public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Michael Matz <matz@suse.de>, x86-64-abi@googlegroups.com
Cc: binutils@sourceware.org
Subject: Re: GNU property saga
Date: Wed, 20 Mar 2019 14:51:00 -0000	[thread overview]
Message-ID: <fd15dd6d62f9e47d65ced21b65d9799168e1b85e.camel@klomp.org> (raw)
In-Reply-To: <alpine.LSU.2.21.1903041706520.5354@wotan.suse.de>

Hi,

On Mon, 2019-03-04 at 17:25 +0000, Michael Matz wrote:
> I'll admit that I have lost track of the consensus about GNU
> properties and all the discussions last year.  But we want to
> somewhen get this into the psABI document.

Thanks for picking this up. These things have a way of creeping up in
the various code bases without ever really reaching consensus. Causing
sad faces everywhere. Lets see if we can agree on something.

As far as I understand we did reach (a somewhat forced) consensus on
how to represent the IBT and Shadow Stack and Stack Size support which
the current glibc dynamic loader depends on.

The consensus on representation of those properties is described here:
https://sourceware.org/ml/binutils/2018-09/msg00282.html

But there doesn't seem to be any consensus anyon other/new GNU property
features or notes that would require the new (and/or) semantics.
bintuils and glibc don't even agree on the names and values of these
new feature properties.

You already split the discussion of the and/or semantics of those new
property features off into another thread. I think the answer to the
questions you pose below should also be split for the existing GNU
Properties (IBT/SHST/STACK_SIZE) and the new property/note features.

>   I believe there were two points (with subitems) of contentions:
>
> 1) use PT_NOTE vs PT_xxx for program header containing the properties
> 
> I believe the consensus was to use a new PT_xxx value

As far as I understand the current consensus, for the existing property
features, it is actually the opposite. There will be a new PT_NOTE
segment with (for ELFCLASS64) larger alignment and padding. This is
what the current glibc dynamic loader depends on.

But for the new GNU Property features it does seem that people would
prefer to use a new PT_xxx value. There is a new constant in binutils:
#define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
But that isn't used anywhere else.

Question is, if we are going to use that for new GNU Property features,
should we also do that for the old ones and how does that impact the
existing binaries/dynamic libraries?

> 1a) use new SHT_xxx for sections contain such properties
> 
> I believe the consensus was to stay with SHT_NOTE, even though that
> is squarely against ELF spirit.

Yes, for the existing GNU Properties. But I think it would be a bad
idea for the new property features if those will use a new PT value
segment type. Then the rules for composing SHT_NOTEs become even more
complex. You already need to distinguish between existing (GNU) notes
which don't combine with the new (Property) notes because they use
different alignment and padding rules. Then you would also get even
different notes that don't combine with any of the existing ones. At
least, the rules for combining them are not clear to me.

Cheers,

Mark

  parent reply	other threads:[~2019-03-20 14:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 17:25 Michael Matz
2019-03-04 17:40 ` OR_AND semantics (was: GNU property saga) Michael Matz
2019-03-05  0:48   ` Cary Coutant
2019-03-06 13:57     ` Michael Matz
2019-03-07  6:56       ` Cary Coutant
2019-03-08  3:44   ` H.J. Lu
2019-03-08  6:06     ` Cary Coutant
2019-03-08  6:25       ` Jim Dehnert
2019-03-11  7:34         ` H.J. Lu
2019-03-20 14:51 ` Mark Wielaard [this message]
     [not found]   ` <25adbffa-fc4c-1b01-7949-fbe0dc212f70@arm.com>
2019-05-10 18:37     ` GNU property saga Mark Wielaard

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=fd15dd6d62f9e47d65ced21b65d9799168e1b85e.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=binutils@sourceware.org \
    --cc=matz@suse.de \
    --cc=x86-64-abi@googlegroups.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).