]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Skip zero entries in aranges
authorMark Wielaard <mark@klomp.org>
Fri, 6 Oct 2023 11:56:55 +0000 (13:56 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 9 Oct 2023 16:06:44 +0000 (18:06 +0200)
commitace48815682214308d2f849f149250a6562c59fe
tree319d28d12f973b07e85a19c3586c657d6736f9cc
parent557aa6a4b7b1d678b7c2c3b9aae1dafcc2160c64
libdw: Skip zero entries in aranges

An address/length entry of two zeros is supposed to mark the end of a
table. But in some cases a producer might leave zero entries in the
table (for example when using gcc -ffunction-sections -gc-sections).

Since we know the lenght of the table we can just skip such entries
and continue to the end.

    * libdw/dwarf_getaranges.c (dwarf_getaranges): Calculate endp.
    When seeing two zero values, check we are at endp.

https://sourceware.org/bugzilla/show_bug.cgi?id=27805

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/dwarf_getaranges.c