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

4.104.114.84.9
Last change on this file since 4217b96 was 4217b96, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 8, 2006 at 12:28:38 PM

2006-02-08 Joel Sherrill <joel@…>

  • startup/linkcmds: Add sections required by newer gcc versions.
  • Property mode set to 100644
File size: 5.8 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                 * Special FreeBSD sysctl sections.
102                 */
103                . = ALIGN (16);
104                __start_set_sysctl_set = .;
105                *(set_sysctl_*);
106                __stop_set_sysctl_set = ABSOLUTE(.);
107                *(set_domain_*);
108                *(set_pseudo_*);
109
110                /*
111                 * C++ constructors/destructors
112                 *
113                 * gcc uses crtbegin.o to find the start of the constructors
114                 * and destructors so we make sure it is first.  Because this
115                 * is a wildcard, it doesn't matter if the user does not
116                 * actually link against crtbegin.o; the linker won't look for
117                 * a file to match a wildcard.  The wildcard also means that
118                 * it doesn't matter which directory crtbegin.o is in. The
119                 * constructor and destructor list are terminated in
120                 * crtend.o.  The same comments apply to it.
121                 */
122                . = ALIGN (16);
123                *crtbegin.o(.ctors)
124                *(.ctors)
125                *crtend.o(.ctors)
126                *crtbegin.o(.dtors)
127                *(.dtors)
128                *crtend.o(.dtors)
129
130                /*
131                 * Exception frame info
132                 */
133                . = ALIGN (16);
134                *(.eh_frame)
135
136                /*
137                 * Read-only data
138                 */
139                . = ALIGN (16);
140                _rodata_start = . ;
141                *(.rodata*)
142                *(.gnu.linkonce.r*)
143
144                 . = ALIGN (16);
145                PROVIDE (_etext = .);
146        } >ram
147        .data : {
148                PROVIDE (_copy_start = .);
149                *(.data)
150                *(.gnu.linkonce.d*)
151                *(.gcc_except_table)
152                *(.jcr)
153                . = ALIGN (16);
154                PROVIDE (_edata = .);
155                PROVIDE (_copy_end = .);
156        } >ram
157        .bss : {
158                M68Kvec = .;
159                . += (256 * 4);
160                _clear_start = .;
161                *(.dynbss)
162                *(.bss* .gnu.linkonce.b.*)
163                *(COMMON)
164                . = ALIGN (16);
165                PROVIDE (end = .);
166
167                . += _StackSize;
168                . = ALIGN (16);
169                _stack_init = .;
170                _clear_end = .;
171
172                _WorkspaceBase = .;
173        } >ram
174
175       /*
176        * On-chip memory/peripherals
177        *
178        */
179        dpram : {
180                m340 = .;
181                _m340 = .;
182                . += (8 * 1024);
183        } >ram
184
185
186  /* Stabs debugging sections.  */
187  .stab 0 : { *(.stab) }
188  .stabstr 0 : { *(.stabstr) }
189  .stab.excl 0 : { *(.stab.excl) }
190  .stab.exclstr 0 : { *(.stab.exclstr) }
191  .stab.index 0 : { *(.stab.index) }
192  .stab.indexstr 0 : { *(.stab.indexstr) }
193  .comment 0 : { *(.comment) }
194
195  /* DWARF debug sections.
196     Symbols in the DWARF debugging sections are relative to the beginning
197     of the section so we begin them at 0.  */
198  /* DWARF 1 */
199  .debug          0 : { *(.debug) }
200  .line           0 : { *(.line) }
201 
202  /* GNU DWARF 1 extensions */
203  .debug_srcinfo  0 : { *(.debug_srcinfo) }
204  .debug_sfnames  0 : { *(.debug_sfnames) }
205 
206  /* DWARF 1.1 and DWARF 2 */
207  .debug_aranges  0 : { *(.debug_aranges) }
208  .debug_pubnames 0 : { *(.debug_pubnames) }
209 
210  /* DWARF 2 */
211  .debug_info     0 : { *(.debug_info) }
212  .debug_abbrev   0 : { *(.debug_abbrev) }
213  .debug_line     0 : { *(.debug_line) }
214  .debug_frame    0 : { *(.debug_frame) }
215  .debug_str      0 : { *(.debug_str) }
216  .debug_loc      0 : { *(.debug_loc) }
217  .debug_macinfo  0 : { *(.debug_macinfo) }
218 
219  /* SGI/MIPS DWARF 2 extensions */
220  .debug_weaknames 0 : { *(.debug_weaknames) }
221  .debug_funcnames 0 : { *(.debug_funcnames) }
222  .debug_typenames 0 : { *(.debug_typenames) }
223  .debug_varnames  0 : { *(.debug_varnames) }
224  /* These must appear regardless of  .  */
225}
Note: See TracBrowser for help on using the repository browser.