source: rtems/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom @ 960fd85

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

  • Property mode set to 100644
File size: 6.6 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.rtems.com/license/LICENSE.
15 */
16
17
18OUTPUT_FORMAT("elf32-shl", "elf32-shl",
19              "elf32-shl")
20OUTPUT_ARCH(sh)
21ENTRY(_start)
22/* Do we need any of these for elf?
23   __DYNAMIC = 0;    */
24
25_RamBase = DEFINED(_RamBase) ? _RamBase : 0x88000000;
26_RamSize = DEFINED(_RamSize) ? _RamSize : 8M;
27_HeapSize = DEFINED(_HeapSize) ? _HeapSize : (2 * 1024 * 1024);
28
29/*
30 * Area assignments:
31 *     Area 0: Flash memory, SRAM interface
32 *     Area 1: GDC
33 *     Area 2: SDRAM
34 *     Area 3-6: unused
35 */
36MEMORY
37{
38/*
39 * Real values
40 */
41  ram           : o = 0x88000000, l = 8M
42  rom           : o = 0x80000000, l = 4M
43/*
44 * Fake values to test from gdb
45 */
46/*
47  ram           : o = 0x88100000, l = 4M
48  rom           : o = 0x88500000, l = 3M
49*/
50}
51
52SECTIONS
53{
54  /* Read-only sections, merged into text segment: */
55  .init          :
56  {
57    KEEP (*(.init))
58  } =0
59  .text      :
60  {
61    *(.text*)
62
63    /*
64     * Special FreeBSD sysctl sections.
65     */
66    . = ALIGN (16);
67    ___start_set_sysctl_set = .;
68    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
69    ___stop_set_sysctl_set = ABSOLUTE(.);
70    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
71    *(set_pseudo_*);
72
73    /* .gnu.warning sections are handled specially by elf32.em.  */
74    *(.gnu.warning)
75    *(.gnu.linkonce.t*)
76  } > rom
77  _etext = .;
78  PROVIDE (etext = .);
79  .rela.dyn       :
80    {
81      *(.rela.init)
82      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
83      *(.rela.fini)
84      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
85      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
86      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
87      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
88      *(.rela.ctors)
89      *(.rela.dtors)
90      *(.rela.got)
91      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
92      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
93      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
94      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
95      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
96    } >ram
97  .fini      :
98  {
99    KEEP (*(.fini))
100  } =0
101  .rodata   :
102  {
103    *(.rodata)
104    *(.rodata.*)
105    *(.gnu.linkonce.r*)
106    . = ALIGN(32);
107  } > rom
108  .tdata : {
109    __TLS_Data_begin = .;
110    *(.tdata .tdata.* .gnu.linkonce.td.*)
111    __TLS_Data_end = .;
112  } > rom
113  .tbss : {
114    __TLS_BSS_begin = .;
115    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
116    __TLS_BSS_end = .;
117  } > rom
118  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
119  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
120  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
121  __TLS_Alignment = ALIGNOF (.tdata);
122  .ctors   :
123  {
124    ___ctors = .;
125    /* gcc uses crtbegin.o to find the start of
126       the constructors, so we make sure it is
127       first.  Because this is a wildcard, it
128       doesn't matter if the user does not
129       actually link against crtbegin.o; the
130       linker won't look for a file to match a
131       wildcard.  The wildcard also means that it
132       doesn't matter which directory crtbegin.o
133       is in.  */
134    KEEP (*crtbegin.o(.ctors))
135    /* We don't want to include the .ctor section from
136       from the crtend.o file until after the sorted ctors.
137       The .ctor section from the crtend file contains the
138       end of ctors marker and it must be last */
139    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
140    KEEP (*(SORT(.ctors.*)))
141    KEEP (*(.ctors))
142    ___ctors_end = .;
143  } > rom
144   .dtors         :
145  {
146    ___dtors = .;
147    KEEP (*crtbegin.o(.dtors))
148    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
149    KEEP (*(SORT(.dtors.*)))
150    KEEP (*(.dtors))
151    ___dtors_end = .;
152    copy_start_in_rom = .;
153  } > rom
154
155  /* Adjust the address for the data segment.  We want to adjust up to
156     the same address within the page on the next page up.  */
157  . = ALIGN(128) + (. & (128 - 1));
158  .data     : AT(LOADADDR(.dtors) + SIZEOF(.dtors))
159  {
160    copy_start = .;
161    *(.data)
162    *(.data.*)
163    *(.gnu.linkonce.d*)
164    SORT(CONSTRUCTORS)
165    copy_end = .;
166  } > ram
167  .eh_frame : { *(.eh_frame) } > ram
168  /* We want the small data sections together, so single-instruction offsets
169     can access them all, and initialized data all before uninitialized, so
170     we can shorten the on-disk segment size.  */
171  .bss       :
172  {
173   __bss_start = .;
174   *(.dynbss)
175   *(.bss .bss* .gnu.linkonce.b*)
176   *(COMMON)
177   /* Align here to ensure that the .bss section occupies space up to
178      _end.  Align after .bss to ensure correct alignment even if the
179      .bss section disappears because there are no input sections.  */
180   . = ALIGN(32 / 8);
181   __bss_end = .;
182  } > ram
183
184  . = ALIGN(16);
185  _WorkAreaBase = . ;
186
187  . = ALIGN(16);
188  .stack . : {
189     stack_start = .;
190     . = . + 4096;
191     stack_end = .;
192  }
193
194  . = ALIGN(16);
195  _CPU_Interrupt_stack_low  = . ;
196  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
197
198  /* Stabs debugging sections.  */
199  .stab 0 : { *(.stab) }
200  .stabstr 0 : { *(.stabstr) }
201  .stab.excl 0 : { *(.stab.excl) }
202  .stab.exclstr 0 : { *(.stab.exclstr) }
203  .stab.index 0 : { *(.stab.index) }
204  .stab.indexstr 0 : { *(.stab.indexstr) }
205  .comment 0 : { *(.comment) }
206  /* DWARF debug sections.
207     Symbols in the DWARF debugging sections are relative to the beginning
208     of the section so we begin them at 0.  */
209  /* DWARF 1 */
210  .debug          0 : { *(.debug) }
211  .line           0 : { *(.line) }
212  /* GNU DWARF 1 extensions */
213  .debug_srcinfo  0 : { *(.debug_srcinfo) }
214  .debug_sfnames  0 : { *(.debug_sfnames) }
215  /* DWARF 1.1 and DWARF 2 */
216  .debug_aranges  0 : { *(.debug_aranges) }
217  .debug_pubnames 0 : { *(.debug_pubnames) }
218  /* DWARF 2 */
219  .debug_info     0 : { *(.debug_info) }
220  .debug_abbrev   0 : { *(.debug_abbrev) }
221  .debug_line     0 : { *(.debug_line) }
222  .debug_frame    0 : { *(.debug_frame) }
223  .debug_str      0 : { *(.debug_str) }
224  .debug_loc      0 : { *(.debug_loc) }
225  .debug_macinfo  0 : { *(.debug_macinfo) }
226  /* SGI/MIPS DWARF 2 extensions */
227  .debug_weaknames 0 : { *(.debug_weaknames) }
228  .debug_funcnames 0 : { *(.debug_funcnames) }
229  .debug_typenames 0 : { *(.debug_typenames) }
230  .debug_varnames  0 : { *(.debug_varnames) }
231  .stack : { _stack = .; *(.stack) }
232  /* These must appear regardless of  .  */
233}
Note: See TracBrowser for help on using the repository browser.