source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

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