[PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

Mark Wielaard mjw at redhat.com
Thu Apr 24 09:49:05 UTC 2014

On Thu, 2014-04-24 at 00:32 +0200, Petr Machata wrote:
> Mark Wielaard <mjw at redhat.com> writes:
> > But I think I prefer the fix using multiplication as posted here:
> > https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-April/003991.html
> > That one is also just a oneliner and more generic since it doesn't rely
> > on having to cast to uint64_t. And Richard checked it still just
> > generates a shift.
> Ah, cool, I didn't notice that e-mail.

OK, I pushed that fix and the other undefined behavior fixes posted
earlier to master now:

  readelf: handle_core_item make sure variable length array isn't zero size.
  libdwfl: __libdwfl_frame_reg_[gs]et use uint64_t when checking bits.
  readelf.c (print_gdb_index_section): Use unsigned int for 31 bits left shift.
  libdw (get_sleb128_step): Remove undefined behavior.

make CFLAGS="-g -fsanitize=undefined" && \
make CFLAGS="-g -fsanitize=undefined" check
with gcc 4.9 should have zero FAILs now.



More information about the elfutils-devel mailing list