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

4.115
Last change on this file since ae03ad26 was ae03ad26, checked in by Joel Sherrill <joel.sherrill@…>, on 09/02/14 at 17:29:42

mcf5235/.../linkcmds: Use dram region consistently like other variants

"ram" and "dram" regions were used inconsistently. Most variants
used the "dram" memory region so this was changed to be consistent.

  • 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    dram : 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        *(.gnu.linkonce.r*)
134       
135        . = ALIGN (16);
136
137        *(.console_gdb_xfer)
138        *(.bootstrap_data)
139        . = ALIGN(16);
140        _estuff = .;
141    PROVIDE (_etext = .);
142    } > dram
143
144    .tdata : {
145        _TLS_Data_begin = .;
146        *(.tdata .tdata.* .gnu.linkonce.td.*)
147        _TLS_Data_end = .;
148    } > dram
149
150    .tbss : {
151        _TLS_BSS_begin = .;
152        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
153        _TLS_BSS_end = .;
154    } > dram
155
156    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
157    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
158    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
159    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
160    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
161    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
162       
163        .data : {
164            PROVIDE( _data_dest_start = . );
165            PROVIDE( _copy_start = .);
166            *(.data*)
167            *(.gnu.linkonce.d*)
168            *(.gcc_except_table*)
169            *(.jcr)
170            . = ALIGN (16);
171            PROVIDE (_edata = .);
172        PROVIDE (_copy_end = .);
173        PROVIDE (_data_dest_end = . );
174        } > dram
175
176        _data_src_start = _estuff;
177        _data_src_end = _data_dest_start + SIZEOF(.data);       
178       
179        .bss : {
180                _clear_start = .;
181                *(.bss*)
182                *(COMMON)
183                . = ALIGN (16);
184                PROVIDE (end = .);
185                _clear_end = .;
186
187                WorkAreaBase = .;
188        } > dram
189  /* Stabs debugging sections.  */
190  .stab 0 : { *(.stab) }
191  .stabstr 0 : { *(.stabstr) }
192  .stab.excl 0 : { *(.stab.excl) }
193  .stab.exclstr 0 : { *(.stab.exclstr) }
194  .stab.index 0 : { *(.stab.index) }
195  .stab.indexstr 0 : { *(.stab.indexstr) }
196  .comment 0 : { *(.comment) }
197
198PROVIDE (end_of_all = .); 
199}
Note: See TracBrowser for help on using the repository browser.