source: rtems/bsps/m68k/mrm332/start/linkcmds @ 715d616

5
Last change on this file since 715d616 was 715d616, checked in by Sebastian Huber <sebastian.huber@…>, on 06/19/18 at 13:10:36

bsps: Support .rtemsstack.* linker input sections

Use a dedicated memory region or place it between the BSS and workspace.

Update #3459.

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