Bug 29692 - Support binaries with empty symbol table
authorDodji Seketeli <dodji@redhat.com>
Wed, 22 Mar 2023 12:50:20 +0000 (13:50 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 22 Mar 2023 14:32:10 +0000 (15:32 +0100)
commit6641e71a03b372d537171603dc58eb79b1155229
treee1a2c7f1c57c8f153daf4022e8c3c9f30efdede4
parent889f05f9352400c23739e7e573361e2f607d5f94
Bug 29692 - Support binaries with empty symbol table

Some binaries can have a symbol table in which no symbol is actually
defined and exported.  That binary would thus have an empty ABI
corpus.

Interestingly, Libabigail's DWARF reader is emits an error when
it encounters such binaries.

This patch adds the support for those binaries.

* src/abg-dwarf-reader.cc (reader::read_debug_info_into_corpus):
Get out early also upon having an empty symbol table.
* src/abg-elf-reader.cc (reader::read_corpus): Error out only if
there is no symbol table for the binary.  If an empty symbol table
is found however, that is not an error.
* tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0:
New binary test input.
* tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0.abi:
New expected abixml file.
* tests/data/Makefile.am: Add the new input test files to source
distribution.
* tests/test-read-dwarf.cc (in_out_specs): Add the new test inputs
above to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
src/abg-elf-reader.cc
tests/data/Makefile.am
tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0 [new file with mode: 0755]
tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0.abi [new file with mode: 0644]
tests/test-read-dwarf.cc