Patchwork make it possible for the target to rename ".tm_clone_table"

login
register
mail settings
Submitter IainS
Date Nov. 18, 2011, 6:30 p.m.
Message ID <26A6FF58-00D1-453F-9248-2B97962C0012@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/126468/
State New
Headers show

Comments

IainS - Nov. 18, 2011, 6:30 p.m.
On 18 Nov 2011, at 18:12, Rainer Orth wrote:

> Iain Sandoe <developer@sandoe-acoustics.co.uk> writes:
>
>>> This, together with the unconditional use in varasm.c, will lead  
>>> to a
>>> bootstrap failure on Tru64 UNIX, which lacks named sections  
>>> completely.
>>
>> right, it was worrying me what a target without named sections does -
>> ... I can easily remove the #if defined (TARGET_ASM_NAMED_SECTION)
>> ... what happens when the code runs then?
>
> We ICE like this:
>
> /vol/gcc/src/hg/trunk/local/libitm/testsuite/libitm.c/cancel.c:55:1:  
> internal
> compiler error: in default_no_named_section, at varasm.c:6293
>
> I should probably file a PR, but there's still no proper bugzilla
> component for trans-mem.

well ... what about this instead then?
Iain
Rainer Orth - Nov. 18, 2011, 6:41 p.m.
Iain Sandoe <developer@sandoe-acoustics.co.uk> writes:

> well ... what about this instead then?

That one should at least be no worse than the current situation :-)

> Index: gcc/defaults.h
> ===================================================================
> --- gcc/defaults.h	(revision 181476)
> +++ gcc/defaults.h	(working copy)
> @@ -392,6 +392,14 @@ see the files COPYING3 and COPYING.RUNTIME respect
>  #endif
>  #endif
>  
> +/* If we have named sections, provide a name for the transaction clone
> +   table section.  */
> +#if defined (TARGET_ASM_NAMED_SECTION)

I suggest using #ifdef for single-condition tests; it's less chatty and
thus easier to read (again below).

	Rainer

Patch

Index: gcc/defaults.h
===================================================================
--- gcc/defaults.h	(revision 181476)
+++ gcc/defaults.h	(working copy)
@@ -392,6 +392,14 @@  see the files COPYING3 and COPYING.RUNTIME respect
 #endif
 #endif
 
+/* If we have named sections, provide a name for the transaction clone
+   table section.  */
+#if defined (TARGET_ASM_NAMED_SECTION)
+#ifndef TM_CLONE_TABLE_SECTION_NAME
+#define TM_CLONE_TABLE_SECTION_NAME ".tm_clone_table"
+#endif
+#endif
+
 /* If we have named section and we support weak symbols, then use the
    .jcr section for recording java classes which need to be registered
    at program start-up time.  */
Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	(revision 181476)
+++ gcc/varasm.c	(working copy)
@@ -5961,7 +5961,13 @@  dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_a
 
       if (!switched)
 	{
-	  switch_to_section (get_named_section (NULL, ".tm_clone_table", 3));
+#if defined (TARGET_ASM_NAMED_SECTION)
+	  switch_to_section (get_named_section (NULL, 
+						TM_CLONE_TABLE_SECTION_NAME,
+						3));
+#else
+	  switch_to_section (data_section);
+#endif
 	  assemble_align (POINTER_SIZE);
 	  switched = true;
 	}
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 181476)
+++ gcc/config/darwin.h	(working copy)
@@ -692,6 +680,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  TM_CLONE_TABLE_SECTION_NAME
+#define TM_CLONE_TABLE_SECTION_NAME "__DATA,__tm_clone_table"
+
 #undef  TARGET_ASM_RELOC_RW_MASK
 #define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask