This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2.25] powerpc: Avoid calling strncmp via PLT on GCC 7


On Mon, 2017-01-16 at 11:29 -0200, Tulio Magno Quites Machado Filho
wrote:
> This patch only fixes the issue on elf/check-localplt.
> In case you notice any other test failures when comparing strings on
> GCC
> 7, please refer to this patch:
> https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00744.html

Tulio,
  I'll be posting an updated version of that patch shortly that
addresses the issues you were seeing. However it adds builtin expansion
of both strncmp and strcmp so I think your patch needs to add both to
powerpc/symbol-hacks.h. Here is what I get from check-localplt with
gcc7 plus this patch:

cat /home/sawdey/src/glibc/build/elf/check-localplt.out
Extra PLT reference: libc.so: strcmp
Extra PLT reference: libc.so: strncmp

Thanks, 
   Aaron

> 
> -- 8< --
> 
> GCC 7 added support for a strncmp built-in for POWER7, generating PLT
> calls
> to strncmp from libc.
> 
> 2017-01-16  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.
> com>
> 
> 	* sysdeps/powerpc/symbol-hacks.h: New file.  Enforce strncmp
> 	calls don't go through the PLT.
> ---
>  sysdeps/powerpc/symbol-hacks.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>  create mode 100644 sysdeps/powerpc/symbol-hacks.h
> 
> diff --git a/sysdeps/powerpc/symbol-hacks.h b/sysdeps/powerpc/symbol-
> hacks.h
> new file mode 100644
> index 0000000..7558b18
> --- /dev/null
> +++ b/sysdeps/powerpc/symbol-hacks.h
> @@ -0,0 +1,7 @@
> +#include <sysdeps/generic/symbol-hacks.h>
> +
> +/* GCC 7.0 added support for a builtin strncmp that is used on POWER
> >= 7.  */
> +#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \
> +    && defined _ARCH_PWR7
> +asm ("strncmp = __GI_strncmp");
> +#endif
-- 
Aaron Sawdey, Ph.D.  acsawdey@linux.vnet.ibm.com
050-2/C113  (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]