source: rtems/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds @ 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: 7.4 KB
Line 
1/*
2 * The common part of the default linker scripts for standalone
3 * executables running on a Moxie processor.
4 *
5 * Copyright (C) 2008 Anthony Green
6 *
7 * The authors hereby grant permission to use, copy, modify,
8 * distribute, and license this software and its documentation for any
9 * purpose, provided that existing copyright notices are retained in
10 * all copies and that this notice is included verbatim in any
11 * distributions. No written agreement, license, or royalty fee is
12 * required for any of the authorized uses. Modifications to this
13 * software may be copyrighted by their authors and need not follow
14 * the licensing terms described here, provided that the new terms are
15 * clearly indicated on the first page of each file where they apply.
16 */
17
18OUTPUT_FORMAT("elf32-bigmoxie")
19OUTPUT_ARCH(moxie)
20ENTRY(_start)
21
22RamBase = DEFINED(RamBase) ? RamBase : 0x00000000;
23RamSize = DEFINED(RamSize) ? RamSize : 16M;
24HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
25
26SECTIONS
27{
28  /* Read-only sections, merged into text segment: */
29  . = 0x00001000;
30  .interp     : { *(.interp)    }
31  .hash          : { *(.hash)           }
32  .dynsym        : { *(.dynsym)         }
33  .dynstr        : { *(.dynstr)         }
34  .gnu.version   : { *(.gnu.version)    }
35  .gnu.version_d   : { *(.gnu.version_d)        }
36  .gnu.version_r   : { *(.gnu.version_r)        }
37  .rel.init      : { *(.rel.init)       }
38  .rela.init     : { *(.rela.init)      }
39  .rel.text      :
40    {
41      *(.rel.text)
42      *(.rel.text.*)
43      *(.rel.gnu.linkonce.t*)
44    }
45  .rela.text     :
46    {
47      *(.rela.text)
48      *(.rela.text.*)
49      *(.rela.gnu.linkonce.t*)
50    }
51  .rel.fini      : { *(.rel.fini)       }
52  .rela.fini     : { *(.rela.fini)      }
53  .rel.rodata    :
54    {
55      *(.rel.rodata)
56      *(.rel.rodata.*)
57      *(.rel.gnu.linkonce.r*)
58    }
59  .rela.rodata   :
60    {
61      *(.rela.rodata)
62      *(.rela.rodata.*)
63      *(.rela.gnu.linkonce.r*)
64    }
65  .rel.data      :
66    {
67      *(.rel.data)
68      *(.rel.data.*)
69      *(.rel.gnu.linkonce.d*)
70    }
71  .rela.data     :
72    {
73      *(.rela.data)
74      *(.rela.data.*)
75      *(.rela.gnu.linkonce.d*)
76    }
77  .rel.ctors     : { *(.rel.ctors)      }
78  .rela.ctors    : { *(.rela.ctors)     }
79  .rel.dtors     : { *(.rel.dtors)      }
80  .rela.dtors    : { *(.rela.dtors)     }
81  .rel.got       : { *(.rel.got)                }
82  .rela.got      : { *(.rela.got)               }
83  .rel.sdata     :
84    {
85      *(.rel.sdata)
86      *(.rel.sdata.*)
87      *(.rel.gnu.linkonce.s*)
88    }
89  .rela.sdata     :
90    {
91      *(.rela.sdata)
92      *(.rela.sdata.*)
93      *(.rela.gnu.linkonce.s*)
94    }
95  .rel.sbss      : { *(.rel.sbss)               }
96  .rela.sbss     : { *(.rela.sbss)      }
97  .rel.bss       : { *(.rel.bss)                }
98  .rela.bss      : { *(.rela.bss)               }
99  .rel.plt       : { *(.rel.plt)                }
100  .rela.plt      : { *(.rela.plt)               }
101  .plt      : { *(.plt) }
102  .text      :
103  {
104    *(.text)
105    *(.text.*)
106    *(.stub)
107
108    /*
109     * Special FreeBSD sysctl sections.
110     */
111    . = ALIGN (16);
112    __start_set_sysctl_set = .;
113    *(set_sysctl_*);
114    __stop_set_sysctl_set = ABSOLUTE(.);
115    *(set_domain_*);
116    *(set_pseudo_*);
117
118    /* .gnu.warning sections are handled specially by elf32.em.  */
119    *(.gnu.warning)
120    *(.gnu.linkonce.t*)
121    *(.glue_7t) *(.glue_7)
122  } =0
123  .init          :
124  {
125    KEEP (*(.init))
126  } =0
127  _etext = .;
128  PROVIDE (etext = .);
129  .fini      :
130  {
131    KEEP (*(.fini))
132  } =0
133  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
134  .rodata1   : { *(.rodata1) }
135  .tdata : {
136    _TLS_Data_begin = .;
137    *(.tdata .tdata.* .gnu.linkonce.td.*)
138    _TLS_Data_end = .;
139  }
140  .tbss : {
141    _TLS_BSS_begin = .;
142    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
143    _TLS_BSS_end = .;
144  }
145  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
146  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
147  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
148  _TLS_Alignment = ALIGNOF (.tdata);
149  .eh_frame_hdr : { *(.eh_frame_hdr) }
150  /* Adjust the address for the data segment.  We want to adjust up to
151     the same address within the page on the next page up.  */
152  . = ALIGN(256) + (. & (256 - 1));
153  .data    :
154  {
155    *(.data)
156    *(.data.*)
157    *(.gnu.linkonce.d*)
158    SORT(CONSTRUCTORS)
159  }
160  .data1   : { *(.data1) }
161  .eh_frame : { KEEP (*(.eh_frame)) }
162  .gcc_except_table : { *(.gcc_except_table) }
163  .ctors   :
164  {
165    /* gcc uses crtbegin.o to find the start of
166       the constructors, so we make sure it is
167       first.  Because this is a wildcard, it
168       doesn't matter if the user does not
169       actually link against crtbegin.o; the
170       linker won't look for a file to match a
171       wildcard.  The wildcard also means that it
172       doesn't matter which directory crtbegin.o
173       is in.  */
174    KEEP (*crtbegin.o(.ctors))
175    /* We don't want to include the .ctor section from
176       from the crtend.o file until after the sorted ctors.
177       The .ctor section from the crtend file contains the
178       end of ctors marker and it must be last */
179    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
180    KEEP (*(SORT(.ctors.*)))
181    KEEP (*(.ctors))
182  }
183   .dtors         :
184  {
185    KEEP (*crtbegin.o(.dtors))
186    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
187    KEEP (*(SORT(.dtors.*)))
188    KEEP (*(.dtors))
189  }
190  .jcr            : { KEEP (*(.jcr)) }
191  .got           : { *(.got.plt) *(.got) }
192  .dynamic       : { *(.dynamic) }
193  /* We want the small data sections together, so single-instruction offsets
194     can access them all, and initialized data all before uninitialized, so
195     we can shorten the on-disk segment size.  */
196  .sdata     :
197  {
198    *(.sdata)
199    *(.sdata.*)
200    *(.gnu.linkonce.s.*)
201  }
202  _edata = .;
203  PROVIDE (edata = .);
204  __bss_start = .;
205  __bss_start__ = .;
206  .sbss      :
207  {
208    *(.dynsbss)
209    *(.sbss)
210    *(.sbss.*)
211    *(.scommon)
212  }
213  .bss       :
214  {
215   *(.dynbss)
216   *(.bss)
217   *(.bss.*)
218   *(COMMON)
219   /* Align here to ensure that the .bss section occupies space up to
220      _end.  Align after .bss to ensure correct alignment even if the
221      .bss section disappears because there are no input sections.  */
222   . = ALIGN(32 / 8);
223  }
224  . = ALIGN(32 / 8);
225  _end = .;
226  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
227  PROVIDE (end = .);
228  WorkAreaBase = .;
229  /* Stabs debugging sections.  */
230  .stab 0 : { *(.stab) }
231  .stabstr 0 : { *(.stabstr) }
232  .stab.excl 0 : { *(.stab.excl) }
233  .stab.exclstr 0 : { *(.stab.exclstr) }
234  .stab.index 0 : { *(.stab.index) }
235  .stab.indexstr 0 : { *(.stab.indexstr) }
236  .comment 0 : { *(.comment) }
237  /* DWARF debug sections.
238     Symbols in the DWARF debugging sections are relative to the beginning
239     of the section so we begin them at 0.  */
240  /* DWARF 1 */
241  .debug          0 : { *(.debug) }
242  .line           0 : { *(.line) }
243  /* GNU DWARF 1 extensions */
244  .debug_srcinfo  0 : { *(.debug_srcinfo) }
245  .debug_sfnames  0 : { *(.debug_sfnames) }
246  /* DWARF 1.1 and DWARF 2 */
247  .debug_aranges  0 : { *(.debug_aranges) }
248  .debug_pubnames 0 : { *(.debug_pubnames) }
249  /* DWARF 2 */
250  .debug_info     0 : { *(.debug_info) }
251  .debug_abbrev   0 : { *(.debug_abbrev) }
252  .debug_line     0 : { *(.debug_line) }
253  .debug_frame    0 : { *(.debug_frame) }
254  .debug_str      0 : { *(.debug_str) }
255  .debug_loc      0 : { *(.debug_loc) }
256  .debug_macinfo  0 : { *(.debug_macinfo) }
257  .debug_ranges   0 : { *(.debug_ranges) }
258  /* SGI/MIPS DWARF 2 extensions */
259  .debug_weaknames 0 : { *(.debug_weaknames) }
260  .debug_funcnames 0 : { *(.debug_funcnames) }
261  .debug_typenames 0 : { *(.debug_typenames) }
262  .debug_varnames  0 : { *(.debug_varnames) }
263  .stack 0x400000 : { _stack = .; *(.stack) }
264  /* These must appear regardless of  .  */
265}
Note: See TracBrowser for help on using the repository browser.