[9526d217] | 1 | /* |
---|
| 2 | * This file contains directives for the GNU linker which are specific |
---|
| 3 | * to the Generic MC68302 board. |
---|
| 4 | * |
---|
[08311cc3] | 5 | * COPYRIGHT (c) 1989-1999. |
---|
[9526d217] | 6 | * On-Line Applications Research Corporation (OAR). |
---|
| 7 | * |
---|
[98e4ebf5] | 8 | * The license and distribution terms for this file may be |
---|
| 9 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 10 | * http://www.OARcorp.com/rtems/license.html. |
---|
[9526d217] | 11 | * |
---|
| 12 | * $Id$ |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | MEMORY |
---|
[b2b4835] | 16 | { |
---|
[9526d217] | 17 | ram : org = 0x0000, l = 16M |
---|
[b2b4835] | 18 | } |
---|
[9526d217] | 19 | |
---|
| 20 | m302 = 0xf7f000; |
---|
[11290355] | 21 | _VBR = 0x000000; /* location of the VBR table (in RAM) */ |
---|
[9526d217] | 22 | |
---|
[b2b4835] | 23 | /* |
---|
| 24 | * Declare some sizes. |
---|
| 25 | */ |
---|
| 26 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
| 27 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
| 28 | |
---|
[9526d217] | 29 | SECTIONS |
---|
| 30 | { |
---|
[b2b4835] | 31 | ram : { |
---|
| 32 | . = 0xc00000; |
---|
| 33 | } >ram |
---|
| 34 | |
---|
| 35 | /* |
---|
| 36 | * Text, data and bss segments |
---|
| 37 | */ |
---|
| 38 | .text : { |
---|
| 39 | *(.text) |
---|
| 40 | |
---|
| 41 | /* |
---|
| 42 | * C++ constructors/destructors |
---|
| 43 | */ |
---|
| 44 | *(.gnu.linkonce.t.*) |
---|
| 45 | |
---|
| 46 | /* |
---|
| 47 | * Initialization and finalization code. |
---|
| 48 | * |
---|
| 49 | * Various files can provide initialization and finalization |
---|
| 50 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
| 51 | * body of these functions are in .init and .fini sections. We |
---|
| 52 | * accumulate the bodies here, and prepend function prologues |
---|
| 53 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
| 54 | * be linked first; crtn.o must be linked last. Because these |
---|
| 55 | * are wildcards, it doesn't matter if the user does not |
---|
| 56 | * actually link against crti.o and crtn.o; the linker won't |
---|
| 57 | * look for a file to match a wildcard. The wildcard also |
---|
| 58 | * means that it doesn't matter which directory crti.o and |
---|
| 59 | * crtn.o are in. |
---|
| 60 | */ |
---|
| 61 | PROVIDE (_init = .); |
---|
| 62 | *crti.o(.init) |
---|
| 63 | *(.init) |
---|
| 64 | *crtn.o(.init) |
---|
| 65 | PROVIDE (_fini = .); |
---|
| 66 | *crti.o(.fini) |
---|
| 67 | *(.fini) |
---|
| 68 | *crtn.o(.fini) |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * C++ constructors/destructors |
---|
| 72 | * |
---|
| 73 | * gcc uses crtbegin.o to find the start of the constructors |
---|
| 74 | * and destructors so we make sure it is first. Because this |
---|
| 75 | * is a wildcard, it doesn't matter if the user does not |
---|
| 76 | * actually link against crtbegin.o; the linker won't look for |
---|
| 77 | * a file to match a wildcard. The wildcard also means that |
---|
| 78 | * it doesn't matter which directory crtbegin.o is in. The |
---|
| 79 | * constructor and destructor list are terminated in |
---|
| 80 | * crtend.o. The same comments apply to it. |
---|
| 81 | */ |
---|
| 82 | . = ALIGN (16); |
---|
| 83 | *crtbegin.o(.ctors) |
---|
| 84 | *(.ctors) |
---|
| 85 | *crtend.o(.ctors) |
---|
| 86 | *crtbegin.o(.dtors) |
---|
| 87 | *(.dtors) |
---|
| 88 | *crtend.o(.dtors) |
---|
| 89 | |
---|
| 90 | /* |
---|
| 91 | * Exception frame info |
---|
| 92 | */ |
---|
| 93 | . = ALIGN (16); |
---|
| 94 | *(.eh_frame) |
---|
| 95 | |
---|
| 96 | /* |
---|
| 97 | * Read-only data |
---|
| 98 | */ |
---|
| 99 | . = ALIGN (16); |
---|
| 100 | _rodata_start = . ; |
---|
| 101 | *(.rodata) |
---|
| 102 | *(.gnu.linkonce.r*) |
---|
| 103 | |
---|
| 104 | . = ALIGN (16); |
---|
| 105 | PROVIDE (_etext = .); |
---|
| 106 | } >ram |
---|
| 107 | .data : { |
---|
| 108 | PROVIDE (_copy_start = .); |
---|
| 109 | *(.data) |
---|
| 110 | *(.gnu.linkonce.d*) |
---|
| 111 | *(.gcc_except_table) |
---|
| 112 | . = ALIGN (16); |
---|
| 113 | PROVIDE (_edata = .); |
---|
| 114 | PROVIDE (_copy_end = .); |
---|
| 115 | } >ram |
---|
| 116 | .bss : { |
---|
| 117 | PROVIDE (_bss_start = .); |
---|
| 118 | PROVIDE (_clear_start = .); |
---|
| 119 | *(.bss) |
---|
| 120 | *(COMMON) |
---|
| 121 | . = ALIGN (16); |
---|
| 122 | PROVIDE (end = .); |
---|
[f86ec42] | 123 | |
---|
[b2b4835] | 124 | . += StackSize; |
---|
| 125 | PROVIDE (_stack_init = .); |
---|
[f86ec42] | 126 | |
---|
[b2b4835] | 127 | . = ALIGN (16); |
---|
| 128 | PROVIDE (_HeapStart = .); |
---|
| 129 | . += HeapSize; |
---|
| 130 | PROVIDE (_HeapEnd = .); |
---|
[01c36de] | 131 | |
---|
[b2b4835] | 132 | clear_end = .; |
---|
[01c36de] | 133 | |
---|
[b2b4835] | 134 | PROVIDE (_WorkspaceBase = .); |
---|
| 135 | } >ram |
---|
[9526d217] | 136 | } |
---|