This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ATTRIBUTE_HIDDEN for libbfd.h
- From: Alan Modra <amodra at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: binutils at sourceware dot org
- Date: Fri, 1 Jun 2018 13:20:26 +0930
- Subject: Re: ATTRIBUTE_HIDDEN for libbfd.h
- References: <20180518034729.GP23663@bubble.grove.modra.org> <87wovjil5v.fsf@igel.home>
On Thu, May 31, 2018 at 11:13:00PM +0200, Andreas Schwab wrote:
> Breaks --enable-shared build:
bfd/
* bfd.c (_bfd_error_handler): Arrange for this function to be
declared in bfd-in2.h.
* libbfd-in.h (_bfd_error_handler): Don't declare.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
opcodes/
* sysdep.h (_bfd_error_handler): Don't declare.
* msp430-decode.opc: Include bfd.h. Don't include ansidecl.h here.
* rl78-decode.opc: Likewise.
* msp430-decode.c: Regenerate.
* rl78-decode.c: Regenerate.
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 3bf56a6219..09c817df4f 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1087,14 +1087,6 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
return arg_count;
}
-/* This is the default routine to handle BFD error messages.
- Like fprintf (stderr, ...), but also handles some extra format specifiers.
-
- %pA section name from section. For group components, prints group name too.
- %pB file name from bfd. For archive components, prints archive too.
-
- Beware: Only supports a maximum of 9 format arguments. */
-
static void
error_handler_internal (const char *fmt, va_list ap)
{
@@ -1156,6 +1148,26 @@ error_handler_internal (const char *fmt, va_list ap)
static bfd_error_handler_type _bfd_error_internal = error_handler_internal;
+/*
+FUNCTION
+ _bfd_error_handler
+
+SYNOPSIS
+ void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
+
+DESCRIPTION
+ This is the default routine to handle BFD error messages.
+ Like fprintf (stderr, ...), but also handles some extra format
+ specifiers.
+
+ %pA section name from section. For group components, prints
+ group name too.
+ %pB file name from bfd. For archive components, prints
+ archive too.
+
+ Beware: Only supports a maximum of 9 format arguments.
+*/
+
void
_bfd_error_handler (const char *fmt, ...)
{
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 9796f2d67e..3c55adf075 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -123,9 +123,6 @@ extern void *bfd_realloc2
extern void *bfd_zmalloc2
(bfd_size_type, bfd_size_type) ATTRIBUTE_HIDDEN;
-extern void _bfd_error_handler (const char *s, ...)
- ATTRIBUTE_PRINTF_1 ATTRIBUTE_HIDDEN;
-
/* These routines allocate and free things on the BFD's objalloc. */
extern void *bfd_alloc2
diff --git a/opcodes/msp430-decode.opc b/opcodes/msp430-decode.opc
index 8cdae5afae..71ff762d91 100644
--- a/opcodes/msp430-decode.opc
+++ b/opcodes/msp430-decode.opc
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "ansidecl.h"
+#include "bfd.h"
#include "opintl.h"
#include "opcode/msp430-decode.h"
diff --git a/opcodes/rl78-decode.opc b/opcodes/rl78-decode.opc
index 49e9e69d95..444ced2764 100644
--- a/opcodes/rl78-decode.opc
+++ b/opcodes/rl78-decode.opc
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "ansidecl.h"
+#include "bfd.h"
#include "opintl.h"
#include "opcode/rl78.h"
diff --git a/opcodes/sysdep.h b/opcodes/sysdep.h
index 20f5828082..8e5e6af1ae 100644
--- a/opcodes/sysdep.h
+++ b/opcodes/sysdep.h
@@ -57,7 +57,6 @@ extern char *stpcpy (char *__dest, const char *__src);
#endif
#define opcodes_error_handler _bfd_error_handler
-extern void _bfd_error_handler (const char *, ...) ATTRIBUTE_PRINTF_1;
/* Use sigsetjmp/siglongjmp without saving the signal mask if possible.
It is faster than setjmp/longjmp on systems where the signal mask is
--
Alan Modra
Australia Development Lab, IBM