* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205016
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2013-11-19 Bin Cheng <bin.cheng@arm.com>
* tree-ssa-loop-ivopts.c (enum ainc_type): New.
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)
{
|| (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
{
{
/* 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
#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
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
Specify the register to be used for PIC addressing. The default is R10
unless stack-checking is enabled, when R9 is used.
+@item -mpic-data-is-text-relative
+@opindex mpic-data-is-text-relative
+Assume that each data segments are relative to text segment at load time.
+Therefore, it permits addressing data using PC-relative operations.
+This option is on by default for targets other than VxWorks RTP.
+
@item -mpoke-function-name
@opindex mpoke-function-name
Write the name of each function into the text section, directly