Warning, /bsps/i386/pc386/start/linkcmds is written in an unsupported language. File is not indexed.
0001 /*
0002 * Copy of default "default linker script, for normal executables"
0003 * provided with binutils 2.18 with minor modifications for use
0004 * as pc386 linkcmds. These changes include:
0005 *
0006 * + sections commented out marked with "XXX commented out --joel"
0007 * + addition of m_hdr section
0008 * + addition of FreeBSD sysctl sections
0009 */
0010
0011 /*
0012 * XXX commented out --joel
0013 OUTPUT_FORMAT("elf32-i386", "elf32-i386",
0014 "elf32-i386")
0015 OUTPUT_ARCH(i386)
0016 */
0017 STARTUP(start.o)
0018 ENTRY(start)
0019 HeapSize = DEFINED(HeapSize) ? HeapSize :
0020 DEFINED(_HeapSize) ? _HeapSize : 0x0;
0021 RamSize = DEFINED(RamSize) ? RamSize :
0022 DEFINED(_RamSize) ? _RamSize : 0xFFFFFFFF;
0023
0024 SECTIONS
0025 {
0026 /* Read-only sections, merged into text segment: */
0027 /*
0028 * XXX commented out --joel
0029 PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
0030 */
0031 .interp : { *(.interp) }
0032 .note.gnu.build-id : { *(.note.gnu.build-id) }
0033 .hash : { *(.hash) }
0034 .gnu.hash : { *(.gnu.hash) }
0035 .dynsym : { *(.dynsym) }
0036 .dynstr : { *(.dynstr) }
0037 .gnu.version : { *(.gnu.version) }
0038 .gnu.version_d : { *(.gnu.version_d) }
0039 .gnu.version_r : { *(.gnu.version_r) }
0040 .rel.init : { *(.rel.init) }
0041 .rela.init : { *(.rela.init) }
0042 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
0043 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
0044 .rel.fini : { *(.rel.fini) }
0045 .rela.fini : { *(.rela.fini) }
0046 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
0047 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
0048 .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
0049 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
0050 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
0051 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
0052 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
0053 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
0054 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
0055 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
0056 .rel.ctors : { *(.rel.ctors) }
0057 .rela.ctors : { *(.rela.ctors) }
0058 .rel.dtors : { *(.rel.dtors) }
0059 .rela.dtors : { *(.rela.dtors) }
0060 .rel.got : { *(.rel.got) }
0061 .rela.got : { *(.rela.got) }
0062 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
0063 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
0064 .rel.plt : { *(.rel.plt) }
0065 .rela.plt : { *(.rela.plt) }
0066 .plt : { *(.plt) }
0067 .text :
0068 {
0069 *(.m_hdr)
0070 *(.text .stub .text.* .gnu.linkonce.t.*)
0071 KEEP (*(.text.*personality*))
0072 /* .gnu.warning sections are handled specially by elf32.em. */
0073 *(.gnu.warning)
0074
0075 } =0x90909090
0076
0077 .rtemsroset : {
0078 /* for pre rtems-libbsd FreeBSD code */
0079 __start_set_sysctl_set = .;
0080 *(set_sysctl_*);
0081 __stop_set_sysctl_set = .;
0082 *(set_domain_*);
0083 *(set_pseudo_*);
0084
0085 KEEP (*(SORT(.rtemsroset.*)))
0086 } =0x90909090
0087
0088 .init :
0089 {
0090 KEEP (*(.init))
0091 } =0x90909090
0092 .fini :
0093 {
0094 KEEP (*(.fini))
0095 } =0x90909090
0096 PROVIDE (__etext = .);
0097 PROVIDE (_etext = .);
0098 PROVIDE (etext = .);
0099 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
0100 .rodata1 : { *(.rodata1) }
0101 .tdata : {
0102 _TLS_Data_begin = .;
0103 *(.tdata .tdata.* .gnu.linkonce.td.*)
0104 _TLS_Data_end = .;
0105 }
0106 .tbss : {
0107 _TLS_BSS_begin = .;
0108 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0109 _TLS_BSS_end = .;
0110 }
0111 _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0112 _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0113 _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0114 _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0115 _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0116 _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0117 .eh_frame_hdr : { *(.eh_frame_hdr) }
0118 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
0119 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
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 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
0123 /* Exception handling */
0124 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
0125 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
0126 /* Thread Local Storage sections */
0127 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
0128 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
0129 .preinit_array :
0130 {
0131 PROVIDE_HIDDEN (__preinit_array_start = .);
0132 KEEP (*(.preinit_array))
0133 PROVIDE_HIDDEN (__preinit_array_end = .);
0134 }
0135 .init_array :
0136 {
0137 PROVIDE_HIDDEN (__init_array_start = .);
0138 KEEP (*(SORT(.init_array.*)))
0139 KEEP (*(.init_array))
0140 PROVIDE_HIDDEN (__init_array_end = .);
0141 }
0142 .fini_array :
0143 {
0144 PROVIDE_HIDDEN (__fini_array_start = .);
0145 KEEP (*(.fini_array))
0146 KEEP (*(SORT(.fini_array.*)))
0147 PROVIDE_HIDDEN (__fini_array_end = .);
0148 }
0149 .ctors :
0150 {
0151 /* gcc uses crtbegin.o to find the start of
0152 the constructors, so we make sure it is
0153 first. Because this is a wildcard, it
0154 doesn't matter if the user does not
0155 actually link against crtbegin.o; the
0156 linker won't look for a file to match a
0157 wildcard. The wildcard also means that it
0158 doesn't matter which directory crtbegin.o
0159 is in. */
0160 KEEP (*crtbegin.o(.ctors))
0161 KEEP (*crtbegin?.o(.ctors))
0162 /* We don't want to include the .ctor section from
0163 the crtend.o file until after the sorted ctors.
0164 The .ctor section from the crtend file contains the
0165 end of ctors marker and it must be last */
0166 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0167 KEEP (*(SORT(.ctors.*)))
0168 KEEP (*(.ctors))
0169 }
0170 .dtors :
0171 {
0172 KEEP (*crtbegin.o(.dtors))
0173 KEEP (*crtbegin?.o(.dtors))
0174 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0175 KEEP (*(SORT(.dtors.*)))
0176 KEEP (*(.dtors))
0177 }
0178 .jcr : { KEEP (*(.jcr)) }
0179 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
0180 .dynamic : { *(.dynamic) }
0181 .got : { *(.got) }
0182 . = DATA_SEGMENT_RELRO_END (12, .);
0183 .got.plt : { *(.got.plt) }
0184 .data :
0185 {
0186 *(.data .data.* .gnu.linkonce.d.*)
0187 KEEP (*(.gnu.linkonce.d.*personality*))
0188 SORT(CONSTRUCTORS)
0189 }
0190 .data1 : { *(.data1) }
0191 .rtemsrwset : { KEEP (*(SORT(.rtemsrwset.*))) }
0192 _edata = .; PROVIDE (edata = .);
0193 __bss_start = .;
0194 .bss :
0195 {
0196 *(.dynbss)
0197 *(.bss .bss.* .gnu.linkonce.b.*)
0198 *(COMMON)
0199 /* Align here to ensure that the .bss section occupies space up to
0200 _end. Align after .bss to ensure correct alignment even if the
0201 .bss section disappears because there are no input sections.
0202 FIXME: Why do we need it? When there is no .bss section, we don't
0203 pad the .data section. */
0204 . = ALIGN(. != 0 ? 32 / 8 : 1);
0205 }
0206 . = ALIGN(32 / 8);
0207 _end = .; PROVIDE (end = .);
0208 .noinit (NOLOAD) : {
0209 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0210 }
0211 .rtemsstack (NOLOAD) : {
0212 *(SORT(.rtemsstack.*))
0213 }
0214 WorkAreaBase = .;
0215 . = DATA_SEGMENT_END (.);
0216
0217 /* Stabs debugging sections. */
0218 .stab 0 : { *(.stab) }
0219 .stabstr 0 : { *(.stabstr) }
0220 .stab.excl 0 : { *(.stab.excl) }
0221 .stab.exclstr 0 : { *(.stab.exclstr) }
0222 .stab.index 0 : { *(.stab.index) }
0223 .stab.indexstr 0 : { *(.stab.indexstr) }
0224 .comment 0 : { *(.comment) }
0225 /* DWARF debug sections.
0226 Symbols in the DWARF debugging sections are relative to the beginning
0227 of the section so we begin them at 0. */
0228 /* DWARF 1 */
0229 .debug 0 : { *(.debug) }
0230 .line 0 : { *(.line) }
0231 /* GNU DWARF 1 extensions */
0232 .debug_srcinfo 0 : { *(.debug_srcinfo) }
0233 .debug_sfnames 0 : { *(.debug_sfnames) }
0234 /* DWARF 1.1 and DWARF 2 */
0235 .debug_aranges 0 : { *(.debug_aranges) }
0236 .debug_pubnames 0 : { *(.debug_pubnames) }
0237 /* DWARF 2 */
0238 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
0239 .debug_abbrev 0 : { *(.debug_abbrev) }
0240 .debug_line 0 : { *(.debug_line) }
0241 .debug_frame 0 : { *(.debug_frame) }
0242 .debug_str 0 : { *(.debug_str) }
0243 .debug_loc 0 : { *(.debug_loc) }
0244 .debug_macinfo 0 : { *(.debug_macinfo) }
0245 /* SGI/MIPS DWARF 2 extensions */
0246 .debug_weaknames 0 : { *(.debug_weaknames) }
0247 .debug_funcnames 0 : { *(.debug_funcnames) }
0248 .debug_typenames 0 : { *(.debug_typenames) }
0249 .debug_varnames 0 : { *(.debug_varnames) }
0250 /* DWARF 3 */
0251 .debug_pubtypes 0 : { *(.debug_pubtypes) }
0252 .debug_ranges 0 : { *(.debug_ranges) }
0253 /* DWARF extension */
0254 .debug_macro 0 : { *(.debug_macro) }
0255 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
0256 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
0257 }