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