Index: lib/Object/COFFImportFile.cpp =================================================================== --- lib/Object/COFFImportFile.cpp +++ lib/Object/COFFImportFile.cpp @@ -496,7 +496,7 @@ // COFF Header coff_file_header Header{ - u16(0), + u16(Machine), u16(NumberOfSections), u32(0), u32(sizeof(Header) + (NumberOfSections * sizeof(coff_section))), Index: test/tools/llvm-dlltool/coff-weak-exports.def =================================================================== --- test/tools/llvm-dlltool/coff-weak-exports.def +++ test/tools/llvm-dlltool/coff-weak-exports.def @@ -1,5 +1,6 @@ ; RUN: llvm-dlltool -m i386:x86-64 --input-def %s --output-lib %t.a ; RUN: llvm-nm %t.a | FileCheck %s +; RUN: llvm-readobj %t.a | FileCheck -check-prefix=ARCH %s LIBRARY test.dll EXPORTS @@ -26,3 +27,5 @@ ; CHECK-NEXT: W __imp_ImpLibName2 ; CHECK: T ImpLibName3 ; CHECK-NEXT: T __imp_ImpLibName3 + +; ARCH-NOT: unknown arch