[996a9cb4] | 1 | /* |
---|
| 2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
[e2d79559] | 3 | * Variations in hardware type and dynamic memory size can be made |
---|
| 4 | * by overriding some values with linker command-line arguments. |
---|
| 5 | * |
---|
| 6 | * These linker directives are for producing a BOOTP PROM. |
---|
| 7 | * To create the PROM image from the linker output you must use objcopy |
---|
[996a9cb4] | 8 | * (--adjust-section-vma) to place the data segment at the end of the text |
---|
| 9 | * segment in the PROM. The start-up code takes care of copying this region |
---|
| 10 | * to RAM. |
---|
| 11 | * |
---|
| 12 | * Saskatchewan Accelerator Laboratory |
---|
| 13 | * University of Saskatchewan |
---|
| 14 | * Saskatoon, Saskatchewan, CANADA |
---|
| 15 | * eric@skatter.usask.ca |
---|
| 16 | * |
---|
| 17 | * $Id$ |
---|
| 18 | */ |
---|
| 19 | |
---|
| 20 | /* |
---|
| 21 | * a.out format doesn't handle prom images very well |
---|
| 22 | */ |
---|
| 23 | OUTPUT_FORMAT(coff-m68k) |
---|
| 24 | |
---|
| 25 | /* |
---|
[e2d79559] | 26 | * Declare some sizes. |
---|
| 27 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
| 28 | * number used there is not constant. If this happens to you, edit |
---|
| 29 | * the lines marked XXX below to use a constant value. |
---|
| 30 | */ |
---|
| 31 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
| 32 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
| 33 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
| 34 | |
---|
| 35 | /* |
---|
| 36 | * Declare on-board memory. |
---|
| 37 | * It would be nice if the ram length could be given as |
---|
| 38 | * LENGTH=RamSize, but gld doesn't allow non-constant |
---|
| 39 | * values in the LENGTH expression. |
---|
[996a9cb4] | 40 | */ |
---|
| 41 | MEMORY { |
---|
[e2d79559] | 42 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
[996a9cb4] | 43 | rom : ORIGIN = 0xFF000000, LENGTH = 1M |
---|
| 44 | dpram : ORIGIN = 0xFE000000, LENGTH = 8k |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | /* |
---|
[e2d79559] | 48 | * Declare low-order three octets of Ethernet address. |
---|
[996a9cb4] | 49 | */ |
---|
[e2d79559] | 50 | ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; |
---|
[996a9cb4] | 51 | |
---|
| 52 | /* |
---|
| 53 | * Load objects |
---|
| 54 | */ |
---|
| 55 | SECTIONS { |
---|
[e2d79559] | 56 | /* |
---|
| 57 | * Hardware variations |
---|
| 58 | */ |
---|
| 59 | _RamSize = RamSize; |
---|
| 60 | __RamSize = RamSize; |
---|
| 61 | |
---|
[996a9cb4] | 62 | /* |
---|
| 63 | * Boot PROM |
---|
| 64 | */ |
---|
| 65 | rom : { |
---|
| 66 | _RomBase = .; |
---|
| 67 | __RomBase = .; |
---|
| 68 | } >rom |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * Dynamic RAM |
---|
| 72 | */ |
---|
| 73 | ram : { |
---|
| 74 | _RamBase = .; |
---|
| 75 | __RamBase = .; |
---|
| 76 | } >ram |
---|
| 77 | |
---|
| 78 | /* |
---|
| 79 | * Text, data and bss segments |
---|
| 80 | */ |
---|
| 81 | .text : { |
---|
| 82 | CREATE_OBJECT_SYMBOLS |
---|
| 83 | *(.text) |
---|
| 84 | . = ALIGN (16); |
---|
[1587af6] | 85 | |
---|
| 86 | /* |
---|
| 87 | * C++ constructors |
---|
| 88 | */ |
---|
| 89 | __CTOR_LIST__ = .; |
---|
| 90 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
| 91 | *(.ctors) |
---|
| 92 | LONG(0) |
---|
| 93 | __CTOR_END__ = .; |
---|
| 94 | __DTOR_LIST__ = .; |
---|
| 95 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
| 96 | *(.dtors) |
---|
| 97 | LONG(0) |
---|
| 98 | __DTOR_END__ = .; |
---|
[c257ec4e] | 99 | |
---|
| 100 | etext = .; |
---|
| 101 | _etext = .; |
---|
[996a9cb4] | 102 | } >rom |
---|
| 103 | .data : { |
---|
| 104 | copy_start = .; |
---|
| 105 | *(.data) |
---|
| 106 | . = ALIGN (16); |
---|
| 107 | _edata = .; |
---|
| 108 | copy_end = .; |
---|
| 109 | } >ram |
---|
| 110 | .bss : { |
---|
| 111 | M68Kvec = .; |
---|
| 112 | _M68Kvec = .; |
---|
| 113 | . += (256 * 4); |
---|
| 114 | clear_start = .; |
---|
| 115 | *(.bss) |
---|
| 116 | *(COMMON) |
---|
| 117 | . = ALIGN (16); |
---|
| 118 | _end = .; |
---|
| 119 | |
---|
| 120 | _HeapStart = .; |
---|
| 121 | __HeapStart = .; |
---|
[e2d79559] | 122 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
| 123 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
| 124 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
| 125 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
[996a9cb4] | 126 | . = ALIGN (16); |
---|
| 127 | stack_init = .; |
---|
| 128 | clear_end = .; |
---|
| 129 | |
---|
| 130 | _WorkspaceBase = .; |
---|
| 131 | __WorkspaceBase = .; |
---|
| 132 | } >ram |
---|
| 133 | |
---|
| 134 | /* |
---|
| 135 | * On-chip memory/peripherals |
---|
| 136 | */ |
---|
| 137 | dpram : { |
---|
| 138 | m360 = .; |
---|
| 139 | _m360 = .; |
---|
| 140 | . += (8 * 1024); |
---|
| 141 | |
---|
| 142 | } >dpram |
---|
| 143 | } |
---|