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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [calmrisc16/] [core/] [current/] [src/] [calm16_core.ld] - Blame information for rev 838

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

Line No. Rev Author Line
1 786 skrzyp
//===========================================================================
2
//
3
// MLT linker script for CalmRISC16 Core
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
 
41
OUTPUT_FORMAT("elf32-calmrisc16", "elf32-calmrisc16",
42
              "elf32-calmrisc16")
43
 
44
OUTPUT_ARCH(calmrisc16)
45
 
46
STARTUP(vectors.o)
47
ENTRY(_reset_vector)
48
#ifdef EXTRAS
49
INPUT(extras.o)
50
#endif
51
#if (__GNUC__ >= 3)
52
GROUP(libtarget.a libgcc.a libsupc++.a)
53
#else
54
GROUP(libtarget.a libgcc.a)
55
#endif
56
 
57
#define ALIGN_LMA 0x40
58
#define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
59
#define LMA_EQ_VMA
60
#define FORCE_OUTPUT . = .
61
 
62
#define SECTIONS_BEGIN
63
 
64
#if defined(CYG_HAL_STARTUP_RAM)
65
 
66
/* this version for RAM startup */
67
#define SECTION_vectors(_region_, _vma_, _lma_) \
68
    .vectors _vma_ : _lma_ \
69
    { KEEP (*(.vectors)) } \
70
    > _region_
71
 
72
#elif defined(CYG_HAL_STARTUP_ROM)
73
 
74
/* this version for ROM startup */
75
#define SECTION_vectors(_region_, _vma_, _lma_) \
76
    .vectors _vma_ : _lma_ \
77
    { KEEP (*(.vectors)) } > _region_
78
 
79
#endif /* ROM startup version of ROM vectors */
80
 
81
#define SECTION_ROMISC(_region_, _vma_, _lma_)                                 \
82
  .interp _vma_  : _lma_ { *(.interp)                            } > _region_  \
83
  .hash          : FOLLOWING(.interp)        { *(.hash)          } > _region_  \
84
  .dynsym        : FOLLOWING(.hash)          { *(.dynsym)        } > _region_  \
85
  .dynstr        : FOLLOWING(.dynsym)        { *(.dynstr)        } > _region_  \
86
  .gnu.version   : FOLLOWING(.dynstr)        { *(.gnu.version)   } > _region_  \
87
  .gnu.version_d : FOLLOWING(.gnu.version)   { *(.gnu.version_d) } > _region_  \
88
  .gnu.version_r : FOLLOWING(.gnu.version_d) { *(.gnu.version_r) } > _region_
89
 
90
#define SECTION_RELOCS(_region_, _vma_, _lma_)                              \
91
  .rel.text      :                                                          \
92
    {                                                                       \
93
      *(.rel.text)                                                          \
94
      *(.rel.text.*)                                                        \
95
      *(.rel.gnu.linkonce.t*)                                               \
96
    } > _region_                                                            \
97
  .rela.text     :                                                          \
98
    {                                                                       \
99
      *(.rela.text)                                                         \
100
      *(.rela.text.*)                                                       \
101
      *(.rela.gnu.linkonce.t*)                                              \
102
    } > _region_                                                            \
103
  .rel.data      :                                                          \
104
    {                                                                       \
105
      *(.rel.data)                                                          \
106
      *(.rel.data.*)                                                        \
107
      *(.rel.gnu.linkonce.d*)                                               \
108
    } > _region_                                                            \
109
  .rela.data     :                                                          \
110
    {                                                                       \
111
      *(.rela.data)                                                         \
112
      *(.rela.data.*)                                                       \
113
      *(.rela.gnu.linkonce.d*)                                              \
114
    } > _region_                                                            \
115
  .rel.rodata    :                                                          \
116
    {                                                                       \
117
      *(.rel.rodata)                                                        \
118
      *(.rel.rodata.*)                                                      \
119
      *(.rel.gnu.linkonce.r*)                                               \
120
    } > _region_                                                            \
121
  .rela.rodata   :                                                          \
