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.
12 // Copyright (C) 2006 eCosCentric Ltd.
14 // eCos is free software; you can redistribute it and/or modify it under
15 // the terms of the GNU General Public License as published by the Free
16 // Software Foundation; either version 2 or (at your option) any later version.
18 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
19 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 // You should have received a copy of the GNU General Public License along
24 // with eCos; if not, write to the Free Software Foundation, Inc.,
25 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 // As a special exception, if other files instantiate templates or use macros
28 // or inline functions from this file, or you compile this file and link it
29 // with other works to produce a work based on this file, this file does not
30 // by itself cause the resulting work to be covered by the GNU General Public
31 // License. However the source code for this file must still be made available
32 // in accordance with section (3) of the GNU General Public License.
34 // This exception does not invalidate any other reasons why a work based on
35 // this file might be covered by the GNU General Public License.
36 // -------------------------------------------
37 //####ECOSGPLCOPYRIGHTEND####
38 //==========================================================================
39 //#####DESCRIPTIONBEGIN####
41 // Author(s): Enrico Piria
42 // Contributors: Wade Jensen
44 // Purpose: Coldfire-specific linker script definitions.
46 //####DESCRIPTIONEND####
47 //========================================================================
55 GROUP(libtarget.a libgcc.a libsupc++.a)
57 GROUP(libtarget.a libgcc.a)
61 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
63 #define FORCE_OUTPUT . = .
65 #define SECTIONS_BEGIN
67 #define SECTION_boot(_region_, _vma_, _lma_) \
76 #define SECTION_text(_region_, _vma_, _lma_) \
80 *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) \
84 _etext = .; PROVIDE (etext = .);
86 #define SECTION_fini(_region_, _vma_, _lma_) \
95 #define SECTION_rodata1(_region_, _vma_, _lma_) \
96 .rodata1 _vma_ : _lma_ \
104 #define SECTION_rodata(_region_, _vma_, _lma_) \
105 .rodata _vma_ : _lma_ \
113 #define SECTION_fixup(_region_, _vma_, _lma_) \
114 .fixup _vma_ : _lma_ \
116 __FIXUP_START__ = ABSOLUTE(.); \
119 __FIXUP_END__ = ABSOLUTE(.); \
123 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
124 .gcc_except_table _vma_ : _lma_ \
126 __EXCEPT_START__ = ABSOLUTE(.); \
127 *(.gcc_except_table) \
129 __EXCEPT_END__ = ABSOLUTE(.); \
133 #define SECTION_data(_region_, _vma_, _lma_) \
134 .data _vma_ : _lma_ \
136 __ram_data_start = ABSOLUTE(.); \
138 __GOT1_START__ = ABSOLUTE(.); \
140 __GOT1_END__ = ABSOLUTE(.); \
142 /* Put .ctors and .dtors next to the .got2 section, so that */ \
143 /* the pointers get relocated with -mrelocatable. */ \
144 __CTOR_LIST__ = ABSOLUTE(.); \
145 KEEP(*(SORT(.ctors*))); \
146 __CTOR_END__ = ABSOLUTE(.); \
147 __DTOR_LIST__ = ABSOLUTE(.); \
148 KEEP(*(SORT(.dtors*))) \
149 __DTOR_END__ = ABSOLUTE(.); \
151 KEEP(*( SORT (.ecos.table.*))); \
154 __GOT2_START__ = ABSOLUTE(.); \
156 __GOT2_END__ = ABSOLUTE(.); \
157 __GOT_START = ABSOLUTE(.); \
158 _GLOBAL_OFFSET_TABLE_ = ABSOLUTE(. + 32768); \
159 _SDA_BASE_ = ABSOLUTE(.); \
160 *(.got.plt) *(.got) \
161 __GOT_END__ = ABSOLUTE(.); \
164 /* We want the small data sections together, so single-instruction */ \
165 /* offsets can access them all, and initialized data all before */ \
166 /* uninitialized, so we can shorten the on-disk segment size. */ \
167 __SDATA_START__ = ABSOLUTE(.); \
168 *(.sdata) *(.sdata.*) \
169 __SDATA2_START__ = ABSOLUTE(.); \
172 __ram_data_end = ABSOLUTE(.); \
173 __ram_data_size = ABSOLUTE (.) - ABSOLUTE(__ram_data_start); \
176 __rom_data_start = LOADADDR(.data); \
177 __rom_data_size = SIZEOF(.data); \
178 __rom_data_end = __rom_data_start + __rom_data_size;
180 #define SECTION_bss(_region_, _vma_, _lma_) \
183 __bss_start = ABSOLUTE (.); \
185 *(.dynbss*) *(.bss*) *(COMMON) *(.sbss*) *(.scommon*) \
187 __bss_end = ABSOLUTE (.); \
188 __bss_size = ABSOLUTE (.) - ABSOLUTE(__bss_start); \
192 #define SECTION_stab \
198 #define SECTION_stabstr \
199 .stabstr 0 (NOLOAD) : \
204 #define SECTION_comment \
205 .comment 0 (NOLOAD) : \
210 #define SECTION_uninvar(_region_, _vma_, _lma_) \
211 .uninvar _vma_ : _lma_ \
213 __uninvar_start = ABSOLUTE (.); \
217 __uninvar_end = ABSOLUTE (.); \
218 __uninvar_size = ABSOLUTE (.) - ABSOLUTE(__uninvar_start); \
222 #define SECTION_romvec(_region_, _vma_, _lma_) \
223 .romvec _vma_ : _lma_ \
225 __romvec_start = ABSOLUTE (.); \
229 __romvec_end = ABSOLUTE (.); \
230 __romvec_size = ABSOLUTE (.) - ABSOLUTE(__romvec_start); \
234 #define SECTION_ramvec(_region_, _vma_, _lma_) \
235 .ramvec _vma_ : _lma_ \
237 __ramvec_start = ABSOLUTE (.); \
241 __ramvec_end = ABSOLUTE (.); \
242 __ramvec_size = ABSOLUTE (.) - ABSOLUTE(__ramvec_start); \
246 #define SECTION_virtual_vec_table(_region_, _vma_, _lma_) \
247 .virtual_vec_table _vma_ : _lma_ \
249 __virtual_vec_table_start = ABSOLUTE (.); \
251 __virtual_vec_table_end = ABSOLUTE (.); \
252 __virtual_vec_table_size = ABSOLUTE (.) - ABSOLUTE(__virtual_vec_table_start); \
256 #define SECTIONS_END \
260 . = ALIGN(0x4); _end = .; PROVIDE (end = .);
262 #include <pkgconf/system.h>
263 #include CYGHWR_MEMORY_LAYOUT_LDI
265 hal_virtual_vector_table = __virtual_vec_table_start;