source: rtems/c/src/lib/libbsp/i386/i386ex/startup/linkcmds @ 5c7f274

4.104.114.84.95
Last change on this file since 5c7f274 was 1fdfc28, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 28, 2004 at 3:21:08 PM

2004-07-28 Joel Sherrill <joel@…>

  • startup/linkcmds: Add gnu.linkonce.d and gcc_except_table sections.
  • Property mode set to 100644
File size: 6.1 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.rtems.com/license/LICENSE.
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        *(.gnu.linkonce.d*)
52        *(.gcc_except_table)
53        _edata = .;
54        }
55        _data_start       = ADDR(.data) ;
56         data_start       = _data_start ;
57        _data_size        = _edata - _sdata ;
58
59/**************************************************************************************
60 * bss section:
61 *
62 * The bss section is the last section in RAM. 
63 *************************************************************************************/
64        _edata = ALIGN( 0x10 ); 
65        .bss :
66        {
67        _bss_start = .;
68        *(.bss);
69        *(COMMON);
70        _ebss = ALIGN(0x10);
71        end = _ebss;
72        _end = end;
73        __end = end;
74        }
75        _bss_size   = _ebss - _bss_start ;
76
77/**************************************************************************************
78 * General variables:
79 *
80 * The stack_size variable is customizable here.  The heap is located directly after
81 * The stack in RAM.  A routine within bspstart.c uses these variables to ensure that
82 * the heap used by RTEMS is as large as the RAM remaining after all workspace configurations
83 * are complete.
84 *************************************************************************************/
85        stack_size  = 0x8000 ;
86        stack_origin = end + stack_size ;
87        heap_bottom  = stack_origin + 4 ; 
88
89/***************************************************************************************
90 * text section:
91 *
92 * This section is NOT copied into RAM.  It is left in ROM, as the flash ROM is quick enough.
93 ***************************************************************************************/
94        .text ( 0x3f80000 ):
95        {
96         CREATE_OBJECT_SYMBOLS
97        text_start = . ;
98        _text_start = . ;
99        *(.text ) ;
100        /*
101         * Special FreeBSD sysctl sections.
102         */
103        . = ALIGN (16);
104        __start_set_sysctl_set = .;
105        *(set_sysctl_*);
106        __stop_set_sysctl_set = ABSOLUTE(.);
107        *(set_domain_*);
108        *(set_pseudo_*);
109
110        *(.eh_fram)
111
112        . = ALIGN (16);
113
114        /*
115         * C++ constructors
116         */
117        __CTOR_LIST__ = .;
118        LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
119        *(.ctors)
120        LONG(0)
121        __CTOR_END__ = .;
122        . = ALIGN (4) ;
123        __DTOR_LIST__ = .;
124        LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
125        *(.dtors)
126        LONG(0)
127        __DTOR_END__ = .;
128        _rodata_start = . ;
129        *(.rodata*)
130        *(.eh_frame)
131        *(.gnu.linkonce.r*)
132        _erodata = ALIGN( 0x10 ) ;
133        _etext = ALIGN( 0x10 );
134        _endtext = . ;
135        }
136
137/*******************************************************************************************
138 * initial section:
139 *
140 * This section is defined after the data section.  It must be in the top 64K of memory
141 * to enable the initial short jmp from the reset section while still in real-mode. It
142 * initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
143 * jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
144 ******************************************************************************************/
145
146        .initial _rom_data_start + _data_size :
147        {
148        *(.initial);
149        }
150
151/*******************************************************************************************
152 * board reset section:
153 *
154 * This section contains the short jmp from the reset section to the initial section.  It is
155 * the first code executed on reset/power on.
156 ******************************************************************************************/
157
158        .reset 0x3fffff0:
159        {
160        *(.reset);
161        }
162
163
164  /* Stabs debugging sections.  */
165  .stab 0 : { *(.stab) }
166  .stabstr 0 : { *(.stabstr) }
167  .stab.excl 0 : { *(.stab.excl) }
168  .stab.exclstr 0 : { *(.stab.exclstr) }
169  .stab.index 0 : { *(.stab.index) }
170  .stab.indexstr 0 : { *(.stab.indexstr) }
171  .comment 0 : { *(.comment) }
172
173  /* DWARF debug sections.
174     Symbols in the DWARF debugging sections are relative to the beginning
175     of the section so we begin them at 0.  */
176  /* DWARF 1 */
177  .debug          0 : { *(.debug) }
178  .line           0 : { *(.line) }
179 
180  /* GNU DWARF 1 extensions */
181  .debug_srcinfo  0 : { *(.debug_srcinfo) }
182  .debug_sfnames  0 : { *(.debug_sfnames) }
183 
184  /* DWARF 1.1 and DWARF 2 */
185  .debug_aranges  0 : { *(.debug_aranges) }
186  .debug_pubnames 0 : { *(.debug_pubnames) }
187 
188  /* DWARF 2 */
189  .debug_info     0 : { *(.debug_info) }
190  .debug_abbrev   0 : { *(.debug_abbrev) }
191  .debug_line     0 : { *(.debug_line) }
192  .debug_frame    0 : { *(.debug_frame) }
193  .debug_str      0 : { *(.debug_str) }
194  .debug_loc      0 : { *(.debug_loc) }
195  .debug_macinfo  0 : { *(.debug_macinfo) }
196 
197  /* SGI/MIPS DWARF 2 extensions */
198  .debug_weaknames 0 : { *(.debug_weaknames) }
199  .debug_funcnames 0 : { *(.debug_funcnames) }
200  .debug_typenames 0 : { *(.debug_typenames) }
201  .debug_varnames  0 : { *(.debug_varnames) }
202  /* These must appear regardless of  .  */
203}
Note: See TracBrowser for help on using the repository browser.