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

4.104.114.84.95
Last change on this file since 869eaa9 was 869eaa9, checked in by Joel Sherrill <joel.sherrill@…>, on 02/08/06 at 12:28:03

2006-02-08 Joel Sherrill <joel@…>

  • startup/linkcmds, startup/linkcmds.rom, startup/linkcmds.rom2ram: Add sections required by newer gcc versions.
  • Property mode set to 100644
File size: 5.7 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*)
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  . = ALIGN(16);
157  _HeapStart = . ;
158  . = . + _HeapSize ;
159  PROVIDE( _HeapEnd = . );
160
161  . = ALIGN(16);
162  _WorkSpaceStart = . ;
163  . = . + _WorkspaceSize ;
164  PROVIDE(_WorkSpaceEnd = .);
165
166  . = ALIGN(16);
167  .stack . : {
168     stack_start = .;
169     . = . + 4096;
170     stack_end = .;
171  }
172
173  . = ALIGN(16);
174  _CPU_Interrupt_stack_low  = . ;
175  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
176
177  /* Stabs debugging sections.  */
178  .stab 0 : { *(.stab) }
179  .stabstr 0 : { *(.stabstr) }
180  .stab.excl 0 : { *(.stab.excl) }
181  .stab.exclstr 0 : { *(.stab.exclstr) }
182  .stab.index 0 : { *(.stab.index) }
183  .stab.indexstr 0 : { *(.stab.indexstr) }
184  .comment 0 : { *(.comment) }
185  /* DWARF debug sections.
186     Symbols in the DWARF debugging sections are relative to the beginning
187     of the section so we begin them at 0.  */
188  /* DWARF 1 */
189  .debug          0 : { *(.debug) }
190  .line           0 : { *(.line) }
191  /* GNU DWARF 1 extensions */
192  .debug_srcinfo  0 : { *(.debug_srcinfo) }
193  .debug_sfnames  0 : { *(.debug_sfnames) }
194  /* DWARF 1.1 and DWARF 2 */
195  .debug_aranges  0 : { *(.debug_aranges) }
196  .debug_pubnames 0 : { *(.debug_pubnames) }
197  /* DWARF 2 */
198  .debug_info     0 : { *(.debug_info) }
199  .debug_abbrev   0 : { *(.debug_abbrev) }
200  .debug_line     0 : { *(.debug_line) }
201  .debug_frame    0 : { *(.debug_frame) }
202  .debug_str      0 : { *(.debug_str) }
203  .debug_loc      0 : { *(.debug_loc) }
204  .debug_macinfo  0 : { *(.debug_macinfo) }
205  /* SGI/MIPS DWARF 2 extensions */
206  .debug_weaknames 0 : { *(.debug_weaknames) }
207  .debug_funcnames 0 : { *(.debug_funcnames) }
208  .debug_typenames 0 : { *(.debug_typenames) }
209  .debug_varnames  0 : { *(.debug_varnames) }
210  .stack : { _stack = .; *(.stack) }
211  /* These must appear regardless of  .  */
212}
Note: See TracBrowser for help on using the repository browser.