]> sourceware.org Git - glibc.git/commitdiff
Add sparc configure checks for GOTDATA support.
authorDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2012 20:06:07 +0000 (12:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2012 01:51:48 +0000 (17:51 -0800)
* config.h.in (HAVE_BINUTILS_GOTDATA): New.
(HAVE_GCC_GOTDATA): New.
* sysdeps/sparc/elf/configure.in: Test for GOTDATA
relocation support in both binutils and gcc.
* sysdeps/sparc/elf/configure: Regenerate.

ChangeLog
config.h.in
sysdeps/sparc/elf/configure
sysdeps/sparc/elf/configure.in

index af25b40375a598f15e22557c29e920f5513c72a6..6eb14f67d55f6215bc79776ee0adb666b06d2da3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-02-20  David S. Miller  <davem@davemloft.net>
 
+       * config.h.in (HAVE_BINUTILS_GOTDATA): New.
+       (HAVE_GCC_GOTDATA): New.
+       * sysdeps/sparc/elf/configure.in: Test for GOTDATA
+       relocation support in both binutils and gcc.
+       * sysdeps/sparc/elf/configure: Regenerate.
+
        * sysdeps/sparc/sparc32/elf/configure.in: Delete.
        * sysdeps/sparc/sparc32/elf/configure: Delete.
        * sysdeps/sparc/sparc64/elf/configure.in: Delete.
index 53c68236c529fbe08e0669822806a5ed70fd6246..b5034545bcaa3763f2e15d7696d1bc1b265cf7f3 100644 (file)
    certain registers (CR0, MQ, CTR, LR) in asm statements.  */
 #undef BROKEN_PPC_ASM_CR0
 
+/* Defined on SPARC if as and ld both support GOTDATA relocations.  */
+#undef  HAVE_BINUTILS_GOTDATA
+
+/* Defined on SPARC if GCC emits GOTDATA relocations.  */
+#undef  HAVE_GCC_GOTDATA
+
 /* Define if the linker supports the -z combreloc option.  */
 #undef HAVE_Z_COMBRELOC
 
index 78dc977ec760b677325e987fd8a419b70ec609f8..67a40398c7bf4713b89de78b7246ffb492bca786 100644 (file)
@@ -136,3 +136,76 @@ $as_echo "$libc_cv_sparc_tls" >&6; }
 if test $libc_cv_sparc_tls = no; then
   as_fn_error $? "the assembler must support TLS" "$LINENO" 5
 fi
+
+# Check for GOTDATA relocation support in assembler and linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc binutils GOTDATA reloc support" >&5
+$as_echo_n "checking for sparc binutils GOTDATA reloc support... " >&6; }
+if ${libc_cv_sparc_gotdata+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.S <<\EOF
+       .data
+       .globl  data
+data:  .word   0
+       .text
+       .globl  foo
+foo:   sethi   %gdop_hix22(data), %g1
+       xor     %g1, %gdop_lox10(data), %g1
+#ifdef __arch64__
+       ldx     [%l7 + %g1], %g1, %gdop(data)
+#else
+       ld      [%l7 + %g1], %g1, %gdop(data)
+#endif
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS conftest.S 1>&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
+  libc_cv_sparc_gotdata=yes
+else
+  libc_cv_sparc_gotdata=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_gotdata" >&5
+$as_echo "$libc_cv_sparc_gotdata" >&6; }
+if test $libc_cv_sparc_gotdata = yes; then
+  $as_echo "#define HAVE_BINUTILS_GOTDATA 1" >>confdefs.h
+
+fi
+
+# Check for a GCC emitting GOTDATA relocations.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc gcc GOTDATA reloc support" >&5
+$as_echo_n "checking for sparc gcc GOTDATA reloc support... " >&6; }
+if ${libc_cv_sparc_gcc_gotdata+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<\EOF
+int data;
+int foo(void)
+{
+       return data;
+}
+EOF
+libc_cv_sparc_gcc_gotdata=no
+if { ac_try='${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&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
+  if grep -q 'gdop_hix22' conftest.s \
+     && grep -q 'gdop_lox10' conftest.s; then
+    libc_cv_sparc_gcc_gotdata=yes
+  fi
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_gcc_gotdata" >&5
+$as_echo "$libc_cv_sparc_gcc_gotdata" >&6; }
+if test $libc_cv_sparc_gcc_gotdata = yes; then
+  $as_echo "#define HAVE_GCC_GOTDATA 1" >>confdefs.h
+
+fi
index c22a7c5c58b0f1d7a6dbc0433685902e6ea17805..ab8b189a7fe6f29e4319062f8161605ee1aaa3fc 100644 (file)
@@ -45,3 +45,56 @@ rm -f conftest*])
 if test $libc_cv_sparc_tls = no; then
   AC_MSG_ERROR([the assembler must support TLS])
 fi
+
+# Check for GOTDATA relocation support in assembler and linker.
+AC_CACHE_CHECK(for sparc binutils GOTDATA reloc support, libc_cv_sparc_gotdata, [dnl
+changequote(,)dnl
+cat > conftest.S <<\EOF
+       .data
+       .globl  data
+data:  .word   0
+       .text
+       .globl  foo
+foo:   sethi   %gdop_hix22(data), %g1
+       xor     %g1, %gdop_lox10(data), %g1
+#ifdef __arch64__
+       ldx     [%l7 + %g1], %g1, %gdop(data)
+#else
+       ld      [%l7 + %g1], %g1, %gdop(data)
+#endif
+EOF
+changequote([,])dnl
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_sparc_gotdata=yes
+else
+  libc_cv_sparc_gotdata=no
+fi
+rm -f conftest*])
+if test $libc_cv_sparc_gotdata = yes; then
+  AC_DEFINE(HAVE_BINUTILS_GOTDATA)
+fi
+
+# Check for a GCC emitting GOTDATA relocations.
+AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
+changequote(,)dnl
+cat > conftest.c <<\EOF
+int data;
+int foo(void)
+{
+       return data;
+}
+EOF
+changequote([,])dnl
+dnl
+libc_cv_sparc_gcc_gotdata=no
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&AS_MESSAGE_LOG_FD); then
+  if grep -q 'gdop_hix22' conftest.s \
+     && grep -q 'gdop_lox10' conftest.s; then
+    libc_cv_sparc_gcc_gotdata=yes
+  fi
+fi
+rm -f conftest*])
+if test $libc_cv_sparc_gcc_gotdata = yes; then
+  AC_DEFINE(HAVE_GCC_GOTDATA)
+fi
This page took 0.054724 seconds and 5 git commands to generate.