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

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