mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
[Objdump] Fixing crash when printing symbols in ELF sections with special types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -314,8 +314,11 @@ std::error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
|
||||
ESym->getType() == ELF::STT_FUNC)
|
||||
Result &= ~1;
|
||||
|
||||
if (Header->e_type == ELF::ET_REL)
|
||||
Result += EF.getSection(ESym)->sh_addr;
|
||||
if (Header->e_type == ELF::ET_REL) {
|
||||
const typename ELFFile<ELFT>::Elf_Shdr * Section = EF.getSection(ESym);
|
||||
if (Section != nullptr)
|
||||
Result += Section->sh_addr;
|
||||
}
|
||||
|
||||
return object_error::success;
|
||||
}
|
||||
|
Reference in New Issue
Block a user