unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Cary Coutant <ccoutant@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	x86-64-abi <x86-64-abi@googlegroups.com>,
	 Binutils <binutils@sourceware.org>,
	GNU C Library <libc-alpha@sourceware.org>,
	 Mark Wielaard <mark@klomp.org>, Michael Matz <matz@suse.de>,
	Nick Clifton <nickc@redhat.com>,
	 "Carlos O'Donell" <carlos@redhat.com>,
	"szabolcs.nagy" <szabolcs.nagy@arm.com>
Subject: Re: PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold
Date: Wed, 26 Sep 2018 11:36:09 -0700	[thread overview]
Message-ID: <CAMe9rOrLOQzGRhibpbb1sxkSwJ537eBUZEZkjpv==mHz=o+0PQ@mail.gmail.com> (raw)
In-Reply-To: <CAJimCsFDmPD-T7RV53j15NnuW1fZ2mHSxjUbvDu7EC+oEg_fng@mail.gmail.com>

On Wed, Sep 26, 2018 at 10:39 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>
> Some requirements I'd like to see:

NT_GNU_PROPERTY_TYPE_0 is documented at

https://github.com/hjl-tools/linux-abi

> (1) An NT_GNU_PROPERTY_TYPE_0 note section must be named
> ".note.gnu.property" with type SHT_NOTE.

If it isn't specified this way, please send a patch.

> (2) A ".note.gnu.property" section must contain one and only one note,
> whose type must be NT_GNU_PROPERTY_TYPE_0.

True for linker output and all properties must be sorted.   For relocatable
inputs, there may be more than one NT_GNU_PROPERTY_TYPE_0 notes:

[hjl@gnu-cfl-1 tmp]$ touch n.c
[hjl@gnu-cfl-1 tmp]$ gcc -fcf-protection -c n.c -Wa,-mx86-used-note=yes
[hjl@gnu-cfl-1 tmp]$ readelf -n n.o

Displaying notes found in: .note.gnu.property
  Owner                 Data size Description
  GNU                  0x00000010 NT_GNU_PROPERTY_TYPE_0
      Properties: x86 feature: IBT, SHSTK
  GNU                  0x00000020 NT_GNU_PROPERTY_TYPE_0
      Properties: x86 ISA used: <None>
x86 feature used: x86
[hjl@gnu-cfl-1 tmp]$

> (3) A ".note.gnu.property" section must have sh_align of 8, and its
> length must be a multiple of 8.

If it isn't specified this way, please send a patch.

> (4) A linker is expected to combine ".note.gnu.property" sections in a
> manner described by the ABI documentation, and place the combined
> result, as a single note, in a unique SHT_NOTE section named
> ".note.gnu.property", and in a unique PT_NOTE segment.
>

Why is a unique PT_NOTE segment required? A PT_NOTE segment
may have more than one SHT_NOTE sections with the same section
alignment and each SHT_NOTE section is padded to section alignment.

-- 
H.J.

      reply	other threads:[~2018-09-26 18:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMe9rOrrayKnc_cPm4SmnDnUGLbBUmOYMBTMOM8KLAHVmb=rUQ@mail.gmail.com>
2018-08-16 13:00 ` PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold (was: Re: [PATCH] Document GNU_PROPERTY_X86_ISA_1_[USED|NEEDED]) Florian Weimer
2018-08-16 13:19   ` H.J. Lu
2018-08-16 13:29     ` H.J. Lu
2018-08-16 13:31     ` PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold Florian Weimer
2018-08-16 13:39       ` H.J. Lu
2018-08-16 14:01         ` Florian Weimer
2018-08-16 14:43           ` H.J. Lu
2018-08-16 14:21         ` Florian Weimer
2018-08-16 17:46           ` H.J. Lu
2018-08-16 19:16           ` Mark Wielaard
2018-08-16 19:36             ` H.J. Lu
2018-08-17  6:04               ` Mark Wielaard
2018-08-17  6:20             ` Florian Weimer
2018-08-17  6:41               ` Mark Wielaard
2018-08-17 15:10                 ` H.J. Lu
2018-08-17 21:05                   ` Mark Wielaard
2018-08-21 23:02                     ` Cary Coutant
2018-08-22  9:39                       ` Florian Weimer
2018-08-22 10:08                         ` Mark Wielaard
2018-08-22 23:36                         ` Cary Coutant
2018-08-24 18:39                           ` Florian Weimer
2018-08-23 14:41                         ` Michael Matz
2018-08-23 14:43                           ` Florian Weimer
2018-08-17 15:13               ` H.J. Lu
2018-09-19 19:22   ` Florian Weimer
2018-09-21 12:55     ` Michael Matz
2018-09-21 13:04       ` Florian Weimer
2018-09-26 17:39     ` Cary Coutant
2018-09-26 18:36       ` H.J. Lu [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAMe9rOrLOQzGRhibpbb1sxkSwJ537eBUZEZkjpv==mHz=o+0PQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=ccoutant@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mark@klomp.org \
    --cc=matz@suse.de \
    --cc=nickc@redhat.com \
    --cc=szabolcs.nagy@arm.com \
    --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).