aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>2021-03-11 11:41:24 -0500
committerDavid Edelsohn <dje.gcc@gmail.com>2021-03-11 16:57:24 -0500
commit26ed5a28b18ad080e51e6b61f5f60d67b66fd5f3 (patch)
treeab6a6446ec82563c42ec69cad070a80e2e4638db
parent5f27a9f90d4eadadf937f1a5d0bfccf39261f330 (diff)
downloadgcc-26ed5a28b18ad080e51e6b61f5f60d67b66fd5f3.zip
gcc-26ed5a28b18ad080e51e6b61f5f60d67b66fd5f3.tar.gz
gcc-26ed5a28b18ad080e51e6b61f5f60d67b66fd5f3.tar.bz2
aix: Use lcomm for TLS static data.
GCC on AIX generates thread local uninitialized data in the common section, which could conflict with another module. This patch changes the code generation to place static uninitialized thread local data into the local common section specified with .lcomm. This change also removes the need to create a file-local name for the TBSS data. gcc/ChangeLog: 2021-03-11 David Edelsohn <dje.gcc@gmail.com> PR target/99094 * config/rs6000/rs6000.c (rs6000_xcoff_file_start): Don't create xcoff_tbss_section_name. * config/rs6000/xcoff.h (ASM_OUTPUT_TLS_COMMON): Use .lcomm. * xcoffout.c (xcoff_tbss_section_name): Delete. * xcoffout.h (xcoff_tbss_section_name): Delete.
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/config/rs6000/xcoff.h10
-rw-r--r--gcc/xcoffout.c1
-rw-r--r--gcc/xcoffout.h1
4 files changed, 5 insertions, 9 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 35ecf5a..46ddf49 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -21261,8 +21261,6 @@ rs6000_xcoff_file_start (void)
main_input_filename, ".ro_");
rs6000_gen_section_name (&xcoff_tls_data_section_name,
main_input_filename, ".tls_");
- rs6000_gen_section_name (&xcoff_tbss_section_name,
- main_input_filename, ".tbss_[UL]");
fputs ("\t.file\t", asm_out_file);
output_quoted_string (asm_out_file, main_input_filename);
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index c016678..cb9aae7 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -255,11 +255,11 @@
} while (0)
#ifdef HAVE_AS_TLS
-#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
- do { fputs (COMMON_ASM_OP, (FILE)); \
- RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
- fprintf ((FILE), "[UL]," HOST_WIDE_INT_PRINT_UNSIGNED"\n", \
- (SIZE)); \
+#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
+ do { fputs (LOCAL_COMMON_ASM_OP, (FILE)); \
+ fprintf ((FILE), "%s," HOST_WIDE_INT_PRINT_UNSIGNED",%s[UL],3\n", \
+ (*targetm.strip_name_encoding) (NAME), (SIZE), \
+ (*targetm.strip_name_encoding) (NAME)); \
} while (0)
#endif
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index d07c2fb..3dbea04 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -66,7 +66,6 @@ char *xcoff_bss_section_name;
char *xcoff_private_data_section_name;
char *xcoff_private_rodata_section_name;
char *xcoff_tls_data_section_name;
-char *xcoff_tbss_section_name;
char *xcoff_read_only_section_name;
/* Last source file name mentioned in a NOTE insn. */
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index 10a583b..ae6aee0 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -129,7 +129,6 @@ extern char *xcoff_bss_section_name;
extern char *xcoff_private_data_section_name;
extern char *xcoff_private_rodata_section_name;
extern char *xcoff_tls_data_section_name;
-extern char *xcoff_tbss_section_name;
extern char *xcoff_read_only_section_name;
/* Last source file name mentioned in a NOTE insn. */