cpu,opcodes,gas: fix arguments to ldabs and ldind eBPF instructions
[deliverable/binutils-gdb.git] / binutils / bucomm.c
index 5a0b634344c14f2a7e9394e3904a2f6a492f1b31..21adb05c4188556de5273df9088c9dc6d4b3fc8b 100644 (file)
@@ -1,5 +1,5 @@
 /* bucomm.c -- Bin Utils COMmon code.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2019 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -44,8 +44,12 @@ void
 bfd_nonfatal (const char *string)
 {
   const char *errmsg;
+  enum bfd_error err = bfd_get_error ();
 
-  errmsg = bfd_errmsg (bfd_get_error ());
+  if (err == bfd_error_no_error)
+    errmsg = _("cause of error unknown");
+  else
+    errmsg = bfd_errmsg (err);
   fflush (stdout);
   if (string)
     fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg);
@@ -74,8 +78,12 @@ bfd_nonfatal_message (const char *filename,
   const char *errmsg;
   const char *section_name;
   va_list args;
+  enum bfd_error err = bfd_get_error ();
 
-  errmsg = bfd_errmsg (bfd_get_error ());
+  if (err == bfd_error_no_error)
+    errmsg = _("cause of error unknown");
+  else
+    errmsg = bfd_errmsg (err);
   fflush (stdout);
   section_name = NULL;
   va_start (args, format);
@@ -427,7 +435,7 @@ display_info (void)
    Mode       User\tGroup\tSize\tDate               Name */
 
 void
-print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose)
+print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose, bfd_boolean offsets)
 {
   struct stat buf;
 
@@ -458,7 +466,17 @@ print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose)
        }
     }
 
-  fprintf (file, "%s\n", bfd_get_filename (abfd));
+  fprintf (file, "%s", bfd_get_filename (abfd));
+
+  if (offsets)
+    {
+      if (bfd_is_thin_archive (abfd) && abfd->proxy_origin)
+        fprintf (file, " 0x%lx", (unsigned long) abfd->proxy_origin);
+      else if (!bfd_is_thin_archive (abfd) && abfd->origin)
+        fprintf (file, " 0x%lx", (unsigned long) abfd->origin);
+    }
+
+  fprintf (file, "\n");
 }
 
 /* Return a path for a new temporary file in the same directory
This page took 0.026137 seconds and 4 git commands to generate.