home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / ldscripts / elf_x86_64.xs < prev    next >
Encoding:
LD Linker Script  |  2006-06-28  |  7.7 KB  |  204 lines

  1. /* Script for ld --shared: link shared library */
  2. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
  3.           "elf64-x86-64")
  4. OUTPUT_ARCH(i386:x86-64)
  5. ENTRY(_start)
  6. SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
  7. SECTIONS
  8. {
  9.   /* Read-only sections, merged into text segment: */
  10.   . = 0 + SIZEOF_HEADERS;
  11.   .hash           : { *(.hash) }
  12.   .dynsym         : { *(.dynsym) }
  13.   .dynstr         : { *(.dynstr) }
  14.   .gnu.version    : { *(.gnu.version) }
  15.   .gnu.version_d  : { *(.gnu.version_d) }
  16.   .gnu.version_r  : { *(.gnu.version_r) }
  17.   .rel.init       : { *(.rel.init) }
  18.   .rela.init      : { *(.rela.init) }
  19.   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  20.   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  21.   .rel.fini       : { *(.rel.fini) }
  22.   .rela.fini      : { *(.rela.fini) }
  23.   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  24.   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  25.   .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
  26.   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
  27.   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  28.   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  29.   .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  30.   .rela.tdata      : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  31.   .rel.tbss      : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  32.   .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  33.   .rel.ctors      : { *(.rel.ctors) }
  34.   .rela.ctors     : { *(.rela.ctors) }
  35.   .rel.dtors      : { *(.rel.dtors) }
  36.   .rela.dtors     : { *(.rela.dtors) }
  37.   .rel.got        : { *(.rel.got) }
  38.   .rela.got       : { *(.rela.got) }
  39.   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  40.   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  41.   .rel.ldata      : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }
  42.   .rela.ldata     : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }
  43.   .rel.lbss       : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }
  44.   .rela.lbss      : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }
  45.   .rel.lrodata    : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }
  46.   .rela.lrodata   : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }
  47.   .rel.plt        : { *(.rel.plt) }
  48.   .rela.plt       : { *(.rela.plt) }
  49.   .init           :
  50.   {
  51.     KEEP (*(.init))
  52.   } =0x90909090
  53.   .plt            : { *(.plt) }
  54.   .text           :
  55.   {
  56.     *(.text .stub .text.* .gnu.linkonce.t.*)
  57.     KEEP (*(.text.*personality*))
  58.     /* .gnu.warning sections are handled specially by elf32.em.  */
  59.     *(.gnu.warning)
  60.   } =0x90909090
  61.   .fini           :
  62.   {
  63.     KEEP (*(.fini))
  64.   } =0x90909090
  65.   PROVIDE (__etext = .);
  66.   PROVIDE (_etext = .);
  67.   PROVIDE (etext = .);
  68.   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  69.   .rodata1        : { *(.rodata1) }
  70.   .eh_frame_hdr : { *(.eh_frame_hdr) }
  71.   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  72.   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  73.   /* Adjust the address for the data segment.  We want to adjust up to
  74.      the same address within the page on the next page up.  */
  75.   . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
  76.   /* Exception handling  */
  77.   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  78.   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  79.   /* Thread Local Storage sections  */
  80.   .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  81.   .tbss          : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  82.   .preinit_array     :
  83.   {
  84.     KEEP (*(.preinit_array))
  85.   }
  86.   .init_array     :
  87.   {
  88.      KEEP (*(SORT(.init_array.*)))
  89.      KEEP (*(.init_array))
  90.   }
  91.   .fini_array     :
  92.   {
  93.     KEEP (*(.fini_array))
  94.     KEEP (*(SORT(.fini_array.*)))
  95.   }
  96.   .ctors          :
  97.   {
  98.     /* gcc uses crtbegin.o to find the start of
  99.        the constructors, so we make sure it is
  100.        first.  Because this is a wildcard, it
  101.        doesn't matter if the user does not
  102.        actually link against crtbegin.o; the
  103.        linker won't look for a file to match a
  104.        wildcard.  The wildcard also means that it
  105.        doesn't matter which directory crtbegin.o
  106.        is in.  */
  107.     KEEP (*crtbegin*.o(.ctors))
  108.     /* We don't want to include the .ctor section from
  109.        the crtend.o file until after the sorted ctors.
  110.        The .ctor section from the crtend file contains the
  111.        end of ctors marker and it must be last */
  112.     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
  113.     KEEP (*(SORT(.ctors.*)))
  114.     KEEP (*(.ctors))
  115.   }
  116.   .dtors          :
  117.   {
  118.     KEEP (*crtbegin*.o(.dtors))
  119.     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
  120.     KEEP (*(SORT(.dtors.*)))
  121.     KEEP (*(.dtors))
  122.   }
  123.   .jcr            : { KEEP (*(.jcr)) }
  124.   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
  125.   .dynamic        : { *(.dynamic) }
  126.   .got            : { *(.got) }
  127.   . = DATA_SEGMENT_RELRO_END (24, .);
  128.   .got.plt        : { *(.got.plt) }
  129.   .data           :
  130.   {
  131.     *(.data .data.* .gnu.linkonce.d.*)
  132.     KEEP (*(.gnu.linkonce.d.*personality*))
  133.     SORT(CONSTRUCTORS)
  134.   }
  135.   .data1          : { *(.data1) }
  136.   _edata = .; PROVIDE (edata = .);
  137.   __bss_start = .;
  138.   .bss            :
  139.   {
  140.    *(.dynbss)
  141.    *(.bss .bss.* .gnu.linkonce.b.*)
  142.    *(COMMON)
  143.    /* Align here to ensure that the .bss section occupies space up to
  144.       _end.  Align after .bss to ensure correct alignment even if the
  145.       .bss section disappears because there are no input sections.
  146.       FIXME: Why do we need it? When there is no .bss section, we don't
  147.       pad the .data section.  */
  148.    . = ALIGN(. != 0 ? 64 / 8 : 1);
  149.   }
  150.   . = ALIGN(64 / 8);
  151.   .lbss   :
  152.   {
  153.     *(.dynlbss)
  154.     *(.lbss .lbss.* .gnu.linkonce.lb.*)
  155.     *(LARGE_COMMON)
  156.   }
  157.   .lrodata   ALIGN(0x100000) + (. & (0x100000 - 1)) :
  158.   {
  159.     *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  160.   }
  161.   .ldata   ALIGN(0x100000) + (. & (0x100000 - 1)) :
  162.   {
  163.     *(.ldata .ldata.* .gnu.linkonce.l.*)
  164.     . = ALIGN(. != 0 ? 64 / 8 : 1);
  165.   }
  166.   . = ALIGN(64 / 8);
  167.   _end = .; PROVIDE (end = .);
  168.   . = DATA_SEGMENT_END (.);
  169.   /* Stabs debugging sections.  */
  170.   .stab          0 : { *(.stab) }
  171.   .stabstr       0 : { *(.stabstr) }
  172.   .stab.excl     0 : { *(.stab.excl) }
  173.   .stab.exclstr  0 : { *(.stab.exclstr) }
  174.   .stab.index    0 : { *(.stab.index) }
  175.   .stab.indexstr 0 : { *(.stab.indexstr) }
  176.   .comment       0 : { *(.comment) }
  177.   /* DWARF debug sections.
  178.      Symbols in the DWARF debugging sections are relative to the beginning
  179.      of the section so we begin them at 0.  */
  180.   /* DWARF 1 */
  181.   .debug          0 : { *(.debug) }
  182.   .line           0 : { *(.line) }
  183.   /* GNU DWARF 1 extensions */
  184.   .debug_srcinfo  0 : { *(.debug_srcinfo) }
  185.   .debug_sfnames  0 : { *(.debug_sfnames) }
  186.   /* DWARF 1.1 and DWARF 2 */
  187.   .debug_aranges  0 : { *(.debug_aranges) }
  188.   .debug_pubnames 0 : { *(.debug_pubnames) }
  189.   /* DWARF 2 */
  190.   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  191.   .debug_abbrev   0 : { *(.debug_abbrev) }
  192.   .debug_line     0 : { *(.debug_line) }
  193.   .debug_frame    0 : { *(.debug_frame) }
  194.   .debug_str      0 : { *(.debug_str) }
  195.   .debug_loc      0 : { *(.debug_loc) }
  196.   .debug_macinfo  0 : { *(.debug_macinfo) }
  197.   /* SGI/MIPS DWARF 2 extensions */
  198.   .debug_weaknames 0 : { *(.debug_weaknames) }
  199.   .debug_funcnames 0 : { *(.debug_funcnames) }
  200.   .debug_typenames 0 : { *(.debug_typenames) }
  201.   .debug_varnames  0 : { *(.debug_varnames) }
  202.   /DISCARD/ : { *(.note.GNU-stack) }
  203. }
  204.