source: rtems/bsps/powerpc/haleakala/start/linkcmds

Last change on this file was ffa1153, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 14, 2019 at 8:36:09 PM

bsps: Add RamEnd? to linker command files

Update #3838.

  • Property mode set to 100644
File size: 7.4 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the 405GP/EX
4 *  This file is intended to be used together with dlentry.s
5 *  it will generate downloadable code
6 *
7 *  Modifications for gen405 by Dennis Ehlin
8 *  Modifications for virtex by Keith, Greg, and Bob
9 *  Modifications for 405GP/EX by Michael Hamel
10 */
11
12OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
13OUTPUT_ARCH(powerpc)
14STARTUP(start.o)
15ENTRY(download_entry)
16EXTERN(__vectors)
17
18RamBase = DEFINED(RamBase) ? RamBase : 0;
19RamSize = DEFINED(RamSize) ? RamSize : 256M;
20RamEnd = RamBase + RamSize;
21HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
22
23MEMORY {
24        RAM : ORIGIN = 0, LENGTH = 256M
25        /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
26}
27
28/*
29 * Max sdata/bss.
30 */
31bsp_section_small_data_area_size = 65536;
32
33SECTIONS
34{
35  /* First 16K is occupied by exception vectors and anything else we want to put there */
36  .text 0x4000:
37  {
38     text.start = . ;
39     *(.entry)
40     *(.entry2)
41     *(.text*)
42     *(.rodata*)
43     *(.rodata1)
44     KEEP (*(SORT(.rtemsroset.*)))
45
46     /*
47      * Special FreeBSD sysctl sections.
48      */
49     . = ALIGN (16);
50     __start_set_sysctl_set = .;
51     *(set_sysctl_*);
52     __stop_set_sysctl_set = ABSOLUTE(.);
53     *(set_domain_*);
54     *(set_pseudo_*);
55
56    /* C++ constructors/destructors */
57    *(.gnu.linkonce.t*)
58
59    /*  Initialization and finalization code.
60     *
61     *  Various files can provide initialization and finalization functions.
62     *  The bodies of these functions are in .init and .fini sections. We
63     *  accumulate the bodies here, and prepend function prologues from
64     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
65     *  first; ecrtn.o must be linked last. Because these are wildcards, it
66     *  doesn't matter if the user does not actually link against ecrti.o and
67     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
68     *  wildcard also means that it doesn't matter which directory ecrti.o
69     *  and ecrtn.o are in.
70     */
71    PROVIDE (_init = .);
72    *ecrti.o(.init)
73    *(.init)
74    *ecrtn.o(.init)
75   
76    PROVIDE (_fini = .);
77    *ecrti.o(.fini)
78    *(.fini)
79    *ecrtn.o(.init)
80
81    KEEP (*ecrti.o(.ctors))
82    KEEP (*crtbegin.o(.ctors))
83    KEEP (*crtbegin?.o(.ctors))
84    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
85    KEEP (*(SORT(.ctors.*)))
86    KEEP (*(.ctors))
87    KEEP (*ecrti.o(.dtors))
88    KEEP (*crtbegin.o(.dtors))
89    KEEP (*crtbegin?.o(.dtors))
90    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
91    KEEP (*(SORT(.dtors.*)))
92    KEEP (*(.dtors))
93
94    /* Exception frame info */
95     *(.eh_frame)
96    /* Miscellaneous read-only data */
97    _rodata_start = . ;
98    *(.gnu.linkonce.r*)
99    *(.lit)
100    *(.shdata)
101    *(.rodata)
102    *(.rodata1)
103    *(.descriptors)
104    *(rom_ver)
105    _erodata = .;
106
107    PROVIDE (__EXCEPT_START__ = .);
108    *(.gcc_except_table*)
109    PROVIDE (__EXCEPT_END__ = .);
110    __GOT_START__ = .;
111    s.got = .;
112    *(.got.plt)
113    *(.got)
114    *(.got1)
115    PROVIDE (__GOT2_START__ = .);
116    PROVIDE (_GOT2_START_ = .);
117    *(.got2)
118    PROVIDE (__GOT2_END__ = .);
119    PROVIDE (_GOT2_END_ = .);
120   
121    PROVIDE (__FIXUP_START__ = .);
122    PROVIDE (_FIXUP_START_ = .);
123    *(.fixup)
124    PROVIDE (_FIXUP_END_ = .);
125    PROVIDE (__FIXUP_END__ = .);
126   
127
128    /* Various possible names for the end of the .text section */
129     etext = ALIGN(0x10);
130     _etext = .;
131
132     *(.lit)
133     *(.shdata)
134     _endtext = ALIGN(0x10);
135     text.end = .;
136     text.size = text.end - text.start;
137  } >RAM
138
139  text.size = text.end - text.start;
140
141  .tdata : {
142    _TLS_Data_begin = .;
143    *(.tdata .tdata.* .gnu.linkonce.td.*)
144    _TLS_Data_end = .;
145  } >RAM
146
147  .tbss : {
148    _TLS_BSS_begin = .;
149    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
150    _TLS_BSS_end = .;
151  } >RAM
152
153  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
154  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
155  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
156  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
157  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
158  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
159
160  .jcr : { KEEP (*(.jcr)) } >RAM
161
162    .rel.dyn : {
163      *(.rel.init)
164      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
165      *(.rel.fini)
166      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
167      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
168      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
169      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
170      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
171      *(.rel.ctors)
172      *(.rel.dtors)
173      *(.rel.got)
174      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
175      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
176      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
177      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
178      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
179    } >RAM
180    .rela.dyn : {
181      *(.rela.init)
182      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
183      *(.rela.fini)
184      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
185      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
186      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
187      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
188      *(.rela.ctors)
189      *(.rela.dtors)
190      *(.rela.got)
191      *(.rela.got1)
192      *(.rela.got2)
193      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
194      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
195      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
196      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
197      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
198    } >RAM
199
200
201    /* Initialised large data */
202    .data ( . ) :
203    {
204      . = ALIGN (4);
205      data.start = .;
206      *(.data)
207      *(.data1)
208      KEEP (*(SORT(.rtemsrwset.*)))
209      *(.data.* .gnu.linkonce.d.*)
210      data.end = .;
211    } > RAM
212
213        /* Initialised small data addressed as offsets from r13 */
214        .sdata : {
215      . = ALIGN (4);
216          PROVIDE (__SDATA_START__ = .);
217      bsp_section_sdata_begin = .;
218      sdata.start = .;
219          *(.sdata*)
220      *(.gnu.linkonce.s.*)
221          sdata.end = .;
222      bsp_section_sdata_end = .;
223        } > RAM
224
225        /* Zeroed small data addressed as offsets from r13 */
226   .sbss : {
227      . = ALIGN (4);
228          PROVIDE(__SBSS_START__ = .);
229      bsp_section_sbss_begin = .;
230          sbss.start = .;
231      *(.sbss .sbss.* *.gnu.linkonce.sb.*);
232          sbss.end = .;
233      bsp_section_sbss_end = .;
234      bsp_section_sdata_libdl_begin = .;
235      . = DEFINED(bsp_section_small_data_area_size) ?
236            bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
237      bsp_section_sdata_libdl_end = .;
238    } > RAM
239    PROVIDE(__SBSS_END__ = .);
240
241        /* Zeroed large data */
242        .bss : {
243      . = ALIGN (4);
244          bss.start = .;
245      *(.bss .bss* .gnu.linkonce.b*)
246      . = ALIGN(4);
247      bss.end = .;
248    } > RAM
249
250    bss.size = bss.end - bss.start;
251    sbss.size = sbss.end - sbss.start;
252
253    .rtemsstack (NOLOAD) : {
254        *(SORT(.rtemsstack.*))
255    } >RAM
256
257    WorkAreaBase = .;
258
259        /* Debugging information */
260    .line 0 : { *(.line) }
261    .debug 0 : { *(.debug) }
262    .debug_sfnames 0 : { *(.debug_sfnames) }
263    .debug_srcinfo 0 : { *(.debug_srcinfo) }
264    .debug_pubnames 0 : { *(.debug_pubnames) }
265    .debug_aranges 0 : { *(.debug_aranges) }
266    .debug_aregion 0 : { *(.debug_aregion) }
267    .debug_macinfo 0 : { *(.debug_macinfo) }
268    .stab 0 : { *(.stab) }
269    .stabstr 0 : { *(.stabstr) }
270}
Note: See TracBrowser for help on using the repository browser.