[PATCH 06/27] bfd/ELF: mark internal LoongArch functions hidden

Jan Beulich jbeulich@suse.com
Mon Oct 27 14:10:22 GMT 2025


This reduces the dynamic symbol table a little and allows the compiler to
be more aggressive about inlining (as it sees fit, of course).

--- a/bfd/elfxx-loongarch.h
+++ b/bfd/elfxx-loongarch.h
@@ -22,29 +22,33 @@
 #include "elf/internal.h"
 
 extern reloc_howto_type *
-loongarch_elf_rtype_to_howto (bfd *abfd, unsigned int r_type);
+loongarch_elf_rtype_to_howto (bfd *abfd, unsigned int r_type) ATTRIBUTE_HIDDEN;
 
 extern reloc_howto_type *
-loongarch_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
+loongarch_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
+  ATTRIBUTE_HIDDEN;
 
 extern reloc_howto_type *
-loongarch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name);
+loongarch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+  ATTRIBUTE_HIDDEN;
 
 extern bfd_reloc_code_real_type
 loongarch_larch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
-				   const char *l_r_name);
+				   const char *l_r_name) ATTRIBUTE_HIDDEN;
 
 bool
-loongarch_adjust_reloc_bitsfield (bfd *, reloc_howto_type *, bfd_vma *);
+loongarch_adjust_reloc_bitsfield (bfd *, reloc_howto_type *, bfd_vma *)
+  ATTRIBUTE_HIDDEN;
 void
 bfd_elf32_loongarch_set_data_segment_info (struct bfd_link_info *, int *);
 void
 bfd_elf64_loongarch_set_data_segment_info (struct bfd_link_info *, int *);
 
 bfd_byte *
-loongarch_write_unsigned_leb128 (bfd_byte *p, unsigned int len, bfd_vma value);
+loongarch_write_unsigned_leb128 (bfd_byte *p, unsigned int len, bfd_vma value)
+  ATTRIBUTE_HIDDEN;
 
-int loongarch_get_uleb128_length (bfd_byte *buf);
+int loongarch_get_uleb128_length (bfd_byte *buf) ATTRIBUTE_HIDDEN;
 
 /* TRUE if this is a PLT reference to a local IFUNC.  */
 #define PLT_LOCAL_IFUNC_P(INFO, H) \



More information about the Binutils mailing list