aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJoey Ye <joey.ye@arm.com>2013-11-19 10:00:46 +0000
committerJoey Ye <jye2@gcc.gnu.org>2013-11-19 10:00:46 +0000
commit32d6e6c0f802264d4c5a6c99d5109d4cbb6f7337 (patch)
tree8aea504c43370e1fdb28cd1b1c8baf8085b6e680 /gcc/config
parentcd0470594cbc319d4a179734b2d6247056d07afb (diff)
downloadgcc-32d6e6c0f802264d4c5a6c99d5109d4cbb6f7337.zip
gcc-32d6e6c0f802264d4c5a6c99d5109d4cbb6f7337.tar.gz
gcc-32d6e6c0f802264d4c5a6c99d5109d4cbb6f7337.tar.bz2
arm.opt (-marm-pic-data-is-text-relative): New option.
2013-11-19 Joey Ye <joey.ye@arm.com> * config/arm/arm.opt (-marm-pic-data-is-text-relative): New option. * doc/invoke.texi (-marm-pic-data-is-text-relative): Documentation for new option. * config/arm/arm.c (arm_option_override): By default disable -marm-pic-data-is-text-relative. (legitimize_pic_address): Use arm_pic_data_is_text_relative. (arm_assemble_integer): Likewise. * config/arm/arm.h (TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE): New macro to initialize -marm-pic-data-is-text-relative. From-SVN: r205016
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/arm.c8
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/arm/arm.opt4
3 files changed, 14 insertions, 2 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 3ee27b4..a5bd010 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2449,6 +2449,10 @@ arm_option_override (void)
arm_pic_register = pic_register;
}
+ if (TARGET_VXWORKS_RTP
+ && !global_options_set.x_arm_pic_data_is_text_relative)
+ arm_pic_data_is_text_relative = 0;
+
/* Enable -mfix-cortex-m3-ldrd by default for Cortex-M3 cores. */
if (fix_cm3_ldrd == 2)
{
@@ -5965,7 +5969,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
|| (GET_CODE (orig) == SYMBOL_REF &&
SYMBOL_REF_LOCAL_P (orig)))
&& NEED_GOT_RELOC
- && !TARGET_VXWORKS_RTP)
+ && arm_pic_data_is_text_relative)
insn = arm_pic_static_addr (orig, reg);
else
{
@@ -21458,7 +21462,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
/* See legitimize_pic_address for an explanation of the
TARGET_VXWORKS_RTP check. */
- if (TARGET_VXWORKS_RTP
+ if (!arm_pic_data_is_text_relative
|| (GET_CODE (x) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (x)))
fputs ("(GOT)", asm_out_file);
else
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 1781b75..dbd841e 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -568,6 +568,10 @@ extern int prefer_neon_for_64bits;
#define NEED_PLT_RELOC 0
#endif
+#ifndef TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE
+#define TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE 1
+#endif
+
/* Nonzero if we need to refer to the GOT with a PC-relative
offset. In other words, generate
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index 9b74038..fa0839a 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -158,6 +158,10 @@ mlong-calls
Target Report Mask(LONG_CALLS)
Generate call insns as indirect calls, if necessary
+mpic-data-is-text-relative
+Target Report Var(arm_pic_data_is_text_relative) Init(TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE)
+Assume data segments are relative to text segment.
+
mpic-register=
Target RejectNegative Joined Var(arm_pic_register_string)
Specify the register to be used for PIC addressing