glibc/sysdeps
Will Newton 37d3500738 aarch64: Re-implement setcontext without rt_sigreturn syscall
The current implementation of setcontext uses rt_sigreturn to restore
the contents of registers. This contrasts with the way most other
architectures implement setcontext:

  powerpc64, mips, tile:

  Call rt_sigreturn if context was created by a call to a signal handler,
  otherwise restore in user code.

  powerpc32:

  Call swapcontext system call and don't call sigreturn or rt_sigreturn.

  x86_64, sparc, hppa, sh, ia64, m68k, s390, arm:

  Only support restoring "synchronous" contexts, that is contexts
  created by getcontext, and restoring in user code and don't call
  sigreturn or rt_sigreturn.

  alpha:

  Call sigreturn (but not rt_sigreturn) in all cases to do the restore.

The text of the setcontext manpage suggests that the requirement to be
able to restore a signal handler created context has been dropped from
SUSv2:

  If  the context was obtained by a call to a signal handler, then old
  standard text says that "program execution continues with the program
  instruction following the instruction interrupted by the signal".
  However, this sentence was removed in SUSv2, and the present verdict
  is "the result is unspecified".

Implementing setcontext by calling rt_sigreturn unconditionally causes
problems when used with sigaltstack as in BZ #16629. On this basis it
seems that aarch64 is broken and that new ports should only support
restoring contexts created with getcontext and do not need to call
rt_sigreturn at all.

This patch re-implements the aarch64 setcontext function to restore
the context in user code in a similar manner to x86_64 and other ports.

ChangeLog:

2014-04-17  Will Newton  <will.newton@linaro.org>

	[BZ #16629]
	* sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext):
	Re-implement to restore registers in user code and avoid
	rt_sigreturn system call.
2014-04-17 11:38:50 +01:00
..
aarch64 [AArch64] Define HAVE_RM_CTX and related hooks. 2014-04-17 08:30:07 +01:00
alpha alpha: Enable unwind tables for backtrace.c 2014-04-16 21:35:29 -07:00
arm Add fenv test support for targets which don't have FP traps. 2014-04-17 09:39:27 +01:00
generic Add fenv test support for targets which don't have FP traps. 2014-04-17 09:39:27 +01:00
gnu Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
i386 Factor mmap/munmap of PT_LOAD segments out of _dl_map_object_from_fd et al. 2014-04-03 10:47:14 -07:00
ia64 Compile with -Wundef. 2014-03-14 11:32:51 -07:00
ieee754 [BZ #16824] Fix failing y1 due to too large ulps in downward/upward rounding mode. 2014-04-16 13:03:46 +02:00
init_array Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
m68k Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mach hurd: Add i386 fields to TLS structure 2014-04-16 23:45:36 +02:00
microblaze Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mips Fix -Wundef warnings for _ABI* on MIPS. 2014-03-21 18:21:13 +00:00
posix Use statvfs64() for pathconf(_PC_NAME_MAX). 2014-04-09 20:09:56 +02:00
powerpc PowerPC: Fix --disable-multi-arch builds 2014-04-09 06:22:53 -05:00
pthread Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s390 S/390: Regenerate ULPs 2014-04-16 13:04:34 +02:00
sh Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sparc Regenerate sparc ULPs. 2014-04-13 18:27:19 -07:00
tile tile: Fix cut-and-paste bug in commit fcccd5128. 2014-04-04 15:03:47 -04:00
unix aarch64: Re-implement setcontext without rt_sigreturn syscall 2014-04-17 11:38:50 +01:00
wordsize-32 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wordsize-64 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x86 Save/restore bound registers for _dl_runtime_profile 2014-04-16 14:46:49 -07:00
x86_64 Save/restore bound registers for _dl_runtime_profile 2014-04-16 14:46:49 -07:00