source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds @ b7e4837

5
Last change on this file since b7e4837 was b7e4837, checked in by Joel Sherrill <joel@…>, on 12/19/17 at 17:04:07

mcf5235: Simplify bsp_specs

Updates #3520.

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