source: rtems/c/src/lib/libbsp/sh/gensh4/startup/linkcmds @ 94bbe3a4

4.104.115
Last change on this file since 94bbe3a4 was 94bbe3a4, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 20:13:21

2008-09-16 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, startup/linkcmds, startup/linkcmds.rom, startup/linkcmds.rom2ram: Use top level shared bsp_get_work_area() implementation.
  • Property mode set to 100644
File size: 6.0 KB
Line 
1/*
2 * This file contains GNU linker directives for an general SH4
3 * board.
4 *
5 * Variations in memory size and allocation can be made by
6 * overriding some values with linker command-line arguments.
7 *
8 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
9 * Author: Victor V. Vengerov <vvv@oktet.ru>
10 *
11 * The license and distribution terms for this file may be
12 * found in the file LICENSE in this distribution or at
13 *
14 * http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19
20OUTPUT_ARCH(sh)
21ENTRY(_start)
22/* Do we need any of these for elf?
23   __DYNAMIC = 0;    */
24
25_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000000;
26_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
27_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
28
29/*
30 * Area assignments:
31 *     Area 0: Flash memory, SRAM interface
32 *     Area 1: GDC
33 *     Area 2: SDRAM
34 *     Area 3-6: unused
35 */
36MEMORY
37{
38  ram           : o = 0x88100000, l = 7M
39  rom           : o = 0x80000000, l = 4M
40}
41
42SECTIONS
43{
44  /* Read-only sections, merged into text segment: */
45  .init          :
46  {
47    KEEP (*(.init))
48  } =0
49  .text      :
50  {
51    _start = .;
52    *(.text*)
53
54    /*
55     * Special FreeBSD sysctl sections.
56     */
57    . = ALIGN (16);
58    ___start_set_sysctl_set = .;
59    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
60    ___stop_set_sysctl_set = ABSOLUTE(.);
61    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
62    *(set_pseu*);   /* set_pseudo_* but name is truncated by SH-coff */
63
64    /* .gnu.warning sections are handled specially by elf32.em.  */
65    *(.gnu.warning)
66    *(.gnu.linkonce.t*)
67  } > ram
68  .rela.dyn       :
69    {
70      *(.rela.init)
71      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
72      *(.rela.fini)
73      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
74      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
75      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
76      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
77      *(.rela.ctors)
78      *(.rela.dtors)
79      *(.rela.got)
80      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
81      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
82      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
83      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
84      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
85    } >ram
86  _etext = .;
87  PROVIDE (etext = .);
88  .fini      :
89  {
90    KEEP (*(.fini))
91  } =0
92  .rodata   :
93  {
94    *(.rodata)
95    *(.rodata.*)
96    *(.gnu.linkonce.r*)
97  } > ram
98  .ctors   :
99  {
100    ___ctors = .;
101    /* gcc uses crtbegin.o to find the start of
102       the constructors, so we make sure it is
103       first.  Because this is a wildcard, it
104       doesn't matter if the user does not
105       actually link against crtbegin.o; the
106       linker won't look for a file to match a
107       wildcard.  The wildcard also means that it
108       doesn't matter which directory crtbegin.o
109       is in.  */
110    KEEP (*crtbegin.o(.ctors))
111    /* We don't want to include the .ctor section from
112       from the crtend.o file until after the sorted ctors.
113       The .ctor section from the crtend file contains the
114       end of ctors marker and it must be last */
115    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
116    KEEP (*(SORT(.ctors.*)))
117    KEEP (*(.ctors))
118    ___ctors_end = .;
119  } > ram
120   .dtors         :
121  {
122    ___dtors = .;
123    KEEP (*crtbegin.o(.dtors))
124    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
125    KEEP (*(SORT(.dtors.*)))
126    KEEP (*(.dtors))
127    ___dtors_end = .;
128    copy_start_in_rom = .;
129  } > ram
130
131  /* Adjust the address for the data segment.  We want to adjust up to
132     the same address within the page on the next page up.  */
133  . = ALIGN(128) + (. & (128 - 1));
134  .data    :
135  {
136    copy_start = .;
137    *(.data*)
138    *(.gcc_exc*)
139    ___EH_FRAME_BEGIN__ = .;
140    *(.eh_fram*)
141    ___EH_FRAME_END__ = .;
142    LONG(0);
143    *(.gcc_except_table*)
144    *(.gnu.linkonce.d*)
145    SORT(CONSTRUCTORS)
146    copy_end = .;
147  } > ram
148  .eh_frame : { *(.eh_frame) } > ram
149  /* We want the small data sections together, so single-instruction offsets
150     can access them all, and initialized data all before uninitialized, so
151     we can shorten the on-disk segment size.  */
152  .bss       :
153  {
154   __bss_start = .;
155   *(.dynbss)
156   *(.bss .bss* .gnu.linkonce.b*)
157   *(COMMON)
158   /* Align here to ensure that the .bss section occupies space up to
159      _end.  Align after .bss to ensure correct alignment even if the
160      .bss section disappears because there are no input sections.  */
161   . = ALIGN(32 / 8);
162   __bss_end = .;
163  } > ram
164
165  .stack . : {
166    . = . + 4096;
167  }
168
169  . = ALIGN(16);
170  _WorkAreaBase = . ;
171
172  . = ALIGN(16);
173  _CPU_Interrupt_stack_low  = . ;
174  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
175
176  /* Stabs debugging sections.  */
177  .stab 0 : { *(.stab) }
178  .stabstr 0 : { *(.stabstr) }
179  .stab.excl 0 : { *(.stab.excl) }
180  .stab.exclstr 0 : { *(.stab.exclstr) }
181  .stab.index 0 : { *(.stab.index) }
182  .stab.indexstr 0 : { *(.stab.indexstr) }
183  .comment 0 : { *(.comment) }
184  /* DWARF debug sections.
185     Symbols in the DWARF debugging sections are relative to the beginning
186     of the section so we begin them at 0.  */
187  /* DWARF 1 */
188  .debug          0 : { *(.debug) }
189  .line           0 : { *(.line) }
190  /* GNU DWARF 1 extensions */
191  .debug_srcinfo  0 : { *(.debug_srcinfo) }
192  .debug_sfnames  0 : { *(.debug_sfnames) }
193  /* DWARF 1.1 and DWARF 2 */
194  .debug_aranges  0 : { *(.debug_aranges) }
195  .debug_pubnames 0 : { *(.debug_pubnames) }
196  /* DWARF 2 */
197  .debug_info     0 : { *(.debug_info) }
198  .debug_abbrev   0 : { *(.debug_abbrev) }
199  .debug_line     0 : { *(.debug_line) }
200  .debug_frame    0 : { *(.debug_frame) }
201  .debug_str      0 : { *(.debug_str) }
202  .debug_loc      0 : { *(.debug_loc) }
203  .debug_macinfo  0 : { *(.debug_macinfo) }
204  /* SGI/MIPS DWARF 2 extensions */
205  .debug_weaknames 0 : { *(.debug_weaknames) }
206  .debug_funcnames 0 : { *(.debug_funcnames) }
207  .debug_typenames 0 : { *(.debug_typenames) }
208  .debug_varnames  0 : { *(.debug_varnames) }
209  .stack : { _stack = .; *(.stack) }
210  /* These must appear regardless of  .  */
211}
Note: See TracBrowser for help on using the repository browser.