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