Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/vdso/32: Assemble sigreturn.S separately

sigreturn.S was historically included by the various
__kernel_vsyscall implementations due to assumptions about all the
32-bit vDSO images having the sigreturn symbols at the same address.

Those assumptions were removed in v3.16, and as of v4.4, there is only
a single 32-bit vDSO left.

Simplify the build process by assembling sigreturn.S into a normal
object file.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/d7b6dfde3c7397aa26977320da90448363b5a7e9.1465505753.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Andy Lutomirski and committed by
Ingo Molnar
f0702555 99158f10

+4 -16
+3 -2
arch/x86/entry/vdso/Makefile
··· 134 134 override obj-dirs = $(dir $(obj)) $(obj)/vdso32/ 135 135 136 136 targets += vdso32/vdso32.lds 137 - targets += vdso32/note.o vdso32/vclock_gettime.o vdso32/system_call.o 137 + targets += vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o 138 138 targets += vdso32/vclock_gettime.o 139 139 140 140 KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS)) -DBUILD_VDSO ··· 156 156 $(obj)/vdso32/vdso32.lds \ 157 157 $(obj)/vdso32/vclock_gettime.o \ 158 158 $(obj)/vdso32/note.o \ 159 - $(obj)/vdso32/system_call.o 159 + $(obj)/vdso32/system_call.o \ 160 + $(obj)/vdso32/sigreturn.o 160 161 $(call if_changed,vdso) 161 162 162 163 #
-8
arch/x86/entry/vdso/vdso32/sigreturn.S
··· 1 - /* 2 - * Common code for the sigreturn entry points in vDSO images. 3 - * So far this code is the same for both int80 and sysenter versions. 4 - * This file is #include'd by int80.S et al to define them first thing. 5 - * The kernel assumes that the addresses of these routines are constant 6 - * for all vDSO implementations. 7 - */ 8 - 9 1 #include <linux/linkage.h> 10 2 #include <asm/unistd_32.h> 11 3 #include <asm/asm-offsets.h>
+1 -6
arch/x86/entry/vdso/vdso32/system_call.S
··· 2 2 * AT_SYSINFO entry point 3 3 */ 4 4 5 + #include <linux/linkage.h> 5 6 #include <asm/dwarf2.h> 6 7 #include <asm/cpufeatures.h> 7 8 #include <asm/alternative-asm.h> 8 - 9 - /* 10 - * First get the common code for the sigreturn entry points. 11 - * This must come first. 12 - */ 13 - #include "sigreturn.S" 14 9 15 10 .text 16 11 .globl __kernel_vsyscall