[RFC] powerpc: restore TOC when static longjmp to shared object

Tulio Magno Quites Machado Filho tuliom@linux.ibm.com
Tue May 15 20:49:00 GMT 2018


Florian Weimer <fw@deneb.enyo.de> writes:

> * Rogerio Alves:
>
>> One simple solution would be always restore the TOC pointer by uncomment 
>> the line bellow:
>>
>> /*     std r2,FRAME_TOC_SAVE(r1)       Restore the TOC save area.  */
>>
>> Or maybe we can check if we have a valid TOC pointer before restore it, 
>> instead #if defined SHARED.
>
> Is the register reserved for the TOC pointer in static builds, too?
> Then I suggest to unconditionally save nad restore it; not doing so
> looks like a pointless micro-optimization.
>
> Another problem with sharing jump buffers across static dlopen is that
> you might not have identical pointer guard values.
>
>> I would like to request for comments on this matter: Should we fix/work 
>> this? Is feasible to change longjmp to always restore TOC pointer?
>
> Does setjmp already save it unonditionally?
>
> Removal of static dlopen is still some time away; it's likely not
> going to happen in this cycle, and the fix looks simple enough.

If static dlopen is still going to be supported for some cycles, I also agree
it should be saved and restored unconditionally.

-- 
Tulio Magno



More information about the Libc-alpha mailing list