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