]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Improve IFUNC check [BZ #25506]
authorFangrui Song <maskray@google.com>
Wed, 5 Feb 2020 05:55:44 +0000 (21:55 -0800)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 5 Mar 2020 20:05:05 +0000 (17:05 -0300)
GNU ld's RISCV port does not support IFUNC. ld -no-pie produces no
relocation and the test passed incorrectly. Be more rigid by testing
IRELATIVE explicitly.

Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
configure
configure.ac

index b959d2d9885e53e6adcd7037f8382720555abd40..3b98ec312fc9c8cc605453654a6ca72106ca0185 100755 (executable)
--- a/configure
+++ b/configure
@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
            -o conftest conftest.S 1>&5 2>&5; then
   # Do a link to see if the backend supports IFUNC relocs.
   $READELF -r conftest 1>&5
-  LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
+  LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && {
     libc_cv_ld_gnu_indirect_function=yes
   }
 fi
index 49b900c1ed68fa4dd1dadca809ceb6e8b237a89c..e20034f301fd7d04ab1c4499bfc1eacdb316570c 100644 (file)
@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
            -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   # Do a link to see if the backend supports IFUNC relocs.
   $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
-  LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
+  LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && {
     libc_cv_ld_gnu_indirect_function=yes
   }
 fi