From: Ian Lance Taylor Date: Thu, 11 Dec 1997 04:38:44 +0000 (+0000) Subject: * elflink.h (elf_link_input_bfd): Handle a relocateable link in X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ee8d9327b60a4b89e2dfe6a017d0867f96378af;p=binutils-gdb.git * elflink.h (elf_link_input_bfd): Handle a relocateable link in which a relocation refers to an indirect or warning symbol. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d4c8bb3d49b..e8fc13fd700 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,30 @@ +Wed Dec 10 23:37:11 1997 Ian Lance Taylor + + * elflink.h (elf_link_input_bfd): Handle a relocateable link in + which a relocation refers to an indirect or warning symbol. + Wed Dec 10 11:15:55 1997 Nick Clifton + * coff-arm.c (bfd_arm_coff_final_link): Function deleted. + (coff_arm_final_link_postscript): New function. + (coff_arm_link_output_has_begun): New function. + + * libcoff.h (struct bfd_coff_backend_data): Add new fields: + _bfd_coff_link_output_has_begun and + _bfd_coff_final_link_postscript. Add new macros: + bfd_coff_link_output_has_begun() and + bfd_coff_final_link_postscript(). + + * cofflink.c (_bfd_coff_final_link): Insert calls to + bfd_coff_link_output_has_begun() and + bfd_coff_final_link_postscript(). + + * coffcode.h: Add two new fields to bfd_coff_backend_data + structure: _bfd_coff_link_output_has_begun and + _bfd_coff_final_link_postscript. Add default initialisers for + these fields. Add overridable aliases for the coff swap functions + in the backend data structure. + * elf32-v850.c: Update with patches from the branch to fix HI16_S/LO16 reloc pairs. diff --git a/bfd/elflink.h b/bfd/elflink.h index 711372d88cd..7a9e33b043b 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; }