Remove moxie, msp and mt check_relocs

Message ID auJ2yCpvnXwWfOD6@squeak.grove.modra.org
State New
Headers
Series Remove moxie, msp and mt check_relocs |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Alan Modra Oct. 28, 2026, 10:27 p.m. UTC
  These functions do nothing.

	* elf32-moxie.c (moxie_elf_check_relocs): Delete.
	(elf_backend_check_relocs): Don't define.
	* elf32-msp430.c (elf32_msp430_check_relocs): Delete.
	(elf_backend_check_relocs): Don't define.
	* elf32-mt.c (mt_elf_check_relocs): Delete.
	(elf_backend_check_relocs): Don't define.
  

Patch

diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index 18eb9c2124f..f9948d0bfd3 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -311,48 +311,6 @@  moxie_elf_relocate_section (struct bfd_link_info *info,
   return true;
 }
 
-/* Look through the relocs for a section during the first phase.
-   Since we don't do .gots or .plts, we just need to consider the
-   virtual table relocs for gc.  */
-
-static bool
-moxie_elf_check_relocs (bfd *abfd,
-			struct bfd_link_info *info,
-			asection *sec,
-			const Elf_Internal_Rela *relocs)
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
-  const Elf_Internal_Rela *rel;
-  const Elf_Internal_Rela *rel_end;
-
-  if (bfd_link_relocatable (info))
-    return true;
-
-  symtab_hdr = &elf_symtab_hdr (abfd);
-  sym_hashes = elf_sym_hashes (abfd);
-
-  rel_end = relocs + sec->reloc_count;
-  for (rel = relocs; rel < rel_end; rel++)
-    {
-      struct elf_link_hash_entry *h;
-      unsigned long r_symndx;
-
-      r_symndx = ELF32_R_SYM (rel->r_info);
-      if (r_symndx < symtab_hdr->sh_info)
-	h = NULL;
-      else
-	{
-	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-	  while (h->root.type == bfd_link_hash_indirect
-		 || h->root.type == bfd_link_hash_warning)
-	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	}
-    }
-
-  return true;
-}
-
 #define ELF_ARCH		bfd_arch_moxie
 #define ELF_MACHINE_CODE	EM_MOXIE
 #define ELF_MACHINE_ALT1	EM_MOXIE_OLD
@@ -366,7 +324,6 @@  moxie_elf_check_relocs (bfd *abfd,
 #define elf_info_to_howto_rel			NULL
 #define elf_info_to_howto			moxie_info_to_howto_rela
 #define elf_backend_relocate_section		moxie_elf_relocate_section
-#define elf_backend_check_relocs		moxie_elf_check_relocs
 
 #define elf_backend_can_gc_sections		1
 #define elf_backend_rela_normal			1
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index add0a6826ae..c36e6216a04 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -754,46 +754,6 @@  msp430_info_to_howto_rela (bfd * abfd,
   return true;
 }
 
-/* Look through the relocs for a section during the first phase.
-   Since we don't do .gots or .plts, we just need to consider the
-   virtual table relocs for gc.  */
-
-static bool
-elf32_msp430_check_relocs (bfd * abfd, struct bfd_link_info * info,
-			   asection * sec, const Elf_Internal_Rela * relocs)
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
-  const Elf_Internal_Rela *rel;
-  const Elf_Internal_Rela *rel_end;
-
-  if (bfd_link_relocatable (info))
-    return true;
-
-  symtab_hdr = &elf_symtab_hdr (abfd);
-  sym_hashes = elf_sym_hashes (abfd);
-
-  rel_end = relocs + sec->reloc_count;
-  for (rel = relocs; rel < rel_end; rel++)
-    {
-      struct elf_link_hash_entry *h;
-      unsigned long r_symndx;
-
-      r_symndx = ELF32_R_SYM (rel->r_info);
-      if (r_symndx < symtab_hdr->sh_info)
-	h = NULL;
-      else
-	{
-	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-	  while (h->root.type == bfd_link_hash_indirect
-		 || h->root.type == bfd_link_hash_warning)
-	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	}
-    }
-
-  return true;
-}
-
 /* Perform a single relocation.  By default we use the standard BFD
    routines, but a few relocs, we have to do them ourselves.  */
 
@@ -2963,7 +2923,6 @@  elf32_msp430_eh_frame_address_size (bfd *abfd,
 #define elf_info_to_howto		     msp430_info_to_howto_rela
 #define elf_info_to_howto_rel		     NULL
 #define elf_backend_relocate_section	     elf32_msp430_relocate_section
-#define elf_backend_check_relocs	     elf32_msp430_check_relocs
 #define elf_backend_can_gc_sections	     1
 #define elf_backend_final_write_processing   bfd_elf_msp430_final_write_processing
 #define elf_backend_object_p		     elf32_msp430_object_p
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index 0bd8f05bb2d..ea22a420e98 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -417,48 +417,6 @@  mt_elf_relocate_section
   return true;
 }
 
-/* Look through the relocs for a section during the first phase.
-   Since we don't do .gots or .plts, we just need to consider the
-   virtual table relocs for gc.  */
-
-static bool
-mt_elf_check_relocs (bfd *abfd,
-		     struct bfd_link_info *info,
-		     asection *sec,
-		     const Elf_Internal_Rela *relocs)
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
-  const Elf_Internal_Rela *rel;
-  const Elf_Internal_Rela *rel_end;
-
-  if (bfd_link_relocatable (info))
-    return true;
-
-  symtab_hdr = &elf_symtab_hdr (abfd);
-  sym_hashes = elf_sym_hashes (abfd);
-
-  rel_end = relocs + sec->reloc_count;
-  for (rel = relocs; rel < rel_end; rel++)
-    {
-      struct elf_link_hash_entry *h;
-      unsigned long r_symndx;
-
-      r_symndx = ELF32_R_SYM (rel->r_info);
-      if (r_symndx < symtab_hdr->sh_info)
-	h = NULL;
-      else
-	{
-	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-	  while (h->root.type == bfd_link_hash_indirect
-		 || h->root.type == bfd_link_hash_warning)
-	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	}
-    }
-
-  return true;
-}
-
 /* Return the MACH for an e_flags value.  */
 
 static int
@@ -585,7 +543,6 @@  mt_elf_print_private_bfd_data (bfd *abfd, void *ptr)
 #define bfd_elf32_bfd_reloc_type_lookup		mt_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup	  mt_reloc_name_lookup
 
-#define elf_backend_check_relocs		mt_elf_check_relocs
 #define elf_backend_object_p			mt_elf_object_p
 #define elf_backend_rela_normal			1