source: rtems/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds @ 960fd85

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 28, 2014 at 10:52:17 AM

bsps: Thread-local storage (TLS) for linkcmds

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