mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 09:41:44 +00:00
1b29f9d13e
This patch from Roland adds a PT_NOTE section to both 32 and 64 bits vDSOs to expose the kernel version to glibc, thus avoiding a uname syscall on every launch. This is equivalent to the patches Roland posted already for x86 and x86-64. Note: the 64 bits .note is actually using the 32 bits format. This is normal. The ELF spec specifies a different format for 64 bits .note, but for some reason, this was never properly implemented, the core dumps for example are all using 32 bits format .note, and binutils cannot even read a 64 bits format .note. Talking to our toolchain folks, they think we'd rather stick to 32 bits format .note everywhere and get the spec fixed some day ... Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
37 lines
969 B
Makefile
37 lines
969 B
Makefile
|
|
# List of files in the vdso, has to be asm only for now
|
|
|
|
obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
|
|
|
|
# Build rules
|
|
|
|
targets := $(obj-vdso32) vdso32.so
|
|
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
|
|
|
|
|
|
EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
|
|
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1
|
|
EXTRA_AFLAGS := -D__VDSO32__ -s
|
|
|
|
obj-y += vdso32_wrapper.o
|
|
extra-y += vdso32.lds
|
|
CPPFLAGS_vdso32.lds += -P -C -U$(ARCH)
|
|
|
|
# Force dependency (incbin is bad)
|
|
$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
|
|
|
|
# link rule for the .so file, .lds has to be first
|
|
$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32)
|
|
$(call if_changed,vdso32ld)
|
|
|
|
# assembly rules for the .S files
|
|
$(obj-vdso32): %.o: %.S
|
|
$(call if_changed_dep,vdso32as)
|
|
|
|
# actual build commands
|
|
quiet_cmd_vdso32ld = VDSO32L $@
|
|
cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $^ -o $@
|
|
quiet_cmd_vdso32as = VDSO32A $@
|
|
cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
|
|
|