summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libunwind/libunwind/0003-x86-Stub-out-x86_local_resume.patch
blob: f02f13f79c146968f76ba37c0476b7a3c1c8cbe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 0b2243f19d4ea12a2a68478a5aed503947a800af Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 22 Mar 2016 16:19:29 +0000
Subject: [PATCH] x86: Stub out x86_local_resume()

its purpose seems
to be unwinding across signal handler boundaries, which cannot happen
in correct programs anyway. Replacing the whole function with
something like *(volatile char *)0=0; (i.e. crash), gets a working
libunwind

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 src/x86/Gos-linux.c | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c
index d448dce..c25ae0c 100644
--- a/src/x86/Gos-linux.c
+++ b/src/x86/Gos-linux.c
@@ -284,31 +284,7 @@ x86_r_uc_addr (ucontext_t *uc, int reg)
 HIDDEN int
 x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
 {
-  struct cursor *c = (struct cursor *) cursor;
-  ucontext_t *uc = c->uc;
-
-  /* Ensure c->pi is up-to-date.  On x86, it's relatively common to be
-     missing DWARF unwind info.  We don't want to fail in that case,
-     because the frame-chain still would let us do a backtrace at
-     least.  */
-  dwarf_make_proc_info (&c->dwarf);
-
-  if (unlikely (c->sigcontext_format != X86_SCF_NONE))
-    {
-      struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
-
-      Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc);
-#if !defined(__ANDROID__)
-      x86_sigreturn (sc);
-#endif
-    }
-  else
-    {
-      Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip);
-#if !defined(__ANDROID__)
-      setcontext (uc);
-#endif
-    }
+  *(volatile char *)0=0;
   return -UNW_EINVAL;
 }