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