aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/vdso/Makefile
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-06-12 20:53:12 -0400
committerH. Peter Anvin <hpa@zytor.com>2014-06-12 22:02:30 -0400
commite0bf7b86dace87eccdabdd66d2769ccad19cb81c (patch)
tree25ca13ba0e165ab1d16faf266d4b8d8046b7a5f7 /arch/x86/vdso/Makefile
parentb4b31f6101433e4b8ee73779b69b935af07682f8 (diff)
x86/vdso: Hack to keep 64-bit Go programs working
The Go runtime has a buggy vDSO parser that currently segfaults. This writes an empty SHT_DYNSYM entry that causes Go's runtime to malfunction by thinking that the vDSO is empty rather than malfunctioning by running off the end and segfaulting. This affects x86-64 only as far as we know, so we do not need this for the i386 and x32 vdsos. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Link: http://lkml.kernel.org/r/d10618176c4bd39b457a5e85c497295c90cab1bc.1402620737.git.luto@amacapital.net Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/vdso/Makefile')
-rw-r--r--arch/x86/vdso/Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 9769df094035..ba6fc2757ee4 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -15,12 +15,8 @@ vdso-install-$(VDSO32-y) += $(vdso32-images)
15 15
16 16
17# files to link into the vdso 17# files to link into the vdso
18vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o 18vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vdso-fakesections.o
19 19vobjs-nox32 := vdso-fakesections.o
20vobjs-$(VDSOX32-y) += $(vobjx32s-compat)
21
22# Filter out x32 objects.
23vobj64s := $(filter-out $(vobjx32s-compat),$(vobjs-y))
24 20
25# files to link into kernel 21# files to link into kernel
26obj-y += vma.o 22obj-y += vma.o
@@ -34,7 +30,7 @@ vdso_img-$(VDSO32-y) += 32-sysenter
34 30
35obj-$(VDSO32-y) += vdso32-setup.o 31obj-$(VDSO32-y) += vdso32-setup.o
36 32
37vobjs := $(foreach F,$(vobj64s),$(obj)/$F) 33vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
38 34
39$(obj)/vdso.o: $(obj)/vdso.so 35$(obj)/vdso.o: $(obj)/vdso.so
40 36
@@ -104,7 +100,13 @@ VDSO_LDFLAGS_vdsox32.lds = -Wl,-m,elf32_x86_64 \
104 -Wl,-z,max-page-size=4096 \ 100 -Wl,-z,max-page-size=4096 \
105 -Wl,-z,common-page-size=4096 101 -Wl,-z,common-page-size=4096
106 102
107vobjx32s-y := $(vobj64s:.o=-x32.o) 103# 64-bit objects to re-brand as x32
104vobjs64-for-x32 := $(filter-out $(vobjs-nox32),$(vobjs-y))
105
106# x32-rebranded versions
107vobjx32s-y := $(vobjs64-for-x32:.o=-x32.o)
108
109# same thing, but in the output directory
108vobjx32s := $(foreach F,$(vobjx32s-y),$(obj)/$F) 110vobjx32s := $(foreach F,$(vobjx32s-y),$(obj)/$F)
109 111
110# Convert 64bit object file to x32 for x32 vDSO. 112# Convert 64bit object file to x32 for x32 vDSO.