This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Remove unnecessary IFUNC dispatch for __memset_chk.
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: Ondřej Bílka <neleai at seznam dot cz>, Zack Weinberg <zackw at panix dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 11 Aug 2015 12:26:22 +0300 (MSK)
- Subject: Re: [PATCH] Remove unnecessary IFUNC dispatch for __memset_chk.
- Authentication-results: sourceware.org; auth=none
- References: <m28u9lotfk dot fsf at linux-m68k dot org> <55C76FCD dot 5020607 at panix dot com> <CAMe9rOoAWjRma_mG_FazVh3FGOyiGJ=g82=bsfGqa-COnt5p1g at mail dot gmail dot com> <55C78525 dot 40402 at panix dot com> <CAMe9rOrKg8nzB67+OCXz5n1u7ZLnJncpX7J6KkEXqe0Bra843w at mail dot gmail dot com> <55C79AD8 dot 3070301 at panix dot com> <20150810030920 dot GE23550 at vapier> <20150810211200 dot GA17734 at domone> <20150811024803 dot GP23550 at vapier> <20150811055530 dot GA30467 at domone> <20150811070653 dot GC9481 at vapier>
On Tue, 11 Aug 2015, Mike Frysinger wrote:
> On 11 Aug 2015 07:55, OndÅej BÃlka wrote:
> > On Mon, Aug 10, 2015 at 10:48:03PM -0400, Mike Frysinger wrote:
> > > On 10 Aug 2015 23:12, OndÅej BÃlka wrote:
> > > > On Sun, Aug 09, 2015 at 11:09:20PM -0400, Mike Frysinger wrote:
> > > > > On 09 Aug 2015 14:24, Zack Weinberg wrote:
> > > > > > Is an IFUNC's variant-selecting function called only once per process,
> > > > > > or every time?
> > > > >
> > > > > it's once-per-process. if it were every time, it'd defeat the point of the
> > > > > optimization.
> > > >
> > > > No, its once per each shared library.
> > >
> > > it depends on how you're counting. i'm talking about each ifunc resolver -- it
> > > only executes once per process. yes, the overall lookup of ifunc relocs happens
> > > on a per-object basis, but it doesn't mean each resolver runs more than once.
> > You should verify, not make guesses. Its clearly
> > called twice in following program.
> yes, once per PLT slot. once the slot is resolved, it isn't executed again, on
> a per-process basis.
While OndÅej could indeed engage in a better manner, I'm now compelled to
point out that your previous argumentation looks bad. Each shared object that
calls an ifunc function will have a PLT slot for it, and the resolver may be
called as many times as there are such PLT slots. Which means that previously
OndÅej provided a useful clarification: it's once-per-importing-library in
each process, not once-per-process-period.
Unless you were implying something else that both OndÅej and me have missed?
If so, please clarify.