Date: Mon, 20 Jul 2020 18:22:38 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363375 - head/contrib/elftoolchain/libdwarf Message-ID: <202007201822.06KIMcbI065962@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jul 20 18:22:38 2020 New Revision: 363375 URL: https://svnweb.freebsd.org/changeset/base/363375 Log: libdwarf: Hide SHT_NOBITS sections. gnu_debuglink external debug files will contain an .eh_frame section of type SHT_NOBITS. libdwarf does not handle such sections (or rather, it expects all debug sections to not have type SHT_NOBITS). Avoid loading SHT_NOBITS sections, to be consistent with SGI libdwarf's handling of this case. PR: 239516 Diagnosed by: Paco Pascal <me@pacopascal.com> Reviewed by: emaste (previous version) Event: July 2020 Bugathon MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25626 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Mon Jul 20 17:44:13 2020 (r363374) +++ head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Mon Jul 20 18:22:38 2020 (r363375) @@ -260,6 +260,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error goto fail_cleanup; } + if (sh.sh_type == SHT_NOBITS) + continue; + if ((name = elf_strptr(elf, e->eo_strndx, sh.sh_name)) == NULL) { DWARF_SET_ELF_ERROR(dbg, error); @@ -312,6 +315,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error ret = DW_DLE_ELF; goto fail_cleanup; } + + if (sh.sh_type == SHT_NOBITS) + continue; memcpy(&e->eo_shdr[j], &sh, sizeof(sh));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007201822.06KIMcbI065962>