OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [arch/] [current/] [src/] [sh.ld] - Blame information for rev 817

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
/*==========================================================================
2
//
3
//      sh.ld
4
//
5
//      Linker script for SH
6
//
7
//==========================================================================
8
// ####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, 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
16
// version.
17
//
18
// eCos is distributed in the hope that it will be useful, but WITHOUT
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21
// for more details.
22
//
23
// You should have received a copy of the GNU General Public License
24
// along with eCos; if not, write to the Free Software Foundation, Inc.,
25
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26
//
27
// As a special exception, if other files instantiate templates or use
28
// macros or inline functions from this file, or you compile this file
29
// and link it with other works to produce a work based on this file,
30
// this file does not by itself cause the resulting work to be covered by
31
// the GNU General Public License. However the source code for this file
32
// must still be made available in accordance with section (3) of the GNU
33
// General Public License v2.
34
//
35
// This exception does not invalidate any other reasons why a work based
36
// on this file might be covered by the GNU General Public License.
37
// -------------------------------------------
38
// ####ECOSGPLCOPYRIGHTEND####
39
//==========================================================================
40
//#####DESCRIPTIONBEGIN####
41
//
42
// Author(s):   jskov
43
// Contributors:jskov
44
// Date:        1999-04-24
45
// Purpose:     SH Linker script
46
//
47
//####DESCRIPTIONEND####
48
//
49
//========================================================================*/
50
 
51
#include 
52
#include 
53
 
54
STARTUP(vectors.o)
55
ENTRY(CYG_LABEL_DEFN(_reset))
56
INPUT(extras.o)
57
#if (__GNUC__ >= 3)
58
GROUP(libtarget.a libgcc.a libsupc++.a)
59
#else
60
GROUP(libtarget.a libgcc.a)
61
#endif
62
 
63
#define ALIGN_LMA 16
64
#define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
65
#define LMA_EQ_VMA
66
#define FORCE_OUTPUT . = .
67
 
68
 
69
# define SECTIONS_BEGIN
70
 
71
# define SECTION_vectors(_region_, _vma_, _lma_)                \
72
  .vectors _vma_ : _lma_                                        \
73
  { FORCE_OUTPUT; KEEP(*(.vectors))                             \
74
  }                                                             \
75
  > _region_                                                    \
76
  CYG_LABEL_DEFN(_vector_code_lma) = LOADADDR(.vectors);
77
 
78
# define SECTION_text(_region_, _vma_, _lma_)                   \
79
  .text _vma_ : _lma_                                           \
80
  { CYG_LABEL_DEFN(_stext) = .;                                 \
81
    *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) }      \
82
  > _region_                                                    \
83
  CYG_LABEL_DEFN(_etext) = .;  PROVIDE (__etext = .);
84
 
85
# define SECTION_data(_region_, _vma_, _lma_)                            \
86
    .data _vma_ : _lma_                                                  \
87
    { CYG_LABEL_DEFN(_ram_data_start) = ABSOLUTE(.); *(.data*)           \
88
      *( .2ram.*) ;                                                      \
89
     . = ALIGN(8); CYG_LABEL_DEFN(__CTOR_LIST__) = ABSOLUTE(.);          \
90
      KEEP(*(SORT(.ctors*))) CYG_LABEL_DEFN(__CTOR_END__) = ABSOLUTE(.); \
91
    CYG_LABEL_DEFN(__DTOR_LIST__) = ABSOLUTE(.);                         \
92
      KEEP(*(SORT(.dtors*))) CYG_LABEL_DEFN(__DTOR_END__) = ABSOLUTE(.); \
93
    . = ALIGN(8);                                                        \
94
      KEEP(*( SORT (.ecos.table.*))) ;                                   \
95
    . = ALIGN(4);                                                        \
96
     *(.stack)                                                           \
97
    } > _region_                                                         \
98
    CYG_LABEL_DEFN(_rom_data_start) = LOADADDR(.data);                   \
99
    CYG_LABEL_DEFN(_ram_data_end) = .; PROVIDE(_ram_data_end = .);       \
100
    CYG_LABEL_DEFN(edata) = .; PROVIDE (edata = .);
101
 
102
 
103
#define SECTION_eh_frame(_region_, _vma_, _lma_)      \
104
  .eh_frame _vma_ : _lma_                             \
105
    {                                                 \
106
       FORCE_OUTPUT;  __EH_FRAME_BEGIN__ = .;         \
107
       KEEP(*(.eh_frame))                             \
108
       __FRAME_END__ = .;                             \
109
       . = . + 8;                                     \
110
    } > _region_ = 0
111
 
112
#define SECTION_RELOCS(_region_, _vma_, _lma_)                              \
113
  .rel.text      :                                                          \
114
    {                                                                       \
115
      *(.rel.text)                                                          \
116
      *(.rel.text.*)                                                        \
117
      *(.rel.gnu.linkonce.t*)                                               \
118
    } > _region_                                                            \
119
  .rela.text     :                                                          \
120
    {                                                                       \
121
      *(.rela.text)                                                         \
122
      *(.rela.text.*)                                                       \
123
      *(.rela.gnu.linkonce.t*)                                              \
124
    } > _region_                                                            \
125
  .rel.data      :                                                          \
