Fix up changelog entry of previous delta
[binutils-gdb.git] / binutils / objdump.c
index 93508e2a348b2bbe6c3e4d473b02fae6b46090a6..91da48095f37b116ec589223ff36e9789c6ab03b 100644 (file)
@@ -3002,8 +3002,8 @@ disassemble_bytes (struct disassemble_info * inf,
 
              if (q->addend)
                {
-                 bfd_signed_vma addend = q->addend;
-                 if (addend < 0)
+                 bfd_vma addend = q->addend;
+                 if ((bfd_signed_vma) addend < 0)
                    {
                      printf ("-0x");
                      addend = -addend;
@@ -4071,6 +4071,29 @@ make_ctfsect (const char *name, bfd_byte *data,
   return ctfsect;
 }
 
+/* Dump CTF errors/warnings.  */
+static void
+dump_ctf_errs (ctf_file_t *fp)
+{
+  ctf_next_t *it = NULL;
+  char *errtext;
+  int is_warning;
+  int err;
+
+  /* Dump accumulated errors and warnings.  */
+  while ((errtext = ctf_errwarning_next (fp, &it, &is_warning, &err)) != NULL)
+    {
+      non_fatal (_("%s: %s"), is_warning ? _("warning"): _("error"),
+                errtext);
+      free (errtext);
+    }
+  if (err != ECTF_NEXT_END)
+    {
+      non_fatal (_("CTF error: cannot get CTF errors: `%s'"),
+                ctf_errmsg (err));
+    }
+}
+
 /* Dump one CTF archive member.  */
 
 static int
@@ -4112,11 +4135,14 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg)
 
       if (ctf_errno (ctf))
        {
-         non_fatal (_("Iteration failed: %s, %s\n"), *thing,
+         non_fatal (_("Iteration failed: %s, %s"), *thing,
                   ctf_errmsg (ctf_errno (ctf)));
          break;
        }
     }
+
+  dump_ctf_errs (ctf);
+
   return 0;
 }
 
@@ -4145,7 +4171,8 @@ dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name)
   ctfsect = make_ctfsect (sect_name, ctfdata, ctfsize);
   if ((ctfa = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
     {
-      non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+      dump_ctf_errs (NULL);
+      non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
       bfd_fatal (bfd_get_filename (abfd));
     }
 
@@ -4154,7 +4181,8 @@ dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name)
       ctfsect = make_ctfsect (parent_name, parentdata, parentsize);
       if ((parenta = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
        {
-         non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+         dump_ctf_errs (NULL);
+         non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
          bfd_fatal (bfd_get_filename (abfd));
        }
 
@@ -4168,7 +4196,8 @@ dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name)
      put CTFs and their parents in archives together.)  */
   if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL)
     {
-      non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+      dump_ctf_errs (NULL);
+      non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
       bfd_fatal (bfd_get_filename (abfd));
     }
 
@@ -4266,10 +4295,10 @@ dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED)
   int count;
   int width;
 
-  if ((section->flags & SEC_HAS_CONTENTS) == 0)
+  if (! process_section_p (section))
     return;
 
-  if (! process_section_p (section))
+  if ((section->flags & SEC_HAS_CONTENTS) == 0)
     return;
 
   if ((datasize = bfd_section_size (section)) == 0)