From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 31750384B13B; Thu, 23 Jul 2020 23:05:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31750384B13B From: "mark at klomp dot org" To: libabigail@sourceware.org Subject: [Bug default/26297] Possible misinterpretation of DW_AT_declaration via DW_AT_specification Date: Thu, 23 Jul 2020 23:05:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 23:05:21 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26297 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mark at klomp dot org --- Comment #2 from Mark Wielaard --- (In reply to Giuliano Procida from comment #0) > which concluded that DW_AT_declaration found by following a > DW_AT_specification should be ignored. >=20 > I coded a naive change that plumbed through a "followed_spec" boolean > through bits of the DWARF reader and the results were quite startling. >=20 > Please take a look at this and let me know your thoughts. >=20 > https://github.com/myxoid/libabigail/commit/ > fb3b7302a9923b8ee7ca279cc9492207140d886d I think your analysis is correct, when looking up whether a DIE has the DW_AT_declaration flag set, it should not follow DW_AT_specification or DW_AT_abstract_origin attributes. The patch looks somewhat convoluted though. Could we fix this by just changing die_is_declaration_only () ? die_is_declaration_only () calls die_flag_attribute () which uses die_flag_attribute () which calls dwarf_attr_integrate (). dwarf_attr_integrate () is what follows the DW_AT_specification to lookup t= he attribute. So I would propose to have a version of die_flag_attribute () that just uses dwarf_attr () to lookup the flag if the attribute is DW_AT_declaration. --=20 You are receiving this mail because: You are on the CC list for the bug.=