source: rtems/c/src/lib/libbsp/powerpc/psim/startup/linkcmds @ 183af89

4.115
Last change on this file since 183af89 was 97f82fc, checked in by Jennifer Averett <jennifer.averett@…>, on 03/30/12 at 13:38:14

Resolve link problems with psim irq-server

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