[llvm] r283055 - COFF: Fix short import lib import name type bitshift
Martell Malone via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 1 16:10:21 PDT 2016
Author: martell
Date: Sat Oct 1 18:10:20 2016
New Revision: 283055
URL: http://llvm.org/viewvc/llvm-project?rev=283055&view=rev
Log:
COFF: Fix short import lib import name type bitshift
As per the PE COFF spec (section 8.3, Import Name Type)
Offset: 18 Size 2 bits Name: Type
Offset: 20 Size 3 bits Name: Name Type
Offset: 20 added based on 18+2
Partially commited as rL279069
Differential Revision: https://reviews.llvm.org/D23540
Modified:
llvm/trunk/include/llvm/Support/COFF.h
llvm/trunk/test/tools/llvm-readobj/Inputs/library.lib
llvm/trunk/test/tools/llvm-readobj/coff-exports-implib.test
Modified: llvm/trunk/include/llvm/Support/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/COFF.h?rev=283055&r1=283054&r2=283055&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/COFF.h (original)
+++ llvm/trunk/include/llvm/Support/COFF.h Sat Oct 1 18:10:20 2016
@@ -657,7 +657,7 @@ namespace COFF {
}
ImportNameType getNameType() const {
- return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 3);
+ return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
}
};
Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/library.lib
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/library.lib?rev=283055&r1=283054&r2=283055&view=diff
==============================================================================
Binary files llvm/trunk/test/tools/llvm-readobj/Inputs/library.lib (original) and llvm/trunk/test/tools/llvm-readobj/Inputs/library.lib Sat Oct 1 18:10:20 2016 differ
Modified: llvm/trunk/test/tools/llvm-readobj/coff-exports-implib.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/coff-exports-implib.test?rev=283055&r1=283054&r2=283055&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/coff-exports-implib.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/coff-exports-implib.test Sat Oct 1 18:10:20 2016
@@ -3,20 +3,24 @@ RUN: llvm-readobj -coff-exports %p/Input
CHECK: File: library.dll
CHECK: Format: COFF-import-file
CHECK: Type: const
+CHECK: Name type: undecorate
CHECK: Symbol: __imp__constant
CHECK: File: library.dll
CHECK: Format: COFF-import-file
CHECK: Type: data
+CHECK: Name type: noprefix
CHECK: Symbol: __imp__data
CHECK: File: library.dll
CHECK: Format: COFF-import-file
CHECK: Type: code
+CHECK: Name type: name
CHECK: Symbol: __imp__function
CHECK: File: library.dll
CHECK: Format: COFF-import-file
CHECK: Type: code
+CHECK: Name type: ordinal
CHECK: Symbol: __imp__ordinal
More information about the llvm-commits
mailing list