mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 07:09:08 +00:00
llvm-objdump: Fix crash bug with printing unwind info on stripped file.
The current COFF unwind printer tries to print SEH handler function names, assuming that it can always find function names in string table. It crashes if file being read has no symbol table (i.e. executable). With this patch, llvm-objdump prints SEH handler's RVA if there's no symbol table entry for that RVA. llvm-svn: 202466
This commit is contained in:
parent
8b844d4f24
commit
fe303b55cf
@ -182,10 +182,10 @@ static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
|
||||
return EC;
|
||||
if (Ofs == Offset) {
|
||||
Sym = *I->getSymbol();
|
||||
break;
|
||||
return object_error::success;
|
||||
}
|
||||
}
|
||||
return object_error::success;
|
||||
return object_error::parse_failed;
|
||||
}
|
||||
|
||||
// Given a vector of relocations for a section and an offset into this section
|
||||
@ -225,11 +225,13 @@ static void printCOFFSymbolAddress(llvm::raw_ostream &Out,
|
||||
const std::vector<RelocationRef> &Rels,
|
||||
uint64_t Offset, uint32_t Disp) {
|
||||
StringRef Sym;
|
||||
if (error(resolveSymbolName(Rels, Offset, Sym)))
|
||||
return;
|
||||
Out << Sym;
|
||||
if (Disp > 0)
|
||||
Out << format(" + 0x%04x", Disp);
|
||||
if (!resolveSymbolName(Rels, Offset, Sym)) {
|
||||
Out << Sym;
|
||||
if (Disp > 0)
|
||||
Out << format(" + 0x%04x", Disp);
|
||||
} else {
|
||||
Out << format("0x%04x", Disp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user