]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't declare xmalloc and others in ldmisc.h
authorAlan Modra <amodra@gmail.com>
Tue, 1 Aug 2023 22:24:47 +0000 (07:54 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 1 Aug 2023 22:24:47 +0000 (07:54 +0930)
* ldmisc.h (xmalloc, xrealloc, xexit, yyerror): Don't declare.
* emultempl/pdp11.em: Include libiberty.h.
* emultempl/ticoff.em: Likewise.
* emultempl/vms.em: Likewise.
* ldctor.c: Likewise.
* ldelfgen.c: Likewise.
* ldgram.y: Likewise.
(yyerror): Prototype and make static.

ld/emultempl/pdp11.em
ld/emultempl/ticoff.em
ld/emultempl/vms.em
ld/ldctor.c
ld/ldelfgen.c
ld/ldgram.y
ld/ldmisc.h

index 8ff260a4c135bc0ab21981af4c1d4eab0f03d739..c6dbdeedd6a267a25fab8ec19e35d64652245917 100644 (file)
@@ -21,6 +21,7 @@
 fragment <<EOF
 
 /* --- \begin{pdp11.em} */
+#include "libiberty.h"
 #include "getopt.h"
 
 static void
index 31abefe6674dad3513817345ef5f6a376f52a34d..8a3bfae7fcb2e933c0662efdd3595153355ec540 100644 (file)
@@ -28,6 +28,7 @@ fragment <<EOF
 #define TARGET_IS_${EMULATION_NAME}
 
 #include "sysdep.h"
+#include "libiberty.h"
 #include "bfd.h"
 #include "bfdlink.h"
 #include "ctf-api.h"
index 3d2cd4a56c78254d70d8e5971a8f21c84486c234..1d90169e93d9514d86c0aab12049527cb6ba7a4d 100644 (file)
@@ -22,6 +22,7 @@
 # This file is sourced from generic.em.
 
 fragment <<EOF
+#include "libiberty.h"
 #include "getopt.h"
 
 static void
index 2f80aa02df699a0b1f3301412b02b2da030bac01..936bf4a7977b6a7b1cc417d8130d569c0981b630 100644 (file)
@@ -20,6 +20,7 @@
    MA 02110-1301, USA.  */
 
 #include "sysdep.h"
+#include "libiberty.h"
 #include "bfd.h"
 #include "bfdlink.h"
 #include "safe-ctype.h"
index 8e4a188964e8936c2dc8380afd3846de159c5d7e..62fce3e60facdf96d30639a0744715d732fae99a 100644 (file)
@@ -19,6 +19,7 @@
    MA 02110-1301, USA.  */
 
 #include "sysdep.h"
+#include "libiberty.h"
 #include "bfd.h"
 #include "bfdlink.h"
 #include "ctf-api.h"
index 9dbf10b2b1f237e9adb6792f716bbdf26d61c50f..2b4b50709829b919153f73d2c6e0df2a175a0e07 100644 (file)
@@ -27,6 +27,7 @@
 #define DONTDECLARE_MALLOC
 
 #include "sysdep.h"
+#include "libiberty.h"
 #include "bfd.h"
 #include "bfdlink.h"
 #include "ctf-api.h"
@@ -58,6 +59,8 @@ static char *error_names[ERROR_NAME_MAX];
 static int error_index;
 #define PUSH_ERROR(x) if (error_index < ERROR_NAME_MAX) error_names[error_index] = x; error_index++;
 #define POP_ERROR()   error_index--;
+
+static void yyerror (const char *);
 %}
 %union {
   bfd_vma integer;
@@ -1506,9 +1509,8 @@ opt_semicolon:
        ;
 
 %%
-void
-yyerror(arg)
-     const char *arg;
+static void
+yyerror (const char *arg)
 {
   if (ldfile_assumed_script)
     einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
index 6fbc4c7e687a108acc2b22af8fe60e01ad36473a..5ab9157cdf84713dab5cf6d09e502643f769bf1b 100644 (file)
@@ -27,10 +27,6 @@ extern void minfo (const char *, ...);
 extern void info_msg (const char *, ...);
 extern void lfinfo (FILE *, const char *, ...);
 extern void info_assert (const char *, unsigned int);
-extern void yyerror (const char *);
-extern void *xmalloc (size_t);
-extern void *xrealloc (void *, size_t);
-extern void xexit (int);
 
 #define ASSERT(x) \
 do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0)