aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index bd70157..6e1f683 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -347,13 +347,8 @@ std::error_code COFFObjectFile::sectionContainsSymbol(DataRefImpl SecRef,
bool &Result) const {
const coff_section *Sec = toSec(SecRef);
COFFSymbolRef Symb = getCOFFSymbol(SymbRef);
- const coff_section *SymbSec = nullptr;
- if (std::error_code EC = getSection(Symb.getSectionNumber(), SymbSec))
- return EC;
- if (SymbSec == Sec)
- Result = true;
- else
- Result = false;
+ int32_t SecNumber = (Sec - SectionTable) + 1;
+ Result = SecNumber == Symb.getSectionNumber();
return object_error::success;
}