summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2018-03-09 19:14:40 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2018-03-09 19:14:40 +0100
commit6e627523ee4b3fc00c30dcff74c2adf93e2b6840 (patch)
tree42940ad77a0fd14bd029fa2ee0e912a9a4ef45ac
parent01e9f2f202a0afc658bfd82c0ff1770de7900bb1 (diff)
sparc32: Add nop before __startcontext to stop unwinding
From glibc commit 9aa5c222b9e0409143410a02b6364a3b25dbf028 [BZ #22919]
-rw-r--r--libc/sysdeps/linux/sparc/setcontext.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/sparc/setcontext.S b/libc/sysdeps/linux/sparc/setcontext.S
index f9da21563..48ab5f719 100644
--- a/libc/sysdeps/linux/sparc/setcontext.S
+++ b/libc/sysdeps/linux/sparc/setcontext.S
@@ -95,6 +95,19 @@ END(__setcontext)
weak_alias (__setcontext, setcontext)
+/* We add an NOP here to separate between __setcontext/__startcontext. The
+ wanted behavior that happens is: when unwinding from a function called
+ inside a makecontext() context, FDE lookup will use '&__startcontext - 1',
+ then returns NULL for no FDE found, and immediately ends the unwind, in
+ a normal fashion.
+
+ If this NOP word does not exist, FDE lookup just repeatedly finds
+ __setcontext's FDE in an infinite loop, due to the convention of using
+ 'address - 1' for FDE lookup. Modifiying/deleting the below
+ __startcontext's FDE has no help on this. */
+
+ nop
+
/* This is the helper code which gets called if a function which is
registered with 'makecontext' returns. In this case we have to
install the context listed in the uc_link element of the context