aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-06-30 14:53:02 +0100
committerNick Clifton <nickc@redhat.com>2022-06-30 14:53:02 +0100
commitaa40d66bb18c7aa068179f42de52327a0711834e (patch)
tree3bfae933ebf9f2e75d81787a4190de8b02940940 /binutils/dwarf.c
parent6418644b0d09af7d1334cc034a7bf8674c061d6e (diff)
downloadgdb-aa40d66bb18c7aa068179f42de52327a0711834e.zip
gdb-aa40d66bb18c7aa068179f42de52327a0711834e.tar.gz
gdb-aa40d66bb18c7aa068179f42de52327a0711834e.tar.bz2
Fix implementation of readelf's -wE and -wN options,
* 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.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 84200ae..4504b0f 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;
}