This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__ELF__


This patch cleans up definitions of __ELF__ so they appear in one place
(almost - alpha/elf.h doesn't use elfos.h for some reason) by defining a
new target macro TARGET_OBJFMT_CPP_BUILTINS().  To those familiar with the
hair in config/, it will come as no surprise that many elf targets failed
to define __ELF__, and that some aout targets defined __ELF__.

I documented its definition, since we can now be pretty confident of
getting it right.

Tested on alpha-foo-gnu and powerpc64-foo-linux.

Neil.

	* 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.

Index: c-cppbuiltin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-cppbuiltin.c,v
retrieving revision 1.8
diff -u -p -r1.8 c-cppbuiltin.c
--- c-cppbuiltin.c	11 May 2003 13:43:34 -0000	1.8
+++ c-cppbuiltin.c	18 May 2003 09:18:33 -0000
@@ -32,6 +32,14 @@ Software Foundation, 59 Temple Place - S
 #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
Index: defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.107
diff -u -p -r1.107 defaults.h
--- defaults.h	17 May 2003 21:59:24 -0000	1.107
+++ defaults.h	18 May 2003 09:18:34 -0000
@@ -47,10 +47,6 @@ Software Foundation, 59 Temple Place - S
 #  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.  */
Index: config/elfos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/elfos.h,v
retrieving revision 1.59
diff -u -p -r1.59 elfos.h
--- config/elfos.h	12 May 2003 09:51:18 -0000	1.59
+++ config/elfos.h	18 May 2003 09:18:34 -0000
@@ -21,6 +21,12 @@ along with GNU CC; see the file COPYING.
 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.  */
Index: config/freebsd-spec.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/freebsd-spec.h,v
retrieving revision 1.3
diff -u -p -r1.3 freebsd-spec.h
--- config/freebsd-spec.h	12 Mar 2003 02:29:08 -0000	1.3
+++ config/freebsd-spec.h	18 May 2003 09:18:34 -0000
@@ -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");					\
Index: config/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/netbsd-elf.h,v
retrieving revision 1.6
diff -u -p -r1.6 netbsd-elf.h
--- config/netbsd-elf.h	26 Nov 2002 00:31:31 -0000	1.6
+++ config/netbsd-elf.h	18 May 2003 09:18:34 -0000
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA.  */
   do						\
     {						\
       NETBSD_OS_CPP_BUILTINS_COMMON();		\
-      builtin_define ("__ELF__");		\
     }						\
   while (0)
 
Index: config/alpha/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/elf.h,v
retrieving revision 1.66
diff -u -p -r1.66 elf.h
--- config/alpha/elf.h	12 May 2003 09:51:19 -0000	1.66
+++ config/alpha/elf.h	18 May 2003 09:18:34 -0000
@@ -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*}"
Index: config/alpha/gnu.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/gnu.h,v
retrieving revision 1.4
diff -u -p -r1.4 gnu.h
--- config/alpha/gnu.h	5 Jun 2002 18:33:25 -0000	1.4
+++ config/alpha/gnu.h	18 May 2003 09:18:34 -0000
@@ -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");		\
Index: config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.38
diff -u -p -r1.38 linux-elf.h
--- config/arm/linux-elf.h	10 Mar 2003 17:53:19 -0000	1.38
+++ config/arm/linux-elf.h	18 May 2003 09:18:34 -0000
@@ -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)
Index: config/arm/rtems-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/rtems-elf.h,v
retrieving revision 1.9
diff -u -p -r1.9 rtems-elf.h
--- config/arm/rtems-elf.h	10 Feb 2003 16:33:09 -0000	1.9
+++ config/arm/rtems-elf.h	18 May 2003 09:18:34 -0000
@@ -27,6 +27,5 @@
 #define TARGET_OS_CPP_BUILTINS()		\
     do {					\
 	builtin_define ("__rtems__");		\
-	builtin_define ("__ELF__");		\
 	builtin_assert ("system=rtems");	\
     } while (0)
