mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-05 22:27:34 +00:00
dwarf-reader: remove superfluous ABG_ASSERT
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>
This commit is contained in:
parent
247b4a1815
commit
34e867e74f
@ -8585,7 +8585,7 @@ public:
|
||||
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();
|
||||
@ -8623,7 +8623,6 @@ public:
|
||||
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;
|
||||
|
@ -442,6 +442,7 @@ test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0 \
|
||||
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 \
|
||||
|
BIN
tests/data/test-read-dwarf/test27-bogus-binary.elf
Normal file
BIN
tests/data/test-read-dwarf/test27-bogus-binary.elf
Normal file
Binary file not shown.
@ -265,6 +265,12 @@ InOutSpec in_out_specs[] =
|
||||
"",
|
||||
"",
|
||||
},
|
||||
{
|
||||
"data/test-read-dwarf/test27-bogus-binary.elf",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
},
|
||||
// This should be the last entry.
|
||||
{NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user