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

4.104.114.84.95
Last change on this file since 6ce599c was 6ce599c, checked in by Joel Sherrill <joel.sherrill@…>, on 10/15/01 at 18:01:50

2001-10-13 Ralf Corsepius <corsepiu@…>

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