source: rtems/c/src/lib/libbsp/powerpc/virtex/startup/linkcmds @ c00b49f8

4.104.115
Last change on this file since c00b49f8 was 20d7660b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 21:59:18

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: 7.1 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the virtex
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 *
10 *  $Id$
11 */
12
13OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
14              "elf32-powerpc")
15OUTPUT_ARCH(powerpc)
16
17ENTRY(download_entry)
18
19
20RamBase = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize = DEFINED(RamSize) ? RamSize : 128M;
22HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
23
24MEMORY
25{
26  RAM : ORIGIN = 0, LENGTH = 128M
27  /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
28}
29SECTIONS
30{
31  .text 0x10000:
32  {
33     text.start = . ;
34     *(.entry)
35     *(.entry2)
36     *(.text*)
37     *(.rodata*)
38     *(.rodata1)
39
40     /*
41      * Special FreeBSD sysctl sections.
42      */
43     . = ALIGN (16);
44     __start_set_sysctl_set = .;
45     *(set_sysctl_*);
46     __stop_set_sysctl_set = ABSOLUTE(.);
47     *(set_domain_*);
48     *(set_pseudo_*);
49
50    /* C++ constructors/destructors */
51    *(.gnu.linkonce.t*)
52
53    /*  Initialization and finalization code.
54     *
55     *  Various files can provide initialization and finalization functions.
56     *  The bodies of these functions are in .init and .fini sections. We
57     *  accumulate the bodies here, and prepend function prologues from
58     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
59     *  first; ecrtn.o must be linked last. Because these are wildcards, it
60     *  doesn't matter if the user does not actually link against ecrti.o and
61     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
62     *  wildcard also means that it doesn't matter which directory ecrti.o
63     *  and ecrtn.o are in.
64     */
65    PROVIDE (_init = .);
66    *ecrti.o(.init)
67    *(.init)
68    *ecrtn.o(.init)
69   
70    PROVIDE (_fini = .);
71    *ecrti.o(.fini)
72    *(.fini)
73    *ecrtn.o(.init)
74
75    /*
76     *  C++ constructors and destructors for static objects.
77     *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
78     *  constructor and destructor lists that begin with the list lenght
79     *  end terminate with a NULL entry.
80     */
81     
82    PROVIDE (__CTOR_LIST__ = .);             
83    *crtbegin.o(.ctors)
84    *(.ctors)
85    *crtend.o(.ctors)
86    LONG(0)
87    PROVIDE (__CTOR_END__ = .);
88       
89    PROVIDE (__DTOR_LIST__ = .);
90    *crtbegin.o(.dtors)
91    *(.dtors)
92    *crtend.o(.dtors)
93    LONG(0)
94    PROVIDE (__DTOR_END__ = .);
95       
96    /* Exception frame info */
97     *(.eh_frame)
98    /* Miscellaneous read-only data */
99    _rodata_start = . ;
100    *(.gnu.linkonce.r*)
101    *(.lit)
102    *(.shdata)
103    *(.rodata)
104    *(.rodata1)
105    *(.descriptors)
106    *(rom_ver)
107    _erodata = .;
108
109    PROVIDE (__EXCEPT_START__ = .);
110    *(.gcc_except_table*)
111    PROVIDE (__EXCEPT_END__ = .);
112    __GOT_START__ = .;
113    s.got = .;
114    *(.got.plt)
115    *(.got)
116    *(.got1)
117    PROVIDE (__GOT2_START__ = .);
118    PROVIDE (_GOT2_START_ = .);
119    *(.got2)
120    PROVIDE (__GOT2_END__ = .);
121    PROVIDE (_GOT2_END_ = .);
122   
123    PROVIDE (__FIXUP_START__ = .);
124    PROVIDE (_FIXUP_START_ = .);
125    *(.fixup)
126    PROVIDE (_FIXUP_END_ = .);
127    PROVIDE (__FIXUP_END__ = .);
128   
129
130    /* Various possible names for the end of the .text section */
131     etext = ALIGN(0x10);
132     _etext = .;
133
134     *(.lit)
135     *(.shdata)
136     _endtext = ALIGN(0x10);
137     text.end = .;
138     text.size = text.end - text.start;
139  } >RAM
140
141  text.size = text.end - text.start;
142
143  .jcr : { KEEP (*(.jcr)) } >RAM
144
145    .rel.dyn : {
146      *(.rel.init)
147      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
148      *(.rel.fini)
149      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
150      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
151      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
152      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
153      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
154      *(.rel.ctors)
155      *(.rel.dtors)
156      *(.rel.got)
157      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
158      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
159      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
160      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
161      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
162    } >RAM
163    .rela.dyn : {
164      *(.rela.init)
165      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
166      *(.rela.fini)
167      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
168      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
169      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
170      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
171      *(.rela.ctors)
172      *(.rela.dtors)
173      *(.rela.got)
174      *(.rela.got1)
175      *(.rela.got2)
176      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
177      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
178      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
179      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
180      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
181    } >RAM
182
183
184    /* R/W Data */
185    .data ( . ) :
186    {
187      . = ALIGN (4);
188
189      data.start = .;
190
191      *(.data)
192      *(.data1)
193      *(.data.* .gnu.linkonce.d.*)
194      data.end = .;
195      data.size = data.end - data.start;
196    } >RAM
197
198        /* Arrange as follows:
199         *   sdata
200         *   sbss
201     *   bss
202     *   sbss2
203     *   sdata2
204         * so that we have a contiguous 'bss' area
205         * which can be zeroed in one sweep.
206         * (sdata/sbss and sdata2/sbss2 must also be
207         * contiguous).
208         */
209
210        _SDA_BASE_ = __SDATA_START__ + 0x8000;
211        .sdata : {
212                *(.sdata .sdata.*)
213                *(.gnu.linkonce.s.*)
214        } > RAM
215        _edata = .;
216        .sbss : {
217        *(.dynsbss)
218        *(.sbss .sbss.* .gnu.linkonce.sb.*)
219            *(.scommon)
220        } > RAM
221        .bss : {
222                *(.dynbss)
223                *(.bss .bss* .gnu.linkonce.b*)
224                *(COMMON)
225    } >RAM
226        _SDA2_BASE_ = __SBSS2_START__ + 0x8000;
227        .sbss2 : {
228                *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
229        } > RAM
230        .sdata2 : {
231                *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
232        } > RAM
233       
234        PROVIDE(bss.start    = __SBSS_START__);
235    PROVIDE(bss.size     = __SBSS2_END__ - __SBSS_START__);
236
237  /* align bottom of 32k init stack at a 32k boundary */
238  . = . + 0x4000;
239  . = ALIGN( 0x8000 );
240  stack.start = .;
241  . = . + 0x8000;
242  stack.end   = .;
243  /*
244   * Interrupt stack setup
245   */
246    IntrStack_start = ALIGN(0x10);
247    . += 0x4000;
248    IntrStack_end = .;
249 
250    PROVIDE(_end = . );
251    WorkAreaBase = .;
252
253    .gzipmalloc : {
254        . = ALIGN (16);
255        _startmalloc = .;
256     } >RAM
257               
258
259    /* Sections for compressed .text and .data         */
260    /* after the .datarom section is an int specifying */
261    /* the length of the following compressed image    */
262    /* Executes once then could get overwritten        */
263    .textrom 0x100000 :
264    {
265        *(.textrom)
266        _endloader = .;
267    } >RAM
268
269    .datarom :
270    {
271        _dr_start = .;
272        *(.datarom)
273        _dr_end = .;
274    } >RAM
275    dr_len = _dr_end - _dr_start;
276
277
278    .line 0 : { *(.line) }
279    .debug 0 : { *(.debug) }
280    .debug_sfnames 0 : { *(.debug_sfnames) }
281    .debug_srcinfo 0 : { *(.debug_srcinfo) }
282    .debug_pubnames 0 : { *(.debug_pubnames) }
283    .debug_aranges 0 : { *(.debug_aranges) }
284    .debug_aregion 0 : { *(.debug_aregion) }
285    .debug_macinfo 0 : { *(.debug_macinfo) }
286    .stab 0 : { *(.stab) }
287    .stabstr 0 : { *(.stabstr) }
288}
Note: See TracBrowser for help on using the repository browser.