From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id D18D83858C2F; Thu, 21 Jul 2022 05:34:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D18D83858C2F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb/binutils-2_39-branch] PR29337, readelf CU/TU mixup in .gdb_index X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/binutils-2_39-branch X-Git-Oldrev: 6e35cb8669c8461b77b47dc9081c21eaaa768505 X-Git-Newrev: aabc43be527ff501a2fbed7c3641af544c22e47b Message-Id: <20220721053433.D18D83858C2F@sourceware.org> Date: Thu, 21 Jul 2022 05:34:33 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2022 05:34:33 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Daabc43be527f= f501a2fbed7c3641af544c22e47b commit aabc43be527ff501a2fbed7c3641af544c22e47b Author: Alan Modra Date: Thu Jul 21 14:54:54 2022 +0930 PR29337, readelf CU/TU mixup in .gdb_index =20 Commit 244e19c79111 changed a number of variables in display_gdb_index to count entries rather than words. =20 PR 29337 * dwarf.c (display_gdb_index): Correct use of cu_list_elements. =20 (cherry picked from commit e82295b23d0e52b0dadffb8c0d0b99462cd20fa8) Diff: --- binutils/dwarf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 2b1eec49422..63e6d2e5a04 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -10666,9 +10666,9 @@ display_gdb_index (struct dwarf_section *section, kind =3D GDB_INDEX_SYMBOL_KIND_VALUE (cu); cu =3D GDB_INDEX_CU_VALUE (cu); /* Convert to TU number if it's for a type unit. */ - if (cu >=3D cu_list_elements / 2) + if (cu >=3D cu_list_elements) printf ("%cT%lu", num_cus > 1 ? '\t' : ' ', - (unsigned long) (cu - cu_list_elements / 2)); + (unsigned long) (cu - cu_list_elements)); else printf ("%c%lu", num_cus > 1 ? '\t' : ' ', (unsigned long) cu);