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

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