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

5
Last change on this file since 0989001 was 5f5bbd1, checked in by Sebastian Huber <sebastian.huber@…>, on 11/16/18 at 07:55:30

bsps/x86_64: Use interrupt stack for init stack

Update #3459.

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