source: rtems/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 7.6 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.*) KEEP (*(SORT(.rtemsroset.*))) *(.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_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
147  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
148  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
149  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
150  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
151  .eh_frame_hdr : { *(.eh_frame_hdr) }
152  /* Adjust the address for the data segment.  We want to adjust up to
153     the same address within the page on the next page up.  */
154  . = ALIGN(256) + (. & (256 - 1));
155  .data    :
156  {
157    *(.data)
158    *(.data.*)
159    KEEP (*(SORT(.rtemsrwset.*)))
160    *(.gnu.linkonce.d*)
161    SORT(CONSTRUCTORS)
162  }
163  .data1   : { *(.data1) }
164  .eh_frame : { KEEP (*(.eh_frame)) }
165  .gcc_except_table : { *(.gcc_except_table) }
166  .ctors   :
167  {
168    /* gcc uses crtbegin.o to find the start of
169       the constructors, so we make sure it is
170       first.  Because this is a wildcard, it
171       doesn't matter if the user does not
172       actually link against crtbegin.o; the
173       linker won't look for a file to match a
174       wildcard.  The wildcard also means that it
175       doesn't matter which directory crtbegin.o
176       is in.  */
177    KEEP (*crtbegin.o(.ctors))
178    /* We don't want to include the .ctor section from
179       from the crtend.o file until after the sorted ctors.
180       The .ctor section from the crtend file contains the
181       end of ctors marker and it must be last */
182    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
183    KEEP (*(SORT(.ctors.*)))
184    KEEP (*(.ctors))
185  }
186   .dtors         :
187  {
188    KEEP (*crtbegin.o(.dtors))
189    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
190    KEEP (*(SORT(.dtors.*)))
191    KEEP (*(.dtors))
192  }
193  .jcr            : { KEEP (*(.jcr)) }
194  .got           : { *(.got.plt) *(.got) }
195  .dynamic       : { *(.dynamic) }
196  /* We want the small data sections together, so single-instruction offsets
197     can access them all, and initialized data all before uninitialized, so
198     we can shorten the on-disk segment size.  */
199  .sdata     :
200  {
201    *(.sdata)
202    *(.sdata.*)
203    *(.gnu.linkonce.s.*)
204  }
205  _edata = .;
206  PROVIDE (edata = .);
207  __bss_start = .;
208  __bss_start__ = .;
209  .sbss      :
210  {
211    *(.dynsbss)
212    *(.sbss)
213    *(.sbss.*)
214    *(.scommon)
215  }
216  .bss       :
217  {
218   *(.dynbss)
219   *(.bss)
220   *(.bss.*)
221   *(COMMON)
222   /* Align here to ensure that the .bss section occupies space up to
223      _end.  Align after .bss to ensure correct alignment even if the
224      .bss section disappears because there are no input sections.  */
225   . = ALIGN(32 / 8);
226  }
227  . = ALIGN(32 / 8);
228  _end = .;
229  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
230  PROVIDE (end = .);
231  WorkAreaBase = .;
232  /* Stabs debugging sections.  */
233  .stab 0 : { *(.stab) }
234  .stabstr 0 : { *(.stabstr) }
235  .stab.excl 0 : { *(.stab.excl) }
236  .stab.exclstr 0 : { *(.stab.exclstr) }
237  .stab.index 0 : { *(.stab.index) }
238  .stab.indexstr 0 : { *(.stab.indexstr) }
239  .comment 0 : { *(.comment) }
240  /* DWARF debug sections.
241     Symbols in the DWARF debugging sections are relative to the beginning
242     of the section so we begin them at 0.  */
243  /* DWARF 1 */
244  .debug          0 : { *(.debug) }
245  .line           0 : { *(.line) }
246  /* GNU DWARF 1 extensions */
247  .debug_srcinfo  0 : { *(.debug_srcinfo) }
248  .debug_sfnames  0 : { *(.debug_sfnames) }
249  /* DWARF 1.1 and DWARF 2 */
250  .debug_aranges  0 : { *(.debug_aranges) }
251  .debug_pubnames 0 : { *(.debug_pubnames) }
252  /* DWARF 2 */
253  .debug_info     0 : { *(.debug_info) }
254  .debug_abbrev   0 : { *(.debug_abbrev) }
255  .debug_line     0 : { *(.debug_line) }
256  .debug_frame    0 : { *(.debug_frame) }
257  .debug_str      0 : { *(.debug_str) }
258  .debug_loc      0 : { *(.debug_loc) }
259  .debug_macinfo  0 : { *(.debug_macinfo) }
260  .debug_ranges   0 : { *(.debug_ranges) }
261  /* SGI/MIPS DWARF 2 extensions */
262  .debug_weaknames 0 : { *(.debug_weaknames) }
263  .debug_funcnames 0 : { *(.debug_funcnames) }
264  .debug_typenames 0 : { *(.debug_typenames) }
265  .debug_varnames  0 : { *(.debug_varnames) }
266  .stack 0x400000 : { _stack = .; *(.stack) }
267  /* These must appear regardless of  .  */
268}
Note: See TracBrowser for help on using the repository browser.