From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87602 invoked by alias); 25 Jul 2018 13:17:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 87575 invoked by uid 89); 25 Jul 2018 13:17:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=whatsoever, Hx-spam-relays-external:ESMTPA X-HELO: resqmta-po-10v.sys.comcast.net Received: from resqmta-po-10v.sys.comcast.net (HELO resqmta-po-10v.sys.comcast.net) (96.114.154.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Jul 2018 13:16:56 +0000 Received: from resomta-po-09v.sys.comcast.net ([96.114.154.233]) by resqmta-po-10v.sys.comcast.net with ESMTP id iJItfxuiVOocxiJexfhLGq; Wed, 25 Jul 2018 13:16:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1532524615; bh=4Z7EnRNus8P0iTzZmukUMj/fID/QRlnJj4/lzUh1KzM=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=YzCrhvt3MaWzn9aE4iUTCHeCpYK+N9oG1jOjJntgNei6plpjH6jenwWetOf6v0RG0 L2fOK4w5+UOVA/erXB26+AvJnChe/z2ClSJEKZyp/lYm/gi2k1VU/ZDwZIBXwwlwWv XAn43gHY5ljbrKVV3kXfl7Cy+7jkAOC9A+oJBKH0WhldAlcSoedBa2f5gRAiPCjtU1 iiidsP5pas3RKfbR410+/7JBnVVjF9RO4C2td8rjQoeMCKFZZTipFaVK4yErSGFQTH 2INV3wGkacdjALIQntNDEQtqMVHy7dD/yalcLPusH5QlOKI9u/IYh1khMCVT5fCl0A DC1RApWZ6v6kA== Received: from [192.168.10.125] ([73.60.223.101]) by resomta-po-09v.sys.comcast.net with ESMTPA id iJevfNhSiwLQoiJewfqvlq; Wed, 25 Jul 2018 13:16:55 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [2/5] C-SKY port: Backend implementation From: Paul Koning In-Reply-To: Date: Wed, 25 Jul 2018 13:17:00 -0000 Cc: Sandra Loosemore , "gcc-patches@gcc.gnu.org" , Xianmiao Qu , Yunhai Shang Content-Transfer-Encoding: quoted-printable Message-Id: References: <49d0a2c8-51a0-4a74-d015-0bf1c1098e38@codesourcery.com> <28cb3a6e-4594-3545-5236-c68784af6a57@codesourcery.com> <8a1b9bac-82dc-bb4f-e0a2-9a9b9cbea98a@redhat.com> <5ca2a106-d1d7-6eee-b0b8-2c5f2eb5e0a4@codesourcery.com> To: Jeff Law X-SW-Source: 2018-07/txt/msg01530.txt.bz2 > On Jul 25, 2018, at 12:50 AM, Jeff Law wrote: >=20 >>>> ... >>> It did. See TARGET_CUSTOM_FUNCTION_DESCRIPTORS and the (relatively few) >>> ports that define it. >>=20 >> Hmmm, I completely failed to make that connection from the docs -- the >> whole description of that hook is pretty gibberishy and I thought it was >> something for targets where the ABI already specifies some "standard >> calling sequence" using descriptors (C-SKY doesn't), rather than a >> generic alternative to executable trampolines. Putting on my doc >> maintainer hat briefly, I can see this needs a lot of work. :-( > Most likely :-) So many things to do, so little time. >=20 >=20 >>=20 >> Anyway, is this required for new ports nowadays? If so, I at least know >> what to search for now. At this point I couldn't say whether this would >> do anything to fix the situation on ck801 targets where there simply >> aren't enough spare registers available to the trampoline to both hold >> the static link and do an indirect jump. > It's not required, but preferred, particularly if the part has an MMU > that can provide no-execute protections on pages in memory. If the > target doesn't have an mmu, then it's of marginal value. >=20 > The key advantage it has over the old trampoline implementation is that > stacks can remain non-executable, even for Ada and nested functions. > That's a big win from a security standpoint. Non-executable stacks are a very good thing. That said, I also looked at the target hook documentation and was left with= out any clue whatsoever. It sure isn't clear what powers of two have to do= with descriptors, or what descriptors have to do with support for nested f= unctions. Can you suggest places to look to get an understanding of this feature? It= sounds like the only other option is "Use the source, Luke". Any specific= targets that make a good reference implementation for this? paul