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

  1. /* Script for -N: mix text and data on same page; don't align data */
  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.   PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
  11.   .interp         : { *(.interp) }
  12.   .hash           : { *(.hash) }
  13.   .dynsym         : { *(.dynsym) }
  14.   .dynstr         : { *(.dynstr) }
  15.   .gnu.version    : { *(.gnu.version) }
  16.   .gnu.version_d  : { *(.gnu.version_d) }
  17.   .gnu.version_r  : { *(.gnu.version_r) }
  18.   .rel.init       : { *(.rel.init) }
  19.   .rela.init      : { *(.rela.init) }
  20.   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  21.   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  22.   .rel.fini       : { *(.rel.fini) }
  23.   .rela.fini      : { *(.rela.fini) }
  24.   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  25.   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  26.   .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
  27.   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
  28.   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  29.   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  30.   .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  31.   .rela.tdata      : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  32.   .rel.tbss      : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  33.   .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  34.   .rel.ctors      : { *(.rel.ctors) }
  35.   .rela.ctors     : { *(.rela.ctors) }
  36.   .rel.dtors      : { *(.rel.dtors) }
  37.   .rela.dtors     : { *(.rela.dtors) }
  38.   .rel.got        : { *(.rel.got) }
  39.   .rela.got       : { *(.rela.got) }
  40.   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  41.   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  42.   .rel.ldata      : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }
  43.   .rela.ldata     : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }
  44.   .rel.lbss       : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }
  45.   .rela.lbss      : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }
  46.   .rel.lrodata    : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }
  47.   .rela.lrodata   : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }
  48.   .rel.plt        : { *(.rel.plt) }
  49.   .rela.plt       : { *(.rela.plt) }
  50.   .init           :
  51.   {
  52.     KEEP (*(.init))
  53.   } =0x90909090
  54.   .plt            : { *(.plt) }
  55.   .text           :
  56.   {
  57.     *(.text .stub .text.* .gnu.linkonce.t.*)
  58.     KEEP (*(.text.*personality*))
  59.     /* .gnu.warning sections are handled specially by elf32.em.  */
  60.     *(.gnu.warning)
  61.   } =0x90909090
  62.   .fini           :
  63.   {
  64.     KEEP (*(.fini))
  65.   } =0x90909090
  66.   PROVIDE (__etext = .);
  67.   PROVIDE (_etext = .);
  68.   PROVIDE (etext = .);
  69.   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  70.   .rodata1        : { *(.rodata1) }
  71.   .eh_frame_hdr : { *(.eh_frame_hdr) }
  72.   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  73.   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  74.   /* Adjust the address for the data segment.  We want to adjust up to
  75.      the same address within the page on the next page up.  */
  76.   . = .;
  77.   /* Exception handling  */
  78.   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  79.   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  80.   /* Thread Local Storage sections  */
  81.   .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  82.   .tbss          : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  83.   .preinit_array     :
  84.   {
  85.     PROVIDE_HIDDEN (__preinit_array_start = .);
  86.     KEEP (*(.preinit_array))
  87.     PROVIDE_HIDDEN (__preinit_array_end = .);
  88.   }
  89.   .init_array     :
  90.   {
  91.      PROVIDE_HIDDEN (__init_array_start = .);
  92.      KEEP (*(SORT(.init_array.*)))
  93.      KEEP (*(.init_array))
  94.      PROVIDE_HIDDEN (__init_array_end = .);
  95.   }
  96.   .fini_array     :
  97.   {
  98.     PROVIDE_HIDDEN (__fini_array_start = .);
  99.     KEEP (*(.fini_array))
  100.     KEEP (*(SORT(.fini_array.*)))
  101.     PROVIDE_HIDDEN (__fini_array_end = .);
  102.   }
  103.   .ctors          :
  104.   {
  105.     /* gcc uses crtbegin.o to find the start of
  106.        the constructors, so we make sure it is
  107.        first.  Because this is a wildcard, it
  108.        doesn't matter if the user does not
  109.        actually link against crtbegin.o; the
  110.        linker won't look for a file to match a
  111.        wildcard.  The wildcard also means that it
  112.        doesn't matter which directory crtbegin.o
  113.        is in.  */
  114.     KEEP (*crtbegin*.o(.ctors))
  115.     /* We don't want to include the .ctor section from
  116.        the crtend.o file until after the sorted ctors.
  117.        The .ctor section from the crtend file contains the
  118.        end of ctors marker and it must be last */
  119.     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
  120.     KEEP (*(SORT(.ctors.*)))
  121.     KEEP (*(.ctors))
  122.   }
  123.   .dtors          :
  124.   {
  125.     KEEP (*crtbegin*.o(.dtors))
  126.     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
  127.     KEEP (*(SORT(.dtors.*)))
  128.     KEEP (*(.dtors))
  129.   }
  130.   .jcr            : { KEEP (*(.jcr)) }
  131.   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
  132.   .dynamic        : { *(.dynamic) }
  133.   .got            : { *(.got) }
  134.   .got.plt        : { *(.got.plt) }
  135.   .data           :
  136.   {
  137.     *(.data .data.* .gnu.linkonce.d.*)
  138.     KEEP (*(.gnu.linkonce.d.*personality*))
  139.     SORT(CONSTRUCTORS)
  140.   }
  141.   .data1          : { *(.data1) }
  142.   _edata = .; PROVIDE (edata = .);
  143.   __bss_start = .;
  144.   .bss            :
  145.   {
  146.    *(.dynbss)
  147.    *(.bss .bss.* .gnu.linkonce.b.*)
  148.    *(COMMON)
  149.    /* Align here to ensure that the .bss section occupies space up to
  150.       _end.  Align after .bss to ensure correct alignment even if the
  151.       .bss section disappears because there are no input sections.
  152.       FIXME: Why do we need it? When there is no .bss section, we don't
  153.       pad the .data section.  */
  154.    . = ALIGN(. != 0 ? 64 / 8 : 1);
  155.   }
  156.   . = ALIGN(64 / 8);
  157.   .lbss   :
  158.   {
  159.     *(.dynlbss)
  160.     *(.lbss .lbss.* .gnu.linkonce.lb.*)
  161.     *(LARGE_COMMON)
  162.   }
  163.   .lrodata   ALIGN(0x100000) + (. & (0x100000 - 1)) :
  164.   {
  165.     *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  166.   }
  167.   .ldata   ALIGN(0x100000) + (. & (0x100000 - 1)) :
  168.   {
  169.     *(.ldata .ldata.* .gnu.linkonce.l.*)
  170.     . = ALIGN(. != 0 ? 64 / 8 : 1);
  171.   }
  172.   . = ALIGN(64 / 8);
  173.   _end = .; PROVIDE (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.