source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash @ 960fd85

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

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