mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-15 16:38:41 +00:00
If we're searching for a symbol reference to pretty-print a scattered relocation address, and we don't find a symbol table entry, try section begin addresses as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f1b7448201
commit
b28bdbf846
@ -821,6 +821,24 @@ void MachOObjectFile::printRelocationTargetName(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we couldn't find a symbol that this relocation refers to, try
|
||||||
|
// to find a section beginning instead.
|
||||||
|
for (section_iterator SI = begin_sections(), SE = end_sections(); SI != SE;
|
||||||
|
SI.increment(ec)) {
|
||||||
|
if (ec) report_fatal_error(ec.message());
|
||||||
|
|
||||||
|
uint64_t Addr;
|
||||||
|
StringRef Name;
|
||||||
|
|
||||||
|
if ((ec = SI->getAddress(Addr)))
|
||||||
|
report_fatal_error(ec.message());
|
||||||
|
if (Addr != Val) continue;
|
||||||
|
if ((ec = SI->getName(Name)))
|
||||||
|
report_fatal_error(ec.message());
|
||||||
|
fmt << Name;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fmt << format("0x%x", Val);
|
fmt << format("0x%x", Val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user