Index: config/arm/unknown-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/unknown-elf.h,v
retrieving revision 1.31
diff -u -p -r1.31 unknown-elf.h
--- config/arm/unknown-elf.h	12 May 2003 09:51:20 -0000	1.31
+++ config/arm/unknown-elf.h	18 May 2003 09:18:34 -0000
@@ -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
Index: config/cris/cris.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.h,v
retrieving revision 1.51
diff -u -p -r1.51 cris.h
--- config/cris/cris.h	12 May 2003 09:51:22 -0000	1.51
+++ config/cris/cris.h	18 May 2003 09:18:35 -0000
@@ -254,14 +254,6 @@ extern const char *cris_elinux_stacksize
     }						\
   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;
 
Index: config/cris/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/linux.h,v
retrieving revision 1.7
diff -u -p -r1.7 linux.h
--- config/cris/linux.h	9 Mar 2003 01:20:03 -0000	1.7
+++ config/cris/linux.h	18 May 2003 09:18:35 -0000
@@ -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__");		\
Index: config/h8300/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/elf.h,v
retrieving revision 1.8
diff -u -p -r1.8 elf.h
--- config/h8300/elf.h	3 Jun 2002 00:51:36 -0000	1.8
+++ config/h8300/elf.h	18 May 2003 09:18:35 -0000
@@ -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
Index: config/i370/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i370/linux.h,v
retrieving revision 1.10
diff -u -p -r1.10 linux.h
--- config/i370/linux.h	12 Aug 2002 03:10:43 -0000	1.10
+++ config/i370/linux.h	18 May 2003 09:18:35 -0000
@@ -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)
 
Index: config/i386/beos-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/beos-elf.h,v
retrieving revision 1.18
diff -u -p -r1.18 beos-elf.h
--- config/i386/beos-elf.h	15 Nov 2002 14:57:11 -0000	1.18
+++ config/i386/beos-elf.h	18 May 2003 09:18:35 -0000
@@ -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_");					\
Index: config/i386/gnu.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/gnu.h,v
retrieving revision 1.16
diff -u -p -r1.16 gnu.h
--- config/i386/gnu.h	5 Jun 2002 17:01:30 -0000	1.16
+++ config/i386/gnu.h	18 May 2003 09:18:35 -0000
@@ -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");		\
Index: config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/linux.h,v
retrieving revision 1.42
diff -u -p -r1.42 linux.h
--- config/i386/linux.h	15 Nov 2002 14:57:12 -0000	1.42
+++ config/i386/linux.h	18 May 2003 09:18:35 -0000
@@ -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)				\
Index: config/i386/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/linux64.h,v
retrieving revision 1.19
diff -u -p -r1.19 linux64.h
--- config/i386/linux64.h	14 Jan 2003 13:33:02 -0000	1.19
+++ config/i386/linux64.h	18 May 2003 09:18:35 -0000
@@ -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)						\
 	  {							\
Index: config/i386/moss.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/moss.h,v
retrieving revision 1.7
diff -u -p -r1.7 moss.h
--- config/i386/moss.h	5 Jun 2002 17:01:31 -0000	1.7
+++ config/i386/moss.h	18 May 2003 09:18:35 -0000
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA.  */
   do						\
     {						\
 	builtin_define_std ("moss");		\
-	builtin_define ("__ELF__");		\
 	builtin_assert ("system=posix");	\
 	if (flag_pic)				\
 	  {					\
Index: config/i386/rtemself.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/rtemself.h,v
retrieving revision 1.17
diff -u -p -r1.17 rtemself.h
--- config/i386/rtemself.h	28 Sep 2002 15:29:40 -0000	1.17
+++ config/i386/rtemself.h	18 May 2003 09:18:35 -0000
@@ -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)			\
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.150
diff -u -p -r1.150 ia64.h
--- config/ia64/ia64.h	14 May 2003 07:29:49 -0000	1.150
+++ config/ia64/ia64.h	18 May 2003 09:18:36 -0000
@@ -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)
Index: config/m68k/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/linux.h,v
retrieving revision 1.28
diff -u -p -r1.28 linux.h
--- config/m68k/linux.h	17 May 2003 21:57:37 -0000	1.28
+++ config/m68k/linux.h	18 May 2003 09:18:37 -0000
@@ -106,10 +106,16 @@ 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
Index: config/m68k/rtemself.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/rtemself.h,v
retrieving revision 1.8
diff -u -p -r1.8 rtemself.h
--- config/m68k/rtemself.h	17 May 2003 21:57:38 -0000	1.8
+++ config/m68k/rtemself.h	18 May 2003 09:18:37 -0000
@@ -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)
Index: config/mcore/mcore-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore-elf.h,v
retrieving revision 1.14
diff -u -p -r1.14 mcore-elf.h
--- config/mcore/mcore-elf.h	12 Mar 2003 11:46:56 -0000	1.14
+++ config/mcore/mcore-elf.h	18 May 2003 09:18:37 -0000
@@ -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
 
