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]

[PATCH] cleans x from elfos.h


This patch cleans ENDFILE_SPEC and STARTFILE_SPEC out of elfos.h.
These two settings are really too OS(platform) specific to specify in
such a global header.  In fact I only had to add them to 3 files! which
shows how much all other OS(platform) have to override these values.

This change was tested on the following targets:

    arm-deo-rtems
    arm-deo-freebsd5
    arm-deo-linux
    arm-deo-uclinux
    arm-deo-ecos-elf
    arm-deo-elf
    arm-deo-conix
    arm-deo-oabi
    cris-deo-elf
    hppa1.1-deo-pro
    hppa1.1-deo-rtems
    hppa-deo-lites
    i586-deo-chorusos
    i586-deo-elf
    i586-sequent-ptx4
    i586-deo-freebsd5
    x86_64-deo-freebsd5
    ia64-deo-elf
    ia64-deo-freebsd5
    m68hc11-deo-elf
    m68hc12-deo-elf
    powerpc-deo-freebsd5
    sparc64-deo-freebsd5
    strongarm-deo-elf
    xscale-deo-elf

which all use elfos.h w/o svr4.h (which overrides the elfos.h settings).

Permission to commit?

-- 
-- David  (obrien@FreeBSD.org)


2001-12-11  David O'Brien  <obrien@FreeBSD.org>

	* elfos.h (ENDFILE_SPEC, STARTFILE_SPEC): Do not define.
	* config/cris/cris.h (ENDFILE_SPEC): Define.
	* config/i386/i386elf.h ((ENDFILE_SPEC, STARTFILE_SPEC): Define.
	* config/pa/elf.h: Likewise.


Index: elfos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/elfos.h,v
retrieving revision 1.42
diff -u -r1.42 elfos.h
--- elfos.h	2001/12/09 20:13:19	1.42
+++ elfos.h	2001/12/10 23:11:51
@@ -42,15 +42,6 @@
 #define MAX_OFILE_ALIGNMENT (32768 * 8)
 #endif
 
-#undef  ENDFILE_SPEC
-#define ENDFILE_SPEC "crtend.o%s"
-
-#undef	STARTFILE_SPEC
-#define STARTFILE_SPEC "%{!shared: \
-			 %{!symbolic: \
-			  %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
-			crtbegin.o%s"
-
 /* Use periods rather than dollar signs in special g++ assembler names.  */
 
 #define NO_DOLLAR_IN_LABEL
Index: cris/cris.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/cris/cris.h,v
retrieving revision 1.17
diff -u -r1.17 cris.h
--- cris.h	2001/12/09 21:25:03	1.17
+++ cris.h	2001/12/10 23:11:53
@@ -231,13 +231,14 @@
    link them to crt0.o to be prepared.  Use scrt0.c if running the
    simulator, linear style, or s2crt0.c if fixed style.  */
 /* We need to remove any previous definition (elfos.h).  */
-#undef STARTFILE_SPEC
 #define STARTFILE_SPEC \
  "%{sim2:s2crt0.o%s}\
   %{!sim2:%{sim:scrt0.o%s}\
    %{!sim:%{pg:gcrt0.o%s}\
     %{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
   crtbegin.o%s"
+
+#define ENDFILE_SPEC "crtend.o%s"
 
 #define EXTRA_SPECS				\
   {"cpp_subtarget", CRIS_CPP_SUBTARGET_SPEC},	\
Index: i386/i386elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386elf.h,v
retrieving revision 1.18
diff -u -r1.18 i386elf.h
--- i386elf.h	2001/11/11 05:56:41	1.18
+++ i386elf.h	2001/12/10 23:11:53
@@ -47,6 +47,13 @@
 #undef CPP_SPEC
 #define CPP_SPEC "%(cpp_cpu)"
 
+#define ENDFILE_SPEC "crtend.o%s"
+
+#define STARTFILE_SPEC "%{!shared: \
+			 %{!symbolic: \
+			  %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
+			crtbegin.o%s"
+
 /* This is how to output assembly code to define a `float' constant.
    We always have to use a .long pseudo-op to do this because the native
    SVR4 ELF assembler is buggy and it generates incorrect values when we
Index: pa/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/elf.h,v
retrieving revision 1.9
diff -u -r1.9 elf.h
--- elf.h	2001/11/09 23:16:04	1.9
+++ elf.h	2001/12/10 23:11:53
@@ -21,6 +21,13 @@
 /* So we can conditionalize small amounts of code in pa.c or pa.md.  */
 #define OBJ_ELF
 
+#define ENDFILE_SPEC "crtend.o%s"
+
+#define STARTFILE_SPEC "%{!shared: \
+			 %{!symbolic: \
+			  %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
+			crtbegin.o%s"
+
 #define TEXT_SECTION_ASM_OP "\t.text"
 #define DATA_SECTION_ASM_OP "\t.data"
 #define BSS_SECTION_ASM_OP "\t.section\t.bss"


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