public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Maxim Blinov <maxim.blinov@embecosm.com>,
	FX Coudert <fxcoudert@gmail.com>,
	Eric Botcazou <ebotcazou@adacore.com>,
	Jeff Law <jeffreyalaw@gmail.com>,
	aburgess@redhat.com
Subject: Re: [PATCH] core: Support heap-based trampolines
Date: Mon, 17 Jul 2023 08:16:32 +0100	[thread overview]
Message-ID: <C11F4468-95C2-43BA-87E9-B5ADE9E6D964@sandoe.co.uk> (raw)
In-Reply-To: <6B96AFB9-4476-4E51-8FD7-FDEC43879614@sandoe.co.uk>



> On 17 Jul 2023, at 07:58, Iain Sandoe <iain@sandoe.co.uk> wrote
> 
>> On 17 Jul 2023, at 07:43, FX Coudert <fxcoudert@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


  reply	other threads:[~2023-07-17  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 10:38 FX Coudert
2023-07-17  6:31 ` Richard Biener
2023-07-17  6:43   ` FX Coudert
2023-07-17  6:58     ` Iain Sandoe
2023-07-17  7:16       ` Iain Sandoe [this message]
2023-07-19  9:04         ` Martin Uecker
2023-07-19  9:29           ` Iain Sandoe
2023-07-19 10:43             ` Martin Uecker
2023-07-19 14:23               ` Iain Sandoe
2023-07-19 15:18                 ` Martin Uecker
2023-08-05 14:20   ` FX Coudert
2023-08-20  9:43     ` FX Coudert
2023-09-06 15:44     ` FX Coudert
2023-09-14 10:18       ` Richard Biener
2023-09-16 19:10         ` Iain Sandoe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C11F4468-95C2-43BA-87E9-B5ADE9E6D964@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=aburgess@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=fxcoudert@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=maxim.blinov@embecosm.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).