source: rtems/c/src/lib/libbsp/sh/gensh4/startup/linkcmds @ c1368b9

4.104.114.84.95
Last change on this file since c1368b9 was 6b366f73, checked in by Joel Sherrill <joel.sherrill@…>, on 10/29/01 at 14:28:48

2001-10-29 Joel Sherrill <joel@…>

  • startup/linkcmds: Remove explicit force of output format.
  • Property mode set to 100644
File size: 5.0 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_ARCH(sh)
21ENTRY(_start)
22/* Do we need any of these for elf?
23   __DYNAMIC = 0;    */
24
25_HeapSize = DEFINED(_HeapSize) ? _HeapSize : (2 * 1024 * 1024);
26_WorkspaceSize = DEFINED(_WorkspaceSize) ? _WorkspaceSize : (1024 * 1024);
27
28/*
29 * Area assignments:
30 *     Area 0: Flash memory, SRAM interface
31 *     Area 1: GDC
32 *     Area 2: SDRAM
33 *     Area 3-6: unused
34 */
35MEMORY
36{
37  ram           : o = 0x88100000, l = 7M
38  rom           : o = 0x80000000, l = 4M
39}
40
41SECTIONS
42{
43  /* Read-only sections, merged into text segment: */
44  .init          :
45  {
46    KEEP (*(.init))
47  } =0
48  .text      :
49  {
50    *(.text)
51    *(.text.*)
52    /* .gnu.warning sections are handled specially by elf32.em.  */
53    *(.gnu.warning)
54    *(.gnu.linkonce.t*)
55  } > ram
56  _etext = .;
57  PROVIDE (etext = .);
58  .fini      :
59  {
60    KEEP (*(.fini))
61  } =0
62  .rodata   :
63  {
64    *(.rodata)
65    *(.rodata.*)
66    *(.gnu.linkonce.r*)
67  } > ram
68  .ctors   :
69  {
70    ___ctors = .;
71    /* gcc uses crtbegin.o to find the start of
72       the constructors, so we make sure it is
73       first.  Because this is a wildcard, it
74       doesn't matter if the user does not
75       actually link against crtbegin.o; the
76       linker won't look for a file to match a
77       wildcard.  The wildcard also means that it
78       doesn't matter which directory crtbegin.o
79       is in.  */
80    KEEP (*crtbegin.o(.ctors))
81    /* We don't want to include the .ctor section from
82       from the crtend.o file until after the sorted ctors.
83       The .ctor section from the crtend file contains the
84       end of ctors marker and it must be last */
85    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
86    KEEP (*(SORT(.ctors.*)))
87    KEEP (*(.ctors))
88    ___ctors_end = .;
89  } > ram
90   .dtors         :
91  {
92    ___dtors = .;
93    KEEP (*crtbegin.o(.dtors))
94    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
95    KEEP (*(SORT(.dtors.*)))
96    KEEP (*(.dtors))
97    ___dtors_end = .;
98    copy_start_in_rom = .;
99  } > ram
100
101  /* Adjust the address for the data segment.  We want to adjust up to
102     the same address within the page on the next page up.  */
103  . = ALIGN(128) + (. & (128 - 1));
104  .data    :
105  {
106    copy_start = .;
107    *(.data)
108    *(.data.*)
109    *(.gnu.linkonce.d*)
110    SORT(CONSTRUCTORS)
111    copy_end = .;
112  } > ram
113  .eh_frame : { *(.eh_frame) } > ram
114  /* We want the small data sections together, so single-instruction offsets
115     can access them all, and initialized data all before uninitialized, so
116     we can shorten the on-disk segment size.  */
117  .bss       :
118  {
119   __bss_start = .;
120   *(.dynbss)
121   *(.bss)
122   *(.bss.*)
123   *(COMMON)
124   /* Align here to ensure that the .bss section occupies space up to
125      _end.  Align after .bss to ensure correct alignment even if the
126      .bss section disappears because there are no input sections.  */
127   . = ALIGN(32 / 8);
128   __bss_end = .;
129  } > ram
130
131  . = ALIGN(16);
132  _HeapStart = . ;
133  . = . + _HeapSize ;
134  PROVIDE( _HeapEnd = . );
135
136  . = ALIGN(16);
137  _WorkSpaceStart = . ;
138  . = . + _WorkspaceSize ;
139  PROVIDE(_WorkSpaceEnd = .);
140
141  . = ALIGN(16);
142  .stack . : {
143    . = . + 4096;
144  }
145
146  . = ALIGN(16);
147  _CPU_Interrupt_stack_low  = . ;
148  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
149
150  /* Stabs debugging sections.  */
151  .stab 0 : { *(.stab) }
152  .stabstr 0 : { *(.stabstr) }
153  .stab.excl 0 : { *(.stab.excl) }
154  .stab.exclstr 0 : { *(.stab.exclstr) }
155  .stab.index 0 : { *(.stab.index) }
156  .stab.indexstr 0 : { *(.stab.indexstr) }
157  .comment 0 : { *(.comment) }
158  /* DWARF debug sections.
159     Symbols in the DWARF debugging sections are relative to the beginning
160     of the section so we begin them at 0.  */
161  /* DWARF 1 */
162  .debug          0 : { *(.debug) }
163  .line           0 : { *(.line) }
164  /* GNU DWARF 1 extensions */
165  .debug_srcinfo  0 : { *(.debug_srcinfo) }
166  .debug_sfnames  0 : { *(.debug_sfnames) }
167  /* DWARF 1.1 and DWARF 2 */
168  .debug_aranges  0 : { *(.debug_aranges) }
169  .debug_pubnames 0 : { *(.debug_pubnames) }
170  /* DWARF 2 */
171  .debug_info     0 : { *(.debug_info) }
172  .debug_abbrev   0 : { *(.debug_abbrev) }
173  .debug_line     0 : { *(.debug_line) }
174  .debug_frame    0 : { *(.debug_frame) }
175  .debug_str      0 : { *(.debug_str) }
176  .debug_loc      0 : { *(.debug_loc) }
177  .debug_macinfo  0 : { *(.debug_macinfo) }
178  /* SGI/MIPS DWARF 2 extensions */
179  .debug_weaknames 0 : { *(.debug_weaknames) }
180  .debug_funcnames 0 : { *(.debug_funcnames) }
181  .debug_typenames 0 : { *(.debug_typenames) }
182  .debug_varnames  0 : { *(.debug_varnames) }
183  .stack : { _stack = .; *(.stack) }
184  /* These must appear regardless of  .  */
185}
Note: See TracBrowser for help on using the repository browser.