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

4.104.114.84.95
Last change on this file since 99159ec6 was 9c1133e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/20/03 at 19:57:14

mkChangeLogList [-n]

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