Blame SOURCES/glibc-rh1445781-1.patch

147e83
commit 3e058c9d7eab6d6361e7cda5ba1394bc1757c9f6
147e83
Author: H.J. Lu <hjl.tools@gmail.com>
147e83
Date:   Fri May 22 17:46:42 2015 -0700
147e83
147e83
    Don't issue an error if DT_PLTRELSZ is missing
147e83
    
147e83
    A shared object doesn't need PLT if there are no PLT relocations.  It
147e83
    shouldn't be an error if DT_PLTRELSZ is missing.
147e83
    
147e83
    	[BZ #18410]
147e83
    	* elf/dl-reloc.c (_dl_relocate_object): Don't issue an error
147e83
    	for missing DT_PLTRELSZ.
147e83
147e83
diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c
147e83
--- a/elf/dl-reloc.c	2017-10-04 16:42:16.000000000 -0400
147e83
+++ b/elf/dl-reloc.c	2017-10-05 17:44:14.486358084 -0400
147e83
@@ -259,21 +259,13 @@ _dl_relocate_object (struct link_map *l,
147e83
     ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
147e83
 
147e83
 #ifndef PROF
147e83
-    if (__builtin_expect (consider_profiling, 0))
147e83
+    if (__builtin_expect (consider_profiling, 0)
147e83
+	&& l->l_info[DT_PLTRELSZ] != NULL)
147e83
       {
147e83
 	/* Allocate the array which will contain the already found
147e83
 	   relocations.  If the shared object lacks a PLT (for example
147e83
 	   if it only contains lead function) the l_info[DT_PLTRELSZ]
147e83
 	   will be NULL.  */
147e83
-	if (l->l_info[DT_PLTRELSZ] == NULL)
147e83
-	  {
147e83
-	    errstring = N_("%s: no PLTREL found in object %s\n");
147e83
-	  fatal:
147e83
-	    _dl_fatal_printf (errstring,
147e83
-			      rtld_progname ?: "<program name unknown>",
147e83
-			      l->l_name);
147e83
-	  }
147e83
-
147e83
 	size_t sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA
147e83
 			   ? sizeof (ElfW(Rela))
147e83
 			   : sizeof (ElfW(Rel));
147e83
@@ -284,7 +276,7 @@ _dl_relocate_object (struct link_map *l,
147e83
 	  {
147e83
 	    errstring = N_("\
147e83
 %s: out of memory to store relocation results for %s\n");
147e83
-	    goto fatal;
147e83
+	    _dl_fatal_printf (errstring, rtld_progname, l->l_name);
147e83
 	  }
147e83
       }
147e83
 #endif