diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-06-07 03:48:00 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-06-07 03:48:00 +0000 |
commit | 94d8217d652d28bf71ba768b142f5cc51086111e (patch) | |
tree | 90726d27e220afde4ca2ae4b3a5f17c2b5d74b3a /ld/scripttempl | |
parent | 1e6479d4d794f6f93e2c6801f9ee1163433f46d6 (diff) | |
download | gdb-94d8217d652d28bf71ba768b142f5cc51086111e.zip gdb-94d8217d652d28bf71ba768b142f5cc51086111e.tar.gz gdb-94d8217d652d28bf71ba768b142f5cc51086111e.tar.bz2 |
* scripttempl/pe.sc: Add zeroes after .idata$3 to mark the end of
the import list.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r-- | ld/scripttempl/pe.sc | 114 |
1 files changed, 52 insertions, 62 deletions
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index bd9f27e..b497561 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -1,8 +1,5 @@ # Linker script for PE. -# These are substituted in as variables in order to get '}' in a shell -# conditional expansion. -INIT='.init : { *(.init) }' -FINI='.fini : { *(.fini) }' + cat <<EOF OUTPUT_FORMAT(${OUTPUT_FORMAT}) ${LIB_SEARCH_DIRS} @@ -11,95 +8,92 @@ ENTRY(_mainCRTStartup) SECTIONS { - .text ${RELOCATING+ __image_base__ + __section_alignment__ } : - { - ${RELOCATING+ *(.init);} - *(.text) - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; - LONG (-1); *(.ctors); *(.ctor); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; - LONG (-1); *(.dtors); *(.dtor); LONG (0); } - ${RELOCATING+ *(.fini);} - ${RELOCATING+ *(.gcc_exc);} - ${RELOCATING+ etext = .}; - } + { + ${RELOCATING+ *(.init)} + *(.text) + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + LONG (-1); *(.ctors); *(.ctor); LONG (0); } + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + LONG (-1); *(.dtors); *(.dtor); LONG (0); } + ${RELOCATING+ *(.fini)} + /* ??? Why is .gcc_exc here? */ + ${RELOCATING+ *(.gcc_exc)} + ${RELOCATING+ etext = .;} + /* Grouped section support currently must be explicitly provided for + in the linker script. */ + *(.text\$) + *(.gcc_except_table) + } .bss BLOCK(__section_alignment__) : - { - __bss_start__ = . ; - *(.bss) ; - *(COMMON); - __bss_end__ = . ; - } + { + __bss_start__ = . ; + *(.bss) + *(COMMON) + __bss_end__ = . ; + } .data BLOCK(__section_alignment__) : - { - __data_start__ = . ; - *(.data); - *(.data2); - __data_end__ = . ; - } + { + __data_start__ = . ; + *(.data) + *(.data2) + __data_end__ = . ; + /* Grouped section support currently must be explicitly provided for + in the linker script. */ + *(.data\$) + } .rdata BLOCK(__section_alignment__) : - { + { *(.rdata) - ; + /* Grouped section support currently must be explicitly provided for + in the linker script. */ + *(.rdata\$) } - - - .edata BLOCK(__section_alignment__) : { - *(.edata) ; + .edata BLOCK(__section_alignment__) : + { + *(.edata) } - - /DISCARD/ BLOCK(__section_alignment__) : { + /DISCARD/ BLOCK(__section_alignment__) : + { *(.debug\$S) *(.debug\$T) *(.debug\$F) *(.drectve) - ; } .idata BLOCK(__section_alignment__) : - { + { + /* This cannot currently be handled with grouped sections. + See pe.em:sort_sections. */ *(.idata\$2) *(.idata\$3) + ${RELOCATING+ /* These zeroes mark the end of the import list. */} + ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);} *(.idata\$4) *(.idata\$5) *(.idata\$6) *(.idata\$7) - ; } .CRT BLOCK(__section_alignment__) : { - *(.CRT\$XCA) - *(.CRT\$XCC) - *(.CRT\$XCZ) - *(.CRT\$XIA) - *(.CRT\$XIC) - *(.CRT\$XIZ) - *(.CRT\$XLA) - *(.CRT\$XLZ) - *(.CRT\$XPA) - *(.CRT\$XPX) - *(.CRT\$XPZ) - *(.CRT\$XTA) - *(.CRT\$XTZ) - ; + /* Grouped sections are used to handle .CRT\$foo. */ + *(.CRT\$) } .rsrc BLOCK(__section_alignment__) : { - *(.rsrc\$01) - *(.rsrc\$02) - ; + /* Grouped sections are used to handle .rsrc\$0[12]. */ + *(.rsrc\$) } .endjunk BLOCK(__section_alignment__) : { /* end is deprecated, don't use it */ - ${RELOCATING+ end = .}; - ${RELOCATING+ __end__ = .}; + ${RELOCATING+ end = .;} + ${RELOCATING+ __end__ = .;} } .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} : @@ -112,13 +106,9 @@ SECTIONS [ .stabstr ] } - .reloc BLOCK(__section_alignment__) : { *(.reloc) - ; } - - } EOF |