From: Carlos O'Donell <carlos@redhat.com>
To: hegdesmailbox@gmail.com, Roland McGrath <roland@hack.frob.com>,
"H.J. Lu" <hjl.tools@gmail.com>
Cc: gnu-gabi@sourceware.org
Subject: Re: OSABI on Linux Distros
Date: Fri, 01 Jan 2016 00:00:00 -0000 [thread overview]
Message-ID: <cf375a3c-4ac8-2173-1c76-e741a2431754@redhat.com> (raw)
In-Reply-To: <a7ffb9cb-b876-4165-71ca-a76a13b3255f@gmail.com>
On 06/11/2016 02:44 AM, Suprateeka R Hegde wrote:
> On 11-Jun-2016 02:52 AM, Roland McGrath wrote:
>>> What is the reason why we emit OSABI value as "UNIX - System V"
>>> (ELFOSABI_SYSV) even on GNU/Linux systems? Shouldn't it be just "GNU"
>>> (ELFOSABI_GNU)?
>>
>> In GNU systems the use of this field is specifically to indicate that
>> certain GNU extensions to ELF are used in the particular object. In
>> particular, if any .dynsym entries use STT_GNU_IFUNC o STB_GNU_UNIQUE,
>> then e_ident[EI_OSABI] must be ELFOSABI_GNU.
>
> OK. I understood this part. But then I did not know this set is
> partial. I thought use of *any* GNU specific extension should mark it
> as GNU OSABI.
>
> For instance, GNU_RELRO, GNU_EH_FRAME, GNU_STACK, etc. Even with all
> these, it is still marked SYSV ABI.
I'm not as authoritative on this as Roland is, but in my opinion I expect
that because all three of these entries are optional they do not constitute
a change in the EI_OSABI.
You can ignore GNU_RELRO without any problem, you just won't have a
read-only segment after relocation.
You can ignore GNU_STACK without any problems, it's information
for the dynamic loader to set default stack permissions. When unset the
glibc dynamic loader will use sensible per-machine defaults, likewise
other implementations should also.
The GNU_EH_FRAME can be ignored if you're not using the GNU-based
unwinder which uses this PT_* entry to find .eh_frame_hdr.
Other dynamic linkers should ignore program header segments they don't
understand, and thus the above optionally processed entries should not
change the EI_OSABI.
> 1. Do we have a documented list of GNU extensions that are necessary
> to mark an ELF as GNU ABI?
Not that I am aware of. H.J. might better answer this question.
> 2. Why the list is partial? Why not all GNU extensions?
Only the required GNU extensions should mark EI_OSABI as ELFOSABI_GNU.
If you don't implement STT_GNU_IFUNC or STB_GNU_UNIQUE then things
actually fail.
--
Cheers,
Carlos.
next prev parent reply other threads:[~2016-06-13 15:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 0:00 Suprateeka R Hegde
2016-01-01 0:00 ` Roland McGrath
2016-01-01 0:00 ` Carlos O'Donell
2016-01-01 0:00 ` Suprateeka R Hegde
2016-01-01 0:00 ` Suprateeka R Hegde
2016-01-01 0:00 ` Carlos O'Donell [this message]
2016-01-01 0:00 ` Suprateeka R Hegde
2016-01-01 0:00 ` Carlos O'Donell
2016-01-01 0:00 ` Suprateeka R Hegde
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=cf375a3c-4ac8-2173-1c76-e741a2431754@redhat.com \
--to=carlos@redhat.com \
--cc=gnu-gabi@sourceware.org \
--cc=hegdesmailbox@gmail.com \
--cc=hjl.tools@gmail.com \
--cc=roland@hack.frob.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).