From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 162E43842AF8 for ; Thu, 30 Jun 2022 13:53:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 162E43842AF8 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-599-XdXJhzwdNSuXCcS2jEFKnA-1; Thu, 30 Jun 2022 09:52:58 -0400 X-MC-Unique: XdXJhzwdNSuXCcS2jEFKnA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9A0D38005DD for ; Thu, 30 Jun 2022 13:52:57 +0000 (UTC) Received: from comet.redhat.com (unknown [10.39.194.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C0F640334D for ; Thu, 30 Jun 2022 13:52:57 +0000 (UTC) From: Nick Clifton To: binutils@sourceware.org Subject: Commit: Fix parsing of readelf's -wN and -wE options Date: Thu, 30 Jun 2022 14:52:55 +0100 Message-ID: <87k08y45s8.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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, 30 Jun 2022 13:53:01 -0000 Hi Guys, I am applying the patch below to fix a snafu in my update to the binutils' dwarf command line option parsing code. I had forgotten that the -wE and -wN options are intended to turn off a feature and so ORing in their value has no effect. Doh. Cheers Nick binutils/ChangeLog 2022-06-30 Nick Clifton * dwarf.c (dwarf_select_sections_by_name): If the entry's value is zero then clear the corresponding variable. (dwarf_select_sections_by_letters): Likewise. * testsuite/binutils-all/debuginfo.exp: Expect -WE and -wE debuginfod tests to fail. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 84200ae4078..4504b0facc6 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -12169,7 +12169,10 @@ dwarf_select_sections_by_names (const char *names) if (strncmp (p, entry->option, len) == 0 && (p[len] == ',' || p[len] == '\0')) { - * entry->variable = entry->val; + if (entry->val == 0) + * entry->variable = 0; + else + * entry->variable = entry->val; result |= entry->val; p += len; @@ -12213,7 +12216,10 @@ dwarf_select_sections_by_letters (const char *letters) { if (entry->letter == * letters) { - * entry->variable |= entry->val; + if (entry->val == 0) + * entry->variable = 0; + else + * entry->variable |= entry->val; result |= entry->val; break; } diff --git a/binutils/testsuite/binutils-all/debuginfod.exp b/binutils/testsuite/binutils-all/debuginfod.exp index d0e6db23f34..f5935ad0348 100644 --- a/binutils/testsuite/binutils-all/debuginfod.exp +++ b/binutils/testsuite/binutils-all/debuginfod.exp @@ -189,7 +189,7 @@ if { [regexp ".*DEBUGINFOD.*" $conf_objdump] } { test_fetch_debugaltlink $OBJDUMP "-Wk" set test "disabling debuginfod access" - # setup_xfail *-*-* + setup_xfail *-*-* test_fetch_debuglink $OBJDUMP "-W -WE" set test "debuginfod" @@ -202,7 +202,7 @@ if { [regexp ".*DEBUGINFOD.*" $conf_readelf] } { test_fetch_debugaltlink $READELF "-wk" set test "disabling debuginfod access" - # setup_xfail *-*-* + setup_xfail *-*-* test_fetch_debuglink $READELF "-w -wE" set test "debuginfod"