public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: enh <enh@google.com>
Cc: Evan Green <evan@rivosinc.com>,
	 libc-alpha@sourceware.org, palmer@rivosinc.com,
	 vineetg@rivosinc.com,  slewis@rivosinc.com
Subject: Re: [PATCH v9 5/6] riscv: Add ifunc helper method to hwprobe.h
Date: Thu, 07 Dec 2023 10:46:51 +0100	[thread overview]
Message-ID: <8734wes5tg.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAJgzZoqifY8hkkMo7vyGBwBb4rD9Fi=F_m9brPOLcTzPcsTKcw@mail.gmail.com> (enh@google.com's message of "Wed, 6 Dec 2023 10:17:15 -0800")

> specifically, my anecdata from Android [both open-source libraries and
> apps] is that basically no-one uses ifuncs beyond libc and
> compiler-generated fmv ifuncs [though for riscv64 that's still "future
> work"], so there's no market for helpers for hand-written ifuncs?

It used to be more widely used on GNU/Linux, for example:

  implemented enabling sized-delete support at runtime

  Under gcc 4.5 or greater we're using ifunc function attribute to
  resolve sized delete operator to either plain delete implementation
  (default) or to sized delete (if enabled via environment variable
  TCMALLOC_ENABLE_SIZED_DELETE).
   
  <https://github.com/gperftools/gperftools/commit/6fdfc5a7f40ebcff3fdaada1a2994ff54be2f9c7>

After distributions turned on BIND_NOW, using IFUNCs for purposes like
that became much more difficult.  We are getting closer to re-enabling
getenv for use in IFUNC resolvers if the ELF dependencies express a
usable relocatoion order, but until my delayed IFUNC resolution patch is
accepted, IFUNC resolvers won't interoperate will with symbol
interposition or underlinking, so compatibility problems remain.

Outside GCC and glibc, I only see an IFUNC resolver in zlib (which is
known to be problematic because it's a frequently interposed library,
and it will go away with the switch to zlib-ng), and nauty
<https://pallini.di.uniroma1.it/>.  I don't know how that was produced.
I do not evidence of other uses for global symbols, neither from
function multi-versioning nor from manually written clones.  (There
might be some additional use in the form of IRELATIVE relocations.)

Thanks,
Florian


  parent reply	other threads:[~2023-12-07  9:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 18:32 [PATCH v9 0/6] RISC-V: ifunced memcpy using new kernel hwprobe interface Evan Green
2023-11-30 18:32 ` [PATCH v9 1/6] riscv: Add Linux hwprobe syscall support Evan Green
2023-12-06 17:22   ` Adhemerval Zanella Netto
2023-12-06 17:24     ` Adhemerval Zanella Netto
2023-11-30 18:32 ` [PATCH v9 2/6] riscv: Add hwprobe vdso call support Evan Green
2023-12-06 17:34   ` Adhemerval Zanella Netto
2023-12-11 21:02     ` Evan Green
2023-11-30 18:32 ` [PATCH v9 3/6] riscv: Add __riscv_hwprobe pointer to ifunc calls Evan Green
2023-12-06  0:31   ` enh
2023-11-30 18:32 ` [PATCH v9 4/6] riscv: Enable multi-arg ifunc resolvers Evan Green
2023-11-30 18:32 ` [PATCH v9 5/6] riscv: Add ifunc helper method to hwprobe.h Evan Green
2023-12-06 17:39   ` Adhemerval Zanella Netto
2023-12-06 18:17   ` enh
2023-12-06 19:42     ` Palmer Dabbelt
2023-12-07  9:46     ` Florian Weimer [this message]
2023-12-07 16:32       ` enh
2023-12-07 16:47         ` Florian Weimer
2023-12-07 17:09           ` enh
2023-11-30 18:32 ` [PATCH v9 6/6] riscv: Add and use alignment-ignorant memcpy Evan Green
2023-12-06 17:07 ` [PATCH v9 0/6] RISC-V: ifunced memcpy using new kernel hwprobe interface Palmer Dabbelt

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=8734wes5tg.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=enh@google.com \
    --cc=evan@rivosinc.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palmer@rivosinc.com \
    --cc=slewis@rivosinc.com \
    --cc=vineetg@rivosinc.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).