source: rtems/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds @ 29387823

4.104.114.84.95
Last change on this file since 29387823 was 29387823, checked in by Chris Johns <chrisj@…>, on 06/23/03 at 12:04:21

PR264 - Stopped the core dump by removing the bad instruction.
PR414 - Fixed the global interupt vector register.
Linker command file to have the boot code in the first 8K.
The chip select remap needed to be volatile.

  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*
2 * $Id$
3 *
4 * MC68302 Linker command file
5 *
6 */
7
8/*
9 * Declare some sizes.
10 */
11_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
12_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
13_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
14_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
15
16/*
17 * Memory map.
18 */
19RAM_BASE = DEFINED(RAM_BASE) ? RAM_BASE : 0x00000000;
20RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x00100000;
21ROM_BASE = DEFINED(ROM_BASE) ? ROM_BASE : 0x00C00000;
22ROM_SIZE = DEFINED(ROM_SIZE) ? ROM_SIZE : 0x00100000;
23MC68302_BASE = DEFINED(MC68302_BASE) ? MC68302_BASE : 0x00700000;
24
25/*
26 * Declare on-board memory.
27 */
28MEMORY {
29          ram : ORIGIN = 0x00000000, LENGTH = 1M
30}
31SECTIONS
32{
33        .vtable RAM_BASE :
34        {
35                vtable_start = .;
36                *(.vtable)
37                evtable = .;
38        } >ram
39
40        /*
41         * Text, data and bss segments
42         */
43        .text ROM_BASE : {
44                /*
45                 * Needs to be first. 8K limit on CS0 at reset.
46                 */
47                *(.resettext);
48                *cpuboot.o(.text)
49
50                /*
51                 * The reset of the text is entered once CS0 is remapped.
52                 */
53                *(.text)
54
55                /*
56                 * C++ constructors/destructors
57                 */
58                *(.gnu.linkonce.t.*)
59
60                /*
61                 * Initialization and finalization code.
62                 *
63                 * Various files can provide initialization and finalization
64                 * functions.  crtbegin.o and crtend.o are two instances. The
65                 * body of these functions are in .init and .fini sections. We
66                 * accumulate the bodies here, and prepend function prologues
67                 * from crti.o and function epilogues from crtn.o. crti.o must
68                 * be linked first; crtn.o must be linked last.  Because these
69                 * are wildcards, it doesn't matter if the user does not
70                 * actually link against crti.o and crtn.o; the linker won't
71                 * look for a file to match a wildcard.  The wildcard also
72                 * means that it doesn't matter which directory crti.o and
73                 * crtn.o are in.
74                 */
75                PROVIDE (_init = .);
76                *crti.o(.init)
77                *(.init)
78                *crtn.o(.init)
79                PROVIDE (_fini = .);
80                *crti.o(.fini)
81                *(.fini)
82                *crtn.o(.fini)
83
84                /*
85                 * Special FreeBSD sysctl sections.
86                 */
87                . = ALIGN (16);
88                __start_set_sysctl_set = .;
89                *(set_sysctl_*);
90                __stop_set_sysctl_set = ABSOLUTE(.);
91                *(set_domain_*);
92                *(set_pseudo_*);
93
94                /*
95                 * C++ constructors/destructors
96                 *
97                 * gcc uses crtbegin.o to find the start of the constructors
98                 * and destructors so we make sure it is first.  Because this
99                 * is a wildcard, it doesn't matter if the user does not
100                 * actually link against crtbegin.o; the linker won't look for
101                 * a file to match a wildcard.  The wildcard also means that
102                 * it doesn't matter which directory crtbegin.o is in. The
103                 * constructor and destructor list are terminated in
104                 * crtend.o.  The same comments apply to it.
105                 */
106                . = ALIGN (16);
107                *crtbegin.o(.ctors)
108                *(.ctors)
109                *crtend.o(.ctors)
110                *crtbegin.o(.dtors)
111                *(.dtors)
112                *crtend.o(.dtors)
113
114                /*
115                 * Exception frame info
116                 */
117                . = ALIGN (16);
118                *(.eh_frame)
119
120                /*
121                 * Read-only data
122                 */
123                . = ALIGN (16);
124                _rodata_start = .;
125                *(.rodata*)
126                *(.gnu.linkonce.r*)
127
128                 . = ALIGN (16);
129                PROVIDE (_etext = .);
130        } >rom
131
132        .data (ADDR(.vtable) + SIZEOF(.vtable)) :
133          AT (ADDR(.text) + SIZEOF(.text)) {
134                PROVIDE (_copy_start = .);
135                *(.data)
136                *(.gnu.linkonce.d*)
137                *(.gcc_except_table)
138                *(.jcr)
139                . = ALIGN (16);
140                PROVIDE (_edata = .);
141                PROVIDE (_copy_end = .);
142        } >ram
143        .bss (ADDR(.data) + SIZEOF(.data)) : {
144                _clear_start = .;
145                *(.bss)
146                *(COMMON)
147                . = ALIGN (16);
148                PROVIDE (end = .);
149
150                . += _StackSize;
151                . = ALIGN (16);
152                _stack_init = .;
153                _clear_end = .;
154
155                _WorkspaceBase = .;
156        } >ram
157
158  /* Stabs debugging sections.  */
159  .stab 0 : { *(.stab) }
160  .stabstr 0 : { *(.stabstr) }
161  .stab.excl 0 : { *(.stab.excl) }
162  .stab.exclstr 0 : { *(.stab.exclstr) }
163  .stab.index 0 : { *(.stab.index) }
164  .stab.indexstr 0 : { *(.stab.indexstr) }
165  .comment 0 : { *(.comment) }
166
167  /* DWARF debug sections.
168     Symbols in the DWARF debugging sections are relative to the beginning
169     of the section so we begin them at 0.  */
170  /* DWARF 1 */
171  .debug          0 : { *(.debug) }
172  .line           0 : { *(.line) }
173 
174  /* GNU DWARF 1 extensions */
175  .debug_srcinfo  0 : { *(.debug_srcinfo) }
176  .debug_sfnames  0 : { *(.debug_sfnames) }
177 
178  /* DWARF 1.1 and DWARF 2 */
179  .debug_aranges  0 : { *(.debug_aranges) }
180  .debug_pubnames 0 : { *(.debug_pubnames) }
181 
182  /* DWARF 2 */
183  .debug_info     0 : { *(.debug_info) }
184  .debug_abbrev   0 : { *(.debug_abbrev) }
185  .debug_line     0 : { *(.debug_line) }
186  .debug_frame    0 : { *(.debug_frame) }
187  .debug_str      0 : { *(.debug_str) }
188  .debug_loc      0 : { *(.debug_loc) }
189  .debug_macinfo  0 : { *(.debug_macinfo) }
190 
191  /* SGI/MIPS DWARF 2 extensions */
192  .debug_weaknames 0 : { *(.debug_weaknames) }
193  .debug_funcnames 0 : { *(.debug_funcnames) }
194  .debug_typenames 0 : { *(.debug_typenames) }
195  .debug_varnames  0 : { *(.debug_varnames) }
196  /* These must appear regardless of  .  */
197}
198
199m302 = MC68302_BASE;
200_VBR = ADDR(.vtable);           /* location of the VBR table (in RAM) */
201
Note: See TracBrowser for help on using the repository browser.