mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 22:04:55 +00:00
Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9fa0ab3335
commit
1171dada02
@ -62,23 +62,8 @@ RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) {
|
||||
}
|
||||
|
||||
uint64_t RuntimeDyldCOFF::getSymbolOffset(const SymbolRef &Sym) {
|
||||
uint64_t Address;
|
||||
if (Sym.getAddress(Address))
|
||||
return UnknownAddress;
|
||||
|
||||
if (Address == UnknownAddress)
|
||||
return UnknownAddress;
|
||||
|
||||
const ObjectFile *Obj = Sym.getObject();
|
||||
section_iterator SecI(Obj->section_end());
|
||||
if (Sym.getSection(SecI))
|
||||
return UnknownAddress;
|
||||
|
||||
if (SecI == Obj->section_end())
|
||||
return UnknownAddress;
|
||||
|
||||
uint64_t SectionAddress = SecI->getAddress();
|
||||
return Address - SectionAddress;
|
||||
// The value in a relocatable COFF object is the offset.
|
||||
return Sym.getValue();
|
||||
}
|
||||
|
||||
bool RuntimeDyldCOFF::isCompatibleFile(const object::ObjectFile &Obj) const {
|
||||
|
Loading…
Reference in New Issue
Block a user