]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/v85x/v850/v2_0/src/v85x_v850.ld
Initial revision
[karo-tx-redboot.git] / packages / hal / v85x / v850 / v2_0 / src / v85x_v850.ld
1 //=============================================================================
2 //
3 // MLT linker script for NEC
4 // adapted from packages/hal/arm/pid/v1_1/src/pid.ld
5 //
6 //=============================================================================
7 //####ECOSGPLCOPYRIGHTBEGIN####
8 // -------------------------------------------
9 // This file is part of eCos, the Embedded Configurable Operating System.
10 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
11 //
12 // eCos is free software; you can redistribute it and/or modify it under
13 // the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 2 or (at your option) any later version.
15 //
16 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 // for more details.
20 //
21 // You should have received a copy of the GNU General Public License along
22 // with eCos; if not, write to the Free Software Foundation, Inc.,
23 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 //
25 // As a special exception, if other files instantiate templates or use macros
26 // or inline functions from this file, or you compile this file and link it
27 // with other works to produce a work based on this file, this file does not
28 // by itself cause the resulting work to be covered by the GNU General Public
29 // License. However the source code for this file must still be made available
30 // in accordance with section (3) of the GNU General Public License.
31 //
32 // This exception does not invalidate any other reasons why a work based on
33 // this file might be covered by the GNU General Public License.
34 //
35 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
36 // at http://sources.redhat.com/ecos/ecos-license/
37 // -------------------------------------------
38 //####ECOSGPLCOPYRIGHTEND####
39 //=============================================================================
40
41 #include <pkgconf/system.h>
42
43 STARTUP(vectors.o)
44 // Enter at reset_vector in non-RAM startups so they are more representative
45 // of actual execution when loaded over ICE
46 #ifdef CYG_HAL_STARTUP_RAM
47 ENTRY(start)
48 #else
49 ENTRY(reset_vector)
50 #endif
51 #ifdef EXTRAS
52 INPUT(extras.o)
53 #endif
54 #if (__GNUC__ >= 3)
55 GROUP(libtarget.a libgcc.a libsupc++.a)
56 #else
57 GROUP(libtarget.a libgcc.a)
58 #endif
59
60 #define ALIGN_LMA 4
61 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
62 #define LMA_EQ_VMA
63 #define FORCE_OUTPUT . = .
64
65 #define SECTIONS_BEGIN                          \
66   /* Debug information */                       \
67   .debug_aranges  0 : { *(.debug_aranges) }     \
68   .debug_pubnames 0 : { *(.debug_pubnames) }    \
69   .debug_info     0 : { *(.debug_info) }        \
70   .debug_abbrev   0 : { *(.debug_abbrev) }      \
71   .debug_line     0 : { *(.debug_line) }        \
72   .debug_frame    0 : { *(.debug_frame) }       \
73   .debug_str      0 : { *(.debug_str) }         \
74   .debug_loc      0 : { *(.debug_loc) }         \
75   .debug_macinfo  0 : { *(.debug_macinfo) }
76
77 #define SECTION_rom_vectors(_region_, _vma_, _lma_) \
78     .rom_vectors _vma_ : _lma_ \
79     { FORCE_OUTPUT; KEEP (*(.vectors)) } \
80     > _region_
81
82 #define SECTION_ram_vectors(_region_, _vma_, _lma_) \
83     .ram_vectors _vma_ : _lma_ \
84     { ___ram_vectors_start = ABSOLUTE(.); \
85       FORCE_OUTPUT; KEEP (*(.ram_vectors)) \
86       ___ram_vectors_end = ABSOLUTE(.); \
87     } > _region_ \
88     ___ram_vectors_loadaddr = LOADADDR(.ram_vectors);
89
90 #define SECTION_text(_region_, _vma_, _lma_) \
91     .text _vma_ : _lma_ \
92     { stext = ABSOLUTE(.); \
93     PROVIDE (__stext = ABSOLUTE(.)); \
94     *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) \
95     *(.glue_7) *(.glue_7t)  \
96     } > _region_ \
97     etext = .; PROVIDE (__etext = .);
98
99 #define SECTION_fini(_region_, _vma_, _lma_) \
100     .fini _vma_ : _lma_ \
101     { FORCE_OUTPUT; *(.fini) } \
102     > _region_
103
104 #define SECTION_rodata(_region_, _vma_, _lma_) \
105     .rodata _vma_ : _lma_ \
106     { FORCE_OUTPUT; *(.rodata*) } \
107     > _region_
108
109 #define SECTION_rodata1(_region_, _vma_, _lma_) \
110     .rodata1 _vma_ : _lma_ \
111     { FORCE_OUTPUT; *(.rodata1) } \
112     > _region_
113
114 #define SECTION_fixup(_region_, _vma_, _lma_) \
115     .fixup _vma_ : _lma_ \
116     { FORCE_OUTPUT; *(.fixup) } \
117     > _region_
118
119 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
120     .gcc_except_table _vma_ : _lma_ \
121     { FORCE_OUTPUT; *(.gcc_except_table) } \
122     > _region_
123
124 #define SECTION_data(_region_,  _vma_, _lma_) \
125     .data _vma_ : _lma_ \
126     { ___ram_data_start = ABSOLUTE (.); *(.data*) *(.data1); \
127     _GOT1_START_ = ABSOLUTE (.); *(.got1) _GOT1_END_ = ABSOLUTE (.); \
128     _GOT2_START_ = ABSOLUTE (.); *(.got2) _GOT2_END_ = ABSOLUTE (.); \
129     . = ALIGN (4); \
130     KEEP(*( SORT (.ecos.table.*))) ; \
131     ___CTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.ctors*))) ___CTOR_END__ = ABSOLUTE (.); \
132     ___DTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.dtors*))) ___DTOR_END__ = ABSOLUTE (.); \
133     *(.eh_frame) \
134     *(.dynamic) *(.sdata*) *(.sbss*) } \
135     > _region_ \
136     ___rom_data_start = LOADADDR (.data); \
137     ___ram_data_end = .; PROVIDE (___ram_data_end = .); _edata = .; PROVIDE (edata = .); \
138     PROVIDE (___rom_data_end = LOADADDR (.data) + SIZEOF(.data));
139
140 #define SECTION_bss(_region_,  _vma_, _lma_) \
141     .bss _vma_ : _lma_ \
142     { ___bss_start = ABSOLUTE (.); \
143     *(.scommon) *(.dynbss) *(.bss*) *(COMMON) \
144     ___bss_end = ABSOLUTE (.); } \
145     > _region_
146
147 #include <cyg/hal/plf_sections.h>
148
149 #include <pkgconf/hal_v85x.h>
150 #include <pkgconf/hal_v85x_v850.h>
151 #include CYGHWR_MEMORY_LAYOUT_LDI
152
153 // EOF v85x_v850.ld