[PATCH] D23540: COFF: Fix short import lib import name type bitshift

Martell Malone via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 00:26:06 PDT 2016


martell updated the summary for this revision.
martell removed rL LLVM as the repository for this revision.
martell updated this revision to Diff 68145.

https://reviews.llvm.org/D23540

Files:
  include/llvm/Support/COFF.h
  test/tools/llvm-readobj/Inputs/imports.mangle.coff-x86_64
  test/tools/llvm-readobj/imports-mangle.test
  tools/llvm-readobj/llvm-readobj.cpp

Index: tools/llvm-readobj/llvm-readobj.cpp
===================================================================
--- tools/llvm-readobj/llvm-readobj.cpp
+++ tools/llvm-readobj/llvm-readobj.cpp
@@ -460,6 +460,8 @@
     }
     if (ObjectFile *Obj = dyn_cast<ObjectFile>(&*ChildOrErr.get()))
       dumpObject(Obj);
+    else if (COFFImportFile *Import = dyn_cast<COFFImportFile>(&*ChildOrErr.get()))
+      dumpCOFFImportFile(Import);
     else
       reportError(Arc->getFileName(), readobj_error::unrecognized_file_format);
   }
Index: test/tools/llvm-readobj/imports-mangle.test
===================================================================
--- /dev/null
+++ test/tools/llvm-readobj/imports-mangle.test
@@ -0,0 +1,17 @@
+RUN: llvm-readobj --coff-imports %p/Inputs/imports.mangle.coff-x86_64 | FileCheck -check-prefix=X64  %s
+
+X64:      Name type: undecorate
+X64-NEXT:   Symbol: __imp_?sym4@@YAHH at Z
+X64-NEXT:   Symbol: ?sym4@@YAHH at Z
+
+X64:      Name type: noprefix
+X64-NEXT:   Symbol: __imp__sym3
+X64-NEXT:   Symbol: _sym3
+
+X64:      Name type: name
+X64-NEXT:   Symbol: __imp_sym1
+X64-NEXT:   Symbol: sym1
+
+X64:      Name type: ordinal
+X64-NEXT:   Symbol: __imp_sym2
+X64-NEXT:   Symbol: sym2
Index: include/llvm/Support/COFF.h
===================================================================
--- include/llvm/Support/COFF.h
+++ include/llvm/Support/COFF.h
@@ -657,7 +657,7 @@
     }
 
     ImportNameType getNameType() const {
-      return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 3);
+      return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
     }
   };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23540.68145.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160816/f22fd98d/attachment.bin>


More information about the llvm-commits mailing list