x86: Treat relocation against IFUNC symbol as FUNC
[deliverable/binutils-gdb.git] / bfd / elf32-sh.c
index b4854a2cead08c4d32165050602542723928dfb9..d0f5ac8f29d2fe9b40dab0363467eeb14c119f47 100644 (file)
@@ -472,7 +472,7 @@ sh_elf_reloc_name_lookup (bfd *abfd, const char *r_name)
 
 /* Given an ELF reloc, fill in the howto field of a relent.  */
 
-static void
+static bfd_boolean
 sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
   unsigned int r;
@@ -488,13 +488,14 @@ sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
       || (r >= R_SH_FIRST_INVALID_RELOC_6 && r <= R_SH_LAST_INVALID_RELOC_6))
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%B: unrecognised SH reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r);
       bfd_set_error (bfd_error_bad_value);
-      r = R_SH_NONE;
+      return FALSE;
     }
 
   cache_ptr->howto = get_howto_table (abfd) + r;
+  return TRUE;
 }
 \f
 /* This function handles relaxing for SH ELF.  See the corresponding
@@ -577,8 +578,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
       if (laddr >= sec->size)
        {
          /* xgettext:c-format */
-         _bfd_error_handler (_("%B: %#Lx: warning: bad R_SH_USES offset"),
-                             abfd, irel->r_offset);
+         _bfd_error_handler
+           (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES offset"),
+            abfd, (uint64_t) irel->r_offset);
          continue;
        }
       insn = bfd_get_16 (abfd, contents + laddr);
@@ -589,8 +591,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%B: %#Lx: warning: R_SH_USES points to unrecognized insn 0x%x"),
-            abfd, irel->r_offset, insn);
+           (_("%pB: %#" PRIx64 ": warning: "
+              "R_SH_USES points to unrecognized insn 0x%x"),
+            abfd, (uint64_t) irel->r_offset, insn);
          continue;
        }
 
@@ -607,8 +610,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%B: %#Lx: warning: bad R_SH_USES load offset"),
-            abfd, irel->r_offset);
+           (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES load offset"),
+            abfd, (uint64_t) irel->r_offset);
          continue;
        }
 
@@ -623,8 +626,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%B: %#Lx: warning: could not find expected reloc"),
-            abfd, paddr);
+           (_("%pB: %#" PRIx64 ": warning: could not find expected reloc"),
+            abfd, (uint64_t) paddr);
          continue;
        }
 
@@ -652,8 +655,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: warning: symbol in unexpected section"),
-                abfd, paddr);
+               (_("%pB: %#" PRIx64 ": warning: symbol in unexpected section"),
+                abfd, (uint64_t) paddr);
              continue;
            }
 
@@ -782,8 +785,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%B: %#Lx: warning: could not find expected COUNT reloc"),
-            abfd, paddr);
+           (_("%pB: %#" PRIx64 ": warning: "
+              "could not find expected COUNT reloc"),
+            abfd, (uint64_t) paddr);
          continue;
        }
 
@@ -792,8 +796,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
       if (irelcount->r_addend == 0)
        {
          /* xgettext:c-format */
-         _bfd_error_handler (_("%B: %#Lx: warning: bad count"),
-                             abfd, paddr);
+         _bfd_error_handler (_("%pB: %#" PRIx64 ": warning: bad count"),
+                             abfd, (uint64_t) paddr);
          continue;
        }
 
@@ -1196,8 +1200,8 @@ sh_elf_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
-                abfd, irel->r_offset);
+               (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"),
+                abfd, (uint64_t) irel->r_offset);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -1567,8 +1571,8 @@ sh_elf_swap_insns (bfd *abfd, asection *sec, void *relocs,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
-                abfd, irel->r_offset);
+               (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"),
+                abfd, (uint64_t) irel->r_offset);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -3286,7 +3290,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
 
       info->flags |= DF_TEXTREL;
       info->callbacks->minfo
