[PATCH] More fixes for unsafe compiler optimization

Carlos O'Donell carlos@redhat.com
Tue Apr 29 20:34:00 GMT 2014


On 04/29/2014 03:22 PM, Adhemerval Zanella wrote:
> GCC 4.9 -ftree-loop-distribute-patterns now may transform loops in
> memcpy.  Add the alias to internal GLIBC symbol to avoid PLT creation.
> 
> This fixes the check-localplt issues when building GLIBC with GCC 4.9
> on powerpc64.  Ok to apply?
> 
> --
> 
> 	* sysdeps/generic/symbol-hacks.h (memcpy): Add internal alias.
> 
> ---
> 
> diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
> index 9eaf014..6bec24b 100644
> --- a/sysdeps/generic/symbol-hacks.h
> +++ b/sysdeps/generic/symbol-hacks.h
> @@ -3,4 +3,5 @@
>  #if !defined __ASSEMBLER__ && !defined NOT_IN_libc && defined SHARED
>  asm ("memmove = __GI_memmove");
>  asm ("memset = __GI_memset");
> +asm ("memcpy = __GI_memcpy");
>  #endif
> 

Looks good to me. I was surprised we didn't already list memcpy.

c.



More information about the Libc-alpha mailing list