mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 15:10:33 +00:00
Simplify the logic, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0502ac4036
commit
9a5f962059
@ -154,25 +154,21 @@ std::error_code COFFObjectFile::getSymbolAddress(DataRefImpl Ref,
|
||||
uint64_t &Result) const {
|
||||
COFFSymbolRef Symb = getCOFFSymbol(Ref);
|
||||
|
||||
if (Symb.isAnyUndefined()) {
|
||||
Result = UnknownAddress;
|
||||
return std::error_code();
|
||||
}
|
||||
if (Symb.isCommon()) {
|
||||
if (Symb.isAnyUndefined() || Symb.isCommon()) {
|
||||
Result = UnknownAddress;
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
int32_t SectionNumber = Symb.getSectionNumber();
|
||||
if (!COFF::isReservedSectionNumber(SectionNumber)) {
|
||||
const coff_section *Section = nullptr;
|
||||
if (std::error_code EC = getSection(SectionNumber, Section))
|
||||
return EC;
|
||||
|
||||
Result = Section->VirtualAddress + Symb.getValue();
|
||||
if (COFF::isReservedSectionNumber(SectionNumber)) {
|
||||
Result = Symb.getValue();
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
Result = Symb.getValue();
|
||||
const coff_section *Section = nullptr;
|
||||
if (std::error_code EC = getSection(SectionNumber, Section))
|
||||
return EC;
|
||||
Result = Section->VirtualAddress + Symb.getValue();
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user