aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.c
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2015-02-19 23:47:58 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2015-02-19 23:47:58 +0000
commitf258111adfbbada8d2835a3fdebb2d127a47a8b4 (patch)
tree0aea18675d4b1f41831714ca939846fe1ced1e96 /gcc/config/pa/pa.c
parent81d43c6bb892b782435460279012b1ef5494ef2d (diff)
downloadgcc-f258111adfbbada8d2835a3fdebb2d127a47a8b4.zip
gcc-f258111adfbbada8d2835a3fdebb2d127a47a8b4.tar.gz
gcc-f258111adfbbada8d2835a3fdebb2d127a47a8b4.tar.bz2
pa.c (pa_reloc_rw_mask): New function.
* config/pa/pa.c (pa_reloc_rw_mask): New function. (TARGET_ASM_RELOC_RW_MASK): Define. (pa_cannot_force_const_mem): Revert previous change. From-SVN: r220827
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r--gcc/config/pa/pa.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 15913dc..ecb1724 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -149,6 +149,7 @@ static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT);
static int pa_adjust_cost (rtx_insn *, rtx, rtx_insn *, int);
static int pa_adjust_priority (rtx_insn *, int);
static int pa_issue_rate (void);
+static int pa_reloc_rw_mask (void);
static void pa_som_asm_init_sections (void) ATTRIBUTE_UNUSED;
static section *pa_som_tm_clone_table_section (void) ATTRIBUTE_UNUSED;
static section *pa_select_section (tree, int, unsigned HOST_WIDE_INT)
@@ -324,6 +325,9 @@ static size_t n_deferred_plabels = 0;
#define TARGET_ASM_FILE_END output_deferred_plabels
#endif
+#undef TARGET_ASM_RELOC_RW_MASK
+#define TARGET_ASM_RELOC_RW_MASK pa_reloc_rw_mask
+
#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
#define TARGET_PRINT_OPERAND_PUNCT_VALID_P pa_print_operand_punct_valid_p
@@ -1569,14 +1573,6 @@ force_mode (machine_mode mode, rtx orig)
static bool
pa_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
- /* Reload sometimes tries to put const data symbolic operands in
- readonly memory. The HP SOM linker doesn't allow symbolic data
- in readonly memory. */
- if (TARGET_SOM
- && !function_label_operand (x, VOIDmode)
- && symbolic_operand (x, VOIDmode))
- return true;
-
return tls_referenced_p (x);
}
@@ -9707,6 +9703,19 @@ pa_select_section (tree exp, int reloc,
return data_section;
}
+/* Implement pa_reloc_rw_mask. */
+
+static int
+pa_reloc_rw_mask (void)
+{
+ /* We force (const (plus (symbol) (const_int))) to memory when the
+ const_int doesn't fit in a 14-bit integer. The SOM linker can't
+ handle this construct in read-only memory and we want to avoid
+ this for ELF. So, we always force an RTX needing relocation to
+ the data section. */
+ return 3;
+}
+
static void
pa_globalize_label (FILE *stream, const char *name)
{