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

4.104.114.84.95
Last change on this file since 646e0008 was 96462044, checked in by Joel Sherrill <joel.sherrill@…>, on 10/11/01 at 19:04:12

2001-10-11 Alexandra Kossovsky <sasha@…>

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