]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd: move ATTRIBUTE_HIDDEN to separate header master
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Nov 2025 07:10:49 +0000 (08:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Nov 2025 07:10:49 +0000 (08:10 +0100)
... for it to become usable in places where libbfd.h cannot (easily) be
included.

bfd/Makefile.am
bfd/Makefile.in
bfd/hidden.h [new file with mode: 0644]
bfd/libbfd-in.h
bfd/libbfd.h
bfd/po/SRC-POTFILES.in

index 3c3243269f12a603d2036d61c0c7a26db070d610..557848483e7b8eb7be13ac100746fb2d57ef4dc4 100644 (file)
@@ -710,7 +710,7 @@ SOURCE_HFILES = \
        elf-linux-core.h elf-s390.h elf-vxworks.h \
        elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \
        elfxx-sparc.h elfxx-tilegx.h elfxx-x86.h elfxx-loongarch.h \
-       genlink.h go32stub.h \
+       genlink.h go32stub.h hidden.h \
        libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
        libpei.h libxcoff.h \
        mach-o.h \
index 6d1944c266437b03f29cca1eea933a642bb093fc..ab92d52ad75b0dec79c3617282c6acfa97251912 100644 (file)
@@ -1176,7 +1176,7 @@ SOURCE_HFILES = \
        elf-linux-core.h elf-s390.h elf-vxworks.h \
        elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \
        elfxx-sparc.h elfxx-tilegx.h elfxx-x86.h elfxx-loongarch.h \
-       genlink.h go32stub.h \
+       genlink.h go32stub.h hidden.h \
        libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
        libpei.h libxcoff.h \
        mach-o.h \
diff --git a/bfd/hidden.h b/bfd/hidden.h
new file mode 100644 (file)
index 0000000..8a2eb51
--- /dev/null
@@ -0,0 +1,34 @@
+/* hidden.h -- "hidden" ELF visibility attribute abstraction.
+   (This include file is not for users of the library.)
+
+   Copyright (C) 2025 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#ifndef _HIDDEN_H
+#define _HIDDEN_H 1
+
+#ifndef ATTRIBUTE_HIDDEN
+#if HAVE_HIDDEN
+#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
+#else
+#define ATTRIBUTE_HIDDEN
+#endif
+#endif
+
+#endif /* _HIDDEN_H */
index e00bd4353e359438c91cbd709a7ba6e22e154c96..93e49b8b3d5d9e307fae7cde0d9a5d4bcffb8604 100644 (file)
 #ifndef _LIBBFD_H
 #define _LIBBFD_H 1
 
-#ifndef ATTRIBUTE_HIDDEN
-#if HAVE_HIDDEN
-#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
-#else
-#define ATTRIBUTE_HIDDEN
-#endif
-#endif
-
 #include "hashtab.h"
+#include "hidden.h"
 
 #ifdef __cplusplus
 extern "C" {
index 5f1239ecb43e2391f0f2ee52a8edfb1cecadea1a..3e522dd4ab4578c64fc8bd215d605b2109808717 100644 (file)
 #ifndef _LIBBFD_H
 #define _LIBBFD_H 1
 
-#ifndef ATTRIBUTE_HIDDEN
-#if HAVE_HIDDEN
-#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
-#else
-#define ATTRIBUTE_HIDDEN
-#endif
-#endif
-
 #include "hashtab.h"
+#include "hidden.h"
 
 #ifdef __cplusplus
 extern "C" {
index 1ba9cc2fdb103a83efd625faf2d76b9de587eee3..a931b3a7c2d96cc6069f7e9a0470ec0b50d9ec1b 100644 (file)
@@ -273,6 +273,7 @@ format.c
 genlink.h
 go32stub.h
 hash.c
+hidden.h
 hpux-core.c
 i386aout.c
 i386bsd.c