https://llvm.org/bugs/show_bug.cgi?id=31766
Bug ID: 31766 Summary: llvm-readobj fails to parse DLL import table Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Object Assignee: compn...@compnerd.org Reporter: smee...@fb.com CC: david.majne...@gmail.com, llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17897 --> https://llvm.org/bugs/attachment.cgi?id=17897&action=edit llvm-readobj -coff-imports fails on this DLL % cat ro.c long __stdcall RoGetActivationFactory(void *, void *, void **); void f() { RoGetActivationFactory(0, 0, 0); } % clang -target i686-windows -c ro.c % ld.custom -shared -o ro.dll ro.o /path/to/WindowsSDK/10/SDK/Lib/10.0.10586.0/um/x86/runtimeobject.lib % llvm-readobj -coff-imports ro.dll File: ro.dll Format: COFF-i386 Arch: i386 AddressSize: 32bit Import { Name: api-ms-win-core-winrt-l1-1-0.dll ImportLookupTableRVA: 0x303C ImportAddressTableRVA: 0x3044 Error reading file: Invalid data was encountered while parsing the file. I apologize for this not being a self-contained example. The Windows SDK used is from a standard installation (I can attach runtimeobject.lib if desired). ld.custom is a custom internal linker based on mingw ld; unfortunately, I cannot reproduce the issue with stock mingw ld (or link or lld). However, dumpbin (from Visual Studio) is able to parse this DLL fine, so llvm-readobj should be too. I'm attaching the problematic DLL instead. I bisected the error to r277298; specifically, its changing imported_symbol_begin and imported_symbol_end to reference the Import Address Table rather than the Import Lookup Table. I'm guessing there's some mix-up between the two elsewhere which was exposed by that change. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs