$ x86_64-pc-mingw32-objdump -p a.exe (...) DLL Name: b.dll vma: Hint/Ord Member-Name Bound-To Segmentation fault Program received signal SIGSEGV, Segmentation fault. bfd_getl16 (p=0x1e63ad0) at ../../src/bfd/libbfd.c:559 559 ../../src/bfd/libbfd.c: No such file or directory. in ../../src/bfd/libbfd.c (gdb) bt #0 bfd_getl16 (p=0x1e63ad0) at ../../src/bfd/libbfd.c:559 #1 0x00000000004486b5 in pe_print_idata (abfd=0x1e67090, vfile=<value optimized out>) at pex64igen.c:1302 #2 0x0000000000448fa1 in _bfd_pex64_print_private_bfd_data_common (abfd=0x1e67090, vfile=0x2aaaaaaad000) at pex64igen.c:1976 #3 0x0000000000452449 in pe_print_private_bfd_data (abfd=0x1e63ad0, vfile=0x2aaaaaaad000) at ../../src/bfd/peicode.h:335 #4 0x00000000004043bc in dump_bfd (abfd=0x1e67090) at ../../src/binutils/objdump.c:2440 #5 0x0000000000404bff in display_bfd (abfd=0x1e67090) at ../../src/binutils/objdump.c:3004 #6 0x0000000000404d48 in display_file (filename=0x7fffba1799b4 "a.exe", target=<value optimized out>) at ../../src/binutils/objdump.c:3065 #7 0x000000000040534c in main (argc=3, argv=0x7fffba177868) at ../../src/binutils/objdump.c:3311 and the major thing, the a.exe doesn't work on winxp64. it should print hello world but i see nothing on the windows console.
Created attachment 2347 [details] testcase
$ x86_64-pc-mingw32-gcc -v Using built-in specs. Target: x86_64-pc-mingw32 Configured with: ../gcc/configure --prefix=/tmp/root-x86_64-pc-linux --with-sysroot=/tmp/root-x86_64-pc-linux --target=x86_64-pc-mingw32 Thread model: win32 gcc version 4.4.0 20080402 (experimental) (GCC) this is a mingw64 toolchain snapshot from sf.net.
Created attachment 2348 [details] dep walker report. the a.exe's import table looks broken.
Created attachment 2349 [details] Fix for problem The rva's offset for IAT and thunk was not set to PE_IDATA4_SIZE or PE_IDATA5_SIZE. This results in wrong values read on 4 byte offset.
Committed at revision 1.103