Remove ARI check for multiple calls to warning or error
[deliverable/binutils-gdb.git] / binutils / size.c
index 479a4648877d9b6c14e36cc719a0bcda83ac26d3..69da30cade772acec2f32567e0bbac33977e4176 100644 (file)
@@ -478,11 +478,11 @@ berkeley_or_gnu_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec,
   flagword flags;
   bfd_size_type size;
 
-  flags = bfd_get_section_flags (abfd, sec);
+  flags = bfd_section_flags (sec);
   if ((flags & SEC_ALLOC) == 0)
     return;
 
-  size = bfd_get_section_size (sec);
+  size = bfd_section_size (sec);
   if ((flags & SEC_CODE) != 0
       || (selected_output_format == FORMAT_BERKLEY
          && (flags & SEC_READONLY) != 0))
@@ -557,21 +557,25 @@ static void
 sysv_internal_sizer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
                     void *ignore ATTRIBUTE_UNUSED)
 {
-  bfd_size_type size = bfd_section_size (file, sec);
+  flagword flags = bfd_section_flags (sec);
+  /* Exclude sections with no flags set.  This is to omit som spaces.  */
+  if (flags == 0)
+    return;
 
   if (   ! bfd_is_abs_section (sec)
       && ! bfd_is_com_section (sec)
       && ! bfd_is_und_section (sec))
     {
-      int namelen = strlen (bfd_section_name (file, sec));
+      bfd_size_type size = bfd_section_size (sec);
+      int namelen = strlen (bfd_section_name (sec));
 
       if (namelen > svi_namelen)
        svi_namelen = namelen;
 
       svi_total += size;
 
-      if (bfd_section_vma (file, sec) > svi_maxvma)
-       svi_maxvma = bfd_section_vma (file, sec);
+      if (bfd_section_vma (sec) > svi_maxvma)
+       svi_maxvma = bfd_section_vma (sec);
     }
 }
 
@@ -589,17 +593,21 @@ static void
 sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
                       void *ignore ATTRIBUTE_UNUSED)
 {
-  bfd_size_type size = bfd_section_size (file, sec);
+  flagword flags = bfd_section_flags (sec);
+  if (flags == 0)
+    return;
 
   if (   ! bfd_is_abs_section (sec)
       && ! bfd_is_com_section (sec)
       && ! bfd_is_und_section (sec))
     {
+      bfd_size_type size = bfd_section_size (sec);
+
       svi_total += size;
 
-      sysv_one_line (bfd_section_name (file, sec),
+      sysv_one_line (bfd_section_name (sec),
                     size,
-                    bfd_section_vma (file, sec));
+                    bfd_section_vma (sec));
     }
 }
 
This page took 0.03847 seconds and 4 git commands to generate.