[332484b5] | 1 | /* linkcmds |
---|
| 2 | * |
---|
| 3 | * $Id$ |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | OUTPUT_ARCH(m68k) |
---|
| 7 | STARTUP(except_vect_332_ROM.o) |
---|
| 8 | __DYNAMIC = 0; |
---|
| 9 | |
---|
| 10 | /* |
---|
| 11 | * ROM: |
---|
| 12 | * +--------------------+ <- low memory |
---|
| 13 | * | .text | |
---|
| 14 | * | etext | |
---|
| 15 | * | ctor list | the ctor and dtor lists are for |
---|
| 16 | * | dtor list | C++ support |
---|
| 17 | * | _endtext | |
---|
| 18 | * | temporary .data | .data is moved to RAM by crt0 |
---|
| 19 | * | | |
---|
| 20 | * +--------------------+ <- high memory |
---|
| 21 | * |
---|
| 22 | * |
---|
| 23 | * RAM: |
---|
| 24 | * +--------------------+ <- low memory |
---|
| 25 | * | .data | initialized data goes here |
---|
| 26 | * | _sdata | |
---|
| 27 | * | _edata | |
---|
| 28 | * +--------------------+ |
---|
| 29 | * | .bss | |
---|
| 30 | * | __bss_start | start of bss, cleared by crt0 |
---|
| 31 | * | _end | start of heap, used by sbrk() |
---|
| 32 | * +--------------------+ |
---|
| 33 | * | heap space | |
---|
| 34 | * | _ENDHEAP | |
---|
| 35 | * | stack space | |
---|
| 36 | * | __stack | top of stack |
---|
| 37 | * +--------------------+ <- high memory |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | MEMORY |
---|
| 41 | { |
---|
| 42 | rom : ORIGIN = 0x90000, LENGTH = 0x70000 |
---|
| 43 | ram : ORIGIN = 0x03000, LENGTH = 0x7d000 |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x003000; |
---|
| 47 | _RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000; |
---|
| 48 | _RamEnd = _RamBase + _RamSize; |
---|
| 49 | |
---|
| 50 | __end_of_ram = 0x080000; |
---|
| 51 | _copy_data_from_rom = 1; |
---|
| 52 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; |
---|
[c0c6168] | 53 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000; |
---|
[332484b5] | 54 | |
---|
| 55 | /* |
---|
| 56 | * |
---|
| 57 | */ |
---|
| 58 | SECTIONS |
---|
| 59 | { |
---|
| 60 | .text : |
---|
| 61 | { |
---|
| 62 | . = .; |
---|
| 63 | CREATE_OBJECT_SYMBOLS |
---|
| 64 | text_start = .; |
---|
| 65 | _text_start = .; |
---|
| 66 | *(.text) |
---|
| 67 | . = ALIGN (16); |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * Initialization and finalization code. |
---|
| 72 | * |
---|
| 73 | * Various files can provide initialization and finalization |
---|
| 74 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
| 75 | * body of these functions are in .init and .fini sections. We |
---|
| 76 | * accumulate the bodies here, and prepend function prologues |
---|
| 77 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
| 78 | * be linked first; crtn.o must be linked last. Because these |
---|
| 79 | * are wildcards, it doesn't matter if the user does not |
---|
| 80 | * actually link against crti.o and crtn.o; the linker won't |
---|
| 81 | * look for a file to match a wildcard. The wildcard also |
---|
| 82 | * means that it doesn't matter which directory crti.o and |
---|
| 83 | * crtn.o are in. |
---|
| 84 | */ |
---|
| 85 | PROVIDE (_init = .); |
---|
| 86 | *crti.o(.init) |
---|
| 87 | *(.init) |
---|
| 88 | *crtn.o(.init) |
---|
| 89 | PROVIDE (_fini = .); |
---|
| 90 | *crti.o(.fini) |
---|
| 91 | *(.fini) |
---|
| 92 | *crtn.o(.fini) |
---|
| 93 | |
---|
[c0c6168] | 94 | /* |
---|
| 95 | * Special FreeBSD sysctl sections. |
---|
| 96 | */ |
---|
| 97 | . = ALIGN (16); |
---|
| 98 | __start_set_sysctl_set = .; |
---|
| 99 | *(set_sysctl_*); |
---|
| 100 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 101 | *(set_domain_*); |
---|
| 102 | *(set_pseudo_*); |
---|
| 103 | |
---|
| 104 | /* |
---|
| 105 | * C++ constructors/destructors |
---|
| 106 | * |
---|
| 107 | * gcc uses crtbegin.o to find the start of the constructors |
---|
| 108 | * and destructors so we make sure it is first. Because this |
---|
| 109 | * is a wildcard, it doesn't matter if the user does not |
---|
| 110 | * actually link against crtbegin.o; the linker won't look for |
---|
| 111 | * a file to match a wildcard. The wildcard also means that |
---|
| 112 | * it doesn't matter which directory crtbegin.o is in. The |
---|
| 113 | * constructor and destructor list are terminated in |
---|
| 114 | * crtend.o. The same comments apply to it. |
---|
| 115 | */ |
---|
| 116 | . = ALIGN (16); |
---|
| 117 | *crtbegin.o(.ctors) |
---|
| 118 | *(.ctors) |
---|
| 119 | *crtend.o(.ctors) |
---|
| 120 | *crtbegin.o(.dtors) |
---|
| 121 | *(.dtors) |
---|
| 122 | *crtend.o(.dtors) |
---|
| 123 | |
---|
| 124 | *(.eh_frame) |
---|
[332484b5] | 125 | . = ALIGN (16); |
---|
| 126 | |
---|
| 127 | /* |
---|
| 128 | * Read-only data |
---|
| 129 | */ |
---|
| 130 | . = ALIGN (16); |
---|
| 131 | _rodata_start = . ; |
---|
[c0c6168] | 132 | *(.rodata*) |
---|
[332484b5] | 133 | *(.gnu.linkonce.r*) |
---|
| 134 | |
---|
| 135 | etext = ALIGN(0x10); |
---|
| 136 | __CTOR_LIST__ = .; |
---|
| 137 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
| 138 | *(.ctors) |
---|
| 139 | LONG(0) |
---|
| 140 | __CTOR_END__ = .; |
---|
| 141 | __DTOR_LIST__ = .; |
---|
| 142 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
| 143 | *(.dtors) |
---|
| 144 | LONG(0) |
---|
| 145 | __DTOR_END__ = .; |
---|
| 146 | *(.lit) |
---|
| 147 | *(.shdata) |
---|
| 148 | _etext = .; |
---|
| 149 | _endtext = .; |
---|
| 150 | } > rom |
---|
| 151 | .gcc_exc : |
---|
| 152 | AT ( ADDR(.text) + SIZEOF( .text ) ) |
---|
| 153 | { |
---|
| 154 | *(.gcc_exc) |
---|
| 155 | } > ram |
---|
| 156 | .data : |
---|
| 157 | { |
---|
| 158 | data_start = .; |
---|
| 159 | _data_start = .; |
---|
| 160 | _copy_start = .; |
---|
| 161 | _sdata = . ; |
---|
| 162 | *(.data) |
---|
[c0c6168] | 163 | *(.gnu.linkonce.d*) |
---|
| 164 | *(.gcc_except_table) |
---|
| 165 | *(.jcr) |
---|
| 166 | |
---|
[332484b5] | 167 | CONSTRUCTORS |
---|
| 168 | edata = ALIGN(0x10); |
---|
| 169 | _edata = .; |
---|
| 170 | } > ram |
---|
| 171 | .shbss : |
---|
| 172 | { |
---|
| 173 | *(.shbss) |
---|
| 174 | } > ram |
---|
| 175 | .bss : |
---|
| 176 | { |
---|
| 177 | __bss_start = ALIGN(0x8); |
---|
| 178 | bss_start = .; |
---|
| 179 | _bss_start = .; |
---|
| 180 | _clear_start = .; |
---|
[9f903322] | 181 | *(.shbss) |
---|
| 182 | *(.dynbss) |
---|
| 183 | *(.bss .bss.* .gnu.linkonce.b.*) |
---|
[332484b5] | 184 | *(COMMON) |
---|
[c0c6168] | 185 | . = ALIGN (16); |
---|
[332484b5] | 186 | end = .; |
---|
| 187 | _end = ALIGN(0x8); |
---|
| 188 | __end = ALIGN(0x8); |
---|
| 189 | |
---|
| 190 | _WorkspaceBase = . + _StackSize; |
---|
| 191 | } > ram |
---|
| 192 | .stab . (NOLOAD) : |
---|
| 193 | { |
---|
| 194 | [ .stab ] |
---|
| 195 | } |
---|
| 196 | .stabstr . (NOLOAD) : |
---|
| 197 | { |
---|
| 198 | [ .stabstr ] |
---|
| 199 | } |
---|
| 200 | } |
---|