source: rtems/bsps/m68k/gen68340/start/linkcmds @ ffa1153

5
Last change on this file since ffa1153 was ffa1153, checked in by Sebastian Huber <sebastian.huber@…>, on 12/14/19 at 20:36:09

bsps: Add RamEnd? to linker command files

Update #3838.

  • Property mode set to 100644
File size: 6.4 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
18/*
19 * Declare some sizes.
20 */
21RamBase = DEFINED(RamBase) ? RamBase : 0x10000000;
22RamSize = DEFINED(RamSize) ? RamSize : 4M;
23RamEnd = RamBase + RamSize;
24HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
25
26/*
27 * Declare on-board memory.
28 * It would be nice if the ram length could be given as
29 * LENGTH=RamSize, but gld doesn't allow non-constant
30 * values in the LENGTH expression. 
31 */
32MEMORY {
33          ram : ORIGIN = 0x10000000, LENGTH = 4M
34          rom : ORIGIN = 0x01000000, LENGTH = 4M
35/*        dpram : ORIGIN = 0xFE000000, LENGTH = 8k */
36}
37
38ENTRY(start)
39STARTUP(start.o)
40
41/*
42 * Declare low-order three octets of Ethernet address.
43 */
44ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
45
46/*
47 * Load objects
48 */
49SECTIONS {
50
51        /*
52         * Boot PROM
53         */
54        rom : {
55                _RomBase = .;
56                __RomBase = .;
57        } >rom
58
59        /*
60         * Dynamic RAM
61         */
62        ram : {
63                . = .;
64        } >ram
65
66        /*
67         * Text, data and bss segments
68         */
69        .text : {
70                *(.text*)
71
72                /*
73                 * C++ constructors/destructors
74                 */
75                *(.gnu.linkonce.t.*)
76
77                /*
78                 * Initialization and finalization code.
79                 *
80                 * Various files can provide initialization and finalization
81                 * functions.  crtbegin.o and crtend.o are two instances. The
82                 * body of these functions are in .init and .fini sections. We
83                 * accumulate the bodies here, and prepend function prologues
84                 * from crti.o and function epilogues from crtn.o. crti.o must
85                 * be linked first; crtn.o must be linked last.  Because these
86                 * are wildcards, it doesn't matter if the user does not
87                 * actually link against crti.o and crtn.o; the linker won't
88                 * look for a file to match a wildcard.  The wildcard also
89                 * means that it doesn't matter which directory crti.o and
90                 * crtn.o are in.
91                 */
92                PROVIDE (_init = .);
93                *crti.o(.init)
94                *(.init)
95                *crtn.o(.init)
96                PROVIDE (_fini = .);
97                *crti.o(.fini)
98                *(.fini)
99                *crtn.o(.fini)
100
101                /*
102                 * Special FreeBSD sysctl sections.
103                 */
104                . = ALIGN (16);
105                __start_set_sysctl_set = .;
106                *(set_sysctl_*);
107                __stop_set_sysctl_set = ABSOLUTE(.);
108                *(set_domain_*);
109                *(set_pseudo_*);
110
111                /*
112                 * C++ constructors/destructors
113                 *
114                 * gcc uses crtbegin.o to find the start of the constructors
115                 * and destructors so we make sure it is first.  Because this
116                 * is a wildcard, it doesn't matter if the user does not
117                 * actually link against crtbegin.o; the linker won't look for
118                 * a file to match a wildcard.  The wildcard also means that
119                 * it doesn't matter which directory crtbegin.o is in. The
120                 * constructor and destructor list are terminated in
121                 * crtend.o.  The same comments apply to it.
122                 */
123                . = ALIGN (16);
124                *crtbegin.o(.ctors)
125                *(.ctors)
126                *crtend.o(.ctors)
127                *crtbegin.o(.dtors)
128                *(.dtors)
129                *crtend.o(.dtors)
130
131                /*
132                 * Exception frame info
133                 */
134                . = ALIGN (16);
135                *(.eh_frame)
136
137                /*
138                 * Read-only data
139                 */
140                . = ALIGN (16);
141                _rodata_start = . ;
142                *(.rodata*)
143                KEEP (*(SORT(.rtemsroset.*)))
144                *(.gnu.linkonce.r*)
145
146                 . = ALIGN (16);
147                PROVIDE (_etext = .);
148        } >ram
149
150        .tdata : {
151                _TLS_Data_begin = .;
152                *(.tdata .tdata.* .gnu.linkonce.td.*)
153                _TLS_Data_end = .;
154        } >ram
155
156        .tbss : {
157                _TLS_BSS_begin = .;
158                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
159                _TLS_BSS_end = .;
160        } >ram
161
162        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
163        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
164        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
165        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
166        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
167        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
168
169        .data : {
170                PROVIDE (_copy_start = .);
171                *(.data*)
172                KEEP (*(SORT(.rtemsrwset.*)))
173                *(.gnu.linkonce.d*)
174                *(.gcc_except_table*)
175                *(.jcr)
176                . = ALIGN (16);
177                PROVIDE (_edata = .);
178                PROVIDE (_copy_end = .);
179        } >ram
180        .bss : {
181                M68Kvec = .;
182                . += (256 * 4);
183                _clear_start = .;
184                *(.dynbss)
185                *(.bss* .gnu.linkonce.b.*)
186                *(COMMON)
187                . = ALIGN (16);
188                PROVIDE (end = .);
189                _clear_end = .;
190        } >ram
191
192        .rtemsstack (NOLOAD) : {
193                *(SORT(.rtemsstack.*))
194                WorkAreaBase = .;
195        } >ram
196
197       /*
198        * On-chip memory/peripherals
199        *
200        */
201        dpram : {
202                m340 = .;
203                _m340 = .;
204                . += (8 * 1024);
205        } >ram
206
207
208  /* Stabs debugging sections.  */
209  .stab 0 : { *(.stab) }
210  .stabstr 0 : { *(.stabstr) }
211  .stab.excl 0 : { *(.stab.excl) }
212  .stab.exclstr 0 : { *(.stab.exclstr) }
213  .stab.index 0 : { *(.stab.index) }
214  .stab.indexstr 0 : { *(.stab.indexstr) }
215  .comment 0 : { *(.comment) }
216
217  /* DWARF debug sections.
218     Symbols in the DWARF debugging sections are relative to the beginning
219     of the section so we begin them at 0.  */
220  /* DWARF 1 */
221  .debug          0 : { *(.debug) }
222  .line           0 : { *(.line) }
223 
224  /* GNU DWARF 1 extensions */
225  .debug_srcinfo  0 : { *(.debug_srcinfo) }
226  .debug_sfnames  0 : { *(.debug_sfnames) }
227 
228  /* DWARF 1.1 and DWARF 2 */
229  .debug_aranges  0 : { *(.debug_aranges) }
230  .debug_pubnames 0 : { *(.debug_pubnames) }
231 
232  /* DWARF 2 */
233  .debug_info     0 : { *(.debug_info) }
234  .debug_abbrev   0 : { *(.debug_abbrev) }
235  .debug_line     0 : { *(.debug_line) }
236  .debug_frame    0 : { *(.debug_frame) }
237  .debug_str      0 : { *(.debug_str) }
238  .debug_loc      0 : { *(.debug_loc) }
239  .debug_macinfo  0 : { *(.debug_macinfo) }
240 
241  /* SGI/MIPS DWARF 2 extensions */
242  .debug_weaknames 0 : { *(.debug_weaknames) }
243  .debug_funcnames 0 : { *(.debug_funcnames) }
244  .debug_typenames 0 : { *(.debug_typenames) }
245  .debug_varnames  0 : { *(.debug_varnames) }
246  /* These must appear regardless of  .  */
247}
Note: See TracBrowser for help on using the repository browser.