source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds @ 85c92574

4.104.114.84.95
Last change on this file since 85c92574 was 85c92574, checked in by Joel Sherrill <joel.sherrill@…>, on May 9, 2002 at 9:37:30 PM

2001-05-09 Joel Sherrill <joel@…>

  • startup/linkcmds: In support of gcc 3.1, added one of more of the sections .jcr, .rodata*, .data.*, .gnu.linkonce.s2.*, .gnu.linkonce.sb2.*, and .gnu.linkonce.s.*. Spacing corrections and direction of segments to memory regions may also have been addressed. This was a sweep across all BSPs.
  • Property mode set to 100644
File size: 6.4 KB
Line 
1/*
2 *  This file contains directives for the GNU linker that are specific
3 *  to the MBX860-2 board.
4 *
5 *  $Id$
6 */
7
8OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
9OUTPUT_ARCH(powerpc)
10ENTRY(start)
11
12/*
13 * Declare some sizes.
14 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
15 *      number used there is not constant.  If this happens to you, edit
16 *      the lines marked XXX below to use a constant value.
17 */
18HeapSize = DEFINED(HeapSize) ? HeapSize : 0x100000;     /* 1M Heap */
19StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
20 
21MEMORY
22        {
23        ram : org = 0x0, l = 4M
24        nvram : org = 0xfa000000, l = 32K
25        dpram : org = 0xfa200000, l = 16K
26        flash : org = 0xfc000000, l = 2M
27        immr  : org = 0xfa200000, l = 16K
28        }
29
30
31SECTIONS
32{
33  /*
34   *  If the vectors are specified statically rather than created at run time,
35   *  accumulate them starting at VMA 0x0.
36   */
37  .vectors :
38  {
39    *(.vectors)
40  } >ram
41
42  /*
43   *  The stack will live in this area - between the vectors and
44   *  the text section.
45   */
46       
47  .text 0x10000:
48  {
49    /* Read-only sections, merged into text segment: */
50   
51    text.start = .;
52
53    /* Entry point is the .entry section */
54    *(.entry)
55    *(.entry2)
56
57    /* Actual code */
58    *(.text)
59    *(.text.*)
60             
61    /* C++ constructors/destructors */
62    *(.gnu.linkonce.t*)
63             
64    /*  Initialization and finalization code.
65     *
66     *  Various files can provide initialization and finalization functions.
67     *  The bodies of these functions are in .init and .fini sections. We
68     *  accumulate the bodies here, and prepend function prologues from
69     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
70     *  first; ecrtn.o must be linked last. Because these are wildcards, it
71     *  doesn't matter if the user does not actually link against ecrti.o and
72     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
73     *  wildcard also means that it doesn't matter which directory ecrti.o
74     *  and ecrtn.o are in.
75     */
76    PROVIDE (_init = .);
77    *ecrti.o(.init)
78    *(.init)
79    *ecrtn.o(.init)
80   
81    PROVIDE (_fini = .);
82    *ecrti.o(.fini)
83    *(.fini)
84    *ecrtn.o(.init)
85
86    /*
87     *  C++ constructors and destructors for static objects.
88     *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
89     *  constructor and destructor lists that begin with the list lenght
90     *  end terminate with a NULL entry.
91     */
92     
93    PROVIDE (__CTOR_LIST__ = .);             
94    /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
95    *crtbegin.o(.ctors)
96    *(.ctors)
97    *crtend.o(.ctors)
98    LONG(0)
99    PROVIDE (__CTOR_END__ = .);
100       
101    PROVIDE (__DTOR_LIST__ = .);
102    /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
103    *crtbegin.o(.dtors)
104    *(.dtors)
105    *crtend.o(.dtors)
106    LONG(0)
107    PROVIDE (__DTOR_END__ = .);
108       
109    /* Exception frame info */
110    *(.eh_frame)
111
112   /* Miscellaneous read-only data */
113    _rodata_start = . ;
114    *(.gnu.linkonce.r*)
115    *(.lit)
116    *(.shdata)
117    *(.rodata*)
118    *(.rodata1)
119    *.(eh_frame)
120    *(.descriptors)
121    *(rom_ver)
122    _erodata = .;
123
124
125    /* Various possible names for the end of the .text section */
126    etext = ALIGN(0x10);
127    _etext = .;
128    _endtext = .;
129    text.end = .;
130    PROVIDE (etext = .);
131    PROVIDE (__etext = .);
132 } > ram
133 
134  /* R/W Data */
135  .data :
136  {
137    data_start = .;
138   
139    *(.data)
140    *(.data.*)
141    *(.data1)
142   
143    PROVIDE (__SDATA_START__ = .);
144    *(.sdata)
145    *(.gnu.linkonce.d*)
146    *(.gnu.linkonce.s.*)
147    PROVIDE (__SDATA_END__ = .);
148   
149    PROVIDE (__EXCEPT_START__ = .);
150    *(.gcc_except_table)
151    PROVIDE (__EXCEPT_END__ = .);
152   
153    PROVIDE(__GOT_START__ = .);
154    *(.got.plt)
155    *(.got)
156    PROVIDE(__GOT_END__ = .);
157       
158    *(.got1)
159   
160    PROVIDE (__GOT2_START__ = .);
161    PROVIDE (_GOT2_START_ = .);
162    *(.got2)
163    PROVIDE (__GOT2_END__ = .);
164    PROVIDE (_GOT2_END_ = .);
165       
166    PROVIDE (__FIXUP_START__ = .);
167    PROVIDE (_FIXUP_START_ = .);
168    *(.fixup)
169    PROVIDE (_FIXUP_END_ = .);
170    PROVIDE (__FIXUP_END__ = .);
171
172  /*  We want the small data sections together, so single-instruction offsets
173   *   can access them all.
174   */
175    PROVIDE (__SDATA2_START__ = .);
176    *(.sdata2)
177    *(.gnu.linkonce.s2.*)
178    *(.sbss2)
179    PROVIDE (__SDATA2_END__ = .);
180  } > ram
181       
182         
183  .bss :
184  {
185    PROVIDE (__SBSS_START__ = .);
186       
187    PROVIDE (__SBSS2_START__ = .);
188    *(.sbss2)
189    PROVIDE (__SBSS2_END__ = .);
190       
191    bss.start = .;
192    *(.bss)
193    *(.sbss)
194    *(COMMON)
195    . = ALIGN(4);
196    bss.end = .;
197   
198   PROVIDE (__SBSS_END__ = .);
199
200  } > ram
201 
202  bss.size = bss.end - bss.start;
203  text.size = text.end - text.start;
204  PROVIDE(_end = bss.end);
205  /*
206   * Interrupt stack setup
207   */
208
209  IntrStack_start = ALIGN(0x10);
210  . += 0x4000;
211  intrStack = .;
212  PROVIDE(intrStackPtr = intrStack);
213
214  _HeapStart = .;
215  __HeapStart = .;
216  . += HeapSize;  /* XXX -- Old gld can't handle this */
217  /* . += 0x80000; */ /* HeapSize for old gld */
218  _HeapEnd = .;
219  __HeapEnd = .;
220  clear_end = .;
221       
222  _WorkspaceBase = .;
223  __WorkspaceBase = .;
224       
225  dpram :
226  {
227  m8xx = .;
228  _m8xx = .;
229  . += (16 * 1024);
230  } >immr
231
232  /* Stabs debugging sections.  */
233  .stab 0 : { *(.stab) }
234  .stabstr 0 : { *(.stabstr) }
235  .stab.excl 0 : { *(.stab.excl) }
236  .stab.exclstr 0 : { *(.stab.exclstr) }
237  .stab.index 0 : { *(.stab.index) }
238  .stab.indexstr 0 : { *(.stab.indexstr) }
239  .comment 0 : { *(.comment) }
240 
241  /* DWARF debug sections.
242     Symbols in the DWARF debugging sections are relative to the beginning
243     of the section so we begin them at 0.  */
244  /* DWARF 1 */
245  .debug          0 : { *(.debug) }
246  .line           0 : { *(.line) }
247 
248  /* GNU DWARF 1 extensions */
249  .debug_srcinfo  0 : { *(.debug_srcinfo) }
250  .debug_sfnames  0 : { *(.debug_sfnames) }
251 
252  /* DWARF 1.1 and DWARF 2 */
253  .debug_aranges  0 : { *(.debug_aranges) }
254  .debug_pubnames 0 : { *(.debug_pubnames) }
255 
256  /* DWARF 2 */
257  .debug_info     0 : { *(.debug_info) }
258  .debug_abbrev   0 : { *(.debug_abbrev) }
259  .debug_line     0 : { *(.debug_line) }
260  .debug_frame    0 : { *(.debug_frame) }
261  .debug_str      0 : { *(.debug_str) }
262  .debug_loc      0 : { *(.debug_loc) }
263  .debug_macinfo  0 : { *(.debug_macinfo) }
264 
265  /* SGI/MIPS DWARF 2 extensions */
266  .debug_weaknames 0 : { *(.debug_weaknames) }
267  .debug_funcnames 0 : { *(.debug_funcnames) }
268  .debug_typenames 0 : { *(.debug_typenames) }
269  .debug_varnames  0 : { *(.debug_varnames) }
270  /* These must appear regardless of  .  */
271}
Note: See TracBrowser for help on using the repository browser.