source: rtems/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds @ f58f0b45

4.104.114.84.95
Last change on this file since f58f0b45 was f58f0b45, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 11, 1999 at 3:28:04 PM

Now compiles for coff and elf.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Motorola MVME167 board. This linker script produces ELF
4 *  executables.
5 *
6 *  Copyright (c) 1999, National Research Council of Canada.
7 *  Some of this material was copied from binutils-2.9.4 linker scripts,
8 *  and is therefore likely to be copyrighted by the Free Software
9 *  Foundation, even though explicit copyright notices did not appear in
10 *  those files.
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.OARcorp.com/rtems/license.html.
15 *
16 *  $Id$
17 */
18
19/* These are not really needed here */
20/* OUTPUT_FORMAT("elf32-m68k") */
21OUTPUT_ARCH(m68k)
22ENTRY(_start)
23
24/* Base address and size of RAM on the MVME167 */
25
26RAM_SIZE = 4M;
27RAM_START = 0x00800000;
28RAM_END = RAM_START + RAM_SIZE;
29
30/*
31 * Declare some sizes.
32 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
33 *      number used there is not constant.  If this happens to you, edit
34 *      the lines marked XXX below to use a constant value.
35 */
36HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
37StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
38
39MEMORY
40{
41  /*  The location of RAM is the address space is configurable.
42      This is where we put one board. The base address should be
43      passed as a parameter when building multiprocessor images
44      where each board resides at a different address. */
45  ram  : org = 0x00800000, l = 4M
46  rom  : org = 0xFF800000, l = 4M
47  sram : org = 0xFFE00000, l = 128K
48}
49
50SECTIONS
51{
52  /*
53   * We want the entry point to be the first thing in memory.
54   * Merge all read-only data into the .text section.
55   */
56  .text 0x00800000 :
57  {
58    text_start = . ;
59   
60    *(.text)
61    *(.text.*)
62    *(.stub)
63
64    /* C++ constructors/destructors */
65    *(.gnu.linkonce.t*)
66   
67    /* Initialization and finalization code.
68     *
69     * Various files can provide initialization and finalization functions.
70     * crtbegin.o and crtend.o are two instances. The body of these functions
71     * are in .init and .fini sections. We accumulate the bodies here, and
72     * prepend function prologues from crti.o and function epilogues from
73     * crtn.o. crti.o must be linked first; crtn.o must be linked last.
74     * Because these are wildcards, it doesn't matter if the user does not
75     * actually link against crti.o and crtn.o; the linker won't look for a
76     * file to match a wildcard.  The wildcard also means that it doesn't
77     * matter which directory crti.o and crtn.o are in.
78     */
79    PROVIDE (_init = .);
80    *crti.o(.init)
81    *(.init)
82    *crtn.o(.init)
83   
84    PROVIDE (_fini = .);
85    *crti.o(.fini)
86    *(.fini)
87    *crtn.o(.init)
88   
89    . = ALIGN (16);
90   
91    /* C++ constructors and destructors for static objects.
92     *
93     * gcc uses crtbegin.o to find the start of the constructors and
94     * destructors so we make sure it is first.  Because this is a wildcard,
95     * it doesn't matter if the user does not actually link against
96     * crtbegin.o; the linker won't look for a file to match a wildcard.  The
97     * wildcard also means that it doesn't matter which directory crtbegin.o
98     * is in. The constructor and destructor list are terminated in crtend.o.
99     * The same comments apply to it.
100     */
101    PROVIDE (__CTOR_LIST__ = .);
102    *crtbegin.o(.ctors)
103    *(.ctors)
104    *crtend.o(.ctors)
105    PROVIDE (__CTOR_END__ = .);
106
107    PROVIDE (__DTOR_LIST__ = .);
108    *crtbegin.o(.dtors)
109    *(.dtors)
110    *crtend.o(.dtors)
111    PROVIDE (__DTOR_END__ = .);
112   
113    . = ALIGN (16);
114   
115    /* Exception frame info */
116    *(.eh_frame)
117   
118    . = ALIGN (16);
119
120    /* Do we have any of these with egcs-1.x and higher? */
121    *(.gcc_exc)
122   
123    . = ALIGN (16);
124               
125    _rodata_start = . ;
126    *(.rodata)
127    *(.rodata.*)
128    *(.gnu.linkonce.r*)
129    *(.rodata1)   
130    _erodata = .;
131
132    _etext = .;
133    PROVIDE (etext = .);
134       
135  } >ram =0x4e75
136 
137  . = ALIGN (16);
138 
139  .data :
140  {
141    data_start = .;
142   
143    *(.data)
144    *(.data.*)
145    *(.data1)
146    *(.sdata)
147    *(.gnu.linkonce.d*)
148    *(.gcc_except_table)
149   
150    . = ALIGN (16);
151    _edata = .;
152    PROVIDE (edata = .);
153  } >ram
154
155  .bss :
156  {
157    bss_start = .;
158    *(.dynbss)
159    *(.bss)
160    *(COMMON)
161    *(.sbss)
162    *(.scommon) 
163   
164    . = ALIGN (16);
165    _end = .;
166    PROVIDE (end = .);
167  } >ram
168
169  _HeapStart    = .;
170  . += HeapSize;        /* XXX -- Old gld can't handle this     */
171  _HeapEnd = .;
172  _StackStart = .;
173  . += StackSize;       /* XXX -- Old gld can't handle this     */
174  /* . +=       0x10000; */     /* HeapSize     for     old     gld     */
175  /* . +=       0x1000;  */     /* StackSize for old gld */
176  . =   ALIGN (16);
177  _StackEnd = .;
178  stack_init = .;
179  clear_end =   .;
180
181  _WorkspaceBase        = .;
182
183  /* Stabs debugging sections.  */
184  .stab 0 : { *(.stab) }
185  .stabstr 0 : { *(.stabstr) }
186  .stab.excl 0 : { *(.stab.excl) }
187  .stab.exclstr 0 : { *(.stab.exclstr) }
188  .stab.index 0 : { *(.stab.index) }
189  .stab.indexstr 0 : { *(.stab.indexstr) }
190  .comment 0 : { *(.comment) }
191 
192  /* DWARF debug sections.
193     Symbols in the DWARF debugging sections are relative to the beginning
194     of the section so we begin them at 0.  */
195  /* DWARF 1 */
196  .debug          0 : { *(.debug) }
197  .line           0 : { *(.line) }
198 
199  /* GNU DWARF 1 extensions */
200  .debug_srcinfo  0 : { *(.debug_srcinfo) }
201  .debug_sfnames  0 : { *(.debug_sfnames) }
202 
203  /* DWARF 1.1 and DWARF 2 */
204  .debug_aranges  0 : { *(.debug_aranges) }
205  .debug_pubnames 0 : { *(.debug_pubnames) }
206 
207  /* DWARF 2 */
208  .debug_info     0 : { *(.debug_info) }
209  .debug_abbrev   0 : { *(.debug_abbrev) }
210  .debug_line     0 : { *(.debug_line) }
211  .debug_frame    0 : { *(.debug_frame) }
212  .debug_str      0 : { *(.debug_str) }
213  .debug_loc      0 : { *(.debug_loc) }
214  .debug_macinfo  0 : { *(.debug_macinfo) }
215 
216  /* SGI/MIPS DWARF 2 extensions */
217  .debug_weaknames 0 : { *(.debug_weaknames) }
218  .debug_funcnames 0 : { *(.debug_funcnames) }
219  .debug_typenames 0 : { *(.debug_typenames) }
220  .debug_varnames  0 : { *(.debug_varnames) }
221  /* These must appear regardless of  .  */
222}
223
Note: See TracBrowser for help on using the repository browser.