aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m68k/m68kelf.h
diff options
context:
space:
mode:
authorDon Lindsay <dlindsay@cygnus.com>1999-06-17 15:09:47 +0000
committerDon Lindsay <dlindsay@gcc.gnu.org>1999-06-17 15:09:47 +0000
commit2c8ec431e3d004bab9f620815ffafe7d3be3597e (patch)
tree2dcfc57a63ac1ac16c4f9a4c78bb79ef0a1a5b64 /gcc/config/m68k/m68kelf.h
parentfb8684745d6485ed60a4e88d0b2a8fc8b4d4acfa (diff)
downloadgcc-2c8ec431e3d004bab9f620815ffafe7d3be3597e.zip
gcc-2c8ec431e3d004bab9f620815ffafe7d3be3597e.tar.gz
gcc-2c8ec431e3d004bab9f620815ffafe7d3be3597e.tar.bz2
Added -mpcrel flag, and underlying support for PC-relative addressing on m68k.
h Added -mpcrel flag, and underlying support for PC-relative addressing on m68k. Patch is tested, and approved by Jim Wilson. From-SVN: r27576
Diffstat (limited to 'gcc/config/m68k/m68kelf.h')
-rw-r--r--gcc/config/m68k/m68kelf.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index 476692d..88dfc3d 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -246,9 +246,11 @@ extern int switch_table_difference_label_flag;
/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
operand of a function call. */
#undef LEGITIMATE_PIC_OPERAND_P
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- (! symbolic_operand (X, VOIDmode) \
- || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X)))
+
+#define LEGITIMATE_PIC_OPERAND_P(X) \
+ (! symbolic_operand (X, VOIDmode) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ || PCREL_GENERAL_OPERAND_OK)
/* Turn off function cse if we are doing PIC. We always want function call
to be done as `bsr foo@PLTPC', so it will force the assembler to create
@@ -261,6 +263,8 @@ extern int switch_table_difference_label_flag;
if (flag_pic) flag_no_function_cse = 1; \
if (! TARGET_68020 && flag_pic == 2) \
error("-fPIC is not currently supported on the 68000 or 68010\n"); \
+ if (TARGET_PCREL && flag_pic == 0) \
+ flag_pic = 1; \
}
/* end of stuff from m68kv4.h */