source: rtems/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram @ f3323e1

4.104.114.84.95
Last change on this file since f3323e1 was f3323e1, checked in by Joel Sherrill <joel.sherrill@…>, on 06/25/06 at 00:36:29

2006-06-24 Joel Sherrill <joel@…>

  • startup/linkcmds, startup/linkcmds.rom, startup/linkcmds.rom2ram: Add .rela.dyn sections.
  • Property mode set to 100644
File size: 6.4 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_FORMAT("elf32-shl", "elf32-shl",
21              "elf32-shl")
22OUTPUT_ARCH(sh)
23ENTRY(_start)
24/* Do we need any of these for elf?
25   __DYNAMIC = 0;    */
26
27_HeapSize = DEFINED(_HeapSize) ? _HeapSize : (2 * 1024 * 1024);
28_WorkspaceSize = DEFINED(_WorkspaceSize) ? _WorkspaceSize : (1024 * 1024);
29
30/*
31 * Area assignments:
32 *     Area 0: Flash memory, SRAM interface
33 *     Area 1: GDC
34 *     Area 2: SDRAM
35 *     Area 3-6: unused
36 */
37MEMORY
38{
39/*
40 * Real values
41 */
42  ram           : o = 0x88000000, l = 8M
43  rom           : o = 0x80000000, l = 4M
44/*
45 * Fake values to test from gdb
46 */
47/*
48  ram           : o = 0x88100000, l = 4M
49  rom           : o = 0x88500000, l = 3M
50*/
51}
52
53SECTIONS
54{
55  rom : {
56    copy_start_in_rom = .;
57  } >rom
58
59  /* Read-only sections, merged into text segment: */
60  .init          :
61  {
62    KEEP (*(.init))
63  } =0
64  .text      : AT(copy_start_in_rom)
65  {
66    copy_start = .;
67    *(.text*)
68
69    /*
70     * Special FreeBSD sysctl sections.
71     */
72    . = ALIGN (16);
73    ___start_set_sysctl_set = .;
74    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
75    ___stop_set_sysctl_set = ABSOLUTE(.);
76    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
77    *(set_pseudo_*);
78
79    /* .gnu.warning sections are handled specially by elf32.em.  */
80    *(.gnu.warning)
81    *(.gnu.linkonce.t*)
82  } > ram
83  _etext = .;
84  PROVIDE (etext = .);
85  .fini      :
86  {
87    KEEP (*(.fini))
88  } =0
89  .rodata   :  AT(LOADADDR(.text) + SIZEOF(.text))
90  {
91    *(.rodata)
92    *(.rodata.*)
93    *(.gnu.linkonce.r*)
94    . = ALIGN(32);
95  } > ram
96  .ctors   :  AT(LOADADDR(.rodata) + SIZEOF(.rodata))
97  {
98    ___ctors = .;
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    ___ctors_end = .;
117  } > ram
118   .dtors         : AT(LOADADDR(.ctors) + SIZEOF(.ctors))
119  {
120    ___dtors = .;
121    KEEP (*crtbegin.o(.dtors))
122    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
123    KEEP (*(SORT(.dtors.*)))
124    KEEP (*(.dtors))
125    ___dtors_end = .;
126  } > ram
127
128  /* Adjust the address for the data segment.  We want to adjust up to
129     the same address within the page on the next page up.  */
130  . = ALIGN(128) + (. & (128 - 1));
131  .data     : AT(LOADADDR(.dtors) + SIZEOF(.dtors))
132  {
133    *(.data)
134    *(.data.*)
135    *(.gnu.linkonce.d*)
136    SORT(CONSTRUCTORS)
137    copy_end = .;
138  } > ram
139  .eh_frame : { *(.eh_frame) } > ram
140  /* We want the small data sections together, so single-instruction offsets
141     can access them all, and initialized data all before uninitialized, so
142     we can shorten the on-disk segment size.  */
143  .bss       :
144  {
145   __bss_start = .;
146   *(.dynbss)
147   *(.bss .bss* .gnu.linkonce.b*)
148   *(COMMON)
149   /* Align here to ensure that the .bss section occupies space up to
150      _end.  Align after .bss to ensure correct alignment even if the
151      .bss section disappears because there are no input sections.  */
152   . = ALIGN(32 / 8);
153   __bss_end = .;
154  } > ram
155
156  .rela.dyn       :
157    {
158      *(.rela.init)
159      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
160      *(.rela.fini)
161      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
162      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
163      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
164      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
165      *(.rela.ctors)
166      *(.rela.dtors)
167      *(.rela.got)
168      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
169      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
170      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
171      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
172      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
173    } >ram
174  . = ALIGN(16);
175  _HeapStart = . ;
176  . = . + _HeapSize ;
177  PROVIDE( _HeapEnd = . );
178
179  . = ALIGN(16);
180  _WorkSpaceStart = . ;
181  . = . + _WorkspaceSize ;
182  PROVIDE(_WorkSpaceEnd = .);
183
184  . = ALIGN(16);
185  .stack . : {
186     stack_start = .;
187     . = . + 4096;
188     stack_end = .;
189  }
190
191  . = ALIGN(16);
192  _CPU_Interrupt_stack_low  = . ;
193  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
194
195  /* Stabs debugging sections.  */
196  .stab 0 : { *(.stab) }
197  .stabstr 0 : { *(.stabstr) }
198  .stab.excl 0 : { *(.stab.excl) }
199  .stab.exclstr 0 : { *(.stab.exclstr) }
200  .stab.index 0 : { *(.stab.index) }
201  .stab.indexstr 0 : { *(.stab.indexstr) }
202  .comment 0 : { *(.comment) }
203  /* DWARF debug sections.
204     Symbols in the DWARF debugging sections are relative to the beginning
205     of the section so we begin them at 0.  */
206  /* DWARF 1 */
207  .debug          0 : { *(.debug) }
208  .line           0 : { *(.line) }
209  /* GNU DWARF 1 extensions */
210  .debug_srcinfo  0 : { *(.debug_srcinfo) }
211  .debug_sfnames  0 : { *(.debug_sfnames) }
212  /* DWARF 1.1 and DWARF 2 */
213  .debug_aranges  0 : { *(.debug_aranges) }
214  .debug_pubnames 0 : { *(.debug_pubnames) }
215  /* DWARF 2 */
216  .debug_info     0 : { *(.debug_info) }
217  .debug_abbrev   0 : { *(.debug_abbrev) }
218  .debug_line     0 : { *(.debug_line) }
219  .debug_frame    0 : { *(.debug_frame) }
220  .debug_str      0 : { *(.debug_str) }
221  .debug_loc      0 : { *(.debug_loc) }
222  .debug_macinfo  0 : { *(.debug_macinfo) }
223  /* SGI/MIPS DWARF 2 extensions */
224  .debug_weaknames 0 : { *(.debug_weaknames) }
225  .debug_funcnames 0 : { *(.debug_funcnames) }
226  .debug_typenames 0 : { *(.debug_typenames) }
227  .debug_varnames  0 : { *(.debug_varnames) }
228  .stack : { _stack = .; *(.stack) }
229  /* These must appear regardless of  .  */
230}
Note: See TracBrowser for help on using the repository browser.