Segher Boessenkool <seg...@kernel.crashing.org> writes:

> On Thu, Jan 12, 2017 at 05:53:06PM +0000, Joseph Myers wrote:
>> On Thu, 15 Dec 2016, Aaron Sawdey wrote:
>> 
>> > +      emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, "strncmp"),
>> > +                         target, LCT_NORMAL, GET_MODE (target), 3,
>> > +                         force_reg (Pmode, XEXP (src1, 0)), Pmode,
>> > +                         force_reg (Pmode, XEXP (src2, 0)), Pmode,
>> > +                         len_rtx, GET_MODE (len_rtx));
>> 
>> Building glibc with GCC mainline for powerpc64le-linux-gnu (from my bot 
>> doing such builds and compilation parts of the testsuite for all GNU/Linux 
>> glibc ABIs daily), I'm seeing a failure of the elf/check-localplt test, 
>> "Extra PLT reference: libc.so: strncmp".
>> 
>> Without having bisected, I suspect this patch of being a likely cause of 
>> that failure.  glibc redirects internal calls to use hidden aliases such 
>> as __GI_strncmp to avoid them going through the PLT.  By using 
>> gen_rtx_SYMBOL_REF there with a hardcoded function name "strncmp", this 
>> code looks like it would render a declaration of strncmp with asm 
>> ("__GI_strncmp") ineffective, generating a direct call to strncmp when 
>> glibc expects __GI_strncmp to be called instead.
>> 
>> I don't know how readily this code can be made to respect asm renaming of 
>> strncmp.  If it's hard to fix in GCC, I suppose glibc needs a powerpc 
>> version of symbol-hacks.h to handle this redirection.
>
> Tulio will look at fixing it in glibc tomorrow.  Thanks for the report,

Does this code affects a specific rs6000 build? i.e. powerpc64le -mcpu=power8.
Or is it generic?

-- 
Tulio Magno

Reply via email to