* elflink.h (elf_link_input_bfd): Handle a relocateable link in
authorIan Lance Taylor <ian@airs.com>
Thu, 11 Dec 1997 04:38:44 +0000 (04:38 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 11 Dec 1997 04:38:44 +0000 (04:38 +0000)
which a relocation refers to an indirect or warning symbol.

bfd/ChangeLog
bfd/elflink.h

index d4c8bb3d49b14dddf60e4a334eb8c37e547da7bd..e8fc13fd7006d90f29b52d60f11946418025f367 100644 (file)
@@ -1,5 +1,30 @@
+Wed Dec 10 23:37:11 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * 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  <nickc@cygnus.com>
 
+       * 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.
 
index 711372d88cdbd0e79531a7ec82d6e31ac95fb0f7..7a9e33b043b550a427e7fa16f8663cc3cf221de7 100644 (file)
@@ -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;
                    }