Index: config/mips/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
retrieving revision 1.55
diff -u -p -r1.55 linux.h
--- config/mips/linux.h	1 May 2003 02:33:12 -0000	1.55
+++ config/mips/linux.h	18 May 2003 09:18:37 -0000
@@ -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");				\
Index: config/pa/pa-linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-linux.h,v
retrieving revision 1.31
diff -u -p -r1.31 pa-linux.h
--- config/pa/pa-linux.h	20 Dec 2002 23:24:39 -0000	1.31
+++ config/pa/pa-linux.h	18 May 2003 09:18:37 -0000
@@ -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");		\
Index: config/rs6000/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux.h,v
retrieving revision 1.36
diff -u -p -r1.36 linux.h
--- config/rs6000/linux.h	13 Apr 2003 17:51:06 -0000	1.36
+++ config/rs6000/linux.h	18 May 2003 09:18:37 -0000
@@ -29,7 +29,6 @@
   do                                      \
     {                                     \
       builtin_define_std ("PPC");         \
-      builtin_define ("__ELF__");         \
       builtin_define_std ("powerpc");     \
       builtin_assert ("cpu=powerpc");     \
       builtin_assert ("machine=powerpc"); \
Index: config/rs6000/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux64.h,v
retrieving revision 1.37
diff -u -p -r1.37 linux64.h
--- config/rs6000/linux64.h	30 Apr 2003 16:51:20 -0000	1.37
+++ config/rs6000/linux64.h	18 May 2003 09:18:37 -0000
@@ -170,7 +170,6 @@
       builtin_define ("__powerpc__");       \
       builtin_define ("__powerpc64__");     \
       builtin_define ("__PIC__");           \
-      builtin_define ("__ELF__");           \
       builtin_assert ("cpu=powerpc64");     \
       builtin_assert ("machine=powerpc64"); \
     }                                       \
Index: config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.127
diff -u -p -r1.127 sysv4.h
--- config/rs6000/sysv4.h	15 May 2003 02:35:19 -0000	1.127
+++ config/rs6000/sysv4.h	18 May 2003 09:18:37 -0000
@@ -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.  */
 
