Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The work for simd support uses @gnu_indirect_function. When Valgrind sees binaries using such function it expects to have its own ifunc_handler. Until now there wasn't one for FreeBSD so Valgrind terminates with an abort. This patch merges the fix maintainer and creator made upstream. PR: 273955 Reported by: pjfloyd@wanadoo.fr (maintainer)
- Loading branch information
Showing
2 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- coregrind/vg_preloaded.c.orig 2023-09-19 20:30:09.413386000 +0200 | ||
+++ coregrind/vg_preloaded.c 2023-09-19 20:32:14.366333000 +0200 | ||
@@ -228,7 +228,27 @@ | ||
|
||
#elif defined(VGO_freebsd) | ||
|
||
-// nothing specific currently | ||
+#if (FREEBSD_VERS >= FREEBSD_14) | ||
+ | ||
+void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) (void); | ||
+void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) (void) | ||
+{ | ||
+ OrigFn fn; | ||
+ Addr result = 0; | ||
+ Addr fnentry; | ||
+ | ||
+ /* Call the original indirect function and get it's result */ | ||
+ VALGRIND_GET_ORIG_FN(fn); | ||
+ CALL_FN_W_v(result, fn); | ||
+ | ||
+ fnentry = result; | ||
+ | ||
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ADD_IFUNC_TARGET, | ||
+ fn.nraddr, fnentry, 0, 0, 0); | ||
+ return (void*)result; | ||
+} | ||
+ | ||
+#endif | ||
|
||
#elif defined(VGO_solaris) | ||
|