From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 60FBF3982422; Thu, 8 Jul 2021 09:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60FBF3982422 From: "gprocida at google dot com" To: libabigail@sourceware.org Subject: [Bug default/28060] [libabigail] Invalid offset for bitfields Date: Thu, 08 Jul 2021 09:34:20 +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: gprocida at google dot com X-Bugzilla-Status: NEW 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, 08 Jul 2021 09:34:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28060 gprocida at google dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gprocida at google dot com --- Comment #2 from gprocida at google dot com --- The problem is in abidw, not abidiff. I'm guessing that both DW_AT_data_member_location and DW_AT_data_bit_offset need to be taken into consideration, not just one of them. The problem exists with -gdwarf-3 and -gdwarf-4, but not -gdwarf-5. $ head test.{0,1}.c =3D=3D> test.0.c <=3D=3D #include struct bigstruct { char name[128]; uint8_t bitfield0:1; }; uint8_t foo(const struct bigstruct * big) { return big->bitfield0; } =3D=3D> test.1.c <=3D=3D #include struct bigstruct { char name[128]; uint8_t bitfield0:1; uint8_t bitfield1:1; }; uint8_t foo(const struct bigstruct * big) { return big->bitfield0; } $ for i in 0 1; do gcc -Wall -Wextra -g -c test.$i.c; abidw --no-show-locs test.$i.o > test.$i.xml; done $ diff -u test.{0,1}.xml --- test.0.xml 2021-07-08 10:21:30.460919575 +0100 +++ test.1.xml 2021-07-08 10:21:30.516919874 +0100 @@ -1,8 +1,8 @@ - + - + @@ -18,6 +18,9 @@ + + + --=20 You are receiving this mail because: You are on the CC list for the bug.=