]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/mn10300/am31/v2_0/src/mn10300_am31.ld
Initial revision
[karo-tx-redboot.git] / packages / hal / mn10300 / am31 / v2_0 / src / mn10300_am31.ld
1 //===========================================================================
2 //
3 // MLT linker script for MN10300
4 // adapted from packages\hal\mn10300\stdeval1\v1_1\src\stdeval1.ld
5 //
6 //===========================================================================
7 //####ECOSGPLCOPYRIGHTBEGIN####
8 // -------------------------------------------
9 // This file is part of eCos, the Embedded Configurable Operating System.
10 // Copyright (C) 2003 Bart Veer
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 //
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.
16 //
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
20 // for more details.
21 //
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.
25 //
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.
32 //
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.
35 //
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
42 #include <pkgconf/system.h>
43 STARTUP(vectors.o)
44 ENTRY(reset_vector)
45 #ifdef EXTRAS
46 INPUT(extras.o)
47 #endif
48 #if (__GNUC__ >= 3)
49 GROUP(libtarget.a libgcc.a libsupc++.a)
50 #else
51 GROUP(libtarget.a libgcc.a)
52 #endif
53
54
55 #define ALIGN_LMA 4
56 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
57 #define LMA_EQ_VMA
58 #define FORCE_OUTPUT . = .
59
60 #define SECTIONS_BEGIN
61
62 #define SECTION_rom_vectors(_region_, _vma_, _lma_) \
63     .rom_vectors _vma_ : _lma_ \
64     { FORCE_OUTPUT; KEEP (*(.vectors)) } \
65     > _region_
66
67 #define SECTION_text(_region_, _vma_, _lma_) \
68     .text _vma_ : _lma_ \
69     { __stext = ABSOLUTE(.); \
70     *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) } \
71     > _region_ \
72     __etext = .; PROVIDE (etext = .);
73
74 #define SECTION_fini(_region_, _vma_, _lma_) \
75     .fini _vma_ : _lma_ \
76     { FORCE_OUTPUT; *(.fini) } \
77     > _region_
78
79 #define SECTION_rodata(_region_, _vma_, _lma_) \
80     .rodata _vma_ : _lma_ \
81     { FORCE_OUTPUT; *(.rodata*) } \
82     > _region_
83
84 #define SECTION_rodata1(_region_, _vma_, _lma_) \
85     .rodata1 _vma_ : _lma_ \
86     { FORCE_OUTPUT; *(.rodata1) } \
87     > _region_
88
89 #define SECTION_fixup(_region_, _vma_, _lma_) \
90     .fixup _vma_ : _lma_ \
91     { FORCE_OUTPUT; *(.fixup) } \
92     > _region_
93
94 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
95     .gcc_except_table _vma_ : _lma_ \
96     { FORCE_OUTPUT; *(.gcc_except_table) } \
97     > _region_
98
99 #define SECTION_data(_region_, _vma_, _lma_) \
100     .data _vma_ : _lma_ \
101     { __ram_data_start = ABSOLUTE (.); *(.data*) *(.data1) \
102     . = ALIGN(4); \
103     KEEP(*( SORT (.ecos.table.*))) ; \
104     . = ALIGN(4); \
105     _GOT1_START_ = ABSOLUTE (.); *(.got1) _GOT1_END_ = ABSOLUTE (.); \
106     _GOT2_START_ = ABSOLUTE (.); *(.got2) _GOT2_END_ = ABSOLUTE (.); \
107     . = ALIGN (4); \
108     __CTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.ctors*))) __CTOR_END__ = ABSOLUTE (.); \
109     __DTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.dtors*))) __DTOR_END__ = ABSOLUTE (.); \
110     _GOT_START = ABSOLUTE (.); _GLOBAL_OFFSET_TABLE_ = ABSOLUTE (.) + 32768; _SDA_BASE_ = ABSOLUTE (.); \
111     *(.got.plt) *(.got) _GOT_END_ = ABSOLUTE (.); \
112     *(.eh_frame) \
113     *(.dynamic) *(.sdata*) *(.sbss*) } \
114     > _region_ \
115     __rom_data_start = LOADADDR (.data); \
116     __ram_data_end = .; PROVIDE (__ram_data_end = .); _edata = .; PROVIDE (edata = .);
117
118 #define SECTION_bss(_region_, _vma_, _lma_) \
119     .bss _vma_ : _lma_ \
120     { __bss_start = ABSOLUTE (.); \
121     *(.scommon) *(.dynbss) *(.bss) *(COMMON) \
122     __bss_end = ABSOLUTE (.); } \
123     > _region_
124
125 #define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .); \
126   .stab 0 : { *(.stab) }                        \
127   .stabstr 0 : { *(.stabstr) }                  \
128   .stab.excl 0 : { *(.stab.excl) }              \
129   .stab.exclstr 0 : { *(.stab.exclstr) }        \
130   .stab.index 0 : { *(.stab.index) }            \
131   .stab.indexstr 0 : { *(.stab.indexstr) }      \
132   .comment 0 : { *(.comment) }                  \
133   .debug          0 : { *(.debug) }             \
134   .line           0 : { *(.line) }              \
135   .debug_srcinfo  0 : { *(.debug_srcinfo) }     \
136   .debug_sfnames  0 : { *(.debug_sfnames) }     \
137   .debug_aranges  0 : { *(.debug_aranges) }     \
138   .debug_pubnames 0 : { *(.debug_pubnames) }    \
139   .debug_info     0 : { *(.debug_info) }        \
140   .debug_abbrev   0 : { *(.debug_abbrev) }      \
141   .debug_line     0 : { *(.debug_line) }        \
142   .debug_frame    0 : { *(.debug_frame) }       \
143   .debug_str      0 : { *(.debug_str) }         \
144   .debug_loc      0 : { *(.debug_loc) }         \
145   .debug_macinfo  0 : { *(.debug_macinfo) }     \
146   .debug_weaknames 0 : { *(.debug_weaknames) }  \
147   .debug_funcnames 0 : { *(.debug_funcnames) }  \
148   .debug_typenames 0 : { *(.debug_typenames) }  \
149   .debug_varnames  0 : { *(.debug_varnames) }
150
151 #include CYGHWR_MEMORY_LAYOUT_LDI
152
153 _mn10300_interrupt_control = 0x34000100;
154 _mn10300_interrupt_vectors = 0x20000000;
155
156 #if (defined (CYG_HAL_STARTUP_RAM) && ! defined (CYGPKG_HAL_MN10300_AM31_SIM))
157 #define VSR_BASE 0x48000000
158 _hal_vsr_table = VSR_BASE;
159 _hal_virtual_vector_table = VSR_BASE + 0x80;
160 #endif