* emulparams/elf32ms1.sh: New.
[deliverable/binutils-gdb.git] / ld / scripttempl / elf.sc
CommitLineData
252b5132
RH
1#
2# Unusual variables checked by this code:
563e308f 3# NOP - four byte opcode for no-op (defaults to 0)
48459341
L
4# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
5# empty.
951e9133
L
6# SMALL_DATA_CTOR - .ctors contains small data.
7# SMALL_DATA_DTOR - .dtors contains small data.
252b5132
RH
8# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
9# INITIAL_READONLY_SECTIONS - at start of text segment
10# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
11# (e.g., .PARISC.milli)
12# OTHER_TEXT_SECTIONS - these get put in .text when relocating
13# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
14# (e.g., .PARISC.global)
8c37241b
JJ
15# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
16# (e.g. PPC32 .fixup, .got[12])
904ecb2d 17# OTHER_BSS_SECTIONS - other than .bss .sbss ...
252b5132
RH
18# OTHER_SECTIONS - at the end
19# EXECUTABLE_SYMBOLS - symbols that must be defined for an
20# executable (e.g., _DYNAMIC_LINK)
ba916c8a
MM
21# TEXT_START_ADDR - the first byte of the text segment, after any
22# headers.
23# TEXT_BASE_ADDRESS - the first byte of the text segment.
252b5132
RH
24# TEXT_START_SYMBOLS - symbols that appear at the start of the
25# .text section.
26# DATA_START_SYMBOLS - symbols that appear at the start of the
27# .data section.
eac338cf
PB
28# DATA_END_SYMBOLS - symbols that appear at the end of the
29# writeable data sections.
252b5132 30# OTHER_GOT_SYMBOLS - symbols defined just before .got.
5253f23b
AM
31# OTHER_GOT_SECTIONS - sections just after .got.
32# OTHER_SDATA_SECTIONS - sections just after .sdata.
252b5132
RH
33# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
34# .bss section besides __bss_start.
35# DATA_PLT - .plt should be in data segment, not text segment.
b71a5181 36# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
6c86c541 37# BSS_PLT - .plt should be in bss segment
252b5132
RH
38# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
39# EMBEDDED - whether this is for an embedded system.
40# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
41# start address of shared library.
42# INPUT_FILES - INPUT command of files to always include
a8e53fb0 43# WRITABLE_RODATA - if set, the .rodata section should be writable
904ecb2d
JL
44# INIT_START, INIT_END - statements just before and just after
45# combination of .init sections.
46# FINI_START, FINI_END - statements just before and just after
47# combination of .fini sections.
465bc359
AM
48# STACK_ADDR - start of a .stack section.
49# OTHER_END_SYMBOLS - symbols to place right at the end of the script.
eac338cf
PB
50# ETEXT_NAME - name of a symbol for the end of the text section,
51# normally etext.
8c37241b
JJ
52# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
53# so that .got can be in the RELRO area. It should be set to
54# the number of bytes in the beginning of .got.plt which can be
55# in the RELRO area as well.
252b5132
RH
56#
57# When adding sections, do note that the names of some sections are used
58# when specifying the start address of the next.
59#
60
d73e9da0
AS
61# Many sections come in three flavours. There is the 'real' section,
62# like ".data". Then there are the per-procedure or per-variable
63# sections, generated by -ffunction-sections and -fdata-sections in GCC,
64# and useful for --gc-sections, which for a variable "foo" might be
65# ".data.foo". Then there are the linkonce sections, for which the linker
66# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
67# The exact correspondences are:
68#
69# Section Linkonce section
70# .text .gnu.linkonce.t.foo
71# .rodata .gnu.linkonce.r.foo
72# .data .gnu.linkonce.d.foo
73# .bss .gnu.linkonce.b.foo
74# .sdata .gnu.linkonce.s.foo
75# .sbss .gnu.linkonce.sb.foo
76# .sdata2 .gnu.linkonce.s2.foo
77# .sbss2 .gnu.linkonce.sb2.foo
465bc359 78# .debug_info .gnu.linkonce.wi.foo
13ae64f3
JJ
79# .tdata .gnu.linkonce.td.foo
80# .tbss .gnu.linkonce.tb.foo
d73e9da0
AS
81#
82# Each of these can also have corresponding .rel.* and .rela.* sections.
9ac4db9c 83
252b5132
RH
84test -z "$ENTRY" && ENTRY=_start
85test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
86test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
87if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
88test -z "${ELFSIZE}" && ELFSIZE=32
89test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
90test "$LD_FLAG" = "N" && DATA_ADDR=.
eac338cf 91test -z "${ETEXT_NAME}" && ETEXT_NAME=etext
9203ba99
JJ
92test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
93test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
8c37241b 94test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
1ddd7b13 95DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
8c37241b 96DATA_SEGMENT_RELRO_END=""
2d13d8c5
JJ
97DATA_SEGMENT_END=""
98if test -n "${COMMONPAGESIZE}"; then
1ddd7b13 99 DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
2d13d8c5 100 DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
4ca02259 101 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
2d20f7bf 102fi
465bc359 103INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
0cf7d72c
AM
104if test -z "$PLT"; then
105 PLT=".plt ${RELOCATING-0} : { *(.plt) }"
106fi
8d6d53d4 107test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
8c37241b
JJ
108if test -z "$GOT"; then
109 if test -z "$SEPARATE_GOTPLT"; then
110 GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
111 else
112 GOT=".got ${RELOCATING-0} : { *(.got) }"
4ca02259 113 GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
8c37241b
JJ
114 fi
115fi
465bc359
AM
116DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
117RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
8c37241b 118DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
9ee5e499 119STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
48459341
L
120if test -z "${NO_SMALL_DATA}"; then
121 SBSS=".sbss ${RELOCATING-0} :
122 {
0fb53118 123 ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
48459341
L
124 *(.dynsbss)
125 *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
126 *(.scommon)
48459341
L
127 }"
128 SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
129 SDATA="/* We want the small data sections together, so single-instruction offsets
130 can access them all, and initialized data all before uninitialized, so
131 we can shorten the on-disk segment size. */
132 .sdata ${RELOCATING-0} :
133 {
134 ${RELOCATING+${SDATA_START_SYMBOLS}}
0fb53118 135 ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
48459341
L
136 *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
137 }"
138 SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
139 REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
140 .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
141 REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
142 .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
143 REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
144 .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
145 REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
146 .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
8c37241b
JJ
147else
148 NO_SMALL_DATA=" "
48459341 149fi
0cf7d72c
AM
150if test -z "${DATA_GOT}"; then
151 if test -n "${NO_SMALL_DATA}"; then
152 DATA_GOT=" "
153 fi
154fi
155if test -z "${SDATA_GOT}"; then
156 if test -z "${NO_SMALL_DATA}"; then
157 SDATA_GOT=" "
158 fi
159fi
8c37241b 160test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
465bc359 161CTOR=".ctors ${CONSTRUCTING-0} :
252b5132
RH
162 {
163 ${CONSTRUCTING+${CTOR_START}}
164 /* gcc uses crtbegin.o to find the start of
165 the constructors, so we make sure it is
166 first. Because this is a wildcard, it
167 doesn't matter if the user does not
168 actually link against crtbegin.o; the
169 linker won't look for a file to match a
170 wildcard. The wildcard also means that it
171 doesn't matter which directory crtbegin.o
172 is in. */
173
877d60f7 174 KEEP (*crtbegin*.o(.ctors))
252b5132
RH
175
176 /* We don't want to include the .ctor section from
177 from the crtend.o file until after the sorted ctors.
178 The .ctor section from the crtend file contains the
179 end of ctors marker and it must be last */
180
877d60f7 181 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
252b5132
RH
182 KEEP (*(SORT(.ctors.*)))
183 KEEP (*(.ctors))
184 ${CONSTRUCTING+${CTOR_END}}
185 }"
465bc359 186DTOR=".dtors ${CONSTRUCTING-0} :
252b5132
RH
187 {
188 ${CONSTRUCTING+${DTOR_START}}
877d60f7
AM
189 KEEP (*crtbegin*.o(.dtors))
190 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
252b5132
RH
191 KEEP (*(SORT(.dtors.*)))
192 KEEP (*(.dtors))
193 ${CONSTRUCTING+${DTOR_END}}
194 }"
465bc359
AM
195STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
196 {
197 ${RELOCATING+_stack = .;}
198 *(.stack)
199 }"
252b5132
RH
200
201# if this is for an embedded system, don't add SIZEOF_HEADERS.
202if [ -z "$EMBEDDED" ]; then
203 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
204else
205 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
206fi
207
208cat <<EOF
209OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
210 "${LITTLE_OUTPUT_FORMAT}")
211OUTPUT_ARCH(${OUTPUT_ARCH})
212ENTRY(${ENTRY})
213
214${RELOCATING+${LIB_SEARCH_DIRS}}
215${RELOCATING+/* Do we need any of these for elf?
216 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
217${RELOCATING+${EXECUTABLE_SYMBOLS}}
218${RELOCATING+${INPUT_FILES}}
219${RELOCATING- /* For some reason, the Solaris linker makes bad executables
220 if gld -r is used and the intermediate file has sections starting
221 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
222 bug. But for now assigning the zero vmas works. */}
223
224SECTIONS
225{
226 /* Read-only sections, merged into text segment: */
c6d3b05f 227 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
252b5132 228 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
36af4a4e 229 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
252b5132
RH
230 ${CREATE_SHLIB-${INTERP}}
231 ${INITIAL_READONLY_SECTIONS}
232 ${TEXT_DYNAMIC+${DYNAMIC}}
465bc359
AM
233 .hash ${RELOCATING-0} : { *(.hash) }
234 .dynsym ${RELOCATING-0} : { *(.dynsym) }
235 .dynstr ${RELOCATING-0} : { *(.dynstr) }
236 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
237 .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
238 .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
9e4141bc 239
db6751f2
JJ
240EOF
241if [ "x$COMBRELOC" = x ]; then
242 COMBRELOCCAT=cat
243else
244 COMBRELOCCAT="cat > $COMBRELOC"
245fi
246eval $COMBRELOCCAT <<EOF
465bc359
AM
247 .rel.init ${RELOCATING-0} : { *(.rel.init) }
248 .rela.init ${RELOCATING-0} : { *(.rela.init) }
249 .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
250 .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
251 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
252 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
253 .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
254 .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
9e4141bc 255 ${OTHER_READONLY_RELOC_SECTIONS}
8c37241b
JJ
256 .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
257 .rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
465bc359
AM
258 .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
259 .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
13ae64f3
JJ
260 .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
261 .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
262 .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
263 .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
465bc359
AM
264 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
265 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
266 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
267 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
268 .rel.got ${RELOCATING-0} : { *(.rel.got) }
269 .rela.got ${RELOCATING-0} : { *(.rela.got) }
9e4141bc 270 ${OTHER_GOT_RELOC_SECTIONS}
48459341
L
271 ${REL_SDATA}
272 ${REL_SBSS}
273 ${REL_SDATA2}
274 ${REL_SBSS2}
465bc359
AM
275 .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
276 .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
db6751f2
JJ
277EOF
278if [ -n "$COMBRELOC" ]; then
279cat <<EOF
465bc359 280 .rel.dyn ${RELOCATING-0} :
db6751f2
JJ
281 {
282EOF
283sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
284cat <<EOF
285 }
465bc359 286 .rela.dyn ${RELOCATING-0} :
db6751f2
JJ
287 {
288EOF
289sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
290cat <<EOF
291 }
292EOF
293fi
294cat <<EOF
465bc359
AM
295 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
296 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
9e673ad1 297 ${OTHER_PLT_RELOC_SECTIONS}
9e4141bc 298
465bc359 299 .init ${RELOCATING-0} :
4ab10e93 300 {
53db15ed 301 ${RELOCATING+${INIT_START}}
4ab10e93 302 KEEP (*(.init))
53db15ed 303 ${RELOCATING+${INIT_END}}
4ab10e93
GK
304 } =${NOP-0}
305
8d6d53d4 306 ${TEXT_PLT+${PLT}}
465bc359 307 .text ${RELOCATING-0} :
252b5132
RH
308 {
309 ${RELOCATING+${TEXT_START_SYMBOLS}}
465bc359 310 *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
a85bf78e 311 KEEP (*(.text.*personality*))
252b5132
RH
312 /* .gnu.warning sections are handled specially by elf32.em. */
313 *(.gnu.warning)
252b5132
RH
314 ${RELOCATING+${OTHER_TEXT_SECTIONS}}
315 } =${NOP-0}
465bc359 316 .fini ${RELOCATING-0} :
904ecb2d 317 {
53db15ed 318 ${RELOCATING+${FINI_START}}
904ecb2d 319 KEEP (*(.fini))
53db15ed 320 ${RELOCATING+${FINI_END}}
904ecb2d 321 } =${NOP-0}
eac338cf
PB
322 ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
323 ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
324 ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
a8e53fb0 325 ${WRITABLE_RODATA-${RODATA}}
465bc359 326 .rodata1 ${RELOCATING-0} : { *(.rodata1) }
6c86c541
GK
327 ${CREATE_SHLIB-${SDATA2}}
328 ${CREATE_SHLIB-${SBSS2}}
465bc359 329 ${OTHER_READONLY_SECTIONS}
65765700 330 .eh_frame_hdr : { *(.eh_frame_hdr) }
0841712e 331 .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
dfff4fbe 332 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
252b5132
RH
333
334 /* Adjust the address for the data segment. We want to adjust up to
335 the same address within the page on the next page up. */
9203ba99 336 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
2d20f7bf 337 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
9203ba99 338 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
252b5132 339
8c37241b 340 /* Exception handling */
0841712e 341 .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
dfff4fbe 342 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
8c37241b
JJ
343
344 /* Thread Local Storage sections */
345 .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
346 .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
347
7b89fa29 348 .preinit_array ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
7b89fa29 349 .init_array ${RELOCATING-0} : { KEEP (*(.init_array)) }
7b89fa29 350 .fini_array ${RELOCATING-0} : { KEEP (*(.fini_array)) }
b5090659 351
951e9133
L
352 ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
353 ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
8c37241b
JJ
354 .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
355
356 ${RELOCATING+${DATARELRO}}
357 ${OTHER_RELRO_SECTIONS}
358 ${TEXT_DYNAMIC-${DYNAMIC}}
0cf7d72c
AM
359 ${DATA_GOT+${RELRO_NOW+${GOT}}}
360 ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
361 ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
8c37241b 362 ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
0cf7d72c
AM
363 ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
364 ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
8c37241b 365
b71a5181 366 ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
8c37241b 367
465bc359 368 .data ${RELOCATING-0} :
252b5132
RH
369 {
370 ${RELOCATING+${DATA_START_SYMBOLS}}
465bc359 371 *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
a85bf78e 372 KEEP (*(.gnu.linkonce.d.*personality*))
252b5132
RH
373 ${CONSTRUCTING+SORT(CONSTRUCTORS)}
374 }
465bc359 375 .data1 ${RELOCATING-0} : { *(.data1) }
a8e53fb0 376 ${WRITABLE_RODATA+${RODATA}}
465bc359 377 ${OTHER_READWRITE_SECTIONS}
951e9133
L
378 ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
379 ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
b71a5181 380 ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
0cf7d72c
AM
381 ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}}
382 ${SDATA_GOT+${GOT}}
383 ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
48459341 384 ${SDATA}
465bc359 385 ${OTHER_SDATA_SECTIONS}
eac338cf 386 ${RELOCATING+${DATA_END_SYMBOLS-_edata = .; PROVIDE (edata = .);}}
01d9ad14
L
387 /* __bss_start is used by _bfd_elf_provide_section_bound_symbols in
388 elflink.c. */
252b5132
RH
389 ${RELOCATING+__bss_start = .;}
390 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
48459341 391 ${SBSS}
6c86c541 392 ${BSS_PLT+${PLT}}
465bc359 393 .bss ${RELOCATING-0} :
252b5132
RH
394 {
395 *(.dynbss)
465bc359 396 *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
252b5132
RH
397 *(COMMON)
398 /* Align here to ensure that the .bss section occupies space up to
399 _end. Align after .bss to ensure correct alignment even if the
400 .bss section disappears because there are no input sections. */
401 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
402 }
465bc359 403 ${OTHER_BSS_SECTIONS}
252b5132 404 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
9e4141bc 405 ${RELOCATING+_end = .;}
252b5132
RH
406 ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
407 ${RELOCATING+PROVIDE (end = .);}
2d13d8c5 408 ${RELOCATING+${DATA_SEGMENT_END}}
252b5132
RH
409
410 /* Stabs debugging sections. */
465bc359
AM
411 .stab 0 : { *(.stab) }
412 .stabstr 0 : { *(.stabstr) }
413 .stab.excl 0 : { *(.stab.excl) }
414 .stab.exclstr 0 : { *(.stab.exclstr) }
415 .stab.index 0 : { *(.stab.index) }
252b5132
RH
416 .stab.indexstr 0 : { *(.stab.indexstr) }
417
465bc359 418 .comment 0 : { *(.comment) }
252b5132
RH
419
420 /* DWARF debug sections.
421 Symbols in the DWARF debugging sections are relative to the beginning
422 of the section so we begin them at 0. */
423
424 /* DWARF 1 */
425 .debug 0 : { *(.debug) }
426 .line 0 : { *(.line) }
427
428 /* GNU DWARF 1 extensions */
429 .debug_srcinfo 0 : { *(.debug_srcinfo) }
430 .debug_sfnames 0 : { *(.debug_sfnames) }
431
432 /* DWARF 1.1 and DWARF 2 */
433 .debug_aranges 0 : { *(.debug_aranges) }
434 .debug_pubnames 0 : { *(.debug_pubnames) }
435
436 /* DWARF 2 */
465bc359 437 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
252b5132
RH
438 .debug_abbrev 0 : { *(.debug_abbrev) }
439 .debug_line 0 : { *(.debug_line) }
440 .debug_frame 0 : { *(.debug_frame) }
441 .debug_str 0 : { *(.debug_str) }
442 .debug_loc 0 : { *(.debug_loc) }
443 .debug_macinfo 0 : { *(.debug_macinfo) }
444
445 /* SGI/MIPS DWARF 2 extensions */
446 .debug_weaknames 0 : { *(.debug_weaknames) }
447 .debug_funcnames 0 : { *(.debug_funcnames) }
448 .debug_typenames 0 : { *(.debug_typenames) }
449 .debug_varnames 0 : { *(.debug_varnames) }
450
465bc359 451 ${STACK_ADDR+${STACK}}
252b5132 452 ${OTHER_SECTIONS}
465bc359 453 ${RELOCATING+${OTHER_END_SYMBOLS}}
9ee5e499 454 ${RELOCATING+${STACKNOTE}}
252b5132
RH
455}
456EOF
This page took 0.272491 seconds and 4 git commands to generate.