]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Make sure to get .eh_frame_hdr with .eh_frame in getcfi_shdr
authorMark Wielaard <mark@klomp.org>
Fri, 5 Dec 2025 15:27:04 +0000 (16:27 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 9 Dec 2025 23:38:20 +0000 (00:38 +0100)
commit361bab598419c4aea1d8f1ab0304cc52bfc82cda
treee9256c4e63c5eda2ab19e66cfeaf544793071524
parent7a51b50ba5a4b5053deb8041d06590a4f1dc7269
libdw: Make sure to get .eh_frame_hdr with .eh_frame in getcfi_shdr

If we find a .eh_frame section we want to make sure to also get the
search table section .eh_frame_hdr. Otherwise lookups will be very
slow. Only create a Dwarf_CFI without a search table as a last resort.

* libdw/dwarf_getcfi_elf.c (getcfi_shdr): Keep iterating
        through the shdrs till both .eh_frame and .eh_frame_hdr are
        found. Check both aren't SHT_NOBITS.

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

Suggested-by: Shimin Guo <shimin.guo@skydio.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/dwarf_getcfi_elf.c