1 /*==========================================================================
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 //==========================================================================
44 ENTRY(__exception_reset)
49 GROUP(libtarget.a libgcc.a libsupc++.a)
51 GROUP(libtarget.a libgcc.a)
55 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
57 #define FORCE_OUTPUT . = .
59 #ifndef CYG_LABEL_DEFN
60 # define CYG_LABEL_DEFN(_label) _label
63 #define SECTIONS_BEGIN
65 #define SECTION_text(_region_, _vma_, _lma_) \
68 *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) } \
70 _etext = .; PROVIDE (etext = .);
72 #define SECTION_fini(_region_, _vma_, _lma_) \
74 { FORCE_OUTPUT; *(.fini) } \
77 #define SECTION_rodata1(_region_, _vma_, _lma_) \
78 .rodata1 _vma_ : _lma_ \
79 { FORCE_OUTPUT; *(.rodata1) } \
82 #define SECTION_rodata(_region_, _vma_, _lma_) \
83 .rodata _vma_ : _lma_ \
84 { FORCE_OUTPUT; *(.rodata*) } \
87 #define SECTION_fixup(_region_, _vma_, _lma_) \
88 .fixup _vma_ : _lma_ \
89 { __FIXUP_START__ = ABSOLUTE(.); *(.fixup) __FIXUP_END__ = ABSOLUTE(.);}\
92 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
93 .gcc_except_table _vma_ : _lma_ \
94 { __EXCEPT_START__ = ABSOLUTE(.); *(.gcc_except_table) \
95 __EXCEPT_END__ = ABSOLUTE(.);} \
98 #define SECTION_data(_region_, _vma_, _lma_, _rom_data_addr_) \
101 __ram_data_start = ABSOLUTE(.); \
103 __GOT1_START__ = ABSOLUTE(.); *(.got1) __GOT1_END__ = ABSOLUTE(.); \
105 KEEP(*( SORT (.ecos.table.*))); \
107 __CTOR_LIST__ = ABSOLUTE(.); \
108 KEEP(*(SORT(.ctors*))); \
109 __CTOR_END__ = ABSOLUTE(.); \
110 __DTOR_LIST__ = ABSOLUTE(.); \
111 KEEP(*(SORT(.dtors*))) \
112 __DTOR_END__ = ABSOLUTE(.); \
114 __GOT2_START__ = ABSOLUTE(.); *(.got2) __GOT2_END__ = ABSOLUTE(.); \
115 __GOT_START = ABSOLUTE(.); _GLOBAL_OFFSET_TABLE_ = ABSOLUTE(. + 32768); \
116 _SDA_BASE_ = ABSOLUTE(.); *(.got.plt) *(.got) \
117 __GOT_END__ = ABSOLUTE(.); *(.dynamic) \
119 /* We want the small data sections together, so single-instruction */ \
120 /* offsets can access them all, and initialized data all before */ \
121 /* uninitialized, so we can shorten the on-disk segment size. */ \
122 __SDATA_START__ = ABSOLUTE(.); *(.sdata) \
123 __ram_data_end = ABSOLUTE(.); \
124 __ram_data_size = ABSOLUTE (.) - ABSOLUTE(__ram_data_start); \
127 __rom_data_start = ABSOLUTE(_rom_data_addr_); \
128 __rom_data_size = SIZEOF(.data); \
129 __rom_data_end = __rom_data_start + __rom_data_size;
131 #define SECTION_sbss(_region_, _vma_, _lma_) \
132 .sbss _vma_ : _lma_ \
133 { __sbss_start = ABSOLUTE (.); \
134 __SBSS_START__ = ABSOLUTE(.); *(.sbss) __SBSS_END__ = ABSOLUTE(.); \
136 __sbss_end = ABSOLUTE (.); \
137 __sbss_size = ABSOLUTE (.) - ABSOLUTE(__sbss_start); \
141 #define SECTION_bss(_region_, _vma_, _lma_) \
143 { __bss_start = ABSOLUTE (.); \
144 FORCE_OUTPUT; *(.dynbss) *(.bss) *(COMMON) \
145 __bss_end = ABSOLUTE (.); \
146 __bss_size = ABSOLUTE (.) - ABSOLUTE(__bss_start); \
150 #define SECTION_stab \
156 #define SECTION_stabstr \
157 .stabstr 0 (NOLOAD) : \
162 #define SECTION_comment \
163 .comment 0 (NOLOAD) : \
168 #define SECTION_heap1(_region_, _vma_, _lma_, _minsize_) \
169 .heap1 _vma_ : _lma_ \
170 { __heap1_start = ABSOLUTE (.); \
172 __heap1_end = ABSOLUTE (.); \
173 __heap1_size = ABSOLUTE (.) - ABSOLUTE(__heap1_start); \
177 #define SECTION_uninvar(_region_, _vma_, _lma_) \
178 .uninvar _vma_ : _lma_ \
179 { __uninvar_start = ABSOLUTE (.); \
180 FORCE_OUTPUT; *(.uninvar) \
181 __uninvar_end = ABSOLUTE (.); \
182 __uninvar_size = ABSOLUTE (.) - ABSOLUTE(__uninvar_start); \
186 #define GENERIC_SECTION(_name_, _region_, _vma_, _lma_, _minsize_) \
187 . ## _name_ _vma_ : _lma_ \
188 { __ ## _name_ ## _start = ABSOLUTE (.); \
189 FORCE_OUTPUT; *(. ## _name_ ## ) \
190 __ ## _name_ ## _datasize = (ABSOLUTE (.) - ABSOLUTE(__ ## _name_ ## _start)); \
191 . += (_minsize_) > (__ ## _name_ ## _datasize) ? (_minsize_) - (__ ## _name_ ## _datasize) : 0; \
192 __ ## _name_ ## _end = ABSOLUTE (.); \
193 __ ## _name_ ## _size = (ABSOLUTE (.) - ABSOLUTE(__ ## _name_ ## _start)); \
197 #define SECTIONS_END \
201 . = ALIGN(4); _end = .; PROVIDE (end = .);
203 #include <pkgconf/system.h>
204 #include CYGHWR_MEMORY_LAYOUT_LDI