source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram @ e545bfa

4.104.114.84.95
Last change on this file since e545bfa was 504c5ca, checked in by Joel Sherrill <joel.sherrill@…>, on 06/23/06 at 16:04:33

2006-06-23 Worth Burruss <worth@…>

  • Makefile.am, README, startup/init5235.c, startup/linkcmds, startup/linkcmdsflash, startup/linkcmdsram: Modify to the mcf5235 eval boards to either load and run from ram using the dBug moniter as the boot deviced (Board setup as shipped from the factory), or it allows the user to Boot his code from flash he loads onto the eval board. The code changes between the two are based on the selected linker script using a variable in the script. The options to the linker are used to override the default linker script and select which options to configure at boot either from flash, or from ram:

-qnolinkcmds -T linkcmdsflash

If no options are given the standard linker sript assumes dBug was
used to set up the board and the user is going to load his program
to RAM.

  • Property mode set to 100644
File size: 4.8 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.OARcorp.com/rtems/license.html.
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 = 0;
21
22/*
23 * Declare some sizes.
24 */
25_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0 ;
26_RamSize = DEFINED(_RamSize) ? _RamSize : 16M ;
27_HeapSize = 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)
43MEMORY
44{
45    ram : ORIGIN = 0, LENGTH = 16M
46    sram : ORIGIN = 0x20000000, LENGTH = 64K
47    flash : ORIGIN = 0xFFE00000, LENGTH = 2M
48}
49
50SECTIONS
51{
52   
53    _header_offset = 0;
54   
55    /*
56     * Text, data and bss segments
57     */
58    .text 0x40000 : {
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 = _estuff;
160        _data_src_end = _data_dest_start + SIZEOF(.data);       
161       
162        .bss : {
163                _clear_start = .;
164                *(.bss*)
165                *(COMMON)
166                . = ALIGN (16);
167                PROVIDE (end = .);
168                _clear_end = .;
169
170                _WorkspaceBase = .;
171        } >ram
172  /* Stabs debugging sections.  */
173  .stab 0 : { *(.stab) }
174  .stabstr 0 : { *(.stabstr) }
175  .stab.excl 0 : { *(.stab.excl) }
176  .stab.exclstr 0 : { *(.stab.exclstr) }
177  .stab.index 0 : { *(.stab.index) }
178  .stab.indexstr 0 : { *(.stab.indexstr) }
179  .comment 0 : { *(.comment) }
180
181PROVIDE (end_of_all = .); 
182}
Note: See TracBrowser for help on using the repository browser.