symbian-qemu-0.9.1-12/qemu-symbian-svp/x86_64.ld
changeset 1 2fb8b9db1c86
equal deleted inserted replaced
0:ffa851df0825 1:2fb8b9db1c86
       
     1 /* Default linker script, for normal executables */
       
     2 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
       
     3 OUTPUT_ARCH(i386:x86-64)
       
     4 ENTRY(_start)
       
     5 SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64");
       
     6 SECTIONS
       
     7 {
       
     8   /* Reserve a chunk of memory at a low address to prevent the host ld.so
       
     9      loading shared libraries where we want to put the target application.  */
       
    10   /* Older linkers can't add an extra program header for .reserved when
       
    11      SIZEOF_HEADERS is user.  Instead leave a chunk of space for them.  */
       
    12   /* Unfortunately this also effects the placement of program headers.
       
    13      Deliberately place it at a misaligned address before the area we want
       
    14      so that program headers can be allocated there.  */
       
    15   . = 0x1f00;
       
    16   .reserved : { *(.reserved) }
       
    17   /* Reserve a second area for programs linked at this address (PowerPC).  */
       
    18   . = 0x10000000;
       
    19   .reserved2 : { *(.reserved2) }
       
    20   /* Read-only sections, merged into text segment: */
       
    21   /* Leave space for headers for system emulation.  */
       
    22   . = 0x60000000 + 0xf00;
       
    23   .interp         : { *(.interp) }
       
    24   .hash           : { *(.hash) }
       
    25   .dynsym         : { *(.dynsym) }
       
    26   .dynstr         : { *(.dynstr) }
       
    27   .gnu.version    : { *(.gnu.version) }
       
    28   .gnu.version_d  : { *(.gnu.version_d) }
       
    29   .gnu.version_r  : { *(.gnu.version_r) }
       
    30   .rel.init       : { *(.rel.init) }
       
    31   .rela.init      : { *(.rela.init) }
       
    32   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
       
    33   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
       
    34   .rel.fini       : { *(.rel.fini) }
       
    35   .rela.fini      : { *(.rela.fini) }
       
    36   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
       
    37   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
       
    38   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
       
    39   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
       
    40   .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
       
    41   .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
       
    42   .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
       
    43   .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
       
    44   .rel.ctors      : { *(.rel.ctors) }
       
    45   .rela.ctors     : { *(.rela.ctors) }
       
    46   .rel.dtors      : { *(.rel.dtors) }
       
    47   .rela.dtors     : { *(.rela.dtors) }
       
    48   .rel.got        : { *(.rel.got) }
       
    49   .rela.got       : { *(.rela.got) }
       
    50   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
       
    51   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
       
    52   .rel.plt        : { *(.rel.plt) }
       
    53   .rela.plt       : { *(.rela.plt) }
       
    54   .init           :
       
    55   {
       
    56     KEEP (*(.init))
       
    57   } =0x90909090
       
    58   .plt            : { *(.plt) }
       
    59   .text           :
       
    60   {
       
    61     *(.text .stub .text.* .gnu.linkonce.t.*)
       
    62     /* .gnu.warning sections are handled specially by elf32.em.  */
       
    63     *(.gnu.warning)
       
    64   } =0x90909090
       
    65   .fini           :
       
    66   {
       
    67     KEEP (*(.fini))
       
    68   } =0x90909090
       
    69   PROVIDE (__etext = .);
       
    70   PROVIDE (_etext = .);
       
    71   PROVIDE (etext = .);
       
    72   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
       
    73   .rodata1        : { *(.rodata1) }
       
    74   .eh_frame_hdr : { *(.eh_frame_hdr) }
       
    75   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
       
    76   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table) }
       
    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 (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
       
    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       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
       
   103   .gcc_except_table   : ONLY_IF_RW { *(.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   .got            : { *(.got.plt) *(.got) }
       
   134   _edata = .;
       
   135   PROVIDE (edata = .);
       
   136   __bss_start = .;
       
   137   .bss            :
       
   138   {
       
   139    *(.dynbss)
       
   140    *(.bss .bss.* .gnu.linkonce.b.*)
       
   141    *(COMMON)
       
   142    /* Align here to ensure that the .bss section occupies space up to
       
   143       _end.  Align after .bss to ensure correct alignment even if the
       
   144       .bss section disappears because there are no input sections.  */
       
   145    . = ALIGN(64 / 8);
       
   146   }
       
   147   . = ALIGN(64 / 8);
       
   148   _end = .;
       
   149   PROVIDE (end = .);
       
   150   . = DATA_SEGMENT_END (.);
       
   151   /* Stabs debugging sections.  */
       
   152   .stab          0 : { *(.stab) }
       
   153   .stabstr       0 : { *(.stabstr) }
       
   154   .stab.excl     0 : { *(.stab.excl) }
       
   155   .stab.exclstr  0 : { *(.stab.exclstr) }
       
   156   .stab.index    0 : { *(.stab.index) }
       
   157   .stab.indexstr 0 : { *(.stab.indexstr) }
       
   158   .comment       0 : { *(.comment) }
       
   159   /* DWARF debug sections.
       
   160      Symbols in the DWARF debugging sections are relative to the beginning
       
   161      of the section so we begin them at 0.  */
       
   162   /* DWARF 1 */
       
   163   .debug          0 : { *(.debug) }
       
   164   .line           0 : { *(.line) }
       
   165   /* GNU DWARF 1 extensions */
       
   166   .debug_srcinfo  0 : { *(.debug_srcinfo) }
       
   167   .debug_sfnames  0 : { *(.debug_sfnames) }
       
   168   /* DWARF 1.1 and DWARF 2 */
       
   169   .debug_aranges  0 : { *(.debug_aranges) }
       
   170   .debug_pubnames 0 : { *(.debug_pubnames) }
       
   171   /* DWARF 2 */
       
   172   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
       
   173   .debug_abbrev   0 : { *(.debug_abbrev) }
       
   174   .debug_line     0 : { *(.debug_line) }
       
   175   .debug_frame    0 : { *(.debug_frame) }
       
   176   .debug_str      0 : { *(.debug_str) }
       
   177   .debug_loc      0 : { *(.debug_loc) }
       
   178   .debug_macinfo  0 : { *(.debug_macinfo) }
       
   179   /* SGI/MIPS DWARF 2 extensions */
       
   180   .debug_weaknames 0 : { *(.debug_weaknames) }
       
   181   .debug_funcnames 0 : { *(.debug_funcnames) }
       
   182   .debug_typenames 0 : { *(.debug_typenames) }
       
   183   .debug_varnames  0 : { *(.debug_varnames) }
       
   184 }