Properly set progbits/nobits for Solaris/SPARC as
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 30 Jan 2013 09:26:21 +0000 (09:26 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 30 Jan 2013 09:26:21 +0000 (09:26 +0000)
* configure.ac (HAVE_AS_SPARC_NOBITS): New test.
* configure: Regenerate.
* config.in: Regenerate.
* config/sparc/sparc.c (sparc_solaris_elf_asm_named_section): Emit
#nobits/#progbits if supported.

From-SVN: r195572

gcc/ChangeLog
gcc/config.in
gcc/config/sparc/sparc.c
gcc/configure
gcc/configure.ac

index 2dbe38241db72ce47acd15d9bf18a4443174b9d1..b796e699d383ab551f78db9852ce08dcc5d6fbe6 100644 (file)
@@ -1,3 +1,11 @@
+2013-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac (HAVE_AS_SPARC_NOBITS): New test.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * config/sparc/sparc.c (sparc_solaris_elf_asm_named_section): Emit
+       #nobits/#progbits if supported.
+
 2013-01-29  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/56121
index 7038906340199a41ba5938f93a6db4375b3ab81c..d80fb9f6e11379cb778c2fbe791168e18610e588 100644 (file)
 #endif
 
 
-/* Define if the zone collector is in use */
-#ifndef USED_FOR_TARGET
-#undef GGC_ZONE
-#endif
-
-
 /* mcontext_t fields start with __ */
 #ifndef USED_FOR_TARGET
 #undef HAS_MCONTEXT_T_UNDERSCORES
 #endif
 
 
-/* Define if your assembler supports SPARC4 instructions. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_AS_SPARC4
-#endif
-
-
 /* Define if your assembler supports fprnd. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_FPRND
 #endif
 
 
+/* Define if your assembler supports SPARC4 instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_SPARC4
+#endif
+
+
 /* Define if your assembler and linker support GOTDATA_OP relocs. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_SPARC_GOTDATA_OP
 #endif
 
 
+/* Define to 1 if your assembler supports #nobits, 0 otherwise. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_SPARC_NOBITS
+#endif
+
+
 /* Define if your assembler and linker support unaligned PC relative relocs.
    */
 #ifndef USED_FOR_TARGET
 #endif
 
 
-/* Define if your PowerPC64 linker supports a large TOC. */
+/* Define if your AIX linker supports a large TOC. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_LD_LARGE_TOC
 #endif
index 3d7db6070943390ec60628987b4555ed2a513244..08c2894fbbc0f5e2d34962086bb87f680ba664d2 100644 (file)
@@ -9512,7 +9512,14 @@ sparc_solaris_elf_asm_named_section (const char *name, unsigned int flags,
   if (flags & SECTION_CODE)
     fputs (",#execinstr", asm_out_file);
 
-  /* ??? Handle SECTION_BSS.  */
+  /* Sun as only supports #nobits/#progbits since Solaris 10.  */
+  if (HAVE_AS_SPARC_NOBITS)
+    {
+      if (flags & SECTION_BSS)
+       fputs (",#nobits", asm_out_file);
+      else
+       fputs (",#progbits", asm_out_file);
+    }
 
   fputc ('\n', asm_out_file);
 }
index 5730c9d45177cc63cb9c98c5afeaabcbbca2d0d7..6711c0feb5f7f8d3682bb8b4c39bb4394efaaf49 100755 (executable)
@@ -23927,6 +23927,39 @@ $as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
 
 fi
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for #nobits" >&5
+$as_echo_n "checking assembler for #nobits... " >&6; }
+if test "${gcc_cv_as_sparc_nobits+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_sparc_nobits=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.section "nobits",#alloc,#write,#nobits
+       .section "progbits",#alloc,#write,#progbits' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_sparc_nobits=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sparc_nobits" >&5
+$as_echo "$gcc_cv_as_sparc_nobits" >&6; }
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_AS_SPARC_NOBITS `if test $gcc_cv_as_sparc_nobits = yes; then echo 1; else echo 0; fi`
+_ACEOF
+
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -relax option" >&5
 $as_echo_n "checking assembler for -relax option... " >&6; }
 if test "${gcc_cv_as_sparc_relax+set}" = set; then :
index b471faef02f0d9b9e86e34f9c9924025955a7e94..9ae560489059d1c4a6cfe5e92b3bc3434f7b97a2 100644 (file)
@@ -3467,6 +3467,13 @@ case "$target" in
       [AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
                [Define if your assembler supports .register.])])
 
+    gcc_GAS_CHECK_FEATURE([@%:@nobits], gcc_cv_as_sparc_nobits,,,
+      [.section "nobits",#alloc,#write,#nobits
+       .section "progbits",#alloc,#write,#progbits])
+    AC_DEFINE_UNQUOTED(HAVE_AS_SPARC_NOBITS,
+      [`if test $gcc_cv_as_sparc_nobits = yes; then echo 1; else echo 0; fi`],
+      [Define to 1 if your assembler supports #nobits, 0 otherwise.])
+
     gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,,
       [-relax], [.text],,
       [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,