This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Dwarf views broken on ia64?


Alexandre, Nick,

one of the two "view number mismatch" errors triggers all over the place
in building target libraries for ia64 in a cross build of gcc 8.1.0 on x86. I
have no idea whether gas or gcc are at fault. To distinguish the two
diagnostics I've added the patch below (may be worth to consider for
master); to allow the build to complete I've also lowered the one that
triggers to a warning (I don't think this would be an appropriate change
in general).

Attached an example of a produced assembly file triggering the
diagnostic twice.

Solution suggestions appreciated,
Jan

--- binutils-2.30/gas/dwarf2dbg.c
+++ 2.30/gas/dwarf2dbg.c
@@ -368,7 +368,18 @@ set_or_check_view (struct line_entry *e,
       if (viewx.X_op == O_constant)
 	{
 	  if (!value->X_add_number != !viewx.X_add_number)
-	    as_bad (_("view number mismatch"));
+	    {
+	      char val_buf [sizeof (viewx.X_add_number) * 3 + 2];
+	      char vwx_buf [sizeof (viewx.X_add_number) * 3 + 2];
+
+	      if (sizeof (viewx.X_add_number) > sizeof (bfd_vma))
+		abort ();
+
+	      sprintf_vma (val_buf, (bfd_vma) value->X_add_number);
+	      sprintf_vma (vwx_buf, (bfd_vma) viewx.X_add_number);
+	      as_warn (_("view number mismatch (0x%s vs 0x%s)"),
+		       vwx_buf, val_buf);
+	    }
 	}
       /* Record the expression to check it later.  It is the result of
 	 a logical not, thus 0 or 1.  We just add up all such deferred
@@ -2265,7 +2276,13 @@ dwarf2dbg_final_check (void)
       failed = resolve_symbol_value (sym);
       if (!symbol_resolved_p (sym) || failed)
 	{
-	  as_bad (_("view number mismatch"));
+	  const char *name = S_GET_NAME (sym);
+
+	  if (name)
+	    as_bad (_("view number mismatch for `%s'"),
+		    decode_local_label_name ((char *) name));
+	  else
+	    as_bad (_("view number mismatch"));
 	  break;
 	}
     }


Attachment: libgcc2.s
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]