[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; |
---|
[f849f3e] | 17 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
| 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 = . ; |
---|
| 32 | *(.init) |
---|
| 33 | eprol = .; |
---|
| 34 | *(.text) |
---|
| 35 | *(.text.*) |
---|
[b45c7f2] | 36 | *(.eh_frame) |
---|
[f849f3e] | 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 = .); |
---|
| 44 | *(.fini) |
---|
[0ea3293] | 45 | *(.gcc_except_table) |
---|
| 46 | } >ram |
---|
[7de58239] | 47 | |
---|
| 48 | .ctors : |
---|
[f849f3e] | 49 | { |
---|
| 50 | /* gcc uses crtbegin.o to find the start of |
---|
| 51 | the constructors, so we make sure it is |
---|
| 52 | first. Because this is a wildcard, it |
---|
| 53 | doesn't matter if the user does not |
---|
| 54 | actually link against crtbegin.o; the |
---|
| 55 | linker won't look for a file to match a |
---|
| 56 | wildcard. The wildcard also means that it |
---|
| 57 | doesn't matter which directory crtbegin.o |
---|
| 58 | is in. */ |
---|
| 59 | |
---|
| 60 | KEEP (*crtbegin.o(.ctors)) |
---|
| 61 | |
---|
| 62 | /* We don't want to include the .ctor section from |
---|
| 63 | from the crtend.o file until after the sorted ctors. |
---|
| 64 | The .ctor section from the crtend file contains the |
---|
| 65 | end of ctors marker and it must be last */ |
---|
| 66 | |
---|
| 67 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
| 68 | KEEP (*(SORT(.ctors.*))) |
---|
| 69 | KEEP (*(.ctors)) |
---|
[0ea3293] | 70 | } >ram |
---|
[f849f3e] | 71 | |
---|
[7de58239] | 72 | .dtors : |
---|
[f849f3e] | 73 | { |
---|
| 74 | KEEP (*crtbegin.o(.dtors)) |
---|
| 75 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
| 76 | KEEP (*(SORT(.dtors.*))) |
---|
| 77 | KEEP (*(.dtors)) |
---|
| 78 | |
---|
[7de58239] | 79 | etext = .; |
---|
| 80 | _etext = .; |
---|
[0ea3293] | 81 | } >ram |
---|
| 82 | |
---|
[7de58239] | 83 | |
---|
| 84 | |
---|
| 85 | .rdata : |
---|
| 86 | { |
---|
[f849f3e] | 87 | *(.rdata) |
---|
| 88 | *(.rodata) |
---|
| 89 | *(.rodata.*) |
---|
| 90 | *(.gnu.linkonce.r*) |
---|
[0ea3293] | 91 | } >ram |
---|
[7de58239] | 92 | |
---|
| 93 | .data : |
---|
| 94 | { |
---|
| 95 | _fdata = ALIGN(16); |
---|
| 96 | |
---|
[f849f3e] | 97 | *(.data) |
---|
| 98 | *(.data.*) |
---|
| 99 | *(.gnu.linkonce.d*) |
---|
[0ea3293] | 100 | } >ram |
---|
[7de58239] | 101 | |
---|
| 102 | |
---|
| 103 | .lit8 : |
---|
| 104 | { |
---|
| 105 | . = ALIGN(8); |
---|
| 106 | |
---|
| 107 | _gp = . + 0x8000; |
---|
| 108 | __global = _gp; |
---|
[f849f3e] | 109 | *(.lit8) |
---|
[0ea3293] | 110 | } >ram |
---|
[7de58239] | 111 | |
---|
| 112 | .lit4 : |
---|
| 113 | { |
---|
[f849f3e] | 114 | *(.lit4) |
---|
[0ea3293] | 115 | } >ram |
---|
[7de58239] | 116 | |
---|
| 117 | .sdata : |
---|
| 118 | { |
---|
[f849f3e] | 119 | *(.sdata) |
---|
| 120 | *(.sdata.*) |
---|
| 121 | *(.gnu.linkonce.s*) |
---|
[0ea3293] | 122 | } >ram |
---|
[7de58239] | 123 | |
---|
| 124 | .sbss : |
---|
| 125 | { |
---|
[f849f3e] | 126 | edata = .; |
---|
| 127 | _edata = .; |
---|
| 128 | _fbss = .; |
---|
| 129 | *(.sbss) |
---|
| 130 | *(.scommon) |
---|
[0ea3293] | 131 | } >ram |
---|
[7de58239] | 132 | |
---|
| 133 | |
---|
| 134 | .bss : |
---|
| 135 | { |
---|
[f849f3e] | 136 | _bss_start = . ; |
---|
| 137 | *(.bss) |
---|
[7de58239] | 138 | *(.reginfo) |
---|
[f849f3e] | 139 | *(COMMON) |
---|
| 140 | . = ALIGN (64); |
---|
| 141 | _stack_limit = .; |
---|
| 142 | . += _StackSize; |
---|
| 143 | __stack = .; |
---|
| 144 | _stack_init = .; |
---|
| 145 | _clear_end = .; |
---|
| 146 | HeapBase = .; |
---|
| 147 | . += HeapSize; /* reserve some memory for heap */ |
---|
[2cdde6d] | 148 | WorkspaceBase = .; |
---|
[7de58239] | 149 | end = .; |
---|
| 150 | _end = .; |
---|
[0ea3293] | 151 | } >ram |
---|
[f849f3e] | 152 | |
---|
| 153 | |
---|
[7de58239] | 154 | /* |
---|
| 155 | ** DWARF debug sections. |
---|
| 156 | ** Symbols in the DWARF debugging sections are relative to |
---|
| 157 | ** the beginning of the section so we begin them at 0. |
---|
| 158 | */ |
---|
[f849f3e] | 159 | |
---|
| 160 | /* DWARF 1 */ |
---|
[0ea3293] | 161 | .debug 0 : { *(.debug) } |
---|
| 162 | .line 0 : { *(.line) } |
---|
[f849f3e] | 163 | |
---|
| 164 | /* GNU DWARF 1 extensions */ |
---|
[0ea3293] | 165 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 166 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
[f849f3e] | 167 | |
---|
| 168 | /* DWARF 1.1 and DWARF 2 */ |
---|
[0ea3293] | 169 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 170 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
[f849f3e] | 171 | |
---|
| 172 | /* DWARF 2 */ |
---|
[0ea3293] | 173 | .debug_info 0 : { *(.debug_info) } |
---|
| 174 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 175 | .debug_line 0 : { *(.debug_line) } |
---|
| 176 | .debug_frame 0 : { *(.debug_frame)} |
---|
| 177 | .debug_str 0 : { *(.debug_str) } |
---|
| 178 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 179 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
[f849f3e] | 180 | |
---|
| 181 | /* SGI/MIPS DWARF 2 extensions */ |
---|
[0ea3293] | 182 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 183 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 184 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 185 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
[f849f3e] | 186 | } |
---|