]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine whether the assemb...
authorRoger Sayle <roger@eyesopen.com>
Thu, 2 Nov 2006 00:56:38 +0000 (00:56 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 2 Nov 2006 00:56:38 +0000 (00:56 +0000)
* configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine
whether the assembler supports taking the difference of symbols in
different sections.  On x86/Solaris, GAS does but Solaris as doesn't.
* configure: Regenerate.
* config.in: Regenerate.
* config/i386/sol2-10.h (JUMP_TABLES_IN_TEXT_SECTION): Define if
the assembler doesn't support taking the difference of symbols in
different sections, i.e. we're using the native solaris assembler.

From-SVN: r118405

gcc/ChangeLog
gcc/config.in
gcc/config/i386/sol2-10.h
gcc/configure
gcc/configure.ac

index e3a24355f37ff0405b02b9f0551635eaf8860935..65fdde091f26cc599723436a656e8a0393458aca 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-01  Roger Sayle  <roger@eyesopen.com>
+
+       * configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine
+       whether the assembler supports taking the difference of symbols in
+       different sections.  On x86/Solaris, GAS does but Solaris as doesn't.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * config/i386/sol2-10.h (JUMP_TABLES_IN_TEXT_SECTION): Define if
+       the assembler doesn't support taking the difference of symbols in
+       different sections, i.e. we're using the native solaris assembler.
+
 2006-11-01  Pete Steinmetz  <steinmtz@us.ibm.com>
            Peter Bergner  <bergner@vnet.ibm.com>
 
index 0f5f01164554c33d1e80397cec4d956c755297a5..a8e18bc3bb762ea59c6abd1d56ff3a3a0e0d8e8e 100644 (file)
 #endif
 
 
+/* Define if your assembler supports the subtraction of symbols in different
+   sections. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_IX86_DIFF_SECT_DELTA
+#endif
+
+
 /* Define if your assembler supports the ffreep mnemonic. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_IX86_FFREEP
index af51b4cb37682cd8abcdde3c861af7a6ef8d7bc6..587e56fe7fa9351a8373f35c81192e9a5de7f97f 100644 (file)
@@ -1,5 +1,5 @@
 /* Solaris 10 configuration.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC.
 
 This file is part of GCC.
@@ -34,6 +34,14 @@ Boston, MA 02110-1301, USA.  */
                 "-s %(asm_cpu)"
 #endif
 
+/* The native Solaris assembler can't calculate the difference between
+   symbols in different sections, which causes problems for -fPIC jump
+   tables in .rodata.  */
+#ifndef HAVE_AS_IX86_DIFF_SECT_DELTA
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
+#endif
+
 #undef NO_PROFILE_COUNTERS
 
 #undef MCOUNT_NAME
index 2e2b0bc1b758248a5d74eea6ec30eb270a8ee6ef..582e37b1a93e87ed7649ec1be3348a700e06a6a4 100755 (executable)
@@ -15251,6 +15251,45 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_AS_IX86_FFREEP 1
 _ACEOF
 
+fi
+
+    echo "$as_me:$LINENO: checking assembler for different section symbol subtraction" >&5
+echo $ECHO_N "checking assembler for different section symbol subtraction... $ECHO_C" >&6
+if test "${gcc_cv_as_ix86_diff_sect_delta+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  gcc_cv_as_ix86_diff_sect_delta=no
+  if test x$gcc_cv_as != x; then
+    echo '.section .rodata
+.L1:
+        .long .L2-.L1
+        .long .L3-.L1
+        .text
+.L3:    nop
+.L2:    nop' > conftest.s
+    if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+    then
+       gcc_cv_as_ix86_diff_sect_delta=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_diff_sect_delta" >&5
+echo "${ECHO_T}$gcc_cv_as_ix86_diff_sect_delta" >&6
+if test $gcc_cv_as_ix86_diff_sect_delta = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_IX86_DIFF_SECT_DELTA 1
+_ACEOF
+
 fi
 
     # This one is used unconditionally by i386.[ch]; it is to be defined
index fca9fedaf07dec194b739dfae31ce3305ea28948..b089f607a757eb90cf3806e687b06435d7a18858 100644 (file)
@@ -2850,6 +2850,18 @@ foo:     nop
       [AC_DEFINE(HAVE_AS_IX86_FFREEP, 1,
         [Define if your assembler supports the ffreep mnemonic.])])
 
+    gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
+      gcc_cv_as_ix86_diff_sect_delta,,,
+      [.section .rodata
+.L1:
+        .long .L2-.L1
+        .long .L3-.L1
+        .text
+.L3:    nop
+.L2:    nop],,
+      [AC_DEFINE(HAVE_AS_IX86_DIFF_SECT_DELTA, 1,
+        [Define if your assembler supports the subtraction of symbols in different sections.])])
+
     # This one is used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],