source: rtems/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds @ 510f8b4d

4.104.115
Last change on this file since 510f8b4d was 510f8b4d, checked in by Joel Sherrill <joel.sherrill@…>, on 05/04/10 at 00:06:51

2010-05-03 Joel Sherrill <joel.sherrilL@…>

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