[PATCH 00/12] Remove bcopy and bzero optimizations

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Feb 22 15:40:02 GMT 2022



On 21/02/2022 13:39, Szabolcs Nagy wrote:
> The 02/10/2022 16:58, Adhemerval Zanella via Libc-alpha wrote:
>> Both symbols are marked as legacy in POSIX.1-2001 and removed on
>> POSIX.1-2008, although the prototypes are defined for _GNU_SOURCE
>> or _DEFAULT_SOURCE.
>>
>> Most architectures just route bcopy/bzero to internal memmove/memset
>> implementation, however some do implement iFUNC variants when memset
>> or memmove are also provided through iFUNC.
>>
>> However, gcc already replaces bcopy with a memmove and bzero with memset
>> on default configuration (to actually get a bstring libc call the code
>> requires to omit string.h inclusion and built with --fno-builtin), so
>> it is highly unlikely programs are actually calling libc bcopy or
>> bzero symbols.
> ...
>> So there is point in keeping such optimization.
>>
>> Adhemerval Zanella (12):
>>   ia64: Remove bcopy
>>   powerpc: Remove bcopy optimizations
>>   i386: Remove bcopy optimizations
>>   x86_64: Remove bcopy optimizations
>>   alpha: Remove bzero optimization
>>   ia64: Remove bzero optimization
>>   Remove bzero optimization
>>   powerpc: Remove powerpc32 bzero optimizations
>>   powerpc: Remove powerpc64 bzero optimizations
>>   s390: Remove bzero optimizations
>>   i686: Remove bzero optimizations
>>   x86_64: Remove bzero optimizations
> 
> i see this does not affect aarch64, but i agree with the principle.
> 
> (there was a comment about the x86 bzero code that if __memsetzero
> is accepted then it's easier to rename the bzero optimization instead
> of removing and readding.)

I will exclude the last patch that touches x86_64 and commit the rest.
>From last discussions on both maillist and weekly we still need to
get consensus on __memsetzero addition.


More information about the Libc-alpha mailing list