[501d312] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | */ |
---|
| 4 | |
---|
| 5 | /* |
---|
| 6 | * Declare some sizes. |
---|
| 7 | */ |
---|
| 8 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0; |
---|
| 9 | _RamSize = DEFINED(_RamSize) ? _RamSize : 1M; |
---|
| 10 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; |
---|
| 11 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
| 12 | |
---|
| 13 | ENTRY("_start") |
---|
| 14 | /* The memory size is 256KB to coincide with the simulator. |
---|
| 15 | Don't change either without considering the other. */ |
---|
| 16 | MEMORY |
---|
| 17 | { |
---|
| 18 | /* 0xc4 is a magic entry. We should have the linker just |
---|
| 19 | skip over it one day... */ |
---|
| 20 | vectors : o = 0x0000, l = 0xc4 |
---|
| 21 | magicvectors : o = 0xc4, l = 0x3c |
---|
| 22 | /* We still only use 256k as the main ram size. */ |
---|
| 23 | ram : o = 0x0100, l = 0x3fefc |
---|
| 24 | /* The stack starts at the top of main ram. */ |
---|
| 25 | topram : o = 0x3fffc, l = 0x4 |
---|
| 26 | /* This holds variables in the "tiny" sections. */ |
---|
| 27 | tiny : o = 0xff8000, l = 0x7f00 |
---|
| 28 | /* At the very top of the address space is the 8-bit area. */ |
---|
| 29 | eight : o = 0xffff00, l = 0x100 |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | SECTIONS |
---|
| 34 | { |
---|
| 35 | .vectors : |
---|
| 36 | { |
---|
| 37 | *(.vectors) |
---|
| 38 | } > vectors |
---|
| 39 | |
---|
| 40 | .text : |
---|
| 41 | { |
---|
| 42 | CREATE_OBJECT_SYMBOLS |
---|
| 43 | *(.text) |
---|
| 44 | _etext = .; |
---|
| 45 | |
---|
| 46 | /* |
---|
| 47 | ___CTOR_LIST__ = .; |
---|
| 48 | LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2) |
---|
| 49 | *(.ctors) |
---|
| 50 | LONG(0) |
---|
| 51 | ___CTOR_END__ = .; |
---|
| 52 | ___DTOR_LIST__ = .; |
---|
| 53 | LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2) |
---|
| 54 | *(.dtors) |
---|
| 55 | LONG(0) |
---|
| 56 | ___DTOR_END__ = .; |
---|
| 57 | */ |
---|
| 58 | } >ram |
---|
| 59 | .data SIZEOF(.text) + ADDR(.text): |
---|
| 60 | { |
---|
| 61 | *(.data) |
---|
| 62 | CONSTRUCTORS |
---|
| 63 | _edata = .; |
---|
| 64 | } >ram |
---|
| 65 | .bss SIZEOF(.data) + ADDR(.data): |
---|
| 66 | { |
---|
| 67 | _bss_start = .; |
---|
| 68 | *(.bss) |
---|
| 69 | *(COMMON) |
---|
| 70 | . = ALIGN (64); |
---|
| 71 | . += _StackSize; |
---|
| 72 | _stack_init = .; |
---|
| 73 | _clear_end = .; |
---|
| 74 | _WorkspaceBase = .; |
---|
| 75 | . += 512K; /* reserve some memory for workspace */ |
---|
| 76 | _HeapBase = .; |
---|
| 77 | . += _HeapSize; /* reserve some memory for heap */ |
---|
| 78 | _end = .; |
---|
| 79 | __end = .; |
---|
| 80 | } >ram |
---|
| 81 | .tiny : { |
---|
| 82 | *(.tiny) |
---|
| 83 | } > tiny |
---|
| 84 | .eight : { |
---|
| 85 | *(.eight) |
---|
| 86 | } > eight |
---|
| 87 | .stab 0 (NOLOAD) : { |
---|
| 88 | [ .stab ] |
---|
| 89 | } |
---|
| 90 | .stabstr 0 (NOLOAD) : { |
---|
| 91 | [ .stabstr ] |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | } |
---|