aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-05-17 15:13:28 +0000
committerNick Clifton <nickc@redhat.com>2012-05-17 15:13:28 +0000
commitdf7b86aa4cb63ce86e60949b8160438bc0f9e389 (patch)
tree5b75db54327715ae68627e815ba9552c4c0046ec /ld
parent134fa82ef4b30284ea5f18b2a3902f6f3d3e2fa4 (diff)
downloadgdb-df7b86aa4cb63ce86e60949b8160438bc0f9e389.zip
gdb-df7b86aa4cb63ce86e60949b8160438bc0f9e389.tar.gz
gdb-df7b86aa4cb63ce86e60949b8160438bc0f9e389.tar.bz2
PR 14072
* configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: Generate an error if included before config.h. * alpha-opc.c: Include sysdep.h before any other header file. * alpha-dis.c: Likewise. * avr-dis.c: Likewise. * cgen-opc.c: Likewise. * cr16-dis.c: Likewise. * cris-dis.c: Likewise. * crx-dis.c: Likewise. * d10v-dis.c: Likewise. * d10v-opc.c: Likewise. * d30v-dis.c: Likewise. * d30v-opc.c: Likewise. * h8500-dis.c: Likewise. * i370-dis.c: Likewise. * i370-opc.c: Likewise. * m10200-dis.c: Likewise. * m10300-dis.c: Likewise. * micromips-opc.c: Likewise. * mips-opc.c: Likewise. * mips61-opc.c: Likewise. * moxie-dis.c: Likewise. * or32-opc.c: Likewise. * pj-dis.c: Likewise. * ppc-dis.c: Likewise. * ppc-opc.c: Likewise. * s390-dis.c: Likewise. * sh-dis.c: Likewise. * sh64-dis.c: Likewise. * sparc-dis.c: Likewise. * sparc-opc.c: Likewise. * spu-dis.c: Likewise. * tic30-dis.c: Likewise. * tic54x-dis.c: Likewise. * tic80-dis.c: Likewise. * tic80-opc.c: Likewise. * tilegx-dis.c: Likewise. * tilepro-dis.c: Likewise. * v850-dis.c: Likewise. * v850-opc.c: Likewise. * vax-dis.c: Likewise. * w65-dis.c: Likewise. * xgate-dis.c: Likewise. * xtensa-dis.c: Likewise. * rl78-decode.opc: Likewise. * rl78-decode.c: Regenerate. * rx-decode.opc: Likewise. * rx-decode.c: Regenerate. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: Generate an error if included before config.h. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * aclocal.m4: Regenerate. * bfd-in.h: Generate an error if included before config.h. * sysdep.h: Likewise. * bfd-in2.h: Regenerate. * compress.c: Remove #include "config.h". * plugin.c: Likewise. * elf32-m68hc1x.c: Include sysdep.h before alloca-conf.h. * elf64-hppa.c: Likewise. * som.c: Likewise. * xsymc.c: Likewise. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * aclocal.m4: Regenerate. * Makefile.am: Use wrappers around C files generated by flex. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. * itbl-lex-wrapper.c: New file. * config/bfin-lex-wrapper.c: New file. * cgen.c: Include as.h before setjmp.h. * config/tc-dlx.c: Include as.h before any other header. * config/tc-h8300.c: Likewise. * config/tc-lm32.c: Likewise. * config/tc-mep.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-msp430.c: Likewise. * config/tc-or32.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-xtensa.c: Likewise. * configure.in: Add check that sysdep.h has been included before any system header files. * configure: Regenerate. * config.in: Regenerate. * unwind-ia64.h: Include config.h.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/config.in7
-rwxr-xr-xld/configure7
-rw-r--r--ld/configure.in9
-rw-r--r--ld/sysdep.h4
5 files changed, 35 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 0cead2b..bf18bbf 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2012-05-17 Daniel Richard G. <skunk@iskunk.org>
+ Nick Clifton <nickc@redhat.com>
+
+ PR 14072
+ * configure.in: Add check that sysdep.h has been included before
+ any system header files.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * sysdep.h: Generate an error if included before config.h.
+
2012-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
* emultempl/m68hc1xelf.em (hook_in_stub): Pass proper `bfd'
diff --git a/ld/config.in b/ld/config.in
index bb4f5fa..5fbc4a3 100644
--- a/ld/config.in
+++ b/ld/config.in
@@ -1,5 +1,12 @@
/* config.in. Generated from configure.in by autoheader. */
+/* Check that config.h is #included before system headers
+ (this works only for glibc, but that should be enough). */
+#if defined(__GLIBC__) && !defined(__CONFIG_H__)
+# error config.h must be #included before system headers
+#endif
+#define __CONFIG_H__ 1
+
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
diff --git a/ld/configure b/ld/configure
index 85e78ef..f4e4bb6 100755
--- a/ld/configure
+++ b/ld/configure
@@ -4750,6 +4750,9 @@ $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
ac_config_headers="$ac_config_headers config.h:config.in"
+# PR 14072
+
+
if test -z "$target" ; then
as_fn_error "Unrecognized target system type; please check config.sub." "$LINENO" 5
fi
@@ -12174,7 +12177,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12177 "configure"
+#line 12180 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12280,7 +12283,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12283 "configure"
+#line 12286 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/ld/configure.in b/ld/configure.in
index 160a060..b844927 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -124,6 +124,15 @@ AM_LC_MESSAGES
AC_CONFIG_HEADERS([config.h:config.in])
+# PR 14072
+AH_VERBATIM([00_CONFIG_H_CHECK],
+[/* Check that config.h is #included before system headers
+ (this works only for glibc, but that should be enough). */
+#if defined(__GLIBC__) && !defined(__CONFIG_H__)
+# error config.h must be #included before system headers
+#endif
+#define __CONFIG_H__ 1])
+
if test -z "$target" ; then
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
diff --git a/ld/sysdep.h b/ld/sysdep.h
index eadee88..d3495fc 100644
--- a/ld/sysdep.h
+++ b/ld/sysdep.h
@@ -22,6 +22,10 @@
#ifndef LD_SYSDEP_H
#define LD_SYSDEP_H
+#ifdef PACKAGE
+#error sysdep.h must be included in lieu of config.h
+#endif
+
#include "config.h"
#include <stdio.h>