]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support .largecomm with Solaris as (PR target/61821)
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 26 Apr 2016 10:10:33 +0000 (10:10 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Tue, 26 Apr 2016 10:10:33 +0000 (10:10 +0000)
PR target/61821
* config/i386/i386.c (LARGECOMM_SECTION_ASM_OP): Define default.
(x86_elf_aligned_common): Rename to ...
(x86_elf_aligned_decl_common): ... this.
Add decl arg.  Switch to .lbss for largecomm object.  Use
LARGECOMM_SECTION_ASM_OP.
* config/i386/i386-protos.h (x86_elf_aligned_common): Reflect
renaming.
* config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_COMMON): Rename to ...
(ASM_OUTPUT_ALIGNED_DECL_COMMON): ... this.
Pass new decl arg.
* config/i386/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
[!USE_GAS] (LARGECOMM_SECTION_ASM_OP): Define.

From-SVN: r235435

gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/sol2.h
gcc/config/i386/x86-64.h

index d86fb69469e9184208a195a261a9afb5f9ea4c15..1907d2b42e66c06661c203a5449cb677bb89be29 100644 (file)
@@ -1,3 +1,19 @@
+2016-04-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/61821
+       * config/i386/i386.c (LARGECOMM_SECTION_ASM_OP): Define default.
+       (x86_elf_aligned_common): Rename to ...
+       (x86_elf_aligned_decl_common): ... this.
+       Add decl arg.  Switch to .lbss for largecomm object.  Use
+       LARGECOMM_SECTION_ASM_OP.
+       * config/i386/i386-protos.h (x86_elf_aligned_common): Reflect
+       renaming.
+       * config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_COMMON): Rename to ...
+       (ASM_OUTPUT_ALIGNED_DECL_COMMON): ... this.
+       Pass new decl arg.
+       * config/i386/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+       [!USE_GAS] (LARGECOMM_SECTION_ASM_OP): Define.
+
 2016-04-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR target/59407
index 93b5e1ed613cedca33cc012a553b87a232a2d182..4145ed566582e439d02b523f2df7c0153e2930d0 100644 (file)
@@ -296,8 +296,8 @@ extern int ix86_decompose_address (rtx, struct ix86_address *);
 extern int memory_address_length (rtx, bool);
 extern void x86_output_aligned_bss (FILE *, tree, const char *,
                                    unsigned HOST_WIDE_INT, int);
-extern void x86_elf_aligned_common (FILE *, const char *,
-                                   unsigned HOST_WIDE_INT, int);
+extern void x86_elf_aligned_decl_common (FILE *, tree, const char *,
+                                        unsigned HOST_WIDE_INT, int);
 
 #ifdef RTX_CODE
 extern void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *,
index 8495e0ad8c3ea7bd7f34877654ee0771473c3604..d8278fbc600c6b158dd727ee5b67768d6f0d4841 100644 (file)
@@ -6648,19 +6648,27 @@ x86_64_elf_unique_section (tree decl, int reloc)
 }
 
 #ifdef COMMON_ASM_OP
+
+#ifndef LARGECOMM_SECTION_ASM_OP
+#define LARGECOMM_SECTION_ASM_OP "\t.largecomm\t"
+#endif
+
 /* This says how to output assembler code to declare an
    uninitialized external linkage data object.
 
-   For medium model x86-64 we need to use .largecomm opcode for
+   For medium model x86-64 we need to use LARGECOMM_SECTION_ASM_OP opcode for
    large objects.  */
 void
-x86_elf_aligned_common (FILE *file,
+x86_elf_aligned_decl_common (FILE *file, tree decl,
                        const char *name, unsigned HOST_WIDE_INT size,
                        int align)
 {
   if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC)
       && size > (unsigned int)ix86_section_threshold)
-    fputs ("\t.largecomm\t", file);
+    {
+      switch_to_section (get_named_section (decl, ".lbss", 0));
+      fputs (LARGECOMM_SECTION_ASM_OP, file);
+    }
   else
     fputs (COMMON_ASM_OP, file);
   assemble_name (file, name);
index 5d3122e6b8f8f5a26b6d7f682dc06a29e2634b05..df23b1298b88547f004d387b526abba7cb72cdc1 100644 (file)
@@ -184,15 +184,15 @@ along with GCC; see the file COPYING3.  If not see
 
 /* As in sparc/sol2.h, override the default from i386/x86-64.h to work
    around Sun as TLS bug.  */
-#undef  ASM_OUTPUT_ALIGNED_COMMON
-#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)             \
+#undef  ASM_OUTPUT_ALIGNED_DECL_COMMON
+#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN)  \
   do                                                                   \
     {                                                                  \
       if (TARGET_SUN_TLS                                               \
          && in_section                                                 \
          && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
        switch_to_section (bss_section);                                \
-      x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN);                        \
+      x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN);     \
     }                                                                  \
   while  (0)
 
@@ -230,6 +230,10 @@ along with GCC; see the file COPYING3.  If not see
 #define DTORS_SECTION_ASM_OP   "\t.section\t.dtors, \"aw\""
 #endif
 
+#ifndef USE_GAS
+#define LARGECOMM_SECTION_ASM_OP "\t.lbcomm\t"
+#endif
+
 #define USE_IX86_FRAME_POINTER 1
 #define USE_X86_64_FRAME_POINTER 1
 
index 204f128d5b0e39aa26e63d22eacbfee751187d74..b0bf83589d7b4a5ae34d7c5e4549c7876e81025f 100644 (file)
@@ -55,9 +55,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
   x86_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
 
-#undef  ASM_OUTPUT_ALIGNED_COMMON
-#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)             \
-  x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN);
+#undef  ASM_OUTPUT_ALIGNED_DECL_COMMON
+#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN)          \
+  x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN);
 
 /* This is used to align code labels according to Intel recommendations.  */