e0ea46
commit 947388eb043ea1c44b37df94046e1eee790ad776
e0ea46
Author: Mike Crowe <mac@mcrowe.com>
e0ea46
Date:   Mon Sep 9 14:16:16 2019 +0100
e0ea46
e0ea46
    Intercept strncmp for glibc ld.so v2.28+
e0ea46
    
e0ea46
    In glibc 5aad5f617892e75d91d4c8fb7594ff35b610c042 (first released in
e0ea46
    v2.28) a call to strncmp was added to dl-load.c:is_dst. This causes
e0ea46
    valgrind to complain about glibc's highly-optimised strncmp performing
e0ea46
    sixteen-byte reads on short strings in ld.so. Let's intercept strncmp in
e0ea46
    ld.so too so we use valgrind's simple version to avoid this problem.
e0ea46
e0ea46
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
e0ea46
index 3b42b3a87..5396e83be 100644
e0ea46
--- a/shared/vg_replace_strmem.c
e0ea46
+++ b/shared/vg_replace_strmem.c
e0ea46
@@ -710,6 +710,8 @@ static inline void my_exit ( int x )
e0ea46
  STRNCMP(VG_Z_LIBC_SONAME, __GI_strncmp)
e0ea46
  STRNCMP(VG_Z_LIBC_SONAME, __strncmp_sse2)
e0ea46
  STRNCMP(VG_Z_LIBC_SONAME, __strncmp_sse42)
e0ea46
+ STRNCMP(VG_Z_LD_LINUX_SO_2, strncmp)
e0ea46
+ STRNCMP(VG_Z_LD_LINUX_X86_64_SO_2, strncmp)
e0ea46
 
e0ea46
 #elif defined(VGO_freebsd)
e0ea46
  STRNCMP(VG_Z_LIBC_SONAME, strncmp)