122
    {                                                                       \
123
      *(.rela.rodata)                                                       \
124
      *(.rela.rodata.*)                                                     \
125
      *(.rela.gnu.linkonce.r*)                                              \
126
    } > _region_                                                            \
127
  .rel.got       :   { *(.rel.got)    } > _region_                          \
128
  .rela.got      :   { *(.rela.got)   } > _region_                          \
129
  .rel.ctors     :   { *(.rel.ctors)  } > _region_                          \
130
  .rela.ctors    :   { *(.rela.ctors) } > _region_                          \
131
  .rel.dtors     :   { *(.rel.dtors)  } > _region_                          \
132
  .rela.dtors    :   { *(.rela.dtors) } > _region_                          \
133
  .rel.init      :   { *(.rel.init)   } > _region_                          \
134
  .rela.init     :   { *(.rela.init)  } > _region_                          \
135
  .rel.fini      :   { *(.rel.fini)   } > _region_                          \
136
  .rela.fini     :   { *(.rela.fini)  } > _region_                          \
137
  .rel.bss       :   { *(.rel.bss)    } > _region_                          \
138
  .rela.bss      :   { *(.rela.bss)   } > _region_                          \
139
  .rel.plt       :   { *(.rel.plt)    } > _region_                          \
140
  .rela.plt      :   { *(.rela.plt)   } > _region_                          \
141
  .rel.dyn       :   { *(.rel.dyn)    } > _region_
142
 
143
#define SECTION_init(_region_, _vma_, _lma_)   \
144
  .init _vma_ : _lma_                          \
145
    {                                          \
146
      FORCE_OUTPUT; KEEP (*(.init))            \
147
    } > _region_ =0x9e90
148
 
149
#define SECTION_text(_region_, _vma_, _lma_)   \
150
  .text _vma_ : _lma_                          \
151
    {                                          \
152
      _stext = .; _ftext = . ;                 \
153
      *(.text)                                 \
154
      *(.text.*)                               \
155
      *(.stub)                                 \
156
      *(.gnu.warning)                          \
157
      *(.gnu.linkonce.t*)                      \
158
    } > _region_ =0x9e90                       \
159
  _etext = .; PROVIDE (etext = .);
160
 
161
#define SECTION_fini(_region_, _vma_, _lma_)   \
162
  .fini _vma_ : _lma_                          \
163
    {                                          \
164
      FORCE_OUTPUT; KEEP (*(.fini))                   \
165
    } > _region_ =0x9e90
166
 
167
#define SECTION_rodata(_region_, _vma_, _lma_)        \
168
  .rodata _vma_ : _lma_                               \
169
    {                                                 \
170
      FORCE_OUTPUT; *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*)    \
171
    } > _region_
172
 
173
#define SECTION_rodata1(_region_, _vma_, _lma_)       \
174
  .rodata1 _vma_ : _lma_                              \
175
    {                                                 \
176
     FORCE_OUTPUT; *(.rodata1) *(.rodata1.*)          \
177
    } > _region_
178
 
179
#define SECTION_vsr_table(_region_, _vma_, _lma_)     \
180
  .vsr_table _vma_ : _lma_                            \
181
    {                                                 \
182
      FORCE_OUTPUT; *(.vsr_table)                     \
183
    } > _region_
184
 
185
#define SECTION_data(_region_, _vma_, _lma_)          \
186
  .data _vma_ : _lma_                                 \
187
    {                                                 \
188
      ___ram_data_start = ABSOLUTE (.); _fdata = . ;   \
189
      *(.data) *(.data.*) *(.gnu.linkonce.d*)         \
190
    . = ALIGN (8);                                    \
191
    SORT(CONSTRUCTORS)                                \
192
    } > _region_                                      \
193
    ___rom_data_start = LOADADDR(.data);
194
 
195
#define SECTION_data1(_region_, _vma_, _lma_)         \
196
  .data1 _vma_ : _lma_                                \
197
    {                                                 \
198
       FORCE_OUTPUT; *(.data1) *(.data1.*)            \
199
    } > _region_
