source: rtems/bsps/m68k/mcf5235/start/linkcmdsram @ e10dec0

Last change on this file since e10dec0 was e10dec0, checked in by Sebastian Huber <sebastian.huber@…>, on 04/30/21 at 13:47:10

bsps: Support RTEMS_NOINIT in linkcmds

Update #3866.

  • Property mode set to 100644
File size: 5.6 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Freescale ColdFire mcf5235
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13/*
14 * declare for the MCF5235_BSP_START_FROM_FLASH
15 * 0 - use debug monitor to load to ram
16 * 1 - load everything from flash from scratch
17 */
18MCF5235_BSP_START_FROM_FLASH = 0;
19
20/*
21 * Declare some sizes.
22 */
23RamBase = DEFINED(RamBase) ? RamBase : 0x0;
24RamSize = DEFINED(RamSize) ? RamSize : 16M;
25RamEnd = RamBase + RamSize;
26HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
27
28
29/*
30 * System clock speed
31 */
32_CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 150000000 ;
33
34/*
35 * Location of on-chip devices
36 */
37__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
38__SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
39_VBR = 0x0;
40
41ENTRY(start)
42STARTUP(start.o)
43
44MEMORY
45{
46    ram : ORIGIN = 0, LENGTH = 16M
47    sram : ORIGIN = 0x20000000, LENGTH = 64K
48    flash : ORIGIN = 0xFFE00000, LENGTH = 2M
49}
50
51SECTIONS
52{
53   
54    _header_offset = 0;
55   
56    /*
57     * Text, data and bss segments
58     */
59    .text 0x40000 : {
60       
61       *(.text*)
62        *(.ram_code)
63
64        /*
65         * C++ constructors/destructors
66         */
67        *(.gnu.linkonce.t.*)
68
69        /*
70         * Initialization and finalization code.
71              *
72              * Various files can provide initialization and finalization
73         * functions.  crtbegin.o and crtend.o are two instances. The
74         * body of these functions are in .init and .fini sections. We
75         * accumulate the bodies here, and prepend function prologues
76         * from crti.o and function epilogues from crtn.o. crti.o must
77         * be linked first; crtn.o must be linked last.  Because these
78         * are wildcards, it doesn't matter if the user does not
79         * actually link against crti.o and crtn.o; the linker won't
80         * look for a file to match a wildcard.  The wildcard also
81         * means that it doesn't matter which directory crti.o and
82         * crtn.o are in.
83         */
84        PROVIDE (_init = .);
85        *crti.o(.init)
86        *(.init)
87        *crtn.o(.init)
88        PROVIDE (_fini = .);
89        *crti.o(.fini)
90        *(.fini)
91        *crtn.o(.fini)
92
93        /*
94         * Special FreeBSD sysctl sections.
95         */
96        . = ALIGN (16);
97        __start_set_sysctl_set = .;
98        *(set_sysctl_*);
99        __stop_set_sysctl_set = ABSOLUTE(.);
100        *(set_domain_*);
101        *(set_pseudo_*);
102
103
104        /*
105         * C++ constructors/destructors
106         *
107         * gcc uses crtbegin.o to find the start of the constructors
108         * and destructors so we make sure it is first.  Because this
109         * is a wildcard, it doesn't matter if the user does not
110         * actually link against crtbegin.o; the linker won't look for
111         * a file to match a wildcard.  The wildcard also means that
112         * it doesn't matter which directory crtbegin.o is in. The
113         * constructor and destructor list are terminated in
114         * crtend.o.  The same comments apply to it.
115         */
116        . = ALIGN (16);
117        *crtbegin.o(.ctors)
118        *(.ctors)
119        *crtend.o(.ctors)
120        *crtbegin.o(.dtors)
121        *(.dtors)
122        *crtend.o(.dtors)
123
124        /*
125         * Exception frame info
126         */
127        . = ALIGN (16);
128        *(.eh_frame)
129
130        /*
131         * Read-only data
132         */
133        . = ALIGN (16);
134        _rodata_start = . ;
135        *(.rodata*)
136        KEEP (*(SORT(.rtemsroset.*)))
137        *(.gnu.linkonce.r*)
138       
139        . = ALIGN (16);
140
141        *(.console_gdb_xfer)
142        *(.bootstrap_data)
143        . = ALIGN(16);
144        _estuff = .;
145    PROVIDE (_etext = .);
146    } >ram
147
148    .tdata : {
149        _TLS_Data_begin = .;
150        *(.tdata .tdata.* .gnu.linkonce.td.*)
151        _TLS_Data_end = .;
152    } >ram
153
154    .tbss : {
155        _TLS_BSS_begin = .;
156        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
157        _TLS_BSS_end = .;
158    } >ram
159
160    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
161    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
162    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
163    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
164    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
165    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
166       
167        .data : {
168            PROVIDE( _data_dest_start = . );
169            PROVIDE( _copy_start = .);
170            *(.data)
171            KEEP (*(SORT(.rtemsrwset.*)))
172            *(.gnu.linkonce.d*)
173            *(.gcc_except_table*)
174            *(.jcr)
175            . = ALIGN (16);
176            PROVIDE (_edata = .);
177        PROVIDE (_copy_end = .);
178        PROVIDE (_data_dest_end = . );
179        } >ram
180
181        _data_src_start = _estuff;
182        _data_src_end = _data_dest_start + SIZEOF(.data);       
183       
184        .bss : {
185                _clear_start = .;
186                *(.bss*)
187                *(COMMON)
188                . = ALIGN (16);
189                PROVIDE (end = .);
190                _clear_end = .;
191        } >ram
192
193        .noinit (NOLOAD) : {
194                *(.noinit*)
195        } > ram
196
197        .rtemsstack (NOLOAD) : {
198                *(SORT(.rtemsstack.*))
199                WorkAreaBase = .;
200        } >ram
201
202  /* Stabs debugging sections.  */
203  .stab 0 : { *(.stab) }
204  .stabstr 0 : { *(.stabstr) }
205  .stab.excl 0 : { *(.stab.excl) }
206  .stab.exclstr 0 : { *(.stab.exclstr) }
207  .stab.index 0 : { *(.stab.index) }
208  .stab.indexstr 0 : { *(.stab.indexstr) }
209  .comment 0 : { *(.comment) }
210
211PROVIDE (end_of_all = .); 
212}
Note: See TracBrowser for help on using the repository browser.