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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 5.2 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        *(.gnu.linkonce.r*)
134       
135        . = ALIGN (16);
136
137        *(.console_gdb_xfer)
138        *(.bootstrap_data)
139        . = ALIGN(16);
140        _estuff = .;
141    PROVIDE (_etext = .);
142    } >ram
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_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
158    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
159    _TLS_Alignment = ALIGNOF (.tdata);
160       
161        .data : {
162            PROVIDE( _data_dest_start = . );
163            PROVIDE( _copy_start = .);
164            *(.data*)
165            *(.gnu.linkonce.d*)
166            *(.gcc_except_table*)
167            *(.jcr)
168            . = ALIGN (16);
169            PROVIDE (_edata = .);
170        PROVIDE (_copy_end = .);
171        PROVIDE (_data_dest_end = . );
172        } >ram
173
174        _data_src_start = _estuff;
175        _data_src_end = _data_dest_start + SIZEOF(.data);       
176       
177        .bss : {
178                _clear_start = .;
179                *(.bss*)
180                *(COMMON)
181                . = ALIGN (16);
182                PROVIDE (end = .);
183                _clear_end = .;
184
185                WorkAreaBase = .;
186        } >ram
187  /* Stabs debugging sections.  */
188  .stab 0 : { *(.stab) }
189  .stabstr 0 : { *(.stabstr) }
190  .stab.excl 0 : { *(.stab.excl) }
191  .stab.exclstr 0 : { *(.stab.exclstr) }
192  .stab.index 0 : { *(.stab.index) }
193  .stab.indexstr 0 : { *(.stab.indexstr) }
194  .comment 0 : { *(.comment) }
195
196PROVIDE (end_of_all = .); 
197}
Note: See TracBrowser for help on using the repository browser.