3 # Copyright (C) 2014-2019 Free Software Foundation, Inc.
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved.
9 # These variables may be overridden by the emulation file. The
10 # defaults are appropriate for a DECstation running Ultrix.
12 test -z "$ENTRY" && ENTRY=_start
14 #test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x0"
16 CTOR=".ctors ${CONSTRUCTING-0} :
18 ${CONSTRUCTING+${CTOR_START}}
19 /* gcc uses crtbegin.o to find the start of
20 the constructors, so we make sure it is
21 first. Because this is a wildcard, it
22 doesn't matter if the user does not
23 actually link against crtbegin.o; the
24 linker won't look for a file to match a
25 wildcard. The wildcard also means that it
26 doesn't matter which directory crtbegin.o
29 KEEP (*crtbegin.o(.ctors))
31 /* We don't want to include the .ctor section from
32 from the crtend.o file until after the sorted ctors.
33 The .ctor section from the crtend file contains the
34 end of ctors marker and it must be last */
36 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
37 KEEP (*(SORT(.ctors.*)))
39 ${CONSTRUCTING+${CTOR_END}}
42 DTOR=" .dtors ${CONSTRUCTING-0} :
44 ${CONSTRUCTING+${DTOR_START}}
45 KEEP (*crtbegin.o(.dtors))
46 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
47 KEEP (*(SORT(.dtors.*)))
49 ${CONSTRUCTING+${DTOR_END}}
53 /* Copyright (C) 2014-2019 Free Software Foundation, Inc.
55 Copying and distribution of this script, with or without modification,
56 are permitted in any medium without royalty provided the copyright
57 notice and this notice are preserved. */
59 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
60 "${LITTLE_OUTPUT_FORMAT}")
61 /*${LIB_SEARCH_DIRS}*/
62 ${RELOCATING+${LIB_SEARCH_DIRS}}
64 ${RELOCATING+ENTRY (${ENTRY})}
66 ${RELOCATING+_TEXT_START_ADDR = DEFINED(_TEXT_START_ADDR) ? _TEXT_START_ADDR : 0x50;
67 _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x0;
68 _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400;}
72 .vectors.reset 0x0 : { KEEP (*(.vectors.reset)) } = 0
73 .vectors.sw_exception 0x8 : { KEEP (*(.vectors.sw_exception)) } = 0
74 .vectors.interrupt 0x10 : { KEEP (*(.vectors.interrupt)) } = 0
75 .vectors.debug_sw_break 0x18 : { KEEP (*(.vectors.debug_sw_break)) } = 0
76 .vectors.hw_exception 0x20 : { KEEP (*(.vectors.hw_exception)) } = 0
78 ${RELOCATING+. = _TEXT_START_ADDR;}
80 ${RELOCATING+ _ftext = .;}
83 ${RELOCATING+*(.text.*)}
84 ${RELOCATING+*(.gnu.linkonce.t.*)}
86 ${RELOCATING+ _etext = .;}
88 .init : { KEEP (*(SORT_NONE(.init))) } =0
89 .fini : { KEEP (*(SORT_NONE(.fini))) } =0
91 ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
92 ${RELOCATING+PROVIDE (___CTOR_LIST__ = .);}
94 ${RELOCATING+PROVIDE (__CTOR_END__ = .);}
95 ${RELOCATING+PROVIDE (___CTOR_END__ = .);}
97 ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
98 ${RELOCATING+PROVIDE (___DTOR_LIST__ = .);}
100 ${RELOCATING+PROVIDE (__DTOR_END__ = .);}
101 ${RELOCATING+PROVIDE (___DTOR_END__ = .);}
103 ${RELOCATING+ . = ALIGN(4);}
104 ${RELOCATING+ _frodata = . ;}
107 ${RELOCATING+*(.rodata.*)}
108 ${RELOCATING+*(.gnu.linkonce.r.*)}
109 ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
111 ${RELOCATING+ _erodata = .;}
113 /* Alignments by 8 to ensure that _SDA2_BASE_ on a word boundary */
114 /* Note that .sdata2 and .sbss2 must be contiguous */
115 ${RELOCATING+. = ALIGN(8);}
116 ${RELOCATING+ _ssrw = .;}
119 ${RELOCATING+*(.sdata2.*)}
120 ${RELOCATING+*(.gnu.linkonce.s2.*)}
122 ${RELOCATING+. = ALIGN(4);}
124 ${RELOCATING+PROVIDE (__sbss2_start = .);}
126 ${RELOCATING+*(.sbss2.*)}
127 ${RELOCATING+*(.gnu.linkonce.sb2.*)}
128 ${RELOCATING+PROVIDE (__sbss2_end = .);}
130 ${RELOCATING+. = ALIGN(8);}
131 ${RELOCATING+ _essrw = .;}
132 ${RELOCATING+ _ssrw_size = _essrw - _ssrw;}
133 ${RELOCATING+ PROVIDE (_SDA2_BASE_ = _ssrw + (_ssrw_size / 2 ));}
135 ${RELOCATING+ . = ALIGN(4);}
136 ${RELOCATING+ _fdata = .;}
139 ${RELOCATING+*(.gnu.linkonce.d.*)}
140 ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
142 ${RELOCATING+ _edata = . ;}
144 /* Added to handle pic code */
157 /* Added by Sathya to handle C++ exceptions */
166 .gcc_except_table : {
170 /* Alignments by 8 to ensure that _SDA_BASE_ on a word boundary */
171 /* Note that .sdata and .sbss must be contiguous */
172 ${RELOCATING+. = ALIGN(8);}
173 ${RELOCATING+ _ssro = .;}
176 ${RELOCATING+*(.sdata.*)}
177 ${RELOCATING+*(.gnu.linkonce.s.*)}
179 ${RELOCATING+. = ALIGN(4);}
181 ${RELOCATING+PROVIDE (__sbss_start = .);}
183 ${RELOCATING+*(.sbss.*)}
184 ${RELOCATING+*(.gnu.linkonce.sb.*)}
185 ${RELOCATING+PROVIDE (__sbss_end = .);}
187 ${RELOCATING+. = ALIGN(8);}
188 ${RELOCATING+ _essro = .;}
189 ${RELOCATING+ _ssro_size = _essro - _ssro;}
190 ${RELOCATING+PROVIDE (_SDA_BASE_ = _ssro + (_ssro_size / 2 ));}
192 ${RELOCATING+ . = ALIGN(4);}
193 ${RELOCATING+ _fbss = .;}
195 ${RELOCATING+PROVIDE (__bss_start = .);}
197 ${RELOCATING+*(.bss.*)}
198 ${RELOCATING+*(.gnu.linkonce.b.*)}
199 ${RELOCATING+*(COMMON)}
200 ${RELOCATING+. = ALIGN(. != 0 ? 4 : 1);}
202 ${RELOCATING+PROVIDE (__bss_end = .);}
205 ${RELOCATING+ . = ALIGN(4);}
208 ${RELOCATING+ _heap = .;}
209 ${RELOCATING+ _heap_start = .;}
210 ${RELOCATING+ . += _HEAP_SIZE;}
211 ${RELOCATING+ _heap_end = .;}
214 ${RELOCATING+ . = ALIGN(4);}
217 ${RELOCATING+ _stack_end = .;}
218 ${RELOCATING+ . += _STACK_SIZE;}
219 ${RELOCATING+ . = ALIGN(. != 0 ? 8 : 1);}
220 ${RELOCATING+ _stack = .;}
221 ${RELOCATING+ _end = .;}
226 ${RELOCATING+*(.tdata.*)}
227 ${RELOCATING+*(.gnu.linkonce.td.*)}
231 ${RELOCATING+*(.tbss.*)}
232 ${RELOCATING+*(.gnu.linkonce.tb.*)}