* elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
authorIan Lance Taylor <ian@airs.com>
Mon, 1 Aug 1994 16:34:09 +0000 (16:34 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 1 Aug 1994 16:34:09 +0000 (16:34 +0000)
if there aren't any.

bfd/ChangeLog
bfd/elfcode.h

index d6b9f25a8e96606d5dda063efd9cd91e93123e69..9ced001c190e9c53f85ee3f9e8518b46b9c82fa8 100644 (file)
@@ -1,5 +1,8 @@
 Mon Aug  1 12:04:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
+       * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
+       if there aren't any.
+
        * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
        * hosts/solaris2.h: Remove.
        * config/solaris2.mh: Remove.
index 49f24c4cf575d76cba47467a5822b3aa3ca24873..6e0f2d0dea978b4734f60f6346439f7181d36c5d 100644 (file)
@@ -2928,7 +2928,9 @@ elf_slurp_reloc_table (abfd, asect, symbols)
   unsigned int i;
   int entsize;
 
-  if (asect->relocation != NULL)
+  if (asect->relocation != NULL
+      || (asect->flags & SEC_RELOC) == 0
+      || asect->reloc_count == 0)
     return true;
 
   BFD_ASSERT (asect->rel_filepos == d->rel_hdr.sh_offset
@@ -5034,7 +5036,7 @@ elf_adjust_dynamic_symbol (h, data)
       BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined);
       BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
       if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
-         || (weakdef->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
+         || (weakdef->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0)
        {
          /* This symbol is defined or referenced by a regular object
             file, so we will not do anything special.  Clear weakdef
This page took 0.033983 seconds and 4 git commands to generate.