source: rtems/c/src/lib/libbsp/i386/i386ex/startup/linkcmds @ 4cb5d29

4.104.114.84.95
Last change on this file since 4cb5d29 was 4cb5d29, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/00 at 13:33:23

2000-09-29 Charles-Antoine Gauthier <charles.gauthier@…>

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