[binutils-gdb] bfd/XCOFF: mark internal data hidden

Jan Beulich jbeulich@sourceware.org
Fri Nov 21 08:07:58 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0213f3c1fa661b13c6593e19e034d0830be3d12b

commit 0213f3c1fa661b13c6593e19e034d0830be3d12b
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Nov 21 09:05:02 2025 +0100

    bfd/XCOFF: mark internal data hidden
    
    This reduces the dynamic symbol table a bit (about a dozen symbols) and
    allows the compiler to be more aggressive about inlining (as it sees fit,
    of course).

Diff:
---
 bfd/libxcoff.h | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h
index 28893375969..ee27e0a1fa5 100644
--- a/bfd/libxcoff.h
+++ b/bfd/libxcoff.h
@@ -22,6 +22,8 @@
 #ifndef LIBXCOFF_H
 #define LIBXCOFF_H
 
+#include "hidden.h"
+
 /* This is the backend information kept for XCOFF files.  This
    structure is constant for a particular backend.  The first element
    is the COFF backend data structure, so that XCOFF targets can use
@@ -235,21 +237,23 @@ typedef bool xcoff_reloc_function (bfd *, asection *, bfd *,
 typedef bool xcoff_complain_function (bfd *, bfd_vma, bfd_vma,
 					     struct reloc_howto_struct *);
 
-extern xcoff_reloc_function *const xcoff_calculate_relocation[];
-extern xcoff_complain_function *const xcoff_complain_overflow[];
+extern xcoff_reloc_function *const xcoff_calculate_relocation[]
+  ATTRIBUTE_HIDDEN;
+extern xcoff_complain_function *const xcoff_complain_overflow[]
+  ATTRIBUTE_HIDDEN;
 
 #define XCOFF_NO_LONG_SECTION_NAMES  (false), bfd_coff_set_long_section_names_disallowed
 
 /* Relocation functions */
-extern xcoff_reloc_function xcoff_reloc_type_noop;
-extern xcoff_reloc_function xcoff_reloc_type_fail;
-extern xcoff_reloc_function xcoff_reloc_type_pos;
-extern xcoff_reloc_function xcoff_reloc_type_neg;
-extern xcoff_reloc_function xcoff_reloc_type_rel;
-extern xcoff_reloc_function xcoff_reloc_type_toc;
-extern xcoff_reloc_function xcoff_reloc_type_ba;
-extern xcoff_reloc_function xcoff_reloc_type_crel;
-extern xcoff_reloc_function xcoff_reloc_type_tls;
+extern xcoff_reloc_function xcoff_reloc_type_noop ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_fail ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_pos ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_neg ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_rel ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_toc ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_ba ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_crel ATTRIBUTE_HIDDEN;
+extern xcoff_reloc_function xcoff_reloc_type_tls ATTRIBUTE_HIDDEN;
 
 /* Structure to describe dwarf sections.
    Useful to convert from XCOFF section name to flag and vice-versa.


More information about the Binutils-cvs mailing list