aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-01-16 18:39:45 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-01-16 18:39:45 +0000
commit514d8465b1b65307c43a208cb7221b4942b99aa2 (patch)
treea3a38ae5544f9f6ccaa35cf8396c07866e24cd75 /gcc/config/mips
parentc2a8bb27083af7bdb39ac8bad12d829c9b17b46a (diff)
(LINKER_ENDIAN_SPEC): Define.
(LINK_SPEC): Add linker_endian_spec. (EXTRA_SPECS): Add linker_endian_spec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips')
-rw-r--r--gcc/config/mips/mips.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index b29bd5caa24..7505a754826 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -452,6 +452,19 @@ extern void text_section ();
#endif
#endif
+/* We must pass -EL to the linker by default for little endian embedded
+ targets using linker scripts with a OUTPUT_FORMAT line. Otherwise, the
+ 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
+#if TARGET_ENDIAN_DEFAULT == 0
+#define LINKER_ENDIAN_SPEC "%{!EB:%{!meb:-EL}}"
+#else
+#define LINKER_ENDIAN_SPEC ""
+#endif
+#endif
+
/* This macro is similar to `TARGET_SWITCHES' but defines names of
command options that have values. Its definition is an
initializer with a subgrouping for each command option.
@@ -740,7 +753,8 @@ while (0)
#ifndef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
-%{bestGnum} %{shared} %{non_shared}"
+%{bestGnum} %{shared} %{non_shared} \
+%(linker_endian_spec)"
#endif /* LINK_SPEC defined */
/* Specs for the compiler proper */
@@ -823,6 +837,7 @@ while (0)
{ "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 }, \
SUBTARGET_EXTRA_SPECS
#ifndef SUBTARGET_EXTRA_SPECS