diff options
Diffstat (limited to 'arch/x86/vdso/vdso.lds.S')
-rw-r--r-- | arch/x86/vdso/vdso.lds.S | 94 |
1 files changed, 26 insertions, 68 deletions
diff --git a/arch/x86/vdso/vdso.lds.S b/arch/x86/vdso/vdso.lds.S index 667d3245d972..4e5dd3b4de7f 100644 --- a/arch/x86/vdso/vdso.lds.S +++ b/arch/x86/vdso/vdso.lds.S | |||
@@ -1,79 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * Linker script for vsyscall DSO. The vsyscall page is an ELF shared | 2 | * Linker script for 64-bit vDSO. |
3 | * object prelinked to its virtual address, and with only one read-only | 3 | * We #include the file to define the layout details. |
4 | * segment (that fits in one page). This script controls its layout. | 4 | * Here we only choose the prelinked virtual address. |
5 | * | ||
6 | * This file defines the version script giving the user-exported symbols in | ||
7 | * the DSO. We can define local symbols here called VDSO* to make their | ||
8 | * values visible using the asm-x86/vdso.h macros from the kernel proper. | ||
5 | */ | 9 | */ |
6 | #include <asm/asm-offsets.h> | ||
7 | #include "voffset.h" | ||
8 | 10 | ||
9 | #define VDSO_PRELINK 0xffffffffff700000 | 11 | #define VDSO_PRELINK 0xffffffffff700000 |
10 | 12 | #include "vdso-layout.lds.S" | |
11 | SECTIONS | ||
12 | { | ||
13 | . = VDSO_PRELINK + SIZEOF_HEADERS; | ||
14 | |||
15 | .hash : { *(.hash) } :text | ||
16 | .gnu.hash : { *(.gnu.hash) } | ||
17 | .dynsym : { *(.dynsym) } | ||
18 | .dynstr : { *(.dynstr) } | ||
19 | .gnu.version : { *(.gnu.version) } | ||
20 | .gnu.version_d : { *(.gnu.version_d) } | ||
21 | .gnu.version_r : { *(.gnu.version_r) } | ||
22 | |||
23 | /* This linker script is used both with -r and with -shared. | ||
24 | For the layouts to match, we need to skip more than enough | ||
25 | space for the dynamic symbol table et al. If this amount | ||
26 | is insufficient, ld -shared will barf. Just increase it here. */ | ||
27 | . = VDSO_PRELINK + VDSO_TEXT_OFFSET; | ||
28 | |||
29 | .text : { *(.text*) } :text | ||
30 | .rodata : { *(.rodata*) } :text | ||
31 | .data : { | ||
32 | *(.data*) | ||
33 | *(.sdata*) | ||
34 | *(.bss*) | ||
35 | *(.dynbss*) | ||
36 | } :text | ||
37 | |||
38 | .altinstructions : { *(.altinstructions) } :text | ||
39 | .altinstr_replacement : { *(.altinstr_replacement) } :text | ||
40 | |||
41 | .note : { *(.note.*) } :text :note | ||
42 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | ||
43 | .eh_frame : { KEEP (*(.eh_frame)) } :text | ||
44 | .dynamic : { *(.dynamic) } :text :dynamic | ||
45 | .useless : { | ||
46 | *(.got.plt) *(.got) | ||
47 | *(.gnu.linkonce.d.*) | ||
48 | *(.gnu.linkonce.b.*) | ||
49 | } :text | ||
50 | } | ||
51 | 13 | ||
52 | /* | 14 | /* |
53 | * We must supply the ELF program headers explicitly to get just one | 15 | * This controls what userland symbols we export from the vDSO. |
54 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | ||
55 | */ | 16 | */ |
56 | PHDRS | 17 | VERSION { |
57 | { | 18 | LINUX_2.6 { |
58 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 19 | global: |
59 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 20 | clock_gettime; |
60 | note PT_NOTE FLAGS(4); /* PF_R */ | 21 | __vdso_clock_gettime; |
61 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 22 | gettimeofday; |
23 | __vdso_gettimeofday; | ||
24 | getcpu; | ||
25 | __vdso_getcpu; | ||
26 | local: *; | ||
27 | }; | ||
62 | } | 28 | } |
63 | 29 | ||
30 | VDSO64_PRELINK = VDSO_PRELINK; | ||
31 | |||
64 | /* | 32 | /* |
65 | * This controls what symbols we export from the DSO. | 33 | * Define VDSO64_x for each VEXTERN(x), for use via VDSO64_SYMBOL. |
66 | */ | 34 | */ |
67 | VERSION | 35 | #define VEXTERN(x) VDSO64_ ## x = vdso_ ## x; |
68 | { | 36 | #include "vextern.h" |
69 | LINUX_2.6 { | 37 | #undef VEXTERN |
70 | global: | ||
71 | clock_gettime; | ||
72 | __vdso_clock_gettime; | ||
73 | gettimeofday; | ||
74 | __vdso_gettimeofday; | ||
75 | getcpu; | ||
76 | __vdso_getcpu; | ||
77 | local: *; | ||
78 | }; | ||
79 | } | ||