source: rtems/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds @ 2afb22b

5
Last change on this file since 2afb22b was be7ee65, checked in by Joel Sherrill <joel@…>, on 12/20/17 at 20:14:45

haleakala: Simplify bsp_specs

Updates #3520.

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