forked from Imagelibrary/binutils-gdb
PR31872, Segfault in objdump (elf_slurp_reloc_table_from_section)
This one was triggered by trying to dump an AMDGPU object. elf64-amdgcn.c lacks support for objdump relocation handling. PR 31872 * elfcode.h (elf_slurp_reloc_table_from_section): Don't segfault on NULL elf_info_to_howto_rel.
This commit is contained in:
@@ -1614,11 +1614,11 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
|
|||||||
|
|
||||||
relent->addend = rela.r_addend;
|
relent->addend = rela.r_addend;
|
||||||
|
|
||||||
if ((entsize == sizeof (Elf_External_Rela)
|
res = false;
|
||||||
&& ebd->elf_info_to_howto != NULL)
|
if (entsize == sizeof (Elf_External_Rela)
|
||||||
|| ebd->elf_info_to_howto_rel == NULL)
|
&& ebd->elf_info_to_howto != NULL)
|
||||||
res = ebd->elf_info_to_howto (abfd, relent, &rela);
|
res = ebd->elf_info_to_howto (abfd, relent, &rela);
|
||||||
else
|
else if (ebd->elf_info_to_howto_rel != NULL)
|
||||||
res = ebd->elf_info_to_howto_rel (abfd, relent, &rela);
|
res = ebd->elf_info_to_howto_rel (abfd, relent, &rela);
|
||||||
|
|
||||||
if (! res || relent->howto == NULL)
|
if (! res || relent->howto == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user