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