From: GNU Libc Maintainers Date: Sat, 3 Mar 2018 10:47:56 +0000 (+0000) Subject: submitted-sparc32-makecontext X-Git-Tag: archive/raspbian/2.27-1+rpi1^2~36 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6db5f406a3aab64964d6d2e7fcdca75bdb638435;p=glibc.git submitted-sparc32-makecontext 2018-03-03 Aurelien Jarno [BZ #22919] * sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S (__startcontext): Add nop before __startcontext, add explaining comments. Gbp-Pq: Topic sparc Gbp-Pq: Name submitted-sparc32-makecontext.diff --- diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S index 695f172c6..283aef1b3 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/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