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/elf_nacl.x.static | 3 -T path-to-toolchain/x86_64-nacl/lib/ldscripts/elf_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("elf32-nacl", "elf32-nacl", | 8 OUTPUT_FORMAT("elf32-nacl", "elf32-nacl", |
9 "elf32-nacl") | 9 "elf32-nacl") |
10 OUTPUT_ARCH(i386) | 10 OUTPUT_ARCH(i386) |
11 ENTRY(_start) | 11 ENTRY(_start) |
12 SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"
); | 12 SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"
); |
13 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); | 13 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); |
14 PHDRS | 14 PHDRS |
15 { | 15 { |
16 headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */ | 16 headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */ |
17 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ | 17 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ |
18 seg_rodata PT_LOAD FLAGS(4) ; /* read */ | 18 seg_rodata PT_LOAD FLAGS(4) ; /* read */ |
19 seg_tls PT_TLS FLAGS(4) ; | 19 seg_tls PT_TLS FLAGS(4) ; |
20 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ | 20 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ |
| 21 seg_build_id PT_NOTE FLAGS(4) ; |
21 } | 22 } |
22 SECTIONS | 23 SECTIONS |
23 { | 24 { |
24 /* Read-only sections, merged into text segment: */ | 25 /* Read-only sections, merged into text segment: */ |
25 PROVIDE (__executable_start = 0x20000); . = 0x20000; | 26 PROVIDE (__executable_start = 0x20000); . = 0x20000; |
26 .plt : { *(.plt) } | 27 .plt : { *(.plt) } |
27 /* I couldn't get ld to add NOP-padding between output sections | 28 /* I couldn't get ld to add NOP-padding between output sections |
28 (only between input sections within an output section), | 29 (only between input sections within an output section), |
29 so I have simply combined .init and .text */ | 30 so I have simply combined .init and .text */ |
30 .text : SUBALIGN(32) | 31 .text : SUBALIGN(32) |
(...skipping 13 matching lines...) Expand all Loading... |
44 PROVIDE (_etext = .); | 45 PROVIDE (_etext = .); |
45 PROVIDE (etext = .); | 46 PROVIDE (etext = .); |
46 | 47 |
47 . = DEFINED(__nacl_rodata_start) ? __nacl_rodata_start : .; | 48 . = DEFINED(__nacl_rodata_start) ? __nacl_rodata_start : .; |
48 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ | 49 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */ |
49 .note.gnu.build-id : | 50 .note.gnu.build-id : |
50 { | 51 { |
51 PROVIDE_HIDDEN (__note_gnu_build_id_start = .); | 52 PROVIDE_HIDDEN (__note_gnu_build_id_start = .); |
52 *(.note.gnu.build-id) | 53 *(.note.gnu.build-id) |
53 PROVIDE_HIDDEN (__note_gnu_build_id_end = .); | 54 PROVIDE_HIDDEN (__note_gnu_build_id_end = .); |
54 } :seg_rodata | 55 } :seg_rodata :seg_build_id |
55 .hash : { *(.hash) } | 56 .hash : { *(.hash) } :seg_rodata |
56 .gnu.hash : { *(.gnu.hash) } | 57 .gnu.hash : { *(.gnu.hash) } |
57 .dynsym : { *(.dynsym) } | 58 .dynsym : { *(.dynsym) } |
58 .dynstr : { *(.dynstr) } | 59 .dynstr : { *(.dynstr) } |
59 .gnu.version : { *(.gnu.version) } | 60 .gnu.version : { *(.gnu.version) } |
60 .gnu.version_d : { *(.gnu.version_d) } | 61 .gnu.version_d : { *(.gnu.version_d) } |
61 .gnu.version_r : { *(.gnu.version_r) } | 62 .gnu.version_r : { *(.gnu.version_r) } |
62 .rel.init : { *(.rel.init) } | 63 .rel.init : { *(.rel.init) } |
63 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } | 64 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } |
64 .rel.fini : { *(.rel.fini) } | 65 .rel.fini : { *(.rel.fini) } |
65 .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... |
204 .debug_funcnames 0 : { *(.debug_funcnames) } | 205 .debug_funcnames 0 : { *(.debug_funcnames) } |
205 .debug_typenames 0 : { *(.debug_typenames) } | 206 .debug_typenames 0 : { *(.debug_typenames) } |
206 .debug_varnames 0 : { *(.debug_varnames) } | 207 .debug_varnames 0 : { *(.debug_varnames) } |
207 /* DWARF 3 */ | 208 /* DWARF 3 */ |
208 .debug_pubtypes 0 : { *(.debug_pubtypes) } | 209 .debug_pubtypes 0 : { *(.debug_pubtypes) } |
209 .debug_ranges 0 : { *(.debug_ranges) } | 210 .debug_ranges 0 : { *(.debug_ranges) } |
210 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } | 211 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
211 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } | 212 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } |
212 /DISCARD/ : { *(.note.ABI-tag) } | 213 /DISCARD/ : { *(.note.ABI-tag) } |
213 } | 214 } |
OLD | NEW |