aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-12-11 04:38:44 +0000
committerIan Lance Taylor <ian@airs.com>1997-12-11 04:38:44 +0000
commit5ee8d9327b60a4b89e2dfe6a017d0867f96378af (patch)
tree98dfa402560a157f4d00a2b20924b46c180155af /bfd/elflink.h
parent06434f5f166690629f2d5ce14e56a7727b259ed0 (diff)
downloadgdb-5ee8d9327b60a4b89e2dfe6a017d0867f96378af.zip
gdb-5ee8d9327b60a4b89e2dfe6a017d0867f96378af.tar.gz
gdb-5ee8d9327b60a4b89e2dfe6a017d0867f96378af.tar.bz2
* elflink.h (elf_link_input_bfd): Handle a relocateable link in
which a relocation refers to an indirect or warning symbol.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 711372d..7a9e33b 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -4731,6 +4731,7 @@ elf_link_input_bfd (finfo, input_bfd)
|| (elf_bad_symtab (input_bfd)
&& finfo->sections[r_symndx] == NULL))
{
+ struct elf_link_hash_entry *rh;
long indx;
/* This is a reloc against a global symbol. We
@@ -4741,13 +4742,18 @@ elf_link_input_bfd (finfo, input_bfd)
for this symbol. The symbol index is then
set at the end of elf_bfd_final_link. */
indx = r_symndx - extsymoff;
- *rel_hash = elf_sym_hashes (input_bfd)[indx];
+ rh = elf_sym_hashes (input_bfd)[indx];
+ while (rh->root.type == bfd_link_hash_indirect
+ || rh->root.type == bfd_link_hash_warning)
+ rh = (struct elf_link_hash_entry *) rh->root.u.i.link;
/* Setting the index to -2 tells
elf_link_output_extsym that this symbol is
used by a reloc. */
- BFD_ASSERT ((*rel_hash)->indx < 0);
- (*rel_hash)->indx = -2;
+ BFD_ASSERT (rh->indx < 0);
+ rh->indx = -2;
+
+ *rel_hash = rh;
continue;
}