| 1 |
578 |
jeremybenn |
/* Linker script for m5282evb
|
| 2 |
|
|
*
|
| 3 |
|
|
* Version:Sourcery G++ Lite 4.2-125
|
| 4 |
|
|
* BugURL:https://support.codesourcery.com/GNUToolchain/
|
| 5 |
|
|
*
|
| 6 |
|
|
* Copyright 2007, 2008 CodeSourcery.
|
| 7 |
|
|
*
|
| 8 |
|
|
* The authors hereby grant permission to use, copy, modify, distribute,
|
| 9 |
|
|
* and license this software and its documentation for any purpose, provided
|
| 10 |
|
|
* that existing copyright notices are retained in all copies and that this
|
| 11 |
|
|
* notice is included verbatim in any distributions. No written agreement,
|
| 12 |
|
|
* license, or royalty fee is required for any of the authorized uses.
|
| 13 |
|
|
* Modifications to this software may be copyrighted by their authors
|
| 14 |
|
|
* and need not follow the licensing terms described here, provided that
|
| 15 |
|
|
* the new terms are clearly indicated on the first page of each file where
|
| 16 |
|
|
* they apply. */
|
| 17 |
|
|
|
| 18 |
|
|
OUTPUT_ARCH(m68k)
|
| 19 |
|
|
ENTRY(_start)
|
| 20 |
|
|
SEARCH_DIR(.)
|
| 21 |
|
|
GROUP(-lgcc -lc -lcs3 -lcs3unhosted -lcs3coldfire)
|
| 22 |
|
|
|
| 23 |
|
|
MEMORY
|
| 24 |
|
|
{
|
| 25 |
|
|
ram (rwx) : ORIGIN = 0x00000000, LENGTH = 16M
|
| 26 |
|
|
rom (rx) : ORIGIN = 0xFFE00000, LENGTH = 2M
|
| 27 |
|
|
rombar (rx) : ORIGIN = 0xf0000000, LENGTH = 512K
|
| 28 |
|
|
rambar (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
| 29 |
|
|
ipsbar (rw) : ORIGIN = 0x40000000, LENGTH = 0x20000000
|
| 30 |
|
|
}
|
| 31 |
|
|
|
| 32 |
|
|
/* These force the linker to search for particular symbols from
|
| 33 |
|
|
* the start of the link process and thus ensure the user's
|
| 34 |
|
|
* overrides are picked up
|
| 35 |
|
|
*/
|
| 36 |
|
|
EXTERN(__cs3_reset_m5282evb)
|
| 37 |
|
|
INCLUDE coldfire-names.inc
|
| 38 |
|
|
EXTERN(__cs3_interrupt_vector_coldfire)
|
| 39 |
|
|
EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end)
|
| 40 |
|
|
EXTERN(_start)
|
| 41 |
|
|
|
| 42 |
|
|
PROVIDE(__cs3_heap_start = _end);
|
| 43 |
|
|
PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
|
| 44 |
|
|
PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20);
|
| 45 |
|
|
PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
|
| 46 |
|
|
|
| 47 |
|
|
SECTIONS
|
| 48 |
|
|
{
|
| 49 |
|
|
|
| 50 |
|
|
.text :
|
| 51 |
|
|
{
|
| 52 |
|
|
CREATE_OBJECT_SYMBOLS
|
| 53 |
|
|
__cs3_region_start_ram = .;
|
| 54 |
|
|
*(.cs3.region-head.ram)
|
| 55 |
|
|
ASSERT (. == __cs3_region_start_ram, ".cs3.region-head.ram not permitted");
|
| 56 |
|
|
__cs3_interrupt_vector = __cs3_interrupt_vector_coldfire;
|
| 57 |
|
|
*(.cs3.interrupt_vector)
|
| 58 |
|
|
/* Make sure we pulled in an interrupt vector. */
|
| 59 |
|
|
ASSERT (. != __cs3_interrupt_vector_coldfire, "No interrupt vector");
|
| 60 |
|
|
|
| 61 |
|
|
PROVIDE(__cs3_reset_m5282evb = _start);
|
| 62 |
|
|
__cs3_reset = __cs3_reset_m5282evb;
|
| 63 |
|
|
*(.cs3.reset)
|
| 64 |
|
|
|
| 65 |
|
|
*(.text .text.* .gnu.linkonce.t.*)
|
| 66 |
|
|
|
| 67 |
|
|
. = ALIGN(0x4);
|
| 68 |
|
|
KEEP (*crtbegin.o(.jcr))
|
| 69 |
|
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .jcr))
|
| 70 |
|
|
KEEP (*crtend.o(.jcr))
|
| 71 |
|
|
|
| 72 |
|
|
. = ALIGN(0x4);
|
| 73 |
|
|
*(.gcc_except_table .gcc_except_table.*)
|
| 74 |
|
|
} >ram
|
| 75 |
|
|
.eh_frame_hdr : ALIGN (4)
|
| 76 |
|
|
{
|
| 77 |
|
|
KEEP (*(.eh_frame_hdr))
|
| 78 |
|
|
} >ram
|
| 79 |
|
|
.eh_frame : ALIGN (4)
|
| 80 |
|
|
{
|
| 81 |
|
|
KEEP (*(.eh_frame))
|
| 82 |
|
|
} >ram
|
| 83 |
|
|
.rodata : ALIGN (4)
|
| 84 |
|
|
{
|
| 85 |
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
| 86 |
|
|
|
| 87 |
|
|
. = ALIGN(4);
|
| 88 |
|
|
_init = .;
|
| 89 |
|
|
LONG (0x4e560000) /* linkw %fp,#0 */
|
| 90 |
|
|
KEEP(*(.init))
|
| 91 |
|
|
SHORT (0x4e5e) /* unlk %fp */
|
| 92 |
|
|
SHORT (0x4e75) /* rts */
|
| 93 |
|
|
|
| 94 |
|
|
. = ALIGN(4);
|
| 95 |
|
|
__preinit_array_start = .;
|
| 96 |
|
|
KEEP (*(.preinit_array))
|
| 97 |
|
|
__preinit_array_end = .;
|
| 98 |
|
|
|
| 99 |
|
|
. = ALIGN(4);
|
| 100 |
|
|
__init_array_start = .;
|
| 101 |
|
|
KEEP (*(SORT(.init_array.*)))
|
| 102 |
|
|
KEEP (*(.init_array))
|
| 103 |
|
|
__init_array_end = .;
|
| 104 |
|
|
|
| 105 |
|
|
. = ALIGN(4);
|
| 106 |
|
|
_fini = .;
|
| 107 |
|
|
LONG (0x4e560000) /* linkw %fp,#0 */
|
| 108 |
|
|
KEEP(*(.fini))
|
| 109 |
|
|
SHORT (0x4e5e) /* unlk %fp */
|
| 110 |
|
|
SHORT (0x4e75) /* rts */
|
| 111 |
|
|
|
| 112 |
|
|
. = ALIGN(4);
|
| 113 |
|
|
__fini_array_start = .;
|
| 114 |
|
|
KEEP (*(.fini_array))
|
| 115 |
|
|
KEEP (*(SORT(.fini_array.*)))
|
| 116 |
|
|
__fini_array_end = .;
|
| 117 |
|
|
|
| 118 |
|
|
. = ALIGN(0x4);
|
| 119 |
|
|
KEEP (*crtbegin.o(.ctors))
|
| 120 |
|
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
| 121 |
|
|
KEEP (*(SORT(.ctors.*)))
|
| 122 |
|
|
KEEP (*crtend.o(.ctors))
|
| 123 |
|
|
|
| 124 |
|
|
. = ALIGN(0x4);
|
| 125 |
|
|
KEEP (*crtbegin.o(.dtors))
|
| 126 |
|
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
| 127 |
|
|
KEEP (*(SORT(.dtors.*)))
|
| 128 |
|
|
KEEP (*crtend.o(.dtors))
|
| 129 |
|
|
|
| 130 |
|
|
*(.lit)
|
| 131 |
|
|
|
| 132 |
|
|
. = ALIGN(4);
|
| 133 |
|
|
__cs3_regions = .;
|
| 134 |
|
|
LONG (0)
|
| 135 |
|
|
LONG (__cs3_region_init_ram)
|
| 136 |
|
|
LONG (__cs3_region_start_ram)
|
| 137 |
|
|
LONG (__cs3_region_init_size_ram)
|
| 138 |
|
|
LONG (__cs3_region_zero_size_ram)
|
| 139 |
|
|
LONG (0)
|
| 140 |
|
|
LONG (__cs3_region_init_rombar)
|
| 141 |
|
|
LONG (__cs3_region_start_rombar)
|
| 142 |
|
|
LONG (__cs3_region_init_size_rombar)
|
| 143 |
|
|
LONG (__cs3_region_zero_size_rombar)
|
| 144 |
|
|
LONG (0)
|
| 145 |
|
|
LONG (__cs3_region_init_rambar)
|
| 146 |
|
|
LONG (__cs3_region_start_rambar)
|
| 147 |
|
|
LONG (__cs3_region_init_size_rambar)
|
| 148 |
|
|
LONG (__cs3_region_zero_size_rambar)
|
| 149 |
|
|
__cs3_regions_end = .;
|
| 150 |
|
|
|
| 151 |
|
|
. = ALIGN (8);
|
| 152 |
|
|
. = ALIGN (8);
|
| 153 |
|
|
_etext = .;
|
| 154 |
|
|
} >ram
|
| 155 |
|
|
|
| 156 |
|
|
.cs3.rom : ALIGN (8)
|
| 157 |
|
|
{
|
| 158 |
|
|
__cs3_region_start_rom = .;
|
| 159 |
|
|
*(.cs3.region-head.rom)
|
| 160 |
|
|
*(.rom)
|
| 161 |
|
|
. = ALIGN (8);
|
| 162 |
|
|
} >rom
|
| 163 |
|
|
.cs3.rom.bss :
|
| 164 |
|
|
{
|
| 165 |
|
|
*(.rom.b)
|
| 166 |
|
|
. = ALIGN (8);
|
| 167 |
|
|
} >rom
|
| 168 |
|
|
/* __cs3_region_end_rom is deprecated */
|
| 169 |
|
|
__cs3_region_end_rom = __cs3_region_start_rom + LENGTH(rom);
|
| 170 |
|
|
__cs3_region_size_rom = LENGTH(rom);
|
| 171 |
|
|
__cs3_region_init_rom = LOADADDR (.cs3.rom);
|
| 172 |
|
|
__cs3_region_init_size_rom = LOADADDR (.cs3.rom.bss) - LOADADDR (.cs3.rom);
|
| 173 |
|
|
__cs3_region_zero_size_rom = SIZEOF(.cs3.rom.bss);
|
| 174 |
|
|
|
| 175 |
|
|
.cs3.rombar : ALIGN (8)
|
| 176 |
|
|
{
|
| 177 |
|
|
__cs3_region_start_rombar = .;
|
| 178 |
|
|
*(.cs3.region-head.rombar)
|
| 179 |
|
|
*(.rombar)
|
| 180 |
|
|
. = ALIGN (8);
|
| 181 |
|
|
} >rombar
|
| 182 |
|
|
.cs3.rombar.bss :
|
| 183 |
|
|
{
|
| 184 |
|
|
*(.rombar.b)
|
| 185 |
|
|
. = ALIGN (8);
|
| 186 |
|
|
} >rombar
|
| 187 |
|
|
/* __cs3_region_end_rombar is deprecated */
|
| 188 |
|
|
__cs3_region_end_rombar = __cs3_region_start_rombar + LENGTH(rombar);
|
| 189 |
|
|
__cs3_region_size_rombar = LENGTH(rombar);
|
| 190 |
|
|
__cs3_region_init_rombar = LOADADDR (.cs3.rombar);
|
| 191 |
|
|
__cs3_region_init_size_rombar = LOADADDR (.cs3.rombar.bss) - LOADADDR (.cs3.rombar);
|
| 192 |
|
|
__cs3_region_zero_size_rombar = SIZEOF(.cs3.rombar.bss);
|
| 193 |
|
|
|
| 194 |
|
|
.cs3.rambar : ALIGN (8)
|
| 195 |
|
|
{
|
| 196 |
|
|
__cs3_region_start_rambar = .;
|
| 197 |
|
|
*(.cs3.region-head.rambar)
|
| 198 |
|
|
*(.rambar)
|
| 199 |
|
|
. = ALIGN (8);
|
| 200 |
|
|
} >rambar
|
| 201 |
|
|
.cs3.rambar.bss :
|
| 202 |
|
|
{
|
| 203 |
|
|
*(.rambar.b)
|
| 204 |
|
|
. = ALIGN (8);
|
| 205 |
|
|
} >rambar
|
| 206 |
|
|
/* __cs3_region_end_rambar is deprecated */
|
| 207 |
|
|
__cs3_region_end_rambar = __cs3_region_start_rambar + LENGTH(rambar);
|
| 208 |
|
|
__cs3_region_size_rambar = LENGTH(rambar);
|
| 209 |
|
|
__cs3_region_init_rambar = LOADADDR (.cs3.rambar);
|
| 210 |
|
|
__cs3_region_init_size_rambar = LOADADDR (.cs3.rambar.bss) - LOADADDR (.cs3.rambar);
|
| 211 |
|
|
__cs3_region_zero_size_rambar = SIZEOF(.cs3.rambar.bss);
|
| 212 |
|
|
|
| 213 |
|
|
.cs3.ipsbar :
|
| 214 |
|
|
{
|
| 215 |
|
|
__cs3_region_start_ipsbar = .;
|
| 216 |
|
|
*(.cs3.region-head.ipsbar)
|
| 217 |
|
|
. = ALIGN (8);
|
| 218 |
|
|
} >ipsbar
|
| 219 |
|
|
/* __cs3_region_end_ipsbar is deprecated */
|
| 220 |
|
|
__cs3_region_end_ipsbar = __cs3_region_start_ipsbar + LENGTH(ipsbar);
|
| 221 |
|
|
__cs3_region_size_ipsbar = LENGTH(ipsbar);
|
| 222 |
|
|
|
| 223 |
|
|
.data : ALIGN (8)
|
| 224 |
|
|
{
|
| 225 |
|
|
|
| 226 |
|
|
*(.got.plt) *(.got)
|
| 227 |
|
|
*(.shdata)
|
| 228 |
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
| 229 |
|
|
. = ALIGN (8);
|
| 230 |
|
|
*(.ram)
|
| 231 |
|
|
_edata = .;
|
| 232 |
|
|
} >ram
|
| 233 |
|
|
.bss :
|
| 234 |
|
|
{
|
| 235 |
|
|
*(.shbss)
|
| 236 |
|
|
*(.bss .bss.* .gnu.linkonce.b.*)
|
| 237 |
|
|
*(COMMON)
|
| 238 |
|
|
. = ALIGN (8);
|
| 239 |
|
|
*(.ram.b)
|
| 240 |
|
|
_end = .;
|
| 241 |
|
|
__end = .;
|
| 242 |
|
|
} >ram
|
| 243 |
|
|
/* __cs3_region_end_ram is deprecated */
|
| 244 |
|
|
__cs3_region_end_ram = __cs3_region_start_ram + LENGTH(ram);
|
| 245 |
|
|
__cs3_region_size_ram = LENGTH(ram);
|
| 246 |
|
|
__cs3_region_init_ram = LOADADDR (.text);
|
| 247 |
|
|
__cs3_region_init_size_ram = _edata - ADDR (.text);
|
| 248 |
|
|
__cs3_region_zero_size_ram = _end - _edata;
|
| 249 |
|
|
|
| 250 |
|
|
.stab 0 (NOLOAD) : { *(.stab) }
|
| 251 |
|
|
.stabstr 0 (NOLOAD) : { *(.stabstr) }
|
| 252 |
|
|
/* DWARF debug sections.
|
| 253 |
|
|
* Symbols in the DWARF debugging sections are relative to the beginning
|
| 254 |
|
|
* of the section so we begin them at 0. */
|
| 255 |
|
|
/* DWARF 1 */
|
| 256 |
|
|
.debug 0 : { *(.debug) }
|
| 257 |
|
|
.line 0 : { *(.line) }
|
| 258 |
|
|
/* GNU DWARF 1 extensions */
|
| 259 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
| 260 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
| 261 |
|
|
/* DWARF 1.1 and DWARF 2 */
|
| 262 |
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
| 263 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
| 264 |
|
|
/* DWARF 2 */
|
| 265 |
|
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
| 266 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
| 267 |
|
|
.debug_line 0 : { *(.debug_line) }
|
| 268 |
|
|
.debug_frame 0 : { *(.debug_frame) }
|
| 269 |
|
|
.debug_str 0 : { *(.debug_str) }
|
| 270 |
|
|
.debug_loc 0 : { *(.debug_loc) }
|
| 271 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
| 272 |
|
|
/* SGI/MIPS DWARF 2 extensions */
|
| 273 |
|
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
| 274 |
|
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
| 275 |
|
|
.debug_typenames 0 : { *(.debug_typenames) }
|
| 276 |
|
|
.debug_varnames 0 : { *(.debug_varnames) }
|
| 277 |
|
|
}
|