unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Carlos O'Donell <codonell@redhat.com>
Cc: Zack Weinberg <zackw@panix.com>,
	 GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Are ifuncs intended to be allowed to resolve to symbols in another DSO?
Date: Mon, 03 Feb 2020 20:06:34 +0000	[thread overview]
Message-ID: <87tv47jv05.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <559bbced-2f06-4196-719a-923e6c804e1d@redhat.com> (Carlos O'Donell's message of "Sat, 1 Feb 2020 01:27:23 -0500")

* Carlos O'Donell:

> If an IFUNC resolver calls a function which is not yet resolved then
> isn't that a defect in the IFUNC resolver?

There is a position that an IFUNC resolver must not use any non-local
relocations.  (We must support some relocations for IFUNCs on
!PI_STATIC_AND_HIDDEN targets.)  In this case, yes, such a dependencies
would be a bug because all external dependencies are bugs.

On the other hand, in glibc, we could get rid of many IFUNC resolvers
which violate this rule only after changing the loader that eliminated
their need for them.  Other IFUNCs that do not follow this rule do not
have this luxury.

> The code which contains such an IFUNC should have had a DT_NEEDED entry
> on all objects to which the resolver called into?

This does not help with symbol interposition.

> I like solutions that ensure that IFUNC resolvers, which are just foreign
> functions, run at a stage *after* their own dependencies have been resolved,
> but before their own initializers have run.

Lazy binding achieves this because it implicitly tracks this dependency
information.  For eager binding, we simply do not have this information.
Hence my patch for delayed relocation processing.  But it does not solve
the problem completely, of course.

Thanks,
Florian


  reply	other threads:[~2020-02-03 20:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 18:29 Are ifuncs intended to be allowed to resolve to symbols in another DSO? Zack Weinberg
2020-01-09 20:37 ` Florian Weimer
2020-02-01  6:27   ` Carlos O'Donell
2020-02-03 20:06     ` Florian Weimer [this message]
2020-02-03 22:03       ` Carlos O'Donell
2020-02-04  7:15         ` Fangrui Song
2020-02-21 13:28         ` Florian Weimer

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=87tv47jv05.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=codonell@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=zackw@panix.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).