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