source: rtems/c/src/lib/libbsp/m68k/uC5282/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: 6.6 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Arcturus uC DIMM ColdFire 5282
4 *
5 *  Author: W. Eric Norum <norume@aps.anl.gov>
6 *
7 *  COPYRIGHT (c) 2005-2007.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 */
14
15/*
16 * Declare some locations and sizes.
17 */
18RamBase = DEFINED(RamBase) ? RamBase : 0x0;
19RamSize = DEFINED(RamSize) ? RamSize : 16M;
20HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
21_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000;
22_FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ;
23
24/*
25 * Location of downloaded (from TFTP or flash) file
26 */
27_DownloadLocation = 0x40000;
28
29/*
30 * System clock speed
31 *
32 * If autodetection of the system clock pased on the PLL ref. clock
33 * (AFAIK 8MHz for both 64MHz and 80MHz boards) doesn't work then
34 * you can:
35 *   - define (nonzero) system clock speed from app- linkflags (or here)
36 *   - use a uCbootloader env. var: SYS_CLOCK_SPEED to define it.
37 * You can also redefine the PLL reference clock speed from linkflags
38 * or here...
39 */
40_CPUClockSpeed    = DEFINED(_CPUClockSpeed)    ? _CPUClockSpeed : 0 ;
41_PLLRefClockSpeed = DEFINED(_PLLRefClockSpeed) ? _PLLRefClockSpeed : 8000000;
42
43/*
44 * Location of on-chip devices
45 */
46__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
47__SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
48_VBR = 0x0;
49
50ENTRY(start)
51MEMORY
52{
53    ram : ORIGIN = 0, LENGTH = 16M
54    sram : ORIGIN = 0x20000000, LENGTH = 64k
55}
56
57SECTIONS
58{
59
60    _header_offset = 0;
61
62    /*
63     * Text, data and bss segments
64     */
65    .text _DownloadLocation : {
66
67        *(.text*)
68        *(.ram_code)
69
70        /*
71         * C++ constructors/destructors
72         */
73        *(.gnu.linkonce.t.*)
74
75        /*
76         * Initialization and finalization code.
77         *
78         * Various files can provide initialization and finalization
79         * functions.  crtbegin.o and crtend.o are two instances. The
80         * body of these functions are in .init and .fini sections. We
81         * accumulate the bodies here, and prepend function prologues
82         * from crti.o and function epilogues from crtn.o. crti.o must
83         * be linked first; crtn.o must be linked last.  Because these
84         * are wildcards, it doesn't matter if the user does not
85         * actually link against crti.o and crtn.o; the linker won't
86         * look for a file to match a wildcard.  The wildcard also
87         * means that it doesn't matter which directory crti.o and
88         * crtn.o are in.
89         */
90        PROVIDE (_init = .);
91        *crti.o(.init)
92        *(.init)
93        *crtn.o(.init)
94        PROVIDE (_fini = .);
95        *crti.o(.fini)
96        *(.fini)
97        *crtn.o(.fini)
98
99        /*
100         * Special FreeBSD sysctl sections.
101         */
102        . = ALIGN (16);
103        __start_set_sysctl_set = .;
104        *(set_sysctl_*);
105        __stop_set_sysctl_set = ABSOLUTE(.);
106        *(set_domain_*);
107        *(set_pseudo_*);
108
109        /*
110         * C++ constructors/destructors
111         *
112         * gcc uses crtbegin.o to find the start of the constructors
113         * and destructors so we make sure it is first.  Because this
114         * is a wildcard, it doesn't matter if the user does not
115         * actually link against crtbegin.o; the linker won't look for
116         * a file to match a wildcard.  The wildcard also means that
117         * it doesn't matter which directory crtbegin.o is in. The
118         * constructor and destructor list are terminated in
119         * crtend.o.  The same comments apply to it.
120         */
121        . = ALIGN (16);
122        *crtbegin.o(.ctors)
123        *(.ctors)
124        *crtend.o(.ctors)
125        *crtbegin.o(.dtors)
126        *(.dtors)
127        *crtend.o(.dtors)
128
129        /*
130         * Exception frame info
131         */
132        . = ALIGN (16);
133        *(.eh_frame)
134
135        /*
136         * Read-only data
137         */
138        . = ALIGN (16);
139        _rodata_start = . ;
140        *(.rodata*)
141        *(.gnu.linkonce.r*)
142
143        . = ALIGN (16);
144
145        *(.console_gdb_xfer)
146        *(.bootstrap_data)
147        . = ALIGN(16);
148        _estuff = .;
149        PROVIDE (_etext = .);
150    } >ram
151
152    .tdata : {
153        _TLS_Data_begin = .;
154        *(.tdata .tdata.* .gnu.linkonce.td.*)
155        _TLS_Data_end = .;
156    } > ram
157
158    .tbss : {
159        _TLS_BSS_begin = .;
160        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
161        _TLS_BSS_end = .;
162    } > ram
163
164    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
165    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
166    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
167    _TLS_Alignment = ALIGNOF (.tdata);
168
169    .data : {
170        PROVIDE( _data_dest_start = . );
171        PROVIDE( _copy_start = .);
172        *(.data*)
173        *(.gnu.linkonce.d*)
174        *(.gcc_except_table*)
175        *(.jcr)
176        . = ALIGN (16);
177        PROVIDE (_edata = .);
178        PROVIDE (_copy_end = .);
179        PROVIDE (_data_dest_end = . );
180    } >ram
181
182    _data_src_start = LOADADDR(.data);
183    _data_src_end = _data_src_start + SIZEOF(.data);
184
185    .bss : {
186        _clear_start = .;
187        *(.bss*)
188        *(.gnu.linkonce.b.*)
189        *(COMMON)
190        . = ALIGN (16);
191        PROVIDE (end = .);
192        _clear_end = .;
193        WorkAreaBase = .;
194    } >ram
195
196  /* Stabs debugging sections.  */
197  .stab 0 : { *(.stab) }
198  .stabstr 0 : { *(.stabstr) }
199  .stab.excl 0 : { *(.stab.excl) }
200  .stab.exclstr 0 : { *(.stab.exclstr) }
201  .stab.index 0 : { *(.stab.index) }
202  .stab.indexstr 0 : { *(.stab.indexstr) }
203  .comment 0 : { *(.comment) }
204
205  /* DWARF debug sections.
206     Symbols in the DWARF debugging sections are relative to the beginning
207     of the section so we begin them at 0.  */
208  /* DWARF 1 */
209  .debug          0 : { *(.debug) }
210  .line           0 : { *(.line) }
211
212  /* GNU DWARF 1 extensions */
213  .debug_srcinfo  0 : { *(.debug_srcinfo) }
214  .debug_sfnames  0 : { *(.debug_sfnames) }
215
216  /* DWARF 1.1 and DWARF 2 */
217  .debug_aranges  0 : { *(.debug_aranges) }
218  .debug_pubnames 0 : { *(.debug_pubnames) }
219
220  /* DWARF 2 */
221  .debug_info     0 : { *(.debug_info) }
222  .debug_abbrev   0 : { *(.debug_abbrev) }
223  .debug_line     0 : { *(.debug_line) }
224  .debug_frame    0 : { *(.debug_frame) }
225  .debug_str      0 : { *(.debug_str) }
226  .debug_loc      0 : { *(.debug_loc) }
227  .debug_macinfo  0 : { *(.debug_macinfo) }
228
229  /* SGI/MIPS DWARF 2 extensions */
230  .debug_weaknames 0 : { *(.debug_weaknames) }
231  .debug_funcnames 0 : { *(.debug_funcnames) }
232  .debug_typenames 0 : { *(.debug_typenames) }
233  .debug_varnames  0 : { *(.debug_varnames) }
234  /* These must appear regardless of  .  */
235
236PROVIDE (end_of_all = .);
237}
Note: See TracBrowser for help on using the repository browser.