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