Bug 20478 - libc_ifunc macro and similar usages leads to false debug-information.
Summary: libc_ifunc macro and similar usages leads to false debug-information.
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: 2.25
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 10:35 UTC by Stefan Liebler
Modified: 2016-10-07 08:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Liebler 2016-08-17 10:35:09 UTC
The current s390 ifunc resolver for vector optimized functions and the common
libc_ifunc macro in include/libc-symbols.h uses something like that to define an ifunc'ed symbol:
extern void *__resolve___strlen(unsigned long int dl_hwcap) asm (strlen);
asm (".type strlen, %gnu_indirect_function");

This leads to false debug information:
objdump --dwarf=info libc.so:
...
<1><1e6424>: Abbrev Number: 43 (DW_TAG_subprogram)
    <1e6425>   DW_AT_external    : 1
    <1e6425>   DW_AT_name        : (indirect string, offset: 0x1146e): __resolve___strlen
    <1e6429>   DW_AT_decl_file   : 1
    <1e642a>   DW_AT_decl_line   : 23
    <1e642b>   DW_AT_linkage_name: (indirect string, offset: 0x1147a): strlen
    <1e642f>   DW_AT_prototyped  : 1
    <1e642f>   DW_AT_type        : <0x1e4ccd>
    <1e6433>   DW_AT_low_pc      : 0x998e0
    <1e643b>   DW_AT_high_pc     : 0x16
    <1e6443>   DW_AT_frame_base  : 1 byte block: 9c     (DW_OP_call_frame_cfa)
    <1e6445>   DW_AT_GNU_all_call_sites: 1
    <1e6445>   DW_AT_sibling     : <0x1e6459>
 <2><1e6449>: Abbrev Number: 44 (DW_TAG_formal_parameter)
    <1e644a>   DW_AT_name        : (indirect string, offset: 0x1845): dl_hwcap
    <1e644e>   DW_AT_decl_file   : 1
    <1e644f>   DW_AT_decl_line   : 23
    <1e6450>   DW_AT_type        : <0x1e4c8d>
    <1e6454>   DW_AT_location    : 0x122115 (location list)
...

The debuginfo for the ifunc-resolver function contains the DW_AT_linkage_name
field, which names the real function name "strlen". If you perform an inferior
function call to strlen in lldb, then it fails due to something like that:
"error: no matching function for call to 'strlen'
candidate function not viable: no known conversion from 'const char [6]'
to 'unsigned long' for 1st argument"

The unsigned long is the dl_hwcap argument of the resolver function.
The strlen function itself has no debuginfo.

