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

4.104.114.84.95
Last change on this file since b8c9883 was b8c9883, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 13, 2000 at 8:45:07 PM

All m68k BSPs now build with new ELF style linkcmds.

  • Property mode set to 100644
File size: 4.2 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 = 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}
Note: See TracBrowser for help on using the repository browser.