===================================================================
@@ -7090,6 +7090,10 @@ section names for mergeable constant data. Define
the string if a different section name should be used.
@end deftypevr
+@deftypefn {Target Hook} {section *} TARGET_ASM_TM_CLONE_TABLE_SECTION (void)
+Return the section that should be used for transactional memory clone tables.
+@end deftypefn
+
@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
Return the section into which a constant @var{x}, of mode @var{mode},
should be placed. You can assume that @var{x} is some kind of
===================================================================
@@ -7013,6 +7013,8 @@ otherwise.
@hook TARGET_ASM_MERGEABLE_RODATA_PREFIX
+@hook TARGET_ASM_TM_CLONE_TABLE_SECTION
+
@hook TARGET_ASM_SELECT_RTX_SECTION
Return the section into which a constant @var{x}, of mode @var{mode},
should be placed. You can assume that @var{x} is some kind of
===================================================================
@@ -305,6 +305,13 @@ section names for mergeable constant data. Define
the string if a different section name should be used.",
const char *, ".rodata")
+/* Return the section to be used for transactional memory clone tables. */
+DEFHOOK
+(tm_clone_table_section,
+ "Return the section that should be used for transactional memory clone\
+ tables.",
+ section *, (void), default_clone_table_section)
+
/* Output a constructor for a symbol with a given priority. */
DEFHOOK
(constructor,
===================================================================
@@ -3,7 +3,8 @@
/* Since the non TM version of new_node() gets optimized away, it
shouldn't appear in the clone table either. */
-/* { dg-final { scan-assembler-not "tm_clone_table" } } */
+/* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */
#define NULL 0
extern void *malloc (__SIZE_TYPE__);
===================================================================
@@ -5961,7 +5961,7 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_a
if (!switched)
{
- switch_to_section (get_named_section (NULL, ".tm_clone_table", 3));
+ switch_to_section (targetm.asm_out.tm_clone_table_section ());
assemble_align (POINTER_SIZE);
switched = true;
}
@@ -5973,6 +5973,14 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_a
}
}
+/* Provide a default for the tm_clone_table section. */
+
+section *
+default_clone_table_section (void)
+{
+ return get_named_section (NULL, ".tm_clone_table", 3);
+}
+
/* Helper comparison function for qsorting by the DECL_UID stored in
alias_pair->emitted_diags. */
===================================================================
@@ -638,6 +638,7 @@ extern section *default_elf_select_section (tree,
extern void default_unique_section (tree, int);
extern section *default_function_rodata_section (tree);
extern section *default_no_function_rodata_section (tree);
+extern section *default_clone_table_section (void);
extern section *default_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
extern section *default_elf_select_rtx_section (enum machine_mode, rtx,
===================================================================
@@ -58,6 +58,7 @@ extern int machopic_reloc_rw_mask (void);
extern section *machopic_select_section (tree, int, unsigned HOST_WIDE_INT);
extern section *darwin_function_section (tree, enum node_frequency, bool, bool);
+extern section *darwin_tm_clone_table_section (void);
extern void darwin_function_switched_text_sections (FILE *, tree, bool);
extern void darwin_unique_section (tree decl, int reloc);
===================================================================
@@ -1265,6 +1265,14 @@ darwin_mergeable_constant_section (tree exp,
return readonly_data_section;
}
+section *
+darwin_tm_clone_table_section (void)
+{
+ return get_named_section (NULL,
+ "__DATA,__tm_clone_table,regular,no_dead_strip",
+ 3);
+}
+
int
machopic_reloc_rw_mask (void)
{
===================================================================
@@ -697,6 +696,10 @@ extern GTY(()) section * darwin_sections[NUM_DARWI
#define TARGET_ASM_UNIQUE_SECTION darwin_unique_section
#undef TARGET_ASM_FUNCTION_RODATA_SECTION
#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
+
+#undef TARGET_ASM_TM_CLONE_TABLE_SECTION
+#define TARGET_ASM_TM_CLONE_TABLE_SECTION darwin_tm_clone_table_section
+
#undef TARGET_ASM_RELOC_RW_MASK
#define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask