public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "jakub at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/27212] ./dwz: xxx: Invalid DW_AT_decl_file file number 20
Date: Wed, 20 Jan 2021 19:43:53 +0000	[thread overview]
Message-ID: <bug-27212-11298-HEwFNeeRym@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27212-11298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27212

--- Comment #5 from Jakub Jelinek <jakub at redhat dot com> ---
Therefore, I think the right fix is:
diff --git a/dwz.c b/dwz.c
index 308bcba..6117c70 100644
--- a/dwz.c
+++ b/dwz.c
@@ -10456,19 +10456,18 @@ build_abbrevs_for_die (htab_t h, dw_cu_ref cu,
dw_die_ref die,
                    case DW_FORM_data4: value = read_32 (ptr); break;
                    case DW_FORM_data8: value = read_64 (ptr); break;
                    case DW_FORM_udata: value = read_uleb128 (ptr); break;
-                   case DW_FORM_implicit_const: break;
+                   case DW_FORM_implicit_const:
+                     value = reft->values[i];
+                     break;
                    default:
                      error (0, 0, "Unhandled %s for %s",
                             get_DW_FORM_str (form),
                             get_DW_AT_str (reft->attr[i].attr));
                      return 1;
                    }
-                 /* Note that the value is only used for calculating the
-                    DIE size and possibly change form. Doesn't change the
-                    implicit_const from or value.  */
+                 value = line_htab_lookup (refcu, value);
                  if (form != DW_FORM_implicit_const)
                    {
-                     value = line_htab_lookup (refcu, value);
                      if (value <= 0xff)
                        {
                          form = DW_FORM_data1;
@@ -10488,7 +10487,7 @@ build_abbrevs_for_die (htab_t h, dw_cu_ref cu,
dw_die_ref die,
                  t->attr[j].attr = reft->attr[i].attr;
                  t->attr[j].form = form;
                  if (form == DW_FORM_implicit_const)
-                   t->values[j] = reft->values[i];
+                   t->values[j] = value;
                  j++;
                  continue;
                }
@@ -12088,10 +12087,8 @@ write_die (unsigned char *ptr, dw_cu_ref cu,
dw_die_ref die,
                  update = true;
                  break;
                case DW_FORM_implicit_const:
-                 /* Negative means, already transformed.  */
-                 if (reft->values[i] >= 0)
-                   update = true;
-                 value = reft->values[i];
+                 /* DW_FORM_implicit_const should have been updated
+                    already when computing abbrevs.  */
                  break;
                default: abort ();
                }
@@ -12104,9 +12101,6 @@ write_die (unsigned char *ptr, dw_cu_ref cu, dw_die_ref
die,
                    case DW_FORM_data2: write_16 (ptr, value); break;
                    case DW_FORM_data4: write_32 (ptr, value); break;
                    case DW_FORM_udata: write_uleb128 (ptr, value); break;
-                   case DW_FORM_implicit_const:
-                     reft->values[i] = -value; /* Note, negated.  */
-                     break;
                    default: abort ();
                    }
                }
and this passes the #c0 testcase.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-01-20 19:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  8:38 [Bug default/27212] New: " jakub at redhat dot com
2021-01-20 10:59 ` [Bug default/27212] " mark at klomp dot org
2021-01-20 18:06 ` jakub at redhat dot com
2021-01-20 18:28 ` jakub at redhat dot com
2021-01-20 19:40 ` jakub at redhat dot com
2021-01-20 19:43 ` jakub at redhat dot com [this message]
2021-01-20 21:15 ` mark at klomp dot org
2021-01-20 21:32 ` jakub at redhat dot com
2021-01-20 21:56 ` mark at klomp dot org
2021-01-21  7:58 ` jakub at redhat dot com
2021-02-08 15:51 ` mark at klomp dot org

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=bug-27212-11298-HEwFNeeRym@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@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).