[RFC] Prevent tailcall optimizations of libdl functions

Szabolcs Nagy szabolcs.nagy@arm.com
Wed Jan 25 15:41:00 GMT 2017


On 25/01/17 15:40, Florian Weimer wrote:
> On 01/25/2017 04:38 PM, Szabolcs Nagy wrote:
>> On 25/01/17 15:32, Yuri Gribov wrote:
>>> FWIW it sounds like GCC attribute would be the most natural solution
>>> (and probably also useful in other contexts). I'll try to cook a patch
>>> for GCC if there are no objections.
>>
>> note that even if dlsym is marked notailcall, with
>>
>> p = dlsym;
>> ...
>> return p();
>>
>> if the type of p does not carry the attributes of
>> dlsym then this can be a tailcall.
> 
> Yes, but dlsym would still see the address of the function containing the dlsym call, which is what we need to
> determine the relevant object.
> 

how?



More information about the Libc-alpha mailing list