From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 440E63858D28 for ; Thu, 21 Jul 2022 05:32:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 440E63858D28 Received: by mail-pj1-x102a.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so480746pjf.2 for ; Wed, 20 Jul 2022 22:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=EsZsSEGS0lvD55sqLemlcvd03iBYLPD8LRDXUVB6vro=; b=S0QbiOVuH1CDAQ4LUvO/7lzyolIvqQ0Ry0Hvad9tMpN63IpMvbMbtfJpGO0pAOawZs +5zREhj8GUhexnuNAl9lkHxgVYFeN8rFIe/bYL6UR/e4hvmVfH+RFDm4dgV44MrCro7n 50ZTivxVlXFwpYXtp11lkK9wtD9DY3kqSjohm5Q+9RkvqAuYKZZMFJSpd1/YPijE6PIF Qw1z3JvCc2G+IibpN/5eld1clhqj/IG6U0v2cwlr+l2Er0uM62fU362JSKMjSYmfuWL4 HLMv4v8KGvAwrVMEX8gSi49varAlJsEGLqcJOfvg84LIWVzw3Wnv7WHf6y9uwB4W/udG hELg== X-Gm-Message-State: AJIora/C5+5fYRFtEL9/ZxH3JkfgEV33j1bMfBe3//MHAi8E7JBNJKE2 5Ff/TmK0bFd03kkyS2ZpKPKmScY3K9I= X-Google-Smtp-Source: AGRyM1tj47R90D9ymoWh7gS2ENP/fLAAw0H7g+A6WC5z8behtCVdbrzQFfIvRB4sgt+A/QgNRy27UA== X-Received: by 2002:a17:90a:694b:b0:1f2:1581:ab75 with SMTP id j11-20020a17090a694b00b001f21581ab75mr9577101pjm.7.1658381571045; Wed, 20 Jul 2022 22:32:51 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id d126-20020a623684000000b005288b568d17sm628775pfa.167.2022.07.20.22.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 22:32:50 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 1AC041140BC9; Thu, 21 Jul 2022 15:02:48 +0930 (ACST) Date: Thu, 21 Jul 2022 15:02:48 +0930 From: Alan Modra To: binutils@sourceware.org Subject: PR29337, readelf CU/TU mixup in .gdb_index Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3036.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2022 05:32:53 -0000 Commit 244e19c79111 changed a number of variables in display_gdb_index to count entries rather than words. PR 29337 * dwarf.c (display_gdb_index): Correct use of cu_list_elements. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 99fb3566994..7d0a9ffefea 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -10671,9 +10671,9 @@ display_gdb_index (struct dwarf_section *section, kind = GDB_INDEX_SYMBOL_KIND_VALUE (cu); cu = GDB_INDEX_CU_VALUE (cu); /* Convert to TU number if it's for a type unit. */ - if (cu >= cu_list_elements / 2) + if (cu >= 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); -- Alan Modra Australia Development Lab, IBM