source: rtems/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM @ f331442d

4.104.114.84.95
Last change on this file since f331442d was c0c6168, checked in by Joel Sherrill <joel.sherrill@…>, on 01/20/03 at 20:33:17

2003-01-20 Duane Gustavus <duane@…>

  • console/sci.c, include/mrm332.h, startup/linkcmds, startup/linkcmds_ROM: Various updates to make this run properly from ROM.
  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*  linkcmds
2 *
3 *  $Id$
4 */
5
6OUTPUT_ARCH(m68k)
7STARTUP(except_vect_332_ROM.o)
8__DYNAMIC  =  0;
9
10/*
11 * ROM:
12 * +--------------------+ <- low memory
13 * | .text              |
14 * |        etext       |
15 * |        ctor list   | the ctor and dtor lists are for
16 * |        dtor list   | C++ support
17 * |        _endtext    |
18 * | temporary .data    | .data is moved to RAM by crt0
19 * |                    |
20 * +--------------------+ <- high memory
21 *
22 *
23 * RAM:
24 * +--------------------+ <- low memory
25 * | .data              | initialized data goes here
26 * |        _sdata      |
27 * |        _edata      |
28 * +--------------------+
29 * | .bss               |
30 * |        __bss_start | start of bss, cleared by crt0
31 * |        _end        | start of heap, used by sbrk()
32 * +--------------------+
33 * |    heap space      |
34 * |        _ENDHEAP    |
35 * |    stack space     |
36 * |        __stack     | top of stack
37 * +--------------------+ <- high memory
38 */
39
40MEMORY
41{
42  rom     : ORIGIN = 0x90000, LENGTH = 0x70000
43  ram     : ORIGIN = 0x03000, LENGTH = 0x7d000
44}
45
46_RamBase = DEFINED(_RamBase) ? _RamBase : 0x003000;
47_RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000;
48_RamEnd = _RamBase + _RamSize;
49
50__end_of_ram = 0x080000;
51_copy_data_from_rom = 1;
52_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
53_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
54
55/*
56 *
57 */
58SECTIONS
59{
60  .text :
61  {
62    . = .;
63    CREATE_OBJECT_SYMBOLS
64    text_start = .;
65    _text_start = .;
66    *(.text)
67    . = ALIGN (16);
68
69
70    /*
71     * Initialization and finalization code.
72     *
73     * Various files can provide initialization and finalization
74     * functions.  crtbegin.o and crtend.o are two instances. The
75     * body of these functions are in .init and .fini sections. We
76     * accumulate the bodies here, and prepend function prologues
77     * from crti.o and function epilogues from crtn.o. crti.o must
78     * be linked first; crtn.o must be linked last.  Because these
79     * are wildcards, it doesn't matter if the user does not
80     * actually link against crti.o and crtn.o; the linker won't
81     * look for a file to match a wildcard.  The wildcard also
82     * means that it doesn't matter which directory crti.o and
83     * crtn.o are in.
84     */
85    PROVIDE (_init = .);
86    *crti.o(.init)
87    *(.init)
88    *crtn.o(.init)
89    PROVIDE (_fini = .);
90    *crti.o(.fini)
91    *(.fini)
92    *crtn.o(.fini)
93
94    /*
95     * Special FreeBSD sysctl sections.
96     */
97    . = ALIGN (16);
98    __start_set_sysctl_set = .;
99    *(set_sysctl_*);
100    __stop_set_sysctl_set = ABSOLUTE(.);
101    *(set_domain_*);
102    *(set_pseudo_*);
103
104    /*
105     * C++ constructors/destructors
106     *
107     * gcc uses crtbegin.o to find the start of the constructors
108     * and destructors so we make sure it is first.  Because this
109     * is a wildcard, it doesn't matter if the user does not
110     * actually link against crtbegin.o; the linker won't look for
111     * a file to match a wildcard.  The wildcard also means that
112     * it doesn't matter which directory crtbegin.o is in. The
113     * constructor and destructor list are terminated in
114     * crtend.o.  The same comments apply to it.
115     */
116    . = ALIGN (16);
117    *crtbegin.o(.ctors)
118    *(.ctors)
119    *crtend.o(.ctors)
120    *crtbegin.o(.dtors)
121    *(.dtors)
122    *crtend.o(.dtors)
123
124    *(.eh_frame)
125    . = ALIGN (16);
126
127    /*
128     * Read-only data
129     */
130    . = ALIGN (16);
131    _rodata_start = . ;
132    *(.rodata*)
133    *(.gnu.linkonce.r*)
134
135    etext = ALIGN(0x10);
136    __CTOR_LIST__ = .;
137    LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
138    *(.ctors)
139    LONG(0)
140    __CTOR_END__ = .;
141    __DTOR_LIST__ = .;
142    LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
143    *(.dtors)
144    LONG(0)
145    __DTOR_END__ = .;
146    *(.lit)
147    *(.shdata)
148    _etext = .;
149    _endtext = .;
150  } > rom
151  .gcc_exc :
152  AT ( ADDR(.text) + SIZEOF( .text ) )
153  {
154    *(.gcc_exc)
155  } > ram
156  .data :
157  {
158    data_start = .;
159    _data_start = .;
160    _copy_start = .;
161    _sdata = . ;
162    *(.data)
163    *(.gnu.linkonce.d*)
164    *(.gcc_except_table)
165    *(.jcr)
166
167    CONSTRUCTORS
168    edata = ALIGN(0x10);
169    _edata = .;
170  } > ram
171  .shbss :
172  {
173    *(.shbss)
174  } > ram
175  .bss :
176  {
177    __bss_start = ALIGN(0x8);
178    bss_start = .;
179    _bss_start = .;
180    _clear_start = .;
181    *(.bss)
182    *(COMMON)
183    . = ALIGN (16);
184    end = .;
185    _end = ALIGN(0x8);
186    __end = ALIGN(0x8);
187
188    _WorkspaceBase = . + _StackSize;
189  } > ram
190  .stab . (NOLOAD) :
191  {
192    [ .stab ]
193  }
194  .stabstr . (NOLOAD) :
195  {
196    [ .stabstr ]
197  }
198}
Note: See TracBrowser for help on using the repository browser.