source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds @ 310a2ec

4.104.114.84.95
Last change on this file since 310a2ec was 8ef3818, checked in by Joel Sherrill <joel.sherrill@…>, on 06/12/00 at 19:57:02

Patch from John Cotton <john.cotton@…>, Charles-Antoine Gauthier
<charles.gauthier@…>, and Darlene A. Stewart
<Darlene.Stewart@…> to add support for a number of very
significant things:

+ BSPs for many variations on the Motorola MBX8xx board series
+ Cache Manager including initial support for m68040

and PowerPC

+ Rework of mpc8xx libcpu code so all mpc8xx CPUs now use

same code base.

+ Rework of eth_comm BSP to utiltize above.

John reports this works on the 821 and 860

  • Property mode set to 100644
File size: 6.1 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    *(.descriptors)
120    *(rom_ver)
121    _erodata = .;
122
123
124    /* Various possible names for the end of the .text section */
125    etext = ALIGN(0x10);
126    _etext = .;
127    _endtext = .;
128    text.end = .;
129    PROVIDE (etext = .);
130    PROVIDE (__etext = .);
131 } > ram
132 
133  /* R/W Data */
134  .data :
135  {
136    data_start = .;
137   
138    *(.data)
139    *(.data.*)
140    *(.data1)
141   
142    PROVIDE (__SDATA_START__ = .);
143    *(.sdata)
144    *(.gnu.linkonce.d*)
145    PROVIDE (__SDATA_END__ = .);
146   
147    PROVIDE (__EXCEPT_START__ = .);
148    *(.gcc_except_table)
149    PROVIDE (__EXCEPT_END__ = .);
150   
151    PROVIDE(__GOT_START__ = .);
152    *(.got.plt)
153    *(.got)
154    PROVIDE(__GOT_END__ = .);
155       
156    *(.got1)
157   
158    PROVIDE (__GOT2_START__ = .);
159    PROVIDE (_GOT2_START_ = .);
160    *(.got2)
161    PROVIDE (__GOT2_END__ = .);
162    PROVIDE (_GOT2_END_ = .);
163       
164    PROVIDE (__FIXUP_START__ = .);
165    PROVIDE (_FIXUP_START_ = .);
166    *(.fixup)
167    PROVIDE (_FIXUP_END_ = .);
168    PROVIDE (__FIXUP_END__ = .);
169
170  /*  We want the small data sections together, so single-instruction offsets
171   *   can access them all.
172   */
173    PROVIDE (__SDATA2_START__ = .);
174    *(.sdata2)
175    PROVIDE (__SDATA2_END__ = .);
176  } > ram
177       
178         
179  .bss :
180  {
181    PROVIDE (__SBSS_START__ = .);
182       
183    PROVIDE (__SBSS2_START__ = .);
184    *(.sbss2)
185    PROVIDE (__SBSS2_END__ = .);
186       
187    bss.start = .;
188    *(.bss)
189    *(.sbss)
190    *(COMMON)
191    . = ALIGN(4);
192    bss.end = .;
193   
194   PROVIDE (__SBSS_END__ = .);
195
196  } > ram
197 
198  bss.size = bss.end - bss.start;
199  text.size = text.end - text.start;
200  PROVIDE(_end = bss.end);
201       
202  _HeapStart = .;
203  __HeapStart = .;
204  . += HeapSize;  /* XXX -- Old gld can't handle this */
205  /* . += 0x80000; */ /* HeapSize for old gld */
206  _HeapEnd = .;
207  __HeapEnd = .;
208  clear_end = .;
209       
210  _WorkspaceBase = .;
211  __WorkspaceBase = .;
212       
213  dpram :
214  {
215  m8xx = .;
216  _m8xx = .;
217  . += (16 * 1024);
218  } >immr
219
220  /* Stabs debugging sections.  */
221  .stab 0 : { *(.stab) }
222  .stabstr 0 : { *(.stabstr) }
223  .stab.excl 0 : { *(.stab.excl) }
224  .stab.exclstr 0 : { *(.stab.exclstr) }
225  .stab.index 0 : { *(.stab.index) }
226  .stab.indexstr 0 : { *(.stab.indexstr) }
227  .comment 0 : { *(.comment) }
228 
229  /* DWARF debug sections.
230     Symbols in the DWARF debugging sections are relative to the beginning
231     of the section so we begin them at 0.  */
232  /* DWARF 1 */
233  .debug          0 : { *(.debug) }
234  .line           0 : { *(.line) }
235 
236  /* GNU DWARF 1 extensions */
237  .debug_srcinfo  0 : { *(.debug_srcinfo) }
238  .debug_sfnames  0 : { *(.debug_sfnames) }
239 
240  /* DWARF 1.1 and DWARF 2 */
241  .debug_aranges  0 : { *(.debug_aranges) }
242  .debug_pubnames 0 : { *(.debug_pubnames) }
243 
244  /* DWARF 2 */
245  .debug_info     0 : { *(.debug_info) }
246  .debug_abbrev   0 : { *(.debug_abbrev) }
247  .debug_line     0 : { *(.debug_line) }
248  .debug_frame    0 : { *(.debug_frame) }
249  .debug_str      0 : { *(.debug_str) }
250  .debug_loc      0 : { *(.debug_loc) }
251  .debug_macinfo  0 : { *(.debug_macinfo) }
252 
253  /* SGI/MIPS DWARF 2 extensions */
254  .debug_weaknames 0 : { *(.debug_weaknames) }
255  .debug_funcnames 0 : { *(.debug_funcnames) }
256  .debug_typenames 0 : { *(.debug_typenames) }
257  .debug_varnames  0 : { *(.debug_varnames) }
258  /* These must appear regardless of  .  */
259}
Note: See TracBrowser for help on using the repository browser.