1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

PowerPC: Fix uc_link == NULL handling for makecontex.

If the function registered with makecontext returns with a NULL context
link the process should exit with zero, not non-zero.
This commit is contained in:
Andreas Schwab
2012-11-01 20:10:39 -05:00
committed by Ryan S. Arnold
parent b3563932f8
commit d6cffd3ec0
2 changed files with 20 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2012-11-01 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: If the
function returns with a NULL context exit with zero.
2012-11-01 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> 2012-11-01 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* sysdeps/powerpc/Makefile (cflags): Remove -mnew-mnemonics. * sysdeps/powerpc/Makefile (cflags): Remove -mnew-mnemonics.

View File

@ -140,20 +140,20 @@ L(exitcode):
ld r2,FRAME_TOC_SAVE(r1) ld r2,FRAME_TOC_SAVE(r1)
ld r3,UCONTEXT_LINK(r3) /* Load the resume context. */ ld r3,UCONTEXT_LINK(r3) /* Load the resume context. */
cmpdi r3,0 cmpdi r3,0
beq L(BADSTATUS) beq L(do_exit)
bl JUMPTARGET(__setcontext) bl JUMPTARGET(__setcontext)
nop nop
/* If setcontext returns (which can happen if the syscall fails) we will
L(BADSTATUS):
/* If setcontext returns (which can happen if the syscall fails) we will
exit the program with error status (-1). */ exit the program with error status (-1). */
li r3,-1 li r3,-1
L(do_exit):
#ifdef SHARED #ifdef SHARED
b JUMPTARGET(__GI_exit); b JUMPTARGET(__GI_exit);
#else #else
b JUMPTARGET(exit); b JUMPTARGET(exit);
nop nop
#endif #endif
b L(do_exit)
/* The address of the exit code is in the link register. Store the lr /* The address of the exit code is in the link register. Store the lr
in the ucontext as LNK so the target function will return to our in the ucontext as LNK so the target function will return to our