Home | History | Annotate | Download | only in qemu
      1 /* ld script to make i386 Linux kernel
      2  * Written by Martin Mares <mj (at) atrey.karlin.mff.cuni.cz>;
      3  */
      4 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
      5 OUTPUT_ARCH(powerpc:common)
      6 SEARCH_DIR(/usr/powerpc-linux-gnu/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib)
      7 ENTRY(_start)
      8 SECTIONS
      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.init       : { *(.rel.init) }
     20   .rela.init      : { *(.rela.init) }
     21   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
     22   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
     23   .rel.fini       : { *(.rel.fini) }
     24   .rela.fini      : { *(.rela.fini) }
     25   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
     26   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
     27   .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
     28   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
     29   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
     30   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
     31   .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
     32   .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
     33   .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
     34   .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
     35   .rel.ctors      : { *(.rel.ctors) }
     36   .rela.ctors     : { *(.rela.ctors) }
     37   .rel.dtors      : { *(.rel.dtors) }
     38   .rela.dtors     : { *(.rela.dtors) }
     39   .rel.got        : { *(.rel.got) }
     40   .rela.got       : { *(.rela.got) }
     41   .rela.got1           : { *(.rela.got1) }
     42   .rela.got2           : { *(.rela.got2) }
     43   .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
     44   .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
     45   .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
     46   .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
     47   .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
     48   .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
     49   .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
     50   .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
     51   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
     52   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
     53   .rel.plt        : { *(.rel.plt) }
     54   .rela.plt       : { *(.rela.plt) }
     55   .init           :
     56   {
     57     KEEP (*(.init))
     58   } =0
     59   .text           :
     60   {
     61     *(.text .stub .text.* .gnu.linkonce.t.*)
     62     KEEP (*(.text.*personality*))
     63     /* .gnu.warning sections are handled specially by elf32.em.  */
     64     *(.gnu.warning)
     65     *(.glink)
     66   } =0x47ff041f
     67   .fini           :
     68   {
     69     KEEP (*(.fini))
     70   } =0x47ff041f
     71   PROVIDE (__etext = .);
     72   PROVIDE (_etext = .);
     73   PROVIDE (etext = .);
     74   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
     75   .rodata1        : { *(.rodata1) }
     76   .sdata2         :
     77   {
     78     PROVIDE (_SDA2_BASE_ = 32768);
     79     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
     80   }
     81   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
     82   .eh_frame_hdr : { *(.eh_frame_hdr) }
     83   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
     84   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
     85   /* Adjust the address for the data segment.  We want to adjust up to
     86      the same address within the page on the next page up.  */
     87   . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
     88   /* Exception handling  */
     89   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
     90   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
     91   /* Thread Local Storage sections  */
     92   .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
     93   .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
     94   .preinit_array     :
     95   {
     96     PROVIDE_HIDDEN (__preinit_array_start = .);
     97     KEEP (*(.preinit_array))
     98     PROVIDE_HIDDEN (__preinit_array_end = .);
     99   }
    100   .init_array     :
    101   {
    102      PROVIDE_HIDDEN (__init_array_start = .);
    103      KEEP (*(SORT(.init_array.*)))
    104      KEEP (*(.init_array))
    105      PROVIDE_HIDDEN (__init_array_end = .);
    106   }
    107   .fini_array     :
    108   {
    109     PROVIDE_HIDDEN (__fini_array_start = .);
    110     KEEP (*(.fini_array))
    111     KEEP (*(SORT(.fini_array.*)))
    112     PROVIDE_HIDDEN (__fini_array_end = .);
    113   }
    114   .ctors          :
    115   {
    116     /* gcc uses crtbegin.o to find the start of
    117        the constructors, so we make sure it is
    118        first.  Because this is a wildcard, it
    119        doesn't matter if the user does not
    120        actually link against crtbegin.o; the
    121        linker won't look for a file to match a
    122        wildcard.  The wildcard also means that it
    123        doesn't matter which directory crtbegin.o
    124        is in.  */
    125     KEEP (*crtbegin*.o(.ctors))
    126     /* We don't want to include the .ctor section from
    127        the crtend.o file until after the sorted ctors.
    128        The .ctor section from the crtend file contains the
    129        end of ctors marker and it must be last */
    130     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
    131     KEEP (*(SORT(.ctors.*)))
    132     KEEP (*(.ctors))
    133   }
    134   .dtors          :
    135   {
    136     KEEP (*crtbegin*.o(.dtors))
    137     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
    138     KEEP (*(SORT(.dtors.*)))
    139     KEEP (*(.dtors))
    140   }
    141   .jcr            : { KEEP (*(.jcr)) }
    142   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
    143   .got1           : { *(.got1) }
    144   .got2           : { *(.got2) }
    145   .dynamic        : { *(.dynamic) }
    146   .got            : SPECIAL { *(.got) }
    147   . = DATA_SEGMENT_RELRO_END (0, .);
    148   .plt            : SPECIAL { *(.plt) }
    149   .data           :
    150   {
    151     *(.data .data.* .gnu.linkonce.d.*)
    152     KEEP (*(.gnu.linkonce.d.*personality*))
    153     SORT(CONSTRUCTORS)
    154   }
    155   .data1          : { *(.data1) }
    156   .got            : SPECIAL { *(.got) }
    157   /* We want the small data sections together, so single-instruction offsets
    158      can access them all, and initialized data all before uninitialized, so
    159      we can shorten the on-disk segment size.  */
    160   .sdata          :
    161   {
    162     PROVIDE (_SDA_BASE_ = 32768);
    163     *(.sdata .sdata.* .gnu.linkonce.s.*)
    164   }
    165   _edata = .; PROVIDE (edata = .);
    166   __bss_start = .;
    167   .sbss           :
    168   {
    169     PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
    170     *(.dynsbss)
    171     *(.sbss .sbss.* .gnu.linkonce.sb.*)
    172     *(.scommon)
    173     PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
    174   }
    175   .plt            : SPECIAL { *(.plt) }
    176   .bss            :
    177   {
    178    *(.dynbss)
    179    *(.bss .bss.* .gnu.linkonce.b.*)
    180    *(COMMON)
    181    /* Align here to ensure that the .bss section occupies space up to
    182       _end.  Align after .bss to ensure correct alignment even if the
    183       .bss section disappears because there are no input sections.
    184       FIXME: Why do we need it? When there is no .bss section, we don't
    185       pad the .data section.  */
    186    . = ALIGN(. != 0 ? 32 / 8 : 1);
    187   }
    188   . = ALIGN(32 / 8);
    189   . = ALIGN(32 / 8);
    190   _end = .; PROVIDE (end = .);
    191   . = DATA_SEGMENT_END (.);
    192   /* Stabs debugging sections.  */
    193   .stab 0 : { *(.stab) }
    194   .stabstr 0 : { *(.stabstr) }
    195   .stab.excl 0 : { *(.stab.excl) }
    196   .stab.exclstr 0 : { *(.stab.exclstr) }
    197   .stab.index 0 : { *(.stab.index) }
    198   .stab.indexstr 0 : { *(.stab.indexstr) }
    199   .comment 0 : { *(.comment) }
    200   /* DWARF debug sections.
    201      Symbols in the DWARF debugging sections are relative to the beginning
    202      of the section so we begin them at 0.  */
    203   /* DWARF 1 */
    204   .debug          0 : { *(.debug) }
    205   .line           0 : { *(.line) }
    206   /* GNU DWARF 1 extensions */
    207   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    208   .debug_sfnames  0 : { *(.debug_sfnames) }
    209   /* DWARF 1.1 and DWARF 2 */
    210   .debug_aranges  0 : { *(.debug_aranges) }
    211   .debug_pubnames 0 : { *(.debug_pubnames) }
    212   /* DWARF 2 */
    213   .debug_info     0 : { *(.debug_info) }
    214   .debug_abbrev   0 : { *(.debug_abbrev) }
    215   .debug_line     0 : { *(.debug_line) }
    216   .debug_frame    0 : { *(.debug_frame) }
    217   .debug_str      0 : { *(.debug_str) }
    218   .debug_loc      0 : { *(.debug_loc) }
    219   .debug_macinfo  0 : { *(.debug_macinfo) }
    220   /* SGI/MIPS DWARF 2 extensions */
    221   .debug_weaknames 0 : { *(.debug_weaknames) }
    222   .debug_funcnames 0 : { *(.debug_funcnames) }
    223   .debug_typenames 0 : { *(.debug_typenames) }
    224   .debug_varnames  0 : { *(.debug_varnames) }
    225   /* These must appear regardless of  .  */
    226   /DISCARD/    : { *(.fixup) }
    227   /DISCARD/ : { *(.note.GNU-stack) }
    228 }
    229