summaryrefslogtreecommitdiff
path: root/system/elfutils/backtrace-signal.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/elfutils/backtrace-signal.patch')
-rw-r--r--system/elfutils/backtrace-signal.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/elfutils/backtrace-signal.patch b/system/elfutils/backtrace-signal.patch
new file mode 100644
index 000000000..3de66da31
--- /dev/null
+++ b/system/elfutils/backtrace-signal.patch
@@ -0,0 +1,20 @@
+Backtraces are thrown off by musl's __restore_sigs internal symbol.
+
+--- elfutils-0.192/tests/backtrace.c.old 2024-10-18 14:03:43.000000000 -0500
++++ elfutils-0.192/tests/backtrace.c 2024-11-19 03:56:50.568150211 -0600
+@@ -90,6 +90,15 @@
+ return;
+ }
+ Dwfl_Module *mod;
++ /* Handle musl's signal handler. */
++ static bool restore_sigs_seen = false;
++ if (symname && strcmp (symname, "__restore_sigs") == 0)
++ {
++ restore_sigs_seen = true;
++ return;
++ }
++ if (restore_sigs_seen)
++ frameno--;
+ /* Skip frames for which there isn't a function name. */
+ static int nulls_seen = 0;
+ if (symname == NULL)