blob: 2e263f367b139c30da34b9e346007e206132955e [file] [log] [blame]
Roland McGrathf6b46eb2008-01-30 13:30:41 +01001/*
2 * Linker script for vDSO. This is an ELF shared object prelinked to
3 * its virtual address, and with only one read-only segment.
4 * This script controls its layout.
5 */
6
7SECTIONS
8{
Stefani Seibold7a59ed42014-03-17 23:22:09 +01009#ifdef BUILD_VDSO32
10#include <asm/vdso32.h>
11
12 .hpet_sect : {
13 hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
14 } :text :hpet_sect
15
16 .vvar_sect : {
17 vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
18
19 /* Place all vvars at the offsets in asm/vvar.h. */
20#define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset;
21#define __VVAR_KERNEL_LDS
22#include <asm/vvar.h>
23#undef __VVAR_KERNEL_LDS
24#undef EMIT_VVAR
25 } :text :vvar_sect
26#endif
Andy Lutomirskib0b49f22014-03-13 16:01:26 -070027 . = SIZEOF_HEADERS;
Roland McGrathf6b46eb2008-01-30 13:30:41 +010028
29 .hash : { *(.hash) } :text
30 .gnu.hash : { *(.gnu.hash) }
31 .dynsym : { *(.dynsym) }
32 .dynstr : { *(.dynstr) }
33 .gnu.version : { *(.gnu.version) }
34 .gnu.version_d : { *(.gnu.version_d) }
35 .gnu.version_r : { *(.gnu.version_r) }
36
37 .note : { *(.note.*) } :text :note
38
39 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
40 .eh_frame : { KEEP (*(.eh_frame)) } :text
41
42 .dynamic : { *(.dynamic) } :text :dynamic
43
44 .rodata : { *(.rodata*) } :text
45 .data : {
46 *(.data*)
47 *(.sdata*)
48 *(.got.plt) *(.got)
49 *(.gnu.linkonce.d.*)
50 *(.bss*)
51 *(.dynbss*)
52 *(.gnu.linkonce.b.*)
53 }
54
55 .altinstructions : { *(.altinstructions) }
56 .altinstr_replacement : { *(.altinstr_replacement) }
57
58 /*
59 * Align the actual code well away from the non-instruction data.
60 * This is the best thing for the I-cache.
61 */
62 . = ALIGN(0x100);
63
64 .text : { *(.text*) } :text =0x90909090
H. Peter Anvin26f5ef22014-03-25 13:41:36 -070065
66 /DISCARD/ : {
67 *(.discard)
68 *(.discard.*)
69 }
Roland McGrathf6b46eb2008-01-30 13:30:41 +010070}
71
72/*
73 * Very old versions of ld do not recognize this name token; use the constant.
74 */
75#define PT_GNU_EH_FRAME 0x6474e550
76
77/*
78 * We must supply the ELF program headers explicitly to get just one
79 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
80 */
81PHDRS
82{
83 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
84 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
85 note PT_NOTE FLAGS(4); /* PF_R */
86 eh_frame_hdr PT_GNU_EH_FRAME;
Stefani Seibold7a59ed42014-03-17 23:22:09 +010087#ifdef BUILD_VDSO32
88 vvar_sect PT_NULL FLAGS(4); /* PF_R */
89 hpet_sect PT_NULL FLAGS(4); /* PF_R */
90#endif
Roland McGrathf6b46eb2008-01-30 13:30:41 +010091}