aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2004-07-09 09:30:46 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2004-07-09 09:30:46 +0000
commit2ad4dcf985bf7b87b56e31a4d7d1f878e8dcea78 (patch)
tree3fdda4aba160a45835b2302040249ad8c3955a6b
parent55d816e7c16bcb97973913b47a8303d140ab465c (diff)
downloadgcc-2ad4dcf985bf7b87b56e31a4d7d1f878e8dcea78.zip
gcc-2ad4dcf985bf7b87b56e31a4d7d1f878e8dcea78.tar.gz
gcc-2ad4dcf985bf7b87b56e31a4d7d1f878e8dcea78.tar.bz2
arm.c (arm_cpp_interwork): New variable.
* arm.c (arm_cpp_interwork): New variable. (arm_override_options): Set it if TARGET_INTERWORK was on the command line. * arm.h (arm_cpp_interwork): Declare it. (TARGET_CPU_CPP_BUILTINS): Use it to control definition of __THUMB_INTERWORK__ in the preprocessor. From-SVN: r84351
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/arm/arm.c13
-rw-r--r--gcc/config/arm/arm.h9
3 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b65f1ea..6de0aaf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-07-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_cpp_interwork): New variable.
+ (arm_override_options): Set it if TARGET_INTERWORK was on the command
+ line.
+ * arm.h (arm_cpp_interwork): Declare it.
+ (TARGET_CPU_CPP_BUILTINS): Use it to control definition of
+ __THUMB_INTERWORK__ in the preprocessor.
+
2004-07-09 Nathan Sidwell <nathan@codesourcery.com>
* vec.h (VEC_T_alloc): Fix MEM_STAT_DECL pasto.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a6826cd..9c373cf 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -418,6 +418,13 @@ int arm_is_6_or_7 = 0;
/* Nonzero if generating Thumb instructions. */
int thumb_code = 0;
+/* Nonzero if we should define __THUMB_INTERWORK__ in the
+ preprocessor.
+ XXX This is a bit of a hack, it's intended to help work around
+ problems in GLD which doesn't understand that armv5t code is
+ interworking clean. */
+int arm_cpp_interwork = 0;
+
/* In case of a PRE_INC, POST_INC, PRE_DEC, POST_DEC memory reference, we
must report the mode of the memory reference from PRINT_OPERAND to
PRINT_OPERAND_ADDRESS. */
@@ -838,6 +845,12 @@ arm_override_options (void)
/* V5 code we generate is completely interworking capable, so we turn off
TARGET_INTERWORK here to avoid many tests later on. */
+
+ /* XXX However, we must pass the right pre-processor defines to CPP
+ or GLD can get confused. This is a hack. */
+ if (TARGET_INTERWORK)
+ arm_cpp_interwork = 1;
+
if (arm_arch5)
target_flags &= ~ARM_FLAG_INTERWORK;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 3067153..a66ec4d 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -63,7 +63,7 @@ extern char arm_arch_name[];
\
/* Add a define for interworking. \
Needed when building libgcc.a. */ \
- if (TARGET_INTERWORK) \
+ if (arm_cpp_interwork) \
builtin_define ("__THUMB_INTERWORK__"); \
\
builtin_assert ("cpu=arm"); \
@@ -528,6 +528,13 @@ extern int arm_tune_xscale;
/* Nonzero if this chip is an ARM6 or an ARM7. */
extern int arm_is_6_or_7;
+/* Nonzero if we should define __THUMB_INTERWORK__ in the
+ preprocessor.
+ XXX This is a bit of a hack, it's intended to help work around
+ problems in GLD which doesn't understand that armv5t code is
+ interworking clean. */
+extern int arm_cpp_interwork;
+
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME)
#endif