maybe_adjust_et_rel_sym_addr_to_abs_addr contained an ABG_ASSERT to
ensure symbol_section is not used on an invalid value. Since
maybe_adjust_et_rel_sym_addr_to_abs_addr handles this case, this assert
can be removed.
* src/abg-dwarf-reader.cc
(maybe_adjust_et_rel_sym_addr_to_abs_addr): improve NULL check,
remove superfluous ABG_ASSERT
* tests/data/Makefile.am: Add new test case to the distribution.
* tests/test-read-dwarf.cc: Likewise.
* tests/data/test-read-dwarf/test27-bogus-binary.elf: New test case.
Signed-off-by: Matthias Maennich <maennich@google.com>
GElf_Addr
maybe_adjust_et_rel_sym_addr_to_abs_addr(GElf_Addr addr, Elf_Scn *section)
{
- if (section == 0)
+ if (!section)
return addr;
Elf* elf = elf_handle();
maybe_adjust_et_rel_sym_addr_to_abs_addr(GElf_Sym *sym)
{
Elf_Scn *symbol_section = elf_getscn(elf_handle(), sym->st_shndx);
- ABG_ASSERT(symbol_section);
GElf_Addr result = sym->st_value;
result = maybe_adjust_et_rel_sym_addr_to_abs_addr(result, symbol_section);
return result;
test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi \
test-read-dwarf/test25-bogus-binary.elf \
test-read-dwarf/test26-bogus-binary.elf \
+test-read-dwarf/test27-bogus-binary.elf \
\
test-annotate/test0.abi \
test-annotate/test1.abi \
"",
"",
},
+ {
+ "data/test-read-dwarf/test27-bogus-binary.elf",
+ "",
+ "",
+ "",
+ },
// This should be the last entry.
{NULL, NULL, NULL, NULL}
};