source: rtems/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds @ d7aecdc

4.104.114.84.95
Last change on this file since d7aecdc was 9f30a08b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/00 at 14:25:46

2000-09-29 Charles-Antoine Gauthier <charles.gauthier@…>

  • startup/linkcmds: Added lines so DWARF debug information would be available. Otherwise gdb complains that the offsets for the debug info are incorrect and doesn't load the files.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*
2 * This file contains GNU linker directives for a generic MC68340/349 board.
3 * Variations in hardware type and dynamic memory size can be made
4 * by overriding some values with linker command-line arguments.
5 *
6 * ATTENTION: RAM and ROM placement must accord those in start340.S!!
7 *            (next time I'll use some shared variables :) )
8 *
9 * Geoffroy Montel
10 * France Telecom - CNET/DSM/TAM/CAT
11 * 4, rue du Clos Courtel
12 * 35512 CESSON-SEVIGNE
13 * FRANCE
14 *
15 * e-mail: g_montel@yahoo.com
16 *
17 *  $Id$
18 */
19
20/*
21 * Declare some sizes.
22 */
23_RamBase = DEFINED(_RamBase) ? _RamBase : 0x10000000;
24_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
25_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
26_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
27
28/*
29 * Declare on-board memory.
30 * It would be nice if the ram length could be given as
31 * LENGTH=_RamSize, but gld doesn't allow non-constant
32 * values in the LENGTH expression. 
33 */
34MEMORY {
35          ram : ORIGIN = 0x10000000, LENGTH = 4M
36          rom : ORIGIN = 0x01000000, LENGTH = 4M
37/*        dpram : ORIGIN = 0xFE000000, LENGTH = 8k */
38}
39
40/*
41 * Declare low-order three octets of Ethernet address.
42 */
43ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
44
45/*
46 * Load objects
47 */
48SECTIONS {
49
50        /*
51         * Boot PROM
52         */
53        rom : {
54                _RomBase = .;
55                __RomBase = .;
56        } >rom
57
58        /*
59         * Dynamic RAM
60         */
61        ram : {
62                . = .;
63        } >ram
64
65        /*
66         * Text, data and bss segments
67         */
68        .text : {
69                *(.text)
70
71                /*
72                 * C++ constructors/destructors
73                 */
74                *(.gnu.linkonce.t.*)
75
76                /*
77                 * Initialization and finalization code.
78                 *
79                 * Various files can provide initialization and finalization
80                 * functions.  crtbegin.o and crtend.o are two instances. The
81                 * body of these functions are in .init and .fini sections. We
82                 * accumulate the bodies here, and prepend function prologues
83                 * from crti.o and function epilogues from crtn.o. crti.o must
84                 * be linked first; crtn.o must be linked last.  Because these
85                 * are wildcards, it doesn't matter if the user does not
86                 * actually link against crti.o and crtn.o; the linker won't
87                 * look for a file to match a wildcard.  The wildcard also
88                 * means that it doesn't matter which directory crti.o and
89                 * crtn.o are in.
90                 */
91                PROVIDE (_init = .);
92                *crti.o(.init)
93                *(.init)
94                *crtn.o(.init)
95                PROVIDE (_fini = .);
96                *crti.o(.fini)
97                *(.fini)
98                *crtn.o(.fini)
99
100                /*
101                 * C++ constructors/destructors
102                 *
103                 * gcc uses crtbegin.o to find the start of the constructors
104                 * and destructors so we make sure it is first.  Because this
105                 * is a wildcard, it doesn't matter if the user does not
106                 * actually link against crtbegin.o; the linker won't look for
107                 * a file to match a wildcard.  The wildcard also means that
108                 * it doesn't matter which directory crtbegin.o is in. The
109                 * constructor and destructor list are terminated in
110                 * crtend.o.  The same comments apply to it.
111                 */
112                . = ALIGN (16);
113                *crtbegin.o(.ctors)
114                *(.ctors)
115                *crtend.o(.ctors)
116                *crtbegin.o(.dtors)
117                *(.dtors)
118                *crtend.o(.dtors)
119
120                /*
121                 * Exception frame info
122                 */
123                . = ALIGN (16);
124                *(.eh_frame)
125
126                /*
127                 * Read-only data
128                 */
129                . = ALIGN (16);
130                _rodata_start = . ;
131                *(.rodata)
132                *(.gnu.linkonce.r*)
133
134                 . = ALIGN (16);
135                PROVIDE (_etext = .);
136        } >ram
137        .data : {
138                PROVIDE (_copy_start = .);
139                *(.data)
140                *(.gnu.linkonce.d*)
141                *(.gcc_except_table)
142                . = ALIGN (16);
143                PROVIDE (_edata = .);
144                PROVIDE (_copy_end = .);
145        } >ram
146        .bss : {
147                M68Kvec = .;
148                . += (256 * 4);
149                _clear_start = .;
150                *(.bss)
151                *(COMMON)
152                . = ALIGN (16);
153                PROVIDE (end = .);
154
155                . += _StackSize;
156                . = ALIGN (16);
157                _stack_init = .;
158                _clear_end = .;
159
160                _WorkspaceBase = .;
161        } >ram
162
163       /*
164        * On-chip memory/peripherals
165        *
166        */
167        dpram : {
168                m340 = .;
169                _m340 = .;
170                . += (8 * 1024);
171        } >ram
172
173
174  /* Stabs debugging sections.  */
175  .stab 0 : { *(.stab) }
176  .stabstr 0 : { *(.stabstr) }
177  .stab.excl 0 : { *(.stab.excl) }
178  .stab.exclstr 0 : { *(.stab.exclstr) }
179  .stab.index 0 : { *(.stab.index) }
180  .stab.indexstr 0 : { *(.stab.indexstr) }
181  .comment 0 : { *(.comment) }
182
183  /* DWARF debug sections.
184     Symbols in the DWARF debugging sections are relative to the beginning
185     of the section so we begin them at 0.  */
186  /* DWARF 1 */
187  .debug          0 : { *(.debug) }
188  .line           0 : { *(.line) }
189 
190  /* GNU DWARF 1 extensions */
191  .debug_srcinfo  0 : { *(.debug_srcinfo) }
192  .debug_sfnames  0 : { *(.debug_sfnames) }
193 
194  /* DWARF 1.1 and DWARF 2 */
195  .debug_aranges  0 : { *(.debug_aranges) }
196  .debug_pubnames 0 : { *(.debug_pubnames) }
197 
198  /* DWARF 2 */
199  .debug_info     0 : { *(.debug_info) }
200  .debug_abbrev   0 : { *(.debug_abbrev) }
201  .debug_line     0 : { *(.debug_line) }
202  .debug_frame    0 : { *(.debug_frame) }
203  .debug_str      0 : { *(.debug_str) }
204  .debug_loc      0 : { *(.debug_loc) }
205  .debug_macinfo  0 : { *(.debug_macinfo) }
206 
207  /* SGI/MIPS DWARF 2 extensions */
208  .debug_weaknames 0 : { *(.debug_weaknames) }
209  .debug_funcnames 0 : { *(.debug_funcnames) }
210  .debug_typenames 0 : { *(.debug_typenames) }
211  .debug_varnames  0 : { *(.debug_varnames) }
212  /* These must appear regardless of  .  */
213}
Note: See TracBrowser for help on using the repository browser.