Please have a look at the patchset "[PATCH v2 1/9] Add configure check to test if gcc supports attribute ifunc." (https://www.sourceware.org/ml/libc-alpha/2016-08/msg00258.html) on the mailinglist.
Comment 1 cvs-commit@gcc.gnu.org 2016-10-07 08:25:54 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  314ba75e4a26f7147c757a10b07a62ff113409aa (commit)
       via  051f8be7c9466c7e53bf1f3a9d5a83c53a7ea815 (commit)
       via  75685c4d98cf260181879b799e403c6cc37418be (commit)
       via  98ac7b7c85429913c94a9bd9fbe74bb5a333d224 (commit)
       via  a4d7fe35cd8f860b1cdf3521834a666447aba4c8 (commit)
       via  e23faea6aec97b75f7a7567350538c1c0dfc1cee (commit)
       via  18d6c45e12127ea88a704c0915de2ba13d3af998 (commit)
       via  00980d845f8f2ec3ed4ad161a1e5b97704be1929 (commit)
       via  022dfdce000374b60aadfb0a5ed9a5c4c1dbd29b (commit)
      from  1e7c8fcca5ace329f81785bcdfc139a4c93e9de5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=314ba75e4a26f7147c757a10b07a62ff113409aa

commit 314ba75e4a26f7147c757a10b07a62ff113409aa
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:48 2016 +0200

    Use libc_ifunc macro for siglongjmp, longjmp in libpthread.
    
    This patch uses the libc_ifunc macro to create already existing ifunc functions
    longjmp_ifunc, siglongjmp_ifunc if HAVE_IFUNC is defined.
    The s390 pt-longjmp.c includes the common pt-longjmp.c and uses strong_alias
    to create the longjmp, siglongjmp symbols for glibc version 2.19.
    
    ChangeLog:
    
    	* nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
    	* sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
    	Use strong_alias to create symbols for glibc verison 2.19.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=051f8be7c9466c7e53bf1f3a9d5a83c53a7ea815

commit 051f8be7c9466c7e53bf1f3a9d5a83c53a7ea815
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    Use libc_ifunc macro for vfork in libpthread.
    
    This patch uses the libc_ifunc macro to create already existing ifunc functions
    vfork_ifunc and __vfork_ifunc if HAVE_IFUNC is defined.
    
    ChangeLog:
    
    	* nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=75685c4d98cf260181879b799e403c6cc37418be

commit 75685c4d98cf260181879b799e403c6cc37418be
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    Use libc_ifunc macro for system in libpthread.
    
    This patch uses the libc_ifunc macro to create already existing ifunc function
    system_ifunc if HAVE_IFUNC is defined.
    
    ChangeLog:
    
    	* nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=98ac7b7c85429913c94a9bd9fbe74bb5a333d224

commit 98ac7b7c85429913c94a9bd9fbe74bb5a333d224
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    Use libc_ifunc macro for clock_* symbols in librt.
    
    This patch uses the libc_ifunc macro to create already existing ifunc functions
    clock_getres, clock_gettime, clock_settime, clock_getcpuclockid and
    clock_nanosleep. If HAVE_IFUNC is defined, the macro COMPAT_REDIRECT uses
    the libc_ifunc macro.
    Furthermore some whitespace damage is cleaned.
    
    ChangeLog:
    
    	* rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a4d7fe35cd8f860b1cdf3521834a666447aba4c8

commit a4d7fe35cd8f860b1cdf3521834a666447aba4c8
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    ppc: Use libc_ifunc macro for time, gettimeofday.
    
    This patch uses the libc_ifunc_hidden macro to create already existing ifunc functions
    time and gettimeofday on power. This way, the libc_hidden_def macro can be used
    instead of inline assemblies.
    On ppc32, the __GI_* symbols do not target the ifunc symbol and thus the
    redirection construct has to be applied here.
    
    ChangeLog:
    
    	* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
    	Use libc_ifunc_hidden and libc_hidden_def macro. Redirect ifunced function
    	in header for using it as type for ifunc function because __GI_* symbols
    	for ppc32 do not target the ifunc symbols.
    	* sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e23faea6aec97b75f7a7567350538c1c0dfc1cee

commit e23faea6aec97b75f7a7567350538c1c0dfc1cee
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    i386, x86: Use libc_ifunc macro for time, gettimeofday.
    
    This patch uses the libc_ifunc_hidden macro to create already existing ifunc functions
    time and gettimeofday on intel. This way, the libc_hidden_def macro can be used
    instead of the libc_ifunc_hidden_def one which was only used here. Thus the
    macro is removed from libc-symbols.h.
    On i386, the __GI_* symbols do not target the ifunc symbol and thus the
    redirection construct has to be applied here.
    
    ChangeLog:
    
    	* sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday):
    	Use libc_ifunc_hidden macro. Use libc_hidden_def instead of
    	libc_ifunc_hidden_def.
    	* sysdeps/unix/sysv/linux/x86/time.c (time): Likewise.
    	* sysdeps/unix/sysv/linux/i386/gettimeofday.c (__gettimeofday):
    	Redirect ifunced function in header for using it as type of ifunc'ed
    	function. Redefine libc_hidden_def to use fallback non ifunc'ed
    	function for __GI_* symbol.
    	* sysdeps/unix/sysv/linux/i386/time.c (time): Likewise.
    	* include/libc-symbols.h
    	(libc_ifunc_hidden_def, libc_ifunc_hidden_def1): Delete macro.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=18d6c45e12127ea88a704c0915de2ba13d3af998

