[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 | * Copyright assigned to U.S. Government, 1994. |
---|
| 8 | * |
---|
| 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
| 11 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | * |
---|
| 15 | * Memory layout: |
---|
| 16 | * |
---|
| 17 | * 0x0008000 -> ... : initial section ( init 386ex, goto protected mode) |
---|
| 18 | * ... -> ... : text section ( executable code ) |
---|
| 19 | * ... -> 0x00A0000 : data section ( initialized storage ) |
---|
| 20 | * 0x0100000 -> 0x0200000 : bss section, stack space, heap storage |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | ENTRY(_init_i386ex) ; |
---|
| 24 | SECTIONS |
---|
| 25 | { |
---|
| 26 | |
---|
| 27 | /*************************************************************************** |
---|
| 28 | * initial section: |
---|
| 29 | * |
---|
| 30 | * This section is the first in memory, preceding the text and data sections. |
---|
| 31 | * It initializes the i386ex, sets up the gdt in RAM, loads the gdt, |
---|
| 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 | .initial _DOS_ld_addr : |
---|
| 39 | { |
---|
| 40 | *(.initial); |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | /*************************************************************************** |
---|
| 44 | * text section: |
---|
| 45 | * |
---|
| 46 | * Nobody here but us opcodes. |
---|
| 47 | ***************************************************************************/ |
---|
| 48 | |
---|
| 49 | .text BLOCK(0x10) : |
---|
| 50 | { |
---|
| 51 | CREATE_OBJECT_SYMBOLS |
---|
| 52 | text_start = . ; |
---|
| 53 | _text_start = . ; |
---|
| 54 | *(.text ) ; |
---|
| 55 | . = ALIGN (16); |
---|
| 56 | |
---|
| 57 | *(.eh_fram) |
---|
| 58 | . = ALIGN (16); |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * C++ constructors |
---|
| 62 | */ |
---|
| 63 | __CTOR_LIST__ = .; |
---|
| 64 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
| 65 | *(.ctors) |
---|
| 66 | LONG(0) |
---|
| 67 | __CTOR_END__ = .; |
---|
| 68 | . = ALIGN (4) ; |
---|
| 69 | __DTOR_LIST__ = .; |
---|
| 70 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
| 71 | *(.dtors) |
---|
| 72 | LONG(0) |
---|
| 73 | __DTOR_END__ = .; |
---|
| 74 | _rodata_start = . ; |
---|
| 75 | *(.rodata) |
---|
| 76 | *(.gnu.linkonce.r*) |
---|
| 77 | _erodata = ALIGN( 0x10 ) ; |
---|
| 78 | _etext = ALIGN( 0x10 ); |
---|
| 79 | _endtext = . ; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | /*************************************************************************** |
---|
| 83 | * data section: |
---|
| 84 | * |
---|
| 85 | * This section defines the location of the data section in RAM. |
---|
| 86 | ***************************************************************************/ |
---|
| 87 | |
---|
| 88 | .data BLOCK(0x10) : |
---|
| 89 | { |
---|
| 90 | _sdata = .; |
---|
| 91 | *(.data); |
---|
| 92 | _edata = .; |
---|
| 93 | } |
---|
| 94 | _data_size = _edata - _sdata ; |
---|
| 95 | |
---|
| 96 | /*************************************************************************** |
---|
| 97 | * bss section: |
---|
| 98 | * |
---|
| 99 | * The bss section is the first section in extended RAM ( > 1MB). |
---|
| 100 | ***************************************************************************/ |
---|
| 101 | |
---|
| 102 | .bss 0x100000 (NOLOAD) : |
---|
| 103 | { |
---|
| 104 | _bss_start = .; |
---|
| 105 | *(.bss); |
---|
| 106 | *(COMMON); |
---|
| 107 | _ebss = ALIGN(0x10); |
---|
| 108 | } |
---|
| 109 | _bss_size = _ebss - _bss_start ; |
---|
| 110 | |
---|
| 111 | /*************************************************************************** |
---|
| 112 | * General variables: |
---|
| 113 | * |
---|
| 114 | * The stack_size variable is customizable here. The heap is located directly |
---|
| 115 | * after the stack in RAM. A routine within bspstart.c uses these variables |
---|
| 116 | * to ensure that the heap used by RTEMS is as large as the RAM remaining |
---|
| 117 | * after all workspace configurations are complete. |
---|
| 118 | ***************************************************************************/ |
---|
| 119 | |
---|
| 120 | stack_size = 0x8000 ; |
---|
| 121 | stack_origin = _ebss + stack_size ; |
---|
| 122 | heap_bottom = stack_origin + 4 ; |
---|
| 123 | |
---|
| 124 | } |
---|