[4a238002] | 1 | /* |
---|
| 2 | * This is an adapted linker script from egcs-1.0.1 |
---|
| 3 | * |
---|
| 4 | * Memory layout for an SH7045F with main memory in area 2 |
---|
| 5 | * This memory layout it very similar to that used for Hitachi's |
---|
| 6 | * EVB with CMON in FLASH |
---|
| 7 | * |
---|
| 8 | * NOTE: The ram start address may vary, all other start addresses are fixed |
---|
| 9 | * Not suiteable for gdb's simulator |
---|
| 10 | * |
---|
| 11 | * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and |
---|
| 12 | * Bernd Becker (becker@faw.uni-ulm.de) |
---|
| 13 | * |
---|
| 14 | * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany |
---|
| 15 | * |
---|
| 16 | * This program is distributed in the hope that it will be useful, |
---|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
| 19 | * |
---|
| 20 | * |
---|
| 21 | * COPYRIGHT (c) 1998. |
---|
| 22 | * On-Line Applications Research Corporation (OAR). |
---|
| 23 | * Copyright assigned to U.S. Government, 1994. |
---|
| 24 | * |
---|
| 25 | * The license and distribution terms for this file may be |
---|
| 26 | * found in the file LICENSE in this distribution or at |
---|
| 27 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 28 | * |
---|
| 29 | * Modified to reflect SH7045F processor and EVB: |
---|
| 30 | * John M. Mills (jmills@tga.com) |
---|
| 31 | * TGA Technologies, Inc. |
---|
| 32 | * 100 Pinnacle Way, Suite 140 |
---|
| 33 | * Norcross, GA 30071 U.S.A. |
---|
| 34 | * |
---|
| 35 | * This modified file may be copied and distributed in accordance |
---|
| 36 | * the above-referenced license. It is provided for critique and |
---|
| 37 | * developmental purposes without any warranty nor representation |
---|
| 38 | * by the authors or by TGA Technologies. |
---|
| 39 | * |
---|
| 40 | * $Id$ |
---|
| 41 | */ |
---|
| 42 | |
---|
| 43 | OUTPUT_ARCH(sh) |
---|
| 44 | ENTRY(_start) |
---|
| 45 | |
---|
| 46 | /* These assignments load code into SH7045F EVB SRAM for monitor debugging */ |
---|
| 47 | |
---|
| 48 | MEMORY |
---|
| 49 | { |
---|
| 50 | rom : o = 0x00400000, l = 0x00040000 |
---|
| 51 | ram : o = 0x00440000, l = 0x00040000 |
---|
| 52 | onchip_peri : o = 0xFFFF8000, l = 0x00000800 |
---|
| 53 | onchip_ram : o = 0xFFFFF000, l = 0x00001000 |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | /* Sections are defined for RAM loading and monitor debugging */ |
---|
| 57 | SECTIONS |
---|
| 58 | { |
---|
| 59 | /* boot vector table */ |
---|
| 60 | .monvects 0x00400000 (NOLOAD): { |
---|
| 61 | _monvects = . ; |
---|
| 62 | } > rom |
---|
| 63 | |
---|
| 64 | /* monitor play area */ |
---|
| 65 | .monram 0x00440000 (NOLOAD) : |
---|
| 66 | { |
---|
| 67 | _ramstart = .; |
---|
| 68 | } > ram |
---|
| 69 | |
---|
| 70 | /* monitor vector table */ |
---|
| 71 | .vects 0x00442000 (NOLOAD) : { |
---|
| 72 | _vectab = . ; |
---|
| 73 | *(.vects); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | /* Read-only sections, merged into text segment: */ |
---|
| 77 | |
---|
| 78 | . = 0x00444000 ; |
---|
| 79 | .interp : { *(.interp) } |
---|
| 80 | .hash : { *(.hash) } |
---|
| 81 | .dynsym : { *(.dynsym) } |
---|
| 82 | .dynstr : { *(.dynstr) } |
---|
| 83 | .gnu.version : { *(.gnu.version) } |
---|
| 84 | .gnu.version_d : { *(.gnu.version_d) } |
---|
| 85 | .gnu.version_r : { *(.gnu.version_r) } |
---|
| 86 | .rel.text : |
---|
| 87 | { *(.rel.text) *(.rel.gnu.linkonce.t*) } |
---|
| 88 | .rela.text : |
---|
| 89 | { *(.rela.text) *(.rela.gnu.linkonce.t*) } |
---|
| 90 | .rel.data : |
---|
| 91 | { *(.rel.data) *(.rel.gnu.linkonce.d*) } |
---|
| 92 | .rela.data : |
---|
| 93 | { *(.rela.data) *(.rela.gnu.linkonce.d*) } |
---|
| 94 | .rel.rodata : |
---|
| 95 | { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } |
---|
| 96 | .rela.rodata : |
---|
| 97 | { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } |
---|
| 98 | .rel.got : { *(.rel.got) } |
---|
| 99 | .rela.got : { *(.rela.got) } |
---|
| 100 | .rel.ctors : { *(.rel.ctors) } |
---|
| 101 | .rela.ctors : { *(.rela.ctors) } |
---|
| 102 | .rel.dtors : { *(.rel.dtors) } |
---|
| 103 | .rela.dtors : { *(.rela.dtors) } |
---|
| 104 | .rel.init : { *(.rel.init) } |
---|
| 105 | .rela.init : { *(.rela.init) } |
---|
| 106 | .rel.fini : { *(.rel.fini) } |
---|
| 107 | .rela.fini : { *(.rela.fini) } |
---|
| 108 | .rel.bss : { *(.rel.bss) } |
---|
| 109 | .rela.bss : { *(.rela.bss) } |
---|
| 110 | .rel.plt : { *(.rel.plt) } |
---|
| 111 | .rela.plt : { *(.rela.plt) } |
---|
| 112 | .init : { *(.init) } =0 |
---|
| 113 | .plt : { *(.plt) } |
---|
| 114 | .text . : |
---|
| 115 | { |
---|
| 116 | *(.text) |
---|
| 117 | *(.stub) |
---|
| 118 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
| 119 | *(.gnu.warning) |
---|
| 120 | *(.gnu.linkonce.t*) |
---|
| 121 | } > ram |
---|
| 122 | _etext = .; |
---|
| 123 | PROVIDE (etext = .); |
---|
| 124 | .fini . : { *(.fini) } =0 |
---|
| 125 | .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } |
---|
| 126 | .rodata1 . : { *(.rodata1) } |
---|
| 127 | /* Adjust the address for the data segment. We want to adjust up to |
---|
| 128 | the same address within the page on the next page up. */ |
---|
| 129 | . = ALIGN(128) + (. & (128 - 1)); |
---|
| 130 | .data . : |
---|
| 131 | { |
---|
| 132 | *(.data) |
---|
| 133 | *(.gnu.linkonce.d*) |
---|
| 134 | CONSTRUCTORS |
---|
| 135 | } > ram |
---|
| 136 | .data1 . : { *(.data1) } |
---|
| 137 | .ctors . : |
---|
| 138 | { |
---|
| 139 | ___ctors = .; |
---|
| 140 | *(.ctors) |
---|
| 141 | ___ctors_end = .; |
---|
| 142 | } |
---|
| 143 | .dtors . : |
---|
| 144 | { |
---|
| 145 | ___dtors = .; |
---|
| 146 | *(.dtors) |
---|
| 147 | ___dtors_end = .; |
---|
| 148 | } |
---|
| 149 | .got . : { *(.got.plt) *(.got) } |
---|
| 150 | .dynamic . : { *(.dynamic) } |
---|
| 151 | /* We want the small data sections together, so single-instruction offsets |
---|
| 152 | can access them all, and initialized data all before uninitialized, so |
---|
| 153 | we can shorten the on-disk segment size. */ |
---|
| 154 | .sdata . : { *(.sdata) } |
---|
| 155 | _edata = .; |
---|
| 156 | PROVIDE (edata = .); |
---|
| 157 | __bss_start = .; |
---|
| 158 | .sbss . : { *(.sbss) *(.scommon) } |
---|
| 159 | .bss . : |
---|
| 160 | { |
---|
| 161 | *(.dynbss) |
---|
| 162 | *(.bss) |
---|
| 163 | *(COMMON) |
---|
| 164 | } > ram |
---|
| 165 | _end = . ; |
---|
| 166 | PROVIDE (end = .); |
---|
| 167 | |
---|
| 168 | _HeapStart = . ; |
---|
| 169 | . = . + 1024 * 20 ; |
---|
| 170 | PROVIDE( _HeapEnd = . ); |
---|
| 171 | |
---|
| 172 | _WorkSpaceStart = . ; |
---|
| 173 | . = 0x00480000 ; |
---|
| 174 | PROVIDE(_WorkSpaceEnd = .); |
---|
| 175 | |
---|
| 176 | _CPU_Interrupt_stack_low = 0xFFFFF000 ; |
---|
| 177 | _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ; |
---|
| 178 | |
---|
| 179 | /* Stabs debugging sections. */ |
---|
| 180 | .stab 0 : { *(.stab) } |
---|
| 181 | .stabstr 0 : { *(.stabstr) } |
---|
| 182 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 183 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 184 | .stab.index 0 : { *(.stab.index) } |
---|
| 185 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 186 | .comment 0 : { *(.comment) } |
---|
| 187 | /* DWARF debug sections. |
---|
| 188 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 189 | of the section so we begin them at 0. */ |
---|
| 190 | /* DWARF 1 */ |
---|
| 191 | .debug 0 : { *(.debug) } |
---|
| 192 | .line 0 : { *(.line) } |
---|
| 193 | /* GNU DWARF 1 extensions */ |
---|
| 194 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 195 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 196 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 197 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 198 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 199 | /* DWARF 2 */ |
---|
| 200 | .debug_info 0 : { *(.debug_info) } |
---|
| 201 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 202 | .debug_line 0 : { *(.debug_line) } |
---|
| 203 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 204 | .debug_str 0 : { *(.debug_str) } |
---|
| 205 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 206 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 207 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 208 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 209 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 210 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 211 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 212 | |
---|
| 213 | .stack 0xFFFFFEC0 : { _stack = .; *(.stack) } > onchip_ram |
---|
| 214 | /* These must appear regardless of . */ |
---|
| 215 | } |
---|