1 |
786 |
skrzyp |
//===========================================================================
|
2 |
|
|
//
|
3 |
|
|
// MLT linker script for H8/300H
|
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 Free Software Foundation, 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
|
14 |
|
|
// version.
|
15 |
|
|
//
|
16 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
17 |
|
|
// ANY 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
|
22 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
23 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
24 |
|
|
//
|
25 |
|
|
// As a special exception, if other files instantiate templates or use
|
26 |
|
|
// macros or inline functions from this file, or you compile this file
|
27 |
|
|
// and link it with other works to produce a work based on this file,
|
28 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
29 |
|
|
// the GNU General Public License. However the source code for this file
|
30 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
31 |
|
|
// General Public License v2.
|
32 |
|
|
//
|
33 |
|
|
// This exception does not invalidate any other reasons why a work based
|
34 |
|
|
// on this file might be covered by the GNU General Public License.
|
35 |
|
|
// -------------------------------------------
|
36 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
37 |
|
|
//===========================================================================
|
38 |
|
|
|
39 |
|
|
#include
|
40 |
|
|
#include
|
41 |
|
|
#include
|
42 |
|
|
STARTUP(vectors.o)
|
43 |
|
|
ENTRY(CYG_LABEL_DEFN(_start))
|
44 |
|
|
#ifdef EXTRAS
|
45 |
|
|
INPUT(extras.o)
|
46 |
|
|
#endif
|
47 |
|
|
GROUP(libtarget.a libgcc.a)
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
#define ALIGN_LMA 4
|
52 |
|
|
#define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
|
53 |
|
|
#define LMA_EQ_VMA
|
54 |
|
|
#define FORCE_OUTPUT . = .
|
55 |
|
|
|
56 |
|
|
#define SECTIONS_BEGIN
|
57 |
|
|
|
58 |
|
|
#define SECTION_rom_vectors(_region_, _vma_, _lma_) \
|
59 |
|
|
.vectors _vma_ : _lma_ \
|
60 |
|
|
{ FORCE_OUTPUT; KEEP (*(.vectors)) } \
|
61 |
|
|
> _region_
|
62 |
|
|
|
63 |
|
|
#define SECTION_text(_region_, _vma_, _lma_) \
|
64 |
|
|
.text _vma_ : _lma_ \
|
65 |
|
|
{ CYG_LABEL_DEFN(_stext) = ABSOLUTE(.); \
|
66 |
|
|
*(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) } \
|
67 |
|
|
> _region_ \
|
68 |
|
|
CYG_LABEL_DEFN(_etext) = .; PROVIDE (etext = .);
|
69 |
|
|
|
70 |
|
|
#define SECTION_fini(_region_, _vma_, _lma_) \
|
71 |
|
|
.fini _vma_ : _lma_ \
|
72 |
|
|
{ FORCE_OUTPUT; *(.fini) } \
|
73 |
|
|
> _region_
|
74 |
|
|
|
75 |
|
|
#define SECTION_rodata(_region_, _vma_, _lma_) \
|
76 |
|
|
.rodata _vma_ : _lma_ \
|
77 |
|
|
{ FORCE_OUTPUT; *(.rodata*) } \
|
78 |
|
|
> _region_
|
79 |
|
|
|
80 |
|
|
#define SECTION_rodata1(_region_, _vma_, _lma_) \
|
81 |
|
|
.rodata1 _vma_ : _lma_ \
|
82 |
|
|
{ FORCE_OUTPUT; *(.rodata1) } \
|
83 |
|
|
> _region_
|
84 |
|
|
|
85 |
|
|
#define SECTION_fixup(_region_, _vma_, _lma_) \
|
86 |
|
|
.fixup _vma_ : _lma_ \
|
87 |
|
|
{ FORCE_OUTPUT; *(.fixup) } \
|
88 |
|
|
> _region_
|
89 |
|
|
|
90 |
|
|
#define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
|
91 |
|
|
.gcc_except_table _vma_ : _lma_ \
|
92 |
|
|
{ FORCE_OUTPUT; *(.gcc_except_table) } \
|
93 |
|
|
> _region_
|
94 |
|
|
|
95 |
|
|
#if defined(CYGSEM_HAL_H8300_VECTOR_HOOK)
|
96 |
|
|
#define SECTION_int_hook_table(_region_, _vma_, _lma_) \
|
97 |
|
|
.int_hook_table CYGHWR_HAL_H8300_VECTOR_ADDRESS : _lma_ \
|
98 |
|
|
{ CYG_LABEL_DEFN(__int_hook_start) = ABSOLUTE (.); \
|
99 |
|
|
FORCE_OUTPUT; *(.int_hook_table) } \
|
100 |
|
|
> _region_ \
|
101 |
|
|
CYG_LABEL_DEFN(__rom_int_hook_table) = LOADADDR(.int_hook_table); \
|
102 |
|
|
CYG_LABEL_DEFN(__int_hook_end) = .;
|
103 |
|
|
#else
|
104 |
|
|
#define SECTION_int_hook_table(_region_, _vma_, _lma_) \
|
105 |
|
|
.int_hook_table _vma_ : _lma_ \
|
106 |
|
|
{ CYG_LABEL_DEFN(__int_hook_start) = ABSOLUTE (.); \
|
107 |
|
|
FORCE_OUTPUT; *(.int_hook_table) } \
|
108 |
|
|
> _region_
|
109 |
|
|
#endif
|
110 |
|
|
|
111 |
|
|
#define SECTION_data(_region_, _vma_, _lma_) \
|
112 |
|
|
.data _vma_ : _lma_ \
|
113 |
|
|
{ CYG_LABEL_DEFN(__ram_data_start) = ABSOLUTE (.); *(.data*) *(.data1) \
|
114 |
|
|
. = ALIGN(4); \
|
115 |
|
|
KEEP(*( SORT (.ecos.table.*))) ; \
|
116 |
|
|
. = ALIGN(4); \
|
117 |
|
|
CYG_LABEL_DEFN(_GOT1_START_) = ABSOLUTE (.); *(.got1) CYG_LABEL_DEFN(_GOT1_END_) = ABSOLUTE (.); \
|
118 |
|
|
CYG_LABEL_DEFN(_GOT2_START_) = ABSOLUTE (.); *(.got2) CYG_LABEL_DEFN(_GOT2_END_) = ABSOLUTE (.); \
|
119 |
|
|
. = ALIGN (4); \
|
120 |
|
|
CYG_LABEL_DEFN(__CTOR_LIST__) = ABSOLUTE (.); KEEP (*(SORT (.ctors*))) CYG_LABEL_DEFN(__CTOR_END__) = ABSOLUTE (.); \
|
121 |
|
|
CYG_LABEL_DEFN(__DTOR_LIST__) = ABSOLUTE (.); KEEP (*(SORT (.dtors*))) CYG_LABEL_DEFN(__DTOR_END__) = ABSOLUTE (.); \
|
122 |
|
|
CYG_LABEL_DEFN(_GOT_START) = ABSOLUTE (.); CYG_LABEL_DEFN(_GLOBAL_OFFSET_TABLE_) = ABSOLUTE (.) + 32768; CYG_LABEL_DEFN(_SDA_BASE_) = ABSOLUTE (.); \
|
123 |
|
|
*(.got.plt) *(.got) CYG_LABEL_DEFN(_GOT_END_) = ABSOLUTE (.); \
|
124 |
|
|
*(.dynamic) *(.sdata*) *(.sbss*) } \
|
125 |
|
|
> _region_ \
|
126 |
|
|
CYG_LABEL_DEFN(__rom_data_start) = LOADADDR (.data); \
|
127 |
|
|
CYG_LABEL_DEFN(__ram_data_end) = .; PROVIDE (CYG_LABEL_DEFN(__ram_data_end) = .); CYG_LABEL_DEFN(_edata) = .; PROVIDE (edata = .);
|
128 |
|
|
|
129 |
|
|
#define SECTION_bss(_region_, _vma_, _lma_) \
|
130 |
|
|
.bss _vma_ : _lma_ \
|
131 |
|
|
{ CYG_LABEL_DEFN(__bss_start) = ABSOLUTE (.); \
|
132 |
|
|
*(.scommon) *(.dynbss) *(.bss.*) *(COMMON) \
|
133 |
|
|
CYG_LABEL_DEFN(__bss_end) = ABSOLUTE (.); } \
|
134 |
|
|
> _region_
|
135 |
|
|
|
136 |
|
|
#define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .);
|
137 |
|
|
|
138 |
|
|
#include CYGHWR_MEMORY_LAYOUT_LDI
|
139 |
|
|
#include CYGBLD_HAL_PLATFORM_H
|
140 |
|
|
|
141 |
|
|
CYG_LABEL_DEFN(hal_virtual_vector_table) = CYGHWR_HAL_VECTOR_TABLE;
|