mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Handle relocations that don't point to symbols.
In ELF (as in MachO), not all relocations point to symbols. Represent this properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj ELF's dumper to handle relocatios without symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -178,7 +178,7 @@ static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
|
||||
uint64_t Ofs;
|
||||
if (error_code ec = I->getOffset(Ofs)) return ec;
|
||||
if (Ofs == Offset) {
|
||||
if (error_code ec = I->getSymbol(Sym)) return ec;
|
||||
Sym = *I->getSymbol();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,10 +250,9 @@ static void DisassembleInputMachO2(StringRef Filename,
|
||||
Sections[SectIdx].getAddress(SectionAddress);
|
||||
RelocOffset -= SectionAddress;
|
||||
|
||||
SymbolRef RelocSym;
|
||||
RI->getSymbol(RelocSym);
|
||||
symbol_iterator RelocSym = RI->getSymbol();
|
||||
|
||||
Relocs.push_back(std::make_pair(RelocOffset, RelocSym));
|
||||
Relocs.push_back(std::make_pair(RelocOffset, *RelocSym));
|
||||
}
|
||||
array_pod_sort(Relocs.begin(), Relocs.end());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user