1 /* Script for ld -r: link without relocation */
2 OUTPUT_FORMAT("elf32-nacl", "elf32-nacl",
5 /* For some reason, the Solaris linker makes bad executables
6 if gld -r is used and the intermediate file has sections starting
7 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
8 bug. But for now assigning the zero vmas works. */
11 headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */
12 text PT_LOAD FLAGS(5) ; /* read + execute */
13 rodata PT_LOAD FLAGS(4) ; /* read */
14 data PT_LOAD FLAGS(6) ; /* read + write */
15 /* TODO(sehr): do we need a stack? */
19 /* Read-only sections, merged into text segment: */
20 .interp 0 : { *(.interp) }
21 .note.gnu.build-id : { *(.note.gnu.build-id) }
22 .hash 0 : { *(.hash) }
23 .gnu.hash 0 : { *(.gnu.hash) }
24 .dynsym 0 : { *(.dynsym) }
25 .dynstr 0 : { *(.dynstr) }
26 .gnu.version 0 : { *(.gnu.version) }
27 .gnu.version_d 0: { *(.gnu.version_d) }
28 .gnu.version_r 0: { *(.gnu.version_r) }
29 .rel.init 0 : { *(.rel.init) }
30 .rel.text 0 : { *(.rel.text) }
31 .rel.fini 0 : { *(.rel.fini) }
32 .rel.rodata 0 : { *(.rel.rodata) }
33 .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
34 .rel.data 0 : { *(.rel.data) }
35 .rel.tdata 0 : { *(.rel.tdata) }
36 .rel.tbss 0 : { *(.rel.tbss) }
37 .rel.ctors 0 : { *(.rel.ctors) }
38 .rel.dtors 0 : { *(.rel.dtors) }
39 .rel.got 0 : { *(.rel.got) }
40 .rel.bss 0 : { *(.rel.bss) }
41 .rel.ifunc 0 : { *(.rel.ifunc) }
51 .plt 0 : { *(.plt) *(.iplt)}
55 /* .gnu.warning sections are handled specially by elf32.em. */
58 .text.compat 0 : { *(.text.compat) } =0x90909090
59 __libc_freeres_fn 0 : { *(__libc_freeres_fn) } =0x90909090
60 __libc_thread_freeres_fn 0 : { *(__libc_thread_freeres_fn) } =0x90909090
65 /* nacl wants page alignment */
66 .rodata 0 : { *(.rodata) } :rodata
67 .rodata1 0 : { *(.rodata1) }
68 .nacl_rpc_methods : { *(.nacl_rpc_methods) }
69 .eh_frame_hdr : { *(.eh_frame_hdr) }
70 .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
71 .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
72 /* Adjust the address for the data segment. We want to adjust up to
73 the same address within the page on the next page up. */
74 /* Exception handling */
75 .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
76 .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
77 /* Thread Local Storage sections */
78 /* The total size of the TLS template area must be a multiple of 0x20,
79 * but it's size calculation is hardcoded in bfd_elf_final_link function
80 * so the only thing we can do is align segments here properly */
87 /* . does not advance for tbss because it is not loaded. */
90 KEEP (*(.preinit_array))
94 KEEP (*(SORT(.init_array.*)))
100 KEEP (*(SORT(.fini_array.*)))
102 .jcr 0 : { KEEP (*(.jcr)) }
103 .dynamic 0 : { *(.dynamic) }
104 .got 0 : { *(.got) *(.igot) }
105 .got.plt 0 : { *(.got.plt) *(.igot.plt) }
106 /* nacl wants page alignment */
111 .data1 0 : { *(.data1) }
117 /* Align here to ensure that the .bss section occupies space up to
118 _end. Align after .bss to ensure correct alignment even if the
119 .bss section disappears because there are no input sections.
120 FIXME: Why do we need it? When there is no .bss section, we don't
121 pad the .data section. */
123 /* Stabs debugging sections. */
124 .stab 0 : { *(.stab) }
125 .stabstr 0 : { *(.stabstr) }
126 .stab.excl 0 : { *(.stab.excl) }
127 .stab.exclstr 0 : { *(.stab.exclstr) }
128 .stab.index 0 : { *(.stab.index) }
129 .stab.indexstr 0 : { *(.stab.indexstr) }
130 .comment 0 : { *(.comment) }
131 /* DWARF debug sections.
132 Symbols in the DWARF debugging sections are relative to the beginning
133 of the section so we begin them at 0. */
135 .debug 0 : { *(.debug) }
136 .line 0 : { *(.line) }
137 /* GNU DWARF 1 extensions */
138 .debug_srcinfo 0 : { *(.debug_srcinfo) }
139 .debug_sfnames 0 : { *(.debug_sfnames) }
140 /* DWARF 1.1 and DWARF 2 */
141 .debug_aranges 0 : { *(.debug_aranges) }
142 .debug_pubnames 0 : { *(.debug_pubnames) }
144 .debug_info 0 : { *(.debug_info) }
145 .debug_abbrev 0 : { *(.debug_abbrev) }
146 .debug_line 0 : { *(.debug_line) }
147 .debug_frame 0 : { *(.debug_frame) }
148 .debug_str 0 : { *(.debug_str) }
149 .debug_loc 0 : { *(.debug_loc) }
150 .debug_macinfo 0 : { *(.debug_macinfo) }
151 /* SGI/MIPS DWARF 2 extensions */
152 .debug_weaknames 0 : { *(.debug_weaknames) }
153 .debug_funcnames 0 : { *(.debug_funcnames) }
154 .debug_typenames 0 : { *(.debug_typenames) }
155 .debug_varnames 0 : { *(.debug_varnames) }
157 .debug_pubtypes 0 : { *(.debug_pubtypes) }
158 .debug_ranges 0 : { *(.debug_ranges) }
159 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }