]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix stdlib/tst-makecontext regression for Nios II
authorChung-Lin Tang <cltang@codesourcery.com>
Mon, 25 Apr 2016 07:08:17 +0000 (00:08 -0700)
committerChung-Lin Tang <cltang@codesourcery.com>
Mon, 25 Apr 2016 07:08:17 +0000 (00:08 -0700)
ChangeLog
sysdeps/unix/sysv/linux/nios2/setcontext.S

index 6563baf8e796aebc78dadd0fff481f25ad3422bb..b8b87eab72fbdeb1a276ad4f2ae7109167120b1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-25  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/nios2/setcontext.S (__startcontext):
+       Add nop before __startcontext, add explaining comments.
+
 2016-04-25  Samuel thibault  <samuel.thibault@ens-lyon.org>
 
        RFC2292 macros were obsoleted by RFC3542, and should not be exposed
index f10e8ffc0ff34a69006d4bb694877bbb9913fe36..177aa4b3cce4888831b0fdf8bbf4b2d5bc4c46af 100644 (file)
@@ -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