diff mbox series

[02/16] elf, uapi: Add definition for STN_UNDEF

Message ID 20250203-parse_vdso-nolibc-v1-2-9cb6268d77be@linutronix.de (mailing list archive)
State New
Headers show
Series selftests: vDSO: parse_vdso: Make compatible with nolibc | expand

Commit Message

Thomas Weißschuh Feb. 3, 2025, 9:05 a.m. UTC
The definition is used by tools/testing/selftests/vDSO/parse_vdso.c.
To be able to build the vDSO selftests without a libc dependency,
add the definition to the kernels own UAPI headers.

Link: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.symtab.html
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 include/uapi/linux/elf.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kees Cook Feb. 4, 2025, 3:32 p.m. UTC | #1
On Mon, Feb 03, 2025 at 10:05:03AM +0100, Thomas Weißschuh wrote:
> The definition is used by tools/testing/selftests/vDSO/parse_vdso.c.
> To be able to build the vDSO selftests without a libc dependency,
> add the definition to the kernels own UAPI headers.
> 
> Link: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.symtab.html
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Kees Cook <kees@kernel.org>
diff mbox series

Patch

diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
index b44069d29cecc0f9de90ee66bfffd2137f4275a8..448695c7364042b10682acc8223eb6053ad039dd 100644
--- a/include/uapi/linux/elf.h
+++ b/include/uapi/linux/elf.h
@@ -125,6 +125,8 @@  typedef __s64	Elf64_Sxword;
 #define STB_GLOBAL 1
 #define STB_WEAK   2
 
+#define STN_UNDEF 0
+
 #define STT_NOTYPE  0
 #define STT_OBJECT  1
 #define STT_FUNC    2