Bug 24431 Read 32bit values when testing for the v4.19 symbol table format
authormaennich@google.com <maennich@google.com>
Fri, 10 May 2019 01:00:40 +0000 (02:00 +0100)
committerDodji Seketeli <dodji@redhat.com>
Fri, 10 May 2019 05:21:24 +0000 (07:21 +0200)
commita8bec92de2c956547bba10efea7480f33f398687
tree90d4c1a2490b6a054b8d255083d9a97e73d234e0
parent2af69905605430e198a79f60bd84912ff35099ad
Bug 24431 Read 32bit values when testing for the v4.19 symbol table format

Reading into uint64_t when reading the symbol table values drops the
sign and subsequently offset calculations will only be correct if either
the offset is positive or if the calculation overflows.

Read the relative value as signed int32_t (indepently of the target's
bitness) to allow negative offsets.  That also allows to drop the code
that formerly handled the overflow.

That change fixes an assertion raised when dealing with aarch64 kernel
binaries that have a __ksymtab with 32bit relocations. i.e. Bug #24431

* src/abg-dwarf-reader.cc
(try_reading_first_ksymtab_entry_using_v4_19_format): attempt to
read first __ksymtab entry into int32_t to preserve sign

Signed-off-by: Matthias Maennich <maennich@google.com>
src/abg-dwarf-reader.cc