public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Subject: Commit: Fix parsing of readelf's -wN and -wE options
Date: Thu, 30 Jun 2022 14:52:55 +0100	[thread overview]
Message-ID: <87k08y45s8.fsf@redhat.com> (raw)

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  <nickc@redhat.com>

	* 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"
 


                 reply	other threads:[~2022-06-30 13:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k08y45s8.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).