aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
commitafae4a55ccaa0de95ea11e5f634084db6ab2f444 (patch)
treed632cc867d10410ba9fb750523be790b86846ac4 /gcc/final.c
parent9d9a82ec8478ff52c7a9d61f58cd2a7b6295b5f9 (diff)
parentd2eb616a0f7bea78164912aa438c29fe1ef5774a (diff)
downloadgcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.zip
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.gz
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.bz2
Merge branch 'master' into devel/coarray_native
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 80423d1..fc9a05e 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "rtl-iter.h"
#include "print-rtl.h"
#include "function-abi.h"
+#include "common/common-target.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data declarations. */
@@ -2154,6 +2155,21 @@ asm_show_source (const char *filename, int linenum)
fputc ('\n', asm_out_file);
}
+/* Judge if an absolute jump table is relocatable. */
+
+bool
+jumptable_relocatable (void)
+{
+ bool relocatable = false;
+
+ if (!CASE_VECTOR_PC_RELATIVE
+ && !targetm.asm_out.generate_pic_addr_diff_vec ()
+ && targetm_common.have_named_sections)
+ relocatable = targetm.asm_out.reloc_rw_mask ();
+
+ return relocatable;
+}
+
/* The final scan for one insn, INSN.
Args are same as in `final', except that INSN
is the insn being scanned.
@@ -2493,7 +2509,8 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
int log_align;
switch_to_section (targetm.asm_out.function_rodata_section
- (current_function_decl));
+ (current_function_decl,
+ jumptable_relocatable ()));
#ifdef ADDR_VEC_ALIGN
log_align = ADDR_VEC_ALIGN (table);
@@ -2572,7 +2589,8 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
if (! JUMP_TABLES_IN_TEXT_SECTION)
switch_to_section (targetm.asm_out.function_rodata_section
- (current_function_decl));
+ (current_function_decl,
+ jumptable_relocatable ()));
else
switch_to_section (current_function_section ());