commit 18d6c45e12127ea88a704c0915de2ba13d3af998
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:47 2016 +0200

    s390: Refactor ifunc resolvers due to false debuginfo.
    
    This patch adjusts the s390 specific ifunc helper macros in ifunc-resolve.h to
    use the common __ifunc macro, which uses gcc attribute ifunc to get rid of the
    false debuginfo. Therefore the redirection construct is applied where needed.
    
    Perhaps in future we can switch some of the internal symbols __GI_* from the
    fallback variant to the ifunc function. But this change is not
    straightforward due to a segmentation fault while linking libc.so with older
    binutils on s390.
    
    ChangeLog:
    
    	[BZ #20478]
    	* sysdeps/s390/multiarch/ifunc-resolve.h
    	(s390_vx_libc_ifunc2, s390_libc_ifunc): Use __ifunc from libc-symbols.h
    	to create ifunc symbols.
    	(s390_vx_libc_ifunc_init, s390_vx_libc_ifunc_redirected
    	, s390_vx_libc_ifunc2_redirected, s390_libc_ifunc_init): New define.
    	* sysdeps/s390/multiarch/memchr.c: Redirect ifunced function in header
    	for using it as type for ifunc function.
    	* sysdeps/s390/multiarch/mempcpy.c: Likewise.
    	* sysdeps/s390/multiarch/rawmemchr.c: Likewise.
    	* sysdeps/s390/multiarch/stpcpy.c: Likewise.
    	* sysdeps/s390/multiarch/stpncpy.c: Likewise.
    	* sysdeps/s390/multiarch/strcat.c: Likewise.
    	* sysdeps/s390/multiarch/strchr.c: Likewise.
    	* sysdeps/s390/multiarch/strcmp.c: Likewise.
    	* sysdeps/s390/multiarch/strcpy.c: Likewise.
    	* sysdeps/s390/multiarch/strcspn.c: Likewise.
    	* sysdeps/s390/multiarch/strlen.c: Likewise.
    	* sysdeps/s390/multiarch/strncmp.c: Likewise.
    	* sysdeps/s390/multiarch/strncpy.c: Likewise.
    	* sysdeps/s390/multiarch/strnlen.c: Likewise.
    	* sysdeps/s390/multiarch/strpbrk.c: Likewise.
    	* sysdeps/s390/multiarch/strrchr.c: Likewise.
    	* sysdeps/s390/multiarch/strspn.c: Likewise.
    	* sysdeps/s390/multiarch/wcschr.c: Likewise.
    	* sysdeps/s390/multiarch/wcscmp.c: Likewise.
    	* sysdeps/s390/multiarch/wcspbrk.c: Likewise.
    	* sysdeps/s390/multiarch/wcsspn.c: Likewise.
    	* sysdeps/s390/multiarch/wmemchr.c: Likewise.
    	* sysdeps/s390/multiarch/wmemset.c: Likewise.
    	* sysdeps/s390/s390-32/multiarch/memcmp.c: Likewise.
    	* sysdeps/s390/s390-32/multiarch/memcpy.c: Likewise.
    	* sysdeps/s390/s390-32/multiarch/memset.c: Likewise.
    	* sysdeps/s390/s390-64/multiarch/memcmp.c: Likewise.
    	* sysdeps/s390/s390-64/multiarch/memcpy.c: Likewise.
    	* sysdeps/s390/s390-64/multiarch/memset.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=00980d845f8f2ec3ed4ad161a1e5b97704be1929

commit 00980d845f8f2ec3ed4ad161a1e5b97704be1929
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:46 2016 +0200

    Use gcc attribute ifunc in libc_ifunc macro instead of inline assembly due to false debuginfo.
    
    The current s390 ifunc resolver for vector optimized functions and the common
    libc_ifunc macro in include/libc-symbols.h uses something like that to generate ifunc'ed functions:
    extern void *__resolve___strlen(unsigned long int dl_hwcap) asm (strlen);
    asm (".type strlen, %gnu_indirect_function");
    
    This leads to false debug information:
    objdump --dwarf=info libc.so:
    ...
    <1><1e6424>: Abbrev Number: 43 (DW_TAG_subprogram)
        <1e6425>   DW_AT_external    : 1
        <1e6425>   DW_AT_name        : (indirect string, offset: 0x1146e): __resolve___strlen
        <1e6429>   DW_AT_decl_file   : 1
        <1e642a>   DW_AT_decl_line   : 23
        <1e642b>   DW_AT_linkage_name: (indirect string, offset: 0x1147a): strlen
        <1e642f>   DW_AT_prototyped  : 1
        <1e642f>   DW_AT_type        : <0x1e4ccd>
        <1e6433>   DW_AT_low_pc      : 0x998e0
        <1e643b>   DW_AT_high_pc     : 0x16
        <1e6443>   DW_AT_frame_base  : 1 byte block: 9c     (DW_OP_call_frame_cfa)
        <1e6445>   DW_AT_GNU_all_call_sites: 1
        <1e6445>   DW_AT_sibling     : <0x1e6459>
     <2><1e6449>: Abbrev Number: 44 (DW_TAG_formal_parameter)
        <1e644a>   DW_AT_name        : (indirect string, offset: 0x1845): dl_hwcap
        <1e644e>   DW_AT_decl_file   : 1
        <1e644f>   DW_AT_decl_line   : 23
        <1e6450>   DW_AT_type        : <0x1e4c8d>
        <1e6454>   DW_AT_location    : 0x122115 (location list)
    ...
    
    The debuginfo for the ifunc-resolver function contains the DW_AT_linkage_name
    field, which names the real function name "strlen". If you perform an inferior
    function call to strlen in lldb, then it fails due to something like that:
    "error: no matching function for call to 'strlen'
    candidate function not viable: no known conversion from 'const char [6]'
    to 'unsigned long' for 1st argument"
    
    The unsigned long is the dl_hwcap argument of the resolver function.
    The strlen function itself has no debufinfo.
    
    The s390 ifunc resolver for memset & co uses something like that:
    asm (".globl FUNC"
         ".type FUNC, @gnu_indirect_function"
         ".set FUNC, __resolve_FUNC");
    
    This way the debuginfo for the ifunc-resolver function does not conain the
    DW_AT_linkage_name field and the real function has no debuginfo, too.
    
    Using this strategy for the vector optimized functions leads to some troubles
    for functions like strnlen. Here we have __strnlen and a weak alias strnlen.
    The __strnlen function is the ifunc function, which is realized with the asm-
    statement above. The weak_alias-macro can't be used here due to undefined symbol:
    gcc ../sysdeps/s390/multiarch/strnlen.c -c ...
    In file included from <command-line>:0:0:
    ../sysdeps/s390/multiarch/strnlen.c:28:24: error: ‘strnlen’ aliased to undefined symbol ‘__strnlen’
     weak_alias (__strnlen, strnlen)
                            ^
    ./../include/libc-symbols.h:111:26: note: in definition of macro ‘_weak_alias’
       extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
                              ^
    ../sysdeps/s390/multiarch/strnlen.c:28:1: note: in expansion of macro ‘weak_alias’
     weak_alias (__strnlen, strnlen)
     ^
    make[2]: *** [build/string/strnlen.o] Error 1
    
    As the __strnlen function is defined with asm-statements the function name
    __strnlen isn't known by gcc. But the weak alias can also be done with an
    asm statement to resolve this issue:
    __asm__ (".weak  strnlen\n\t"
             ".set   strnlen,__strnlen\n");
    
    In order to use the weak_alias macro, gcc needs to know the ifunc function. The
    minimum gcc to build glibc is currently 4.7, which supports attribute((ifunc)).
    See https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html.
    It is only supported if gcc is configured with --enable-gnu-indirect-function
    or gcc supports it by default for at least intel and s390x architecture.
    This patch uses the old behaviour if gcc support is not available.
    Usage of attribute ifunc is something like that:
    __typeof (FUNC) FUNC __attribute__ ((ifunc ("__resolve_FUNC")));
    
    Then gcc produces the same .globl, .type, .set assembler instructions like above.
    And the debuginfo does not contain the DW_AT_linkage_name field and there is no
    debuginfo for the real function, too.
    
    But in order to get it work, there is also some extra work to do.
    Currently, the glibc internal symbol on s390x e.g. __GI___strnlen is not the
    ifunc symbol, but the fallback __strnlen_c symbol. Thus I have to omit the
    libc_hidden_def macro in strnlen.c (here is the ifunc function __strnlen)
    because it is already handled in strnlen-c.c (here is __strnlen_c).
    
    Due to libc_hidden_proto (__strnlen) in string.h, compiling fails:
    gcc ../sysdeps/s390/multiarch/strnlen.c -c ...
    In file included from <command-line>:0:0:
    ../sysdeps/s390/multiarch/strnlen.c:53:24: error: ‘strnlen’ aliased to undefined symbol ‘__strnlen’
     weak_alias (__strnlen, strnlen)
                            ^
    ./../include/libc-symbols.h:111:26: note: in definition of macro ‘_weak_alias’
       extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
                              ^
    ../sysdeps/s390/multiarch/strnlen.c:53:1: note: in expansion of macro ‘weak_alias’
     weak_alias (__strnlen, strnlen)
     ^
    make[2]: *** [build/string/strnlen.os] Error 1
    
    I have to redirect the prototypes for __strnlen in string.h and create a copy
    of the prototype for using as ifunc function:
    __typeof (__redirect___strnlen) __strnlen __attribute__ ((ifunc ("__resolve_strnlen")));
    weak_alias (__strnlen, strnlen)
    
    This way there is no trouble with the internal __GI_* symbols.
    Glibc builds fine with this construct and the debuginfo is "correct".
    For functions without a __GI_* symbol like memccpy this redirection is not needed.
    
    This patch adjusts the common libc_ifunc and libm_ifunc macro to use gcc
    attribute ifunc. Due to this change, the macro users where the __GI_* symbol
    does not target the ifunc symbol have to be prepared with the redirection
    construct.
    Furthermore a configure check to test gcc support is added. If it is not supported,
    the old behaviour is used.
    
    This patch also prepares the libc_ifunc macro to be useable in s390-ifunc-macro.
    The s390 ifunc-resolver-functions do have an hwcaps parameter and not all
    resolvers need the same initialization code. The next patch in this series
    changes the s390 ifunc macros to use this common one.
    
    ChangeLog:
    
    	* include/libc-symbols.h (__ifunc_resolver):
    	New macro is used by __ifunc* macros.
    	(__ifunc): New macro uses gcc attribute ifunc or inline assembly
    	depending on HAVE_GCC_IFUNC.
    	(libc_ifunc, libm_ifunc): Use __ifunc as base macro.
    	(libc_ifunc_redirected, libc_ifunc_hidden, libm_ifunc_init): New macro.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c:
    	Redirect ifunced function in header for using as type for ifunc function.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c: Likewise.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c: Likewise.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/strstr.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise.
    	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c:
    	Add libc_hidden_def() and use libc_ifunc_hidden() macro
    	instead of libc_ifunc() macro.
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c: Likewise.
    	* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=022dfdce000374b60aadfb0a5ed9a5c4c1dbd29b

commit 022dfdce000374b60aadfb0a5ed9a5c4c1dbd29b
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Oct 7 09:56:46 2016 +0200

    Add configure check to test if gcc supports attribute ifunc.
    
    This patch adds a configure check to test if gcc supports attribute ifunc.
    The support can either be enabled in <gcc-src>/gcc/config.gcc for one
    architecture in general by setting default_gnu_indirect_function variable to yes
    or by configuring gcc with --enable-gnu-indirect-function.
    
    The next patch rewrites libc_ifunc macro to use gcc attribute ifunc instead
    of inline assembly to generate the IFUNC symbols due to false debuginfo.
    
    If gcc does not support attribute ifunc, the old approach for generating
    ifunc'ed symbols is used. Then the debug-information is false. Thus it is
    recommended to use a gcc with indirect function support (See notes in INSTALL).
    After this patch-series these inline assemblies for ifunc-handling are not
    scattered in multiple files but are used only indirect via ifunc-macros
    and can simply removed in libc-symbols.h in future.
    
    If glibc is configured with --enable-multi-arch and gcc does not support
    attribute ifunc, a configure warning is dumped!
    
    ChangeLog:
    
    	* config.h.in (HAVE_GCC_IFUNC): New undef.
    	* configure.ac: Add check if gcc supports attribute ifunc feature.
    	* configure: Regenerated.
    	* manual/install.texi: Add recommendation for gcc with
    	indirect-function support.
    	* INSTALL: Regenerated.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  137 +++++++++++++++++
 INSTALL                                            |    9 +
 NEWS                                               |    9 +
 config.h.in                                        |    3 +
 configure                                          |   42 +++++
 configure.ac                                       |   33 ++++
 include/libc-symbols.h                             |  157 ++++++++++++++++----
 manual/install.texi                                |    8 +
 nptl/pt-longjmp.c                                  |   24 +---
 nptl/pt-system.c                                   |   19 +--
 nptl/pt-vfork.c                                    |   22 +--
 rt/clock-compat.c                                  |   34 ++---
 .../powerpc32/power4/fpu/multiarch/s_finite.c      |   16 ++-
 .../powerpc32/power4/fpu/multiarch/s_finitef.c     |   10 +-
 .../powerpc32/power4/fpu/multiarch/s_isinf.c       |   16 ++-
 .../powerpc32/power4/fpu/multiarch/s_isinff.c      |   10 +-
 .../powerpc32/power4/fpu/multiarch/s_isnan.c       |   24 ++-
 .../powerpc32/power4/fpu/multiarch/s_isnanf.c      |   17 +-
 .../powerpc/powerpc32/power4/multiarch/memcmp.c    |   10 +-
 .../powerpc/powerpc32/power4/multiarch/memcpy.c    |   23 ++--
 .../powerpc/powerpc32/power4/multiarch/memmove.c   |   10 +-
 .../powerpc/powerpc32/power4/multiarch/mempcpy.c   |   15 ++-
 .../powerpc/powerpc32/power4/multiarch/memset.c    |   14 +-
 .../powerpc/powerpc32/power4/multiarch/rawmemchr.c |   11 +-
 .../powerpc/powerpc32/power4/multiarch/strchr.c    |   12 +-
 .../powerpc/powerpc32/power4/multiarch/strlen.c    |   10 +-
 .../powerpc/powerpc32/power4/multiarch/strncmp.c   |   12 +-
 .../powerpc/powerpc32/power4/multiarch/strnlen.c   |   13 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c |   20 ++-
 .../powerpc/powerpc64/fpu/multiarch/s_finitef.c    |   14 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c  |   20 ++-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c |   14 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c  |   32 +++--
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c |   25 ++--
 sysdeps/powerpc/powerpc64/multiarch/memcmp.c       |   14 +-
 sysdeps/powerpc/powerpc64/multiarch/mempcpy.c      |   15 ++-
 sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c    |   10 +-
 sysdeps/powerpc/powerpc64/multiarch/stpcpy.c       |   13 +-
 sysdeps/powerpc/powerpc64/multiarch/stpncpy.c      |   17 ++-
 sysdeps/powerpc/powerpc64/multiarch/strcat.c       |   14 +-
 sysdeps/powerpc/powerpc64/multiarch/strchr.c       |   12 +-
 sysdeps/powerpc/powerpc64/multiarch/strcmp.c       |   16 ++-
 sysdeps/powerpc/powerpc64/multiarch/strcpy.c       |   14 +-
 sysdeps/powerpc/powerpc64/multiarch/strncmp.c      |   20 ++-
 sysdeps/powerpc/powerpc64/multiarch/strncpy.c      |   16 ++-
 sysdeps/powerpc/powerpc64/multiarch/strnlen.c      |   14 +-
 sysdeps/powerpc/powerpc64/multiarch/strrchr.c      |   10 +-
 sysdeps/powerpc/powerpc64/multiarch/strstr.c       |   10 +-
 sysdeps/powerpc/powerpc64/multiarch/wcschr.c       |   17 ++-
 sysdeps/s390/multiarch/ifunc-resolve.h             |   77 +++++-----
 sysdeps/s390/multiarch/memchr.c                    |    5 +-
 sysdeps/s390/multiarch/mempcpy.c                   |   12 +-
 sysdeps/s390/multiarch/rawmemchr.c                 |    5 +-
 sysdeps/s390/multiarch/stpcpy.c                    |    9 +-
 sysdeps/s390/multiarch/stpncpy.c                   |    6 +-
 sysdeps/s390/multiarch/strcat.c                    |    4 +-
 sysdeps/s390/multiarch/strchr.c                    |    6 +-
 sysdeps/s390/multiarch/strcmp.c                    |    7 +-
 sysdeps/s390/multiarch/strcpy.c                    |    5 +-
 sysdeps/s390/multiarch/strcspn.c                   |    6 +-
 sysdeps/s390/multiarch/strlen.c                    |    4 +-
 sysdeps/s390/multiarch/strncmp.c                   |    9 +-
 sysdeps/s390/multiarch/strncpy.c                   |    7 +-
 sysdeps/s390/multiarch/strnlen.c                   |    7 +-
 sysdeps/s390/multiarch/strpbrk.c                   |    6 +-
 sysdeps/s390/multiarch/strrchr.c                   |    6 +-
 sysdeps/s390/multiarch/strspn.c                    |    6 +-
 sysdeps/s390/multiarch/wcschr.c                    |    7 +-
 sysdeps/s390/multiarch/wcscmp.c                    |    4 +-
 sysdeps/s390/multiarch/wcspbrk.c                   |    4 +-
 sysdeps/s390/multiarch/wcsspn.c                    |    4 +-
 sysdeps/s390/multiarch/wmemchr.c                   |    7 +-
 sysdeps/s390/multiarch/wmemset.c                   |    7 +-
 sysdeps/s390/s390-32/multiarch/memcmp.c            |    7 +-
 sysdeps/s390/s390-32/multiarch/memcpy.c            |    5 +-
 sysdeps/s390/s390-32/multiarch/memset.c            |    5 +-
 sysdeps/s390/s390-64/multiarch/memcmp.c            |    7 +-
 sysdeps/s390/s390-64/multiarch/memcpy.c            |    5 +-
 sysdeps/s390/s390-64/multiarch/memset.c            |    5 +-
 sysdeps/unix/sysv/linux/i386/gettimeofday.c        |   14 ++-
 sysdeps/unix/sysv/linux/i386/time.c                |   14 ++-
 sysdeps/unix/sysv/linux/powerpc/gettimeofday.c     |   60 ++++----
 sysdeps/unix/sysv/linux/powerpc/time.c             |   67 +++++----
 sysdeps/unix/sysv/linux/s390/pt-longjmp.c          |    4 +-
 sysdeps/unix/sysv/linux/x86/gettimeofday.c         |   28 ++--
 sysdeps/unix/sysv/linux/x86/time.c                 |   26 ++--
 86 files changed, 1019 insertions(+), 505 deletions(-)
Comment 2 Stefan Liebler 2016-10-07 08:29:02 UTC
Fixed with commits in comment 1.