This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch hjl/pr19178/master created. glibc-2.22-479-gd8952eb


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr19178/master has been created
        at  d8952eb0d100475c74c5f282ac32519389ee3e0c (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d8952eb0d100475c74c5f282ac32519389ee3e0c

commit d8952eb0d100475c74c5f282ac32519389ee3e0c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Oct 28 07:49:44 2015 -0700

    Clear ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for prelink
    
    prelink runs ld.so with the environment variable LD_TRACE_PRELINKING
    set to dump the relocation type class from _dl_debug_bindings.  prelink
    has the following relocation type classes:
    
    where ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA has a conflict with
    RTYPE_CLASS_TLS.
    
    Since prelink doesn't use ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA, we
    should clear the ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA bit when the
    DL_DEBUG_PRELINK bit is set.
    
    	[BZ #19178]
    	* elf/dl-lookup.c (RTYPE_CLASS_VALID): New.
    	(RTYPE_CLASS_PLT): Likewise.
    	(RTYPE_CLASS_COPY): Likewise.
    	(RTYPE_CLASS_TLS): Likewise.
    	(_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID
    	to set relocation type class for DL_DEBUG_PRELINK.  Clear the
    	ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA bit for DL_DEBUG_PRELINK.

diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 581fb20..da05b32 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -1016,6 +1016,18 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
 #ifdef SHARED
   if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
     {
+/* ELF_RTYPE_CLASS_XXX must match RTYPE_CLASS_XXX used by prelink with
+   LD_TRACE_PRELINKING.  */
+#define RTYPE_CLASS_VALID	8
+#define RTYPE_CLASS_PLT		(8|1)
+#define RTYPE_CLASS_COPY	(8|2)
+#define RTYPE_CLASS_TLS		(8|4)
+#if ELF_RTYPE_CLASS_PLT != 0 && ELF_RTYPE_CLASS_PLT != 1
+# error ELF_RTYPE_CLASS_PLT must be 0 or 1!
+#endif
+#if ELF_RTYPE_CLASS_COPY != 0 && ELF_RTYPE_CLASS_COPY != 2
+# error ELF_RTYPE_CLASS_COPY must be 0 or 2!
+#endif
       int conflict = 0;
       struct sym_val val = { NULL, NULL };
 
@@ -1073,10 +1085,15 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
 	{
 	  if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
 				== STT_TLS))
-	    type_class = 4;
+	    type_class = RTYPE_CLASS_TLS;
 	  else if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
 				     == STT_GNU_IFUNC))
-	    type_class |= 8;
+	    {
+	      /* Clear the ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA bit since
+		 it isn't used by prelink.  */
+	      type_class &= ~ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA;
+	      type_class |= RTYPE_CLASS_VALID;
+	    }
 	}
 
       if (conflict

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


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