[f849f3e] | 1 | /* |
---|
| 2 | * Linker script for Mongoose-V prototyping board. |
---|
| 3 | * See README for address map details. |
---|
| 4 | * |
---|
| 5 | * $Id$ |
---|
| 6 | */ |
---|
| 7 | |
---|
[7de58239] | 8 | /* . = 0x80020000; */ |
---|
| 9 | |
---|
[f849f3e] | 10 | /* |
---|
| 11 | * Declare some sizes. |
---|
| 12 | */ |
---|
[7de58239] | 13 | |
---|
[f849f3e] | 14 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000000; |
---|
| 15 | _RamSize = DEFINED(_RamSize) ? _RamSize : 32M; |
---|
[7de58239] | 16 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x40000; |
---|
[8f10c92] | 17 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x4000; |
---|
[f849f3e] | 18 | ClockRate = DEFINED(ClockRate) ? ClockRate : 12000000; |
---|
| 19 | |
---|
[7de58239] | 20 | |
---|
| 21 | |
---|
| 22 | MEMORY |
---|
| 23 | { |
---|
| 24 | ram : ORIGIN = 0x80020000, LENGTH = 4M |
---|
| 25 | } |
---|
| 26 | |
---|
[f849f3e] | 27 | SECTIONS |
---|
| 28 | { |
---|
| 29 | .text : |
---|
| 30 | { |
---|
| 31 | _ftext = . ; |
---|
[8f10c92] | 32 | |
---|
| 33 | */start.o(.text) |
---|
| 34 | |
---|
[f849f3e] | 35 | *(.text) |
---|
| 36 | *(.text.*) |
---|
| 37 | *(.gnu.linkonce.t*) |
---|
| 38 | *(.mips16.fn.*) |
---|
| 39 | *(.mips16.call.*) |
---|
| 40 | PROVIDE (__runtime_reloc_start = .); |
---|
| 41 | *(.rel.sdata) |
---|
[7de58239] | 42 | *(.rel.dyn) |
---|
[f849f3e] | 43 | PROVIDE (__runtime_reloc_stop = .); |
---|
[8f10c92] | 44 | |
---|
[9c1133e] | 45 | /* |
---|
| 46 | * Special FreeBSD sysctl sections. |
---|
| 47 | */ |
---|
| 48 | . = ALIGN (16); |
---|
| 49 | __start_set_sysctl_set = .; |
---|
| 50 | *(set_sysctl_*); |
---|
| 51 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 52 | *(set_domain_*); |
---|
| 53 | *(set_pseudo_*); |
---|
| 54 | |
---|
[0ea3293] | 55 | *(.gcc_except_table) |
---|
[8f10c92] | 56 | *(.eh_frame_hdr) |
---|
| 57 | *(.eh_frame) |
---|
[0ea3293] | 58 | } >ram |
---|
[7de58239] | 59 | |
---|
[8f10c92] | 60 | .init : |
---|
| 61 | { |
---|
| 62 | KEEP(*(.init)) |
---|
| 63 | |
---|
| 64 | } > ram |
---|
| 65 | |
---|
| 66 | .fini : |
---|
| 67 | { |
---|
| 68 | KEEP(*(.fini)) |
---|
| 69 | |
---|
| 70 | } > ram |
---|
| 71 | |
---|
| 72 | |
---|
[7de58239] | 73 | .ctors : |
---|
[f849f3e] | 74 | { |
---|
| 75 | /* gcc uses crtbegin.o to find the start of |
---|
| 76 | the constructors, so we make sure it is |
---|
| 77 | first. Because this is a wildcard, it |
---|
| 78 | doesn't matter if the user does not |
---|
| 79 | actually link against crtbegin.o; the |
---|
| 80 | linker won't look for a file to match a |
---|
| 81 | wildcard. The wildcard also means that it |
---|
| 82 | doesn't matter which directory crtbegin.o |
---|
| 83 | is in. */ |
---|
| 84 | |
---|
| 85 | KEEP (*crtbegin.o(.ctors)) |
---|
| 86 | |
---|
| 87 | /* We don't want to include the .ctor section from |
---|
| 88 | from the crtend.o file until after the sorted ctors. |
---|
| 89 | The .ctor section from the crtend file contains the |
---|
| 90 | end of ctors marker and it must be last */ |
---|
| 91 | |
---|
| 92 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
| 93 | KEEP (*(SORT(.ctors.*))) |
---|
| 94 | KEEP (*(.ctors)) |
---|
[0ea3293] | 95 | } >ram |
---|
[f849f3e] | 96 | |
---|
[7de58239] | 97 | .dtors : |
---|
[f849f3e] | 98 | { |
---|
| 99 | KEEP (*crtbegin.o(.dtors)) |
---|
| 100 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
| 101 | KEEP (*(SORT(.dtors.*))) |
---|
| 102 | KEEP (*(.dtors)) |
---|
| 103 | |
---|
[7de58239] | 104 | etext = .; |
---|
| 105 | _etext = .; |
---|
[0ea3293] | 106 | } >ram |
---|
| 107 | |
---|
[7de58239] | 108 | |
---|
| 109 | |
---|
| 110 | .rdata : |
---|
| 111 | { |
---|
[f849f3e] | 112 | *(.rdata) |
---|
| 113 | *(.rodata) |
---|
| 114 | *(.rodata.*) |
---|
| 115 | *(.gnu.linkonce.r*) |
---|
[0ea3293] | 116 | } >ram |
---|
[7de58239] | 117 | |
---|
| 118 | .data : |
---|
| 119 | { |
---|
| 120 | _fdata = ALIGN(16); |
---|
| 121 | |
---|
[f849f3e] | 122 | *(.data) |
---|
| 123 | *(.data.*) |
---|
| 124 | *(.gnu.linkonce.d*) |
---|
[0ea3293] | 125 | } >ram |
---|
[7de58239] | 126 | |
---|
[8f10c92] | 127 | .jcr : |
---|
[7de58239] | 128 | { |
---|
| 129 | . = ALIGN(8); |
---|
[8f10c92] | 130 | KEEP (*(.jcr)) |
---|
[7de58239] | 131 | |
---|
[8f10c92] | 132 | _gp = ALIGN(16) + 0x7440; |
---|
[7de58239] | 133 | __global = _gp; |
---|
[8f10c92] | 134 | } >ram |
---|
| 135 | |
---|
| 136 | .lit8 : |
---|
| 137 | { |
---|
[f849f3e] | 138 | *(.lit8) |
---|
[0ea3293] | 139 | } >ram |
---|
[7de58239] | 140 | |
---|
| 141 | .lit4 : |
---|
| 142 | { |
---|
[f849f3e] | 143 | *(.lit4) |
---|
[0ea3293] | 144 | } >ram |
---|
[7de58239] | 145 | |
---|
| 146 | .sdata : |
---|
| 147 | { |
---|
[f849f3e] | 148 | *(.sdata) |
---|
| 149 | *(.sdata.*) |
---|
| 150 | *(.gnu.linkonce.s*) |
---|
[0ea3293] | 151 | } >ram |
---|
[7de58239] | 152 | |
---|
| 153 | .sbss : |
---|
| 154 | { |
---|
[f849f3e] | 155 | edata = .; |
---|
| 156 | _edata = .; |
---|
| 157 | _fbss = .; |
---|
| 158 | *(.sbss) |
---|
| 159 | *(.scommon) |
---|
[0ea3293] | 160 | } >ram |
---|
[7de58239] | 161 | |
---|
| 162 | |
---|
| 163 | .bss : |
---|
| 164 | { |
---|
[f849f3e] | 165 | _bss_start = . ; |
---|
| 166 | *(.bss) |
---|
[7de58239] | 167 | *(.reginfo) |
---|
[f849f3e] | 168 | *(COMMON) |
---|
| 169 | . = ALIGN (64); |
---|
| 170 | _stack_limit = .; |
---|
| 171 | . += _StackSize; |
---|
| 172 | __stack = .; |
---|
| 173 | _stack_init = .; |
---|
| 174 | _clear_end = .; |
---|
| 175 | HeapBase = .; |
---|
| 176 | . += HeapSize; /* reserve some memory for heap */ |
---|
[2cdde6d] | 177 | WorkspaceBase = .; |
---|
[7de58239] | 178 | end = .; |
---|
| 179 | _end = .; |
---|
[0ea3293] | 180 | } >ram |
---|
[f849f3e] | 181 | |
---|
| 182 | |
---|
[7de58239] | 183 | /* |
---|
| 184 | ** DWARF debug sections. |
---|
| 185 | ** Symbols in the DWARF debugging sections are relative to |
---|
| 186 | ** the beginning of the section so we begin them at 0. |
---|
| 187 | */ |
---|
[f849f3e] | 188 | |
---|
| 189 | /* DWARF 1 */ |
---|
[0ea3293] | 190 | .debug 0 : { *(.debug) } |
---|
| 191 | .line 0 : { *(.line) } |
---|
[f849f3e] | 192 | |
---|
| 193 | /* GNU DWARF 1 extensions */ |
---|
[0ea3293] | 194 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 195 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
[f849f3e] | 196 | |
---|
| 197 | /* DWARF 1.1 and DWARF 2 */ |
---|
[0ea3293] | 198 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 199 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
[f849f3e] | 200 | |
---|
| 201 | /* DWARF 2 */ |
---|
[0ea3293] | 202 | .debug_info 0 : { *(.debug_info) } |
---|
| 203 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 204 | .debug_line 0 : { *(.debug_line) } |
---|
| 205 | .debug_frame 0 : { *(.debug_frame)} |
---|
| 206 | .debug_str 0 : { *(.debug_str) } |
---|
| 207 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 208 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
[f849f3e] | 209 | |
---|
| 210 | /* SGI/MIPS DWARF 2 extensions */ |
---|
[0ea3293] | 211 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 212 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 213 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 214 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
[f849f3e] | 215 | } |
---|