source: rtems/bsps/powerpc/mpc8260ads/start/linkcmds @ ffa1153

5
Last change on this file since ffa1153 was ffa1153, checked in by Sebastian Huber <sebastian.huber@…>, on 12/14/19 at 20:36:09

bsps: Add RamEnd? to linker command files

Update #3838.

  • Property mode set to 100644
File size: 8.7 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the MPC8260ADS Board
4 */
5
6OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
7              "elf32-powerpc")
8OUTPUT_ARCH(powerpc)
9
10ENTRY(start)
11STARTUP(start.o)
12EXTERN(__vectors)
13
14/*
15 * Declare some sizes.
16 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
17 *      number used there is not constant.  If this happens to you, edit
18 *      the lines marked XXX below to use a constant value.
19 */
20RamBase     = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize     = DEFINED(RamSize) ? RamDiskSize : 0x0800000; /* 8M program ram */
22RamEnd      = RamBase + RamSize;
23HeapSize    = DEFINED(HeapSize) ? HeapSize : 0x0;
24RamDiskBase = DEFINED(RamDiskBase) ? RamDiskBase : 0x0800000;
25RamDiskSize = DEFINED(RamDiskSize) ? RamDiskSize : 0x0800000; /* 8M ram disk */
26
27MEMORY
28{
29  ram : org = 0x0, l = 8M
30  ramdisk : org = 0x0800000, l = 8M
31  dpram : org = 0x04700000, l = 128K
32  flash : org = 0xff800000, l = 8M
33}
34
35
36SECTIONS
37{
38    /*
39     * The stack will live in this area - between the vectors and
40     * the text section.
41     */
42
43    .text 0x10000:
44    {
45    _textbase = .;
46
47
48    text.start = .;
49
50    /* Entry point is the .entry section */
51    *(.entry)
52    *(.entry2)
53
54    /* Actual Code */
55    *(.text*)
56
57
58    *(.rodata*)
59    *(.rodata1)
60
61
62    /*
63     * Special FreeBSD sysctl sections.
64     */
65    . = ALIGN (16);
66    __start_set_sysctl_set = .;
67    *(set_sysctl_*);
68    __stop_set_sysctl_set = ABSOLUTE(.);
69    *(set_domain_*);
70    *(set_pseudo_*);
71
72    /* C++ constructors/destructors */
73    *(.gnu.linkonce.t*)
74
75    /*  Initialization and finalization code.
76     *
77     *  Various files can provide initialization and finalization functions.
78     *  The bodies of these functions are in .init and .fini sections. We
79     *  accumulate the bodies here, and prepend function prologues from
80     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
81     *  first; ecrtn.o must be linked last. Because these are wildcards, it
82     *  doesn't matter if the user does not actually link against ecrti.o and
83     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
84     *  wildcard also means that it doesn't matter which directory ecrti.o
85     *  and ecrtn.o are in.
86     */
87    PROVIDE (_init = .);
88    *ecrti.o(.init)
89    *(.init)
90    *ecrtn.o(.init)
91
92    PROVIDE (_fini = .);
93    *ecrti.o(.fini)
94    *(.fini)
95    *ecrtn.o(.init)
96
97    KEEP (*ecrti.o(.ctors))
98    KEEP (*crtbegin.o(.ctors))
99    KEEP (*crtbegin?.o(.ctors))
100    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
101    KEEP (*(SORT(.ctors.*)))
102    KEEP (*(.ctors))
103    KEEP (*ecrti.o(.dtors))
104    KEEP (*crtbegin.o(.dtors))
105    KEEP (*crtbegin?.o(.dtors))
106    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
107    KEEP (*(SORT(.dtors.*)))
108    KEEP (*(.dtors))
109
110    /* Exception frame info */
111    *(.eh_frame)
112
113    /* Miscellaneous read-only data */
114    _rodata_start = . ;
115    *(.gnu.linkonce.r*)
116    *(.lit)
117    *(.shdata)
118    *(.rodata)
119    *(.rodata1)
120    KEEP (*(SORT(.rtemsroset.*)))
121    *(.descriptors)
122    *(rom_ver)
123    _erodata = .;
124
125
126    /* Various possible names for the end of the .text section */
127    etext = ALIGN(0x10);
128    _etext = .;
129    _endtext = .;
130    text.end = .;
131    PROVIDE (etext = .);
132    PROVIDE (__etext = .);
133
134    } > ram
135
136  .tdata : {
137    _TLS_Data_begin = .;
138    *(.tdata .tdata.* .gnu.linkonce.td.*)
139    _TLS_Data_end = .;
140  } >ram
141
142  .tbss : {
143    _TLS_BSS_begin = .;
144    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
145    _TLS_BSS_end = .;
146  } >ram
147
148  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
149  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
150  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
151  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
152  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
153  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
154
155
156  .rel.dyn        :
157    {
158      *(.rel.init)
159      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
160      *(.rel.fini)
161      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
162      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
163      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
164      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
165      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
166      *(.rel.ctors)
167      *(.rel.dtors)
168      *(.rel.got)
169      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
170      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
171      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
172      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
173      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
174    } >ram
175  .rela.dyn       :
176    {
177      *(.rela.init)
178      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
179      *(.rela.fini)
180      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
181      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
182      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
183      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
184      *(.rela.ctors)
185      *(.rela.dtors)
186      *(.rela.got)
187      *(.rela.got1)
188      *(.rela.got2)
189      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
190      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
191      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
192      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
193      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
194    } >ram
195  .rel.plt        : { *(.rel.plt) }
196  .rela.plt       : { *(.rela.plt) }
197
198    PROVIDE (__EXCEPT_START__ = .);
199    .gcc_except_table   : { *(.gcc_except_table*) } >ram
200    PROVIDE (__EXCEPT_END__ = .);
201    __GOT_START__ = .;
202    .got :
203    {
204      s.got = .;
205      *(.got.plt) *(.got)
206    } > ram
207    __GOT_END__ = .;
208
209    .got1                 : { *(.got1)          } >ram
210    PROVIDE (__GOT2_START__ = .);
211    PROVIDE (_GOT2_START_ = .);
212    .got2                 :  { *(.got2)         } >ram
213    PROVIDE (__GOT2_END__ = .);
214    PROVIDE (_GOT2_END_ = .);
215
216    PROVIDE (__FIXUP_START__ = .);
217    PROVIDE (_FIXUP_START_ = .);
218    .fixup        : { *(.fixup)         } >ram
219    PROVIDE (_FIXUP_END_ = .);
220    PROVIDE (__FIXUP_END__ = .);
221
222    .sdata : {
223      bsp_section_sdata_begin = .;
224      PROVIDE (_SDA_BASE_ = 32768);
225      *(.sdata .sdata.* .gnu.linkonce.s.*)
226      bsp_section_sdata_end = .;
227  } > ram
228
229    .sbss : {
230      __bss_start = .;
231      bsp_section_sbss_begin = .;
232
233      PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
234      *(.scommon)
235      *(.dynsbss)
236      *(.sbss .sbss.* .gnu.linkonce.sb.*)
237      PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
238      bsp_section_sbss_end = .;
239      bsp_section_sdata_libdl_begin = .;
240      . = DEFINED(bsp_section_small_data_area_size) ?
241              bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
242      bsp_section_sdata_libdl_end = .;
243    } > ram
244
245    .sdata2 : {
246      PROVIDE (_SDA2_BASE_ = 32768);
247
248      *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
249    } > ram =0
250
251    .sbss2 : {
252      *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
253    } > ram =0
254
255    .bss :
256    {
257      bss.start = .;
258      *(.bss .bss* .gnu.linkonce.b*)
259      . = ALIGN(4);
260      bss.end = .;
261    } > ram
262
263    /* R/W Data */
264    .data ( . ) :
265    {
266      . = ALIGN (4);
267
268      data.start = .;
269
270      *(.data)
271      *(.data1)
272      *(.data.* .gnu.linkonce.d.*)
273      KEEP (*(SORT(.rtemsrwset.*)))
274      PROVIDE (__SDATA_START__ = .);
275      *(.sdata .sdata.* .gnu.linkonce.s.*)
276      data.end = .;
277    } > ram
278
279    data.size = data.end - data.start;
280    bss.size = bss.end - bss.start;
281    text.size = text.end - text.start;
282
283    PROVIDE(_end = data.end);
284
285    .gzipmalloc : {
286        . = ALIGN (16);
287        _startmalloc = .;
288     } >ram
289
290    clear_end = .;
291
292    .rtemsstack (NOLOAD) : {
293        *(SORT(.rtemsstack.*))
294    } >ram
295
296    WorkAreaBase = .;
297
298    /* Sections for compressed .text and .data         */
299    /* after the .datarom section is an int specifying */
300    /* the length of the following compressed image    */
301    /* Executes once then could get overwritten        */
302    .textrom 0x100000 :
303    {
304        *(.textrom)
305        _endloader = .;
306    } > ram
307
308    .datarom :
309    {
310        _dr_start = .;
311        *(.datarom)
312        _dr_end = .;
313    } > ram
314    dr_len = _dr_end - _dr_start;
315
316    .dpram :
317    {
318      m8260 = .;
319      _m8260 = .;
320      . += (128 * 1024);
321     } > dpram
322
323
324     /* the reset vector is at 0xfff00000 which is */
325     /* located at offset 0x400000 from the base   */
326     /* of flash                                   */
327    .bootrom 0xFFF00000 :
328    {
329      *(.bootrom)
330      _endboot = .;
331    } > flash
332
333
334    .line 0 : { *(.line) }
335    .debug 0 : { *(.debug) }
336    .debug_sfnames 0 : { *(.debug_sfnames) }
337    .debug_srcinfo 0 : { *(.debug_srcinfo) }
338    .debug_pubnames 0 : { *(.debug_pubnames) }
339    .debug_aranges 0 : { *(.debug_aranges) }
340    .debug_aregion 0 : { *(.debug_aregion) }
341    .debug_macinfo 0 : { *(.debug_macinfo) }
342    .stab 0 : { *(.stab) }
343    .stabstr 0 : { *(.stabstr) }
344}
Note: See TracBrowser for help on using the repository browser.