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: RFC: Should x86-64 support arbitrary calling conventions?


On Mon, Mar 27, 2017 at 4:28 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 27/03/17 12:12, Alexander Monakov wrote:
>> On Mon, 27 Mar 2017, Szabolcs Nagy wrote:
>>> even if the dynamic linker was careful not to
>>> clobber certain registers in memcpy/strcmp/..,
>>> ifunc resolvers follow the normal pcs, so they
>>> are allowed to clobber them anyway.
>>>
>>> so in general 'the dynamic linker is careful'
>>> argument does not work in the presence of
>>> user defined ifunc.
>>
>> As said in an adjacent subthread, the dynamic linker knows exactly when it is
>> about to call back to external code (ifunc resolver, LD_AUDIT handlers), and
>> it can save/restore additional registers just around those points.
>>
>> I believe a bigger issue is usage of [optimized] string functions in the linker.
>>
>
> sorry i missed that thread,
>
> that's true, but note that elf_ifunc_invoke is
> currently called from generic c code from
> elf/dl-runtime.c so it would be a non-trivial
> change to do the save/restore around that.
>

Even without IFUNC nor SSE in ld.so,  we still need to deal with

RTLD_PREPARE_FOREIGN_CALL

which may clobber vector registers.

-- 
H.J.


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