-       (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"),
+       (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
         sec->owner, h->root.root.string, sec);
 
       /* Not an error, just cut short the traversal.  */
@@ -3389,7 +3393,7 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
                  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
                    {
                      info->flags |= DF_TEXTREL;
-                     info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"),
+                     info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"),
                                              p->sec->owner, p->sec);
                    }
 
@@ -3944,7 +3948,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          if ((sym->st_other & STO_SH5_ISA32) != 0)
            (*info->callbacks->reloc_dangerous)
              (info,
-              _("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
+              _("unexpected STO_SH5_ISA32 on local symbol is not handled"),
               input_bfd, input_section, rel->r_offset);
 
          if (sec != NULL && discarded_section (sec))
@@ -4000,9 +4004,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B(%A+%#Lx): %s relocation against SEC_MERGE section"),
+                   (_("%pB(%pA+%#" PRIx64 "): "
+                      "%s relocation against SEC_MERGE section"),
                     input_bfd, input_section,
-                    rel->r_offset, howto->name);
+                    (uint64_t) rel->r_offset, howto->name);
                  return FALSE;
                }
 
@@ -4118,10 +4123,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"),
+                   (_("%pB(%pA+%#" PRIx64 "): "
+                      "unresolvable %s relocation against symbol `%s'"),
                     input_bfd,
                     input_section,
-                    rel->r_offset,
+                    (uint64_t) rel->r_offset,
                     howto->name,
                     h->root.root.string);
                  return FALSE;
@@ -4197,9 +4203,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B: %#Lx: fatal: unaligned branch target for relax-support relocation"),
+                   (_("%pB: %#" PRIx64 ": fatal: "
+                      "unaligned branch target for relax-support relocation"),
                     input_section->owner,
-                    rel->r_offset);
+                    (uint64_t) rel->r_offset);
                  bfd_set_error (bfd_error_bad_value);
                  return FALSE;
                }
@@ -4231,10 +4238,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: unaligned %s relocation %#Lx"),
-                input_section->owner,
-                rel->r_offset, howto->name,
-                relocation);
+               (_("%pB: %#" PRIx64 ": fatal: "
+                  "unaligned %s relocation %#" PRIx64),
+                input_section->owner, (uint64_t) rel->r_offset,
+                howto->name, (uint64_t) relocation);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -4247,10 +4254,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: unaligned %s relocation %#Lx"),
+               (_("%pB: %#" PRIx64 ": fatal: "
+                  "unaligned %s relocation %#" PRIx64 ""),
                 input_section->owner,
-                rel->r_offset, howto->name,
-                relocation);
+                (uint64_t) rel->r_offset, howto->name,
+                (uint64_t) relocation);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -4262,10 +4270,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: R_SH_PSHA relocation %Ld not in range -32..32"),
+               (_("%pB: %#" PRIx64 ": fatal: R_SH_PSHA relocation %" PRId64
+                  " not in range -32..32"),
                 input_section->owner,
-                rel->r_offset,
-                relocation);
+                (uint64_t) rel->r_offset,
+                (int64_t) relocation);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -4277,10 +4286,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B: %#Lx: fatal: R_SH_PSHL relocation %Ld not in range -32..32"),
+               (_("%pB: %#" PRIx64 ": fatal: R_SH_PSHL relocation %" PRId64
+                  " not in range -32..32"),
                 input_section->owner,
-                rel->r_offset,
-                relocation);
+                (uint64_t) rel->r_offset,
+                (int64_t) relocation);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -4423,10 +4433,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B(%A+%#Lx): cannot emit fixup to `%s' in read-only section"),
+                     (_("%pB(%pA+%#" PRIx64 "): "
+                        "cannot emit fixup to `%s' in read-only section"),
                       input_bfd,
                       input_section,
-                      rel->r_offset,
+                      (uint64_t) rel->r_offset,
                       symname);
                    return FALSE;
                  }
