source: rtems/bsps/x86_64/amd64/start/linkcmds @ e10dec0

Last change on this file since e10dec0 was e10dec0, checked in by Sebastian Huber <sebastian.huber@…>, on 04/30/21 at 13:47:10

bsps: Support RTEMS_NOINIT in linkcmds

Update #3866.

  • Property mode set to 100644
File size: 9.7 KB
Line 
1/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
2   Copying and distribution of this script, with or without modification,
3   are permitted in any medium without royalty provided the copyright
4   notice and this notice are preserved.  */
5
6/*
7 * Copy of default linker script generated with:
8 *      x86_64-rtems5-ld --verbose
9 *
10 * Changes:
11 *   - Added HeapSize, RamBase, RamSize, WorkBase
12 *   - rtemssroset section
13 *   - noinit section
14 *   - rtemsstack section
15 */
16
17OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
18          "elf64-x86-64")
19OUTPUT_ARCH(i386:x86-64)
20STARTUP(start.o)
21ENTRY(_start)
22
23HeapSize = DEFINED(HeapSize)  ? HeapSize  :
24           DEFINED(_HeapSize) ? _HeapSize : 0x0;
25RamBase = DEFINED(RamBase)    ? RamBase   :
26          DEFINED(_RamBase)   ? _RamBase  : 0x0;
27
28/* XXX: Defaulting to 1GiB.
29 */
30RamSize = DEFINED(RamSize)    ? RamSize   :
31          DEFINED(_RamSize)   ? _RamSize  : 0x40000000;
32RamEnd = RamBase + RamSize;
33
34SECTIONS
35{
36  /* Read-only sections, merged into text segment: */
37  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x00100000)); . = SEGMENT_START("text-segment", 0x00100000) + SIZEOF_HEADERS;
38  .interp         : { *(.interp) }
39  .note.gnu.build-id : { *(.note.gnu.build-id) }
40  .hash           : { *(.hash) }
41  .gnu.hash       : { *(.gnu.hash) }
42  .dynsym         : { *(.dynsym) }
43  .dynstr         : { *(.dynstr) }
44  .gnu.version    : { *(.gnu.version) }
45  .gnu.version_d  : { *(.gnu.version_d) }
46  .gnu.version_r  : { *(.gnu.version_r) }
47  .rela.dyn       :
48    {
49      *(.rela.init)
50      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
51      *(.rela.fini)
52      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
53      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
54      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
55      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
56      *(.rela.ctors)
57      *(.rela.dtors)
58      *(.rela.got)
59      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
60      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
61      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
62      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
63      *(.rela.ifunc)
64    }
65  .rela.plt       :
66    {
67      *(.rela.plt)
68      PROVIDE_HIDDEN (__rela_iplt_start = .);
69      *(.rela.iplt)
70      PROVIDE_HIDDEN (__rela_iplt_end = .);
71    }
72  .rtemsroset : {
73    /* for pre–RTEMS libbsd FreeBSD code */
74    __start_set_sysctl_set = .;
75    *(set_sysctl_*);
76    __stop_set_sysctl_set = .;
77    *(set_domain_*);
78    *(set_pseudo_*);
79
80    KEEP (*(SORT(.rtemsroset.*)))
81  } =0x90909090
82  .init           :
83  {
84    KEEP (*(SORT_NONE(.init)))
85  }
86  .plt            : { *(.plt) *(.iplt) }
87.plt.got        : { *(.plt.got) }
88.plt.sec        : { *(.plt.sec) }
89  .text           :
90  {
91    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
92    *(.text.exit .text.exit.*)
93    *(.text.startup .text.startup.*)
94    *(.text.hot .text.hot.*)
95    *(.text .stub .text.* .gnu.linkonce.t.*)
96    /* .gnu.warning sections are handled specially by elf32.em.  */
97    *(.gnu.warning)
98  }
99  .fini           :
100  {
101    KEEP (*(SORT_NONE(.fini)))
102  }
103  PROVIDE (__etext = .);
104  PROVIDE (_etext = .);
105  PROVIDE (etext = .);
106  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
107  .rodata1        : { *(.rodata1) }
108  .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
109  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
110  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
111  .gcc_except_table.*) }
112  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
113  /* These sections are generated by the Sun/Oracle C++ compiler.  */
114  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
115  .exception_ranges*) }
116  /* Adjust the address for the data segment.  We want to adjust up to
117     the same address within the page on the next page up.  */
118  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
119  /* Exception handling  */
120  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
121  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
122  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
123  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
124  /* Thread Local Storage sections  */
125  .tdata      : {
126    _TLS_Data_begin = .;
127    *(.tdata .tdata.* .gnu.linkonce.td.*)
128    _TLS_Data_end = .;
129  }
130  .tbss           : {
131    _TLS_BSS_begin = .;
132    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
133    _TLS_BSS_end = .;
134  }
135  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
136  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
137  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
138  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
139  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
140  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
141  .preinit_array     :
142  {
143    PROVIDE_HIDDEN (__preinit_array_start = .);
144    KEEP (*(.preinit_array))
145    PROVIDE_HIDDEN (__preinit_array_end = .);
146  }
147  .init_array     :
148  {
149    PROVIDE_HIDDEN (__init_array_start = .);
150    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
151    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
152    PROVIDE_HIDDEN (__init_array_end = .);
153  }
154  .fini_array     :
155  {
156    PROVIDE_HIDDEN (__fini_array_start = .);
157    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
158    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
159    PROVIDE_HIDDEN (__fini_array_end = .);
160  }
161  .ctors          :
162  {
163    /* gcc uses crtbegin.o to find the start of
164       the constructors, so we make sure it is
165       the first.  Because this is a wildcard, it
166       doesn't matter if the user does not
167       actually link against crtbegin.o; the
168       linker won't look for a file to match a
169       wildcard.  The wildcard also means that which
170       directory crtbegin.o is in doesn't matter */
171    KEEP (*crtbegin.o(.ctors))
172    KEEP (*crtbegin?.o(.ctors))
173    /* We don't want to include the .ctor section from
174       the crtend.o file until after the sorted ctors.
175       The .ctor section from the crtend file contains the
176       end of ctors marker and it must be last */
177    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
178    KEEP (*(SORT(.ctors.*)))
179    KEEP (*(.ctors))
180  }
181  .dtors          :
182  {
183    KEEP (*crtbegin.o(.dtors))
184    KEEP (*crtbegin?.o(.dtors))
185    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
186    KEEP (*(SORT(.dtors.*)))
187    KEEP (*(.dtors))
188  }
189  .jcr            : { KEEP (*(.jcr)) }
190  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
191  .dynamic        : { *(.dynamic) }
192  .got            : { *(.got) *(.igot) }
193  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
194  .got.plt        : { *(.got.plt)  *(.igot.plt) }
195  .data           :
196  {
197    *(.data .data.* .gnu.linkonce.d.*)
198    SORT(CONSTRUCTORS)
199  }
200  .data1          : { *(.data1) }
201  _edata = .; PROVIDE (edata = .);
202  . = .;
203  __bss_start = .;
204  .bss            :
205  {
206   *(.dynbss)
207   *(.bss .bss.* .gnu.linkonce.b.*)
208   *(COMMON)
209   /* Align here to ensure that the .bss section occupies space up to
210      _end.  Align after .bss to ensure correct alignment even if the
211      .bss section disappears because there are no input sections.
212      FIXME: Why do we need it? When there is no .bss section, we don't
213      pad the .data section.  */
214   . = ALIGN(. != 0 ? 64 / 8 : 1);
215  }
216  .lbss   :
217  {
218    *(.dynlbss)
219    *(.lbss .lbss.* .gnu.linkonce.lb.*)
220    *(LARGE_COMMON)
221  }
222  . = ALIGN(64 / 8);
223  . = SEGMENT_START("ldata-segment", .);
224  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
225  {
226    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
227  }
228  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
229  {
230    *(.ldata .ldata.* .gnu.linkonce.l.*)
231    . = ALIGN(. != 0 ? 64 / 8 : 1);
232  }
233  . = ALIGN(64 / 8);
234  _end = .; PROVIDE (end = .);
235  .noinit (NOLOAD) :
236  {
237    *(.noinit*)
238  }
239  .rtemsstack (NOLOAD) :
240  {
241    *(SORT(.rtemsstack.*))
242  }
243  WorkAreaBase = .;
244  . = DATA_SEGMENT_END (.);
245  /* Stabs debugging sections.  */
246
247  .stab          0 : { *(.stab) }
248  .stabstr       0 : { *(.stabstr) }
249  .stab.excl     0 : { *(.stab.excl) }
250  .stab.exclstr  0 : { *(.stab.exclstr) }
251  .stab.index    0 : { *(.stab.index) }
252  .stab.indexstr 0 : { *(.stab.indexstr) }
253  .comment       0 : { *(.comment) }
254  /* DWARF debug sections.
255     Symbols in the DWARF debugging sections are relative to the beginning
256     of the section so we begin them at 0.  */
257  /* DWARF 1 */
258  .debug          0 : { *(.debug) }
259  .line           0 : { *(.line) }
260  /* GNU DWARF 1 extensions */
261  .debug_srcinfo  0 : { *(.debug_srcinfo) }
262  .debug_sfnames  0 : { *(.debug_sfnames) }
263  /* DWARF 1.1 and DWARF 2 */
264  .debug_aranges  0 : { *(.debug_aranges) }
265  .debug_pubnames 0 : { *(.debug_pubnames) }
266  /* DWARF 2 */
267  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
268  .debug_abbrev   0 : { *(.debug_abbrev) }
269  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
270  .debug_frame    0 : { *(.debug_frame) }
271  .debug_str      0 : { *(.debug_str) }
272  .debug_loc      0 : { *(.debug_loc) }
273  .debug_macinfo  0 : { *(.debug_macinfo) }
274  /* SGI/MIPS DWARF 2 extensions */
275  .debug_weaknames 0 : { *(.debug_weaknames) }
276  .debug_funcnames 0 : { *(.debug_funcnames) }
277  .debug_typenames 0 : { *(.debug_typenames) }
278  .debug_varnames  0 : { *(.debug_varnames) }
279  /* DWARF 3 */
280  .debug_pubtypes 0 : { *(.debug_pubtypes) }
281  .debug_ranges   0 : { *(.debug_ranges) }
282  /* DWARF Extension.  */
283  .debug_macro    0 : { *(.debug_macro) }
284  .debug_addr     0 : { *(.debug_addr) }
285  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
286  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
287}
Note: See TracBrowser for help on using the repository browser.