+2017-12-07 Andrew Waterman <andrew@sifive.com>
+
+ * config/riscv/riscv.c (TARGET_ASM_SELECT_SECTION): New define.
+ (TARGET_HAVE_SRODATA_SECTION): New define.
+ (riscv_select_section): New function.
+
2017-12-08 Joseph Myers <joseph@codesourcery.com>
Alexander Monakov <amonakov@ispras.ru>
Jakub Jelinek <jakub@redhat.com>
return riscv_size_ok_for_small_data_p (int_size_in_bytes (TREE_TYPE (x)));
}
+/* Switch to the appropriate section for output of DECL. */
+
+static section *
+riscv_select_section (tree decl, int reloc,
+ unsigned HOST_WIDE_INT align)
+{
+ switch (categorize_decl_for_section (decl, reloc))
+ {
+ case SECCAT_SRODATA:
+ return get_named_section (decl, ".srodata", reloc);
+
+ default:
+ return default_elf_select_section (decl, reloc, align);
+ }
+}
+
/* Return a section for X, handling small data. */
static section *
#undef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P riscv_in_small_data_p
+#undef TARGET_HAVE_SRODATA_SECTION
+#define TARGET_HAVE_SRODATA_SECTION true
+
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION riscv_select_section
+
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION riscv_elf_select_rtx_section