OLD | NEW |
1 /* Default linker script, for normal executables */ | 1 /* Default linker script, for normal executables */ |
2 OUTPUT_FORMAT("elf64-nacl", "elf64-nacl", | 2 OUTPUT_FORMAT("elf64-nacl", "elf64-nacl", |
3 "elf64-nacl") | 3 "elf64-nacl") |
4 OUTPUT_ARCH(i386:x86-64) | 4 OUTPUT_ARCH(i386:x86-64) |
5 ENTRY(_start) | 5 ENTRY(_start) |
6 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); | 6 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); |
7 PHDRS | 7 PHDRS |
8 { | 8 { |
9 seg_interp PT_INTERP FLAGS(4) ; /* read */ | 9 seg_interp PT_INTERP FLAGS(4) ; /* read */ |
10 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ | 10 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ |
11 seg_rodata PT_LOAD FLAGS(4) ; /* read */ | 11 seg_rodata PT_LOAD FLAGS(4) ; /* read */ |
12 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ | 12 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ |
13 seg_bss PT_LOAD FLAGS(6) ; /* read + write */ | 13 seg_bss PT_LOAD FLAGS(6) ; /* read + write */ |
14 seg_dynamic PT_DYNAMIC FLAGS(6) ; | 14 seg_dynamic PT_DYNAMIC FLAGS(6) ; |
15 seg_stack PT_GNU_STACK FLAGS(6) ; | 15 seg_stack PT_GNU_STACK FLAGS(6) ; |
16 seg_tls PT_TLS FLAGS(4) ; | 16 seg_tls PT_TLS FLAGS(4) ; |
17 } | 17 } |
18 SECTIONS | 18 SECTIONS |
19 { | 19 { |
20 PROVIDE (__executable_start = 0x1000000); . = 0x1000000 + SIZEOF_HEADERS; | 20 . = 0x1000000; |
21 . = ALIGN(32); | 21 PROVIDE (__executable_start = .); |
| 22 |
22 /* The ALIGN(32) instructions below are workarounds. | 23 /* The ALIGN(32) instructions below are workarounds. |
23 TODO(mseaborn): Get the object files to include the correct | 24 TODO(mseaborn): Get the object files to include the correct |
24 alignments and padding themselves. | 25 alignments and padding themselves. |
25 See http://code.google.com/p/nativeclient/issues/detail?id=499. */ | 26 See http://code.google.com/p/nativeclient/issues/detail?id=499. */ |
26 .init : | 27 .init : |
27 { | 28 { |
28 KEEP (*(.init)) | 29 KEEP (*(.init)) |
29 . = ALIGN(32); /* ensures NOP fill */ | 30 . = ALIGN(32); /* ensures NOP fill */ |
30 } :seg_code =0x90909090 | 31 } :seg_code =0x90909090 |
31 .plt : { *(.plt) } | 32 .plt : { *(.plt) } |
32 .text : | 33 .text : |
33 { | 34 { |
34 *(.text .stub .text.* .gnu.linkonce.t.*) | 35 *(.text .stub .text.* .gnu.linkonce.t.*) |
35 KEEP (*(.text.*personality*)) | 36 KEEP (*(.text.*personality*)) |
36 /* .gnu.warning sections are handled specially by elf32.em. */ | 37 /* .gnu.warning sections are handled specially by elf32.em. */ |
37 *(.gnu.warning) | 38 *(.gnu.warning) |
38 . = ALIGN(32); /* ensures NOP fill */ | 39 . = ALIGN(32); /* ensures NOP fill */ |
39 } =0x90909090 | 40 } =0x90909090 |
40 .fini : | 41 .fini : |
41 { | 42 { |
42 KEEP (*(.fini)) | 43 KEEP (*(.fini)) |
43 . = ALIGN(32); /* ensures NOP fill */ | 44 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* ensures NOP fill */ |
44 } =0x90909090 | 45 } =0x90909090 |
45 PROVIDE (__etext = .); | 46 PROVIDE (__etext = .); |
46 PROVIDE (_etext = .); | 47 PROVIDE (_etext = .); |
47 PROVIDE (etext = .); | 48 PROVIDE (etext = .); |
48 | 49 |
49 . = 0x11000000 + (. & (CONSTANT (MAXPAGESIZE) - 1)); | 50 . = 0x11000000; |
50 .interp : { *(.interp) } :seg_rodata :seg_interp | 51 .interp : { *(.interp) } :seg_rodata :seg_interp |
51 .note.gnu.build-id : { *(.note.gnu.build-id) } :seg_rodata | 52 .note.gnu.build-id : { *(.note.gnu.build-id) } :seg_rodata |
52 .hash : { *(.hash) } | 53 .hash : { *(.hash) } |
53 .gnu.hash : { *(.gnu.hash) } | 54 .gnu.hash : { *(.gnu.hash) } |
54 .dynsym : { *(.dynsym) } | 55 .dynsym : { *(.dynsym) } |
55 .dynstr : { *(.dynstr) } | 56 .dynstr : { *(.dynstr) } |
56 .gnu.version : { *(.gnu.version) } | 57 .gnu.version : { *(.gnu.version) } |
57 .gnu.version_d : { *(.gnu.version_d) } | 58 .gnu.version_d : { *(.gnu.version_d) } |
58 .gnu.version_r : { *(.gnu.version_r) } | 59 .gnu.version_r : { *(.gnu.version_r) } |
59 .rel.init : { *(.rel.init) } | 60 .rel.init : { *(.rel.init) } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 .debug_typenames 0 : { *(.debug_typenames) } | 233 .debug_typenames 0 : { *(.debug_typenames) } |
233 .debug_varnames 0 : { *(.debug_varnames) } | 234 .debug_varnames 0 : { *(.debug_varnames) } |
234 /* DWARF 3 */ | 235 /* DWARF 3 */ |
235 .debug_pubtypes 0 : { *(.debug_pubtypes) } | 236 .debug_pubtypes 0 : { *(.debug_pubtypes) } |
236 .debug_ranges 0 : { *(.debug_ranges) } | 237 .debug_ranges 0 : { *(.debug_ranges) } |
237 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } | 238 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
238 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } | 239 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } |
239 /DISCARD/ : { *(.note.ABI-tag) } | 240 /DISCARD/ : { *(.note.ABI-tag) } |
240 /DISCARD/ : { *(.interp) } | 241 /DISCARD/ : { *(.interp) } |
241 } | 242 } |
OLD | NEW |