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]

Gcc 2.96 endianness fixes for MIPS/Linux and MIPS/*


Hi,

 I've noticed the '-E[BL]' endianness option does not get passed to the
assembler for the default endianness (i.e. when no override is specified) 
for MIPS/*.  The option does not get passed to the linker for MIPS/Linux,
as well.

 The following patch fixes these problems.  As both the assembler and the
linker uses the same options for the endianness I decided to use a common
spec for both to prevent possible future discrepancies.

2000-08-18  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* config/mips/mips.h: Change LINKER_ENDIAN_SPEC to ENDIAN_SPEC
	and linker_endian_spec to endian_spec. 
	(ENDIAN_SPEC): Add %{EB} and %{EL}.
	(LINK_SPEC): Remove %{EB} and %{EL}.
	(ASM_SPEC): Likewise.  Use %(endian_spec). 

	* config/mips/linux.h (LINK_SPEC): Use %(endian_spec).

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

diff -u --recursive --new-file egcs-20000814.macro/gcc/config/mips/linux.h egcs-20000814/gcc/config/mips/linux.h
--- egcs-20000814.macro/gcc/config/mips/linux.h	Sat Jul 29 10:36:20 2000
+++ egcs-20000814/gcc/config/mips/linux.h	Fri Aug 18 13:47:18 2000
@@ -154,7 +154,9 @@
 
 /* Borrowed from sparc/linux.h */
 #undef LINK_SPEC
-#define LINK_SPEC "%{shared:-shared} \
+#define LINK_SPEC \
+ "%(endian_spec) \
+  %{shared:-shared} \
   %{!shared: \
     %{!ibcs: \
       %{!static: \
diff -u --recursive --new-file egcs-20000814.macro/gcc/config/mips/mips.h egcs-20000814/gcc/config/mips/mips.h
--- egcs-20000814.macro/gcc/config/mips/mips.h	Sun Aug  6 00:02:49 2000
+++ egcs-20000814/gcc/config/mips/mips.h	Fri Aug 18 13:56:22 2000
@@ -524,11 +524,11 @@
    linker will default to using big-endian output files.  The OUTPUT_FORMAT
    line must be in the linker script, otherwise -EB/-EL will not work.  */
 
-#ifndef LINKER_ENDIAN_SPEC
+#ifndef ENDIAN_SPEC
 #if TARGET_ENDIAN_DEFAULT == 0
-#define LINKER_ENDIAN_SPEC "%{!EB:%{!meb:-EL}}"
+#define ENDIAN_SPEC "%{!EB:%{!meb:-EL}} %{EL} %{EB}"
 #else
-#define LINKER_ENDIAN_SPEC "%{!EL:%{!mel:-EB}}"
+#define ENDIAN_SPEC "%{!EL:%{!mel:-EB}} %{EB} %{EL}"
 #endif
 #endif
 
@@ -826,7 +826,7 @@
 /* ASM_SPEC is the set of arguments to pass to the assembler.  */
 
 #define ASM_SPEC "\
-%{!membedded-pic:%{G*}} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
+%{!membedded-pic:%{G*}} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
 %{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
 %(subtarget_asm_optimizing_spec) \
 %(subtarget_asm_debugging_spec) \
@@ -881,9 +881,9 @@
 
 #ifndef LINK_SPEC
 #define LINK_SPEC "\
-%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
-%{bestGnum} %{shared} %{non_shared} \
-%(linker_endian_spec)"
+%(endian_spec) \
+%{G*} %{mips1} %{mips2} %{mips3} %{mips4} \
+%{bestGnum} %{shared} %{non_shared}"
 #endif	/* LINK_SPEC defined */
 
 /* Specs for the compiler proper */
@@ -991,7 +991,7 @@
   { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC },	\
   { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC },	\
   { "subtarget_asm_spec", SUBTARGET_ASM_SPEC },				\
-  { "linker_endian_spec", LINKER_ENDIAN_SPEC },				\
+  { "endian_spec", ENDIAN_SPEC },					\
   SUBTARGET_EXTRA_SPECS
 
 #ifndef SUBTARGET_EXTRA_SPECS


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