diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-06-12 20:53:12 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2014-06-12 22:02:30 -0400 |
commit | e0bf7b86dace87eccdabdd66d2769ccad19cb81c (patch) | |
tree | 25ca13ba0e165ab1d16faf266d4b8d8046b7a5f7 /arch/x86/vdso/Makefile | |
parent | b4b31f6101433e4b8ee73779b69b935af07682f8 (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/Makefile | 18 |
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 |
18 | vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o | 18 | vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vdso-fakesections.o |
19 | 19 | vobjs-nox32 := vdso-fakesections.o | |
20 | vobjs-$(VDSOX32-y) += $(vobjx32s-compat) | ||
21 | |||
22 | # Filter out x32 objects. | ||
23 | vobj64s := $(filter-out $(vobjx32s-compat),$(vobjs-y)) | ||
24 | 20 | ||
25 | # files to link into kernel | 21 | # files to link into kernel |
26 | obj-y += vma.o | 22 | obj-y += vma.o |
@@ -34,7 +30,7 @@ vdso_img-$(VDSO32-y) += 32-sysenter | |||
34 | 30 | ||
35 | obj-$(VDSO32-y) += vdso32-setup.o | 31 | obj-$(VDSO32-y) += vdso32-setup.o |
36 | 32 | ||
37 | vobjs := $(foreach F,$(vobj64s),$(obj)/$F) | 33 | vobjs := $(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 | ||
107 | vobjx32s-y := $(vobj64s:.o=-x32.o) | 103 | # 64-bit objects to re-brand as x32 |
104 | vobjs64-for-x32 := $(filter-out $(vobjs-nox32),$(vobjs-y)) | ||
105 | |||
106 | # x32-rebranded versions | ||
107 | vobjx32s-y := $(vobjs64-for-x32:.o=-x32.o) | ||
108 | |||
109 | # same thing, but in the output directory | ||
108 | vobjx32s := $(foreach F,$(vobjx32s-y),$(obj)/$F) | 110 | vobjx32s := $(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. |