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

4.104.114.84.95
Last change on this file since 350808f was 21023ab8, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/05 at 16:59:49

2005-01-09 Joel Sherrill <joel@…>

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