This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Fix two issues with the IFUNC optimized mem* routines


On Wed, Aug 29, 2012 at 7:28 AM, David Miller <davem@davemloft.net> wrote:
> From: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
> Date: Wed, 29 Aug 2012 13:44:27 +0200
>
>> However, I think this is a general problem which might very well
>> occur with other shared objects defining IFUNC optimized
>> routines. Forcing IFUNC resolvers to never generate any runtime
>> relocations to me appears like a rather non-obvious limitation.
>
> You really have to reference IFUNC implementations from the IFUNC
> resolver using GOT relative relocations, there really is no way around
> this.
>
> On sparc, the linker will optimize normal relocations into
> GOT-relative ones during the final link for symbols which are
> guarenteed to resolve within the linked final object.

In his testcase:

---
void a (int) __attribute__((ifunc ("resolve_a")));

void a1 (int i)
{
  printf("%d\n", i + 1);
}

void (*resolve_a (void)) (int)
{
  return &a1;
}
----

a1 definition can come from a different DSO at run-time.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]