> On 17 Jul 2023, at 07:58, Iain Sandoe <i...@sandoe.co.uk> wrote
>
>> On 17 Jul 2023, at 07:43, FX Coudert <fxcoud...@gmail.com> wrote:
>>
>>
>> There is an alternate mechanism relying on system libraries that is possible
>> on darwin specifically (I don’t know for other targets) but it will only
>> work for signed binaries, and would require us to codesign everything
>> produced by gcc. During development, it was deemed too big an ask and the
>> current strategy was chosen (Iain can surely add more background on that if
>> needed).
>
> I do not think that this solves the setjump/longjump issue - since there’s
> still a notional allocation that takes place (it’s just that the mechanism
> for determining permissions is different).
>
> It is also a big barrier for the general user - and prevents normal folks
> from distributing GCC - since codesigning requires an external certificate
> (i.e. I would really rather avoid it).
>
>>> Was there ever an attempt to provide a "generic" trampoline driven by
>>> a more complex descriptor?
>
> We did look at the “unused address bits” mechanism that Ada has used - but
> that is not really available to a non-private ABI (unless the system vendor
> agrees to change ABI to leave a bit spare) for the base arch either the bits
> are not there (e.g. X86) or reserved (e.g. AArch64).
>
> Andrew Burgess did the original work he might have comments on alternatives
> we tried
Although I will comment that the main barrier to data / descriptor based
schemes is that we allow recursive use of nested functions and that means that
each nest level needs a distinct target address to branch to / call. [that
might also make the bytecode scheme hard(er)]
Iain