diff options
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r-- | bfd/elfxx-x86.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 3a0dffc..8cda8d2 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -1742,6 +1742,53 @@ _bfd_x86_elf_link_fixup_ifunc_symbol (struct bfd_link_info *info, } } +/* Report relative relocation. */ + +void +_bfd_x86_elf_link_report_relative_reloc + (struct bfd_link_info *info, asection *asect, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym, + const char *reloc_name, const void *reloc) +{ + const char *name; + bfd *abfd; + const Elf_Internal_Rela *rel = (const Elf_Internal_Rela *) reloc; + char r_offset[30], r_info[30]; + + /* Use the output BFD for linker created sections. */ + if ((asect->flags & SEC_LINKER_CREATED) != 0) + abfd = info->output_bfd; + else + abfd = asect->owner; + + if (h != NULL && h->root.root.string != NULL) + name = h->root.root.string; + else + name = bfd_elf_sym_name (abfd, &elf_symtab_hdr (abfd), sym, NULL); + + bfd_sprintf_vma (abfd, r_offset, rel->r_offset); + bfd_sprintf_vma (abfd, r_info, rel->r_info); + + if (asect->use_rela_p) + { + char r_addend[30]; + + bfd_sprintf_vma (abfd, r_addend, rel->r_addend); + + info->callbacks->einfo + (_("%pB: %s (offset: 0x%s, info: 0x%s, addend: 0x%s) against " + "'%s' " "for section '%pA' in %pB\n"), + info->output_bfd, reloc_name, r_offset, r_info, r_addend, + name, asect, abfd); + } + else + info->callbacks->einfo + (_("%pB: %s (offset: 0x%s, info: 0x%s) against '%s' for section " + "'%pA' in %pB\n"), + info->output_bfd, reloc_name, r_offset, r_info, name, + asect, abfd); +} + /* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ bfd_boolean |