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