[16a384cf] | 1 | /* |
---|
| 2 | * This file contains directives for the GNU linker which are specific |
---|
| 3 | * to the Technologic Systems TS-1325 (i386ex) board. |
---|
| 4 | * |
---|
| 5 | * Copyright (c) 1989-1998. |
---|
| 6 | * On-Line Applications Research Corporation (OAR). |
---|
| 7 | * |
---|
| 8 | * The license and distribution terms for this file may be |
---|
| 9 | * found in the file LICENSE in this distribution or at |
---|
[e61df10] | 10 | * http://www.rtems.com/license/LICENSE. |
---|
[16a384cf] | 11 | * |
---|
| 12 | * $Id$ |
---|
| 13 | * |
---|
| 14 | * Memory layout: |
---|
| 15 | * |
---|
| 16 | * 0x0008000 -> ... : initial section ( init 386ex, goto protected mode) |
---|
| 17 | * ... -> ... : text section ( executable code ) |
---|
| 18 | * ... -> 0x00A0000 : data section ( initialized storage ) |
---|
| 19 | * 0x0100000 -> 0x0200000 : bss section, stack space, heap storage |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | ENTRY(_init_i386ex) ; |
---|
[1d4048b2] | 23 | |
---|
[16a384cf] | 24 | SECTIONS |
---|
| 25 | { |
---|
| 26 | |
---|
| 27 | /*************************************************************************** |
---|
| 28 | * initial section: |
---|
| 29 | * |
---|
[1d4048b2] | 30 | * This subsection of ".text" is the first in memory, and executed by the DOS |
---|
| 31 | * loader. It initializes the i386ex, sets up the gdt in RAM, loads the gdt, |
---|
[16a384cf] | 32 | * jumps to protected mode, loads the idt, zeros the bss section, sets up |
---|
| 33 | * the stack and calls the rest of the RTEMS initialization. |
---|
| 34 | ***************************************************************************/ |
---|
| 35 | |
---|
| 36 | _DOS_ld_addr = 0x0008000 ; |
---|
| 37 | |
---|
| 38 | /*************************************************************************** |
---|
| 39 | * text section: |
---|
| 40 | * |
---|
| 41 | * Nobody here but us opcodes. |
---|
| 42 | ***************************************************************************/ |
---|
| 43 | |
---|
[1d4048b2] | 44 | .text _DOS_ld_addr : |
---|
[16a384cf] | 45 | { |
---|
[1d4048b2] | 46 | CREATE_OBJECT_SYMBOLS |
---|
[16a384cf] | 47 | text_start = . ; |
---|
| 48 | _text_start = . ; |
---|
| 49 | |
---|
[1d4048b2] | 50 | *(.initial); |
---|
| 51 | . = ALIGN(0x20); |
---|
| 52 | |
---|
| 53 | *(.text ); |
---|
| 54 | . = ALIGN (0x20); |
---|
| 55 | |
---|
[7b0c547a] | 56 | /* |
---|
| 57 | * Special FreeBSD sysctl sections. |
---|
| 58 | */ |
---|
| 59 | . = ALIGN (16); |
---|
| 60 | __start_set_sysctl_set = .; |
---|
| 61 | *(set_sysctl_*); |
---|
| 62 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 63 | *(set_domain_*); |
---|
| 64 | *(set_pseudo_*); |
---|
| 65 | |
---|
[1d4048b2] | 66 | *(.eh_frame) |
---|
| 67 | . = ALIGN (0x20); |
---|
| 68 | |
---|
| 69 | *(.gnu.linkonce.t*) |
---|
| 70 | . = ALIGN(0x20); |
---|
[16a384cf] | 71 | |
---|
| 72 | /* |
---|
| 73 | * C++ constructors |
---|
| 74 | */ |
---|
[1d4048b2] | 75 | |
---|
[16a384cf] | 76 | __CTOR_LIST__ = .; |
---|
| 77 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
| 78 | *(.ctors) |
---|
| 79 | LONG(0) |
---|
| 80 | __CTOR_END__ = .; |
---|
| 81 | . = ALIGN (4) ; |
---|
| 82 | __DTOR_LIST__ = .; |
---|
| 83 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
| 84 | *(.dtors) |
---|
| 85 | LONG(0) |
---|
| 86 | __DTOR_END__ = .; |
---|
[1d4048b2] | 87 | |
---|
[16a384cf] | 88 | _rodata_start = . ; |
---|
[cb3a7ed] | 89 | *(.rodata*) |
---|
[1d4048b2] | 90 | . = ALIGN(0x20); |
---|
| 91 | _erodata = .; |
---|
| 92 | |
---|
[16a384cf] | 93 | *(.gnu.linkonce.r*) |
---|
[1d4048b2] | 94 | . = ALIGN(0x20); |
---|
[16a384cf] | 95 | _endtext = . ; |
---|
| 96 | } |
---|
| 97 | |
---|
[1d4048b2] | 98 | /*************************************************************************** |
---|
| 99 | * ctor/dtor sections: |
---|
| 100 | * |
---|
| 101 | * These sections house the global constructors and destructors. |
---|
| 102 | ***************************************************************************/ |
---|
| 103 | |
---|
| 104 | .init BLOCK(0x20) : |
---|
| 105 | { |
---|
| 106 | *(.init) |
---|
| 107 | } = 0x9090 |
---|
| 108 | |
---|
| 109 | .fini BLOCK(0x20) : |
---|
| 110 | { |
---|
| 111 | *(.fini) |
---|
| 112 | } = 0x9090 |
---|
| 113 | |
---|
[16a384cf] | 114 | /*************************************************************************** |
---|
| 115 | * data section: |
---|
| 116 | * |
---|
| 117 | * This section defines the location of the data section in RAM. |
---|
| 118 | ***************************************************************************/ |
---|
| 119 | |
---|
[1d4048b2] | 120 | .data BLOCK(0x20) : |
---|
[16a384cf] | 121 | { |
---|
| 122 | _sdata = .; |
---|
| 123 | *(.data); |
---|
[1d4048b2] | 124 | . = ALIGN(0x20); |
---|
| 125 | *(.gnu.linkonce.d*) |
---|
| 126 | . = ALIGN(0x20); |
---|
| 127 | *(.gcc_except_table) |
---|
| 128 | . = ALIGN(0x20); |
---|
[16a384cf] | 129 | _edata = .; |
---|
| 130 | } |
---|
| 131 | _data_size = _edata - _sdata ; |
---|
| 132 | |
---|
| 133 | /*************************************************************************** |
---|
| 134 | * bss section: |
---|
| 135 | * |
---|
| 136 | * The bss section is the first section in extended RAM ( > 1MB). |
---|
| 137 | ***************************************************************************/ |
---|
| 138 | |
---|
| 139 | .bss 0x100000 (NOLOAD) : |
---|
| 140 | { |
---|
| 141 | _bss_start = .; |
---|
| 142 | *(.bss); |
---|
| 143 | *(COMMON); |
---|
[1d4048b2] | 144 | _ebss = ALIGN(0x20); |
---|
[16a384cf] | 145 | } |
---|
| 146 | _bss_size = _ebss - _bss_start ; |
---|
| 147 | |
---|
[1d4048b2] | 148 | /*************************************************************************** |
---|
| 149 | * discard section: |
---|
| 150 | * |
---|
| 151 | * This section is used to throw away stuff we don't want. |
---|
| 152 | ***************************************************************************/ |
---|
| 153 | |
---|
| 154 | /DISCARD/ : |
---|
| 155 | { |
---|
| 156 | *(.comment); |
---|
| 157 | *(.note); |
---|
| 158 | } |
---|
| 159 | |
---|
[16a384cf] | 160 | /*************************************************************************** |
---|
| 161 | * General variables: |
---|
| 162 | * |
---|
| 163 | * The stack_size variable is customizable here. The heap is located directly |
---|
| 164 | * after the stack in RAM. A routine within bspstart.c uses these variables |
---|
| 165 | * to ensure that the heap used by RTEMS is as large as the RAM remaining |
---|
| 166 | * after all workspace configurations are complete. |
---|
| 167 | ***************************************************************************/ |
---|
| 168 | |
---|
| 169 | stack_size = 0x8000 ; |
---|
| 170 | stack_origin = _ebss + stack_size ; |
---|
| 171 | heap_bottom = stack_origin + 4 ; |
---|
| 172 | |
---|
[4cb5d29] | 173 | |
---|
| 174 | |
---|
| 175 | /* Stabs debugging sections. */ |
---|
| 176 | .stab 0 : { *(.stab) } |
---|
| 177 | .stabstr 0 : { *(.stabstr) } |
---|
| 178 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 179 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 180 | .stab.index 0 : { *(.stab.index) } |
---|
| 181 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 182 | .comment 0 : { *(.comment) } |
---|
| 183 | |
---|
| 184 | /* DWARF debug sections. |
---|
| 185 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 186 | of the section so we begin them at 0. */ |
---|
| 187 | /* DWARF 1 */ |
---|
| 188 | .debug 0 : { *(.debug) } |
---|
| 189 | .line 0 : { *(.line) } |
---|
| 190 | |
---|
| 191 | /* GNU DWARF 1 extensions */ |
---|
| 192 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 193 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 194 | |
---|
| 195 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 196 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 197 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 198 | |
---|
| 199 | /* DWARF 2 */ |
---|
| 200 | .debug_info 0 : { *(.debug_info) } |
---|
| 201 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 202 | .debug_line 0 : { *(.debug_line) } |
---|
| 203 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 204 | .debug_str 0 : { *(.debug_str) } |
---|
| 205 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 206 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 207 | |
---|
| 208 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 209 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 210 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 211 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 212 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 213 | /* These must appear regardless of . */ |
---|
[16a384cf] | 214 | } |
---|