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

4.104.114.84.95
Last change on this file since bc9037d was bc9037d, checked in by Joel Sherrill <joel.sherrill@…>, on 07/25/02 at 21:00:25

2002-07-25 Joel Sherrill <joel@…>

  • startup/linkcmds: Added EH_FRAME_BEGIN and EH_FRAME_END to remove problems linking empty main(){} with BSP.
  • Property mode set to 100644
File size: 5.1 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    *(.gcc_exc*)
110    ___EH_FRAME_BEGIN__ = .;
111    *(.eh_fram*)
112    ___EH_FRAME_END__ = .;
113    LONG(0);
114    *(.gcc_except_table)
115    *(.gnu.linkonce.d*)
116    SORT(CONSTRUCTORS)
117    copy_end = .;
118  } > ram
119  .eh_frame : { *(.eh_frame) } > ram
120  /* We want the small data sections together, so single-instruction offsets
121     can access them all, and initialized data all before uninitialized, so
122     we can shorten the on-disk segment size.  */
123  .bss       :
124  {
125   __bss_start = .;
126   *(.dynbss)
127   *(.bss)
128   *(.bss.*)
129   *(COMMON)
130   /* Align here to ensure that the .bss section occupies space up to
131      _end.  Align after .bss to ensure correct alignment even if the
132      .bss section disappears because there are no input sections.  */
133   . = ALIGN(32 / 8);
134   __bss_end = .;
135  } > ram
136
137  . = ALIGN(16);
138  _HeapStart = . ;
139  . = . + _HeapSize ;
140  PROVIDE( _HeapEnd = . );
141
142  . = ALIGN(16);
143  _WorkSpaceStart = . ;
144  . = . + _WorkspaceSize ;
145  PROVIDE(_WorkSpaceEnd = .);
146
147  . = ALIGN(16);
148  .stack . : {
149    . = . + 4096;
150  }
151
152  . = ALIGN(16);
153  _CPU_Interrupt_stack_low  = . ;
154  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
155
156  /* Stabs debugging sections.  */
157  .stab 0 : { *(.stab) }
158  .stabstr 0 : { *(.stabstr) }
159  .stab.excl 0 : { *(.stab.excl) }
160  .stab.exclstr 0 : { *(.stab.exclstr) }
161  .stab.index 0 : { *(.stab.index) }
162  .stab.indexstr 0 : { *(.stab.indexstr) }
163  .comment 0 : { *(.comment) }
164  /* DWARF debug sections.
165     Symbols in the DWARF debugging sections are relative to the beginning
166     of the section so we begin them at 0.  */
167  /* DWARF 1 */
168  .debug          0 : { *(.debug) }
169  .line           0 : { *(.line) }
170  /* GNU DWARF 1 extensions */
171  .debug_srcinfo  0 : { *(.debug_srcinfo) }
172  .debug_sfnames  0 : { *(.debug_sfnames) }
173  /* DWARF 1.1 and DWARF 2 */
174  .debug_aranges  0 : { *(.debug_aranges) }
175  .debug_pubnames 0 : { *(.debug_pubnames) }
176  /* DWARF 2 */
177  .debug_info     0 : { *(.debug_info) }
178  .debug_abbrev   0 : { *(.debug_abbrev) }
179  .debug_line     0 : { *(.debug_line) }
180  .debug_frame    0 : { *(.debug_frame) }
181  .debug_str      0 : { *(.debug_str) }
182  .debug_loc      0 : { *(.debug_loc) }
183  .debug_macinfo  0 : { *(.debug_macinfo) }
184  /* SGI/MIPS DWARF 2 extensions */
185  .debug_weaknames 0 : { *(.debug_weaknames) }
186  .debug_funcnames 0 : { *(.debug_funcnames) }
187  .debug_typenames 0 : { *(.debug_typenames) }
188  .debug_varnames  0 : { *(.debug_varnames) }
189  .stack : { _stack = .; *(.stack) }
190  /* These must appear regardless of  .  */
191}
Note: See TracBrowser for help on using the repository browser.