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][aarch64] Fix glibc.tune.cpu tunable handling


On Saturday 02 September 2017 01:10 AM, Steve Ellcey wrote:
> While working on a gcc patch I realized that the glibc tunable
> 'glibc.tune.cpu' was not working on aarch64.  I tracked it down to
> get_midr_from_mcpu and at first I thought I should remove the '== 0'
> from the if statement because tunable_is_name returns true/false, not
> -1/0/1 like strcmp.  But then I realized we shouldn't be using
> tunable_is_name at all because we are comparing two null terminated
> strings and tunable_is_name is trying to compare a null terminated
> string with a '=' terminated string which is not what we have.
> 
> I tested this by running a program that calls memcpy and checking what
> memcpy gets run after setting glibc.tune.cpu to generic, thunderx,
> and falkor.

Right, tunable_is_name is the wrong function to call but using strcmp
there may not be safe.  Please verify that it does not go through a PLT,
i.e. it calls the ld.so version at all times.

Siddhesh


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