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

4.104.114.84.95
Last change on this file since 5850c533 was 5850c533, checked in by Joel Sherrill <joel.sherrill@…>, on 10/26/01 at 13:41:07

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

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