]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/fr30/mb91301/v2_0/src/fr30_mb91301.ld
Initial revision
[karo-tx-redboot.git] / packages / hal / fr30 / mb91301 / v2_0 / src / fr30_mb91301.ld
1 //=============================================================================
2 //
3 // MLT linker script for Fujitsu FR30
4 //
5 //=============================================================================
6 //####ECOSGPLCOPYRIGHTBEGIN####
7 // -------------------------------------------
8 // This file is part of eCos, the Embedded Configurable Operating System.
9 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
10 //
11 // eCos is free software; you can redistribute it and/or modify it under
12 // the terms of the GNU General Public License as published by the Free
13 // Software Foundation; either version 2 or (at your option) any later version.
14 //
15 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
16 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 // for more details.
19 //
20 // You should have received a copy of the GNU General Public License along
21 // with eCos; if not, write to the Free Software Foundation, Inc.,
22 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 //
24 // As a special exception, if other files instantiate templates or use macros
25 // or inline functions from this file, or you compile this file and link it
26 // with other works to produce a work based on this file, this file does not
27 // by itself cause the resulting work to be covered by the GNU General Public
28 // License. However the source code for this file must still be made available
29 // in accordance with section (3) of the GNU General Public License.
30 //
31 // This exception does not invalidate any other reasons why a work based on
32 // this file might be covered by the GNU General Public License.
33 //
34 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
35 // at http://sources.redhat.com/ecos/ecos-license/
36 // -------------------------------------------
37 //####ECOSGPLCOPYRIGHTEND####
38 //=============================================================================
39
40 #include <pkgconf/system.h>
41
42 STARTUP(vectors.o)
43 ENTRY(_start)
44 #ifdef EXTRAS
45 INPUT(extras.o)
46 #endif
47 #if (__GNUC__ >= 3)
48 // GROUP(libtarget.a libgcc.a libsupc++.a)
49 GROUP(libtarget.a libgcc.a)
50 #else
51 GROUP(libtarget.a libgcc.a)
52 #endif
53
54 #define ALIGN_LMA 4
55 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
56 #define LMA_EQ_VMA
57 #define FORCE_OUTPUT . = .
58
59 #define SECTIONS_BEGIN                          \
60   /* Debug information */                       \
61   .debug_aranges  0 : { *(.debug_aranges) }     \
62   .debug_pubnames 0 : { *(.debug_pubnames) }    \
63   .debug_info     0 : { *(.debug_info) }        \
64   .debug_abbrev   0 : { *(.debug_abbrev) }      \
65   .debug_line     0 : { *(.debug_line) }        \
66   .debug_frame    0 : { *(.debug_frame) }       \
67   .debug_str      0 : { *(.debug_str) }         \
68   .debug_loc      0 : { *(.debug_loc) }         \
69   .debug_macinfo  0 : { *(.debug_macinfo) }
70
71 #define SECTION_fixed_vectors(_region_, _vma_, _lma_) \
72     .fixed_vectors _vma_ : _lma_ \
73     { FORCE_OUTPUT; KEEP (*(.fixed_vectors)) } \
74     > _region_
75
76 #define SECTION_rom_vectors(_region_, _vma_, _lma_) \
77     .rom_vectors _vma_ : _lma_ \
78     { FORCE_OUTPUT; KEEP (*(.rom_vectors)) } \
79     > _region_
80
81 #define SECTION_rom_startup(_region_, _vma_, _lma_) \
82     .rom_startup_trampoline _vma_ : _lma_ \
83     { FORCE_OUTPUT; KEEP(*(.rom_startup_trampoline*)) } \
84     > _region_
85
86 #define SECTION_ram_startup(_region_, _vma_, _lma_) \
87     .ram_startup_trampoline _vma_ : _lma_ \
88     { __ram_trampoline_start = ABSOLUTE (.); FORCE_OUTPUT; KEEP(*(.ram_startup_trampoline*)) } \
89     > _region_ \
90     __rom_trampoline_start = LOADADDR (.ram_startup_trampoline); \
91     __rom_trampoline_end = LOADADDR (.ram_startup_trampoline) + SIZEOF(.ram_startup_trampoline);
92
93 #define SECTION_text(_region_, _vma_, _lma_) \
94     .text _vma_ : _lma_ \
95     { _stext = ABSOLUTE(.); \
96     PROVIDE (__stext = ABSOLUTE(.)); \
97     *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) \
98     *(.glue_7) *(.glue_7t)  \
99     } > _region_ \
100     _etext = .; PROVIDE (__etext = .);
101
102 #define SECTION_fini(_region_, _vma_, _lma_) \
103     .fini _vma_ : _lma_ \
104     { FORCE_OUTPUT; *(.fini) } \
105     > _region_
106
107 #define SECTION_rodata(_region_, _vma_, _lma_) \
108     .rodata _vma_ : _lma_ \
109     { FORCE_OUTPUT; *(.rodata*) } \
110     > _region_
111
112 #define SECTION_rodata1(_region_, _vma_, _lma_) \
113     .rodata1 _vma_ : _lma_ \
114     { FORCE_OUTPUT; *(.rodata1) } \
115     > _region_
116
117 #define SECTION_fixup(_region_, _vma_, _lma_) \
118     .fixup _vma_ : _lma_ \
119     { FORCE_OUTPUT; *(.fixup) } \
120     > _region_
121
122 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
123     .gcc_except_table _vma_ : _lma_ \
124     { FORCE_OUTPUT; *(.gcc_except_table) } \
125     > _region_
126
127 #define SECTION_sram(_region_, _vma_, _lma_) \
128     .sram _vma_ : _lma_ \
129     { FORCE_OUTPUT; *(.sram*) } \
130     > _region_
131
132 #define SECTION_data(_region_,  _vma_, _lma_) \
133     .data _vma_ : _lma_ \
134     { __ram_data_start = ABSOLUTE (.); *(.data*) *(.data1) \
135     . = ALIGN (8); \
136     KEEP(*( SORT (.ecos.table.*))) ;            \
137     . = ALIGN (8); \
138     __CTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.ctors*))) __CTOR_END__ = ABSOLUTE (.); \
139     __DTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.dtors*))) __DTOR_END__ = ABSOLUTE (.); \
140     *(.sdata*) \
141     *(.eh_frame) \
142     . = ALIGN (8); *(.2ram.*) \
143     /* Global pointer stuff */ \
144     . = ALIGN(8);    _gp = . + 2048;     __global = _gp; \
145     _GOT_START_ = ABSOLUTE (.); *(.got) _GOT_END_ = ABSOLUTE (.); \
146     _GOT_PLT_START_ = ABSOLUTE (.); *(.got_plt) _GOT_PLT_END_ = ABSOLUTE (.); \
147     _GOT1_START_ = ABSOLUTE (.); *(.got1) _GOT1_END_ = ABSOLUTE (.); \
148     _GOT2_START_ = ABSOLUTE (.); *(.got2) _GOT2_END_ = ABSOLUTE (.); \
149     _DYNAMIC_ = ABSOLUTE (.); *(.dynamic) _DYNAMIC_ = ABSOLUTE (.); \
150     } \
151     > _region_ \
152     __rom_data_start = LOADADDR (.data); \
153     __ram_data_end = .; PROVIDE (__ram_data_end = .); _edata = .; PROVIDE (edata = .); \
154     __rom_data_end = LOADADDR (.data) + SIZEOF(.data);
155
156 #define SECTION_bss(_region_,  _vma_, _lma_) \
157     .bss _vma_ : _lma_ \
158     { __bss_start = ABSOLUTE (.); \
159     *(.scommon) *(.dynbss) *(.sbss) *(.sbss.*) *(.bss*) *(.bss.*) *(COMMON) \
160     __bss_end = ABSOLUTE (.); } \
161     > _region_
162
163 #define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .);
164
165 #include <pkgconf/hal_fr30.h>
166 #include CYGHWR_MEMORY_LAYOUT_LDI