diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-04-03 13:53:43 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-04-03 15:03:59 -0400 |
commit | 378ed3ccd2a0404d031e771b65aa3af221ea8aea (patch) | |
tree | d7ccbfb882b5729f527a302934073b727e0d4fb5 /arch | |
parent | 37c975545ec63320789962bf307f000f08fabd48 (diff) |
x86, vdso: Make the vdso linker script compatible with Gold
Gold can't parse the script due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=16804
With a workaround in place for that issue, Gold 2.23 crashes due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=15355
This works around the former bug and avoids the second by removing
the unnecessary vvar and hpet sections and segments. The vdso and
hpet symbols are still there, and nothing needed the sections or
segments.
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/243fa205098d112ec759c9b1b26785c09f399833.1396547532.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/vdso/vdso-layout.lds.S | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S index 2e263f367b13..9df017ab2285 100644 --- a/arch/x86/vdso/vdso-layout.lds.S +++ b/arch/x86/vdso/vdso-layout.lds.S | |||
@@ -9,12 +9,9 @@ SECTIONS | |||
9 | #ifdef BUILD_VDSO32 | 9 | #ifdef BUILD_VDSO32 |
10 | #include <asm/vdso32.h> | 10 | #include <asm/vdso32.h> |
11 | 11 | ||
12 | .hpet_sect : { | 12 | hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); |
13 | hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); | ||
14 | } :text :hpet_sect | ||
15 | 13 | ||
16 | .vvar_sect : { | 14 | vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); |
17 | vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); | ||
18 | 15 | ||
19 | /* Place all vvars at the offsets in asm/vvar.h. */ | 16 | /* Place all vvars at the offsets in asm/vvar.h. */ |
20 | #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; | 17 | #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; |
@@ -22,7 +19,6 @@ SECTIONS | |||
22 | #include <asm/vvar.h> | 19 | #include <asm/vvar.h> |
23 | #undef __VVAR_KERNEL_LDS | 20 | #undef __VVAR_KERNEL_LDS |
24 | #undef EMIT_VVAR | 21 | #undef EMIT_VVAR |
25 | } :text :vvar_sect | ||
26 | #endif | 22 | #endif |
27 | . = SIZEOF_HEADERS; | 23 | . = SIZEOF_HEADERS; |
28 | 24 | ||
@@ -61,7 +57,12 @@ SECTIONS | |||
61 | */ | 57 | */ |
62 | . = ALIGN(0x100); | 58 | . = ALIGN(0x100); |
63 | 59 | ||
64 | .text : { *(.text*) } :text =0x90909090 | 60 | .text : { *(.text*) } :text =0x90909090, |
61 | |||
62 | /* | ||
63 | * The comma above works around a bug in gold: | ||
64 | * https://sourceware.org/bugzilla/show_bug.cgi?id=16804 | ||
65 | */ | ||
65 | 66 | ||
66 | /DISCARD/ : { | 67 | /DISCARD/ : { |
67 | *(.discard) | 68 | *(.discard) |
@@ -84,8 +85,4 @@ PHDRS | |||
84 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 85 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
85 | note PT_NOTE FLAGS(4); /* PF_R */ | 86 | note PT_NOTE FLAGS(4); /* PF_R */ |
86 | eh_frame_hdr PT_GNU_EH_FRAME; | 87 | eh_frame_hdr PT_GNU_EH_FRAME; |
87 | #ifdef BUILD_VDSO32 | ||
88 | vvar_sect PT_NULL FLAGS(4); /* PF_R */ | ||
89 | hpet_sect PT_NULL FLAGS(4); /* PF_R */ | ||
90 | #endif | ||
91 | } | 88 | } |