Fix implementation of readelf's -wE and -wN options,
authorNick Clifton <nickc@redhat.com>
Thu, 30 Jun 2022 13:53:02 +0000 (14:53 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 30 Jun 2022 13:53:02 +0000 (14:53 +0100)
* 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.

binutils/ChangeLog
binutils/dwarf.c
binutils/testsuite/binutils-all/debuginfod.exp

index 17c23531e839808b502e0ae3312f2f1373d695aa..2a1ca581320e61ef9ad5b57ae9bea02429ef0ccd 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2022-06-28  Nick Clifton  <nickc@redhat.com>
 
        PR 29267
index 84200ae4078008010036b330f1093d127738f8de..4504b0facc65cb9e9ce77f4654eedb87da710228 100644 (file)
@@ -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;
            }
index d0e6db23f34aec456195be3a55de97d3de521ea0..f5935ad0348869021933a3580059a61278692745 100644 (file)
@@ -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"