source: rtems/c/src/lib/libbsp/i386/i386ex/startup/linkcmds @ 85c92574

4.104.114.84.95
Last change on this file since 85c92574 was 85c92574, checked in by Joel Sherrill <joel.sherrill@…>, on 05/09/02 at 21:37:30

2001-05-09 Joel Sherrill <joel@…>

  • startup/linkcmds: In support of gcc 3.1, added one of more of the sections .jcr, .rodata*, .data.*, .gnu.linkonce.s2.*, .gnu.linkonce.sb2.*, and .gnu.linkonce.s.*. Spacing corrections and direction of segments to memory regions may also have been addressed. This was a sweep across all BSPs.
  • Property mode set to 100644
File size: 5.9 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Intel 386ex evaluation board.
4 *
5 *  COPYRIGHT (c) 1989-1999.
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
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 *
14 * Memory layout:
15 *
16 * 0x3f80000 -> 0x3ff0000 : text section
17 * 0x3ff0000 -> 0x3ff0028 : global descriptor table in ROM
18 * 0x3ff0028 -> 0x3fff000 : data section ( copied by start.s to RAM )
19 * 0x3fff000 -> 0x3fffff0 : initial section ( init 386ex, goto protected mode, copy ROM-RAM )
20 * 0x3fffff0 -> 0x4000000 : reset section ( jmp to initial only )
21 */
22
23        ENTRY(reset) ;
24SECTIONS
25{
26
27/****************************************************************************************
28 * data section:
29 *
30 * This section defines the locations of the data section in ROM as well as in RAM. 
31 * start.s copies the data section to RAM in real mode.  This is done PRIOR to the lgdt
32 * instruction since the data section contains the Global_descriptor_table and GDTR.
33 ***********************************************************************************/
34
35        _rom_data_start = 0x3ff0000;
36
37        _rom_data_segment   = 0xF000;
38        _rom_data_offset    = 0x0;
39
40        _ram_data_segment   = 0x0000 ;
41        _ram_data_offset    = 0x0;
42        _ram_data_location  = _ram_data_segment * 16 + _ram_data_offset;
43
44        .init : { _init = .; *(.init) } = 0x9090
45        .fini : { _fini = .; *(.fini) } = 0x9090
46        .data  :
47        AT ( _rom_data_start )
48        {
49        _sdata = .;
50        *(.data);
51        _edata = .;
52        }
53        _data_start       = ADDR(.data) ;
54         data_start       = _data_start ;
55        _data_size        = _edata - _sdata ;
56
57/**************************************************************************************
58 * bss section:
59 *
60 * The bss section is the last section in RAM. 
61 *************************************************************************************/
62        _edata = ALIGN( 0x10 ); 
63        .bss :
64        {
65        _bss_start = .;
66        *(.bss);
67        *(COMMON);
68        _ebss = ALIGN(0x10);
69        end = _ebss;
70        _end = end;
71        __end = end;
72        }
73        _bss_size   = _ebss - _bss_start ;
74
75/**************************************************************************************
76 * General variables:
77 *
78 * The stack_size variable is customizable here.  The heap is located directly after
79 * The stack in RAM.  A routine within bspstart.c uses these variables to ensure that
80 * the heap used by RTEMS is as large as the RAM remaining after all workspace configurations
81 * are complete.
82 *************************************************************************************/
83        stack_size  = 0x8000 ;
84        stack_origin = end + stack_size ;
85        heap_bottom  = stack_origin + 4 ; 
86
87/***************************************************************************************
88 * text section:
89 *
90 * This section is NOT copied into RAM.  It is left in ROM, as the flash ROM is quick enough.
91 ***************************************************************************************/
92        .text ( 0x3f80000 ):
93        {
94         CREATE_OBJECT_SYMBOLS
95        text_start = . ;
96        _text_start = . ;
97        *(.text ) ;
98        . = ALIGN (16);
99
100        *(.eh_fram)
101        . = ALIGN (16);
102
103        /*
104         * C++ constructors
105         */
106        __CTOR_LIST__ = .;
107        LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
108        *(.ctors)
109        LONG(0)
110        __CTOR_END__ = .;
111        . = ALIGN (4) ;
112        __DTOR_LIST__ = .;
113        LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
114        *(.dtors)
115        LONG(0)
116        __DTOR_END__ = .;
117        _rodata_start = . ;
118        *(.rodata*)
119        *(.gnu.linkonce.r*)
120        _erodata = ALIGN( 0x10 ) ;
121        _etext = ALIGN( 0x10 );
122        _endtext = . ;
123        }
124
125/*******************************************************************************************
126 * initial section:
127 *
128 * This section is defined after the data section.  It must be in the top 64K of memory
129 * to enable the initial short jmp from the reset section while still in real-mode. It
130 * initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
131 * jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
132 ******************************************************************************************/
133
134        .initial _rom_data_start + _data_size :
135        {
136        *(.initial);
137        }
138
139/*******************************************************************************************
140 * board reset section:
141 *
142 * This section contains the short jmp from the reset section to the initial section.  It is
143 * the first code executed on reset/power on.
144 ******************************************************************************************/
145
146        .reset 0x3fffff0:
147        {
148        *(.reset);
149        }
150
151
152  /* Stabs debugging sections.  */
153  .stab 0 : { *(.stab) }
154  .stabstr 0 : { *(.stabstr) }
155  .stab.excl 0 : { *(.stab.excl) }
156  .stab.exclstr 0 : { *(.stab.exclstr) }
157  .stab.index 0 : { *(.stab.index) }
158  .stab.indexstr 0 : { *(.stab.indexstr) }
159  .comment 0 : { *(.comment) }
160
161  /* DWARF debug sections.
162     Symbols in the DWARF debugging sections are relative to the beginning
163     of the section so we begin them at 0.  */
164  /* DWARF 1 */
165  .debug          0 : { *(.debug) }
166  .line           0 : { *(.line) }
167 
168  /* GNU DWARF 1 extensions */
169  .debug_srcinfo  0 : { *(.debug_srcinfo) }
170  .debug_sfnames  0 : { *(.debug_sfnames) }
171 
172  /* DWARF 1.1 and DWARF 2 */
173  .debug_aranges  0 : { *(.debug_aranges) }
174  .debug_pubnames 0 : { *(.debug_pubnames) }
175 
176  /* DWARF 2 */
177  .debug_info     0 : { *(.debug_info) }
178  .debug_abbrev   0 : { *(.debug_abbrev) }
179  .debug_line     0 : { *(.debug_line) }
180  .debug_frame    0 : { *(.debug_frame) }
181  .debug_str      0 : { *(.debug_str) }
182  .debug_loc      0 : { *(.debug_loc) }
183  .debug_macinfo  0 : { *(.debug_macinfo) }
184 
185  /* SGI/MIPS DWARF 2 extensions */
186  .debug_weaknames 0 : { *(.debug_weaknames) }
187  .debug_funcnames 0 : { *(.debug_funcnames) }
188  .debug_typenames 0 : { *(.debug_typenames) }
189  .debug_varnames  0 : { *(.debug_varnames) }
190  /* These must appear regardless of  .  */
191}
Note: See TracBrowser for help on using the repository browser.