arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1540480-5.patch

147e83
commit 1c36e1e6a5b9b6f9ad1c67f5d43383afb4d80339
147e83
Author: Dmitry V. Levin <ldv@altlinux.org>
147e83
Date:   Wed Dec 20 11:27:51 2017 +0000
147e83
147e83
    elf: remove redundant code from is_dst
147e83
    
147e83
    is_dst is called either by _dl_dst_count or by _dl_dst_substitute.
147e83
    _dl_dst_count is called by DL_DST_COUNT only.
147e83
    DL_DST_COUNT is called either by expand_dst with is_path == 0
147e83
    or by expand_dynamic_string_token.
147e83
    _dl_dst_substitute is called either from expand_dst with is_path == 0
147e83
    or from expand_dynamic_string_token.
147e83
    The latter function is called either from _dl_map_object with is_path == 0
147e83
    or from fillin_rpath with is_path == 1 and name containing no ':'.
147e83
    
147e83
    In any case (is_path && name[i] == ':') is always false and all code
147e83
    depending on it can be safely removed.
147e83
    
147e83
    * elf/dl-load.c (is_dst): Remove checks that is_path is set and name
147e83
    contains ':', and all code depending on these checks.
147e83
147e83
Index: glibc-2.17-c758a686/elf/dl-load.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/elf/dl-load.c
147e83
+++ glibc-2.17-c758a686/elf/dl-load.c
147e83
@@ -258,14 +258,12 @@ is_dst (const char *start, const char *n
147e83
       /* Skip over closing curly brace and adjust for the --name.  */
147e83
       len += 2;
147e83
     }
147e83
-  else if (name[len] != '\0' && name[len] != '/'
147e83
-	   && (!is_path || name[len] != ':'))
147e83
+  else if (name[len] != '\0' && name[len] != '/')
147e83
     return 0;
147e83
 
147e83
   if (__builtin_expect (secure, 0)
147e83
-      && ((name[len] != '\0' && name[len] != '/'
147e83
-	   && (!is_path || name[len] != ':'))
147e83
-	  || (name != start + 1 && (!is_path || name[-2] != ':'))))
147e83
+      && ((name[len] != '\0' && name[len] != '/')
147e83
+	  || (name != start + 1)))
147e83
     return 0;
147e83
 
147e83
   return len;