Automatic date update in version.in
[deliverable/binutils-gdb.git] / ld / scripttempl / elfd30v.sc
CommitLineData
82704155 1# Copyright (C) 2014-2019 Free Software Foundation, Inc.
6c19b93b 2#
985743c7
NC
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.
252b5132 6
6c19b93b 7CTOR=".ctors ${CONSTRUCTING-0} :
252b5132
RH
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
40cf2291
AM
20 KEEP (*crtbegin.o(.ctors))
21 KEEP (*crtbegin?.o(.ctors))
252b5132
RH
22
23 /* We don't want to include the .ctor section from
bd6791bc 24 the crtend.o file until after the sorted ctors.
252b5132
RH
25 The .ctor section from the crtend file contains the
26 end of ctors marker and it must be last */
27
40cf2291 28 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))
252b5132
RH
29 KEEP (*(SORT(.ctors.*)))
30 KEEP (*(.ctors))
31 ${CONSTRUCTING+ __CTOR_END__ = .; }
32 } ${RELOCATING+ > ${DATA_MEMORY}}"
33
ec2d9b29 34DTOR=" .dtors ${CONSTRUCTING-0} :
252b5132
RH
35 {
36 ${CONSTRUCTING+ __DTOR_LIST__ = .; }
40cf2291
AM
37 KEEP (*crtbegin.o(.dtors))
38 KEEP (*crtbegin?.o(.dtors))
39 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors))
252b5132
RH
40 KEEP (*(SORT(.dtors.*)))
41 KEEP (*(.dtors))
42 ${CONSTRUCTING+ __DTOR_END__ = .; }
43 } ${RELOCATING+ > ${DATA_MEMORY}}"
44
45cat <<EOF
82704155 46/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
985743c7
NC
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
252b5132
RH
52OUTPUT_FORMAT("${OUTPUT_FORMAT}")
53OUTPUT_ARCH(${ARCH})
54
2bf2bf23
AM
55EOF
56
57test -n "${RELOCATING}" && cat <<EOF
252b5132
RH
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
2bf2bf23
AM
66EOF
67
68cat <<EOF
252b5132
RH
69SECTIONS
70{
71 /* Read-only sections, merged into text segment: */
72 ${TEXT_DYNAMIC+${DYNAMIC}}
ec2d9b29
AM
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
2bf2bf23
AM
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*}) }
ec2d9b29
AM
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}
252b5132
RH
120 ${DATA_PLT-${PLT}}
121
122 /* Internal text space */
ec2d9b29 123 .stext ${RELOCATING-0} : { *(.stext) } ${RELOCATING+ > text}
252b5132
RH
124
125 /* Internal text space or external memory */
126 .text :
127 {
128 *(.text)
2bf2bf23 129 ${RELOCATING+*(.gnu.linkonce.t*)
b2e4da5a
L
130 *(SORT_NONE(.init))
131 *(SORT_NONE(.fini))
2bf2bf23 132 _etext = . ;}
252b5132
RH
133 } ${RELOCATING+ > ${TEXT_MEMORY}}
134
135 /* Internal data space */
ec2d9b29
AM
136 .srodata ${RELOCATING-0} : { *(.srodata) } ${RELOCATING+ > data}
137 .sdata ${RELOCATING-0} : { *(.sdata) } ${RELOCATING+ > data}
252b5132
RH
138
139 /* Internal data space or external memory */
ec2d9b29 140 .rodata ${RELOCATING-0} : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}}
252b5132
RH
141
142 /* C++ exception support. */
ec2d9b29
AM
143 .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}}
144 .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}}
252b5132 145
24098abb 146 /* Java class registration support. */
ec2d9b29 147 .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${RELOCATING+ >${DATA_MEMORY}}
24098abb 148
252b5132
RH
149 ${RELOCATING+${CTOR}}
150 ${RELOCATING+${DTOR}}
151
ec2d9b29 152 .data ${RELOCATING-0} :
252b5132
RH
153 {
154 *(.data)
2bf2bf23 155 ${RELOCATING+*(.gnu.linkonce.d*)}
252b5132
RH
156 ${CONSTRUCTING+CONSTRUCTORS}
157 ${RELOCATING+ _edata = . ; }
158 } ${RELOCATING+ > ${DATA_MEMORY}}
159
160 /* External memory */
ec2d9b29 161 .etext ${RELOCATING-0} :
252b5132
RH
162 {
163 ${RELOCATING+ PROVIDE (__etext_start = .) ; }
164 *(.etext)
165 ${RELOCATING+ PROVIDE (__etext_end = .) ; }
166 } ${RELOCATING+ > emem}
167
ec2d9b29
AM
168 .erodata ${RELOCATING-0} : { *(.erodata) } ${RELOCATING+ > emem}
169 .edata ${RELOCATING-0} : { *(.edata) } ${RELOCATING+ > emem}
252b5132 170
ec2d9b29 171 .sbss ${RELOCATING-0} :
252b5132
RH
172 {
173 ${RELOCATING+ PROVIDE (__sbss_start = .) ; }
174 *(.sbss)
175 ${RELOCATING+ PROVIDE (__sbss_end = .) ; }
176 } ${RELOCATING+ > data}
177
ec2d9b29 178 .ebss ${RELOCATING-0} :
252b5132
RH
179 {
180 ${RELOCATING+ PROVIDE (__ebss_start = .) ; }
181 *(.ebss)
182 ${RELOCATING+ PROVIDE (__ebss_end = .) ; }
183 } ${RELOCATING+ > data}
184
ec2d9b29 185 .bss ${RELOCATING-0} :
252b5132
RH
186 {
187 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
188 *(.bss)
2bf2bf23 189 ${RELOCATING+*(COMMON)}
252b5132
RH
190 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
191 ${RELOCATING+ _end = . ; }
192 } ${RELOCATING+ > ${DATA_MEMORY}}
193
ec2d9b29 194 .eit_v ${RELOCATING-0} :
252b5132
RH
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
ceb0a680
NC
211EOF
212
d061dfac 213. $srcdir/scripttempl/DWARF.sc
ceb0a680 214
6c19b93b 215cat <<EOF
2bf2bf23 216 ${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
252b5132
RH
217}
218EOF
219
220
221
This page took 0.990475 seconds and 4 git commands to generate.