aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2003-05-18 09:46:23 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-05-18 09:46:23 +0000
commit4e2e315f25e0e3e5735d317b3159027ad3277d6d (patch)
tree934055010292a1ef9f72c81a8ea96eb52f524b30
parent25903d03442b16235d3198031754e321e0c787c8 (diff)
downloadgcc-4e2e315f25e0e3e5735d317b3159027ad3277d6d.zip
gcc-4e2e315f25e0e3e5735d317b3159027ad3277d6d.tar.gz
gcc-4e2e315f25e0e3e5735d317b3159027ad3277d6d.tar.bz2
c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, [...]): Default here.
* c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, TARGET_OBJFMT_CPP_BUILTINS): Default here. (c_cpp_builtins): Invoke TARGET_OBJFMT_CPP_BUILTINS(). * defaults.h: Don't default TARGET_OS_CPP_BUILTINS here. * config/elfos.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__. * config/freebsd-spec.h, config/netbsd-elf.h, config/alpha/gnu.h, config/arm/linux-elf.h, config/arm/rtems-elf.h, config/arm/unknown-elf.h, config/cris/cris.h, config/cris/linux.h, config/h8300/elf.h, config/i370/linux.h, config/i386/beos-elf.h, config/i386/gnu.h, config/i386/linux.h, config/i386/linux64.h, config/i386/moss.h, config/i386/rtemself.h, config/ia64/ia64.h, config/m68k/rtemself.h, config/mcore/mcore-elf.h, config/mips/linux.h, config/pa/pa-linux.h, config/rs6000/linux.h, config/rs6000/linux64.h, config/rs6000/sysv4.h, config/rs6000/vxworks.h, config/s390/linux.h, config/sh/coff.h, config/sh/elf.h, config/sh/rtemself.h, config/sh/sh.h, config/sparc/linux.h, config/sparc/linux64.h, config/sparc/openbsd64.h, config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h, config/xtensa/elf.h, config/xtensa/linux.h: Don't define __ELF__. * config/alpha.h, config/m68k/linux.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__. * doc/cpp.texi: Document __ELF__. * doc/tm.texi: Document TARGET_OBJFMT_CPP_BUILTINS. From-SVN: r66926
-rw-r--r--gcc/ChangeLog26
-rw-r--r--gcc/c-cppbuiltin.c9
-rw-r--r--gcc/config/alpha/elf.h9
-rw-r--r--gcc/config/alpha/gnu.h1
-rw-r--r--gcc/config/arm/linux-elf.h1
-rw-r--r--gcc/config/arm/rtems-elf.h1
-rw-r--r--gcc/config/arm/unknown-elf.h2
-rw-r--r--gcc/config/cris/cris.h8
-rw-r--r--gcc/config/cris/linux.h1
-rw-r--r--gcc/config/elfos.h6
-rw-r--r--gcc/config/freebsd-spec.h1
-rw-r--r--gcc/config/h8300/elf.h8
-rw-r--r--gcc/config/i370/linux.h1
-rw-r--r--gcc/config/i386/beos-elf.h1
-rw-r--r--gcc/config/i386/gnu.h1
-rw-r--r--gcc/config/i386/linux.h1
-rw-r--r--gcc/config/i386/linux64.h1
-rw-r--r--gcc/config/i386/moss.h1
-rw-r--r--gcc/config/i386/rtemself.h1
-rw-r--r--gcc/config/ia64/ia64.h1
-rw-r--r--gcc/config/m68k/linux.h8
-rw-r--r--gcc/config/m68k/rtemself.h1
-rw-r--r--gcc/config/mcore/mcore-elf.h7
-rw-r--r--gcc/config/mips/linux.h1
-rw-r--r--gcc/config/netbsd-elf.h1
-rw-r--r--gcc/config/pa/pa-linux.h1
-rw-r--r--gcc/config/rs6000/linux.h1
-rw-r--r--gcc/config/rs6000/linux64.h1
-rw-r--r--gcc/config/rs6000/sysv4.h4
-rw-r--r--gcc/config/rs6000/vxworks.h2
-rw-r--r--gcc/config/s390/linux.h1
-rw-r--r--gcc/config/sh/coff.h2
-rw-r--r--gcc/config/sh/elf.h5
-rw-r--r--gcc/config/sh/rtemself.h1
-rw-r--r--gcc/config/sh/sh.h1
-rw-r--r--gcc/config/sparc/linux.h1
-rw-r--r--gcc/config/sparc/linux64.h1
-rw-r--r--gcc/config/sparc/openbsd64.h1
-rw-r--r--gcc/config/sparc/sp64-elf.h1
-rw-r--r--gcc/config/sparc/sp86x-elf.h1
-rw-r--r--gcc/config/xtensa/elf.h5
-rw-r--r--gcc/config/xtensa/linux.h1
-rw-r--r--gcc/defaults.h4
-rw-r--r--gcc/doc/cpp.texi3
-rw-r--r--gcc/doc/tm.texi7
45 files changed, 69 insertions, 74 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd643b5..72a621c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,29 @@
+2003-05-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, TARGET_OBJFMT_CPP_BUILTINS):
+ Default here.
+ (c_cpp_builtins): Invoke TARGET_OBJFMT_CPP_BUILTINS().
+ * defaults.h: Don't default TARGET_OS_CPP_BUILTINS here.
+ * config/elfos.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__.
+ * config/freebsd-spec.h, config/netbsd-elf.h, config/alpha/gnu.h,
+ config/arm/linux-elf.h, config/arm/rtems-elf.h,
+ config/arm/unknown-elf.h, config/cris/cris.h, config/cris/linux.h,
+ config/h8300/elf.h, config/i370/linux.h, config/i386/beos-elf.h,
+ config/i386/gnu.h, config/i386/linux.h, config/i386/linux64.h,
+ config/i386/moss.h, config/i386/rtemself.h, config/ia64/ia64.h,
+ config/m68k/rtemself.h, config/mcore/mcore-elf.h, config/mips/linux.h,
+ config/pa/pa-linux.h, config/rs6000/linux.h, config/rs6000/linux64.h,
+ config/rs6000/sysv4.h, config/rs6000/vxworks.h, config/s390/linux.h,
+ config/sh/coff.h, config/sh/elf.h, config/sh/rtemself.h,
+ config/sh/sh.h, config/sparc/linux.h, config/sparc/linux64.h,
+ config/sparc/openbsd64.h, config/sparc/sp64-elf.h,
+ config/sparc/sp86x-elf.h, config/xtensa/elf.h, config/xtensa/linux.h:
+ Don't define __ELF__.
+ * config/alpha.h, config/m68k/linux.h (TARGET_OBJFMT_CPP_BUILTINS):
+ Define __ELF__.
+ * doc/cpp.texi: Document __ELF__.
+ * doc/tm.texi: Document TARGET_OBJFMT_CPP_BUILTINS. *
+
2003-05-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 9cb1b4e..c97ced3 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -32,6 +32,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "tm_p.h" /* Target prototypes. */
+#ifndef TARGET_OS_CPP_BUILTINS
+# define TARGET_OS_CPP_BUILTINS()
+#endif
+
+#ifndef TARGET_OBJFMT_CPP_BUILTINS
+# define TARGET_OBJFMT_CPP_BUILTINS()
+#endif
+
#ifndef REGISTER_PREFIX
#define REGISTER_PREFIX ""
#endif
@@ -387,6 +395,7 @@ c_cpp_builtins (pfile)
# define builtin_assert(TXT) cpp_assert (pfile, TXT)
TARGET_CPU_CPP_BUILTINS ();
TARGET_OS_CPP_BUILTINS ();
+ TARGET_OBJFMT_CPP_BUILTINS ();
}
/* Pass an object-like macro. If it doesn't lie in the user's
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 5ff6960..3ca8d6c 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -35,8 +35,13 @@ Boston, MA 02111-1307, USA. */
#undef ASM_FINAL_SPEC
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "-D__ELF__"
+/* alpha/ doesn't use elfos.h for some reason. */
+#define TARGET_OBJFMT_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__ELF__"); \
+ } \
+ while (0)
#undef CC1_SPEC
#define CC1_SPEC "%{G*}"
diff --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h
index 9b25daf..db2a278 100644
--- a/gcc/config/alpha/gnu.h
+++ b/gcc/config/alpha/gnu.h
@@ -7,7 +7,6 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__GNU__"); \
- builtin_define ("__ELF__"); \
builtin_define ("__gnu_hurd__"); \
builtin_define ("_LONGLONG"); \
builtin_define_std ("unix"); \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index ec5c69f..5da2b24 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -94,7 +94,6 @@
builtin_define_std ("unix"); \
builtin_define_std ("linux"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} while (0)
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index 9b5b1f1..a736ee1 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -27,6 +27,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index b3d6f6e..573803f 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -43,7 +43,7 @@
/* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
to see if it needs to invoked _init() and _fini(). */
#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC "-D__ELF__ -D__USES_INITFINI__"
+#define SUBTARGET_CPP_SPEC "-D__USES_INITFINI__"
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 92c6550..f741663 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -254,14 +254,6 @@ extern const char *cris_elinux_stacksize_str;
} \
while (0)
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define ("__ELF__"); \
- } \
- while (0)
-
-
/* This needs to be at least 32 bits. */
extern int target_flags;
diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
index f85743f..6893d7f 100644
--- a/gcc/config/cris/linux.h
+++ b/gcc/config/cris/linux.h
@@ -106,7 +106,6 @@ Boston, MA 02111-1307, USA. */
builtin_define ("__gnu_linux__"); \
builtin_define ("__linux__"); \
builtin_define ("__unix__"); \
- builtin_define ("__ELF__"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index b01dcdb..3a04661 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -21,6 +21,12 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define TARGET_OBJFMT_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__ELF__"); \
+ } \
+ while (0)
/* Define a symbol indicating that we are using elfos.h.
Some CPU specific configuration files use this. */
diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
index 4d81d80..b71a202 100644
--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -62,7 +62,6 @@ Boston, MA 02111-1307, USA. */
else \
builtin_define ("__FreeBSD__"); \
builtin_define_std ("unix"); \
- builtin_define ("__ELF__"); \
builtin_define ("__KPRINTF_ATTRIBUTE__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=bsd"); \
diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h
index c7214d4..bfa4e81 100644
--- a/gcc/config/h8300/elf.h
+++ b/gcc/config/h8300/elf.h
@@ -1,11 +1,3 @@
-/* Target OS preprocessor built-ins. */
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define ("__ELF__"); \
- } \
- while (0)
-
/* Undefine some macros defined in h8300 that conflict with elfos.h . */
#undef SDB_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
diff --git a/gcc/config/i370/linux.h b/gcc/config/i370/linux.h
index 4613dca..730d6b0e 100644
--- a/gcc/config/i370/linux.h
+++ b/gcc/config/i370/linux.h
@@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("unix"); \
builtin_define_std ("linux"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=posix"); \
} while (0)
diff --git a/gcc/config/i386/beos-elf.h b/gcc/config/i386/beos-elf.h
index b84519f..d369756 100644
--- a/gcc/config/i386/beos-elf.h
+++ b/gcc/config/i386/beos-elf.h
@@ -58,7 +58,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__ELF__"); \
builtin_define ("__BEOS__"); \
builtin_define ("__INTEL__"); \
builtin_define ("_X86_"); \
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index acf2d3f..ff0ff25 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -9,7 +9,6 @@
{ \
builtin_define_std ("MACH"); \
builtin_define_std ("unix"); \
- builtin_define ("__ELF__"); \
builtin_define ("__GNU__"); \
builtin_define ("__gnu_hurd__"); \
builtin_assert ("system=gnu"); \
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 6b553cd..1573393 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -79,7 +79,6 @@ Boston, MA 02111-1307, USA. */
{ \
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
- builtin_define ("__ELF__"); \
builtin_define ("__gnu_linux__"); \
builtin_assert ("system=posix"); \
if (flag_pic) \
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index b6b5756..591e10d 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=posix"); \
if (flag_pic) \
{ \
diff --git a/gcc/config/i386/moss.h b/gcc/config/i386/moss.h
index 642c625..fc0e60c 100644
--- a/gcc/config/i386/moss.h
+++ b/gcc/config/i386/moss.h
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */
do \
{ \
builtin_define_std ("moss"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=posix"); \
if (flag_pic) \
{ \
diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h
index 0967178..59c40d6 100644
--- a/gcc/config/i386/rtemself.h
+++ b/gcc/config/i386/rtemself.h
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
do \
{ \
builtin_define ("__rtems__"); \
- builtin_define ("__ELF__"); \
builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
if (!TARGET_80387) \
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index e996459..41a687b 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -39,7 +39,6 @@ do { \
builtin_define("__ia64"); \
builtin_define("__ia64__"); \
builtin_define("__itanium__"); \
- builtin_define("__ELF__"); \
if (TARGET_BIG_ENDIAN) \
builtin_define("__BIG_ENDIAN__"); \
} while (0)
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 168fca3..b9b9082 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -106,12 +106,18 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} \
while (0)
+#define TARGET_OBJFMT_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__ELF__"); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#ifdef USE_GNULIBC_1
#if TARGET_DEFAULT & MASK_68881
diff --git a/gcc/config/m68k/rtemself.h b/gcc/config/m68k/rtemself.h
index 393f96a..ab051fe 100644
--- a/gcc/config/m68k/rtemself.h
+++ b/gcc/config/m68k/rtemself.h
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("mc68000"); \
builtin_define ("__USE_INIT_FINI__"); \
builtin_define ("__rtems__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=rtems"); \
} \
while (0)
diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h
index b837859..cc8986a 100644
--- a/gcc/config/mcore/mcore-elf.h
+++ b/gcc/config/mcore/mcore-elf.h
@@ -25,13 +25,6 @@ Boston, MA 02111-1307, USA. */
/* Run-time Target Specification. */
#define TARGET_VERSION fputs (" (Motorola MCORE/elf)", stderr)
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define ("__ELF__"); \
- } \
- while (0)
-
/* Use DWARF2 debugging info. */
#define DWARF2_DEBUGGING_INFO 1
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 3663fe1..2461ac3 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -120,7 +120,6 @@ void FN () \
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
builtin_define_std ("unix"); \
diff --git a/gcc/config/netbsd-elf.h b/gcc/config/netbsd-elf.h
index cb38b93..55ea23a 100644
--- a/gcc/config/netbsd-elf.h
+++ b/gcc/config/netbsd-elf.h
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */
do \
{ \
NETBSD_OS_CPP_BUILTINS_COMMON(); \
- builtin_define ("__ELF__"); \
} \
while (0)
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index b2c0998..1c8266a 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -56,7 +56,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__ELF__"); \
builtin_define ("__gnu_linux__"); \
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index c8322bb..98e85e4 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -29,7 +29,6 @@
do \
{ \
builtin_define_std ("PPC"); \
- builtin_define ("__ELF__"); \
builtin_define_std ("powerpc"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 0cc8ae0..128e3b7 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -170,7 +170,6 @@
builtin_define ("__powerpc__"); \
builtin_define ("__powerpc64__"); \
builtin_define ("__PIC__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("cpu=powerpc64"); \
builtin_assert ("machine=powerpc64"); \
} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 6d30f323..4ccc71d 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -1071,7 +1071,7 @@ extern int fixuplabelno;
/* FreeBSD support. */
#define CPP_OS_FREEBSD_SPEC "\
- -D__ELF__ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
+ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
-Acpu=powerpc -Amachine=powerpc"
#define STARTFILE_FREEBSD_SPEC FBSD_STARTFILE_SPEC
@@ -1190,7 +1190,7 @@ ncrtn.o%s"
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
#define CPP_OS_NETBSD_SPEC "\
--D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
+-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
/* WindISS support. */
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index e96d384..6a5c7e9 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -39,7 +39,7 @@
#define SUBTARGET_EXTRA_SPECS /* none needed */
#define CPP_SPEC \
-"-DCPU_FAMILY=PPC -D__ppc -D__EABI__ -D__ELF__ \
+"-DCPU_FAMILY=PPC -D__ppc -D__EABI__ \
%{t403: -DCPU=PPC403 -D_SOFT_FLOAT ; \
t405: -DCPU=PPC405 -D_SOFT_FLOAT ; \
t440: -DCPU=PPC440 -D_SOFT_FLOAT ; \
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index cbb7710..cc496bd 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -57,7 +57,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("unix"); \
builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
- builtin_define ("__ELF__"); \
builtin_define ("__gnu_linux__"); \
if (flag_pic) \
{ \
diff --git a/gcc/config/sh/coff.h b/gcc/config/sh/coff.h
index a663829..4d9aeb3 100644
--- a/gcc/config/sh/coff.h
+++ b/gcc/config/sh/coff.h
@@ -72,6 +72,4 @@ Boston, MA 02111-1307, USA. */
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", (int)(SIZE)))
-#define TARGET_OBJFMT_CPP_BUILTINS()
-
#define DWARF2_UNWIND_INFO 0
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 1eed089..0dc2468 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -58,11 +58,6 @@ Boston, MA 02111-1307, USA. */
fprintf ((FILE), "\t.little\n"); \
} while (0)
-
-
-/* Let code know that this is ELF. */
-#define TARGET_OBJFMT_CPP_BUILTINS() builtin_define ("__ELF__")
-
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
diff --git a/gcc/config/sh/rtemself.h b/gcc/config/sh/rtemself.h
index ee98cda..b386774 100644
--- a/gcc/config/sh/rtemself.h
+++ b/gcc/config/sh/rtemself.h
@@ -23,6 +23,5 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() do { \
builtin_define( "__rtems__" ); \
- builtin_define( "__ELF__" ); \
builtin_assert( "system=rtems" ); \
} while (0)
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index acec122..c751033 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -79,7 +79,6 @@ do { \
builtin_define ("__pic__"); \
builtin_define ("__PIC__"); \
} \
- TARGET_OBJFMT_CPP_BUILTINS (); \
} while (0)
/* We can not debug without a frame pointer. */
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 4d33a33..23f5892 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("unix"); \
builtin_define_std ("linux"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} \
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 3f7f6ca..aed067d 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define ("_LONGLONG"); \
builtin_define ("__gnu_linux__"); \
- builtin_define ("__ELF__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} \
diff --git a/gcc/config/sparc/openbsd64.h b/gcc/config/sparc/openbsd64.h
index c3d6dfc..96ddf79 100644
--- a/gcc/config/sparc/openbsd64.h
+++ b/gcc/config/sparc/openbsd64.h
@@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */
builtin_define ("__sparcv9__"); \
builtin_define ("__sparc_v9__"); \
builtin_define ("__arch64__"); \
- builtin_define ("__ELF__"); \
} \
while (0)
diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h
index 5592a6e..f442fd8 100644
--- a/gcc/config/sparc/sp64-elf.h
+++ b/gcc/config/sparc/sp64-elf.h
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */
do \
{ \
builtin_define_std ("sparc"); \
- builtin_define ("__ELF__"); \
} \
while (0)
diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h
index e9e8cdb..a3107b5 100644
--- a/gcc/config/sparc/sp86x-elf.h
+++ b/gcc/config/sparc/sp86x-elf.h
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */
do \
{ \
builtin_define ("__sparclite86x__"); \
- builtin_define ("__ELF__"); \
} \
while (0)
diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
index 4bc4f7f..6c8ebcd 100644
--- a/gcc/config/xtensa/elf.h
+++ b/gcc/config/xtensa/elf.h
@@ -19,11 +19,6 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define ("__ELF__"); \
- } while (0)
-
#define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags
/* Don't assume anything about the header files. */
diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
index b364ed9..b3281a2 100644
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
@@ -23,7 +23,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
do { \
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
- builtin_define ("__ELF__"); \
builtin_define ("__gnu_linux__"); \
builtin_assert ("system=posix"); \
} while (0)
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 5f72bfd..12b2527 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -47,10 +47,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# define TARGET_ESC 033
#endif
-#ifndef TARGET_OS_CPP_BUILTINS
-# define TARGET_OS_CPP_BUILTINS()
-#endif
-
/* Store in OUTPUT a string (made with alloca) containing an
assembler-name for a local static variable or function named NAME.
LABELNO is an integer which is different for each call. */
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index d1ade81..63ac814 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -1945,6 +1945,9 @@ incremented on every @samp{#include} directive and decremented at the
end of every included file. It starts out at 0, it's value within the
base file specified on the command line.
+@item __ELF__
+This macro is defined if the target uses the ELF object format.
+
@item __VERSION__
This macro expands to a string constant which describes the version of
the compiler in use. You should not rely on its contents having any
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 8b22dbc..73b2f27 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -655,6 +655,13 @@ preprocessing.
Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
and is used for the target operating system instead.
+@findex TARGET_OBJFMT_CPP_BUILTINS
+@item TARGET_OBJFMT_CPP_BUILTINS()
+Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
+and is used for the target object format. @file{elfos.h} uses this
+macro to define @code{__ELF__}, so you probably do not need to define
+it yourself.
+
@findex extern int target_flags
@item extern int target_flags;
This declaration should be present.