126
    {                                                                       \
127
      *(.rel.data)                                                          \
128
      *(.rel.data.*)                                                        \
129
      *(.rel.gnu.linkonce.d*)                                               \
130
    } > _region_                                                            \
131
  .rela.data     :                                                          \
132
    {                                                                       \
133
      *(.rela.data)                                                         \
134
      *(.rela.data.*)                                                       \
135
      *(.rela.gnu.linkonce.d*)                                              \
136
    } > _region_                                                            \
137
  .rel.rodata    :                                                          \
138
    {                                                                       \
139
      *(.rel.rodata)                                                        \
140
      *(.rel.rodata.*)                                                      \
141
      *(.rel.gnu.linkonce.r*)                                               \
142
    } > _region_                                                            \
143
  .rela.rodata   :                                                          \
144
    {                                                                       \
145
      *(.rela.rodata)                                                       \
146
      *(.rela.rodata.*)                                                     \
147
      *(.rela.gnu.linkonce.r*)                                              \
148
    } > _region_                                                            \
149
  .rel.got       :   { *(.rel.got)    } > _region_                          \
150
  .rela.got      :   { *(.rela.got)   } > _region_                          \
151
  .rel.ctors     :   { *(.rel.ctors)  } > _region_                          \
152
  .rela.ctors    :   { *(.rela.ctors) } > _region_                          \
153
  .rel.dtors     :   { *(.rel.dtors)  } > _region_                          \
154
  .rela.dtors    :   { *(.rela.dtors) } > _region_                          \
155
  .rel.init      :   { *(.rel.init)   } > _region_                          \
156
  .rela.init     :   { *(.rela.init)  } > _region_                          \
157
  .rel.fini      :   { *(.rel.fini)   } > _region_                          \
158
  .rela.fini     :   { *(.rela.fini)  } > _region_                          \
159
  .rel.bss       :   { *(.rel.bss)    } > _region_                          \
160
  .rela.bss      :   { *(.rela.bss)   } > _region_                          \
161
  .rel.plt       :   { *(.rel.plt)    } > _region_                          \
162
  .rela.plt      :   { *(.rela.plt)   } > _region_                          \
163
  .rel.dyn       :   { *(.rel.dyn)    } > _region_
164
 
165
#define SECTION_got(_region_, _vma_, _lma_)                                 \
166
  .got _vma_ : _lma_                                                        \
167
    {                                                                       \
168
      FORCE_OUTPUT; *(.got.plt) *(.got)                                     \
169
    } > _region_
170
 
171
#define SECTION_fini(_region_, _vma_, _lma_)    \
172
    .fini _vma_ : _lma_                         \
173
    { FORCE_OUTPUT; *(.fini) }                  \
174
    > _region_
175
 
176
#define SECTION_rodata1(_region_, _vma_, _lma_) \
177
    .rodata1 _vma_ : _lma_                      \
178
    { FORCE_OUTPUT; *(.rodata1) }               \
179
    > _region_
180
 
181
#define SECTION_rodata(_region_, _vma_, _lma_)  \
182
    .rodata _vma_ : _lma_                       \
183
    { FORCE_OUTPUT; *(.rodata*) }               \
184
    > _region_
185
 
186
#define SECTION_fixup(_region_, _vma_, _lma_)                                \
187
    .fixup _vma_ : _lma_                                                     \
188
    { __FIXUP_START__ = ABSOLUTE(.); *(.fixup) __FIXUP_END__ = ABSOLUTE(.);} \
189
    > _region_
190
 
191
#define SECTION_gcc_except_table(_region_, _vma_, _lma_)        \
192
    .gcc_except_table _vma_ : _lma_                             \
193
    { __EXCEPT_START__ = ABSOLUTE(.);                           \
194
      KEEP(*(.gcc_except_table))                                \
195
      *(.gcc_except_table.*)                                    \
196
      __EXCEPT_END__ = ABSOLUTE(.);}                            \
197
    > _region_
198
 
199
#define SECTION_bss(_region_, _vma_, _lma_)             \
200
    .bss _vma_ : _lma_                                  \
201
    { CYG_LABEL_DEFN(_bss_start) = ABSOLUTE (.);        \
202
      FORCE_OUTPUT; *(.dynbss) *(.bss*) *(COMMON)       \
203
      . = ALIGN(4);                                     \
204
      CYG_LABEL_DEFN(_bss_end) = ABSOLUTE (.); }        \
205
    > _region_
206
 
207
# define SECTION_entry(_region_, _vma_, _lma_)          \
208
  .entry _vma_ : _lma_                                  \
209
  {                                                     \
210
        KEEP(*(.entry))                                 \
211
  }                                                     \
212
  > _region_
213
 
214
#define SECTIONS_END . = ALIGN(4); CYG_LABEL_DEFN(end) = .; PROVIDE (end = .);
215
 
216
#include 
217
#include CYGHWR_MEMORY_LAYOUT_LDI
218
#include CYGBLD_HAL_PLATFORM_H
219
 
220
// Define VSR and vector tables to reside at fixed address.
221
CYG_LABEL_DEFN(hal_vsr_table) = CYGHWR_HAL_VSR_TABLE;
222
CYG_LABEL_DEFN(hal_virtual_vector_table) = CYGHWR_HAL_VECTOR_TABLE;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.