mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-03 02:43:51 +00:00
[Objdump] Fixing crash when printing symbols in ELF sections with special types.
llvm-svn: 229759
This commit is contained in:
parent
de93ac8895
commit
0fc422e3ea
@ -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;
|
||||
}
|
||||
|
BIN
test/tools/llvm-objdump/Inputs/proc-specific-section-elf
Normal file
BIN
test/tools/llvm-objdump/Inputs/proc-specific-section-elf
Normal file
Binary file not shown.
3
test/tools/llvm-objdump/proc-specific-section-elf.test
Normal file
3
test/tools/llvm-objdump/proc-specific-section-elf.test
Normal file
@ -0,0 +1,3 @@
|
||||
// RUN: llvm-objdump -t %p/Inputs/proc-specific-section-elf | FileCheck %s
|
||||
|
||||
CHECK: 00000000 *UND* 00000000 print
|
Loading…
x
Reference in New Issue
Block a user