* scripttempl/elf.sc (.text): Add cold text sections.
[deliverable/binutils-gdb.git] / ld / scripttempl / elfd30v.sc
CommitLineData
252b5132
RH
1
2CTOR=".ctors ${CONSTRUCTING-0} :
3 {
4 ${CONSTRUCTING+ __CTOR_LIST__ = .; }
5 /* gcc uses crtbegin.o to find the start of
6 the constructors, so we make sure it is
7 first. Because this is a wildcard, it
8 doesn't matter if the user does not
9 actually link against crtbegin.o; the
10 linker won't look for a file to match a
11 wildcard. The wildcard also means that it
12 doesn't matter which directory crtbegin.o
13 is in. */
14
40cf2291
AM
15 KEEP (*crtbegin.o(.ctors))
16 KEEP (*crtbegin?.o(.ctors))
252b5132
RH
17
18 /* We don't want to include the .ctor section from
bd6791bc 19 the crtend.o file until after the sorted ctors.
252b5132
RH
20 The .ctor section from the crtend file contains the
21 end of ctors marker and it must be last */
22
40cf2291 23 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))
252b5132
RH
24 KEEP (*(SORT(.ctors.*)))
25 KEEP (*(.ctors))
26 ${CONSTRUCTING+ __CTOR_END__ = .; }
27 } ${RELOCATING+ > ${DATA_MEMORY}}"
28
29DTOR=" .dtors ${CONSTRUCTING-0} :
30 {
31 ${CONSTRUCTING+ __DTOR_LIST__ = .; }
40cf2291
AM
32 KEEP (*crtbegin.o(.dtors))
33 KEEP (*crtbegin?.o(.dtors))
34 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors))
252b5132
RH
35 KEEP (*(SORT(.dtors.*)))
36 KEEP (*(.dtors))
37 ${CONSTRUCTING+ __DTOR_END__ = .; }
38 } ${RELOCATING+ > ${DATA_MEMORY}}"
39
40cat <<EOF
41OUTPUT_FORMAT("${OUTPUT_FORMAT}")
42OUTPUT_ARCH(${ARCH})
43
44MEMORY
45{
46 text ${TEXT_DEF_SECTION} : ORIGIN = ${TEXT_START_ADDR}, LENGTH = ${TEXT_SIZE}
47 data ${DATA_DEF_SECTION} : ORIGIN = ${DATA_START_ADDR}, LENGTH = ${DATA_SIZE}
48 emem ${EMEM_DEF_SECTION} : ORIGIN = ${EMEM_START_ADDR}, LENGTH = ${EMEM_SIZE}
49 eit : ORIGIN = ${EIT_START_ADDR}, LENGTH = ${EIT_SIZE}
50}
51
52SECTIONS
53{
54 /* Read-only sections, merged into text segment: */
55 ${TEXT_DYNAMIC+${DYNAMIC}}
56 .hash ${RELOCATING-0} : { *(.hash) }
57 .dynsym ${RELOCATING-0} : { *(.dynsym) }
58 .dynstr ${RELOCATING-0} : { *(.dynstr) }
59 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
60 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
61 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
62
1bf0a4d9 63 .rel.text ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
252b5132 64 .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
1bf0a4d9 65 .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
252b5132 66 .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
1bf0a4d9 67 .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
252b5132 68 .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
1bf0a4d9 69 .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
252b5132 70 .rela.stext ${RELOCATING-0} : { *(.rela.stest) }
1bf0a4d9 71 .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
252b5132 72 .rela.etext ${RELOCATING-0} : { *(.rela.etest) }
1bf0a4d9 73 .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
252b5132 74 .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
1bf0a4d9 75 .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
252b5132 76 .rela.edata ${RELOCATING-0} : { *(.rela.edata) }
1bf0a4d9 77 .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
252b5132 78 .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
252b5132 79 .rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
1bf0a4d9 80 .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
252b5132 81 .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
1bf0a4d9 82 .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
252b5132 83 .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
1bf0a4d9 84 .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
252b5132 85 .rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
1bf0a4d9 86 .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
252b5132 87 .rel.got ${RELOCATING-0} : { *(.rel.got) }
1bf0a4d9 88 .rela.got ${RELOCATING-0} : { *(.rela.got) }
252b5132 89 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
1bf0a4d9 90 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
252b5132 91 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
1bf0a4d9 92 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
252b5132 93 .rel.init ${RELOCATING-0} : { *(.rel.init) }
1bf0a4d9 94 .rela.init ${RELOCATING-0} : { *(.rela.init) }
252b5132 95 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
1bf0a4d9 96 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
252b5132 97 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
1bf0a4d9 98 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
252b5132 99 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
1bf0a4d9 100 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
252b5132
RH
101
102 .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
103 ${DATA_PLT-${PLT}}
104
105 /* Internal text space */
106 .stext ${RELOCATING-0} : { *(.stext) } ${RELOCATING+ > text}
107
108 /* Internal text space or external memory */
109 .text :
110 {
111 *(.text)
112 *(.gnu.linkonce.t*)
113 *(.init)
114 *(.fini)
115 ${RELOCATING+ _etext = . ; }
116 } ${RELOCATING+ > ${TEXT_MEMORY}}
117
118 /* Internal data space */
119 .srodata ${RELOCATING-0} : { *(.srodata) } ${RELOCATING+ > data}
120 .sdata ${RELOCATING-0} : { *(.sdata) } ${RELOCATING+ > data}
121
122 /* Internal data space or external memory */
123 .rodata ${RELOCATING-0} : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}}
124
125 /* C++ exception support. */
987fd5b4 126 .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}}
c9637625 127 .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}}
252b5132 128
24098abb
RH
129 /* Java class registration support. */
130 .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${RELOCATING+ >${DATA_MEMORY}}
131
252b5132
RH
132 ${RELOCATING+${CTOR}}
133 ${RELOCATING+${DTOR}}
134
135 .data ${RELOCATING-0} :
136 {
137 *(.data)
138 *(.gnu.linkonce.d*)
139 ${CONSTRUCTING+CONSTRUCTORS}
140 ${RELOCATING+ _edata = . ; }
141 } ${RELOCATING+ > ${DATA_MEMORY}}
142
143 /* External memory */
144 .etext ${RELOCATING-0} :
145 {
146 ${RELOCATING+ PROVIDE (__etext_start = .) ; }
147 *(.etext)
148 ${RELOCATING+ PROVIDE (__etext_end = .) ; }
149 } ${RELOCATING+ > emem}
150
151 .erodata ${RELOCATING-0} : { *(.erodata) } ${RELOCATING+ > emem}
152 .edata ${RELOCATING-0} : { *(.edata) } ${RELOCATING+ > emem}
153
154 .sbss ${RELOCATING-0} :
155 {
156 ${RELOCATING+ PROVIDE (__sbss_start = .) ; }
157 *(.sbss)
158 ${RELOCATING+ PROVIDE (__sbss_end = .) ; }
159 } ${RELOCATING+ > data}
160
161 .ebss ${RELOCATING-0} :
162 {
163 ${RELOCATING+ PROVIDE (__ebss_start = .) ; }
164 *(.ebss)
165 ${RELOCATING+ PROVIDE (__ebss_end = .) ; }
166 } ${RELOCATING+ > data}
167
168 .bss ${RELOCATING-0} :
169 {
170 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
171 *(.bss)
172 *(COMMON)
173 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
174 ${RELOCATING+ _end = . ; }
175 } ${RELOCATING+ > ${DATA_MEMORY}}
176
177 .eit_v ${RELOCATING-0} :
178 {
179 ${RELOCATING+ PROVIDE (__eit_start = .) ; }
180 *(.eit_v)
181 ${RELOCATING+ PROVIDE (__eit_end = .) ; }
182 } ${RELOCATING+ > eit}
183
184 /* Stabs debugging sections. */
185 .stab 0 : { *(.stab) }
186 .stabstr 0 : { *(.stabstr) }
187 .stab.excl 0 : { *(.stab.excl) }
188 .stab.exclstr 0 : { *(.stab.exclstr) }
189 .stab.index 0 : { *(.stab.index) }
190 .stab.indexstr 0 : { *(.stab.indexstr) }
191
192 .comment 0 : { *(.comment) }
193
194 /* DWARF debug sections.
195 Symbols in the DWARF debugging sections are relative to the beginning
196 of the section so we begin them at 0. */
197
198 /* DWARF 1 */
199 .debug 0 : { *(.debug) }
200 .line 0 : { *(.line) }
201
202 /* GNU DWARF 1 extensions */
203 .debug_srcinfo 0 : { *(.debug_srcinfo) }
204 .debug_sfnames 0 : { *(.debug_sfnames) }
205
206 /* DWARF 1.1 and DWARF 2 */
207 .debug_aranges 0 : { *(.debug_aranges) }
208 .debug_pubnames 0 : { *(.debug_pubnames) }
209
210 /* DWARF 2 */
3a9d486c 211 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
252b5132
RH
212 .debug_abbrev 0 : { *(.debug_abbrev) }
213 .debug_line 0 : { *(.debug_line) }
214 .debug_frame 0 : { *(.debug_frame) }
215 .debug_str 0 : { *(.debug_str) }
216 .debug_loc 0 : { *(.debug_loc) }
217 .debug_macinfo 0 : { *(.debug_macinfo) }
218
219 PROVIDE (__stack = ${STACK_START_ADDR});
220}
221EOF
222
223
224
225
This page took 0.440543 seconds and 4 git commands to generate.