public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: Jeff Law <law@redhat.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Xianmiao Qu <xianmiao_qu@c-sky.com>,
	Yunhai Shang <yunhai_shang@c-sky.com>
Subject: Re: [2/5] C-SKY port: Backend implementation
Date: Wed, 25 Jul 2018 13:17:00 -0000	[thread overview]
Message-ID: <D9C358D7-DF64-4EBA-8FD5-7F15AF7EE8CD@comcast.net> (raw)
In-Reply-To: <f5abc6cc-f031-fc93-8af6-42af25950c93@redhat.com>



> On Jul 25, 2018, at 12:50 AM, Jeff Law <law@redhat.com> wrote:
> 
>>>> ...
>>> It did.  See TARGET_CUSTOM_FUNCTION_DESCRIPTORS and the (relatively few)
>>> ports that define it.
>> 
>> 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.
> 
> 
>> 
>> 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.
> 
> 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 without 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 functions.

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


  reply	other threads:[~2018-07-25 13:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24  4:17 [0/5] C-SKY port Sandra Loosemore
2018-07-24  4:20 ` [1/5] C-SKY port: Configury Sandra Loosemore
2018-07-24 15:09   ` Jeff Law
2018-07-24  4:21 ` [2/5] C-SKY port: Backend implementation Sandra Loosemore
2018-07-24 15:45   ` Jeff Law
2018-07-24 18:19     ` Sandra Loosemore
2018-07-24 21:25       ` Jeff Law
2018-07-25  0:17         ` Sandra Loosemore
2018-07-25  4:50           ` Jeff Law
2018-07-25 13:17             ` Paul Koning [this message]
2018-07-25 14:54               ` Sandra Loosemore
2018-07-26  6:07         ` 瞿仙淼
2018-07-28  1:49           ` Sandra Loosemore
2018-08-02 22:33             ` Jeff Law
2018-08-02 22:28           ` Jeff Law
2018-08-03  7:58             ` Yunhai
2018-08-03 16:26             ` Sandra Loosemore
2018-07-24  4:23 ` [3/5] C-SKY port: Documentation Sandra Loosemore
2018-07-24 15:10   ` Jeff Law
2018-07-24  4:25 ` [4/5] C-SKY port: Testsuite Sandra Loosemore
2018-07-24 15:10   ` Jeff Law
2018-07-24  4:26 ` [5/5] C-SKY port: libgcc Sandra Loosemore
2018-07-24 15:12   ` Jeff Law
2018-07-24 18:10   ` Segher Boessenkool
2018-07-24 18:19     ` Sandra Loosemore
2018-07-24 19:46       ` Segher Boessenkool
2018-07-24 15:23 ` [0/5] C-SKY port Sandra Loosemore
2018-07-26 23:04   ` Joseph Myers
2018-07-30 16:59     ` Sandra Loosemore
2018-08-01 14:28     ` 瞿仙淼

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=D9C358D7-DF64-4EBA-8FD5-7F15AF7EE8CD@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=sandra@codesourcery.com \
    --cc=xianmiao_qu@c-sky.com \
    --cc=yunhai_shang@c-sky.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).