200
 
201
#define SECTION_eh_frame(_region_, _vma_, _lma_)      \
202
  .eh_frame _vma_ : _lma_                             \
203
    {                                                 \
204
       FORCE_OUTPUT; *(.eh_frame)                     \
205
    } > _region_
206
 
207
#define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
208
  .gcc_except_table _vma_ : _lma_                        \
209
    {                                                    \
210
      FORCE_OUTPUT; *(.gcc_except_table)                 \
211
    } > _region_
212
 
213
 
214
    /* gcc uses crtbegin.o to find the start of
215
       the constructors, so we make sure it is
216
       first.  Because this is a wildcard, it
217
       doesn't matter if the user does not
218
       actually link against crtbegin.o; the
219
       linker won't look for a file to match a
220
       wildcard.  The wildcard also means that it
221
       doesn't matter which directory crtbegin.o
222
       is in.  */
223
 
224
    /* We don't want to include the .ctors section from
225
       the crtend.o file until after the sorted ctors.
226
       The .ctor section from the crtend file contains the
227
       end of ctors marker and it must be last */
228
 
229
/* FIXME: We shouldn't need to define __CTOR_LIST__/__CTOR_END__
230
   and __DTOR_LIST__/__DTOR_END__ except by the PROVIDE lines.
231
   However this doesn't work for old (99r1-era) toolchains, so
232
   leave it for now. */
233
 
234
#define SECTION_ctors(_region_, _vma_, _lma_)     \
235
  .ctors _vma_ : _lma_                            \
236
    {                                             \
237
      FORCE_OUTPUT;                               \
238
      KEEP (*crtbegin.o(.ctors))                  \
239
      ___CTOR_LIST__ = .;                \
240
      PROVIDE (___CTOR_LIST__ = .);                \
241
      KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))   \
242
      KEEP (*(SORT(.ctors.*)))                    \
243
      KEEP (*(.ctors))                            \
244
      ___CTOR_END__ = .;                 \
245
      PROVIDE (___CTOR_END__ = .);                 \
246
    } > _region_
247
 
248
#define SECTION_dtors(_region_, _vma_, _lma_)     \
249
  .dtors _vma_ : _lma_                            \
250
    {                                             \
251
      FORCE_OUTPUT;                               \
252
      KEEP (*crtbegin.o(.dtors))                  \
253
      ___DTOR_LIST__ = .;                \
254
      PROVIDE (___DTOR_LIST__ = .);                \
255
      KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))   \
256
      KEEP (*(SORT(.dtors.*)))                    \
257
      KEEP (*(.dtors))                            \
258
      ___DTOR_END__ = .;                 \
259
      PROVIDE (___DTOR_END__ = .);                 \
260
    } > _region_
261
 
262
#define SECTION_devtab(_region_, _vma_, _lma_)    \
263
  .devtab _vma_ : _lma_                           \
264
    {                                             \
265
      FORCE_OUTPUT;                               \
266
      KEEP(*( SORT (.ecos.table.*))) ;            \
267
    } > _region_
268
 
269
#define SECTION_got(_region_, _vma_, _lma_)     \
270
  _gp = ALIGN(16) + 0x7ff0;                     \
271
  .got _vma_ : _lma_                            \
272
    {                                           \
273
      FORCE_OUTPUT; *(.got.plt) *(.got)         \
274
    } > _region_
275
 
276
#define SECTION_dynamic(_region_, _vma_, _lma_) \
277
  .dynamic _vma_ : _lma_                        \
278
    {                                           \
279
      FORCE_OUTPUT; *(.dynamic)                 \
280
    } > _region_
281
 
282
  /* We want the small data sections together, so single-instruction offsets
283
     can access them all, and initialized data all before uninitialized, so
284
     we can shorten the on-disk segment size.  */
285
 
286
#define SECTION_sdata(_region_, _vma_, _lma_)                 \
287
  .sdata _vma_ : _lma_                                        \
