From c97db4a0a7d4d5be8c64a8d649a4425ee195b05c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 16 Apr 2005 15:24:48 -0700 Subject: [PATCH] i386 vDSO: add PT_NOTE segment This patch adds an ELF note to the vDSO giving the LINUX_VERSION_CODE value. Having this in the vDSO lets the dynamic linker avoid the `uname' syscall it now always does at startup to ascertain the kernel ABI available. Signed-off-by: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/i386/kernel/vsyscall-note.S | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 arch/i386/kernel/vsyscall-note.S (limited to 'arch/i386/kernel/vsyscall-note.S') diff --git a/arch/i386/kernel/vsyscall-note.S b/arch/i386/kernel/vsyscall-note.S new file mode 100644 index 000000000000..d4b5be4f3d5f --- /dev/null +++ b/arch/i386/kernel/vsyscall-note.S @@ -0,0 +1,25 @@ +/* + * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. + * Here we can supply some information useful to userland. + */ + +#include +#include + +#define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type) \ + .section name, flags; \ + .balign 4; \ + .long 1f - 0f; /* name length */ \ + .long 3f - 2f; /* data length */ \ + .long type; /* note type */ \ +0: .asciz vendor; /* vendor name */ \ +1: .balign 4; \ +2: + +#define ASM_ELF_NOTE_END \ +3: .balign 4; /* pad out section */ \ + .previous + + ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0) + .long LINUX_VERSION_CODE + ASM_ELF_NOTE_END -- cgit v1.2.1