source: rtems/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds @ 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: 4.9 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Freescale ColdFire mcf52258
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.e
11 */
12
13/*
14 * Declare some sizes.
15 */
16RamBase = DEFINED(RamBase) ? RamBase : 0x20000000;
17RamSize = DEFINED(RamSize) ? RamSize : 64K;
18HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
19_StackSize = DEFINED(_StackSize) ? _StackSize : 0x400;
20_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
21
22_VBR = 0x20000000;
23
24ENTRY(start)
25
26MEMORY
27{
28    sram : ORIGIN = 0x20000000, LENGTH = 64K
29    flash : ORIGIN = 0x00000000, LENGTH = 512K
30}
31
32SECTIONS
33{
34    /*
35    * Text, data and bss segments
36    */
37    .text : {
38
39        *(.text*)
40        *(.ram_code)
41
42        /*
43        * C++ constructors/destructors
44        */
45        *(.gnu.linkonce.t.*)
46
47        /*
48        * Initialization and finalization code.
49        *
50        * Various files can provide initialization and finalization
51        * functions.  crtbegin.o and crtend.o are two instances. The
52        * body of these functions are in .init and .fini sections. We
53        * accumulate the bodies here, and prepend function prologues
54        * from crti.o and function epilogues from crtn.o. crti.o must
55        * be linked first; crtn.o must be linked last.  Because these
56        * are wildcards, it doesn't matter if the user does not
57        * actually link against crti.o and crtn.o; the linker won't
58        * look for a file to match a wildcard.  The wildcard also
59        * means that it doesn't matter which directory crti.o and
60        * crtn.o are in.
61        */
62        PROVIDE (_init = .);
63        *crti.o(.init)
64        *(.init)
65        *crtn.o(.init)
66        PROVIDE (_fini = .);
67        *crti.o(.fini)
68        *(.fini)
69        *crtn.o(.fini)
70
71        /*
72            * Special FreeBSD sysctl sections.
73            */
74        . = ALIGN (16);
75        __start_set_sysctl_set = .;
76        *(set_sysctl_*);
77        __stop_set_sysctl_set = ABSOLUTE(.);
78        *(set_domain_*);
79        *(set_pseudo_*);
80
81        /*
82        * C++ constructors/destructors
83        *
84        * gcc uses crtbegin.o to find the start of the constructors
85        * and destructors so we make sure it is first.  Because this
86        * is a wildcard, it doesn't matter if the user does not
87        * actually link against crtbegin.o; the linker won't look for
88        * a file to match a wildcard.  The wildcard also means that
89        * it doesn't matter which directory crtbegin.o is in. The
90        * constructor and destructor list are terminated in
91        * crtend.o.  The same comments apply to it.
92        */
93        . = ALIGN (16);
94        *crtbegin.o(.ctors)
95        *(.ctors)
96        *crtend.o(.ctors)
97        *crtbegin.o(.dtors)
98        *(.dtors)
99        *crtend.o(.dtors)
100
101        /*
102        * Exception frame info
103        */
104        . = ALIGN (16);
105        *(.eh_frame)
106
107        /*
108        * Read-only data
109        */
110        . = ALIGN (16);
111        _rodata_start = . ;
112        *(.rodata*)
113        *(.gnu.linkonce.r*)
114
115        . = ALIGN (16);
116
117        *(.console_gdb_xfer)
118        *(.bootstrap_data)
119    } >flash
120
121    .tdata : {
122        _TLS_Data_begin = .;
123        *(.tdata .tdata.* .gnu.linkonce.td.*)
124        _TLS_Data_end = .;
125        . = ALIGN(16);
126        _estuff = .;
127        PROVIDE (_etext = .);
128    } >flash
129
130    .tbss : {
131        _TLS_BSS_begin = .;
132        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
133        _TLS_BSS_end = .;
134    } >flash
135
136    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
137    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
138    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
139    _TLS_Alignment = ALIGNOF (.tdata);
140
141    .data 0x20000400 : AT (_estuff)
142    {
143        PROVIDE( _data_dest_start = . );
144        PROVIDE( _copy_start = .);
145        *(.data*)
146        *(.gnu.linkonce.d*)
147        *(.gcc_except_table*)
148        *(.jcr)
149        . = ALIGN (16);
150        PROVIDE (_edata = .);
151        PROVIDE (_copy_end = .);
152        PROVIDE (_data_dest_end = . );
153    } >sram
154
155    _data_src_start = _estuff;
156    _data_src_end = _data_dest_start + SIZEOF(.data);
157
158    .bss :
159    {
160        PROVIDE (_clear_start = .);
161        *(.bss*)
162        *(COMMON)
163        . = ALIGN (16);
164        PROVIDE (_end = .);
165        PROVIDE (_clear_end = .);
166    } >sram
167
168    .stack :
169    {
170        /*
171         * Starting Stack
172         */
173        . += _StackSize;
174        . = ALIGN (16);
175        PROVIDE(_StackInit = .);
176        PROVIDE(WorkAreaBase = .);
177    } >sram
178
179    /* Stabs debugging sections.  */
180    .stab 0 : { *(.stab) }
181    .stabstr 0 : { *(.stabstr) }
182    .stab.excl 0 : { *(.stab.excl) }
183    .stab.exclstr 0 : { *(.stab.exclstr) }
184    .stab.index 0 : { *(.stab.index) }
185    .stab.indexstr 0 : { *(.stab.indexstr) }
186    .comment 0 : { *(.comment) }
187
188    PROVIDE (end_of_all = .);
189}
Note: See TracBrowser for help on using the repository browser.