Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / arch / x86 / vdso / vdso-layout.lds.S
1 #include <asm/vdso.h>
2
3 /*
4  * Linker script for vDSO.  This is an ELF shared object prelinked to
5  * its virtual address, and with only one read-only segment.
6  * This script controls its layout.
7  */
8
9 SECTIONS
10 {
11         . = SIZEOF_HEADERS;
12
13         .hash           : { *(.hash) }                  :text
14         .gnu.hash       : { *(.gnu.hash) }
15         .dynsym         : { *(.dynsym) }
16         .dynstr         : { *(.dynstr) }
17         .gnu.version    : { *(.gnu.version) }
18         .gnu.version_d  : { *(.gnu.version_d) }
19         .gnu.version_r  : { *(.gnu.version_r) }
20
21         .note           : { *(.note.*) }                :text   :note
22
23         .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text   :eh_frame_hdr
24         .eh_frame       : { KEEP (*(.eh_frame)) }       :text
25
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
42         /*
43          * Align the actual code well away from the non-instruction data.
44          * This is the best thing for the I-cache.
45          */
46         . = ALIGN(0x100);
47
48         .text           : { *(.text*) }                 :text   =0x90909090,
49
50         /*
51          * The remainder of the vDSO consists of special pages that are
52          * 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
54          * vDSO image.
55          */
56
57         . = ALIGN(PAGE_SIZE);
58         vvar_page = .;
59
60         /* Place all vvars at the offsets in asm/vvar.h. */
61 #define EMIT_VVAR(name, offset) vvar_ ## name = vvar_page + offset;
62 #define __VVAR_KERNEL_LDS
63 #include <asm/vvar.h>
64 #undef __VVAR_KERNEL_LDS
65 #undef EMIT_VVAR
66
67         . = vvar_page + PAGE_SIZE;
68
69         hpet_page = .;
70         . = . + PAGE_SIZE;
71
72         . = ALIGN(PAGE_SIZE);
73         end_mapping = .;
74
75         /DISCARD/ : {
76                 *(.discard)
77                 *(.discard.*)
78         }
79 }
80
81 /*
82  * Very old versions of ld do not recognize this name token; use the constant.
83  */
84 #define PT_GNU_EH_FRAME 0x6474e550
85
86 /*
87  * We must supply the ELF program headers explicitly to get just one
88  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
89  */
90 PHDRS
91 {
92         text            PT_LOAD         FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
93         dynamic         PT_DYNAMIC      FLAGS(4);               /* PF_R */
94         note            PT_NOTE         FLAGS(4);               /* PF_R */
95         eh_frame_hdr    PT_GNU_EH_FRAME;
96 }