qemu/m68k.ld
<<
>>
Prefs
   1/* Script for -z combreloc: combine and sort reloc sections */
   2OUTPUT_FORMAT("elf32-m68k", "elf32-m68k",
   3              "elf32-m68k")
   4OUTPUT_ARCH(m68k)
   5ENTRY(_start)
   6SEARCH_DIR("/usr/local/m68k-linux/lib");
   7/* Do we need any of these for elf?
   8   __DYNAMIC = 0;    */
   9SECTIONS
  10{
  11  /* Read-only sections, merged into text segment: */
  12  . = 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.dyn        :
  21    {
  22      *(.rel.init)
  23      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
  24      *(.rel.fini)
  25      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
  26      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
  27      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
  28      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
  29      *(.rel.ctors)
  30      *(.rel.dtors)
  31      *(.rel.got)
  32      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
  33    }
  34  .rela.dyn       :
  35    {
  36      *(.rela.init)
  37      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
  38      *(.rela.fini)
  39      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
  40      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
  41      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
  42      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
  43      *(.rela.ctors)
  44      *(.rela.dtors)
  45      *(.rela.got)
  46      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
  47    }
  48  .rel.plt        : { *(.rel.plt) }
  49  .rela.plt       : { *(.rela.plt) }
  50  .init           :
  51  {
  52    KEEP (*(.init))
  53  } =0x4e754e75
  54  .plt            : { *(.plt) }
  55  .text           :
  56  {
  57    *(.text .stub .text.* .gnu.linkonce.t.*)
  58    /* .gnu.warning sections are handled specially by elf32.em.  */
  59    *(.gnu.warning)
  60  } =0x4e754e75
  61  .fini           :
  62  {
  63    KEEP (*(.fini))
  64  } =0x4e754e75
  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  /* Adjust the address for the data segment.  We want to adjust up to
  72     the same address within the page on the next page up.  */
  73  . = ALIGN(0x2000) + (. & (0x2000 - 1));
  74  /* Ensure the __preinit_array_start label is properly aligned.  We
  75     could instead move the label definition inside the section, but
  76     the linker would then create the section even if it turns out to
  77     be empty, which isn't pretty.  */
  78  . = ALIGN(32 / 8);
  79  PROVIDE (__preinit_array_start = .);
  80  .preinit_array     : { *(.preinit_array) }
  81  PROVIDE (__preinit_array_end = .);
  82  PROVIDE (__init_array_start = .);
  83  .init_array     : { *(.init_array) }
  84  PROVIDE (__init_array_end = .);
  85  PROVIDE (__fini_array_start = .);
  86  .fini_array     : { *(.fini_array) }
  87  PROVIDE (__fini_array_end = .);
  88  .data           :
  89  {
  90    *(.data .data.* .gnu.linkonce.d.*)
  91    SORT(CONSTRUCTORS)
  92  }
  93  .data1          : { *(.data1) }
  94  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  95  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  96  .eh_frame       : { KEEP (*(.eh_frame)) }
  97  .gcc_except_table   : { *(.gcc_except_table) }
  98  .dynamic        : { *(.dynamic) }
  99  .ctors          :
 100  {
 101    /* gcc uses crtbegin.o to find the start of
 102       the constructors, so we make sure it is
 103       first.  Because this is a wildcard, it
 104       doesn't matter if the user does not
 105       actually link against crtbegin.o; the
 106       linker won't look for a file to match a
 107       wildcard.  The wildcard also means that it
 108       doesn't matter which directory crtbegin.o
 109       is in.  */
 110    KEEP (*crtbegin.o(.ctors))
 111    /* We don't want to include the .ctor section from
 112       from the crtend.o file until after the sorted ctors.
 113       The .ctor section from the crtend file contains the
 114       end of ctors marker and it must be last */
 115    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
 116    KEEP (*(SORT(.ctors.*)))
 117    KEEP (*(.ctors))
 118  }
 119  .dtors          :
 120  {
 121    KEEP (*crtbegin.o(.dtors))
 122    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
 123    KEEP (*(SORT(.dtors.*)))
 124    KEEP (*(.dtors))
 125  }
 126  .jcr            : { KEEP (*(.jcr)) }
 127  .got            : { *(.got.plt) *(.got) }
 128  _edata = .;
 129  PROVIDE (edata = .);
 130  __bss_start = .;
 131  .bss            :
 132  {
 133   *(.dynbss)
 134   *(.bss .bss.* .gnu.linkonce.b.*)
 135   *(COMMON)
 136   /* Align here to ensure that the .bss section occupies space up to
 137      _end.  Align after .bss to ensure correct alignment even if the
 138      .bss section disappears because there are no input sections.  */
 139   . = ALIGN(32 / 8);
 140  }
 141  . = ALIGN(32 / 8);
 142  _end = .;
 143  PROVIDE (end = .);
 144  /* Stabs debugging sections.  */
 145  .stab          0 : { *(.stab) }
 146  .stabstr       0 : { *(.stabstr) }
 147  .stab.excl     0 : { *(.stab.excl) }
 148  .stab.exclstr  0 : { *(.stab.exclstr) }
 149  .stab.index    0 : { *(.stab.index) }
 150  .stab.indexstr 0 : { *(.stab.indexstr) }
 151  .comment       0 : { *(.comment) }
 152  /* DWARF debug sections.
 153     Symbols in the DWARF debugging sections are relative to the beginning
 154     of the section so we begin them at 0.  */
 155  /* DWARF 1 */
 156  .debug          0 : { *(.debug) }
 157  .line           0 : { *(.line) }
 158  /* GNU DWARF 1 extensions */
 159  .debug_srcinfo  0 : { *(.debug_srcinfo) }
 160  .debug_sfnames  0 : { *(.debug_sfnames) }
 161  /* DWARF 1.1 and DWARF 2 */
 162  .debug_aranges  0 : { *(.debug_aranges) }
 163  .debug_pubnames 0 : { *(.debug_pubnames) }
 164  /* DWARF 2 */
 165  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
 166  .debug_abbrev   0 : { *(.debug_abbrev) }
 167  .debug_line     0 : { *(.debug_line) }
 168  .debug_frame    0 : { *(.debug_frame) }
 169  .debug_str      0 : { *(.debug_str) }
 170  .debug_loc      0 : { *(.debug_loc) }
 171  .debug_macinfo  0 : { *(.debug_macinfo) }
 172  /* SGI/MIPS DWARF 2 extensions */
 173  .debug_weaknames 0 : { *(.debug_weaknames) }
 174  .debug_funcnames 0 : { *(.debug_funcnames) }
 175  .debug_typenames 0 : { *(.debug_typenames) }
 176  .debug_varnames  0 : { *(.debug_varnames) }
 177}
 178