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

4.104.115
Last change on this file since 50530483 was 284ed06a, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 21:35:23

2008-09-16 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, startup/linkcmds: Use top level shared bsp_get_work_area() implementation.
  • startup/bspgetworkarea.c: Removed.
  • Property mode set to 100644
File size: 6.8 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 *  $Id$
12 */
13
14OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
15OUTPUT_ARCH(powerpc)
16ENTRY(download_entry)
17
18kIntrStackSize = 16K;
19kMainStackSize = 64K;
20
21RamBase = DEFINED(RamBase) ? RamBase : 0;
22RamSize = DEFINED(RamSize) ? RamSize : 256M;
23HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
24
25MEMORY {
26        RAM : ORIGIN = 0, LENGTH = 256M
27        /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
28}
29
30
31SECTIONS
32{
33  /* First 16K is occupied by exception vectors and anything else we want to put there */
34  .text 0x4000:
35  {
36     text.start = . ;
37     *(.entry)
38     *(.entry2)
39     *(.text*)
40     *(.rodata*)
41     *(.rodata1)
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 lenght
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  .jcr : { KEEP (*(.jcr)) } >RAM
147
148    .rel.dyn : {
149      *(.rel.init)
150      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
151      *(.rel.fini)
152      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
153      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
154      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
155      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
156      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
157      *(.rel.ctors)
158      *(.rel.dtors)
159      *(.rel.got)
160      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
161      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
162      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
163      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
164      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
165    } >RAM
166    .rela.dyn : {
167      *(.rela.init)
168      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
169      *(.rela.fini)
170      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
171      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
172      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
173      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
174      *(.rela.ctors)
175      *(.rela.dtors)
176      *(.rela.got)
177      *(.rela.got1)
178      *(.rela.got2)
179      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
180      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
181      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
182      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
183      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
184    } >RAM
185
186
187    /* Initialised large data */
188    .data ( . ) :
189    {
190      . = ALIGN (4);
191      data.start = .;
192      *(.data)
193      *(.data1)
194      *(.data.* .gnu.linkonce.d.*)
195      data.end = .;
196    } > RAM
197
198        /* Initialised small data addressed as offsets from r13 */
199        .sdata : {
200      . = ALIGN (4);
201          PROVIDE (__SDATA_START__ = .);
202      sdata.start = .;
203          *(.sdata*)
204      *(.gnu.linkonce.s.*)
205          sdata.end = .;
206        } > RAM
207
208        /* Zeroed small data addressed as offsets from r13 */
209   .sbss : {
210      . = ALIGN (4);
211          PROVIDE(__SBSS_START__ = .);
212          sbss.start = .;
213      *(.sbss*)
214      *(.gnu.linkonce.sb.*);
215          sbss.end = .;
216    } > RAM
217    PROVIDE(__SBSS_END__ = .);
218
219        /* Zeroed large data */
220        .bss : {
221      . = ALIGN (4);
222          bss.start = .;
223      *(.bss .bss* .gnu.linkonce.b*)
224      . = ALIGN(4);
225      bss.end = .;
226    } > RAM
227
228    bss.size = bss.end - bss.start;
229    sbss.size = sbss.end - sbss.start;
230                       
231    /* Interrupt stack: align to a cache-line boundary */
232    IntrStack_start = ALIGN(0x20);
233    . += kIntrStackSize;
234    intrStack = .;
235    PROVIDE(intrStackPtr = intrStack);
236    PROVIDE(intrStack_start = IntrStack_start);
237    PROVIDE(intrStack_size = kIntrStackSize);
238
239        /* Main stack: align to a cache-line boundary */
240        stack.start = ALIGN(0x20);
241        . += kMainStackSize;
242        stack.end   = .;
243
244        /* RTEMS workspace: size specified by application */
245        WorkAreaBase = ALIGN(0x20);
246
247        /* Debugging information */
248    .line 0 : { *(.line) }
249    .debug 0 : { *(.debug) }
250    .debug_sfnames 0 : { *(.debug_sfnames) }
251    .debug_srcinfo 0 : { *(.debug_srcinfo) }
252    .debug_pubnames 0 : { *(.debug_pubnames) }
253    .debug_aranges 0 : { *(.debug_aranges) }
254    .debug_aregion 0 : { *(.debug_aregion) }
255    .debug_macinfo 0 : { *(.debug_macinfo) }
256    .stab 0 : { *(.stab) }
257    .stabstr 0 : { *(.stabstr) }
258}
Note: See TracBrowser for help on using the repository browser.