qemu/i386.ld
<<
>>
Prefs
   1/* ld script to make i386 Linux kernel
   2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
   3 */
   4OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
   5OUTPUT_ARCH(i386)
   6SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/alpha-unknown-linux-gnu/lib);
   7ENTRY(_start)
   8SECTIONS
   9{
  10  /* Read-only sections, merged into text segment: */
  11  . = 0x60000000 + SIZEOF_HEADERS;
  12  .interp     : { *(.interp)    }
  13  .hash          : { *(.hash)           }
  14  .dynsym        : { *(.dynsym)         }
  15  .dynstr        : { *(.dynstr)         }
  16  .gnu.version   : { *(.gnu.version)    }
  17  .gnu.version_d   : { *(.gnu.version_d)        }
  18  .gnu.version_r   : { *(.gnu.version_r)        }
  19  .rel.text      :
  20    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
  21  .rela.text     :
  22    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
  23  .rel.data      :
  24    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
  25  .rela.data     :
  26    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
  27  .rel.rodata    :
  28    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
  29  .rela.rodata   :
  30    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
  31  .rel.got       : { *(.rel.got)                }
  32  .rela.got      : { *(.rela.got)               }
  33  .rel.ctors     : { *(.rel.ctors)      }
  34  .rela.ctors    : { *(.rela.ctors)     }
  35  .rel.dtors     : { *(.rel.dtors)      }
  36  .rela.dtors    : { *(.rela.dtors)     }
  37  .rel.init      : { *(.rel.init)       }
  38  .rela.init     : { *(.rela.init)      }
  39  .rel.fini      : { *(.rel.fini)       }
  40  .rela.fini     : { *(.rela.fini)      }
  41  .rel.bss       : { *(.rel.bss)                }
  42  .rela.bss      : { *(.rela.bss)               }
  43  .rel.plt       : { *(.rel.plt)                }
  44  .rela.plt      : { *(.rela.plt)               }
  45  .init          : { *(.init)   } =0x47ff041f
  46  .text      :
  47  {
  48    *(.text)
  49    /* .gnu.warning sections are handled specially by elf32.em.  */
  50    *(.gnu.warning)
  51    *(.gnu.linkonce.t*)
  52  } =0x47ff041f
  53  _etext = .;
  54  PROVIDE (etext = .);
  55  .fini      : { *(.fini)    } =0x47ff041f
  56  . = ALIGN(32 / 8);
  57  PROVIDE (__preinit_array_start = .);
  58  .preinit_array     : { *(.preinit_array) }
  59  PROVIDE (__preinit_array_end = .);
  60  PROVIDE (__init_array_start = .);
  61  .init_array     : { *(.init_array) }
  62  PROVIDE (__init_array_end = .);
  63  PROVIDE (__fini_array_start = .);
  64  .fini_array     : { *(.fini_array) }
  65  PROVIDE (__fini_array_end = .);
  66  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
  67  .rodata1   : { *(.rodata1) }
  68  .reginfo : { *(.reginfo) }
  69  /* Adjust the address for the data segment.  We want to adjust up to
  70     the same address within the page on the next page up.  */
  71  . = ALIGN(0x100000) + (. & (0x100000 - 1));
  72  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  73  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  74  .data    :
  75  {
  76    *(.data)
  77    *(.gnu.linkonce.d*)
  78    CONSTRUCTORS
  79  }
  80  .data1   : { *(.data1) }
  81  .ctors         :
  82  {
  83    *(.ctors)
  84  }
  85  .dtors         :
  86  {
  87    *(.dtors)
  88  }
  89  .plt      : { *(.plt) }
  90  .got           : { *(.got.plt) *(.got) }
  91  .dynamic       : { *(.dynamic) }
  92  /* We want the small data sections together, so single-instruction offsets
  93     can access them all, and initialized data all before uninitialized, so
  94     we can shorten the on-disk segment size.  */
  95  .sdata     : { *(.sdata) }
  96  _edata  =  .;
  97  PROVIDE (edata = .);
  98  __bss_start = .;
  99  .sbss      : { *(.sbss) *(.scommon) }
 100  .bss       :
 101  {
 102   *(.dynbss)
 103   *(.bss)
 104   *(COMMON)
 105  }
 106  _end = . ;
 107  PROVIDE (end = .);
 108  /* Stabs debugging sections.  */
 109  .stab 0 : { *(.stab) }
 110  .stabstr 0 : { *(.stabstr) }
 111  .stab.excl 0 : { *(.stab.excl) }
 112  .stab.exclstr 0 : { *(.stab.exclstr) }
 113  .stab.index 0 : { *(.stab.index) }
 114  .stab.indexstr 0 : { *(.stab.indexstr) }
 115  .comment 0 : { *(.comment) }
 116  /* DWARF debug sections.
 117     Symbols in the DWARF debugging sections are relative to the beginning
 118     of the section so we begin them at 0.  */
 119  /* DWARF 1 */
 120  .debug          0 : { *(.debug) }
 121  .line           0 : { *(.line) }
 122  /* GNU DWARF 1 extensions */
 123  .debug_srcinfo  0 : { *(.debug_srcinfo) }
 124  .debug_sfnames  0 : { *(.debug_sfnames) }
 125  /* DWARF 1.1 and DWARF 2 */
 126  .debug_aranges  0 : { *(.debug_aranges) }
 127  .debug_pubnames 0 : { *(.debug_pubnames) }
 128  /* DWARF 2 */
 129  .debug_info     0 : { *(.debug_info) }
 130  .debug_abbrev   0 : { *(.debug_abbrev) }
 131  .debug_line     0 : { *(.debug_line) }
 132  .debug_frame    0 : { *(.debug_frame) }
 133  .debug_str      0 : { *(.debug_str) }
 134  .debug_loc      0 : { *(.debug_loc) }
 135  .debug_macinfo  0 : { *(.debug_macinfo) }
 136  /* SGI/MIPS DWARF 2 extensions */
 137  .debug_weaknames 0 : { *(.debug_weaknames) }
 138  .debug_funcnames 0 : { *(.debug_funcnames) }
 139  .debug_typenames 0 : { *(.debug_typenames) }
 140  .debug_varnames  0 : { *(.debug_varnames) }
 141  /* These must appear regardless of  .  */
 142}
 143