https://bugs.kde.org/show_bug.cgi?id=435441 From 460d0c9a6c27edfffed8ced623cecf64466619f2 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 4 Nov 2021 14:26:40 -0700 Subject: [PATCH] Bug 435441 - Handle weak symbols as global for redirection Weak symbols are global but with lower precedence, so they should be handled the same way as global symbols during malloc replacement. This fixes valgrind on musl 1.2.2 when it is not patched with a soname (as is done on Alpine Linux). https://bugs.kde.org/show_bug.cgi?id=435441 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -429,7 +429,8 @@ Bool get_elf_symbol_info ( } # endif - if (ELFXX_ST_BIND(sym->st_info) == STB_GLOBAL) { + if (ELFXX_ST_BIND(sym->st_info) == STB_GLOBAL + || ELFXX_ST_BIND(sym->st_info) == STB_WEAK) { *is_global_out = True; } -- 2.32.0