]> 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)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 8 Mar 2020 13:07:19 +0000 (14:07 +0100)
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>
(cherry picked from commit 87a698a21646b7ee620923ef5ffa9735471a8ddd)

configure
configure.ac

index 6d26b8246f2d8f7004a43f266c169488c3eb3632..83ae6899c54acd302ab9cd764efee209860498bc 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 7436485419a953ed0bee4c956aff6eaeb9c6d730..51b85359ee84c19357b938aa6c4c498484dd9b6d 100644 (file)
@@ -648,7 +648,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