Home | History | Annotate | Download | only in ldscripts
      1 /* Script for ld --enable-auto-import: Like the default script except read only data is placed into .data  */
      2 OUTPUT_FORMAT(pei-i386)
      3 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
      4 SECTIONS
      5 {
      6   /* Make the virtual address and file offset synced if the alignment is
      7      lower than the target page size. */
      8   . = SIZEOF_HEADERS;
      9   . = ALIGN(__section_alignment__);
     10   .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
     11   {
     12      *(.init)
     13     *(.text)
     14     *(SORT(.text$*))
     15      *(.text.*)
     16     *(.glue_7t)
     17     *(.glue_7)
     18      ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
     19 			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0);
     20      ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
     21 			LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  LONG (0);
     22      *(.fini)
     23     /* ??? Why is .gcc_exc here?  */
     24      *(.gcc_exc)
     25     PROVIDE (etext = .);
     26      *(.gcc_except_table)
     27   }
     28   /* The Cygwin32 library uses a section to avoid copying certain data
     29      on fork.  This used to be named ".data".  The linker used
     30      to include this between __data_start__ and __data_end__, but that
     31      breaks building the cygwin32 dll.  Instead, we name the section
     32      ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
     33   .data BLOCK(__section_alignment__) :
     34   {
     35     __data_start__ = . ;
     36     *(.data)
     37     *(.data2)
     38     *(SORT(.data$*))
     39             *(.rdata)
     40 	    *(SORT(.rdata$*))
     41     *(.jcr)
     42     __data_end__ = . ;
     43     *(.data_cygwin_nocopy)
     44   }
     45   .rdata BLOCK(__section_alignment__) :
     46   {
     47     __rt_psrelocs_start = .;
     48     *(.rdata_runtime_pseudo_reloc)
     49     __rt_psrelocs_end = .;
     50   }
     51   __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
     52   ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
     53   __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
     54   ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
     55   __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
     56   .eh_frame BLOCK(__section_alignment__) :
     57   {
     58     *(.eh_frame*)
     59   }
     60   .pdata BLOCK(__section_alignment__) :
     61   {
     62     *(.pdata)
     63   }
     64   .bss BLOCK(__section_alignment__) :
     65   {
     66     __bss_start__ = . ;
     67     *(.bss)
     68     *(COMMON)
     69     __bss_end__ = . ;
     70   }
     71   .edata BLOCK(__section_alignment__) :
     72   {
     73     *(.edata)
     74   }
     75   /DISCARD/ :
     76   {
     77     *(.debug$S)
     78     *(.debug$T)
     79     *(.debug$F)
     80     *(.drectve)
     81      *(.note.GNU-stack)
     82      *(.gnu.lto_*)
     83   }
     84   .idata BLOCK(__section_alignment__) :
     85   {
     86     /* This cannot currently be handled with grouped sections.
     87 	See pe.em:sort_sections.  */
     88     SORT(*)(.idata$2)
     89     SORT(*)(.idata$3)
     90     /* These zeroes mark the end of the import list.  */
     91     LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
     92     SORT(*)(.idata$4)
     93     __IAT_start__ = .;
     94     SORT(*)(.idata$5)
     95     __IAT_end__ = .;
     96     SORT(*)(.idata$6)
     97     SORT(*)(.idata$7)
     98   }
     99   .CRT BLOCK(__section_alignment__) :
    100   {
    101     ___crt_xc_start__ = . ;
    102     *(SORT(.CRT$XC*))  /* C initialization */
    103     ___crt_xc_end__ = . ;
    104     ___crt_xi_start__ = . ;
    105     *(SORT(.CRT$XI*))  /* C++ initialization */
    106     ___crt_xi_end__ = . ;
    107     ___crt_xl_start__ = . ;
    108     *(SORT(.CRT$XL*))  /* TLS callbacks */
    109     /* ___crt_xl_end__ is defined in the TLS Directory support code */
    110     ___crt_xp_start__ = . ;
    111     *(SORT(.CRT$XP*))  /* Pre-termination */
    112     ___crt_xp_end__ = . ;
    113     ___crt_xt_start__ = . ;
    114     *(SORT(.CRT$XT*))  /* Termination */
    115     ___crt_xt_end__ = . ;
    116   }
    117   .tls BLOCK(__section_alignment__) :
    118   {
    119     ___tls_start__ = . ;
    120     *(.tls)
    121     *(.tls$)
    122     *(SORT(.tls$*))
    123     ___tls_end__ = . ;
    124   }
    125   .endjunk BLOCK(__section_alignment__) :
    126   {
    127     /* end is deprecated, don't use it */
    128     PROVIDE (end = .);
    129     PROVIDE ( _end = .);
    130      __end__ = .;
    131   }
    132   .rsrc BLOCK(__section_alignment__) :
    133   {
    134     *(.rsrc)
    135     *(SORT(.rsrc$*))
    136   }
    137   .reloc BLOCK(__section_alignment__) :
    138   {
    139     *(.reloc)
    140   }
    141   .stab BLOCK(__section_alignment__) (NOLOAD) :
    142   {
    143     *(.stab)
    144   }
    145   .stabstr BLOCK(__section_alignment__) (NOLOAD) :
    146   {
    147     *(.stabstr)
    148   }
    149   /* DWARF debug sections.
    150      Symbols in the DWARF debugging sections are relative to the beginning
    151      of the section.  Unlike other targets that fake this by putting the
    152      section VMA at 0, the PE format will not allow it.  */
    153   /* DWARF 1.1 and DWARF 2.  */
    154   .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
    155   {
    156     *(.debug_aranges)
    157   }
    158   .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
    159   {
    160     *(.debug_pubnames)
    161   }
    162   .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
    163   {
    164     *(.debug_pubtypes)
    165   }
    166   /* DWARF 2.  */
    167   .debug_info BLOCK(__section_alignment__) (NOLOAD) :
    168   {
    169     *(.debug_info) *(.gnu.linkonce.wi.*)
    170   }
    171   .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
    172   {
    173     *(.debug_abbrev)
    174   }
    175   .debug_line BLOCK(__section_alignment__) (NOLOAD) :
    176   {
    177     *(.debug_line)
    178   }
    179   .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
    180   {
    181     *(.debug_frame*)
    182   }
    183   .debug_str BLOCK(__section_alignment__) (NOLOAD) :
    184   {
    185     *(.debug_str)
    186   }
    187   .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
    188   {
    189     *(.debug_loc)
    190   }
    191   .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
    192   {
    193     *(.debug_macinfo)
    194   }
    195   /* SGI/MIPS DWARF 2 extensions.  */
    196   .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
    197   {
    198     *(.debug_weaknames)
    199   }
    200   .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
    201   {
    202     *(.debug_funcnames)
    203   }
    204   .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
    205   {
    206     *(.debug_typenames)
    207   }
    208   .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
    209   {
    210     *(.debug_varnames)
    211   }
    212   .debug_macro BLOCK(__section_alignment__) (NOLOAD) :
    213   {
    214     *(.debug_macro)
    215   }
    216   /* DWARF 3.  */
    217   .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
    218   {
    219     *(.debug_ranges)
    220   }
    221   /* DWARF 4.  */
    222   .debug_types BLOCK(__section_alignment__) (NOLOAD) :
    223   {
    224     *(.debug_types) *(.gnu.linkonce.wt.*)
    225   }
    226 }
    227