source: rtems/c/src/lib/libbsp/m32r/m32rsim/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: 9.0 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.*) }
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_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
95  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
96  _TLS_Alignment = ALIGNOF (.tdata);
97  .sdata2         :
98  {
99    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
100  }
101  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
102  .eh_frame_hdr : { *(.eh_frame_hdr) }
103  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
104  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
105  /* Adjust the address for the data segment.  We want to adjust up to
106     the same address within the page on the next page up.  */
107  . = ALIGN(32) + (. & (32 - 1));
108  /* Exception handling  */
109  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
110  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
111  /* Thread Local Storage sections  */
112  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
113  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
114  .preinit_array     :
115  {
116    PROVIDE_HIDDEN (__preinit_array_start = .);
117    KEEP (*(.preinit_array))
118    PROVIDE_HIDDEN (__preinit_array_end = .);
119  }
120  .init_array     :
121  {
122     PROVIDE_HIDDEN (__init_array_start = .);
123     KEEP (*(SORT(.init_array.*)))
124     KEEP (*(.init_array))
125     PROVIDE_HIDDEN (__init_array_end = .);
126  }
127  .fini_array     :
128  {
129    PROVIDE_HIDDEN (__fini_array_start = .);
130    KEEP (*(.fini_array))
131    KEEP (*(SORT(.fini_array.*)))
132    PROVIDE_HIDDEN (__fini_array_end = .);
133  }
134  .ctors          :
135  {
136    /* gcc uses crtbegin.o to find the start of
137       the constructors, so we make sure it is
138       first.  Because this is a wildcard, it
139       doesn't matter if the user does not
140       actually link against crtbegin.o; the
141       linker won't look for a file to match a
142       wildcard.  The wildcard also means that it
143       doesn't matter which directory crtbegin.o
144       is in.  */
145    KEEP (*crtbegin.o(.ctors))
146    KEEP (*crtbegin?.o(.ctors))
147    /* We don't want to include the .ctor section from
148       the crtend.o file until after the sorted ctors.
149       The .ctor section from the crtend file contains the
150       end of ctors marker and it must be last */
151    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
152    KEEP (*(SORT(.ctors.*)))
153    KEEP (*(.ctors))
154  }
155  .dtors          :
156  {
157    KEEP (*crtbegin.o(.dtors))
158    KEEP (*crtbegin?.o(.dtors))
159    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
160    KEEP (*(SORT(.dtors.*)))
161    KEEP (*(.dtors))
162  }
163  .jcr            : { KEEP (*(.jcr)) }
164  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
165  .dynamic        : { *(.dynamic) }
166  .data           :
167  {
168    *(.data .data.* .gnu.linkonce.d.*)
169    SORT(CONSTRUCTORS)
170  }
171  .data1          : { *(.data1) }
172  .got            : { *(.got.plt) *(.got) }
173  /* We want the small data sections together, so single-instruction offsets
174     can access them all, and initialized data all before uninitialized, so
175     we can shorten the on-disk segment size.  */
176  .sdata          :
177  {
178    *(.sdata .sdata.* .gnu.linkonce.s.*)
179  }
180  _edata = .; PROVIDE (edata = .);
181  __bss_start = .;
182  .sbss           :
183  {
184    *(.dynsbss)
185    *(.sbss .sbss.* .gnu.linkonce.sb.*)
186    *(.scommon)
187  }
188  .bss            :
189  {
190   *(.dynbss)
191   *(.bss .bss.* .gnu.linkonce.b.*)
192   *(COMMON)
193   /* Align here to ensure that the .bss section occupies space up to
194      _end.  Align after .bss to ensure correct alignment even if the
195      .bss section disappears because there are no input sections.
196      FIXME: Why do we need it? When there is no .bss section, we don't
197      pad the .data section.  */
198   . = ALIGN(. != 0 ? 32 / 8 : 1);
199  }
200  . = ALIGN(32 / 8);
201  . = ALIGN(32 / 8);
202  _end = .; PROVIDE (end = .);
203  . = ALIGN(16);
204
205  . += StackSize;
206  PROVIDE (_stack = .);
207  PROVIDE (WorkAreaBase = .);
208  .  = 0x800000;
209  /* Stabs debugging sections.  */
210  .stab          0 : { *(.stab) }
211  .stabstr       0 : { *(.stabstr) }
212  .stab.excl     0 : { *(.stab.excl) }
213  .stab.exclstr  0 : { *(.stab.exclstr) }
214  .stab.index    0 : { *(.stab.index) }
215  .stab.indexstr 0 : { *(.stab.indexstr) }
216  .comment       0 : { *(.comment) }
217  /* DWARF debug sections.
218     Symbols in the DWARF debugging sections are relative to the beginning
219     of the section so we begin them at 0.  */
220  /* DWARF 1 */
221  .debug          0 : { *(.debug) }
222  .line           0 : { *(.line) }
223  /* GNU DWARF 1 extensions */
224  .debug_srcinfo  0 : { *(.debug_srcinfo) }
225  .debug_sfnames  0 : { *(.debug_sfnames) }
226  /* DWARF 1.1 and DWARF 2 */
227  .debug_aranges  0 : { *(.debug_aranges) }
228  .debug_pubnames 0 : { *(.debug_pubnames) }
229  /* DWARF 2 */
230  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
231  .debug_abbrev   0 : { *(.debug_abbrev) }
232  .debug_line     0 : { *(.debug_line) }
233  .debug_frame    0 : { *(.debug_frame) }
234  .debug_str      0 : { *(.debug_str) }
235  .debug_loc      0 : { *(.debug_loc) }
236  .debug_macinfo  0 : { *(.debug_macinfo) }
237  /* SGI/MIPS DWARF 2 extensions */
238  .debug_weaknames 0 : { *(.debug_weaknames) }
239  .debug_funcnames 0 : { *(.debug_funcnames) }
240  .debug_typenames 0 : { *(.debug_typenames) }
241  .debug_varnames  0 : { *(.debug_varnames) }
242  /* DWARF 3 */
243  .debug_pubtypes 0 : { *(.debug_pubtypes) }
244  .debug_ranges   0 : { *(.debug_ranges) }
245  /* DWARF extension */
246  .debug_macro    0 : { *(.debug_macro) }
247  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
248  /* PROVIDE (_stack = 0x800000); */
249  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
250}
Note: See TracBrowser for help on using the repository browser.