@@ -4896,10 +4907,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B(%A+%#Lx): cannot emit fixup to `%s' in read-only section"),
+                     (_("%pB(%pA+%#" PRIx64 "): "
+                        "cannot emit fixup to `%s' in read-only section"),
                       input_bfd,
                       input_section,
-                      rel->r_offset,
+                      (uint64_t) rel->r_offset,
                       symname);
                    return FALSE;
                  }
@@ -4998,9 +5010,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%B(%A+%#Lx): %s relocation against external symbol \"%s\""),
-                input_bfd, input_section, rel->r_offset, howto->name,
-                h->root.root.string);
+               (_("%pB(%pA+%#" PRIx64 "): "
+                  "%s relocation against external symbol \"%s\""),
+                input_bfd, input_section, (uint64_t) rel->r_offset,
+                howto->name, h->root.root.string);
              return FALSE;
            }
          else
@@ -6043,18 +6056,18 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                      && (old_got_type == GOT_NORMAL || got_type == GOT_NORMAL))
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B: `%s' accessed both as normal and FDPIC symbol"),
+                     (_("%pB: `%s' accessed both as normal and FDPIC symbol"),
                       abfd, h->root.root.string);
                  else if (old_got_type == GOT_FUNCDESC
                           || got_type == GOT_FUNCDESC)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B: `%s' accessed both as FDPIC and thread local symbol"),
+                     (_("%pB: `%s' accessed both as FDPIC and thread local symbol"),
                       abfd, h->root.root.string);
                  else
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B: `%s' accessed both as normal and thread local symbol"),
+                     (_("%pB: `%s' accessed both as normal and thread local symbol"),
                       abfd, h->root.root.string);
                  return FALSE;
                }
@@ -6080,7 +6093,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
          if (rel->r_addend)
            {
              _bfd_error_handler
-               (_("%B: Function descriptor relocation with non-zero addend"),
+               (_("%pB: Function descriptor relocation with non-zero addend"),
                 abfd);
              return FALSE;
            }
@@ -6129,12 +6142,12 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                  if (old_got_type == GOT_NORMAL)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B: `%s' accessed both as normal and FDPIC symbol"),
+                     (_("%pB: `%s' accessed both as normal and FDPIC symbol"),
                       abfd, h->root.root.string);
                  else
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%B: `%s' accessed both as FDPIC and thread local symbol"),
+                     (_("%pB: `%s' accessed both as FDPIC and thread local symbol"),
                       abfd, h->root.root.string);
                }
            }
@@ -6318,7 +6331,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
          if (bfd_link_dll (info))
            {
              _bfd_error_handler
-               (_("%B: TLS local exec code cannot be linked into shared objects"),
+               (_("%pB: TLS local exec code cannot be linked into shared objects"),
                 abfd);
              return FALSE;
            }
@@ -6433,7 +6446,7 @@ sh_merge_bfd_arch (bfd *ibfd, struct bfd_link_info *info)
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%B: uses %s instructions while previous modules "
+       (_("%pB: uses %s instructions while previous modules "
           "use %s instructions"),
         ibfd,
         SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point",
@@ -6482,7 +6495,7 @@ sh_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
 
   if (! sh_merge_bfd_arch (ibfd, info))
     {
-      _bfd_error_handler (_("%B: uses instructions which are incompatible "
+      _bfd_error_handler (_("%pB: uses instructions which are incompatible "
                            "with instructions used in previous modules"),
                          ibfd);
       bfd_set_error (bfd_error_bad_value);
@@ -6495,7 +6508,7 @@ sh_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
 
   if (fdpic_object_p (ibfd) != fdpic_object_p (obfd))
     {
-      _bfd_error_handler (_("%B: attempt to mix FDPIC and non-FDPIC objects"),
+      _bfd_error_handler (_("%pB: attempt to mix FDPIC and non-FDPIC objects"),
                          ibfd);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
This page took 0.030222 seconds and 4 git commands to generate.