aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-02-04 21:55:44 -0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-03-05 17:05:05 -0300
commit87a698a21646b7ee620923ef5ffa9735471a8ddd (patch)
treea1cdcf63ba69046a1d9becac55f6b4300fc71169
parent24fdebe75f6df4c0edacb3f0cdc030913920aa4c (diff)
downloadglibc-87a698a21646b7ee620923ef5ffa9735471a8ddd.tar
glibc-87a698a21646b7ee620923ef5ffa9735471a8ddd.tar.gz
glibc-87a698a21646b7ee620923ef5ffa9735471a8ddd.tar.bz2
glibc-87a698a21646b7ee620923ef5ffa9735471a8ddd.zip
Improve IFUNC check [BZ #25506]
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>
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
2 files changed, 2 insertions, 2 deletions
diff --git a/configure b/configure
index b959d2d988..3b98ec312f 100755
--- 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
diff --git a/configure.ac b/configure.ac
index 49b900c1ed..e20034f301 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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