1*3d8817e4Smiod#
2*3d8817e4Smiod# Unusual variables checked by this code:
3*3d8817e4Smiod#	NOP - four byte opcode for no-op (defaults to 0)
4*3d8817e4Smiod#	NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
5*3d8817e4Smiod#		empty.
6*3d8817e4Smiod#	DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
7*3d8817e4Smiod#	INITIAL_READONLY_SECTIONS - at start of text segment
8*3d8817e4Smiod#	OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
9*3d8817e4Smiod#		(e.g., .PARISC.milli)
10*3d8817e4Smiod#	OTHER_TEXT_SECTIONS - these get put in .text when relocating
11*3d8817e4Smiod#	OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
12*3d8817e4Smiod#		(e.g., .PARISC.global)
13*3d8817e4Smiod#	OTHER_SECTIONS - at the end
14*3d8817e4Smiod#	EXECUTABLE_SYMBOLS - symbols that must be defined for an
15*3d8817e4Smiod#		executable (e.g., _DYNAMIC_LINK)
16*3d8817e4Smiod#	TEXT_START_SYMBOLS - symbols that appear at the start of the
17*3d8817e4Smiod#		.text section.
18*3d8817e4Smiod#	DATA_START_SYMBOLS - symbols that appear at the start of the
19*3d8817e4Smiod#		.data section.
20*3d8817e4Smiod#	OTHER_GOT_SYMBOLS - symbols defined just before .got.
21*3d8817e4Smiod#	OTHER_GOT_SECTIONS - sections just after .got.
22*3d8817e4Smiod#	OTHER_SDATA_SECTIONS - sections just after .sdata.
23*3d8817e4Smiod#	OTHER_BSS_SYMBOLS - symbols that appear at the start of the
24*3d8817e4Smiod#		.bss section besides __bss_start.
25*3d8817e4Smiod#	DATA_PLT - .plt should be in data segment, not text segment.
26*3d8817e4Smiod#	BSS_PLT - .plt should be in bss segment
27*3d8817e4Smiod#	TEXT_DYNAMIC - .dynamic in text segment, not data segment.
28*3d8817e4Smiod#	EMBEDDED - whether this is for an embedded system.
29*3d8817e4Smiod#	SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
30*3d8817e4Smiod#		start address of shared library.
31*3d8817e4Smiod#	INPUT_FILES - INPUT command of files to always include
32*3d8817e4Smiod#	WRITABLE_RODATA - if set, the .rodata section should be writable
33*3d8817e4Smiod#	INIT_START, INIT_END -  statements just before and just after
34*3d8817e4Smiod# 	combination of .init sections.
35*3d8817e4Smiod#	FINI_START, FINI_END - statements just before and just after
36*3d8817e4Smiod# 	combination of .fini sections.
37*3d8817e4Smiod#	STACK_ADDR - start of a .stack section.
38*3d8817e4Smiod#	OTHER_SYMBOLS - symbols to place right at the end of the script.
39*3d8817e4Smiod#
40*3d8817e4Smiod# When adding sections, do note that the names of some sections are used
41*3d8817e4Smiod# when specifying the start address of the next.
42*3d8817e4Smiod#
43*3d8817e4Smiod
44*3d8817e4Smiod#  Many sections come in three flavours.  There is the 'real' section,
45*3d8817e4Smiod#  like ".data".  Then there are the per-procedure or per-variable
46*3d8817e4Smiod#  sections, generated by -ffunction-sections and -fdata-sections in GCC,
47*3d8817e4Smiod#  and useful for --gc-sections, which for a variable "foo" might be
48*3d8817e4Smiod#  ".data.foo".  Then there are the linkonce sections, for which the linker
49*3d8817e4Smiod#  eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
50*3d8817e4Smiod#  The exact correspondences are:
51*3d8817e4Smiod#
52*3d8817e4Smiod#  Section	Linkonce section
53*3d8817e4Smiod#  .text	.gnu.linkonce.t.foo
54*3d8817e4Smiod#  .rodata	.gnu.linkonce.r.foo
55*3d8817e4Smiod#  .data	.gnu.linkonce.d.foo
56*3d8817e4Smiod#  .bss		.gnu.linkonce.b.foo
57*3d8817e4Smiod#  .sdata	.gnu.linkonce.s.foo
58*3d8817e4Smiod#  .sbss	.gnu.linkonce.sb.foo
59*3d8817e4Smiod#  .sdata2	.gnu.linkonce.s2.foo
60*3d8817e4Smiod#  .sbss2	.gnu.linkonce.sb2.foo
61*3d8817e4Smiod#  .debug_info	.gnu.linkonce.wi.foo
62*3d8817e4Smiod#
63*3d8817e4Smiod#  Each of these can also have corresponding .rel.* and .rela.* sections.
64*3d8817e4Smiod
65*3d8817e4Smiodtest -z "$ENTRY" && ENTRY=_start
66*3d8817e4Smiodtest -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
67*3d8817e4Smiodtest -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
68*3d8817e4Smiodif [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
69*3d8817e4Smiodtest -z "${ELFSIZE}" && ELFSIZE=32
70*3d8817e4Smiodtest -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
71*3d8817e4Smiodtest "$LD_FLAG" = "N" && DATA_ADDR=.
72*3d8817e4SmiodINTERP=".interp       ${RELOCATING-0} : { *(.interp) }"
73*3d8817e4SmiodPLT=".plt          ${RELOCATING-0} : { *(.plt) }"
74*3d8817e4SmiodDYNAMIC=".dynamic      ${RELOCATING-0} : { *(.dynamic) }"
75*3d8817e4SmiodRODATA=".rodata       ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
76*3d8817e4Smiodif test -z "${NO_SMALL_DATA}"; then
77*3d8817e4Smiod  SBSS=".sbss         ${RELOCATING-0} :
78*3d8817e4Smiod  {
79*3d8817e4Smiod    ${RELOCATING+PROVIDE (__sbss_start = .);}
80*3d8817e4Smiod    ${RELOCATING+PROVIDE (___sbss_start = .);}
81*3d8817e4Smiod    *(.dynsbss)
82*3d8817e4Smiod    *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
83*3d8817e4Smiod    *(.scommon)
84*3d8817e4Smiod    ${RELOCATING+PROVIDE (__sbss_end = .);}
85*3d8817e4Smiod    ${RELOCATING+PROVIDE (___sbss_end = .);}
86*3d8817e4Smiod  }"
87*3d8817e4Smiod  SBSS2=".sbss2        ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
88*3d8817e4Smiod  SDATA="/* We want the small data sections together, so single-instruction offsets
89*3d8817e4Smiod     can access them all, and initialized data all before uninitialized, so
90*3d8817e4Smiod     we can shorten the on-disk segment size.  */
91*3d8817e4Smiod  .sdata        ${RELOCATING-0} :
92*3d8817e4Smiod  {
93*3d8817e4Smiod    ${RELOCATING+${SDATA_START_SYMBOLS}}
94*3d8817e4Smiod    *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
95*3d8817e4Smiod  }"
96*3d8817e4Smiod  SDATA2=".sdata2       ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
97*3d8817e4Smiod  REL_SDATA=".rel.sdata    ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
98*3d8817e4Smiod  .rela.sdata   ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
99*3d8817e4Smiod  REL_SBSS=".rel.sbss     ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
100*3d8817e4Smiod  .rela.sbss    ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
101*3d8817e4Smiod  REL_SDATA2=".rel.sdata2   ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
102*3d8817e4Smiod  .rela.sdata2  ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
103*3d8817e4Smiod  REL_SBSS2=".rel.sbss2    ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
104*3d8817e4Smiod  .rela.sbss2   ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
105*3d8817e4Smiodfi
106*3d8817e4SmiodCTOR="
107*3d8817e4Smiod    ${CONSTRUCTING+${CTOR_START}}
108*3d8817e4Smiod    /* gcc uses crtbegin.o to find the start of
109*3d8817e4Smiod       the constructors, so we make sure it is
110*3d8817e4Smiod       first.  Because this is a wildcard, it
111*3d8817e4Smiod       doesn't matter if the user does not
112*3d8817e4Smiod       actually link against crtbegin.o; the
113*3d8817e4Smiod       linker won't look for a file to match a
114*3d8817e4Smiod       wildcard.  The wildcard also means that it
115*3d8817e4Smiod       doesn't matter which directory crtbegin.o
116*3d8817e4Smiod       is in.  */
117*3d8817e4Smiod
118*3d8817e4Smiod    KEEP (*crtbegin*.o(.ctors))
119*3d8817e4Smiod
120*3d8817e4Smiod    /* We don't want to include the .ctor section from
121*3d8817e4Smiod       the crtend.o file until after the sorted ctors.
122*3d8817e4Smiod       The .ctor section from the crtend file contains the
123*3d8817e4Smiod       end of ctors marker and it must be last */
124*3d8817e4Smiod
125*3d8817e4Smiod    KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
126*3d8817e4Smiod    KEEP (*(SORT(.ctors.*)))
127*3d8817e4Smiod    KEEP (*(.ctors))
128*3d8817e4Smiod    ${CONSTRUCTING+${CTOR_END}}
129*3d8817e4Smiod"
130*3d8817e4SmiodDTOR="
131*3d8817e4Smiod    ${CONSTRUCTING+${DTOR_START}}
132*3d8817e4Smiod    KEEP (*crtbegin*.o(.dtors))
133*3d8817e4Smiod    KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
134*3d8817e4Smiod    KEEP (*(SORT(.dtors.*)))
135*3d8817e4Smiod    KEEP (*(.dtors))
136*3d8817e4Smiod    ${CONSTRUCTING+${DTOR_END}}
137*3d8817e4Smiod"
138*3d8817e4SmiodSTACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
139*3d8817e4Smiod  {
140*3d8817e4Smiod    ${RELOCATING+_stack = .;}
141*3d8817e4Smiod    *(.stack)
142*3d8817e4Smiod  }"
143*3d8817e4Smiod
144*3d8817e4Smiodtest -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
145*3d8817e4Smiod
146*3d8817e4Smiodcat <<EOF
147*3d8817e4SmiodOUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
148*3d8817e4Smiod	      "${LITTLE_OUTPUT_FORMAT}")
149*3d8817e4SmiodOUTPUT_ARCH(${OUTPUT_ARCH})
150*3d8817e4SmiodENTRY(${ENTRY})
151*3d8817e4Smiod
152*3d8817e4Smiod${RELOCATING+${LIB_SEARCH_DIRS}}
153*3d8817e4Smiod${RELOCATING+/* Do we need any of these for elf?
154*3d8817e4Smiod   __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */}
155*3d8817e4Smiod${RELOCATING+${EXECUTABLE_SYMBOLS}}
156*3d8817e4Smiod${RELOCATING+${INPUT_FILES}}
157*3d8817e4Smiod${RELOCATING- /* For some reason, the Solaris linker makes bad executables
158*3d8817e4Smiod  if gld -r is used and the intermediate file has sections starting
159*3d8817e4Smiod  at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
160*3d8817e4Smiod  bug.  But for now assigning the zero vmas works.  */}
161*3d8817e4Smiod
162*3d8817e4SmiodSECTIONS
163*3d8817e4Smiod{
164*3d8817e4Smiod  /* Read-only sections, merged into text segment: */
165*3d8817e4Smiod  ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_BASE_ADDRESS};}}
166*3d8817e4Smiod  ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0};}}
167*3d8817e4Smiod  ${CREATE_SHLIB-${INTERP}}
168*3d8817e4Smiod  ${INITIAL_READONLY_SECTIONS}
169*3d8817e4Smiod  ${TEXT_DYNAMIC+${DYNAMIC}}
170*3d8817e4Smiod  .hash         ${RELOCATING-0} : { *(.hash) }
171*3d8817e4Smiod  .dynsym       ${RELOCATING-0} : { *(.dynsym) }
172*3d8817e4Smiod  .dynstr       ${RELOCATING-0} : { *(.dynstr) }
173*3d8817e4Smiod  .gnu.version  ${RELOCATING-0} : { *(.gnu.version) }
174*3d8817e4Smiod  .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
175*3d8817e4Smiod  .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
176*3d8817e4Smiod
177*3d8817e4SmiodEOF
178*3d8817e4Smiodif [ "x$COMBRELOC" = x ]; then
179*3d8817e4Smiod  COMBRELOCCAT=cat
180*3d8817e4Smiodelse
181*3d8817e4Smiod  COMBRELOCCAT="cat > $COMBRELOC"
182*3d8817e4Smiodfi
183*3d8817e4Smiodeval $COMBRELOCCAT <<EOF
184*3d8817e4Smiod  .rel.init     ${RELOCATING-0} : { *(.rel.init) }
185*3d8817e4Smiod  .rela.init    ${RELOCATING-0} : { *(.rela.init) }
186*3d8817e4Smiod  .rel.text     ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
187*3d8817e4Smiod  .rela.text    ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
188*3d8817e4Smiod  .rel.fini     ${RELOCATING-0} : { *(.rel.fini) }
189*3d8817e4Smiod  .rela.fini    ${RELOCATING-0} : { *(.rela.fini) }
190*3d8817e4Smiod  .rel.rodata   ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
191*3d8817e4Smiod  .rela.rodata  ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
192*3d8817e4Smiod  ${OTHER_READONLY_RELOC_SECTIONS}
193*3d8817e4Smiod  .rel.data     ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
194*3d8817e4Smiod  .rela.data    ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
195*3d8817e4Smiod  .rel.ctors    ${RELOCATING-0} : { *(.rel.ctors) }
196*3d8817e4Smiod  .rela.ctors   ${RELOCATING-0} : { *(.rela.ctors) }
197*3d8817e4Smiod  .rel.dtors    ${RELOCATING-0} : { *(.rel.dtors) }
198*3d8817e4Smiod  .rela.dtors   ${RELOCATING-0} : { *(.rela.dtors) }
199*3d8817e4Smiod  .rel.got      ${RELOCATING-0} : { *(.rel.got) }
200*3d8817e4Smiod  .rela.got     ${RELOCATING-0} : { *(.rela.got) }
201*3d8817e4Smiod  ${OTHER_GOT_RELOC_SECTIONS}
202*3d8817e4Smiod  ${REL_SDATA}
203*3d8817e4Smiod  ${REL_SBSS}
204*3d8817e4Smiod  ${REL_SDATA2}
205*3d8817e4Smiod  ${REL_SBSS2}
206*3d8817e4Smiod  .rel.bss      ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
207*3d8817e4Smiod  .rela.bss     ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
208*3d8817e4SmiodEOF
209*3d8817e4Smiodif [ -n "$COMBRELOC" ]; then
210*3d8817e4Smiodcat <<EOF
211*3d8817e4Smiod  .rel.dyn      ${RELOCATING-0} :
212*3d8817e4Smiod    {
213*3d8817e4SmiodEOF
214*3d8817e4Smiodsed -e '/^[ 	]*[{}][ 	]*$/d;/:[ 	]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/      \1/' $COMBRELOC
215*3d8817e4Smiodcat <<EOF
216*3d8817e4Smiod    }
217*3d8817e4Smiod  .rela.dyn     ${RELOCATING-0} :
218*3d8817e4Smiod    {
219*3d8817e4SmiodEOF
220*3d8817e4Smiodsed -e '/^[ 	]*[{}][ 	]*$/d;/:[ 	]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/      \1/' $COMBRELOC
221*3d8817e4Smiodcat <<EOF
222*3d8817e4Smiod    }
223*3d8817e4SmiodEOF
224*3d8817e4Smiodfi
225*3d8817e4Smiodcat <<EOF
226*3d8817e4Smiod  . = ALIGN(0x1000);
227*3d8817e4Smiod  .rel.plt      ${RELOCATING-0} : { *(.rel.plt) }
228*3d8817e4Smiod  .rela.plt     ${RELOCATING-0} : { *(.rela.plt) }
229*3d8817e4Smiod  ${OTHER_PLT_RELOC_SECTIONS}
230*3d8817e4Smiod  ${DATA_PLT-${BSS_PLT-${PLT}}}
231*3d8817e4Smiod  .text         ${RELOCATING-0} :
232*3d8817e4Smiod  {
233*3d8817e4Smiod    ${RELOCATING+${TEXT_START_SYMBOLS}}
234*3d8817e4Smiod    *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
235*3d8817e4Smiod    /* .gnu.warning sections are handled specially by elf32.em.  */
236*3d8817e4Smiod    *(.gnu.warning)
237*3d8817e4Smiod    ${RELOCATING+${OTHER_TEXT_SECTIONS}}
238*3d8817e4Smiod  } =${NOP-0}
239*3d8817e4Smiod  .fini         ${RELOCATING-0} :
240*3d8817e4Smiod  {
241*3d8817e4Smiod    ${RELOCATING+${FINI_START}}
242*3d8817e4Smiod    KEEP (*(.fini))
243*3d8817e4Smiod    ${RELOCATING+${FINI_END}}
244*3d8817e4Smiod  } =${NOP-0}
245*3d8817e4Smiod  ${RELOCATING+PROVIDE (__etext = .);}
246*3d8817e4Smiod  ${RELOCATING+PROVIDE (_etext = .);}
247*3d8817e4Smiod  ${RELOCATING+PROVIDE (etext = .);}
248*3d8817e4Smiod  . = ALIGN(0x1000);
249*3d8817e4Smiod  ${CREATE_SHLIB-${SDATA2}}
250*3d8817e4Smiod  ${CREATE_SHLIB-${SBSS2}}
251*3d8817e4Smiod  ${OTHER_READONLY_SECTIONS}
252*3d8817e4Smiod  .eh_frame_hdr : { *(.eh_frame_hdr) }
253*3d8817e4Smiod
254*3d8817e4Smiod  . = ALIGN(0x1000);
255*3d8817e4Smiod  .data         ${RELOCATING-0} :
256*3d8817e4Smiod  {
257*3d8817e4Smiod    *(.rodata .rodata.*)
258*3d8817e4Smiod    *(.rodata1)
259*3d8817e4Smiod    *(.gnu.linkonce.r.*)
260*3d8817e4Smiod    ${RELOCATING+${DATA_START_SYMBOLS}}
261*3d8817e4Smiod    *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
262*3d8817e4Smiod    ${CONSTRUCTING+SORT(CONSTRUCTORS)}
263*3d8817e4Smiod    KEEP (*(.eh_frame))
264*3d8817e4Smiod    *(.gcc_except_table)
265*3d8817e4Smiod    ${CTOR}
266*3d8817e4Smiod    ${DTOR}
267*3d8817e4Smiod    KEEP (*(.jcr))
268*3d8817e4Smiod  }
269*3d8817e4Smiod  .data1        ${RELOCATING-0} : { *(.data1) }
270*3d8817e4Smiod  . = ALIGN(0x1000);
271*3d8817e4Smiod  .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
272*3d8817e4Smiod  ${WRITABLE_RODATA+${RODATA}}
273*3d8817e4Smiod  ${OTHER_READWRITE_SECTIONS}
274*3d8817e4Smiod  ${TEXT_DYNAMIC-${DYNAMIC}}
275*3d8817e4Smiod  ${DATA_PLT+${PLT}}
276*3d8817e4Smiod  ${RELOCATING+${OTHER_GOT_SYMBOLS}}
277*3d8817e4Smiod  .got          ${RELOCATING-0} : { *(.got.plt) *(.got) }
278*3d8817e4Smiod  ${OTHER_GOT_SECTIONS}
279*3d8817e4Smiod  ${CREATE_SHLIB+${SDATA2}}
280*3d8817e4Smiod  ${CREATE_SHLIB+${SBSS2}}
281*3d8817e4Smiod  ${SDATA}
282*3d8817e4Smiod  ${OTHER_SDATA_SECTIONS}
283*3d8817e4Smiod  ${RELOCATING+_edata = .;}
284*3d8817e4Smiod  ${RELOCATING+PROVIDE (edata = .);}
285*3d8817e4Smiod  ${RELOCATING+__bss_start = .;}
286*3d8817e4Smiod  ${RELOCATING+${OTHER_BSS_SYMBOLS}}
287*3d8817e4Smiod  ${SBSS}
288*3d8817e4Smiod  ${BSS_PLT+${PLT}}
289*3d8817e4Smiod  . = ALIGN(0x1000);
290*3d8817e4Smiod  .bss          ${RELOCATING-0} :
291*3d8817e4Smiod  {
292*3d8817e4Smiod   *(.dynbss)
293*3d8817e4Smiod   *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
294*3d8817e4Smiod   *(COMMON)
295*3d8817e4Smiod   /* Align here to ensure that the .bss section occupies space up to
296*3d8817e4Smiod      _end.  Align after .bss to ensure correct alignment even if the
297*3d8817e4Smiod      .bss section disappears because there are no input sections.  */
298*3d8817e4Smiod   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
299*3d8817e4Smiod  }
300*3d8817e4Smiod  ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
301*3d8817e4Smiod  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
302*3d8817e4Smiod  ${RELOCATING+${OTHER_END_SYMBOLS}}
303*3d8817e4Smiod  ${RELOCATING+_end = .;}
304*3d8817e4Smiod  ${RELOCATING+PROVIDE (end = .);}
305*3d8817e4Smiod
306*3d8817e4Smiod  /* Stabs debugging sections.  */
307*3d8817e4Smiod  . = ALIGN(0x1000);
308*3d8817e4Smiod  .stab          0 : { *(.stab) }
309*3d8817e4Smiod  .stabstr       0 : { *(.stabstr) }
310*3d8817e4Smiod  .stab.excl     0 : { *(.stab.excl) }
311*3d8817e4Smiod  .stab.exclstr  0 : { *(.stab.exclstr) }
312*3d8817e4Smiod  .stab.index    0 : { *(.stab.index) }
313*3d8817e4Smiod  .stab.indexstr 0 : { *(.stab.indexstr) }
314*3d8817e4Smiod
315*3d8817e4Smiod  . = ALIGN(0x1000);
316*3d8817e4Smiod  .comment       0 : { *(.comment) }
317*3d8817e4Smiod
318*3d8817e4Smiod  /* DWARF debug sections.
319*3d8817e4Smiod     Symbols in the DWARF debugging sections are relative to the beginning
320*3d8817e4Smiod     of the section so we begin them at 0.  */
321*3d8817e4Smiod
322*3d8817e4Smiod  /* DWARF 1 */
323*3d8817e4Smiod  .debug          0 : { *(.debug) }
324*3d8817e4Smiod  .line           0 : { *(.line) }
325*3d8817e4Smiod
326*3d8817e4Smiod  /* GNU DWARF 1 extensions */
327*3d8817e4Smiod  .debug_srcinfo  0 : { *(.debug_srcinfo) }
328*3d8817e4Smiod  .debug_sfnames  0 : { *(.debug_sfnames) }
329*3d8817e4Smiod
330*3d8817e4Smiod  /* DWARF 1.1 and DWARF 2 */
331*3d8817e4Smiod  .debug_aranges  0 : { *(.debug_aranges) }
332*3d8817e4Smiod  .debug_pubnames 0 : { *(.debug_pubnames) }
333*3d8817e4Smiod
334*3d8817e4Smiod  /* DWARF 2 */
335*3d8817e4Smiod  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
336*3d8817e4Smiod  .debug_abbrev   0 : { *(.debug_abbrev) }
337*3d8817e4Smiod  .debug_line     0 : { *(.debug_line) }
338*3d8817e4Smiod  .debug_frame    0 : { *(.debug_frame) }
339*3d8817e4Smiod  .debug_str      0 : { *(.debug_str) }
340*3d8817e4Smiod  .debug_loc      0 : { *(.debug_loc) }
341*3d8817e4Smiod  .debug_macinfo  0 : { *(.debug_macinfo) }
342*3d8817e4Smiod
343*3d8817e4Smiod  /* SGI/MIPS DWARF 2 extensions */
344*3d8817e4Smiod  .debug_weaknames 0 : { *(.debug_weaknames) }
345*3d8817e4Smiod  .debug_funcnames 0 : { *(.debug_funcnames) }
346*3d8817e4Smiod  .debug_typenames 0 : { *(.debug_typenames) }
347*3d8817e4Smiod  .debug_varnames  0 : { *(.debug_varnames) }
348*3d8817e4Smiod
349*3d8817e4Smiod  ${STACK_ADDR+${STACK}}
350*3d8817e4Smiod  ${OTHER_SECTIONS}
351*3d8817e4Smiod  ${RELOCATING+${OTHER_SYMBOLS}}
352*3d8817e4Smiod}
353*3d8817e4SmiodEOF
354