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);
{
struct elf_link_hash_entry *h;
bfd *element;
+ bfd *subsbfd = NULL;
struct bfd_link_hash_entry *undefs_tail;
symindex mark;
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