]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
musl: enable libstdc++ freeres
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 20 Aug 2023 13:24:25 +0000 (15:24 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 20 Aug 2023 13:24:25 +0000 (15:24 +0200)
Both libc and libstdc++ freeres were disabled for musl.
That means that libstdc++ was showing still reachable
memory on systems like Alpine.

coregrind/vg_preloaded.c

index 86f6ac5a26e498e2a216785a0f22e4c045c4414f..a792081b112bc5885e358057d18c35d1507e87db 100644 (file)
@@ -76,7 +76,7 @@ DEFINE_GDB_PY_SCRIPT(VG_GDBSCRIPTS_DIR "/valgrind-monitor.py")
 void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run);
 void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run)
 {
-#  if !defined(__UCLIBC__) && !defined(MUSL_LIBC) \
+#  if !defined(__UCLIBC__) \
       && !defined(VGPV_arm_linux_android) \
       && !defined(VGPV_x86_linux_android) \
       && !defined(VGPV_mips32_linux_android) \
@@ -89,6 +89,14 @@ void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run)
       _ZN9__gnu_cxx9__freeresEv();
    }
 
+#  endif
+
+#  if !defined(__UCLIBC__) && !defined(MUSL_LIBC) \
+      && !defined(VGPV_arm_linux_android) \
+      && !defined(VGPV_x86_linux_android) \
+      && !defined(VGPV_mips32_linux_android) \
+      && !defined(VGPV_arm64_linux_android)
+
    extern void __libc_freeres(void) __attribute__((weak));
    if (((to_run & VG_RUN__LIBC_FREERES) != 0) &&
        (__libc_freeres != NULL)) {