Index: config/rs6000/vxworks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/vxworks.h,v
retrieving revision 1.5
diff -u -p -r1.5 vxworks.h
--- config/rs6000/vxworks.h	5 May 2003 14:33:01 -0000	1.5
+++ config/rs6000/vxworks.h	18 May 2003 09:18:37 -0000
@@ -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 ; \
Index: config/s390/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/linux.h,v
retrieving revision 1.28
diff -u -p -r1.28 linux.h
--- config/s390/linux.h	21 Nov 2002 12:03:49 -0000	1.28
+++ config/s390/linux.h	18 May 2003 09:18:37 -0000
@@ -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)				\
         {					\
Index: config/sh/coff.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/coff.h,v
retrieving revision 1.5
diff -u -p -r1.5 coff.h
--- config/sh/coff.h	12 May 2003 09:51:35 -0000	1.5
+++ config/sh/coff.h	18 May 2003 09:18:37 -0000
@@ -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
Index: config/sh/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/elf.h,v
retrieving revision 1.27
diff -u -p -r1.27 elf.h
--- config/sh/elf.h	3 Mar 2003 20:57:17 -0000	1.27
+++ config/sh/elf.h	18 May 2003 09:18:37 -0000
@@ -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")
 
Index: config/sh/rtemself.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/rtemself.h,v
retrieving revision 1.9
diff -u -p -r1.9 rtemself.h
--- config/sh/rtemself.h	8 Mar 2003 22:26:25 -0000	1.9
+++ config/sh/rtemself.h	18 May 2003 09:18:37 -0000
@@ -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)
Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.199
diff -u -p -r1.199 sh.h
--- config/sh/sh.h	14 May 2003 07:29:53 -0000	1.199
+++ config/sh/sh.h	18 May 2003 09:18:39 -0000
@@ -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.  */
Index: config/sparc/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux.h,v
retrieving revision 1.45
diff -u -p -r1.45 linux.h
--- config/sparc/linux.h	17 May 2003 07:19:56 -0000	1.45
+++ config/sparc/linux.h	18 May 2003 09:18:39 -0000
@@ -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");	\
     }						\
Index: config/sparc/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux64.h,v
retrieving revision 1.66
diff -u -p -r1.66 linux64.h
--- config/sparc/linux64.h	17 May 2003 07:19:56 -0000	1.66
+++ config/sparc/linux64.h	18 May 2003 09:18:39 -0000
@@ -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");	\
     }						\
Index: config/sparc/openbsd64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/openbsd64.h,v
retrieving revision 1.3
diff -u -p -r1.3 openbsd64.h
--- config/sparc/openbsd64.h	17 May 2003 13:47:44 -0000	1.3
+++ config/sparc/openbsd64.h	18 May 2003 09:18:39 -0000
@@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define ("__sparcv9__");		\
 	builtin_define ("__sparc_v9__");	\
 	builtin_define ("__arch64__");		\
-	builtin_define ("__ELF__");		\
     }						\
   while (0)
 
Index: config/sparc/sp64-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sp64-elf.h,v
retrieving revision 1.26
diff -u -p -r1.26 sp64-elf.h
--- config/sparc/sp64-elf.h	17 May 2003 13:47:44 -0000	1.26
+++ config/sparc/sp64-elf.h	18 May 2003 09:18:39 -0000
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA.  */
   do						\
     {						\
 	builtin_define_std ("sparc");		\
-	builtin_define ("__ELF__");		\
     }						\
   while (0)
 
Index: config/sparc/sp86x-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sp86x-elf.h,v
retrieving revision 1.12
diff -u -p -r1.12 sp86x-elf.h
--- config/sparc/sp86x-elf.h	17 May 2003 13:47:44 -0000	1.12
+++ config/sparc/sp86x-elf.h	18 May 2003 09:18:39 -0000
@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA.  */
   do						\
     {						\
 	builtin_define ("__sparclite86x__");	\
-	builtin_define ("__ELF__");		\
     }						\
   while (0)
 
Index: config/xtensa/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/elf.h,v
retrieving revision 1.8
diff -u -p -r1.8 elf.h
--- config/xtensa/elf.h	29 Apr 2003 18:56:52 -0000	1.8
+++ config/xtensa/elf.h	18 May 2003 09:18:39 -0000
@@ -19,11 +19,6 @@ along with GCC; see the file COPYING.  I
 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. */
Index: config/xtensa/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/linux.h,v
retrieving revision 1.10
diff -u -p -r1.10 linux.h
--- config/xtensa/linux.h	29 Apr 2003 18:56:53 -0000	1.10
+++ config/xtensa/linux.h	18 May 2003 09:18:39 -0000
@@ -23,7 +23,6 @@ Software Foundation, 59 Temple Place - S
   do {								\
     builtin_define_std ("linux");				\
     builtin_define_std ("unix");				\
-    builtin_define ("__ELF__");					\
     builtin_define ("__gnu_linux__");				\
     builtin_assert ("system=posix");				\
   } while (0)
Index: doc/cpp.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/cpp.texi,v
retrieving revision 1.58
diff -u -p -r1.58 cpp.texi
--- doc/cpp.texi	17 May 2003 20:29:33 -0000	1.58
+++ doc/cpp.texi	18 May 2003 09:18:41 -0000
@@ -1945,6 +1945,9 @@ incremented on every @samp{#include} dir
 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
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.220
diff -u -p -r1.220 tm.texi
--- doc/tm.texi	17 May 2003 21:59:25 -0000	1.220
+++ doc/tm.texi	18 May 2003 09:18:44 -0000
@@ -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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]