]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/ELF: properly mark bfd_elf_{,gc_common_}final_link() as private
authorJan Beulich <jbeulich@suse.com>
Fri, 14 Nov 2025 08:03:49 +0000 (09:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 14 Nov 2025 08:03:49 +0000 (09:03 +0100)
They're solely used as hook functions (or helpers thereof), so aren't
intended to be invoked directly from outside the library. Add underscore
prefixes and make them hidden.

18 files changed:
bfd/elf-bfd.h
bfd/elf32-arm.c
bfd/elf32-bfin.c
bfd/elf32-cris.c
bfd/elf32-hppa.c
bfd/elf32-m68k.c
bfd/elf32-rx.c
bfd/elf32-spu.c
bfd/elf32-tic6x.c
bfd/elf32-vax.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ia64-vms.c
bfd/elf64-mmix.c
bfd/elflink.c
bfd/elfnn-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-target.h

index e7ee074f1c7624cd4ef1bc62fcb2223a2d3a9114..c9aa3ff9ca9b39666df75a7a9c4aaf7b0399f176 100644 (file)
@@ -2843,8 +2843,8 @@ extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
   (bfd *, arelent *, struct bfd_symbol *, void *,
    asection *, bfd *, char **) ATTRIBUTE_HIDDEN;
 
-extern bool bfd_elf_final_link
-  (bfd *, struct bfd_link_info *);
+extern bool _bfd_elf_final_link
+  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
 
 extern void _bfd_elf_gc_keep
   (struct bfd_link_info *info) ATTRIBUTE_HIDDEN;
@@ -2886,8 +2886,8 @@ extern bool _bfd_elf_gc_mark_extra_sections
 extern bool bfd_elf_gc_common_finalize_got_offsets
   (bfd *, struct bfd_link_info *);
 
-extern bool bfd_elf_gc_common_final_link
-  (bfd *, struct bfd_link_info *);
+extern bool _bfd_elf_gc_common_final_link
+  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
 
 extern bool bfd_elf_reloc_symbol_deleted_p
   (bfd_vma, void *);
index ed2f5467c1ea5515db0b69522ef30a81439546fc..b1426e1744c7e567988f82cf6440e1cd6d5965b7 100644 (file)
@@ -13693,7 +13693,7 @@ elf32_arm_final_link (bfd *abfd, struct bfd_link_info *info)
     return false;
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   /* Process stub sections (eg BE8 encoding, ...).  */
index e5ad4d6ca0a51e729e0bccaf0ad71721ea5e8c95..4da3e0ec0e739a9294c46f39891596d1109b748e 100644 (file)
@@ -5425,7 +5425,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
                                        _bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
                                        bfin_link_hash_table_create
-#define bfd_elf32_bfd_final_link       bfd_elf_gc_common_final_link
+#define bfd_elf32_bfd_final_link       _bfd_elf_gc_common_final_link
 
 #define elf_backend_check_relocs       bfin_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
index 77e8201b4a6be89336b509426d761ff418c03a56..cb88725cc50b17a8dd11349719e2556e30354bc2 100644 (file)
@@ -4100,8 +4100,7 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
        elf_cris_finish_dynamic_sections
 #define elf_backend_create_dynamic_sections \
        _bfd_elf_create_dynamic_sections
-#define bfd_elf32_bfd_final_link \
-       bfd_elf_gc_common_final_link
+#define bfd_elf32_bfd_final_link               _bfd_elf_gc_common_final_link
 #define elf_backend_hide_symbol                        elf_cris_hide_symbol
 #define elf_backend_reloc_type_class           elf_cris_reloc_type_class
 
index 3a7237dbe7d31a888b0ed49d057912ab0a306360..4721cad619a2d92f59e91332665d274b2d5997c7 100644 (file)
@@ -3043,7 +3043,7 @@ elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
   struct stat buf;
 
   /* Invoke the regular ELF linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   /* If we're producing a final executable, sort the contents of the
index b5df42d7488d75e4fd2bb0f1eeef119417ff1996..b1147ad7d9fad2d497a4aab563e98ff7b7407415 100644 (file)
@@ -4629,7 +4629,7 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
                                        _bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
                                        elf_m68k_link_hash_table_create
-#define bfd_elf32_bfd_final_link       bfd_elf_final_link
+#define bfd_elf32_bfd_final_link       _bfd_elf_final_link
 
 #define elf_backend_check_relocs       elf_m68k_check_relocs
 #define elf_backend_early_size_sections \
index 3aeb80bf1fb3abe1b23ae309e8a44e88afd3dc1c..5c8921e27c40d6008409d3ab880d23086c1b6b68 100644 (file)
@@ -3684,7 +3684,7 @@ rx_final_link (bfd * abfd, struct bfd_link_info * info)
        }
     }
 
-  return bfd_elf_final_link (abfd, info);
+  return _bfd_elf_final_link (abfd, info);
 }
 
 static bool
index de051e481851cd770d9c8d390f3d99e75f3180e0..adea6d0d51cbb71328edb4e423abd9b1151ef970 100644 (file)
@@ -3428,7 +3428,7 @@ struct _mos_param {
 
 /* Set linker_mark and gc_mark on any sections that we will put in
    overlays.  These flags are used by the generic ELF linker, but we
-   won't be continuing on to bfd_elf_final_link so it is OK to use
+   won't be continuing on to _bfd_elf_final_link() so it is OK to use
    them.  linker_mark is clear before we get here.  Set segment_mark
    on sections that are part of a pasted function (excluding the last
    section).
@@ -4744,7 +4744,7 @@ spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info)
   if (!spu_elf_build_stubs (info))
     info->callbacks->fatal (_("%P: can not build overlay stubs: %E\n"));
 
-  return bfd_elf_final_link (output_bfd, info);
+  return _bfd_elf_final_link (output_bfd, info);
 }
 
 /* Called when not normally emitting relocs, ie. !bfd_link_relocatable (info)
index 98b3a894ee52da12e038c8bc4234f3866774c926..eb980f9268c84b4b85d5853453858ec23d2a67ca 100644 (file)
@@ -1594,10 +1594,7 @@ elf32_tic6x_final_link (bfd *abfd, struct bfd_link_info *info)
        }
     }
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
-    return false;
-
-  return true;
+  return _bfd_elf_final_link (abfd, info);
 }
 
 /* Called to pass PARAMS to the backend.  We store them in the hash table
index 37a96492d619afd70e37dcfb9b0dcce35b981aa7..aa21c74b3f9b57ccec6b51f48d1715aed28a976e 100644 (file)
@@ -1859,7 +1859,7 @@ elf_vax_plt_sym_val (bfd_vma i, const asection *plt,
                                        _bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
                                        elf_vax_link_hash_table_create
-#define bfd_elf32_bfd_final_link       bfd_elf_gc_common_final_link
+#define bfd_elf32_bfd_final_link       _bfd_elf_gc_common_final_link
 
 #define elf_backend_check_relocs       elf_vax_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
index 967c9c3c4147bdf245d734b7b24b25c4dbd79ade..077539bdcfd62ceeae72b3695988d26d4c24d705 100644 (file)
@@ -5253,7 +5253,7 @@ elf64_alpha_final_link (bfd *abfd, struct bfd_link_info *info)
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (! bfd_elf_final_link (abfd, info))
+  if (! _bfd_elf_final_link (abfd, info))
     return false;
 
   /* Now write out the computed sections.  */
index 582c28f718f6a0fd98e148bbc2122e824a309dad..d2f0211d8adafc610f4446094d3a2a9d983dd016 100644 (file)
@@ -2992,7 +2992,7 @@ elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
                          info);
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   elf_link_hash_traverse (elf_hash_table (info),
index 65498ee4fb93e8712d9415bb4464e10f81fc62f2..8f80a92e23f77962d5a47b0ca162a42435832efc 100644 (file)
@@ -3348,7 +3348,7 @@ elf64_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   if (unwind_output_sec)
index 223a85044f2f5e0790ead2e8d11e89c78eed823e..319369b2d0bb6b69b0ca915196861f23d17f401d 100644 (file)
@@ -2216,7 +2216,7 @@ mmix_elf_final_link (bfd *abfd, struct bfd_link_info *info)
        }
     }
 
