From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id C808C3858D1E for ; Mon, 17 Jul 2023 07:16:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C808C3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sandoe.co.uk Received: (qmail 30452 invoked from network); 17 Jul 2023 07:16:33 -0000 X-APM-Out-ID: 16895781933045 X-APM-Authkey: 257869/1(257869/1) 14 Received: from unknown (HELO smtpclient.apple) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 17 Jul 2023 07:16:33 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: [PATCH] core: Support heap-based trampolines From: Iain Sandoe In-Reply-To: <6B96AFB9-4476-4E51-8FD7-FDEC43879614@sandoe.co.uk> Date: Mon, 17 Jul 2023 08:16:32 +0100 Cc: GCC Patches , Maxim Blinov , FX Coudert , Eric Botcazou , Jeff Law , aburgess@redhat.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <3BD4592C-0F69-4880-8702-F586070FA115@gmail.com> <6B96AFB9-4476-4E51-8FD7-FDEC43879614@sandoe.co.uk> To: Richard Biener X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,KAM_COUK,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 17 Jul 2023, at 07:58, Iain Sandoe wrote >=20 >> On 17 Jul 2023, at 07:43, FX Coudert wrote: >>=20 >>=20 >> There is an alternate mechanism relying on system libraries that is = possible on darwin specifically (I don=E2=80=99t 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). >=20 > I do not think that this solves the setjump/longjump issue - since = there=E2=80=99s still a notional allocation that takes place (it=E2=80=99s= just that the mechanism for determining permissions is different). >=20 > 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). >=20 >>> Was there ever an attempt to provide a "generic" trampoline driven = by >>> a more complex descriptor? >=20 > We did look at the =E2=80=9Cunused address bits=E2=80=9D 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). >=20 > 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