about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/nios2/setcontext.S
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2016-04-25 00:08:17 -0700
committerChung-Lin Tang <cltang@codesourcery.com>2016-04-25 00:08:17 -0700
commita5507dfa60a8b92ba52dadabea88e2b5d91da655 (patch)
tree5f9746c61ccbc2a2b62d4d4767fcb5524d65b924 /sysdeps/unix/sysv/linux/nios2/setcontext.S
parentd454fd21f4366fc529f83fdcd8a1113c5b49853e (diff)
downloadglibc-a5507dfa60a8b92ba52dadabea88e2b5d91da655.tar.gz
glibc-a5507dfa60a8b92ba52dadabea88e2b5d91da655.tar.xz
glibc-a5507dfa60a8b92ba52dadabea88e2b5d91da655.zip
Fix stdlib/tst-makecontext regression for Nios II
Diffstat (limited to 'sysdeps/unix/sysv/linux/nios2/setcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/nios2/setcontext.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/nios2/setcontext.S b/sysdeps/unix/sysv/linux/nios2/setcontext.S
index f10e8ffc0f..177aa4b3cc 100644
--- a/sysdeps/unix/sysv/linux/nios2/setcontext.S
+++ b/sysdeps/unix/sysv/linux/nios2/setcontext.S
@@ -85,6 +85,18 @@ ENTRY(__setcontext)
 PSEUDO_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
+
 ENTRY(__startcontext)
 	mov	r4, r16
 	bne	r4, zero, __setcontext