mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27: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:
@@ -201,8 +201,7 @@ static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
|
||||
return EC;
|
||||
|
||||
if (Ofs == Offset) {
|
||||
if (error_code EC = RelI->getSymbol(Sym))
|
||||
return EC;
|
||||
Sym = *RelI->getSymbol();
|
||||
return readobj_error::success;
|
||||
}
|
||||
}
|
||||
@@ -670,14 +669,13 @@ void COFFDumper::printRelocation(section_iterator SecI,
|
||||
uint64_t Offset;
|
||||
uint64_t RelocType;
|
||||
SmallString<32> RelocName;
|
||||
SymbolRef Symbol;
|
||||
StringRef SymbolName;
|
||||
StringRef Contents;
|
||||
if (error(RelI->getOffset(Offset))) return;
|
||||
if (error(RelI->getType(RelocType))) return;
|
||||
if (error(RelI->getTypeName(RelocName))) return;
|
||||
if (error(RelI->getSymbol(Symbol))) return;
|
||||
if (error(Symbol.getName(SymbolName))) return;
|
||||
symbol_iterator Symbol = RelI->getSymbol();
|
||||
if (error(Symbol->getName(SymbolName))) return;
|
||||
if (error(SecI->getContents(Contents))) return;
|
||||
|
||||
if (opts::ExpandRelocs) {
|
||||
|
||||
Reference in New Issue
Block a user