source: rtems/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 5.1 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.org/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        KEEP (*(SORT(.rtemsroset.*)))
114        *(.gnu.linkonce.r*)
115
116        . = ALIGN (16);
117
118        *(.console_gdb_xfer)
119        *(.bootstrap_data)
120    } >flash
121
122    .tdata : {
123        _TLS_Data_begin = .;
124        *(.tdata .tdata.* .gnu.linkonce.td.*)
125        _TLS_Data_end = .;
126        . = ALIGN(16);
127        _estuff = .;
128        PROVIDE (_etext = .);
129    } >flash
130
131    .tbss : {
132        _TLS_BSS_begin = .;
133        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
134        _TLS_BSS_end = .;
135    } >flash
136
137    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
138    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
139    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
140    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
141    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
142    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
143
144    .data 0x20000400 : AT (_estuff)
145    {
146        PROVIDE( _data_dest_start = . );
147        PROVIDE( _copy_start = .);
148        *(.data*)
149        KEEP (*(SORT(.rtemsrwset.*)))
150        *(.gnu.linkonce.d*)
151        *(.gcc_except_table*)
152        *(.jcr)
153        . = ALIGN (16);
154        PROVIDE (_edata = .);
155        PROVIDE (_copy_end = .);
156        PROVIDE (_data_dest_end = . );
157    } >sram
158
159    _data_src_start = _estuff;
160    _data_src_end = _data_dest_start + SIZEOF(.data);
161
162    .bss :
163    {
164        PROVIDE (_clear_start = .);
165        *(.bss*)
166        *(COMMON)
167        . = ALIGN (16);
168        PROVIDE (_end = .);
169        PROVIDE (_clear_end = .);
170    } >sram
171
172    .stack :
173    {
174        /*
175         * Starting Stack
176         */
177        . += _StackSize;
178        . = ALIGN (16);
179        PROVIDE(_StackInit = .);
180        PROVIDE(WorkAreaBase = .);
181    } >sram
182
183    /* Stabs debugging sections.  */
184    .stab 0 : { *(.stab) }
185    .stabstr 0 : { *(.stabstr) }
186    .stab.excl 0 : { *(.stab.excl) }
187    .stab.exclstr 0 : { *(.stab.exclstr) }
188    .stab.index 0 : { *(.stab.index) }
189    .stab.indexstr 0 : { *(.stab.indexstr) }
190    .comment 0 : { *(.comment) }
191
192    PROVIDE (end_of_all = .);
193}
Note: See TracBrowser for help on using the repository browser.