source: rtems/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds @ 1144653

4.104.114.84.95
Last change on this file since 1144653 was 1144653, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/07 at 20:33:33

2007-05-03 Joel Sherrill <joel@…>

  • startup/linkcmds: Handle .data.* sections
  • Property mode set to 100644
File size: 5.9 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 *  $Id$
15 */
16
17/*
18 * Declare some locations and sizes.
19 */
20_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0 ;
21_RamSize = DEFINED(_RamSize) ? _RamSize : 16M ;
22_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0 ;
23_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000 ;
24_FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ;
25
26/*
27 * Location of downloaded (from TFTP or flash) file
28 */
29_DownloadLocation = 0x40000;
30
31/*
32 * System clock speed
33 */
34_CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 64000000 ;
35
36/*
37 * Location of on-chip devices
38 */
39__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
40__SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
41_VBR = 0x0;
42
43ENTRY(start)
44MEMORY
45{
46    ram : ORIGIN = 0, LENGTH = 16M
47    sram : ORIGIN = 0x20000000, LENGTH = 64k
48}
49
50SECTIONS
51{
52   
53    _header_offset = 0;
54   
55    /*
56     * Text, data and bss segments
57     */
58    .text _DownloadLocation : {
59       
60       *(.text*)
61        *(.ram_code)
62
63        /*
64         * C++ constructors/destructors
65         */
66        *(.gnu.linkonce.t.*)
67
68        /*
69         * Initialization and finalization code.
70              *
71              * Various files can provide initialization and finalization
72         * functions.  crtbegin.o and crtend.o are two instances. The
73         * body of these functions are in .init and .fini sections. We
74         * accumulate the bodies here, and prepend function prologues
75         * from crti.o and function epilogues from crtn.o. crti.o must
76         * be linked first; crtn.o must be linked last.  Because these
77         * are wildcards, it doesn't matter if the user does not
78         * actually link against crti.o and crtn.o; the linker won't
79         * look for a file to match a wildcard.  The wildcard also
80         * means that it doesn't matter which directory crti.o and
81         * crtn.o are in.
82         */
83        PROVIDE (_init = .);
84        *crti.o(.init)
85        *(.init)
86        *crtn.o(.init)
87        PROVIDE (_fini = .);
88        *crti.o(.fini)
89        *(.fini)
90        *crtn.o(.fini)
91
92        /*
93         * Special FreeBSD sysctl sections.
94         */
95        . = ALIGN (16);
96        __start_set_sysctl_set = .;
97        *(set_sysctl_*);
98        __stop_set_sysctl_set = ABSOLUTE(.);
99        *(set_domain_*);
100        *(set_pseudo_*);
101
102
103        /*
104         * C++ constructors/destructors
105         *
106         * gcc uses crtbegin.o to find the start of the constructors
107         * and destructors so we make sure it is first.  Because this
108         * is a wildcard, it doesn't matter if the user does not
109         * actually link against crtbegin.o; the linker won't look for
110         * a file to match a wildcard.  The wildcard also means that
111         * it doesn't matter which directory crtbegin.o is in. The
112         * constructor and destructor list are terminated in
113         * crtend.o.  The same comments apply to it.
114         */
115        . = ALIGN (16);
116        *crtbegin.o(.ctors)
117        *(.ctors)
118        *crtend.o(.ctors)
119        *crtbegin.o(.dtors)
120        *(.dtors)
121        *crtend.o(.dtors)
122
123        /*
124         * Exception frame info
125         */
126        . = ALIGN (16);
127        *(.eh_frame)
128
129        /*
130         * Read-only data
131         */
132        . = ALIGN (16);
133        _rodata_start = . ;
134        *(.rodata*)
135        *(.gnu.linkonce.r*)
136       
137        . = ALIGN (16);
138
139        *(.console_gdb_xfer)
140        *(.bootstrap_data)
141        . = ALIGN(16);
142        _estuff = .;
143    PROVIDE (_etext = .);
144    } >ram
145       
146        .data : {
147            PROVIDE( _data_dest_start = . );
148            PROVIDE( _copy_start = .);
149            *(.data*)
150            *(.gnu.linkonce.d*)
151            *(.gcc_except_table)
152            *(.jcr)
153            . = ALIGN (16);
154            PROVIDE (_edata = .);
155        PROVIDE (_copy_end = .);
156        PROVIDE (_data_dest_end = . );
157        } >ram
158
159        _data_src_start = LOADADDR(.data);
160        _data_src_end = _data_src_start + SIZEOF(.data);       
161       
162        .bss : {
163                _clear_start = .;
164                *(.bss*)
165                *(.gnu.linkonce.b.*)
166                *(COMMON)
167                . = ALIGN (16);
168                PROVIDE (end = .);
169                _clear_end = .;
170
171                _WorkspaceBase = .;
172        } >ram
173  /* Stabs debugging sections.  */
174  .stab 0 : { *(.stab) }
175  .stabstr 0 : { *(.stabstr) }
176  .stab.excl 0 : { *(.stab.excl) }
177  .stab.exclstr 0 : { *(.stab.exclstr) }
178  .stab.index 0 : { *(.stab.index) }
179  .stab.indexstr 0 : { *(.stab.indexstr) }
180  .comment 0 : { *(.comment) }
181
182  /* DWARF debug sections.
183     Symbols in the DWARF debugging sections are relative to the beginning
184     of the section so we begin them at 0.  */
185  /* DWARF 1 */
186  .debug          0 : { *(.debug) }
187  .line           0 : { *(.line) }
188 
189  /* GNU DWARF 1 extensions */
190  .debug_srcinfo  0 : { *(.debug_srcinfo) }
191  .debug_sfnames  0 : { *(.debug_sfnames) }
192 
193  /* DWARF 1.1 and DWARF 2 */
194  .debug_aranges  0 : { *(.debug_aranges) }
195  .debug_pubnames 0 : { *(.debug_pubnames) }
196 
197  /* DWARF 2 */
198  .debug_info     0 : { *(.debug_info) }
199  .debug_abbrev   0 : { *(.debug_abbrev) }
200  .debug_line     0 : { *(.debug_line) }
201  .debug_frame    0 : { *(.debug_frame) }
202  .debug_str      0 : { *(.debug_str) }
203  .debug_loc      0 : { *(.debug_loc) }
204  .debug_macinfo  0 : { *(.debug_macinfo) }
205 
206  /* SGI/MIPS DWARF 2 extensions */
207  .debug_weaknames 0 : { *(.debug_weaknames) }
208  .debug_funcnames 0 : { *(.debug_funcnames) }
209  .debug_typenames 0 : { *(.debug_typenames) }
210  .debug_varnames  0 : { *(.debug_varnames) }
211  /* These must appear regardless of  .  */
212
213PROVIDE (end_of_all = .); 
214}
Note: See TracBrowser for help on using the repository browser.