!11 Bug 29829 - dwarf-reader: Allow DIEs to be in a lexical block

From: @hexiaole1994 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2022-12-12 04:24:50 +00:00 committed by Gitee
commit 8a4ecc791b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 08ed347ebfd108c9c1de0ba65f9a947fda1617ab Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@redhat.com>
Date: Fri, 2 Dec 2022 15:59:13 +0000
Subject: [PATCH] Bug 29829 - dwarf-reader: Allow DIEs to be in a lexical block
Normally, ABI-relevant DWARF DIEs (types and decls) should be at
namespace level. There are real-life cases where such a DIE might be
defined in a lexical block.
This patch teaches the DWARF reader to handle such cases.
* src/abg-dwarf-reader.cc (get_scope_for_die): Support
DW_TAG_lexical_block as DIE scope.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
src/abg-dwarf-reader.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 1d6ad24..895a55d 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -10961,7 +10961,8 @@ get_scope_for_die(read_context& ctxt,
scope_decl_sptr s;
type_or_decl_base_sptr d;
if (dwarf_tag(&parent_die) == DW_TAG_subprogram
- || dwarf_tag(&parent_die) == DW_TAG_array_type)
+ || dwarf_tag(&parent_die) == DW_TAG_array_type
+ || dwarf_tag(&parent_die) == DW_TAG_lexical_block)
// this is an entity defined in a scope that is a function.
// Normally, I would say that this should be dropped. But I have
// seen a case where a typedef DIE needed by a function parameter
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: libabigail Name: libabigail
Version: 2.0 Version: 2.0
Release: 3 Release: 4
Summary: ABI generic analysis and instrumentation library Summary: ABI generic analysis and instrumentation library
License: LGPLv3+ License: LGPLv3+
URL: https://sourceware.org/libabigail/ URL: https://sourceware.org/libabigail/
@ -10,6 +10,7 @@ Patch0001: 0002-abg-reader-fix-comment-of-function.patch
Patch0002: 0003-abg-ir-add-missing-else.patch Patch0002: 0003-abg-ir-add-missing-else.patch
Patch0003: 0004-abg-reader-optimize-if-construction.patch Patch0003: 0004-abg-reader-optimize-if-construction.patch
Patch0004: 0005-abg-diff-utils-fix-typo-in-comments.patch Patch0004: 0005-abg-diff-utils-fix-typo-in-comments.patch
Patch0005: 0006-Bug-29829-dwarf-reader-Allow-DIEs-to-be-in-a-lexical.patch
BuildRequires: gcc-c++ libtool elfutils-devel libxml2-devel doxygen BuildRequires: gcc-c++ libtool elfutils-devel libxml2-devel doxygen
BuildRequires: python3-sphinx texinfo dos2unix dpkg python3-devel python3-rpm BuildRequires: python3-sphinx texinfo dos2unix dpkg python3-devel python3-rpm
BuildRequires: python3-mock python3-unittest2 python3-pyxdg wget mailcap BuildRequires: python3-mock python3-unittest2 python3-pyxdg wget mailcap
@ -95,6 +96,9 @@ fi
%doc doc/manuals/html/* README AUTHORS ChangeLog %doc doc/manuals/html/* README AUTHORS ChangeLog
%changelog %changelog
* Fri Dec 9 2022 Xiaole He <hexiaole@kylinos.cn> - 2.0-4
- backport patch:0006 to fix coredump of libxul.so from thunderbird rpm
* Tue Oct 18 2022 Xiaole He <hexiaole@kylinos.cn> - 2.0-3 * Tue Oct 18 2022 Xiaole He <hexiaole@kylinos.cn> - 2.0-3
- backport patch:0003 to add missing else - backport patch:0003 to add missing else
- backport patch:0004 to optimize if construction - backport patch:0004 to optimize if construction