2004-10-28 Tomer Levi <Tomer.Levi@nsc.com>
[deliverable/binutils-gdb.git] / binutils / size.c
index 02f0972c2476034233c45e1fb51d7f8cbb0ab626..4beb0a309eeece3f82f7cb8166894e303edd087c 100644 (file)
@@ -1,6 +1,6 @@
 /* size.c -- report size of various sections of an executable file.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -341,8 +341,12 @@ display_archive (bfd *file)
 static void
 display_file (char *filename)
 {
-  bfd *file = bfd_openr (filename, target);
+  bfd *file;
 
+  if (get_file_size (filename) < 1)
+    return;
+
+  file = bfd_openr (filename, target);
   if (file == NULL)
     {
       bfd_nonfatal (filename);
@@ -425,7 +429,7 @@ berkeley_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec,
   if ((flags & SEC_ALLOC) == 0)
     return;
 
-  size = bfd_get_section_size_before_reloc (sec);
+  size = bfd_get_section_size (sec);
   if ((flags & SEC_CODE) != 0 || (flags & SEC_READONLY) != 0)
     textsize += size;
   else if ((flags & SEC_HAS_CONTENTS) != 0)
This page took 0.02376 seconds and 4 git commands to generate.