diff options
author | Carlos O'Donell <carlos@systemhalted.org> | 2015-05-08 11:20:32 -0400 |
---|---|---|
committer | Carlos O'Donell <carlos@systemhalted.org> | 2015-05-08 11:29:38 -0400 |
commit | c92d40c0bcfdeec96848d1e67902e621942144e9 (patch) | |
tree | f1b3c606c16ed474b0a5b871c4fc5ea32315a210 /sysdeps/unix/sysv/linux/nios2 | |
parent | a6d78c3b9dc9bf598a60be18e23bf8fe7668a088 (diff) | |
download | glibc-c92d40c0bcfdeec96848d1e67902e621942144e9.tar glibc-c92d40c0bcfdeec96848d1e67902e621942144e9.tar.gz glibc-c92d40c0bcfdeec96848d1e67902e621942144e9.tar.bz2 glibc-c92d40c0bcfdeec96848d1e67902e621942144e9.zip |
Bug 18125: Call exit after last linked context.
There appears to be a discrepancy among the implementations
of setcontext with regards to the function called once the last
linked-to context has finished executing via setcontext.
The POSIX standard says:
~~~
If the uc_link member of the ucontext_t structure pointed to by
the ucp argument is equal to 0, then this context is the main
context, and the thread will exit when this context returns.
~~~
It says "exit" not "exit immediately" nor "exit without running
functions registered with atexit or on_exit."
Therefore the AArch64, ARM, hppa and NIOS II implementations are
wrong and no test detects it.
It is questionable if this should even be fixed or just documented
that the above 4 targets are wrong. The functions are deprecated
and nobody should be using them, but at the same time it silly to
have cross-target differences that make it hard to port old
applications from say x86_64 to AArch64.
Therefore I will ix the 4 arches, and checkin a regression
test to prevent it from changing again.
https://sourceware.org/ml/libc-alpha/2015-03/msg00720.html
Diffstat (limited to 'sysdeps/unix/sysv/linux/nios2')
-rw-r--r-- | sysdeps/unix/sysv/linux/nios2/setcontext.S | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/nios2/setcontext.S b/sysdeps/unix/sysv/linux/nios2/setcontext.S index 9a8dd87b93..f40b73389d 100644 --- a/sysdeps/unix/sysv/linux/nios2/setcontext.S +++ b/sysdeps/unix/sysv/linux/nios2/setcontext.S @@ -89,15 +89,15 @@ ENTRY(__startcontext) mov r4, r16 bne r4, zero, __setcontext - /* If uc_link == zero, call _exit. */ + /* If uc_link == zero, call exit. */ #ifdef PIC nextpc r22 1: movhi r8, %hiadj(_gp_got - 1b) addi r8, r8, %lo(_gp_got - 1b) add r22, r22, r8 - ldw r8, %call(HIDDEN_JUMPTARGET(_exit))(r22) + ldw r8, %call(HIDDEN_JUMPTARGET(exit))(r22) jmp r8 #else - jmpi _exit + jmpi exit #endif END(__startcontext) |