RFC: Should x86-64 support arbitrary calling conventions?
Szabolcs Nagy
szabolcs.nagy@arm.com
Mon Mar 27 16:06:00 GMT 2017
On 27/03/17 16:19, H.J. Lu wrote:
> 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.
>
i don't see RTLD_*_FOREIGN_CALL definition anywhere.
what does it do?
More information about the Libc-alpha
mailing list