source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash @ 384171c

4.104.115
Last change on this file since 384171c was 384171c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 22:16:07

2008-09-16 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, startup/linkcmds, startup/linkcmdsflash, startup/linkcmdsram: Use top level shared bsp_get_work_area() implementation.
  • Property mode set to 100644
File size: 4.9 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Freescale ColdFire mcf5235
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.
11 *
12 *  $Id$
13 */
14
15/*
16 * declare for the MCF5235_BSP_START_FROM_FLASH
17 * 0 - use debug monitor to load to ram
18 * 1 - load everything from flash from scratch
19 */
20MCF5235_BSP_START_FROM_FLASH = 1;
21
22/*
23 * Declare some sizes.
24 */
25RamBase = DEFINED(RamBase) ? RamBase : 0x0;
26RamSize = DEFINED(RamSize) ? RamSize : 16M;
27HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
28
29
30/*
31 * System clock speed
32 */
33_CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 150000000 ;
34
35/*
36 * Location of on-chip devices
37 */
38__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
39__SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
40_VBR = 0x0;
41
42ENTRY(start)
43/*
44 *  NOTE: If loading to flash with dBUG remember to change the origin to 0xFFF00000 because that's where user flash is
45 *  located.
46 */
47MEMORY
48{
49    ram : ORIGIN = 0, LENGTH = 16M
50    sram : ORIGIN = 0x20000000, LENGTH = 64K
51    flash : ORIGIN = 0xFFE00000, LENGTH = 2M
52}
53
54SECTIONS
55{
56   
57    _header_offset = 0;
58   
59    /*
60     * Text, data and bss segments
61     */
62    .text : {
63       
64       *(.text*)
65        *(.ram_code)
66
67        /*
68         * C++ constructors/destructors
69         */
70        *(.gnu.linkonce.t.*)
71
72        /*
73         * Initialization and finalization code.
74         *
75         * Various files can provide initialization and finalization
76         * functions.  crtbegin.o and crtend.o are two instances. The
77         * body of these functions are in .init and .fini sections. We
78         * accumulate the bodies here, and prepend function prologues
79         * from crti.o and function epilogues from crtn.o. crti.o must
80         * be linked first; crtn.o must be linked last.  Because these
81         * are wildcards, it doesn't matter if the user does not
82         * actually link against crti.o and crtn.o; the linker won't
83         * look for a file to match a wildcard.  The wildcard also
84         * means that it doesn't matter which directory crti.o and
85         * crtn.o are in.
86         */
87        PROVIDE (_init = .);
88        *crti.o(.init)
89        *(.init)
90        *crtn.o(.init)
91        PROVIDE (_fini = .);
92        *crti.o(.fini)
93        *(.fini)
94        *crtn.o(.fini)
95
96        /*
97         * Special FreeBSD sysctl sections.
98         */
99        . = ALIGN (16);
100        __start_set_sysctl_set = .;
101        *(set_sysctl_*);
102        __stop_set_sysctl_set = ABSOLUTE(.);
103        *(set_domain_*);
104        *(set_pseudo_*);
105
106
107        /*
108         * C++ constructors/destructors
109         *
110         * gcc uses crtbegin.o to find the start of the constructors
111         * and destructors so we make sure it is first.  Because this
112         * is a wildcard, it doesn't matter if the user does not
113         * actually link against crtbegin.o; the linker won't look for
114         * a file to match a wildcard.  The wildcard also means that
115         * it doesn't matter which directory crtbegin.o is in. The
116         * constructor and destructor list are terminated in
117         * crtend.o.  The same comments apply to it.
118         */
119        . = ALIGN (16);
120        *crtbegin.o(.ctors)
121        *(.ctors)
122        *crtend.o(.ctors)
123        *crtbegin.o(.dtors)
124        *(.dtors)
125        *crtend.o(.dtors)
126
127        /*
128         * Exception frame info
129         */
130        . = ALIGN (16);
131        *(.eh_frame)
132
133        /*
134         * Read-only data
135         */
136        . = ALIGN (16);
137        _rodata_start = . ;
138        *(.rodata*)
139        *(.gnu.linkonce.r*)
140       
141        . = ALIGN (16);
142
143        *(.console_gdb_xfer)
144        *(.bootstrap_data)
145        . = ALIGN(16);
146        _estuff = .;
147    PROVIDE (_etext = .);
148    } >flash
149       
150        .data 0x4000 : AT ( ADDR(.text) + SIZEOF ( .text ) )
151        {
152            PROVIDE( _data_dest_start = . );
153            PROVIDE( _copy_start = .);
154            *(.data)
155            *(.gnu.linkonce.d*)
156            *(.gcc_except_table*)
157            *(.jcr)
158            . = ALIGN (16);
159            PROVIDE (_edata = .);
160        PROVIDE (_copy_end = .);
161        PROVIDE (_data_dest_end = . );
162        } >ram
163
164        _data_src_start = _estuff;
165        _data_src_end = _data_dest_start + SIZEOF(.data);       
166       
167        .bss : {
168                _clear_start = .;
169                *(.bss*)
170                *(COMMON)
171                . = ALIGN (16);
172                PROVIDE (end = .);
173                _clear_end = .;
174
175                WorkAreaBase = .;
176        } >ram
177  /* Stabs debugging sections.  */
178  .stab 0 : { *(.stab) }
179  .stabstr 0 : { *(.stabstr) }
180  .stab.excl 0 : { *(.stab.excl) }
181  .stab.exclstr 0 : { *(.stab.exclstr) }
182  .stab.index 0 : { *(.stab.index) }
183  .stab.indexstr 0 : { *(.stab.indexstr) }
184  .comment 0 : { *(.comment) }
185
186PROVIDE (end_of_all = .); 
187}
Note: See TracBrowser for help on using the repository browser.