source: rtems/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds @ 44d18b9

5
Last change on this file since 44d18b9 was 44d18b9, checked in by Sebastian Huber <sebastian.huber@…>, on 12/09/15 at 13:03:09

bsps: Fix some linker set descriptions

Fix broken RTEMS linker set descriptions introduced by
b618d8cfc54f84d4ed03dc7b7fa510c872e6128a.

  • Property mode set to 100644
File size: 9.2 KB
Line 
1/*
2 * Declare some sizes.
3 */
4RamBase = DEFINED(RamBase) ? RamBase : 0x000000;
5RamSize = DEFINED(RamSize) ? RamSize : 0x800000;
6HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
7StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
8
9
10/* Default linker script, for normal executables */
11OUTPUT_FORMAT("elf32-m32r", "elf32-m32r",
12              "elf32-m32r")
13OUTPUT_ARCH(m32r)
14ENTRY(_start)
15SEARCH_DIR("/home/joel/work-gnat/svn/m32r-install/m32r-elf/lib");
16SECTIONS
17{
18  /* Read-only sections, merged into text segment: */
19  PROVIDE (__executable_start = 0x100); . = 0x100;
20  .interp         : { *(.interp) }
21  .note.gnu.build-id : { *(.note.gnu.build-id) }
22  .hash           : { *(.hash) }
23  .gnu.hash       : { *(.gnu.hash) }
24  .dynsym         : { *(.dynsym) }
25  .dynstr         : { *(.dynstr) }
26  .gnu.version    : { *(.gnu.version) }
27  .gnu.version_d  : { *(.gnu.version_d) }
28  .gnu.version_r  : { *(.gnu.version_r) }
29  .rel.init       : { *(.rel.init) }
30  .rela.init      : { *(.rela.init) }
31  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
32  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
33  .rel.fini       : { *(.rel.fini) }
34  .rela.fini      : { *(.rela.fini) }
35  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
36  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
37  .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
38  .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
39  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
40  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
41  .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
42  .rela.tdata     : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
43  .rel.tbss       : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
44  .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
45  .rel.ctors      : { *(.rel.ctors) }
46  .rela.ctors     : { *(.rela.ctors) }
47  .rel.dtors      : { *(.rel.dtors) }
48  .rela.dtors     : { *(.rela.dtors) }
49  .rel.got        : { *(.rel.got) }
50  .rela.got       : { *(.rela.got) }
51  .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
52  .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
53  .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
54  .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
55  .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
56  .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
57  .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
58  .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
59  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
60  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
61  .rel.plt        : { *(.rel.plt) }
62  .rela.plt       : { *(.rela.plt) }
63  .init           :
64  {
65    KEEP (*(.init))
66  } =0
67  .plt            : { *(.plt) }
68  .text           :
69  {
70    *(.text .stub .text.* .gnu.linkonce.t.*)
71    /* .gnu.warning sections are handled specially by elf32.em.  */
72    *(.gnu.warning)
73  } =0
74  .fini           :
75  {
76    KEEP (*(.fini))
77  } =0
78  PROVIDE (__etext = .);
79  PROVIDE (_etext = .);
80  PROVIDE (etext = .);
81  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) KEEP (*(SORT(.rtemsroset.*))) }
82  .rodata1        : { *(.rodata1) }
83  .tdata : {
84    _TLS_Data_begin = .;
85    *(.tdata .tdata.* .gnu.linkonce.td.*)
86    _TLS_Data_end = .;
87  }
88  .tbss : {
89    _TLS_BSS_begin = .;
90    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
91    _TLS_BSS_end = .;
92  }
93  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
94  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
95  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
96  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
97  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
98  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
99  .sdata2         :
100  {
101    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
102  }
103  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
104  .eh_frame_hdr : { *(.eh_frame_hdr) }
105  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
106  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
107  /* Adjust the address for the data segment.  We want to adjust up to
108     the same address within the page on the next page up.  */
109  . = ALIGN(32) + (. & (32 - 1));
110  /* Exception handling  */
111  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
112  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
113  /* Thread Local Storage sections  */
114  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
115  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
116  .preinit_array     :
117  {
118    PROVIDE_HIDDEN (__preinit_array_start = .);
119    KEEP (*(.preinit_array))
120    PROVIDE_HIDDEN (__preinit_array_end = .);
121  }
122  .init_array     :
123  {
124     PROVIDE_HIDDEN (__init_array_start = .);
125     KEEP (*(SORT(.init_array.*)))
126     KEEP (*(.init_array))
127     PROVIDE_HIDDEN (__init_array_end = .);
128  }
129  .fini_array     :
130  {
131    PROVIDE_HIDDEN (__fini_array_start = .);
132    KEEP (*(.fini_array))
133    KEEP (*(SORT(.fini_array.*)))
134    PROVIDE_HIDDEN (__fini_array_end = .);
135  }
136  .ctors          :
137  {
138    /* gcc uses crtbegin.o to find the start of
139       the constructors, so we make sure it is
140       first.  Because this is a wildcard, it
141       doesn't matter if the user does not
142       actually link against crtbegin.o; the
143       linker won't look for a file to match a
144       wildcard.  The wildcard also means that it
145       doesn't matter which directory crtbegin.o
146       is in.  */
147    KEEP (*crtbegin.o(.ctors))
148    KEEP (*crtbegin?.o(.ctors))
149    /* We don't want to include the .ctor section from
150       the crtend.o file until after the sorted ctors.
151       The .ctor section from the crtend file contains the
152       end of ctors marker and it must be last */
153    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
154    KEEP (*(SORT(.ctors.*)))
155    KEEP (*(.ctors))
156  }
157  .dtors          :
158  {
159    KEEP (*crtbegin.o(.dtors))
160    KEEP (*crtbegin?.o(.dtors))
161    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
162    KEEP (*(SORT(.dtors.*)))
163    KEEP (*(.dtors))
164  }
165  .jcr            : { KEEP (*(.jcr)) }
166  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
167  .dynamic        : { *(.dynamic) }
168  .data           :
169  {
170    *(.data .data.* .gnu.linkonce.d.*)
171    KEEP (*(SORT(.rtemsrwset.*)))
172    SORT(CONSTRUCTORS)
173  }
174  .data1          : { *(.data1) }
175  .got            : { *(.got.plt) *(.got) }
176  /* We want the small data sections together, so single-instruction offsets
177     can access them all, and initialized data all before uninitialized, so
178     we can shorten the on-disk segment size.  */
179  .sdata          :
180  {
181    *(.sdata .sdata.* .gnu.linkonce.s.*)
182  }
183  _edata = .; PROVIDE (edata = .);
184  __bss_start = .;
185  .sbss           :
186  {
187    *(.dynsbss)
188    *(.sbss .sbss.* .gnu.linkonce.sb.*)
189    *(.scommon)
190  }
191  .bss            :
192  {
193   *(.dynbss)
194   *(.bss .bss.* .gnu.linkonce.b.*)
195   *(COMMON)
196   /* Align here to ensure that the .bss section occupies space up to
197      _end.  Align after .bss to ensure correct alignment even if the
198      .bss section disappears because there are no input sections.
199      FIXME: Why do we need it? When there is no .bss section, we don't
200      pad the .data section.  */
201   . = ALIGN(. != 0 ? 32 / 8 : 1);
202  }
203  . = ALIGN(32 / 8);
204  . = ALIGN(32 / 8);
205  _end = .; PROVIDE (end = .);
206  . = ALIGN(16);
207
208  . += StackSize;
209  PROVIDE (_stack = .);
210  PROVIDE (WorkAreaBase = .);
211  .  = 0x800000;
212  /* Stabs debugging sections.  */
213  .stab          0 : { *(.stab) }
214  .stabstr       0 : { *(.stabstr) }
215  .stab.excl     0 : { *(.stab.excl) }
216  .stab.exclstr  0 : { *(.stab.exclstr) }
217  .stab.index    0 : { *(.stab.index) }
218  .stab.indexstr 0 : { *(.stab.indexstr) }
219  .comment       0 : { *(.comment) }
220  /* DWARF debug sections.
221     Symbols in the DWARF debugging sections are relative to the beginning
222     of the section so we begin them at 0.  */
223  /* DWARF 1 */
224  .debug          0 : { *(.debug) }
225  .line           0 : { *(.line) }
226  /* GNU DWARF 1 extensions */
227  .debug_srcinfo  0 : { *(.debug_srcinfo) }
228  .debug_sfnames  0 : { *(.debug_sfnames) }
229  /* DWARF 1.1 and DWARF 2 */
230  .debug_aranges  0 : { *(.debug_aranges) }
231  .debug_pubnames 0 : { *(.debug_pubnames) }
232  /* DWARF 2 */
233  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
234  .debug_abbrev   0 : { *(.debug_abbrev) }
235  .debug_line     0 : { *(.debug_line) }
236  .debug_frame    0 : { *(.debug_frame) }
237  .debug_str      0 : { *(.debug_str) }
238  .debug_loc      0 : { *(.debug_loc) }
239  .debug_macinfo  0 : { *(.debug_macinfo) }
240  /* SGI/MIPS DWARF 2 extensions */
241  .debug_weaknames 0 : { *(.debug_weaknames) }
242  .debug_funcnames 0 : { *(.debug_funcnames) }
243  .debug_typenames 0 : { *(.debug_typenames) }
244  .debug_varnames  0 : { *(.debug_varnames) }
245  /* DWARF 3 */
246  .debug_pubtypes 0 : { *(.debug_pubtypes) }
247  .debug_ranges   0 : { *(.debug_ranges) }
248  /* DWARF extension */
249  .debug_macro    0 : { *(.debug_macro) }
250  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
251  /* PROVIDE (_stack = 0x800000); */
252  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
253}
Note: See TracBrowser for help on using the repository browser.