1 /* Script for ld -pie: link position independent executable */
2 OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux",
6 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
9 /* Read-only sections, merged into text segment: */
10 . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
11 .interp : { *(.interp) }
12 .note.gnu.build-id : { *(.note.gnu.build-id) }
14 .gnu.hash : { *(.gnu.hash) }
15 .dynsym : { *(.dynsym) }
16 .dynstr : { *(.dynstr) }
17 .gnu.version : { *(.gnu.version) }
18 .gnu.version_d : { *(.gnu.version_d) }
19 .gnu.version_r : { *(.gnu.version_r) }
20 .rela.init : { *(.rela.init) }
21 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
22 .rela.fini : { *(.rela.fini) }
23 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
24 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
25 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
26 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
27 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
28 .rela.ctors : { *(.rela.ctors) }
29 .rela.dtors : { *(.rela.dtors) }
30 .rela.got : { *(.rela.got) }
31 .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
32 .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
33 .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
34 .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
35 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
36 .rela.plt : { *(.rela.plt) }
44 *(.text .stub .text.* .gnu.linkonce.t.*)
45 /* .gnu.warning sections are handled specially by elf32.em. */
52 PROVIDE (__etext = .);
55 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
56 .rodata1 : { *(.rodata1) }
59 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
61 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
62 .eh_frame_hdr : { *(.eh_frame_hdr) }
63 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
64 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
65 /* Adjust the address for the data segment. We want to adjust up to
66 the same address within the page on the next page up. */
67 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
68 /* Exception handling */
69 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
70 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
71 /* Thread Local Storage sections */
72 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
73 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
76 PROVIDE_HIDDEN (__preinit_array_start = .);
77 KEEP (*(.preinit_array))
78 PROVIDE_HIDDEN (__preinit_array_end = .);
82 PROVIDE_HIDDEN (__init_array_start = .);
83 KEEP (*(SORT(.init_array.*)))
85 PROVIDE_HIDDEN (__init_array_end = .);
89 PROVIDE_HIDDEN (__fini_array_start = .);
91 KEEP (*(SORT(.fini_array.*)))
92 PROVIDE_HIDDEN (__fini_array_end = .);
96 /* gcc uses crtbegin.o to find the start of
97 the constructors, so we make sure it is
98 first. Because this is a wildcard, it
99 doesn't matter if the user does not
100 actually link against crtbegin.o; the
101 linker won't look for a file to match a
102 wildcard. The wildcard also means that it
103 doesn't matter which directory crtbegin.o
105 KEEP (*crtbegin.o(.ctors))
106 KEEP (*crtbegin?.o(.ctors))
107 /* We don't want to include the .ctor section from
108 the crtend.o file until after the sorted ctors.
109 The .ctor section from the crtend file contains the
110 end of ctors marker and it must be last */
111 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
112 KEEP (*(SORT(.ctors.*)))
117 KEEP (*crtbegin.o(.dtors))
118 KEEP (*crtbegin?.o(.dtors))
119 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
120 KEEP (*(SORT(.dtors.*)))
123 .jcr : { KEEP (*(.jcr)) }
124 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
125 .dynamic : { *(.dynamic) }
126 . = DATA_SEGMENT_RELRO_END (0, .);
129 PROVIDE (__data_start = .);
130 *(.data .data.* .gnu.linkonce.d.*)
133 .data1 : { *(.data1) }
134 .note.ABI-tag : { *(.note.ABI-tag) }
135 .got : { *(.got.plt) *(.got) }
136 /* We want the small data sections together, so single-instruction offsets
137 can access them all, and initialized data all before uninitialized, so
138 we can shorten the on-disk segment size. */
141 *(.sdata .sdata.* .gnu.linkonce.s.*)
143 _edata = .; PROVIDE (edata = .);
148 *(.sbss .sbss.* .gnu.linkonce.sb.*)
154 *(.bss .bss.* .gnu.linkonce.b.*)
156 /* Align here to ensure that the .bss section occupies space up to
157 _end. Align after .bss to ensure correct alignment even if the
158 .bss section disappears because there are no input sections.
159 FIXME: Why do we need it? When there is no .bss section, we don't
160 pad the .data section. */
161 . = ALIGN(. != 0 ? 32 / 8 : 1);
165 _end = .; PROVIDE (end = .);
166 . = DATA_SEGMENT_END (.);
167 /* Stabs debugging sections. */
168 .stab 0 : { *(.stab) }
169 .stabstr 0 : { *(.stabstr) }
170 .stab.excl 0 : { *(.stab.excl) }
171 .stab.exclstr 0 : { *(.stab.exclstr) }
172 .stab.index 0 : { *(.stab.index) }
173 .stab.indexstr 0 : { *(.stab.indexstr) }
174 .comment 0 : { *(.comment) }
175 /* DWARF debug sections.
176 Symbols in the DWARF debugging sections are relative to the beginning
177 of the section so we begin them at 0. */
179 .debug 0 : { *(.debug) }
180 .line 0 : { *(.line) }
181 /* GNU DWARF 1 extensions */
182 .debug_srcinfo 0 : { *(.debug_srcinfo) }
183 .debug_sfnames 0 : { *(.debug_sfnames) }
184 /* DWARF 1.1 and DWARF 2 */
185 .debug_aranges 0 : { *(.debug_aranges) }
186 .debug_pubnames 0 : { *(.debug_pubnames) }
188 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
189 .debug_abbrev 0 : { *(.debug_abbrev) }
190 .debug_line 0 : { *(.debug_line) }
191 .debug_frame 0 : { *(.debug_frame) }
192 .debug_str 0 : { *(.debug_str) }
193 .debug_loc 0 : { *(.debug_loc) }
194 .debug_macinfo 0 : { *(.debug_macinfo) }
195 /* SGI/MIPS DWARF 2 extensions */
196 .debug_weaknames 0 : { *(.debug_weaknames) }
197 .debug_funcnames 0 : { *(.debug_funcnames) }
198 .debug_typenames 0 : { *(.debug_typenames) }
199 .debug_varnames 0 : { *(.debug_varnames) }
201 .debug_pubtypes 0 : { *(.debug_pubtypes) }
202 .debug_ranges 0 : { *(.debug_ranges) }
203 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
204 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }