From: "H.J. Lu" <hjl.tools@gmail.com>
To: Generic System V Application Binary Interface
<generic-abi@googlegroups.com>
Cc: Suprateeka R Hegde <hegdesmailbox@gmail.com>,
Cary Coutant <ccoutant@gmail.com>,
Mark Mentovai <mark@chromium.org>,
gnu-gabi@sourceware.org
Subject: Re: What integer type should ELF note header have?
Date: Sun, 01 Jan 2017 00:00:00 -0000 [thread overview]
Message-ID: <CAMe9rOrY1dzg8ehQQkbJo32xAif1Ba-AMHreULiLeBt=i=Hjdg@mail.gmail.com> (raw)
In-Reply-To: <1513352305.15696.89.camel@klomp.org>
On Fri, Dec 15, 2017 at 7:38 AM, Mark Wielaard <mark@klomp.org> wrote:
> On Thu, 2017-12-14 at 08:39 -0800, H.J. Lu wrote:
>> > > > BTW. What is the reason you need 8 byte aligned notes?
>> > >
>> > > NT_GNU_PROPERTY_TYPE_0 can have 64-bit integer properties
>> > > in 64-bit objects. They should be aligned to 8 bytes.
>> >
>> > Not necessarily. You can have not naturally aligned data in files.
>> > ELF
>> > files are cross architectures, so you have to account for different
>>
>> 64-bit integers in NT_GNU_PROPERTY_TYPE_0 note are naturally aligned
>> by design so that int64 can be used to access 64-bit integers in
>> NT_GNU_PROPERTY_TYPE_0 note on all architectures.
>>
>> > alignments and endian issues anyway. Is there a specific property
>> > of
>> > these 64-bit integers that require them to be 8 byte aligned in the
>> > note descriptor data?
>>
>> Currently it has GNU_PROPERTY_STACK_SIZE as 64-bit integer
>> in 64-bit objects. We may add more in the future.
>
> So is it just convenience, so you don't have to write a
> read_8byte_unaligned_value macro to read the data in the note?
>
> I sympathize that reading note data can be a bit of a pain because you
> cannot rely on the data being naturally aligned. But I am unsure that
> is such a big trouble that it needs new alignment/layout rules.
>
One of NT_GNU_PROPERTY_TYPE_0 note consumers is program
loader. I believe 64-bit integers in NT_GNU_PROPERTY_TYPE_0 note
should be naturally aligned.
H.J.
next prev parent reply other threads:[~2017-12-15 15:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAMe9rOoV5u263JotP=XpiYEzcnjCJOG3U-0X5bnK-WwZoOKTQA@mail.gmail.com>
[not found] ` <99c8440b-54d8-41bc-6e4d-cd1894536bb7@Oracle.COM>
[not found] ` <CAJimCsHE8cMY8MY=BYyQ+o4b14LtQKa2u+SiXWi1o4zBQB9t9Q@mail.gmail.com>
2017-01-01 0:00 ` Suprateeka R Hegde
2017-01-01 0:00 ` Ali Bahrami
2017-01-01 0:00 ` Ali Bahrami
2017-01-01 0:00 ` Mark Wielaard
2017-01-01 0:00 ` H.J. Lu
2017-01-01 0:00 ` Mark Wielaard
2017-01-01 0:00 ` H.J. Lu
2017-01-01 0:00 ` Mark Wielaard
2017-01-01 0:00 ` H.J. Lu
2017-01-01 0:00 ` Mark Wielaard
2017-01-01 0:00 ` H.J. Lu [this message]
[not found] ` <3704867e-58b8-3da1-2b29-959ad67a540d@Oracle.COM>
[not found] ` <1513355861.15696.95.camel@klomp.org>
[not found] ` <CAMe9rOrAFX5gPCB355A=vP0VpWQT1x8V3Hrttxm5ZRsvG1FXXw@mail.gmail.com>
2017-01-01 0:00 ` Mark Wielaard
[not found] ` <CAMe9rOosYw=9kF8eTUnxwQXNguvCrcK5GSaM=vbUUSA6+J49Zw@mail.gmail.com>
2017-01-01 0:00 ` 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='CAMe9rOrY1dzg8ehQQkbJo32xAif1Ba-AMHreULiLeBt=i=Hjdg@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=ccoutant@gmail.com \
--cc=generic-abi@googlegroups.com \
--cc=gnu-gabi@sourceware.org \
--cc=hegdesmailbox@gmail.com \
--cc=mark@chromium.org \
/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).