source: trunk/libs/newlib/src/libgloss/mep/gmap_default.ld @ 458

Last change on this file since 458 was 444, checked in by satin@…, 7 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 8.8 KB
Line 
1/******************************************************************************
2begin-header
3
4   Copyright (c) 2000-2007  Red Hat, Inc. All rights reserved.
5
6   This copyrighted material is made available to anyone wishing to use, modify,
7   copy, or redistribute it subject to the terms and conditions of the BSD
8   License.   This program is distributed in the hope that it will be useful,
9   but WITHOUT ANY WARRANTY expressed or implied, including the implied
10   warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  A copy
11   of this license is available at http://www.opensource.org/licenses. Any
12   Red Hat trademarks that are incorporated in the source code or documentation
13   are not subject to the BSD License and may only be used or replicated with
14   the express permission of Red Hat, Inc.
15
16   Default linker script for use with the Configuration Tool for
17   Toshiba Media Processor.
18
19   When generating a configuration for a media module, M, the
20   configuration tool will copy this file into a custom linker script
21   M.ld, and customize the script with settings from the media
22   module's global map file.
23
24end-header
25*******************************************************************************/
26
27OUTPUT_FORMAT("elf32-mep-little", "elf32-mep",
28              "elf32-mep-little")
29OUTPUT_ARCH(mep)
30ENTRY(_reset)
31
32MEMORY
33{
34/* begin-memory */
35  VEC   (r) : ORIGIN = 0x00000000, LENGTH = 0x000000b8
36  ROM   (r) : ORIGIN = 0x000000b8, LENGTH = 0x001fff48
37  RAM   (w) : ORIGIN = 0x00800000, LENGTH = 0x00800000
38/* end-memory */
39}
40
41SECTIONS
42{
43  /* Sections to be placed in the vec area.  */
44  .vec : { *(.vec) } >VEC /* VEC-section */
45
46  /* Sections to be placed in the HWINIT area.  */
47  .hwinit : { *(.hwinit) } >HWINIT /* HWINIT-section */
48
49  /* Sections to be placed in the ROM area.  */
50  .gnu.version   : { *(.gnu.version)    } >ROM /* ROM-section */
51  .gnu.version_d : { *(.gnu.version_d)  } >ROM /* ROM-section */
52  .gnu.version_r : { *(.gnu.version_r)  } >ROM /* ROM-section */
53
54  /* Sections to be placed in the romdata.s area.  */
55  .srodata :
56  {
57    __sdabase = . + 0x8000;
58    *(.srodata) *(.srodata.*) *(.gnu.linkonce.srd.*)
59  } >RAM /* DATA-section */
60
61  /* Sections to be placed in the data.s area.  */
62  .sdata     :
63  {
64    *(.sdata)
65    *(.sdata.*)
66    *(.gnu.linkonce.s.*)
67  } >RAM /* DATA-section */
68  .sbss      :
69  {
70    PROVIDE (__sbss_start = .);
71    PROVIDE (___sbss_start = .);
72    *(.dynsbss)
73    *(.sbss)
74    *(.sbss.*)
75    *(.gnu.linkonce.sb.*)
76    *(.scommon)
77    PROVIDE (__sbss_end = .);
78    PROVIDE (___sbss_end = .);
79    /* Assert maximum size */
80    __assert_tiny_size = ASSERT ((. < __sdabase) || ((. - __sdabase) <= 0x8000),
81                                 "tiny section overflow");
82  } >RAM /* DATA-section */
83
84  /* Sections to be placed in the data.m area.  */
85  .data    :
86  {
87    __data_start = . ;
88    *(.data)
89    *(.data.*)
90    *(.gnu.linkonce.d.*)
91    SORT(CONSTRUCTORS)
92  } >RAM /* DATA-section */
93  .data1   : { *(.data1) } >RAM /* DATA-section */
94  .eh_frame : { KEEP (*(.eh_frame))} >RAM /* DATA-section */
95  .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } >RAM /* DATA-section */
96  .dynamic       : { *(.dynamic) } >RAM /* DATA-section */
97  .ctors   :
98  {
99    /* gcc uses crtbegin.o to find the start of
100       the constructors, so we make sure it is
101       first.  Because this is a wildcard, it
102       doesn't matter if the user does not
103       actually link against crtbegin.o; the
104       linker won't look for a file to match a
105       wildcard.  The wildcard also means that it
106       doesn't matter which directory crtbegin.o
107       is in.  */
108    KEEP (*crtbegin.o(.ctors))
109    /* We don't want to include the .ctor section from
110       from the crtend.o file until after the sorted ctors.
111       The .ctor section from the crtend file contains the
112       end of ctors marker and it must be last */
113    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
114    KEEP (*(SORT(.ctors.*)))
115    KEEP (*(.ctors))
116  } >RAM /* DATA-section */
117  .dtors         :
118  {
119    KEEP (*crtbegin.o(.dtors))
120    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
121    KEEP (*(SORT(.dtors.*)))
122    KEEP (*(.dtors))
123  } >RAM /* DATA-section */
124  .jcr :
125  {
126    . = ALIGN(4);
127    *(.jcr)
128  } >RAM /* DATA-section */
129  .got :
130  {
131    *(.got.plt) *(.got)
132    _edata = .;
133    PROVIDE (edata = .);
134  } >RAM /* DATA-section */
135  .based :
136  {
137    __tpbase = .;
138    *(.based) *(.based.*) *(.gnu.linkonce.based.*)
139    /* Assert maximum size */
140    __assert_based_size = ASSERT ((. - __tpbase) <= 0x80,
141                                  "based section overflow");
142  } >RAM /* DATA-section */
143
144  .bss       :
145  {
146    __bss_start = .;
147    *(.dynbss)
148    *(.bss)
149    *(.bss.*)
150    *(.gnu.linkonce.b.*)
151    *(COMMON)
152    /* Align here to ensure that the .bss section occupies space up to
153      _end.  Align after .bss to ensure correct alignment even if the
154      .bss section disappears because there are no input sections.  */
155    . = ALIGN(32 / 8);
156    _end = .;
157    PROVIDE (end = .);
158  } >RAM /* DATA-section */
159
160  /* Sections to be placed in the code.m area.  */
161  .init          :
162  {
163    KEEP (*(.init))
164  } >RAM /* CODE-section */
165  .plt      : { *(.plt) } >RAM /* DATA-section */
166  .text      :
167  {
168    *(.text)
169    *(.text.*)
170    *(.stub)
171    /* .gnu.warning sections are handled specially by elf32.em.  */
172    *(.gnu.warning)
173    *(.gnu.linkonce.t.*)
174  } >RAM /* CODE-section */ =0
175  .vtext ALIGN(8)    :
176  {
177    *(.vtext) *(.vtext.*) *(.gnu.linkonce.v.*)
178  } >RAM /* CODE-section */
179  .fini      :
180  {
181    KEEP (*(.fini))
182    PROVIDE (__etext = .);
183    PROVIDE (_etext = .);
184    PROVIDE (etext = .);
185  } >RAM /* CODE-section */ =0
186
187  /* Sections to be placed in the romdata.m area.  */
188  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } >RAM /* DATA-section */
189  .rodata1   : { *(.rodata1) } >RAM /* DATA-section */
190
191  /* Sections to be placed in the code.l area.  */
192  .ftext : {  *(.ftext) *(.ftext.*) *(.gnu.linkonce.ft.*) } >RAM /* CODE-section */
193  .vftext ALIGN(8)    :
194  {
195    *(.vftext) *(.vftext.*) *(.gnu.linkonce.vf.*)
196  } >RAM /* CODE-section */
197
198  /* Sections to be placed in the romdata.l area.  */
199  .frodata :
200  {
201    *(.frodata) *(.frodata.*) *(.gnu.linkonce.frd.*)
202    __assert_near_size = ASSERT (. <= 0x1000000, "near section overflow");
203  } >RAM /* DATA-section */
204
205  /* Sections to be placed in the data.l area.  */
206  .far : { *(.far) *(.far.*) *(.gnu.linkonce.far.*) } >RAM /* DATA-section */
207  .farbss :
208  { PROVIDE (__farbss_start = .);
209    *(.farbss) *(.farbss.*)
210    PROVIDE (__farbss_end = .);
211  } >RAM /* DATA-section */
212
213  /* END-mep-sections */
214
215  /* begin-stack-table */
216  __stack0  = (__stack - (0 *  (__stack_size / 1)) + 15) / 16 * 16;
217
218  .rostacktab :
219  {
220    /* Emit a table describing the location of the different stacks.
221       Only 1 processor in the default configuration.  */
222    . = ALIGN(4);
223    __stack_table = .;
224    LONG (__stack0);
225    __stack_end = .;
226  } >RAM
227  /* end-stack-table */
228
229  /* begin-heap */
230  /* End of DATA is 0x00800000 + 0x00800000. That's where the heap will end.  */
231  __heap_end = 0x00800000 + 0x00800000 - 1;
232  /* end-heap */
233
234  /* Default stack size is 1M.  That's where the heap will start if there's
235     room.  If there's not enough room, allocate half of the remaining space
236     for stack and half for heap.  Align the heap on a 16 byte boundary.  */
237  __stack_size = (__stack_end + 0x100000 <= __heap_end + 1
238                  ? 0x100000
239                  : ((__heap_end + 1 - __stack_end) / 2));
240  __heap = (__stack_end + __stack_size + 15) / 16 * 16;
241
242  /* Leave 16 bytes between the stack and the heap.  */
243  __stack = __heap - 0x10;
244
245  /* Stabs debugging sections.  */
246  .stab 0 : { *(.stab) }
247  .stabstr 0 : { *(.stabstr) }
248  .stab.excl 0 : { *(.stab.excl) }
249  .stab.exclstr 0 : { *(.stab.exclstr) }
250  .stab.index 0 : { *(.stab.index) }
251  .stab.indexstr 0 : { *(.stab.indexstr) }
252  .comment 0 : { *(.comment) }
253  /* DWARF debug sections.
254     Symbols in the DWARF debugging sections are relative to the beginning
255     of the section so we begin them at 0.  */
256  /* DWARF 1 */
257  .debug          0 : { *(.debug) }
258  .line           0 : { *(.line) }
259  /* GNU DWARF 1 extensions */
260  .debug_srcinfo  0 : { *(.debug_srcinfo) }
261  .debug_sfnames  0 : { *(.debug_sfnames) }
262  /* DWARF 1.1 and DWARF 2 */
263  .debug_aranges  0 : { *(.debug_aranges) }
264  .debug_pubnames 0 : { *(.debug_pubnames) }
265  /* DWARF 2 */
266  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
267  .debug_abbrev   0 : { *(.debug_abbrev) }
268  .debug_line     0 : { *(.debug_line) }
269  .debug_frame    0 : { *(.debug_frame) }
270  .debug_str      0 : { *(.debug_str) }
271  .debug_loc      0 : { *(.debug_loc) }
272  .debug_macinfo  0 : { *(.debug_macinfo) }
273  .debug_ranges   0 : { *(.debug_ranges) }
274  /* SGI/MIPS DWARF 2 extensions */
275  .debug_weaknames 0 : { *(.debug_weaknames) }
276  .debug_funcnames 0 : { *(.debug_funcnames) }
277  .debug_typenames 0 : { *(.debug_typenames) }
278  .debug_varnames  0 : { *(.debug_varnames) }
279  /* These must appear regardless of  .  */
280}
Note: See TracBrowser for help on using the repository browser.