[PATCH] PR middle-end/71524: IFUNC resolver may resolve to a non-local function

Alexander Monakov amonakov@ispras.ru
Sun Jun 26 19:06:00 GMT 2016


On Sun, 26 Jun 2016, H.J. Lu wrote:
> On Sun, Jun 26, 2016 at 12:49 AM, Alexander Monakov <amonakov@ispras.ru> wrote:
> > On Sat, 25 Jun 2016, H.J. Lu wrote:
> >> The resolver for ifunc functions might resolve to a non-local function.
> >
> > I think the explanation doesn't match the testcase, in which all three
> > functions: the resolver, the symbol being resolved, and the ultimate
> > resolution are all static. I don't think there was an intention to allow the
> > resolver reside in a different translation unit than the resolvee, so the
> > comment also seems confusing if not wrong.
> 
> Normally the actual function is in a different file:

OK, but I was talking about the resolver and the symbol being resolved -- the
two must be in the same TU afaict.  Where the function returned by the
resolver resides is a different matter.  Specifically, I meant that you cannot
have:

extern void *foo_resolver (void); // No definition in current TU
void foo (void) __attribute__((ifunc("foo_resolver")));

Perhaps the ambiguity in "resolver ... might resolve to" should be avoided. It
seems you meant the resolver's return value, while it can also be understood
as "the address of the resolver, as bound/resolved by ld/ldso".

Alexander



More information about the Gcc-patches mailing list