[ac7d5ef0] | 1 | /* This file is a derivation of that found with the newlib-1.6 distribution |
---|
| 2 | * for the idp.ld file. That file, it appears, was originally written by |
---|
| 3 | * Rob Savoye. Other ideas came from Joel Sherrill for the RTEMS linkcmds |
---|
| 4 | * file (this is basically a mixture of the two). |
---|
[eb5a7e07] | 5 | * |
---|
| 6 | * $Id$ |
---|
[ac7d5ef0] | 7 | */ |
---|
| 8 | |
---|
| 9 | /* |
---|
| 10 | * Setup the memory map of the MC68ec0x0 Board (IDP) |
---|
| 11 | * stack grows up towards high memory. This works for |
---|
| 12 | * both the rom68k and the mon68k monitors. |
---|
| 13 | */ |
---|
[db88957] | 14 | |
---|
[ac7d5ef0] | 15 | MEMORY |
---|
| 16 | { |
---|
| 17 | ram : org = 0x10000, l = 2M |
---|
| 18 | } |
---|
| 19 | |
---|
[b2b4835] | 20 | /* |
---|
| 21 | * Declare some sizes. |
---|
| 22 | */ |
---|
| 23 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
| 24 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
| 25 | |
---|
[ac7d5ef0] | 26 | SECTIONS |
---|
| 27 | { |
---|
[b2b4835] | 28 | ram : { |
---|
| 29 | . = .; |
---|
| 30 | } >ram |
---|
| 31 | |
---|
| 32 | /* |
---|
| 33 | * Text, data and bss segments |
---|
| 34 | */ |
---|
| 35 | .text : { |
---|
| 36 | *(.text) |
---|
| 37 | |
---|
| 38 | /* |
---|
| 39 | * C++ constructors/destructors |
---|
| 40 | */ |
---|
| 41 | *(.gnu.linkonce.t.*) |
---|
| 42 | |
---|
| 43 | /* |
---|
| 44 | * Initialization and finalization code. |
---|
| 45 | * |
---|
| 46 | * Various files can provide initialization and finalization |
---|
| 47 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
| 48 | * body of these functions are in .init and .fini sections. We |
---|
| 49 | * accumulate the bodies here, and prepend function prologues |
---|
| 50 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
| 51 | * be linked first; crtn.o must be linked last. Because these |
---|
| 52 | * are wildcards, it doesn't matter if the user does not |
---|
| 53 | * actually link against crti.o and crtn.o; the linker won't |
---|
| 54 | * look for a file to match a wildcard. The wildcard also |
---|
| 55 | * means that it doesn't matter which directory crti.o and |
---|
| 56 | * crtn.o are in. |
---|
| 57 | */ |
---|
| 58 | PROVIDE (_init = .); |
---|
| 59 | *crti.o(.init) |
---|
| 60 | *(.init) |
---|
| 61 | *crtn.o(.init) |
---|
| 62 | PROVIDE (_fini = .); |
---|
| 63 | *crti.o(.fini) |
---|
| 64 | *(.fini) |
---|
| 65 | *crtn.o(.fini) |
---|
| 66 | |
---|
| 67 | /* |
---|
| 68 | * C++ constructors/destructors |
---|
| 69 | * |
---|
| 70 | * gcc uses crtbegin.o to find the start of the constructors |
---|
| 71 | * and destructors so we make sure it is first. Because this |
---|
| 72 | * is a wildcard, it doesn't matter if the user does not |
---|
| 73 | * actually link against crtbegin.o; the linker won't look for |
---|
| 74 | * a file to match a wildcard. The wildcard also means that |
---|
| 75 | * it doesn't matter which directory crtbegin.o is in. The |
---|
| 76 | * constructor and destructor list are terminated in |
---|
| 77 | * crtend.o. The same comments apply to it. |
---|
| 78 | */ |
---|
| 79 | . = ALIGN (16); |
---|
| 80 | *crtbegin.o(.ctors) |
---|
| 81 | *(.ctors) |
---|
| 82 | *crtend.o(.ctors) |
---|
| 83 | *crtbegin.o(.dtors) |
---|
| 84 | *(.dtors) |
---|
| 85 | *crtend.o(.dtors) |
---|
| 86 | |
---|
| 87 | /* |
---|
| 88 | * Exception frame info |
---|
| 89 | */ |
---|
| 90 | . = ALIGN (16); |
---|
| 91 | *(.eh_frame) |
---|
| 92 | |
---|
| 93 | /* |
---|
| 94 | * Read-only data |
---|
| 95 | */ |
---|
| 96 | . = ALIGN (16); |
---|
| 97 | _rodata_start = . ; |
---|
| 98 | *(.rodata) |
---|
| 99 | *(.gnu.linkonce.r*) |
---|
| 100 | |
---|
| 101 | . = ALIGN (16); |
---|
| 102 | PROVIDE (_etext = .); |
---|
| 103 | } >ram |
---|
| 104 | .data : { |
---|
| 105 | PROVIDE (_copy_start = .); |
---|
| 106 | *(.data) |
---|
| 107 | *(.gnu.linkonce.d*) |
---|
| 108 | *(.gcc_except_table) |
---|
| 109 | . = ALIGN (16); |
---|
| 110 | PROVIDE (_edata = .); |
---|
| 111 | PROVIDE (_copy_end = .); |
---|
| 112 | } >ram |
---|
| 113 | .bss : { |
---|
| 114 | PROVIDE (_bss_start = .); |
---|
| 115 | PROVIDE (_clear_start = .); |
---|
| 116 | *(.bss) |
---|
| 117 | *(COMMON) |
---|
| 118 | . = ALIGN (16); |
---|
| 119 | PROVIDE (end = .); |
---|
| 120 | |
---|
| 121 | . += StackSize; |
---|
| 122 | PROVIDE (_stack_init = .); |
---|
[f86ec42] | 123 | |
---|
[b2b4835] | 124 | . = ALIGN (16); |
---|
| 125 | PROVIDE (_HeapStart = .); |
---|
| 126 | . += HeapSize; |
---|
| 127 | PROVIDE (_HeapEnd = .); |
---|
[f86ec42] | 128 | |
---|
[b2b4835] | 129 | clear_end = .; |
---|
[01c36de] | 130 | |
---|
[b2b4835] | 131 | PROVIDE (_WorkspaceBase = .); |
---|
| 132 | } >ram |
---|
[ac7d5ef0] | 133 | } |
---|