* thread-db.c (enable_thread_event_reporting): Correct warning
[deliverable/binutils-gdb.git] / bfd / elfcode.h
index 4984896d65db2694808dfef17bbe44300edb15aa..d9f3e059dcb01238c6c5fa1e3ae3916a76b8ae95 100644 (file)
@@ -66,6 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
+#include "libiberty.h"
 #include "bfdlink.h"
 #include "libbfd.h"
 #include "elf-bfd.h"
@@ -1372,11 +1373,9 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
        return true;
 
       rel_hdr = &d->rel_hdr;
-      reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+      reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
       rel_hdr2 = d->rel_hdr2;
-      reloc_count2 = (rel_hdr2
-                     ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize)
-                     : 0);
+      reloc_count2 = (rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0);
 
       BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
       BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
@@ -1393,7 +1392,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
        return true;
 
       rel_hdr = &d->this_hdr;
-      reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+      reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
       rel_hdr2 = NULL;
       reloc_count2 = 0;
     }
This page took 0.02428 seconds and 4 git commands to generate.