This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [SPARC] Segfault when resolving STT_GNU_IFUNC functions
On Mon, Jun 27, 2011 at 07:38:05AM +0200, Aurelien Jarno wrote:
> On Mon, Jun 20, 2011 at 07:59:27PM -0700, David Miller wrote:
> > From: David Miller <davem@davemloft.net>
> > Date: Mon, 20 Jun 2011 01:32:37 -0700 (PDT)
> >
> > > From: Aurelien Jarno <aurelien@aurel32.net>
> > > Date: Sun, 12 Jun 2011 01:27:38 +0200
> > >
> > >> Just due to the fact that it will add some more instructions to pass the
> > >> values on all architectures, while only one is actually using it.
> > >
> > > Here is a new patch I am testing at the moment:
> >
> > It passed all of my testing so I checked it into the GIT tree.
> >
>
> Sorry for the late answer. I tested it on my side and I haven't seen any
> regression either, neither in the testsuite nor in general usage. Thanks
> a lot.
>
I actually just found regression on non-sparc, for architectures not
using multiarch. They fail to build given elf_ifunc_invoke() is not
defined.
The patch below fixes the problem. Tested on ia64 and s390.
2011-06-30 Aurelien Jarno <aurelien@aurel32.net>
* sysdeps/generic/dl-irel.h: fix protection against multiple
inclusions.
* sysdeps/generic/dl-irel.h(elf_ifunc_invoke): New.
diff --git a/sysdeps/generic/dl-irel.h b/sysdeps/generic/dl-irel.h
index 4d7b481..62fa1ce 100644
--- a/sysdeps/generic/dl-irel.h
+++ b/sysdeps/generic/dl-irel.h
@@ -17,7 +17,14 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _DL_IREL_h
+#ifndef _DL_IREL_H
#define _DL_IREL_H
+static inline DL_FIXUP_VALUE_TYPE
+__attribute ((always_inline))
+elf_ifunc_invoke (ElfW(Addr) addr)
+{
+ return ((DL_FIXUP_VALUE_TYPE (*) (void)) (addr)) ();
+}
+
#endif /* dl-irel.h */
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net