aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-08-01 16:34:09 +0000
committerIan Lance Taylor <ian@airs.com>1994-08-01 16:34:09 +0000
commitd510fd893a16c3d262614d25d1812ba842da4f3a (patch)
tree843eae26e98787e4942590aa751fb49dbe854ec6 /bfd/elfcode.h
parentabc61566c032581e072608484cc4691fd4486c54 (diff)
downloadgdb-d510fd893a16c3d262614d25d1812ba842da4f3a.zip
gdb-d510fd893a16c3d262614d25d1812ba842da4f3a.tar.gz
gdb-d510fd893a16c3d262614d25d1812ba842da4f3a.tar.bz2
* elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
if there aren't any.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 49f24c4..6e0f2d0 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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