Automatic date update in version.in
[external/binutils.git] / binutils / bucomm.c
index fd6f356..8269c8d 100644 (file)
@@ -1,5 +1,5 @@
 /* bucomm.c -- Bin Utils COMmon code.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -427,7 +427,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 +458,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
@@ -598,6 +608,8 @@ get_file_size (const char * file_name)
        non_fatal (_("Warning: could not locate '%s'.  reason: %s"),
                   file_name, strerror (errno));
     }
+  else if (S_ISDIR (statbuf.st_mode))
+    non_fatal (_("Warning: '%s' is a directory"), file_name);
   else if (! S_ISREG (statbuf.st_mode))
     non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
   else if (statbuf.st_size < 0)