qemu/ia64.ld
<<
>>
Prefs
   1/* Default linker script, for normal executables */
   2OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little",
   3              "elf64-ia64-little")
   4OUTPUT_ARCH(ia64)
   5ENTRY(_start)
   6SEARCH_DIR("/usr/ia64-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
   7/* Do we need any of these for elf?
   8   __DYNAMIC = 0;    */
   9SECTIONS
  10{
  11  /* Read-only sections, merged into text segment: */
  12  PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS;
  13  .interp         : { *(.interp) }
  14  .hash           : { *(.hash) }
  15  .dynsym         : { *(.dynsym) }
  16  .dynstr         : { *(.dynstr) }
  17  .gnu.version    : { *(.gnu.version) }
  18  .gnu.version_d  : { *(.gnu.version_d) }
  19  .gnu.version_r  : { *(.gnu.version_r) }
  20  .rel.init       : { *(.rel.init) }
  21  .rela.init      : { *(.rela.init) }
  22  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  23  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  24  .rel.fini       : { *(.rel.fini) }
  25  .rela.fini      : { *(.rela.fini) }
  26  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  27  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  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.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
  41  .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  42  .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
  43  .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  44  .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
  45  .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  46  .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
  47  .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  48  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  49  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  50  .rel.plt        : { *(.rel.plt) }
  51  .rela.plt       : { *(.rela.plt) }
  52  .rela.IA_64.pltoff   : { *(.rela.IA_64.pltoff) }
  53  .init           :
  54  {
  55    KEEP (*(.init))
  56  } =0x00300000010070000002000001000400
  57  .plt            : { *(.plt) }
  58  .text           :
  59  {
  60    *(.text .stub .text.* .gnu.linkonce.t.*)
  61    /* .gnu.warning sections are handled specially by elf32.em.  */
  62    *(.gnu.warning)
  63  } =0x00300000010070000002000001000400
  64  .fini           :
  65  {
  66    KEEP (*(.fini))
  67  } =0x00300000010070000002000001000400
  68  PROVIDE (__etext = .);
  69  PROVIDE (_etext = .);
  70  PROVIDE (etext = .);
  71  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  72  .rodata1        : { *(.rodata1) }
  73  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
  74  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
  75  .opd            : { *(.opd) }
  76  .IA_64.unwind_info   : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
  77  .IA_64.unwind   : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
  78  .eh_frame_hdr : { *(.eh_frame_hdr) }
  79  /* Adjust the address for the data segment.  We want to adjust up to
  80     the same address within the page on the next page up.  */
  81  . = ALIGN(0x10000) + (. & (0x10000 - 1));
  82  /* Ensure the __preinit_array_start label is properly aligned.  We
  83     could instead move the label definition inside the section, but
  84     the linker would then create the section even if it turns out to
  85     be empty, which isn't pretty.  */
  86  . = ALIGN(64 / 8);
  87  PROVIDE (__preinit_array_start = .);
  88  .preinit_array     : { *(.preinit_array) }
  89  PROVIDE (__preinit_array_end = .);
  90  PROVIDE (__init_array_start = .);
  91  .init_array     : { *(.init_array) }
  92  PROVIDE (__init_array_end = .);
  93  PROVIDE (__fini_array_start = .);
  94  .fini_array     : { *(.fini_array) }
  95  PROVIDE (__fini_array_end = .);
  96  .data           :
  97  {
  98    *(.data .data.* .gnu.linkonce.d.*)
  99    SORT(CONSTRUCTORS)
 100  }
 101  .data1          : { *(.data1) }
 102  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
 103  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
 104  .eh_frame       : { KEEP (*(.eh_frame)) }
 105  .gcc_except_table   : { *(.gcc_except_table) }
 106  .dynamic        : { *(.dynamic) }
 107  .ctors          :
 108  {
 109    /* gcc uses crtbegin.o to find the start of
 110       the constructors, so we make sure it is
 111       first.  Because this is a wildcard, it
 112       doesn't matter if the user does not
 113       actually link against crtbegin.o; the
 114       linker won't look for a file to match a
 115       wildcard.  The wildcard also means that it
 116       doesn't matter which directory crtbegin.o
 117       is in.  */
 118    KEEP (*crtbegin*.o(.ctors))
 119    /* We don't want to include the .ctor section from
 120       from the crtend.o file until after the sorted ctors.
 121       The .ctor section from the crtend file contains the
 122       end of ctors marker and it must be last */
 123    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
 124    KEEP (*(SORT(.ctors.*)))
 125    KEEP (*(.ctors))
 126  }
 127  .dtors          :
 128  {
 129    KEEP (*crtbegin*.o(.dtors))
 130    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
 131    KEEP (*(SORT(.dtors.*)))
 132    KEEP (*(.dtors))
 133  }
 134  .jcr            : { KEEP (*(.jcr)) }
 135  /* Ensure __gp is outside the range of any normal data.  We need to
 136     do this to avoid the linker optimizing the code in op.o and getting
 137     it out of sync with the relocs that we read when processing that
 138     file.  A better solution might be to ensure that the dynamically
 139     generated code and static qemu code share a single gp-value.  */
 140  __gp = . + 0x200000;
 141  .got            : { *(.got.plt) *(.got) }
 142  .IA_64.pltoff   : { *(.IA_64.pltoff) }
 143  /* We want the small data sections together, so single-instruction offsets
 144     can access them all, and initialized data all before uninitialized, so
 145     we can shorten the on-disk segment size.  */
 146  .sdata          :
 147  {
 148    *(.sdata .sdata.* .gnu.linkonce.s.*)
 149  }
 150  _edata = .;
 151  PROVIDE (edata = .);
 152  __bss_start = .;
 153  .sbss           :
 154  {
 155    PROVIDE (__sbss_start = .);
 156    PROVIDE (___sbss_start = .);
 157    *(.dynsbss)
 158    *(.sbss .sbss.* .gnu.linkonce.sb.*)
 159    *(.scommon)
 160    PROVIDE (__sbss_end = .);
 161    PROVIDE (___sbss_end = .);
 162  }
 163  .bss            :
 164  {
 165   . += 0x400000;       /* ensure .bss stuff is out of reach of gp */
 166   *(.dynbss)
 167   *(.bss .bss.* .gnu.linkonce.b.*)
 168   *(COMMON)
 169   /* Align here to ensure that the .bss section occupies space up to
 170      _end.  Align after .bss to ensure correct alignment even if the
 171      .bss section disappears because there are no input sections.  */
 172   . = ALIGN(64 / 8);
 173  }
 174  . = ALIGN(64 / 8);
 175  _end = .;
 176  PROVIDE (end = .);
 177  /* Stabs debugging sections.  */
 178  .stab          0 : { *(.stab) }
 179  .stabstr       0 : { *(.stabstr) }
 180  .stab.excl     0 : { *(.stab.excl) }
 181  .stab.exclstr  0 : { *(.stab.exclstr) }
 182  .stab.index    0 : { *(.stab.index) }
 183  .stab.indexstr 0 : { *(.stab.indexstr) }
 184  .comment       0 : { *(.comment) }
 185  /* DWARF debug sections.
 186     Symbols in the DWARF debugging sections are relative to the beginning
 187     of the section so we begin them at 0.  */
 188  /* DWARF 1 */
 189  .debug          0 : { *(.debug) }
 190  .line           0 : { *(.line) }
 191  /* GNU DWARF 1 extensions */
 192  .debug_srcinfo  0 : { *(.debug_srcinfo) }
 193  .debug_sfnames  0 : { *(.debug_sfnames) }
 194  /* DWARF 1.1 and DWARF 2 */
 195  .debug_aranges  0 : { *(.debug_aranges) }
 196  .debug_pubnames 0 : { *(.debug_pubnames) }
 197  /* DWARF 2 */
 198  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
 199  .debug_abbrev   0 : { *(.debug_abbrev) }
 200  .debug_line     0 : { *(.debug_line) }
 201  .debug_frame    0 : { *(.debug_frame) }
 202  .debug_str      0 : { *(.debug_str) }
 203  .debug_loc      0 : { *(.debug_loc) }
 204  .debug_macinfo  0 : { *(.debug_macinfo) }
 205  /* SGI/MIPS DWARF 2 extensions */
 206  .debug_weaknames 0 : { *(.debug_weaknames) }
 207  .debug_funcnames 0 : { *(.debug_funcnames) }
 208  .debug_typenames 0 : { *(.debug_typenames) }
 209  .debug_varnames  0 : { *(.debug_varnames) }
 210  /DISCARD/ : { *(.note.GNU-stack) }
 211}
 212