gas: blackfin: add tests for recent loop label fixes
[deliverable/binutils-gdb.git] / bfd / elflink.c
index cda897ebd87d6fb736c433ef7722194462c36e95..6d37dc8d4ee31c40a2818a341a21ba60e827900f 100644 (file)
@@ -2341,14 +2341,12 @@ _bfd_elf_link_output_relocs (bfd *output_bfd,
   Elf_Internal_Rela *irelaend;
   bfd_byte *erel;
   struct bfd_elf_section_reloc_data *output_reldata;
-  Elf_Internal_Shdr *output_rel_hdr;
   asection *output_section;
   const struct elf_backend_data *bed;
   void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
   struct bfd_elf_section_data *esdo;
 
   output_section = input_section->output_section;
-  output_rel_hdr = NULL;
 
   bed = get_elf_backend_data (output_bfd);
   esdo = elf_section_data (output_section);
@@ -5013,6 +5011,7 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
        {
          struct elf_link_hash_entry *h;
          bfd *element;
+         bfd *subsbfd = NULL;
          struct bfd_link_hash_entry *undefs_tail;
          symindex mark;
 
@@ -5075,10 +5074,12 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
 
          undefs_tail = info->hash->undefs_tail;
 
-         if (! (*info->callbacks->add_archive_element) (info, element,
-                                                        symdef->name))
+         if (! (*info->callbacks->add_archive_element)
+                               (info, element, symdef->name, &subsbfd))
            goto error_return;
-         if (! bfd_link_add_symbols (element, info))
+         /* Potentially, the add_archive_element hook may have set a
+            substitute BFD for us.  */
+         if (! bfd_link_add_symbols (subsbfd ? subsbfd : element, info))
            goto error_return;
 
          /* If there are any new undefined symbols, we need to make
This page took 0.025795 seconds and 4 git commands to generate.