ldscript.amd64 revision 129824
11553Srgrimes/* $FreeBSD: head/sys/conf/ldscript.amd64 129824 2004-05-29 01:09:00Z tjr $ */
21553SrgrimesOUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
31553SrgrimesOUTPUT_ARCH(i386:x86-64)
41553SrgrimesENTRY(btext)
51553SrgrimesSEARCH_DIR("/usr/lib");
61553SrgrimesSECTIONS
71553Srgrimes{
81553Srgrimes  /* Read-only sections, merged into text segment: */
91553Srgrimes  . = kernbase + 0x00100000 + SIZEOF_HEADERS;
101553Srgrimes  .interp         : { *(.interp) }
111553Srgrimes  .hash           : { *(.hash) }
121553Srgrimes  .dynsym         : { *(.dynsym) }
131553Srgrimes  .dynstr         : { *(.dynstr) }
141553Srgrimes  .gnu.version    : { *(.gnu.version) }
151553Srgrimes  .gnu.version_d  : { *(.gnu.version_d) }
161553Srgrimes  .gnu.version_r  : { *(.gnu.version_r) }
171553Srgrimes  .rel.init       : { *(.rel.init) }
181553Srgrimes  .rela.init      : { *(.rela.init) }
191553Srgrimes  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
201553Srgrimes  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
211553Srgrimes  .rel.fini       : { *(.rel.fini) }
221553Srgrimes  .rela.fini      : { *(.rela.fini) }
231553Srgrimes  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
241553Srgrimes  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
251553Srgrimes  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
261553Srgrimes  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
271553Srgrimes  .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
281553Srgrimes  .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
291553Srgrimes  .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
30114601Sobrien  .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
311553Srgrimes  .rel.ctors      : { *(.rel.ctors) }
3228643Ssteve  .rela.ctors     : { *(.rela.ctors) }
331553Srgrimes  .rel.dtors      : { *(.rel.dtors) }
341553Srgrimes  .rela.dtors     : { *(.rela.dtors) }
351553Srgrimes  .rel.got        : { *(.rel.got) }
361553Srgrimes  .rela.got       : { *(.rela.got) }
371553Srgrimes  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
381553Srgrimes  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
39114601Sobrien  .rel.plt        : { *(.rel.plt) }
4028643Ssteve  .rela.plt       : { *(.rela.plt) }
41119856Scharnier  .init           :
4299141Sjmallett  {
4399141Sjmallett    KEEP (*(.init))
4499141Sjmallett  } =0x90909090
451553Srgrimes  .plt            : { *(.plt) }
461553Srgrimes  .text           :
471553Srgrimes  {
481553Srgrimes    *(.text .stub .text.* .gnu.linkonce.t.*)
491553Srgrimes    /* .gnu.warning sections are handled specially by elf32.em.  */
501553Srgrimes    *(.gnu.warning)
511553Srgrimes  } =0x90909090
52108443Sobrien  .fini           :
531553Srgrimes  {
54114005Sjohan    KEEP (*(.fini))
551553Srgrimes  } =0x90909090
561553Srgrimes  PROVIDE (__etext = .);
571553Srgrimes  PROVIDE (_etext = .);
581553Srgrimes  PROVIDE (etext = .);
591553Srgrimes  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
6099141Sjmallett  .rodata1        : { *(.rodata1) }
6199141Sjmallett  .eh_frame_hdr : { *(.eh_frame_hdr) }
6299141Sjmallett  /* Adjust the address for the data segment.  We want to adjust up to
63119856Scharnier     the same address within the page on the next page up.  */
6499141Sjmallett  . = DATA_SEGMENT_ALIGN(0x100000, 0x1000);
651553Srgrimes  /* Ensure the __preinit_array_start label is properly aligned.  We
661553Srgrimes     could instead move the label definition inside the section, but
671553Srgrimes     the linker would then create the section even if it turns out to
6883410Sru     be empty, which isn't pretty.  */
6983410Sru  . = ALIGN(64 / 8);
701553Srgrimes  PROVIDE (__preinit_array_start = .);
711553Srgrimes  .preinit_array     : { *(.preinit_array) }
7299141Sjmallett  PROVIDE (__preinit_array_end = .);
731553Srgrimes  PROVIDE (__init_array_start = .);
741553Srgrimes  .init_array     : { *(.init_array) }
751553Srgrimes  PROVIDE (__init_array_end = .);
76204165Sgavin  PROVIDE (__fini_array_start = .);
7783410Sru  .fini_array     : { *(.fini_array) }
781553Srgrimes  PROVIDE (__fini_array_end = .);
798857Srgrimes  .data           :
80108443Sobrien  {
818857Srgrimes    *(.data .data.* .gnu.linkonce.d.*)
82204165Sgavin    SORT(CONSTRUCTORS)
83204165Sgavin  }
841553Srgrimes  .data1          : { *(.data1) }
851553Srgrimes  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
861553Srgrimes  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
8783410Sru  .eh_frame       : { KEEP (*(.eh_frame)) }
881553Srgrimes  .gcc_except_table   : { *(.gcc_except_table) }
891553Srgrimes  .dynamic        : { *(.dynamic) }
901553Srgrimes  _start_ctors = .;
9183410Sru  PROVIDE (start_ctors = .);
921553Srgrimes  .ctors          :
931553Srgrimes  {
941553Srgrimes    /* gcc uses crtbegin.o to find the start of
951553Srgrimes       the constructors, so we make sure it is
961553Srgrimes       first.  Because this is a wildcard, it
971553Srgrimes       doesn't matter if the user does not
981553Srgrimes       actually link against crtbegin.o; the
991553Srgrimes       linker won't look for a file to match a
1001553Srgrimes       wildcard.  The wildcard also means that it
1011553Srgrimes       doesn't matter which directory crtbegin.o
1021553Srgrimes       is in.  */
1031553Srgrimes    KEEP (*crtbegin.o(.ctors))
1041553Srgrimes    /* We don't want to include the .ctor section from
10557830Sobrien       from the crtend.o file until after the sorted ctors.
106114005Sjohan       The .ctor section from the crtend file contains the
10757830Sobrien       end of ctors marker and it must be last */
108204165Sgavin    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
109204165Sgavin    KEEP (*(SORT(.ctors.*)))
110204165Sgavin    KEEP (*(.ctors))
1111553Srgrimes  }
1121553Srgrimes  _stop_ctors = .;
1131553Srgrimes  PROVIDE (stop_ctors = .);
1141553Srgrimes  .dtors          :
1151553Srgrimes  {
1161553Srgrimes    KEEP (*crtbegin.o(.dtors))
1171553Srgrimes    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
1181553Srgrimes    KEEP (*(SORT(.dtors.*)))
1191553Srgrimes    KEEP (*(.dtors))
1201553Srgrimes  }
1211553Srgrimes  .jcr            : { KEEP (*(.jcr)) }
12277333Sru  .got            : { *(.got.plt) *(.got) }
12383410Sru  _edata = .;
12483410Sru  PROVIDE (edata = .);
12583410Sru  __bss_start = .;
1261553Srgrimes  .bss            :
1271553Srgrimes  {
12883410Sru   *(.dynbss)
1291553Srgrimes   *(.bss .bss.* .gnu.linkonce.b.*)
1301553Srgrimes   *(COMMON)
1311553Srgrimes   /* Align here to ensure that the .bss section occupies space up to
13277333Sru      _end.  Align after .bss to ensure correct alignment even if the
13377522Sru      .bss section disappears because there are no input sections.  */
134204165Sgavin   . = ALIGN(64 / 8);
135204165Sgavin  }
1361553Srgrimes  . = ALIGN(64 / 8);
13783410Sru  _end = .;
13883410Sru  PROVIDE (end = .);
1391553Srgrimes  . = DATA_SEGMENT_END (.);
14029656Swosch  /* Stabs debugging sections.  */
1411553Srgrimes  .stab          0 : { *(.stab) }
1421553Srgrimes  .stabstr       0 : { *(.stabstr) }
14329656Swosch  .stab.excl     0 : { *(.stab.excl) }
14429656Swosch  .stab.exclstr  0 : { *(.stab.exclstr) }
14529656Swosch  .stab.index    0 : { *(.stab.index) }
146100252Sdwmalone  .stab.indexstr 0 : { *(.stab.indexstr) }
1471553Srgrimes  .comment       0 : { *(.comment) }
1481553Srgrimes  /* DWARF debug sections.
1498857Srgrimes     Symbols in the DWARF debugging sections are relative to the beginning
15029656Swosch     of the section so we begin them at 0.  */
1511553Srgrimes  /* DWARF 1 */
1528857Srgrimes  .debug          0 : { *(.debug) }
1531553Srgrimes  .line           0 : { *(.line) }
1541553Srgrimes  /* GNU DWARF 1 extensions */
1551553Srgrimes  .debug_srcinfo  0 : { *(.debug_srcinfo) }
1561553Srgrimes  .debug_sfnames  0 : { *(.debug_sfnames) }
1571553Srgrimes  /* DWARF 1.1 and DWARF 2 */
1581553Srgrimes  .debug_aranges  0 : { *(.debug_aranges) }
1591553Srgrimes  .debug_pubnames 0 : { *(.debug_pubnames) }
16083410Sru  /* DWARF 2 */
16117597Sadam  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
16217597Sadam  .debug_abbrev   0 : { *(.debug_abbrev) }
16317597Sadam  .debug_line     0 : { *(.debug_line) }
16483410Sru  .debug_frame    0 : { *(.debug_frame) }
1651553Srgrimes  .debug_str      0 : { *(.debug_str) }
1661553Srgrimes  .debug_loc      0 : { *(.debug_loc) }
1671553Srgrimes  .debug_macinfo  0 : { *(.debug_macinfo) }
1681553Srgrimes  /* SGI/MIPS DWARF 2 extensions */
1691553Srgrimes  .debug_weaknames 0 : { *(.debug_weaknames) }
1701553Srgrimes  .debug_funcnames 0 : { *(.debug_funcnames) }
1711553Srgrimes  .debug_typenames 0 : { *(.debug_typenames) }
1721553Srgrimes  .debug_varnames  0 : { *(.debug_varnames) }
17383410Sru}
1741553Srgrimes