288
    {                                                         \
289
      FORCE_OUTPUT; *(.sdata) *(.sdata.*) *(.gnu.linkonce.s*)  \
290
    } > _region_
291
 
292
#define SECTION_lit8(_region_, _vma_, _lma_)    \
293
  .lit8 _vma_ : _lma_                           \
294
    {                                           \
295
      FORCE_OUTPUT; *(.lit8)                    \
296
    } > _region_
297
 
298
#define SECTION_lit4(_region_, _vma_, _lma_)    \
299
  .lit4 : FOLLOWING(.lit8)                      \
300
    {                                           \
301
      FORCE_OUTPUT; *(.lit4)                    \
302
    } > _region_                                \
303
  ___ram_data_end = .; _edata = . ;              \
304
  PROVIDE (edata = .);
305
 
306
#define SECTION_sbss(_region_, _vma_, _lma_)                    \
307
  ___bss_start = .; _fbss = .;                                   \
308
  .sbss _vma_ : _lma_                                           \
309
    {                                                           \
310
      FORCE_OUTPUT; *(.dynsbss) *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*) *(.scommon) \
311
    } > _region_
312
 
313
#define SECTION_bss(_region_, _vma_, _lma_)       \
314
  .bss _vma_ : _lma_                              \
315
    {                                             \
316
      *(.dynbss) *(.bss) *(.bss.*) *(.gnu.linkonce.b.*) *(COMMON)      \
317
    } > _region_                                  \
318
  ___bss_end = .;
319
 
320
/* The /DISCARD/ section ensures that the output will not contain a
321
 * .mdebug section as it confuses GDB. This is a workaround for CR 100804.
322
 */
323
 
324
#define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .); \
325
  /* Stabs debugging sections.  */                              \
326
  .stab          0 : { *(.stab) }                               \
327
  .stabstr       0 : { *(.stabstr) }                            \
328
  .stab.excl     0 : { *(.stab.excl) }                          \
329
  .stab.exclstr  0 : { *(.stab.exclstr) }                       \
330
  .stab.index    0 : { *(.stab.index) }                         \
331
  .stab.indexstr 0 : { *(.stab.indexstr) }                      \
332
  .comment       0 : { *(.comment) }                            \
333
  /* DWARF debug sections.                                      \
334
     Symbols in the DWARF debugging sections are relative to    \
335
     the beginning of the section so we begin them at 0.  */    \
336
  /* DWARF 1 */                                                 \
337
  .debug          0 : { *(.debug) }                             \
338
  .line           0 : { *(.line) }                              \
339
  /* GNU DWARF 1 extensions */                                  \
340
  .debug_srcinfo  0 : { *(.debug_srcinfo) }                     \
341
  .debug_sfnames  0 : { *(.debug_sfnames) }                     \
342
  /* DWARF 1.1 and DWARF 2 */                                   \
343
  .debug_aranges  0 : { *(.debug_aranges) }                     \
344
  .debug_pubnames 0 : { *(.debug_pubnames) }                    \
345
  /* DWARF 2 */                                                 \
346
  .debug_info     0 : { *(.debug_info) }                        \
347
  .debug_abbrev   0 : { *(.debug_abbrev) }                      \
348
  .debug_line     0 : { *(.debug_line) }                        \
349
  .debug_frame    0 : { *(.debug_frame) }                       \
350
  .debug_str      0 : { *(.debug_str) }                         \
351
  .debug_loc      0 : { *(.debug_loc) }                         \
352
  .debug_macinfo  0 : { *(.debug_macinfo) }                     \
353
  /* SGI/MIPS DWARF 2 extensions */                             \
354
  .debug_weaknames 0 : { *(.debug_weaknames) }                  \
355
  .debug_funcnames 0 : { *(.debug_funcnames) }                  \
356
  .debug_typenames 0 : { *(.debug_typenames) }                  \
357
  .debug_varnames  0 : { *(.debug_varnames) }
358
 
359
#include CYGHWR_MEMORY_LAYOUT_LDI
360
 

powered by: WebSVN 2.1.0

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