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.xsc < prev    next >
Encoding:
LD Linker Script  |  2006-06-28  |  7.2 KB  |  209 lines

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