]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Intercept stpcpy also in ld.so for arm64
authorMark Wielaard <mark@klomp.org>
Tue, 7 May 2019 19:20:04 +0000 (21:20 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 7 May 2019 19:20:04 +0000 (21:20 +0200)
On other arches stpcpy () is intercepted for both libc.so and ld.so.
But not on arm64, where it is only intercepted for libc.so.

This can cause memcheck warnings about the use of stpcpy () in ld.so
when called through dlopen () because ld.so contains its own copy of
that functions.

Fix by introducing VG_Z_LD_LINUX_AARCH64_SO_1 (the encoded name of
ld.so on arm64) and using that in vg_replace_strmem.c to intercept
stpcpy.

https://bugs.kde.org/show_bug.cgi?id=407307

NEWS
include/pub_tool_redir.h
shared/vg_replace_strmem.c

diff --git a/NEWS b/NEWS
index 5cbf336b3bc1222e6eead1c050b727dac2ff3626..ca7b0f49919df6b4fb5819f4a4af853ce3d6f915 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ where XXXXXX is the bug number as listed below.
 
 406561  mcinfcallWSRU gdbserver_test fails on ppc64
 407218  Add support for the copy_file_range syscall
+407307  Intercept stpcpy also in ld.so for arm64
 n-i-bz  Fix minor one time leaks in dhat.
 n-i-bz  Add --run-cxx-freeres=no in outer args to avoid inner crashes.
 
index c97941ff40e60ad4e9f88e50738601a334765fbd..15ba67fdb8de458d613444141b65dd9f706f6553 100644 (file)
 #define  VG_Z_LD_SO_1               ldZdsoZd1                  // ld.so.1
 #define  VG_U_LD_SO_1               "ld.so.1"
 
+#define  VG_Z_LD_LINUX_AARCH64_SO_1  ldZhlinuxZhaarch64ZdsoZd1
 #define  VG_U_LD_LINUX_AARCH64_SO_1 "ld-linux-aarch64.so.1"
+
 #define  VG_U_LD_LINUX_ARMHF_SO_3   "ld-linux-armhf.so.3"
 
 #endif
index 89a7dccb72dd5886c323e40ecb0a2f58b7fb4793..19143cf15b3a087b2df6fec019c5eeb65104e541 100644 (file)
@@ -1160,6 +1160,7 @@ static inline void my_exit ( int x )
  STPCPY(VG_Z_LIBC_SONAME,          __stpcpy_sse2_unaligned)
  STPCPY(VG_Z_LD_LINUX_SO_2,        stpcpy)
  STPCPY(VG_Z_LD_LINUX_X86_64_SO_2, stpcpy)
+ STPCPY(VG_Z_LD_LINUX_AARCH64_SO_1,stpcpy)
 
 #elif defined(VGO_darwin)
  //STPCPY(VG_Z_LIBC_SONAME,          stpcpy)