summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/ts_386ex/startup/linkcmds
blob: 093be0133026027ec47eab456d173c5e672e3227 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
 *  This file contains directives for the GNU linker which are specific
 *  to the Technologic Systems TS-1325 (i386ex) board.
 *
 *  Copyright (c) 1989-1998.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 * 
 * Memory layout:
 *
 * 0x0008000 ->    ...    : initial section ( init 386ex, goto protected mode) 
 *    ...    ->    ...    : text section ( executable code )
 *    ...    -> 0x00A0000 : data section ( initialized storage )
 * 0x0100000 -> 0x0200000 : bss section, stack space, heap storage
 */

RamBase = DEFINED(RamBase) ? RamBase : 0x00100000;
RamSize = DEFINED(RamSize) ? RamSize : 512K;
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;

ENTRY(_init_i386ex);

SECTIONS
{

/***************************************************************************
 * initial section:
 *
 * This subsection of ".text" is the first in memory, and executed by the DOS
 * loader. It initializes the i386ex, sets up the gdt in RAM, loads the gdt,
 * jumps to protected mode, loads the idt, zeros the bss section, sets up
 * the stack and calls the rest of the RTEMS initialization.
 ***************************************************************************/

	_DOS_ld_addr	=	0x0008000 ;

/***************************************************************************
 * text section:
 *
 * Nobody here but us opcodes.
 ***************************************************************************/

        .text _DOS_ld_addr :
        {
	CREATE_OBJECT_SYMBOLS
	text_start = . ;
        _text_start = . ;

	*(.initial);
	. = ALIGN(0x20);

        *(.text );
	. = ALIGN (0x20);

	/*
	 * Special FreeBSD sysctl sections.
	 */
	. = ALIGN (16);
	__start_set_sysctl_set = .;
	*(set_sysctl_*);
	__stop_set_sysctl_set = ABSOLUTE(.);
	*(set_domain_*);
	*(set_pseudo_*);

	*(.eh_frame)
	. = ALIGN (0x20);

	*(.gnu.linkonce.t*)
	. = ALIGN(0x20);

	/*
	 * C++ constructors
	 */

	__CTOR_LIST__ = .;
	LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
	*(.ctors)
	LONG(0)
	__CTOR_END__ = .;
	. = ALIGN (4) ;
	__DTOR_LIST__ = .;
	LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
	*(.dtors)
	LONG(0)
	__DTOR_END__ = .;

	_rodata_start = . ;
	*(.rodata*)
	. = ALIGN(0x20);
	_erodata = .;

	*(.gnu.linkonce.r*)
        . = ALIGN(0x20);
	_endtext = . ; 
        }

/***************************************************************************
 * ctor/dtor sections:
 *
 * These sections house the  global constructors and destructors.  
 ***************************************************************************/

	.init BLOCK(0x20) :
	{
	*(.init)
	} = 0x9090

	.fini BLOCK(0x20) :
	{
	*(.fini)
	} = 0x9090

/***************************************************************************
 * data section:
 *
 * This section defines the location of the data section in RAM.  
 ***************************************************************************/

        .data  BLOCK(0x20) : 
        {
        _sdata = .;
        *(.data);
	. = ALIGN(0x20);
	*(.gnu.linkonce.d*)
	. = ALIGN(0x20);
	*(.gcc_except_table*)
	. = ALIGN(0x20);
        _edata = .;
   	}
        _data_size        = _edata - _sdata ;

/***************************************************************************
 * bss section:
 *
 * The bss section is the first section in extended RAM ( > 1MB).  
 ***************************************************************************/

	.bss 0x100000 (NOLOAD) :
	{
	_bss_start = .;
	*(.bss);
	*(COMMON);
	_ebss = ALIGN(0x20);
	}
        _bss_size   = _ebss - _bss_start ;

/***************************************************************************
 * discard section:
 *
 * This section is used to throw away stuff we don't want.  
 ***************************************************************************/

	/DISCARD/ :
	{
	*(.comment);
	*(.note);
	}

/***************************************************************************
 * General variables:
 *
 * The stack_size variable is customizable here.  The heap is located directly
 * after the stack in RAM.  A routine within bspstart.c uses these variables
 * to ensure that the heap used by RTEMS is as large as the RAM remaining
 * after all workspace configurations are complete.
 ***************************************************************************/

        stack_size  = 0x8000 ;
	stack_origin = _ebss + stack_size ;
	heap_bottom  = stack_origin + 4 ;  
        . = ALIGN(0x10);
        WorkAreaBase = .;



  /* Stabs debugging sections.  */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }

  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* These must appear regardless of  .  */
}