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

4.104.114.84.95
Last change on this file since b53261f0 was b53261f0, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 20, 2003 at 8:07:34 PM

2003-01-20 Joel Sherrill <joel@…>

  • startup/linkcmds.rom, startup/linkcmds.rom2ram: Add FreeBSD sysctl() sections.
  • Property mode set to 100644
File size: 5.6 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
70    /*
71     * Special FreeBSD sysctl sections.
72     */
73    . = ALIGN (16);
74    __start_set_sysctl_set = .;
75    *(set_sysctl_*);
76    __stop_set_sysctl_set = ABSOLUTE(.);
77    *(set_domain_*);
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)
149   *(.bss.*)
150   *(COMMON)
151   /* Align here to ensure that the .bss section occupies space up to
152      _end.  Align after .bss to ensure correct alignment even if the
153      .bss section disappears because there are no input sections.  */
154   . = ALIGN(32 / 8);
155   __bss_end = .;
156  } > ram
157
158  . = ALIGN(16);
159  _HeapStart = . ;
160  . = . + _HeapSize ;
161  PROVIDE( _HeapEnd = . );
162
163  . = ALIGN(16);
164  _WorkSpaceStart = . ;
165  . = . + _WorkspaceSize ;
166  PROVIDE(_WorkSpaceEnd = .);
167
168  . = ALIGN(16);
169  .stack . : {
170     stack_start = .;
171     . = . + 4096;
172     stack_end = .;
173  }
174
175  . = ALIGN(16);
176  _CPU_Interrupt_stack_low  = . ;
177  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
178
179  /* Stabs debugging sections.  */
180  .stab 0 : { *(.stab) }
181  .stabstr 0 : { *(.stabstr) }
182  .stab.excl 0 : { *(.stab.excl) }
183  .stab.exclstr 0 : { *(.stab.exclstr) }
184  .stab.index 0 : { *(.stab.index) }
185  .stab.indexstr 0 : { *(.stab.indexstr) }
186  .comment 0 : { *(.comment) }
187  /* DWARF debug sections.
188     Symbols in the DWARF debugging sections are relative to the beginning
189     of the section so we begin them at 0.  */
190  /* DWARF 1 */
191  .debug          0 : { *(.debug) }
192  .line           0 : { *(.line) }
193  /* GNU DWARF 1 extensions */
194  .debug_srcinfo  0 : { *(.debug_srcinfo) }
195  .debug_sfnames  0 : { *(.debug_sfnames) }
196  /* DWARF 1.1 and DWARF 2 */
197  .debug_aranges  0 : { *(.debug_aranges) }
198  .debug_pubnames 0 : { *(.debug_pubnames) }
199  /* DWARF 2 */
200  .debug_info     0 : { *(.debug_info) }
201  .debug_abbrev   0 : { *(.debug_abbrev) }
202  .debug_line     0 : { *(.debug_line) }
203  .debug_frame    0 : { *(.debug_frame) }
204  .debug_str      0 : { *(.debug_str) }
205  .debug_loc      0 : { *(.debug_loc) }
206  .debug_macinfo  0 : { *(.debug_macinfo) }
207  /* SGI/MIPS DWARF 2 extensions */
208  .debug_weaknames 0 : { *(.debug_weaknames) }
209  .debug_funcnames 0 : { *(.debug_funcnames) }
210  .debug_typenames 0 : { *(.debug_typenames) }
211  .debug_varnames  0 : { *(.debug_varnames) }
212  .stack : { _stack = .; *(.stack) }
213  /* These must appear regardless of  .  */
214}
Note: See TracBrowser for help on using the repository browser.