[PATCH v2] Improve IFUNC check

Aurelien Jarno aurelien@aurel32.net
Wed Mar 4 21:38:00 GMT 2020


Could someone please review the patch below so that it can get
committed? Thanks.

On 2020-02-10 11:14, Fangrui Song wrote:
> Attached PATCH v2.
> 
> sparc64 has a non-conventional R_SPARC_JMP_IREL, along with conventional
> R_SPARC_IRELATIVE.

> From 624b3a0c9e4f2f421227bb3f331723dfe807f157 Mon Sep 17 00:00:00 2001
> From: Fangrui Song <maskray@google.com>
> Date: Tue, 4 Feb 2020 21:55:44 -0800
> Subject: [PATCH] Improve IFUNC check [BZ #25506]
> 
> GNU ld does not support IFUNC but does not produces a relocation.
> The test passed incorrectly. Be more rigid by testing IRELATIVE
> explicitly.
> ---
>  configure    | 2 +-
>  configure.ac | 2 +-
>  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
> -- 
> 2.25.0.341.g760bfbb309-goog
> 


-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net



More information about the Libc-alpha mailing list