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 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.


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