Warning, /bsps/x86_64/amd64/start/linkcmds is written in an unsupported language. File is not indexed.
0001 /* Copyright (C) 2014-2018 Free Software Foundation, Inc.
0002 Copying and distribution of this script, with or without modification,
0003 are permitted in any medium without royalty provided the copyright
0004 notice and this notice are preserved. */
0005
0006 /*
0007 * Copy of default linker script generated with:
0008 * x86_64-rtems5-ld --verbose
0009 *
0010 * Changes:
0011 * - Added HeapSize, RamBase, RamSize, WorkBase
0012 * - rtemssroset section
0013 * - noinit section
0014 * - rtemsstack section
0015 * - rtemsrwset section
0016 */
0017
0018 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
0019 "elf64-x86-64")
0020 OUTPUT_ARCH(i386:x86-64)
0021 STARTUP(start.o)
0022 ENTRY(_start)
0023
0024 HeapSize = DEFINED(HeapSize) ? HeapSize :
0025 DEFINED(_HeapSize) ? _HeapSize : 0x0;
0026 RamBase = DEFINED(RamBase) ? RamBase :
0027 DEFINED(_RamBase) ? _RamBase : 0x0;
0028
0029 /* XXX: Defaulting to 1GiB.
0030 */
0031 RamSize = DEFINED(RamSize) ? RamSize :
0032 /* DEFINED(_RamSize) ? _RamSize : 0x2000000;*/ /* 32MB */
0033 DEFINED(_RamSize) ? _RamSize : 0x1000000; /* 16MB */
0034 RamEnd = RamBase + RamSize;
0035
0036 SECTIONS
0037 {
0038 /* Read-only sections, merged into text segment: */
0039 PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x00100000)); . = SEGMENT_START("text-segment", 0x00100000) + SIZEOF_HEADERS;
0040 /* .multiboot2_header : { *(.multiboot2_header) }*/
0041 .interp : { *(.interp) }
0042 .note.gnu.build-id : { *(.note.gnu.build-id) }
0043 .hash : { *(.hash) }
0044 .gnu.hash : { *(.gnu.hash) }
0045 .dynsym : { *(.dynsym) }
0046 .dynstr : { *(.dynstr) }
0047 .gnu.version : { *(.gnu.version) }
0048 .gnu.version_d : { *(.gnu.version_d) }
0049 .gnu.version_r : { *(.gnu.version_r) }
0050 .rela.dyn :
0051 {
0052 *(.rela.init)
0053 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0054 *(.rela.fini)
0055 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0056 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0057 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0058 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0059 *(.rela.ctors)
0060 *(.rela.dtors)
0061 *(.rela.got)
0062 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0063 *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
0064 *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
0065 *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
0066 *(.rela.ifunc)
0067 }
0068 .rela.plt :
0069 {
0070 *(.rela.plt)
0071 PROVIDE_HIDDEN (__rela_iplt_start = .);
0072 *(.rela.iplt)
0073 PROVIDE_HIDDEN (__rela_iplt_end = .);
0074 }
0075 .rtemsroset : {
0076 /* for preāRTEMS libbsd FreeBSD code */
0077 __start_set_sysctl_set = .;
0078 *(set_sysctl_*);
0079 __stop_set_sysctl_set = .;
0080 *(set_domain_*);
0081 *(set_pseudo_*);
0082
0083 KEEP (*(SORT(.rtemsroset.*)))
0084 } =0x90909090
0085 .init :
0086 {
0087 KEEP (*(SORT_NONE(.init)))
0088 }
0089 .plt : { *(.plt) *(.iplt) }
0090 .plt.got : { *(.plt.got) }
0091 .plt.sec : { *(.plt.sec) }
0092 .text :
0093 {
0094 KEEP (*(.multiboot2_header))
0095 *(.text.unlikely .text.*_unlikely .text.unlikely.*)
0096 *(.text.exit .text.exit.*)
0097 *(.text.startup .text.startup.*)
0098 *(.text.hot .text.hot.*)
0099 *(.text .stub .text.* .gnu.linkonce.t.*)
0100 /* .gnu.warning sections are handled specially by elf32.em. */
0101 *(.gnu.warning)
0102 }
0103 .fini :
0104 {
0105 KEEP (*(SORT_NONE(.fini)))
0106 }
0107 PROVIDE (__etext = .);
0108 PROVIDE (_etext = .);
0109 PROVIDE (etext = .);
0110 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
0111 .rodata1 : { *(.rodata1) }
0112 .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
0113 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
0114 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
0115 .gcc_except_table.*) }
0116 .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
0117 /* These sections are generated by the Sun/Oracle C++ compiler. */
0118 .exception_ranges : ONLY_IF_RO { *(.exception_ranges
0119 .exception_ranges*) }
0120 /* Adjust the address for the data segment. We want to adjust up to
0121 the same address within the page on the next page up. */
0122 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
0123 /* Exception handling */
0124 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
0125 .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
0126 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
0127 .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
0128 /* Thread Local Storage sections */
0129 .tdata : {
0130 _TLS_Data_begin = .;
0131 *(.tdata .tdata.* .gnu.linkonce.td.*)
0132 _TLS_Data_end = .;
0133 }
0134 .tbss : {
0135 _TLS_BSS_begin = .;
0136 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0137 _TLS_BSS_end = .;
0138 }
0139 _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0140 _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0141 _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0142 _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0143 _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0144 _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0145 .preinit_array :
0146 {
0147 PROVIDE_HIDDEN (__preinit_array_start = .);
0148 KEEP (*(.preinit_array))
0149 PROVIDE_HIDDEN (__preinit_array_end = .);
0150 }
0151 .init_array :
0152 {
0153 PROVIDE_HIDDEN (__init_array_start = .);
0154 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
0155 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
0156 PROVIDE_HIDDEN (__init_array_end = .);
0157 }
0158 .fini_array :
0159 {
0160 PROVIDE_HIDDEN (__fini_array_start = .);
0161 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
0162 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
0163 PROVIDE_HIDDEN (__fini_array_end = .);
0164 }
0165 .ctors :
0166 {
0167 /* gcc uses crtbegin.o to find the start of
0168 the constructors, so we make sure it is
0169 the first. Because this is a wildcard, it
0170 doesn't matter if the user does not
0171 actually link against crtbegin.o; the
0172 linker won't look for a file to match a
0173 wildcard. The wildcard also means that which
0174 directory crtbegin.o is in doesn't matter */
0175 KEEP (*crtbegin.o(.ctors))
0176 KEEP (*crtbegin?.o(.ctors))
0177 /* We don't want to include the .ctor section from
0178 the crtend.o file until after the sorted ctors.
0179 The .ctor section from the crtend file contains the
0180 end of ctors marker and it must be last */
0181 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0182 KEEP (*(SORT(.ctors.*)))
0183 KEEP (*(.ctors))
0184 }
0185 .dtors :
0186 {
0187 KEEP (*crtbegin.o(.dtors))
0188 KEEP (*crtbegin?.o(.dtors))
0189 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0190 KEEP (*(SORT(.dtors.*)))
0191 KEEP (*(.dtors))
0192 }
0193 .jcr : { KEEP (*(.jcr)) }
0194 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
0195 .dynamic : { *(.dynamic) }
0196 .got : { *(.got) *(.igot) }
0197 . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
0198 .got.plt : { *(.got.plt) *(.igot.plt) }
0199 .data :
0200 {
0201 *(.data .data.* .gnu.linkonce.d.*)
0202 SORT(CONSTRUCTORS)
0203 }
0204 .data1 : { *(.data1) }
0205 .rtemsrwset : { KEEP (*(SORT(.rtemsrwset.*))) }
0206 _edata = .; PROVIDE (edata = .);
0207 . = .;
0208 __bss_start = .;
0209 .bss :
0210 {
0211 *(.dynbss)
0212 *(.bss .bss.* .gnu.linkonce.b.*)
0213 *(COMMON)
0214 /* Align here to ensure that the .bss section occupies space up to
0215 _end. Align after .bss to ensure correct alignment even if the
0216 .bss section disappears because there are no input sections.
0217 FIXME: Why do we need it? When there is no .bss section, we don't
0218 pad the .data section. */
0219 . = ALIGN(. != 0 ? 64 / 8 : 1);
0220 }
0221 .lbss :
0222 {
0223 *(.dynlbss)
0224 *(.lbss .lbss.* .gnu.linkonce.lb.*)
0225 *(LARGE_COMMON)
0226 }
0227 . = ALIGN(64 / 8);
0228 . = SEGMENT_START("ldata-segment", .);
0229 .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
0230 {
0231 *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
0232 }
0233 .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
0234 {
0235 *(.ldata .ldata.* .gnu.linkonce.l.*)
0236 . = ALIGN(. != 0 ? 64 / 8 : 1);
0237 }
0238 . = ALIGN(64 / 8);
0239 _end = .; PROVIDE (end = .);
0240 .noinit (NOLOAD) :
0241 {
0242 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0243 }
0244 . = ALIGN(64);
0245 .rtemsstack (NOLOAD) :
0246 {
0247 *(SORT(.rtemsstack.*))
0248 }
0249 WorkAreaBase = .;
0250 . = DATA_SEGMENT_END (.);
0251 /* Stabs debugging sections. */
0252
0253 .stab 0 : { *(.stab) }
0254 .stabstr 0 : { *(.stabstr) }
0255 .stab.excl 0 : { *(.stab.excl) }
0256 .stab.exclstr 0 : { *(.stab.exclstr) }
0257 .stab.index 0 : { *(.stab.index) }
0258 .stab.indexstr 0 : { *(.stab.indexstr) }
0259 .comment 0 : { *(.comment) }
0260 /* DWARF debug sections.
0261 Symbols in the DWARF debugging sections are relative to the beginning
0262 of the section so we begin them at 0. */
0263 /* DWARF 1 */
0264 .debug 0 : { *(.debug) }
0265 .line 0 : { *(.line) }
0266 /* GNU DWARF 1 extensions */
0267 .debug_srcinfo 0 : { *(.debug_srcinfo) }
0268 .debug_sfnames 0 : { *(.debug_sfnames) }
0269 /* DWARF 1.1 and DWARF 2 */
0270 .debug_aranges 0 : { *(.debug_aranges) }
0271 .debug_pubnames 0 : { *(.debug_pubnames) }
0272 /* DWARF 2 */
0273 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
0274 .debug_abbrev 0 : { *(.debug_abbrev) }
0275 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
0276 .debug_frame 0 : { *(.debug_frame) }
0277 .debug_str 0 : { *(.debug_str) }
0278 .debug_loc 0 : { *(.debug_loc) }
0279 .debug_macinfo 0 : { *(.debug_macinfo) }
0280 /* SGI/MIPS DWARF 2 extensions */
0281 .debug_weaknames 0 : { *(.debug_weaknames) }
0282 .debug_funcnames 0 : { *(.debug_funcnames) }
0283 .debug_typenames 0 : { *(.debug_typenames) }
0284 .debug_varnames 0 : { *(.debug_varnames) }
0285 /* DWARF 3 */
0286 .debug_pubtypes 0 : { *(.debug_pubtypes) }
0287 .debug_ranges 0 : { *(.debug_ranges) }
0288 /* DWARF Extension. */
0289 .debug_macro 0 : { *(.debug_macro) }
0290 .debug_addr 0 : { *(.debug_addr) }
0291
0292 /* Addition to let linker know about custom section for GDB pretty-printing support. */
0293 .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0294
0295 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
0296 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
0297 }