[ppc] Include hwcap as ifunc argument

Richard Henderson rth@twiddle.net
Thu May 24 14:47:00 GMT 2012


On 05/21/2012 09:58 AM, Richard Henderson wrote:
> Aside from the x86 port, there are only two targets that have ifunc
> support in glibc mainline: ppc and arm.  It would be awesomely handy
> if we switch these targets to mirror the sparc lead in passing along
> the dl_hwcap contents as an argument to the resolver, *and* to do it
> in the same release as adding getauxval.  There are some clever things
> we can do at static link time if we know that getauxval corresponds to
> the availability of the ifunc argument.
>
> Dave, dunno if you wanna change the signature of the arg from int to
> unsigned long for 64-bit?  It just seemed prudent to do that here...
>
> I'll present a similar patch for arm shortly...

Like so.  Tested on armv7.  And a ping for the ppc patch?


r~
-------------- next part --------------
diff --git a/sysdeps/arm/dl-irel.h b/sysdeps/arm/dl-irel.h
index 5141031..5b1964e 100644
--- a/sysdeps/arm/dl-irel.h
+++ b/sysdeps/arm/dl-irel.h
@@ -29,7 +29,7 @@ static inline Elf32_Addr
 __attribute ((always_inline))
 elf_ifunc_invoke (Elf32_Addr addr)
 {
-  return ((Elf32_Addr (*) (void)) (addr)) ();
+  return ((Elf32_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));
 }
 
 static inline void


More information about the Libc-alpha mailing list