Blame SOURCES/valgrind-3.15.0-arm64-ld-stpcpy.patch

01cf8b
commit 89423f5d8ba05a099c2c62227a00a4f4eec59eb3
01cf8b
Author: Mark Wielaard <mark@klomp.org>
01cf8b
Date:   Tue May 7 21:20:04 2019 +0200
01cf8b
01cf8b
    Intercept stpcpy also in ld.so for arm64
01cf8b
    
01cf8b
    On other arches stpcpy () is intercepted for both libc.so and ld.so.
01cf8b
    But not on arm64, where it is only intercepted for libc.so.
01cf8b
    
01cf8b
    This can cause memcheck warnings about the use of stpcpy () in ld.so
01cf8b
    when called through dlopen () because ld.so contains its own copy of
01cf8b
    that functions.
01cf8b
    
01cf8b
    Fix by introducing VG_Z_LD_LINUX_AARCH64_SO_1 (the encoded name of
01cf8b
    ld.so on arm64) and using that in vg_replace_strmem.c to intercept
01cf8b
    stpcpy.
01cf8b
    
01cf8b
    https://bugs.kde.org/show_bug.cgi?id=407307
01cf8b
01cf8b
diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
01cf8b
index c97941f..15ba67f 100644
01cf8b
--- a/include/pub_tool_redir.h
01cf8b
+++ b/include/pub_tool_redir.h
01cf8b
@@ -313,7 +313,9 @@
01cf8b
 #define  VG_Z_LD_SO_1               ldZdsoZd1                  // ld.so.1
01cf8b
 #define  VG_U_LD_SO_1               "ld.so.1"
01cf8b
 
01cf8b
+#define  VG_Z_LD_LINUX_AARCH64_SO_1  ldZhlinuxZhaarch64ZdsoZd1
01cf8b
 #define  VG_U_LD_LINUX_AARCH64_SO_1 "ld-linux-aarch64.so.1"
01cf8b
+
01cf8b
 #define  VG_U_LD_LINUX_ARMHF_SO_3   "ld-linux-armhf.so.3"
01cf8b
 
01cf8b
 #endif
01cf8b
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
01cf8b
index 89a7dcc..19143cf 100644
01cf8b
--- a/shared/vg_replace_strmem.c
01cf8b
+++ b/shared/vg_replace_strmem.c
01cf8b
@@ -1160,6 +1160,7 @@ static inline void my_exit ( int x )
01cf8b
  STPCPY(VG_Z_LIBC_SONAME,          __stpcpy_sse2_unaligned)
01cf8b
  STPCPY(VG_Z_LD_LINUX_SO_2,        stpcpy)
01cf8b
  STPCPY(VG_Z_LD_LINUX_X86_64_SO_2, stpcpy)
01cf8b
+ STPCPY(VG_Z_LD_LINUX_AARCH64_SO_1,stpcpy)
01cf8b
 
01cf8b
 #elif defined(VGO_darwin)
01cf8b
  //STPCPY(VG_Z_LIBC_SONAME,          stpcpy)