source: rtems/bsps/m68k/uC5282/start/linkcmds @ 5ed00353

Last change on this file since 5ed00353 was 5ed00353, checked in by Sebastian Huber <sebastian.huber@…>, on 07/14/22 at 12:41:03

bsps: Sort .noinit* sections

Sort the .noinit* input sections by name first, then by alignment if two
sections have the same name. This allows the placement of begin/end symbols to
initialize some areas with a special value.

Update #4678.

  • Property mode set to 100644
File size: 7.3 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Arcturus uC DIMM ColdFire 5282
4 */
5
6/*
7 * Copyright (c) 2005 Eric Norum <eric@norum.ca>
8 *
9 * COPYRIGHT (c) 2005-2007.
10 * On-Line Applications Research Corporation (OAR).
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17/*
18 * Declare some locations and sizes.
19 */
20RamBase = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize = DEFINED(RamSize) ? RamSize : 16M;
22RamEnd = RamBase + RamSize;
23HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
24_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000;
25_FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ;
26
27/*
28 * Location of downloaded (from TFTP or flash) file
29 */
30_DownloadLocation = 0x40000;
31
32/*
33 * System clock speed
34 *
35 * If autodetection of the system clock pased on the PLL ref. clock
36 * (AFAIK 8MHz for both 64MHz and 80MHz boards) doesn't work then
37 * you can:
38 *   - define (nonzero) system clock speed from app- linkflags (or here)
39 *   - use a uCbootloader env. var: SYS_CLOCK_SPEED to define it.
40 * You can also redefine the PLL reference clock speed from linkflags
41 * or here...
42 */
43_CPUClockSpeed    = DEFINED(_CPUClockSpeed)    ? _CPUClockSpeed : 0 ;
44_PLLRefClockSpeed = DEFINED(_PLLRefClockSpeed) ? _PLLRefClockSpeed : 8000000;
45
46/*
47 * Location of on-chip devices
48 */
49__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
50__SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
51_VBR = 0x0;
52
53ENTRY(start)
54STARTUP(start.o)
55
56MEMORY
57{
58    ram : ORIGIN = 0, LENGTH = 16M
59    sram : ORIGIN = 0x20000000, LENGTH = 64k
60}
61
62SECTIONS
63{
64
65    _header_offset = 0;
66
67    /*
68     * Text, data and bss segments
69     */
70    .text _DownloadLocation : {
71
72        *(.text*)
73        *(.ram_code)
74
75        /*
76         * C++ constructors/destructors
77         */
78        *(.gnu.linkonce.t.*)
79
80        /*
81         * Initialization and finalization code.
82         *
83         * Various files can provide initialization and finalization
84         * functions.  crtbegin.o and crtend.o are two instances. The
85         * body of these functions are in .init and .fini sections. We
86         * accumulate the bodies here, and prepend function prologues
87         * from crti.o and function epilogues from crtn.o. crti.o must
88         * be linked first; crtn.o must be linked last.  Because these
89         * are wildcards, it doesn't matter if the user does not
90         * actually link against crti.o and crtn.o; the linker won't
91         * look for a file to match a wildcard.  The wildcard also
92         * means that it doesn't matter which directory crti.o and
93         * crtn.o are in.
94         */
95        PROVIDE (_init = .);
96        KEEP (*crti.o(.init))
97        KEEP (*(.init))
98        KEEP (*crtn.o(.init))
99        PROVIDE (_fini = .);
100        KEEP (*crti.o(.fini))
101        KEEP (*(.fini))
102        KEEP (*crtn.o(.fini))
103
104        /*
105         * Special FreeBSD sysctl sections.
106         */
107        . = ALIGN (16);
108        __start_set_sysctl_set = .;
109        *(set_sysctl_*);
110        __stop_set_sysctl_set = ABSOLUTE(.);
111        *(set_domain_*);
112        *(set_pseudo_*);
113
114        /*
115         * C++ constructors/destructors
116         *
117         * gcc uses crtbegin.o to find the start of the constructors
118         * and destructors so we make sure it is first.  Because this
119         * is a wildcard, it doesn't matter if the user does not
120         * actually link against crtbegin.o; the linker won't look for
121         * a file to match a wildcard.  The wildcard also means that
122         * it doesn't matter which directory crtbegin.o is in. The
123         * constructor and destructor list are terminated in
124         * crtend.o.  The same comments apply to it.
125         */
126        . = ALIGN (16);
127        KEEP (*crtbegin.o(.ctors))
128        KEEP (*crtbegin?.o(.ctors))
129        KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
130        KEEP (*(SORT(.ctors.*)))
131        KEEP (*(.ctors))
132        KEEP (*crtbegin.o(.dtors))
133        KEEP (*crtbegin?.o(.dtors))
134        KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
135        KEEP (*(SORT(.dtors.*)))
136        KEEP (*(.dtors))
137
138        /*
139         * Exception frame info
140         */
141        . = ALIGN (16);
142        KEEP (*(.eh_frame))
143
144        /*
145         * Read-only data
146         */
147        . = ALIGN (16);
148        _rodata_start = . ;
149        *(.rodata*)
150        KEEP (*(SORT(.rtemsroset.*)))
151        *(.gnu.linkonce.r*)
152
153        . = ALIGN (16);
154
155        *(.console_gdb_xfer)
156        *(.bootstrap_data)
157        . = ALIGN(16);
158        _estuff = .;
159        PROVIDE (_etext = .);
160    } >ram
161
162    .tdata : {
163        _TLS_Data_begin = .;
164        *(.tdata .tdata.* .gnu.linkonce.td.*)
165        _TLS_Data_end = .;
166    } > ram
167
168    .tbss : {
169        _TLS_BSS_begin = .;
170        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
171        _TLS_BSS_end = .;
172    } > ram
173
174    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
175    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
176    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
177    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
178    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
179    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
180
181    .data : {
182        PROVIDE( _data_dest_start = . );
183        PROVIDE( _copy_start = .);
184        *(.data*)
185        KEEP (*(SORT(.rtemsrwset.*)))
186        *(.gnu.linkonce.d*)
187        *(.gcc_except_table*)
188        KEEP (*(.jcr))
189        . = ALIGN (16);
190        PROVIDE (_edata = .);
191        PROVIDE (_copy_end = .);
192        PROVIDE (_data_dest_end = . );
193    } >ram
194
195    _data_src_start = LOADADDR(.data);
196    _data_src_end = _data_src_start + SIZEOF(.data);
197
198    .bss : {
199        _clear_start = .;
200        *(.bss*)
201        *(.gnu.linkonce.b.*)
202        *(COMMON)
203        . = ALIGN (16);
204        PROVIDE (end = .);
205        _clear_end = .;
206    } >ram
207
208    .noinit (NOLOAD) : {
209       *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
210    } >ram
211
212    .rtemsstack (NOLOAD) : {
213        *(SORT(.rtemsstack.*))
214        WorkAreaBase = .;
215    } >ram
216
217  /* Stabs debugging sections.  */
218  .stab 0 : { *(.stab) }
219  .stabstr 0 : { *(.stabstr) }
220  .stab.excl 0 : { *(.stab.excl) }
221  .stab.exclstr 0 : { *(.stab.exclstr) }
222  .stab.index 0 : { *(.stab.index) }
223  .stab.indexstr 0 : { *(.stab.indexstr) }
224  .comment 0 : { *(.comment) }
225
226  /* DWARF debug sections.
227     Symbols in the DWARF debugging sections are relative to the beginning
228     of the section so we begin them at 0.  */
229  /* DWARF 1 */
230  .debug          0 : { *(.debug) }
231  .line           0 : { *(.line) }
232
233  /* GNU DWARF 1 extensions */
234  .debug_srcinfo  0 : { *(.debug_srcinfo) }
235  .debug_sfnames  0 : { *(.debug_sfnames) }
236
237  /* DWARF 1.1 and DWARF 2 */
238  .debug_aranges  0 : { *(.debug_aranges) }
239  .debug_pubnames 0 : { *(.debug_pubnames) }
240
241  /* DWARF 2 */
242  .debug_info     0 : { *(.debug_info) }
243  .debug_abbrev   0 : { *(.debug_abbrev) }
244  .debug_line     0 : { *(.debug_line) }
245  .debug_frame    0 : { *(.debug_frame) }
246  .debug_str      0 : { *(.debug_str) }
247  .debug_loc      0 : { *(.debug_loc) }
248  .debug_macinfo  0 : { *(.debug_macinfo) }
249
250  /* SGI/MIPS DWARF 2 extensions */
251  .debug_weaknames 0 : { *(.debug_weaknames) }
252  .debug_funcnames 0 : { *(.debug_funcnames) }
253  .debug_typenames 0 : { *(.debug_typenames) }
254  .debug_varnames  0 : { *(.debug_varnames) }
255  /* These must appear regardless of  .  */
256
257PROVIDE (end_of_all = .);
258}
Note: See TracBrowser for help on using the repository browser.