This is the mail archive of the mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.

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

[PATCH] Fix R_PPC64_{JMP_IREL,IRELATIVE} handling in dl-conflict.c


I've just committed STT_GNU_IFUNC ppc/ppc64 support into prelink,
and this patch is needed on the glibc side.  Without it segfaults,
as in dl-conflict.c sym_map is always NULL.  While dl-machine.h could use
RESOLVE_CONFLICT_FIND_MAP macro to compute it, it doesn't make sense,
because with prelink we know it is already properly relocated (all relative
relocations are applied by prelink).

2009-11-03  Jakub Jelinek  <>

	* sysdeps/powerpc/powerpc64/dl-machine.h (resolve_ifunc): Don't
	relocate opd entry when resolving prelink conflicts.

--- libc/sysdeps/powerpc/powerpc64/dl-machine.h.jj	2009-11-02 13:54:31.000000000 +0100
+++ libc/sysdeps/powerpc/powerpc64/dl-machine.h	2009-11-03 17:33:58.000000000 +0100
@@ -531,13 +531,14 @@ auto inline Elf64_Addr __attribute__ ((a
 resolve_ifunc (Elf64_Addr value,
 	       const struct link_map *map, const struct link_map *sym_map)
   /* The function we are calling may not yet have its opd entry relocated.  */
   Elf64_FuncDesc opd;
   if (map != sym_map
-#if !defined RTLD_BOOTSTRAP && defined SHARED
+# if !defined RTLD_BOOTSTRAP && defined SHARED
       /* Bootstrap map doesn't have l_relocated set for it.  */
       && sym_map != &GL(dl_rtld_map)
+# endif
       && !sym_map->l_relocated)
       Elf64_FuncDesc *func = (Elf64_FuncDesc *) value;
@@ -546,6 +547,7 @@ resolve_ifunc (Elf64_Addr value,
       opd.fd_aux = func->fd_aux;
       value = (Elf64_Addr) &opd;
   return ((Elf64_Addr (*) (void)) value) ();


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