[457b6ae] | 1 | /* |
---|
[e2d79559] | 2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
[f8f370b6] | 3 | * Variations in memory size and allocation can be made by |
---|
| 4 | * overriding some values with linker command-line arguments. |
---|
[457b6ae] | 5 | * |
---|
| 6 | * Saskatchewan Accelerator Laboratory |
---|
| 7 | * University of Saskatchewan |
---|
| 8 | * Saskatoon, Saskatchewan, CANADA |
---|
| 9 | * eric@skatter.usask.ca |
---|
| 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | /* |
---|
[e2d79559] | 15 | * Declare some sizes. |
---|
| 16 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
| 17 | * number used there is not constant. If this happens to you, edit |
---|
| 18 | * the lines marked XXX below to use a constant value. |
---|
| 19 | */ |
---|
| 20 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
| 21 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
| 22 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * Declare on-board memory. |
---|
| 26 | * It would be nice if the ram length could be given as |
---|
| 27 | * LENGTH=RamSize, but gld doesn't allow non-constant |
---|
| 28 | * values in the LENGTH expression. |
---|
[457b6ae] | 29 | */ |
---|
| 30 | MEMORY { |
---|
[e2d79559] | 31 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
[f8f370b6] | 32 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
| 33 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
[457b6ae] | 34 | } |
---|
| 35 | |
---|
| 36 | /* |
---|
[e2d79559] | 37 | * Declare low-order three octets of Ethernet address. |
---|
[457b6ae] | 38 | */ |
---|
[e2d79559] | 39 | ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; |
---|
[11532ca] | 40 | |
---|
[457b6ae] | 41 | /* |
---|
| 42 | * Load objects |
---|
| 43 | */ |
---|
| 44 | SECTIONS { |
---|
[e2d79559] | 45 | /* |
---|
| 46 | * Hardware variations |
---|
| 47 | */ |
---|
| 48 | _RamSize = RamSize; |
---|
| 49 | __RamSize = RamSize; |
---|
| 50 | |
---|
[996a9cb4] | 51 | /* |
---|
| 52 | * Boot PROM |
---|
| 53 | */ |
---|
| 54 | rom : { |
---|
| 55 | _RomBase = .; |
---|
| 56 | __RomBase = .; |
---|
| 57 | } >rom |
---|
| 58 | |
---|
| 59 | /* |
---|
| 60 | * Dynamic RAM |
---|
| 61 | */ |
---|
| 62 | ram : { |
---|
| 63 | _RamBase = .; |
---|
| 64 | __RamBase = .; |
---|
| 65 | } >ram |
---|
| 66 | |
---|
| 67 | /* |
---|
| 68 | * Text, data and bss segments |
---|
| 69 | */ |
---|
[457b6ae] | 70 | .text : { |
---|
[996a9cb4] | 71 | CREATE_OBJECT_SYMBOLS |
---|
| 72 | *(.text) |
---|
| 73 | . = ALIGN (16); |
---|
| 74 | etext = .; |
---|
| 75 | _etext = .; |
---|
[457b6ae] | 76 | } >ram |
---|
| 77 | .data : { |
---|
[996a9cb4] | 78 | copy_start = .; |
---|
| 79 | *(.data) |
---|
| 80 | . = ALIGN (16); |
---|
| 81 | _edata = .; |
---|
| 82 | copy_end = .; |
---|
[457b6ae] | 83 | } >ram |
---|
| 84 | .bss : { |
---|
[996a9cb4] | 85 | M68Kvec = .; |
---|
| 86 | _M68Kvec = .; |
---|
| 87 | . += (256 * 4); |
---|
| 88 | clear_start = .; |
---|
| 89 | *(.bss) |
---|
| 90 | *(COMMON) |
---|
| 91 | . = ALIGN (16); |
---|
| 92 | _end = .; |
---|
[11532ca] | 93 | |
---|
[996a9cb4] | 94 | _HeapStart = .; |
---|
| 95 | __HeapStart = .; |
---|
[3e7b167] | 96 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
| 97 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
| 98 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
| 99 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
[996a9cb4] | 100 | . = ALIGN (16); |
---|
| 101 | stack_init = .; |
---|
| 102 | clear_end = .; |
---|
[457b6ae] | 103 | |
---|
[996a9cb4] | 104 | _WorkspaceBase = .; |
---|
| 105 | __WorkspaceBase = .; |
---|
| 106 | } >ram |
---|
[457b6ae] | 107 | |
---|
[996a9cb4] | 108 | /* |
---|
| 109 | * On-chip memory/peripherals |
---|
| 110 | */ |
---|
| 111 | dpram : { |
---|
| 112 | m360 = .; |
---|
| 113 | _m360 = .; |
---|
| 114 | . += (8 * 1024); |
---|
[457b6ae] | 115 | |
---|
[996a9cb4] | 116 | } >dpram |
---|
[457b6ae] | 117 | } |
---|