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