diff options
Diffstat (limited to 'arch/x86/vdso/vdso-layout.lds.S')
-rw-r--r-- | arch/x86/vdso/vdso-layout.lds.S | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S index 2ec72f651ebf..9197544eea9a 100644 --- a/arch/x86/vdso/vdso-layout.lds.S +++ b/arch/x86/vdso/vdso-layout.lds.S | |||
@@ -6,6 +6,16 @@ | |||
6 | * This script controls its layout. | 6 | * This script controls its layout. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #if defined(BUILD_VDSO64) | ||
10 | # define SHDR_SIZE 64 | ||
11 | #elif defined(BUILD_VDSO32) || defined(BUILD_VDSOX32) | ||
12 | # define SHDR_SIZE 40 | ||
13 | #else | ||
14 | # error unknown VDSO target | ||
15 | #endif | ||
16 | |||
17 | #define NUM_FAKE_SHDRS 13 | ||
18 | |||
9 | SECTIONS | 19 | SECTIONS |
10 | { | 20 | { |
11 | . = SIZEOF_HEADERS; | 21 | . = SIZEOF_HEADERS; |
@@ -18,36 +28,53 @@ SECTIONS | |||
18 | .gnu.version_d : { *(.gnu.version_d) } | 28 | .gnu.version_d : { *(.gnu.version_d) } |
19 | .gnu.version_r : { *(.gnu.version_r) } | 29 | .gnu.version_r : { *(.gnu.version_r) } |
20 | 30 | ||
31 | .dynamic : { *(.dynamic) } :text :dynamic | ||
32 | |||
33 | .rodata : { | ||
34 | *(.rodata*) | ||
35 | *(.data*) | ||
36 | *(.sdata*) | ||
37 | *(.got.plt) *(.got) | ||
38 | *(.gnu.linkonce.d.*) | ||
39 | *(.bss*) | ||
40 | *(.dynbss*) | ||
41 | *(.gnu.linkonce.b.*) | ||
42 | |||
43 | /* | ||
44 | * Ideally this would live in a C file, but that won't | ||
45 | * work cleanly for x32 until we start building the x32 | ||
46 | * C code using an x32 toolchain. | ||
47 | */ | ||
48 | VDSO_FAKE_SECTION_TABLE_START = .; | ||
49 | . = . + NUM_FAKE_SHDRS * SHDR_SIZE; | ||
50 | VDSO_FAKE_SECTION_TABLE_END = .; | ||
51 | } :text | ||
52 | |||
53 | .fake_shstrtab : { *(.fake_shstrtab) } :text | ||
54 | |||
55 | |||
21 | .note : { *(.note.*) } :text :note | 56 | .note : { *(.note.*) } :text :note |
22 | 57 | ||
23 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 58 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
24 | .eh_frame : { KEEP (*(.eh_frame)) } :text | 59 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
25 | 60 | ||
26 | .dynamic : { *(.dynamic) } :text :dynamic | ||
27 | |||
28 | .rodata : { *(.rodata*) } :text | ||
29 | .data : { | ||
30 | *(.data*) | ||
31 | *(.sdata*) | ||
32 | *(.got.plt) *(.got) | ||
33 | *(.gnu.linkonce.d.*) | ||
34 | *(.bss*) | ||
35 | *(.dynbss*) | ||
36 | *(.gnu.linkonce.b.*) | ||
37 | } | ||
38 | |||
39 | .altinstructions : { *(.altinstructions) } | ||
40 | .altinstr_replacement : { *(.altinstr_replacement) } | ||
41 | 61 | ||
42 | /* | 62 | /* |
43 | * Align the actual code well away from the non-instruction data. | 63 | * Text is well-separated from actual data: there's plenty of |
44 | * This is the best thing for the I-cache. | 64 | * stuff that isn't used at runtime in between. |
45 | */ | 65 | */ |
46 | . = ALIGN(0x100); | ||
47 | 66 | ||
48 | .text : { *(.text*) } :text =0x90909090, | 67 | .text : { *(.text*) } :text =0x90909090, |
49 | 68 | ||
50 | /* | 69 | /* |
70 | * At the end so that eu-elflint stays happy when vdso2c strips | ||
71 | * these. A better implementation would avoid allocating space | ||
72 | * for these. | ||
73 | */ | ||
74 | .altinstructions : { *(.altinstructions) } :text | ||
75 | .altinstr_replacement : { *(.altinstr_replacement) } :text | ||
76 | |||
77 | /* | ||
51 | * The remainder of the vDSO consists of special pages that are | 78 | * The remainder of the vDSO consists of special pages that are |
52 | * shared between the kernel and userspace. It needs to be at the | 79 | * shared between the kernel and userspace. It needs to be at the |
53 | * end so that it doesn't overlap the mapping of the actual | 80 | * end so that it doesn't overlap the mapping of the actual |
@@ -75,6 +102,7 @@ SECTIONS | |||
75 | /DISCARD/ : { | 102 | /DISCARD/ : { |
76 | *(.discard) | 103 | *(.discard) |
77 | *(.discard.*) | 104 | *(.discard.*) |
105 | *(__bug_table) | ||
78 | } | 106 | } |
79 | } | 107 | } |
80 | 108 | ||