1 //==========================================================================
5 // Linker script for i386
7 //==========================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
13 // eCos is free software; you can redistribute it and/or modify it under
14 // the terms of the GNU General Public License as published by the Free
15 // Software Foundation; either version 2 or (at your option) any later version.
17 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // You should have received a copy of the GNU General Public License along
23 // with eCos; if not, write to the Free Software Foundation, Inc.,
24 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 // As a special exception, if other files instantiate templates or use macros
27 // or inline functions from this file, or you compile this file and link it
28 // with other works to produce a work based on this file, this file does not
29 // by itself cause the resulting work to be covered by the GNU General Public
30 // License. However the source code for this file must still be made available
31 // in accordance with section (3) of the GNU General Public License.
33 // This exception does not invalidate any other reasons why a work based on
34 // this file might be covered by the GNU General Public License.
36 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 // at http://sources.redhat.com/ecos/ecos-license/
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 //==========================================================================
41 //#####DESCRIPTIONBEGIN####
46 // Purpose: i386 Linker script
48 //####DESCRIPTIONEND####
50 //==========================================================================
57 GROUP(libtarget.a libgcc.a libsupc++.a)
59 GROUP(libtarget.a libgcc.a)
63 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
65 #define FORCE_OUTPUT . = .
68 #define SECTIONS_BEGIN
70 #define SECTION_vectors(_region_, _vma_, _lma_) \
71 .vectors _vma_ : _lma_ \
72 { FORCE_OUTPUT; KEEP(*(.vectors)) } \
75 #define SECTION_text(_region_, _vma_, _lma_) \
78 *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) } \
80 _etext = .; PROVIDE (etext = .);
82 #define SECTION_fini(_region_, _vma_, _lma_) \
84 { FORCE_OUTPUT; *(.fini) } \
87 #define SECTION_rodata1(_region_, _vma_, _lma_) \
88 .rodata1 _vma_ : _lma_ \
89 { FORCE_OUTPUT; *(.rodata1) } \
92 #define SECTION_rodata(_region_, _vma_, _lma_) \
93 .rodata _vma_ : _lma_ \
94 { FORCE_OUTPUT; *(.rodata*) } \
97 #define SECTION_fixup(_region_, _vma_, _lma_) \
98 .fixup _vma_ : _lma_ \
99 { _FIXUP_START_ = ABSOLUTE(.); *(.fixup) _FIXUP_END_ = ABSOLUTE(.);} \
102 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
103 .gcc_except_table _vma_ : _lma_ \
104 { _EXCEPT_START_ = ABSOLUTE(.); *(.gcc_except_table) \
105 _EXCEPT_END_ = ABSOLUTE(.);} \
108 // Note: The __ in the name is an encoding of the .
109 #define SECTION_rel__got(_region_, _vma_, _lma_) \
110 .rel.text _vma_ : _lma_ { *(.rel.text*) *(.rel.gnu.linkonce*) } > _region_ \
111 .rel.data _vma_ : _lma_ { *(.rel.data*) } > _region_ \
112 .rel.got _vma_ : _lma_ \
116 #define SECTION_data(_region_, _vma_, _lma_) \
117 .data _vma_ : _lma_ \
118 { __ram_data_start = ABSOLUTE(.); *(.data*) \
119 _GOT1_START_ = ABSOLUTE(.); *(.got1) _GOT1_END_ = ABSOLUTE(.); \
120 /* Put .ctors and .dtors next to the .got2 section, so that */ \
121 /* the pointers get relocated with -mrelocatable. */ \
122 . = ALIGN(8); __CTOR_LIST__ = ABSOLUTE(.); \
123 KEEP(*(SORT(.ctors*))) __CTOR_END__ = ABSOLUTE(.); \
124 __DTOR_LIST__ = ABSOLUTE(.); \
125 KEEP(*(SORT(.dtors*))) __DTOR_END__ = ABSOLUTE(.); \
127 KEEP(*( SORT (.ecos.table.*))); \
128 _GOT2_START_ = ABSOLUTE(.); *(.got2) _GOT2_END_ = ABSOLUTE(.); \
129 _GOT_START_ = ABSOLUTE(.); _GLOBAL_OFFSET_TABLE_ = ABSOLUTE(. + 32768); \
130 _SDA_BASE_ = ABSOLUTE(.); *(.got.plt) *(.got) \
131 _GOT_END_ = ABSOLUTE(.); *(.dynamic) *(.eh_frame) \
132 /* We want the small data sections together, so single-instruction */ \
133 /* offsets can access them all, and initialized data all before */ \
134 /* uninitialized, so we can shorten the on-disk segment size. */ \
135 _SDATA_START_ = ABSOLUTE(.); *(.sdata*) \
136 . = ALIGN (4); *(.2ram.*) } \
138 __rom_data_start = LOADADDR(.data); \
139 __ram_data_end = .; PROVIDE(__ram_data_end = .); \
140 _edata = .; PROVIDE (edata = .);
142 #define SECTION_sbss(_region_, _vma_, _lma_) \
143 .sbss _vma_ : _lma_ \
144 { __bss_start = ABSOLUTE (.); \
145 _SBSS_START_ = ABSOLUTE(.); *(.sbss*) _SBSS_END_ = ABSOLUTE(.); \
149 #define SECTION_bss(_region_, _vma_, _lma_) \
151 { FORCE_OUTPUT; *(.dynbss*) *(.bss*) *(COMMON) } \
155 #define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .);
157 #include <pkgconf/system.h>
158 #include CYGHWR_MEMORY_LAYOUT_LDI
160 // Standard tables at base of memory
162 idtStart = 0x00001000;
163 hal_vsr_table = 0x00001800;
164 hal_virtual_vector_table = 0x00001c00;
165 cyg_hal_smp_cpu_sync = 0x00002800;
166 cyg_hal_smp_cpu_sync_flag = 0x00002900;
167 cyg_hal_smp_cpu_entry = 0x00002a00;
168 cyg_hal_smp_cpu_running = 0x00002b00;
169 cyg_hal_smp_vsr_sync_flag = 0x00002c00;