summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-11-15 20:23:25 +0000
committerRui Ueyama <ruiu@google.com>2013-11-15 20:23:25 +0000
commit3a226015a0ca52936763a079da582656164c2908 (patch)
tree9f2d35d158610ea16bb6c8836bd1d74568eb5504 /include
parent7d5f2bd5f9615c0f20d3a1f75ec01452d813283b (diff)
downloadllvm-3a226015a0ca52936763a079da582656164c2908.tar.gz
llvm-3a226015a0ca52936763a079da582656164c2908.tar.bz2
llvm-3a226015a0ca52936763a079da582656164c2908.tar.xz
Readobj: If NumbersOfSections is 0xffff, it's an COFF import library.
0xffff does not mean that there are 65535 sections in a COFF file but indicates that it's a COFF import library. This patch fixes SEGV error when an import library file is passed to llvm-readobj. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Object/COFF.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h
index ec8998c746..e05ae6c654 100644
--- a/include/llvm/Object/COFF.h
+++ b/include/llvm/Object/COFF.h
@@ -57,6 +57,8 @@ struct coff_file_header {
support::ulittle32_t NumberOfSymbols;
support::ulittle16_t SizeOfOptionalHeader;
support::ulittle16_t Characteristics;
+
+ bool isImportLibrary() const { return NumberOfSections == 0xffff; }
};
/// The 32-bit PE header that follows the COFF header.