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