From: Fangrui Song <maskray@google.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU gABI gnu-gabi <gnu-gabi@sourceware.org>,
GCC Development <gcc@gcc.gnu.org>,
Binutils <binutils@sourceware.org>,
GNU C Library <libc-alpha@sourceware.org>,
llvm-dev@lists.llvm.org
Subject: Re: [llvm-dev] RFC: Add GNU_PROPERTY_1_NEEDED
Date: Fri, 18 Jun 2021 14:34:50 -0700 [thread overview]
Message-ID: <20210618213450.qdasgofw6hklzxip@google.com> (raw)
In-Reply-To: <CAMe9rOoBh7fTD6HYK3dRzt3Qs7jOjioXwT7SzqBS_449yjHPrQ@mail.gmail.com>
On 2021-06-18, H.J. Lu via llvm-dev wrote:
>Add GNU_PROPERTY_1_NEEDED:
>
> #define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO
>
>to indicate the needed properties by the object file.
>
I am fine with this logical OR style usage. But see below, do we need it
for ld.so runtime check?
(As I mentioned previously, I do not know how an AND-style property can
be used/deployed if old object files without the .note.gnu.property is
considered to have a value of 0.)
>Add GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION:
>
> #define GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION (1U << 0)
>
>to indicate that the object file requires canonical function pointers and
>cannot be used with copy relocation.
In https://sourceware.org/pipermail/gnu-gabi/2021q2/000481.html you gave
a rationale
"The issue is that libfoo.so used in link-time can be different from
libfoo.so at run-time. The symbol, foobar, in libfoo.so at link-time
has the default visibility. But foobar in libfoo.so at run-time can be
protected. ld.so should detect such cases which can lead to run-time
failures."
First, I think such dynamic symbol visibility change is uncommon.
Second, if ld.so finds that a symbol lookup for (st_value==0
st_shndx==SHN_UNDEF) will bind to a STV_PROTECTED definition in a shared
object, can the diagnostic be moved there?
The compatibility property is per-symbol and the symbol lookup is a
perfect place for a diagnostic, like a symbol versioning error.
I guess GCC folks may get noticed if you start a thread adding
-fsingle-global-definition, otherwise many people who have opinions may
just ignore threads about GNU PROPERTY addition.
>
>The PDF file is at
>
>https://gitlab.com/x86-psABIs/Linux-ABI/-/wikis/uploads/9eca2f2defe62b0c5015bf2e3e8a9f05/Linux-gABI-1_needed-2021-06-18.pdf
next prev parent reply other threads:[~2021-06-18 21:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 17:06 RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX H.J. Lu
2021-01-21 15:02 ` H.J. Lu
2021-01-21 21:42 ` Fangrui Song
2021-04-17 12:48 ` H.J. Lu
2021-04-17 18:25 ` Fangrui Song
2021-04-17 19:05 ` H.J. Lu
2021-06-17 18:59 ` H.J. Lu
2021-06-17 19:38 ` [llvm-dev] " Fangrui Song
2021-06-17 19:45 ` H.J. Lu
2021-06-17 20:25 ` Fāng-ruì Sòng
2021-06-17 23:01 ` H.J. Lu
2021-06-18 0:06 ` Fāng-ruì Sòng
2021-06-18 0:24 ` H.J. Lu
2021-06-18 0:49 ` Fāng-ruì Sòng
2021-06-18 2:40 ` H.J. Lu
2021-06-21 14:35 ` Michael Matz
2021-06-22 14:30 ` H.J. Lu
2021-06-22 14:54 ` Michael Matz
2021-06-18 2:45 ` H.J. Lu
2021-06-18 15:38 ` RFC: Add GNU_PROPERTY_1_NEEDED H.J. Lu
2021-06-18 21:34 ` Fangrui Song [this message]
2021-06-19 1:09 ` [llvm-dev] " H.J. Lu
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=20210618213450.qdasgofw6hklzxip@google.com \
--to=maskray@google.com \
--cc=binutils@sourceware.org \
--cc=gcc@gcc.gnu.org \
--cc=gnu-gabi@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=llvm-dev@lists.llvm.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).