source: rtems/c/src/lib/libbsp/m68k/mcf5329/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.1 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.com/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        *(.gnu.linkonce.r*)
121
122        . = ALIGN (16);
123
124        *(.console_gdb_xfer)
125        *(.bootstrap_data)
126    } > boot_flash
127
128    .tdata : {
129        _TLS_Data_begin = .;
130        *(.tdata .tdata.* .gnu.linkonce.td.*)
131        _TLS_Data_end = .;
132        . = ALIGN(16);
133        _estuff = .;
134        PROVIDE (_etext = .);
135    } > boot_flash
136
137    .tbss : {
138        _TLS_BSS_begin = .;
139        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
140        _TLS_BSS_end = .;
141    } > boot_flash
142
143    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
144    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
145    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
146    _TLS_Alignment = ALIGNOF (.tdata);
147
148    .data 0x40000500 : AT (_estuff)
149    {
150        PROVIDE( _data_dest_start = . );
151        PROVIDE( _copy_start = .);
152        *(.data*)
153        *(.gnu.linkonce.d*)
154        *(.gcc_except_table*)
155        *(.jcr)
156        . = ALIGN (16);
157        PROVIDE (_edata = .);
158        PROVIDE (_copy_end = .);
159        PROVIDE (_data_dest_end = . );
160    } > dram
161
162    _data_src_start = _estuff;
163    _data_src_end = _data_dest_start + SIZEOF(.data);
164
165    .bss :
166    {
167        _clear_start = .;
168        *(.bss*)
169        *(COMMON)
170        . = ALIGN (16);
171        PROVIDE (_end = .);
172
173        _clear_end = .;
174        WorkAreaBase = .;
175    } > dram
176
177    .start_stack :
178    {
179        /*
180         * Starting Stack
181         */
182        . += _StackSize;
183        . = ALIGN (16);
184        PROVIDE(_StackInit = .);
185    } > core_sram
186
187    /* Stabs debugging sections.  */
188    .stab 0 : { *(.stab) }
189    .stabstr 0 : { *(.stabstr) }
190    .stab.excl 0 : { *(.stab.excl) }
191    .stab.exclstr 0 : { *(.stab.exclstr) }
192    .stab.index 0 : { *(.stab.index) }
193    .stab.indexstr 0 : { *(.stab.indexstr) }
194    .comment 0 : { *(.comment) }
195
196    PROVIDE (end_of_all = .);
197}
Note: See TracBrowser for help on using the repository browser.