mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 20:29:53 +00:00
Fix llvm-objdump's MachO mode to not depend on the value returned by RelocationRef::getInfo().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
19a4daff9b
commit
7d3f8b8e48
@ -385,7 +385,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
bool symbolTableWorked = false;
|
||||
|
||||
// Parse relocations.
|
||||
std::vector<std::pair<uint64_t, uint32_t> > Relocs;
|
||||
std::vector<std::pair<uint64_t, SymbolRef> > Relocs;
|
||||
error_code ec;
|
||||
for (relocation_iterator RI = Sections[SectIdx].begin_relocations(),
|
||||
RE = Sections[SectIdx].end_relocations(); RI != RE; RI.increment(ec)) {
|
||||
@ -394,10 +394,10 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
Sections[SectIdx].getAddress(SectionAddress);
|
||||
RelocOffset -= SectionAddress;
|
||||
|
||||
uint64_t RelocInfo;
|
||||
RI->getType(RelocInfo);
|
||||
SymbolRef RelocSym;
|
||||
RI->getSymbol(RelocSym);
|
||||
|
||||
Relocs.push_back(std::make_pair(RelocOffset, RelocInfo));
|
||||
Relocs.push_back(std::make_pair(RelocOffset, RelocSym));
|
||||
}
|
||||
array_pod_sort(Relocs.begin(), Relocs.end());
|
||||
|
||||
@ -594,8 +594,8 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
Relocs[j].first < SectAddress + Inst.Address + Inst.Size) {
|
||||
StringRef SymName;
|
||||
uint64_t Addr;
|
||||
UnsortedSymbols[Relocs[j].second].getName(SymName);
|
||||
UnsortedSymbols[Relocs[j].second].getAddress(Addr);
|
||||
Relocs[j].second.getAddress(Addr);
|
||||
Relocs[j].second.getName(SymName);
|
||||
|
||||
outs() << "\t# " << SymName << ' ';
|
||||
DumpAddress(Addr, Sections, MachOObj, outs());
|
||||
|
Loading…
Reference in New Issue
Block a user