[3d6669cc] | 1 | /* |
---|
| 2 | * Cirrus EP7312 linker script |
---|
| 3 | * |
---|
| 4 | * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com> |
---|
| 5 | * |
---|
| 6 | * The license and distribution terms for this file may be |
---|
| 7 | * found in the file LICENSE in this distribution or at |
---|
| 8 | * |
---|
| 9 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 10 | * |
---|
| 11 | * |
---|
| 12 | * $Id$ |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", |
---|
| 16 | "elf32-littlearm") |
---|
| 17 | OUTPUT_ARCH(arm) |
---|
| 18 | ENTRY(_start) |
---|
| 19 | /* SEARCH_DIR(/usr/local/rtems-arm-dev-tools/arm-rtems/lib); */ |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | MEMORY { |
---|
| 23 | sdram : ORIGIN = 0x00000000, LENGTH = 16M |
---|
| 24 | regs : ORIGIN = 0x80000000, LENGTH = 1M |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | /* |
---|
| 28 | * Declare some sizes. |
---|
| 29 | */ |
---|
| 30 | |
---|
| 31 | _sdram_base = DEFINED(_sdram_base) ? _sdram_base : 0x00000000; |
---|
| 32 | _sdram_size = DEFINED(_sdram_size) ? _sdram_size : 16M; |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | _irq_stack_size = DEFINED(_irq_stack_size) ? _irq_stack_size : 0x1000; |
---|
| 36 | _fiq_stack_size = DEFINED(_fiq_stack_size) ? _fiq_stack_size : 0x400; |
---|
| 37 | _abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0; |
---|
| 38 | _svc_stack_size = DEFINED(_svc_stack_size) ? _svc_stack_size : 0x1000; |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | /* Do we need any of these for elf? |
---|
| 43 | __DYNAMIC = 0; */ |
---|
| 44 | |
---|
| 45 | SECTIONS |
---|
| 46 | { |
---|
| 47 | .base : |
---|
| 48 | { |
---|
| 49 | _sram_base = .; |
---|
| 50 | arm_exception_table = .; |
---|
| 51 | |
---|
| 52 | arm_reset_vect = .; /* 0x00 */ |
---|
| 53 | . += 4; |
---|
| 54 | |
---|
| 55 | arm_undef_vect = .; /* 0x04 */ |
---|
| 56 | . += 4; |
---|
| 57 | |
---|
| 58 | arm_swi_vect = .; /* 0x08 */ |
---|
| 59 | . += 4; |
---|
| 60 | |
---|
| 61 | arm_iabrt_vect = .; /* 0x0c */ |
---|
| 62 | . += 4; |
---|
| 63 | |
---|
| 64 | arm_dabrt_vect = .; /* 0x10 */ |
---|
| 65 | . += 4; |
---|
| 66 | |
---|
| 67 | /* no vector here */ |
---|
| 68 | . += 4; |
---|
| 69 | |
---|
| 70 | arm_irq_vect = .; /* 0x18 */ |
---|
| 71 | . += 4; |
---|
| 72 | |
---|
| 73 | arm_fiq_vect = .; /* 0x1c */ |
---|
| 74 | . += 4; |
---|
| 75 | /* FIXME: */ |
---|
| 76 | fiq_vect_table = .; /* this and irq_vector_table should be swapped */ |
---|
| 77 | . += (32 * 4); |
---|
| 78 | |
---|
| 79 | irq_vector_table = .; |
---|
| 80 | . += (32 * 4); |
---|
| 81 | |
---|
| 82 | } > sdram |
---|
| 83 | |
---|
| 84 | .init : |
---|
| 85 | { |
---|
| 86 | KEEP (*(.init)) |
---|
| 87 | } > sdram /*=0*/ |
---|
| 88 | |
---|
| 89 | .text : |
---|
| 90 | { |
---|
| 91 | _text_start = .; |
---|
| 92 | CREATE_OBJECT_SYMBOLS |
---|
| 93 | *(.text) |
---|
| 94 | *(.text.*) |
---|
[7b0c547a] | 95 | |
---|
| 96 | /* |
---|
| 97 | * Special FreeBSD sysctl sections. |
---|
| 98 | */ |
---|
| 99 | . = ALIGN (16); |
---|
| 100 | __start_set_sysctl_set = .; |
---|
| 101 | *(set_sysctl_*); |
---|
| 102 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 103 | *(set_domain_*); |
---|
| 104 | *(set_pseudo_*); |
---|
| 105 | |
---|
[36ea4c2a] | 106 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
| 107 | *(.gnu.warning) |
---|
| 108 | *(.gnu.linkonce.t*) |
---|
[3d6669cc] | 109 | *(.glue_7) |
---|
| 110 | *(.glue_7t) |
---|
| 111 | |
---|
| 112 | /* I think these come from the ld docs: */ |
---|
| 113 | ___CTOR_LIST__ = .; |
---|
| 114 | LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2) |
---|
| 115 | *(.ctors) |
---|
| 116 | LONG(0) |
---|
| 117 | ___CTOR_END__ = .; |
---|
| 118 | ___DTOR_LIST__ = .; |
---|
| 119 | LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2) |
---|
| 120 | *(.dtors) |
---|
| 121 | LONG(0) |
---|
| 122 | ___DTOR_END__ = .; |
---|
| 123 | |
---|
| 124 | _etext = .; |
---|
| 125 | PROVIDE (etext = .); |
---|
| 126 | } > sdram |
---|
| 127 | |
---|
| 128 | .fini : |
---|
| 129 | { |
---|
| 130 | KEEP (*(.fini)) |
---|
| 131 | } > sdram /*=0*/ |
---|
| 132 | |
---|
| 133 | .data : |
---|
| 134 | { |
---|
| 135 | *(.data) |
---|
| 136 | *(.data.*) |
---|
| 137 | *(.gnu.linkonce.d*) |
---|
| 138 | *(.jcr) |
---|
| 139 | SORT(CONSTRUCTORS) |
---|
| 140 | _edata = .; |
---|
| 141 | } > sdram |
---|
| 142 | |
---|
| 143 | .eh_frame : { *(.eh_frame) } > RAM |
---|
| 144 | .data1 : { *(.data1) } > RAM |
---|
| 145 | .eh_frame : { *(.eh_frame) } > RAM |
---|
| 146 | .gcc_except_table : { *(.gcc_except_table) } > RAM |
---|
| 147 | |
---|
| 148 | .rodata : |
---|
| 149 | { |
---|
| 150 | *(.rodata) |
---|
| 151 | *(.rodata.*) |
---|
| 152 | *(.gnu.linkonce.r*) |
---|
| 153 | } > sdram |
---|
| 154 | |
---|
| 155 | .bss : |
---|
| 156 | { |
---|
| 157 | _bss_start_ = .; |
---|
| 158 | _clear_start = .; |
---|
| 159 | *(.bss) |
---|
| 160 | *(.bss.*) |
---|
| 161 | *(COMMON) |
---|
| 162 | . = ALIGN(64); |
---|
| 163 | _clear_end = .; |
---|
| 164 | |
---|
| 165 | . = ALIGN (256); |
---|
| 166 | _abt_stack = .; |
---|
| 167 | . += _abt_stack_size; |
---|
| 168 | |
---|
| 169 | . = ALIGN (256); |
---|
| 170 | _irq_stack = .; |
---|
| 171 | . += _irq_stack_size; |
---|
| 172 | |
---|
| 173 | . = ALIGN (256); |
---|
| 174 | _fiq_stack = .; |
---|
| 175 | . += _fiq_stack_size; |
---|
| 176 | |
---|
| 177 | . = ALIGN (256); |
---|
| 178 | _svc_stack = .; |
---|
| 179 | . += _svc_stack_size; |
---|
| 180 | |
---|
| 181 | _bss_end_ = .; |
---|
| 182 | _end = .; |
---|
| 183 | __end = .; |
---|
| 184 | |
---|
| 185 | |
---|
| 186 | . = ALIGN (1024); |
---|
| 187 | _bss_free_start = .; |
---|
| 188 | |
---|
| 189 | } > sdram |
---|
| 190 | |
---|
| 191 | /* |
---|
| 192 | .regs : |
---|
| 193 | { |
---|
| 194 | ep7312_regs_base = .; |
---|
| 195 | ep7312_regs = .; |
---|
| 196 | . += 8192; |
---|
| 197 | } > regs |
---|
| 198 | */ |
---|
| 199 | |
---|
| 200 | |
---|
| 201 | /* Debugging stuff follows? */ |
---|
| 202 | |
---|
| 203 | /* Stabs debugging sections. */ |
---|
| 204 | .stab 0 : { *(.stab) } |
---|
| 205 | .stabstr 0 : { *(.stabstr) } |
---|
| 206 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 207 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 208 | .stab.index 0 : { *(.stab.index) } |
---|
| 209 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 210 | .comment 0 : { *(.comment) } |
---|
| 211 | /* DWARF debug sections. |
---|
| 212 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 213 | of the section so we begin them at 0. */ |
---|
| 214 | /* DWARF 1 */ |
---|
| 215 | .debug 0 : { *(.debug) } |
---|
| 216 | .line 0 : { *(.line) } |
---|
| 217 | /* GNU DWARF 1 extensions */ |
---|
| 218 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 219 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 220 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 221 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 222 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 223 | /* DWARF 2 */ |
---|
| 224 | .debug_info 0 : { *(.debug_info) } |
---|
| 225 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 226 | .debug_line 0 : { *(.debug_line) } |
---|
| 227 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 228 | .debug_str 0 : { *(.debug_str) } |
---|
| 229 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 230 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 231 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 232 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 233 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 234 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 235 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 236 | /*.stack 0x80000 : { _stack = .; *(.stack) }*/ |
---|
| 237 | /* These must appear regardless of . */ |
---|
| 238 | } |
---|
| 239 | |
---|