OLD | NEW |
---|---|
1 /* Linker script for glibc static linking. | 1 /* Linker script for glibc static linking. |
2 Usage: path_to_sdk/bin/nacl-gcc [usual options] -static | 2 Usage: path_to_sdk/bin/nacl-gcc [usual options] -static |
3 -T path-to-toolchain/x86_64-nacl/lib/ldscripts/elf64_nacl.x.static | 3 -T path-to-toolchain/x86_64-nacl/lib/ldscripts/elf64_nacl.x.static |
4 | 4 |
5 TODO(mseaborn): Make this work with "-static" on its own. | 5 TODO(mseaborn): Make this work with "-static" on its own. |
6 See http://code.google.com/p/nativeclient/issues/detail?id=1198 | 6 See http://code.google.com/p/nativeclient/issues/detail?id=1198 |
7 */ | 7 */ |
8 OUTPUT_FORMAT("elf64-nacl", "elf64-nacl", | 8 OUTPUT_FORMAT("elf64-nacl", "elf64-nacl", |
9 "elf64-nacl") | 9 "elf64-nacl") |
10 OUTPUT_ARCH(i386:x86-64) | 10 OUTPUT_ARCH(i386:x86-64) |
11 ENTRY(_start) | 11 ENTRY(_start) |
12 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); | 12 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); |
13 PHDRS | 13 PHDRS |
14 { | 14 { |
15 headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */ | 15 headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */ |
16 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ | 16 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ |
17 seg_rodata PT_LOAD FLAGS(4) ; /* read */ | 17 seg_rodata PT_LOAD FLAGS(4) ; /* read */ |
18 seg_tls PT_TLS FLAGS(4) ; | 18 seg_tls PT_TLS FLAGS(4) ; |
19 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ | 19 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ |
20 seg_note PT_NOTE FLAGS(4) ; | |
20 } | 21 } |
21 SECTIONS | 22 SECTIONS |
22 { | 23 { |
23 /* Read-only sections, merged into text segment: */ | 24 /* Read-only sections, merged into text segment: */ |
24 PROVIDE (__executable_start = 0x20000); . = 0x20000; | 25 PROVIDE (__executable_start = 0x20000); . = 0x20000; |
25 .plt : { *(.plt) } | 26 .plt : { *(.plt) } |
26 /* I couldn't get ld to add NOP-padding between output sections | 27 /* I couldn't get ld to add NOP-padding between output sections |
27 (only between input sections within an output section), | 28 (only between input sections within an output section), |
28 so I have simply combined .init and .text */ | 29 so I have simply combined .init and .text */ |
29 .text : SUBALIGN(32) | 30 .text : SUBALIGN(32) |
(...skipping 13 matching lines...) Expand all Loading... | |
43 PROVIDE (_etext = .); | 44 PROVIDE (_etext = .); |
44 PROVIDE (etext = .); | 45 PROVIDE (etext = .); |
45 | 46 |
46 . = DEFINED(__nacl_rodata_start) ? __nacl_rodata_start : .; | 47 . = DEFINED(__nacl_rodata_start) ? __nacl_rodata_start : .; |
47 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ | 48 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ |
48 .note.gnu.build-id : | 49 .note.gnu.build-id : |
49 { | 50 { |
50 PROVIDE_HIDDEN (__note_gnu_build_id_start = .); | 51 PROVIDE_HIDDEN (__note_gnu_build_id_start = .); |
51 *(.note.gnu.build-id) | 52 *(.note.gnu.build-id) |
52 PROVIDE_HIDDEN (__note_gnu_build_id_end = .); | 53 PROVIDE_HIDDEN (__note_gnu_build_id_end = .); |
53 } :seg_rodata | 54 } :seg_rodata :seg_note |
54 .hash : { *(.hash) } | 55 .dummy : {} :seg_rodata |
56 .hash : { *(.hash) } | |
Mark Seaborn
2013/08/07 16:43:07
Don't add space at end of line here
bradn
2013/08/07 18:30:02
Done.
| |
55 .gnu.hash : { *(.gnu.hash) } | 57 .gnu.hash : { *(.gnu.hash) } |
56 .dynsym : { *(.dynsym) } | 58 .dynsym : { *(.dynsym) } |
57 .dynstr : { *(.dynstr) } | 59 .dynstr : { *(.dynstr) } |
58 .gnu.version : { *(.gnu.version) } | 60 .gnu.version : { *(.gnu.version) } |
59 .gnu.version_d : { *(.gnu.version_d) } | 61 .gnu.version_d : { *(.gnu.version_d) } |
60 .gnu.version_r : { *(.gnu.version_r) } | 62 .gnu.version_r : { *(.gnu.version_r) } |
61 .rel.init : { *(.rel.init) } | 63 .rel.init : { *(.rel.init) } |
62 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } | 64 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } |
63 .rel.fini : { *(.rel.fini) } | 65 .rel.fini : { *(.rel.fini) } |
64 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } | 66 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 .debug_funcnames 0 : { *(.debug_funcnames) } | 205 .debug_funcnames 0 : { *(.debug_funcnames) } |
204 .debug_typenames 0 : { *(.debug_typenames) } | 206 .debug_typenames 0 : { *(.debug_typenames) } |
205 .debug_varnames 0 : { *(.debug_varnames) } | 207 .debug_varnames 0 : { *(.debug_varnames) } |
206 /* DWARF 3 */ | 208 /* DWARF 3 */ |
207 .debug_pubtypes 0 : { *(.debug_pubtypes) } | 209 .debug_pubtypes 0 : { *(.debug_pubtypes) } |
208 .debug_ranges 0 : { *(.debug_ranges) } | 210 .debug_ranges 0 : { *(.debug_ranges) } |
209 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } | 211 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
210 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } | 212 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } |
211 /DISCARD/ : { *(.note.ABI-tag) } | 213 /DISCARD/ : { *(.note.ABI-tag) } |
212 } | 214 } |
OLD | NEW |