This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/4] make TLS_COMMON_ASM_OP a hook


From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2015-07-24  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/i386/sol2.h: Adjust.
	* defaults.h: Likewise.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: Remove documentation of removed
	TLS_COMMON_ASM_OP macro.
	* target.def (tls_common_asm_op): New hook.
---
 gcc/config/i386/sol2.h | 2 +-
 gcc/defaults.h         | 6 +-----
 gcc/doc/tm.texi        | 7 +++----
 gcc/doc/tm.texi.in     | 6 +-----
 gcc/target.def         | 6 ++++++
 5 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 9b725ad..d8e9c86 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -149,7 +149,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #ifndef USE_GAS
 /* The Sun assembler uses .tcomm for TLS common sections.  */
-#define TLS_COMMON_ASM_OP ".tcomm"
+#define TARGET_TLS_COMMON_ASM_OP ".tcomm"
 
 /* Similar to the Sun assembler on SPARC, the native assembler requires
    TLS objects to be declared as @tls_obj (not @tls_object).  Unlike SPARC,
diff --git a/gcc/defaults.h b/gcc/defaults.h
index dedf896..8684c58 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -73,15 +73,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define IFUNC_ASM_TYPE "gnu_indirect_function"
 #endif
 
-#ifndef TLS_COMMON_ASM_OP
-#define TLS_COMMON_ASM_OP ".tls_common"
-#endif
-
 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE)			\
   do									\
     {									\
-      fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP);			\
+      fprintf ((FILE), "\t%s\t", targetm.tls_common_asm_op);		\
       assemble_name ((FILE), (NAME));					\
       fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",		\
 	       (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT);		\
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 4d19252..faa3017 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6968,11 +6968,10 @@ containing the assembler operation to identify the following data as
 uninitialized, writable small data.
 @end defmac
 
-@defmac TLS_COMMON_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as thread-local
+@deftypevr {Target Hook} {const char *} TARGET_TLS_COMMON_ASM_OP
+The assembler operation to identify the following data as thread-local
 common data.  The default is @code{".tls_common"}.
-@end defmac
+@end deftypevr
 
 @defmac TLS_SECTION_ASM_FLAG
 If defined, a C expression whose value is a character constant
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index e75e818..72a7f84 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -4908,11 +4908,7 @@ containing the assembler operation to identify the following data as
 uninitialized, writable small data.
 @end defmac
 
-@defmac TLS_COMMON_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as thread-local
-common data.  The default is @code{".tls_common"}.
-@end defmac
+@hook TARGET_TLS_COMMON_ASM_OP
 
 @defmac TLS_SECTION_ASM_FLAG
 If defined, a C expression whose value is a character constant
diff --git a/gcc/target.def b/gcc/target.def
index ed438de..64ae8d4 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -5752,6 +5752,12 @@ DEFHOOKPOD
 The default value is false.",
  bool, false)
 
+DEFHOOKPOD
+(tls_common_asm_op,
+"The assembler operation to identify the following data as thread-local\n\
+common data.  The default is @code{\".tls_common\"}.",
+const char *, ".tls_common")
+
 /* True if a small readonly data section is supported.  */
 DEFHOOKPOD
 (have_srodata_section,
-- 
2.4.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]