source: rtems/c/src/lib/libbsp/powerpc/psim/startup/linkcmds @ 1ea0f9d

4.104.115
Last change on this file since 1ea0f9d was af2eb77, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/08 at 20:40:17

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

  • Makefile.am, include/bsp.h, startup/bspstart.c, startup/linkcmds: Use PowerPC level shared bsp_get_work_area() implementation.
  • startup/bspgetworkarea.c: Removed.
  • Property mode set to 100644
File size: 7.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
13OUTPUT_ARCH(powerpc)
14ENTRY(_start)
15/* Do we need any of these for elf?
16   __DYNAMIC = 0;    */
17PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000);
18
19RamBase = DEFINED(RamBase) ? RamBase : 0x0;
20RamSize = DEFINED(RamSize) ? RamSize : 8M;
21
22MEMORY
23  {
24        RAM       : ORIGIN = 0, LENGTH = 8M
25        PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M
26        VECTORS   : ORIGIN = 0xFFF00000, LENGTH = 0x20000
27  }
28
29SECTIONS
30{
31  .entry_point_section :
32  {
33        *(.entry_point_section)
34  } > VECTORS
35
36  /*
37   * BSP: PSIM Register Block
38   */
39  .psim_regs (NOLOAD) : {
40    psim_reg*(.text)
41    psim_reg*(.data)
42    psim_reg*(.bss)
43    psim_reg*(COMMON)
44  } > PSIM_REGS
45
46  /* Read-only sections, merged into text segment: */
47  /* . = 0x40000 + SIZEOF_HEADERS; */
48  . = 0x4000;
49  .interp         : { *(.interp) }
50  .hash           : { *(.hash) }
51  .dynsym         : { *(.dynsym) }
52  .dynstr         : { *(.dynstr) }
53  .gnu.version    : { *(.gnu.version) }
54  .gnu.version_d  : { *(.gnu.version_d) }
55  .gnu.version_r  : { *(.gnu.version_r) }
56  .text      :
57  {
58    *(.text*)
59    *(.gnu.linkonce.t.*)
60    *(.descriptors)
61
62    /*
63     * Special FreeBSD sysctl sections.
64     */
65    . = ALIGN (16);
66    __start_set_sysctl_set = .;
67    *(set_sysctl_*);
68    __stop_set_sysctl_set = ABSOLUTE(.);
69    *(set_domain_*);
70    *(set_pseudo_*);
71
72    /* .gnu.warning sections are handled specially by elf32.em.  */
73    *(.gnu.warning)
74  } >RAM
75  .init           :
76  {
77    KEEP (*(.init))
78  } >RAM =0
79
80  .rel.dyn        :
81    {
82      *(.rel.init)
83      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
84      *(.rel.fini)
85      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
86      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
87      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
88      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
89      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
90      *(.rel.ctors)
91      *(.rel.dtors)
92      *(.rel.got)
93      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
94      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
95      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
96      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
97      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
98    } >RAM
99  .rela.dyn       :
100    {
101      *(.rela.init)
102      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
103      *(.rela.fini)
104      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
105      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
106      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
107      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
108      *(.rela.ctors)
109      *(.rela.dtors)
110      *(.rela.got)
111      *(.rela.got1)
112      *(.rela.got2)
113      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
114      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
115      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
116      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
117      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
118    } >RAM
119  .rel.plt        : { *(.rel.plt) }
120  .rela.plt       : { *(.rela.plt) }
121
122  .fini           :
123  {
124    _fini = .;
125    KEEP (*(.fini))
126  } >RAM =0
127  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM
128  .rodata1        : { *(.rodata1)       } >RAM
129  PROVIDE (__FRAME_BEGIN__ = .);
130  .eh_frame       : { *.(eh_frame)              } >RAM
131  PROVIDE (__FRAME_END__ = .);
132  PROVIDE (_etext = .);
133  PROVIDE (etext = .);
134_SDA2_BASE_ = __SDATA2_START__ + 0x8000;
135  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >RAM
136  .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >RAM
137  PROVIDE (__SBSS2_END__ = .);
138  /* .eh_frame_hdr : { *(.eh_frame_hdr) } >RAM */
139  /* Adjust the address for the data segment.  We want to adjust up to
140     the same address within the page on the next page up.  It would
141     be more correct to do this:
142       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
143     The current expression does not correctly handle the case of a
144     text segment ending precisely at the end of a page; it causes the
145     data segment to skip a page.  The above expression does not have
146     this problem, but it will currently (2/95) cause BFD to allocate
147     a single segment, combining both text and data, for this case.
148     This will prevent the text segment from being shared among
149     multiple executions of the program; I think that is more
150     important than losing a page of the virtual address space (note
151     that no actual memory is lost; the page which is skipped can not
152     be referenced).  */
153  /* . =  ALIGN(8) + 0x40000; */
154  .data    :
155  {
156    *(.data .data.* .gnu.linkonce.d.*)
157    SORT(CONSTRUCTORS)
158  } >RAM
159  PROVIDE (__EXCEPT_START__ = .);
160  .gcc_except_table   : { *(.gcc_except_table*) } >RAM
161  PROVIDE (__EXCEPT_END__ = .);
162
163  .data1          : { *(.data1)         } >RAM
164  .got1           : { *(.got1)          } >RAM
165  .dynamic        : { *(.dynamic)       } >RAM
166  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
167     get relocated with -mrelocatable. Also put in the .fixup pointers.
168     The current compiler no longer needs this, but keep it around for 2.7.2  */
169   PROVIDE (__GOT2_START__ = .);
170   PROVIDE (_GOT2_START_ = .);
171  .got2           :  { *(.got2)         } >RAM
172  PROVIDE (__GOT2_END__ = .);
173  PROVIDE (_GOT2_END_ = .);
174
175  PROVIDE (__CTOR_LIST__ = .);
176  .ctors          : { *(.ctors)         } >RAM
177  PROVIDE (__CTOR_END__ = .);
178
179  PROVIDE (__DTOR_LIST__ = .);
180  .dtors          : { *(.dtors)         } >RAM
181  PROVIDE (__DTOR_END__ = .);
182
183  PROVIDE (__FIXUP_START__ = .);
184  PROVIDE (_FIXUP_START_ = .);
185  .fixup          : { *(.fixup)         } >RAM
186  PROVIDE (_FIXUP_END_ = .);
187  PROVIDE (__FIXUP_END__ = .);
188
189  .jcr            : { KEEP (*(.jcr))    } > RAM
190
191  PROVIDE (__GOT_START__ = .);
192  PROVIDE (_GOT_START_ = .);
193  s.got = .;
194  .got            : { *(.got)           } >RAM
195  .got.plt        : { *(.got.plt)       } >RAM
196  PROVIDE (_GOT_END_ = .);
197  PROVIDE (__GOT_END__ = .);
198
199  /* We want the small data sections together, so single-instruction offsets
200     can access them all, and initialized data all before uninitialized, so
201     we can shorten the on-disk segment size.  */
202_SDA_BASE_ = __SDATA_START__ + 0x8000;
203  .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*)   } >RAM
204  _edata  =  .;
205  PROVIDE (edata = .);
206
207  PROVIDE (RAM_END = 8M);
208  .sbss      :
209  {
210    PROVIDE (__sbss_start = .);
211    *(.dynsbss)
212    *(.sbss* .gnu.linkonce.sb.*)
213    PROVIDE (__sbss_end = .);
214  } >RAM
215  PROVIDE (__SBSS_END__ = .);
216
217  .bss       :
218  {
219   PROVIDE (__bss_start = .);
220   *(.dynbss)
221   *(.bss .bss* .gnu.linkonce.b*)
222   *(COMMON)
223  } >RAM
224  . = ALIGN(16);
225  . += 0x1000;
226  PROVIDE(__stack = .);
227  __rtems_end = . ;
228  . =  ALIGN(8) + 0x8000;
229  PROVIDE(_end = .);
230  PROVIDE(end = .);
231
232  /* These are needed for ELF backends which have not yet been
233     converted to the new style linker.  */
234  .stab 0 : { *(.stab) }
235  .stabstr 0 : { *(.stabstr) }
236  /* DWARF debug sections.
237     Symbols in the DWARF debugging sections are relative to the beginning
238     of the section so we begin them at 0.  */
239  /* DWARF 1 */
240  .debug          0 : { *(.debug) }
241  .line           0 : { *(.line) }
242  /* GNU DWARF 1 extensions */
243  .debug_srcinfo  0 : { *(.debug_srcinfo) }
244  .debug_sfnames  0 : { *(.debug_sfnames) }
245  /* DWARF 1.1 and DWARF 2 */
246  .debug_aranges  0 : { *(.debug_aranges) }
247  .debug_pubnames 0 : { *(.debug_pubnames) }
248  /* DWARF 2 */
249  .debug_info     0 : { *(.debug_info) }
250  .debug_abbrev   0 : { *(.debug_abbrev) }
251  .debug_line     0 : { *(.debug_line) }
252  .debug_frame    0 : { *(.debug_frame) }
253  .debug_str      0 : { *(.debug_str) }
254  .debug_loc      0 : { *(.debug_loc) }
255  .debug_macinfo  0 : { *(.debug_macinfo) }
256  /* SGI/MIPS DWARF 2 extensions */
257  .debug_weaknames 0 : { *(.debug_weaknames) }
258  .debug_funcnames 0 : { *(.debug_funcnames) }
259  .debug_typenames 0 : { *(.debug_typenames) }
260  .debug_varnames  0 : { *(.debug_varnames) }
261  /* These must appear regardless of  .  */
262}
Note: See TracBrowser for help on using the repository browser.