|
From: Paul F. <pa...@so...> - 2026-03-19 07:54:06
|
https://sourceware.org/cgit/valgrind/commit/?id=9a257700d92ddbf0e87ce02c08ba995836c007e5 commit 9a257700d92ddbf0e87ce02c08ba995836c007e5 Author: Paul Floyd <pj...@wa...> Date: Thu Mar 19 08:53:23 2026 +0100 Bug 517748 - Add ability to redirect global functions to Darwin Diff: --- NEWS | 1 + coregrind/m_debuginfo/readmacho.c | 2 +- massif/tests/overloaded-new.vgtest | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3f059769ee..64bafc1e5f 100644 --- a/NEWS +++ b/NEWS @@ -111,6 +111,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 516748 Incorrect use of SET_STATUS_Failure for syscall wrappers that return error codes rather than -1 on error 517697 Implement CLRSSONSTACK and SETUJMPBUF handling on Solaris. +517748 Add ability to redirect global functions to Darwin To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index b8f96dfd70..f97866ffb5 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -434,7 +434,7 @@ void add_symbol( /*OUT*/XArray* /* DiSym */ syms, di->text_avma+di->text_size - sym_addr; disym.isText = inside_text; disym.isIFunc = False; - disym.isGlobal = inside_data || inside_d_data; + disym.isGlobal = (nl->n_type & N_EXT) != 0; // Lots of user function names get prepended with an underscore. Eg. the // function 'f' becomes the symbol '_f'. And the "below main" // function is called "start". So we skip the leading underscore, and diff --git a/massif/tests/overloaded-new.vgtest b/massif/tests/overloaded-new.vgtest index e648b46b4c..0577829a31 100644 --- a/massif/tests/overloaded-new.vgtest +++ b/massif/tests/overloaded-new.vgtest @@ -13,6 +13,6 @@ vgopts: --ignore-fn=_objc_init --ignore-fn-"objc::DenseMap<char const*, objc::de # Darwin ignore functions, for macOS 12 vgopts: --ignore-fn=_xpc_alloc # Darwin ignore functions, for macOS 13 -vgopts: --ignore-fn=_xpc_strdup --ignore-fn=_vasprintf --ignore-fn="_fetchInitializingClassList(bool)" --ignore-fn="cache_t::allocateBuckets(unsigned int)" +vgopts: --ignore-fn=strdup --ignore-fn=_vasprintf --ignore-fn="_fetchInitializingClassList(bool)" --ignore-fn="cache_t::allocateBuckets(unsigned int)" post: perl ../../massif/ms_print massif.out | sed 's/gcc[0-9]*/gcc/' | ./filter_new_aligned | ./filter_ignore_fn cleanup: rm massif.out |