-  if (! bfd_elf_final_link (abfd, info))
+  if (! _bfd_elf_final_link (abfd, info))
     return false;
 
   /* Since this section is marked SEC_LINKER_CREATED, it isn't output by
index 359d1c59248da9c4a76c89300901e14c5ae7c065..ec3ad9735fe89347359d3ae988e631a725549f12 100644 (file)
@@ -12616,7 +12616,7 @@ elf_final_link_free (bfd *obfd, struct elf_final_link_info *flinfo)
 /* Do the final step of an ELF link.  */
 
 bool
-bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
+_bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 {
   bool dynamic;
   bool emit_relocs;
@@ -15066,13 +15066,13 @@ bfd_elf_gc_common_finalize_got_offsets (bfd *abfd,
    got entry reference counting is enabled.  */
 
 bool
-bfd_elf_gc_common_final_link (bfd *abfd, struct bfd_link_info *info)
+_bfd_elf_gc_common_final_link (bfd *abfd, struct bfd_link_info *info)
 {
   if (!bfd_elf_gc_common_finalize_got_offsets (abfd, info))
     return false;
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  return bfd_elf_final_link (abfd, info);
+  return _bfd_elf_final_link (abfd, info);
 }
 
 bool
index 2ff82919350b64271ae176cb1d687c7db4655871..abee1516505dc212bc5fa440e5fb9bfa3156f6e0 100644 (file)
@@ -3739,7 +3739,7 @@ elfNN_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   if (unwind_output_sec)
index 80e7e08308aaf5cd2a85de8de454a8e1b6c49eaf..4460531e58405810f8eb188f6173ed8d20a47328 100644 (file)
@@ -15504,7 +15504,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elf_final_link (abfd, info))
+  if (!_bfd_elf_final_link (abfd, info))
     return false;
 
   /* Now write out the computed sections.  */
index 27b07c9b1c4b039df2cc466167845d56f38d2565..301a2d1bc93dc19f766385f67c50a6e83a349963 100644 (file)
 #define bfd_elfNN_bfd_define_start_stop bfd_elf_define_start_stop
 #endif
 #ifndef bfd_elfNN_bfd_final_link
-#define bfd_elfNN_bfd_final_link       bfd_elf_final_link
+#define bfd_elfNN_bfd_final_link       _bfd_elf_final_link
 #endif
 #undef TARGET_MERGE_SECTIONS
 #define TARGET_MERGE_SECTIONS true