[llvm-branch-commits] [llvm-branch] r360750 - Merging r356982:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue May 14 21:59:27 PDT 2019


Author: tstellar
Date: Tue May 14 21:59:27 2019
New Revision: 360750

URL: http://llvm.org/viewvc/llvm-project?rev=360750&view=rev
Log:
Merging r356982:

------------------------------------------------------------------------
r356982 | mstorsjo | 2019-03-26 02:02:44 -0700 (Tue, 26 Mar 2019) | 12 lines

[llvm-dlltool] Set a proper machine type for weak symbol object files

This makes GNU binutils not reject the libraries outright.

GNU ld handles weak externals slightly differently though, so it
can't use them for aliases in import libraries, but this makes GNU
ld able to use the rest of the import libraries.

LLD accepted object files with machine type 0 aka
IMAGE_FILE_MACHINE_UNKNOWN.

Differential Revision: https://reviews.llvm.org/D59742
------------------------------------------------------------------------

Modified:
    llvm/branches/release_80/lib/Object/COFFImportFile.cpp
    llvm/branches/release_80/test/tools/llvm-dlltool/coff-weak-exports.def

Modified: llvm/branches/release_80/lib/Object/COFFImportFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/Object/COFFImportFile.cpp?rev=360750&r1=360749&r2=360750&view=diff
==============================================================================
--- llvm/branches/release_80/lib/Object/COFFImportFile.cpp (original)
+++ llvm/branches/release_80/lib/Object/COFFImportFile.cpp Tue May 14 21:59:27 2019
@@ -496,7 +496,7 @@ NewArchiveMember ObjectFactory::createWe
 
   // COFF Header
   coff_file_header Header{
-      u16(0),
+      u16(Machine),
       u16(NumberOfSections),
       u32(0),
       u32(sizeof(Header) + (NumberOfSections * sizeof(coff_section))),

Modified: llvm/branches/release_80/test/tools/llvm-dlltool/coff-weak-exports.def
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/tools/llvm-dlltool/coff-weak-exports.def?rev=360750&r1=360749&r2=360750&view=diff
==============================================================================
--- llvm/branches/release_80/test/tools/llvm-dlltool/coff-weak-exports.def (original)
+++ llvm/branches/release_80/test/tools/llvm-dlltool/coff-weak-exports.def Tue May 14 21:59:27 2019
@@ -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 @@ ImpLibName3 = kernel32.Sleep
 ; CHECK-NEXT: W __imp_ImpLibName2
 ; CHECK:      T ImpLibName3
 ; CHECK-NEXT: T __imp_ImpLibName3
+
+; ARCH-NOT: unknown arch




More information about the llvm-branch-commits mailing list