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