Commit Graph

4120 Commits

Author SHA1 Message Date
Roland McGrath d936d379eb SH: Consolidate NPTL/non versions of vfork 2014-06-02 14:29:19 -07:00
Richard Henderson f0712b543e aarch64: Remove PSEUDO_RET 2014-05-30 14:11:51 -04:00
Richard Henderson 74f31c1859 aarch64: Fix error return from __ioctl
Forgotten in ca3cfa40c1
where the error branch was moved from PSEUDO_RET.
2014-05-30 14:09:34 -04:00
Roland McGrath 5190c17f22 m68k: Convert fork.c to arch-fork.h 2014-05-30 18:44:55 +02:00
Richard Henderson 1670e207c5 aarch64: Rely on syscalls preserving registers
In several cases we've had asm routines rely on syscalls not clobbering
call-clobbered registers, and that's now deemed ABI.  So take advantage
of this in the INLINE_SYSCALL path as well.

Shrinks libc.so by about 1k.
2014-05-29 12:53:27 -04:00
Richard Henderson 11a28aee60 aarch64: Use tpidr_el0 rather than __errno_location in librt 2014-05-29 12:41:08 -04:00
Richard Henderson a17e5ffb80 aarch64: Use tpidr_el0 rather than __read_tp in librt 2014-05-29 12:39:03 -04:00
Richard Henderson b5be459771 aarch64: Improve syscall-cancel stack frame
One push instead of N; use stp/ldp to halve the insns.
2014-05-29 12:37:24 -04:00
Richard Henderson 645d44abe3 aarch64: Pass regno parameter to SINGLE_THREAD_P
Use cbz instead of cmp+b.eq.
2014-05-29 12:33:06 -04:00
Richard Henderson a8b4f04ad7 aarch64: Share code in syscall-cancel.h
Fold nocancel and error handling paths.
2014-05-29 12:31:07 -04:00
Richard Henderson af4e8ef944 aarch64: Tabify sysdep-cancel.h 2014-05-29 12:28:59 -04:00
Eric Wong 26b0d2e1a1 Avoid stat/fstat in statvfs/fstatvfs (BZ #15132)
Delay the use of stat/fstat until stat data is required.  When the
kernel returns ST_VALID, stat data is not used by __internal_statvfs.
2014-05-29 09:41:29 +05:30
Roland McGrath 0d3b7a190c SH: Consolidate NPTL/non versions of clone 2014-05-28 17:23:19 -07:00
Roland McGrath 1efe2bd9dc tile: Convert fork.c to arch-fork.h 2014-05-28 14:23:16 -04:00
Roland McGrath 30b6629ede IA64: Convert fork.c to arch-fork.h 2014-05-27 15:43:45 -07:00
Roland McGrath a6bea3ca7b SH: Convert fork.c to arch-fork.h 2014-05-27 12:58:01 -07:00
Adhemerval Zanella c7a8d66787 PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files. 2014-05-26 11:45:14 -05:00
Adhemerval Zanella daee7851e2 PowerPC: Move NPTL ABI headers to sysdeps. 2014-05-26 11:41:47 -05:00
Adhemerval Zanella 50a4081954 PowerPC: Move powerpc64 timer_*.c out of nptl/ 2014-05-26 11:41:46 -05:00
Adhemerval Zanella 8464c2a110 PowerPC: Consolidate NPTL/non versions of clone 2014-05-26 11:41:46 -05:00
Adhemerval Zanella 3d1024e8d1 PowerPC: Consolidate NPTL/non versions of vfork 2014-05-26 11:41:28 -05:00
Richard Henderson aa2f176d6f arm,aarch64: Remove SINGLE_THREAD_P_PIC
This macro was removed by

2005-11-16  Daniel Jacobowitz  <dan@codesourcery.com>

but not applied to the (still separate) eabi port so necro'd
when the eabi port superceded the old abi.  It was thence
copied into the new AArch64 port.
2014-05-25 12:50:41 -04:00
Richard Henderson ca3cfa40c1 aarch64: Tidy syscall error check
Move the error branch from the PSEUDO_RET macro to the PSEUDO macro.
This is in line with other architectures, and will enable further improvments.
2014-05-25 12:46:50 -04:00
Richard Henderson 6e6c2d01eb aarch64: Remove DOARGS/UNDOARGS macros
While they do something for AArch32, they're useless for AArch64.
2014-05-25 12:37:29 -04:00
Richard Henderson c69abcee72 aarch64: Fix DO_CALL block comment 2014-05-25 12:33:00 -04:00
Richard Henderson 82aab97cbf alpha: Do non-default symbols in pt-vfork.S 2014-05-25 09:04:54 -07:00
Richard Henderson bc89e9625f alpha: Move remaining files out of sysdeps/unix/sysv/linux/alpha/nptl/ 2014-05-23 11:20:48 -07:00
Richard Henderson e2fa4bc2bb alpha: Consolidate NPTL/non versions of vfork 2014-05-23 11:20:44 -07:00
Richard Henderson 279b24e2e5 alpha: Merge standard and nptl clone.S 2014-05-23 11:20:41 -07:00
Richard Henderson 132c7f5f01 alpha: Remove nptl/fork.c
The merge at ab21431318 failed
to properly remove the file.
2014-05-23 11:20:37 -07:00
Roland McGrath df54acbb7b AArch64: Convert fork.c to arch-fork.h 2014-05-21 18:45:00 +01:00
Richard Henderson a6b3657be6 aarch64: Merge __local_multiple_threads offset with memory reference
This also highlights that we'd been loading 64-bits instead of
the proper 32-bits.  Caught by the linker as a relocation error,
since the variable happened to be unaligned for 64-bits.
2014-05-21 11:36:51 -04:00
Richard Henderson 3612eb8f25 aarch64: Merge rtld_errno offset with memory reference 2014-05-21 11:36:03 -04:00
Joseph Myers 175cef4163 Fix ARM build with GCC trunk.
sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure.  This patch marks those
variables with __attribute_used__ to avoid that optimization.

Tested that this fixes the build for ARM.

	* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
	(libgcc_s_resume): Use __attribute_used__.
	* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
	Likewise.
2014-05-20 21:27:13 +00:00
Richard Henderson de9d8f2098 alpha: fix sa_flags type (BZ 16967) 2014-05-20 07:17:27 -07:00
Richard Henderson 4c0a1e6392 alpha: Remove bits/siginfo.h (BZ 16966)
Using the default header instead.  This matches the kernel, which also
uses the generic header.  Fixes the sys/wait.h conform issue, where
si_band had the wrong type.
2014-05-20 07:17:24 -07:00
Will Newton a60339aaff AArch64: Fix handling of nocancel syscall failures
The current code for nocancel syscalls does not do a comparison of
the system call return value. This leads to code being generated
where the b.cs follows the svc instruction directly without setting
the flags on which the branch depends.

ChangeLog:

2014-05-20  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
	Test the return value of the system call in the nocancel case.
2014-05-20 13:48:23 +01:00
Yvan Roux 7d05a8168b AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h
This patch fixes an issue observed by the Xen project, where including
signal.h exposes various PSR_MODE #defines.  This is due to the usage
in sys/user.h and sys/procfs.h of the struct user_pt_regs and
user_fpsimd_state included via asm/ptrace.h.  The namespace pollution
this inclusion introduce is already partially fixed with some #undef
of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are
still present, and undefining them is not safe since a user can
include ptrace.h before user.h.

My proposition is to define the 2 structures we need in user.h and get
rid of the asm/ptrace.h inclusion.

Build and make check are clean on AArch64.

2014-05-20  Will Newton  <will.newton@linaro.org>
	    Yvan Roux  <yvan.roux@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
	#include of asm/ptrace.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(struct user_regs_struct): New structure.
	(struct user_fpsimd_struct): New structure.
	* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused
	#include of asm/ptrace.h and second #include of sys/user.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(ELF_NGREG): Use new struct user_regs_struct.
	(elf_fpregset_t): Use new struct user_fpsimd_struct.
2014-05-20 13:45:22 +01:00
Richard Henderson e184a918bb alpha: Create __syscall_nocancel entry points 2014-05-17 11:25:19 -07:00
Richard Henderson ab21431318 Merge remote-tracking branch 'origin/roland/nptl-alpha' 2014-05-17 11:20:44 -07:00
David S. Miller f56c7a6ac4 Fix some termios.h conformtest failures on sparc.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h (PAGEOUT, WRAP):
	Protect with __USE_GNU.
	(TIOCSET_TEMPT): Likewise.
	(TIOCM_LE, TIOCM_DTR, TIOCM_RTS, TIOCM_ST, TIOCM_SR, TIOCM_CTS,
	TIOCM_CAR, TIOCM_RNG, TIOCM_DSR, TIOCM_CD, TIOCM_RI): Remove as
	these are already provided in bits/ioctl-types.h
2014-05-17 11:11:53 -07:00
Roland McGrath f75616b2b1 Fix __waitpid_nocancel link error. 2014-05-16 15:45:58 -07:00
Adhemerval Zanella 026b0fe4e7 PowerPC: clean BSD Terminal Modes expectation in termios.h
This patch guard the BSD definition for terminal modes in PowerPC
specific header fixing the following conformance failures:

FAIL: conform/POSIX/termios.h/conform
FAIL: conform/POSIX2008/termios.h/conform
FAIL: conform/UNIX98/termios.h/conform
2014-05-16 15:54:30 -05:00
Roland McGrath 3edeca8684 Alpha: Convert fork.c to arch-fork.h 2014-05-16 13:03:08 -07:00
Roland McGrath fe39b021f4 ARM: Convert fork.c to arch-fork.h 2014-05-16 12:51:39 -07:00
Roland McGrath 1d1fc46ed1 Add stub arch-fork.h header. 2014-05-16 11:47:13 -07:00
Roland McGrath def4bcb29d Split arch-fork.h from fork.h 2014-05-16 11:17:41 -07:00
Aurelien Jarno d16e6ec7ca SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)
prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>
2014-05-16 00:07:32 +02:00
Aurelien Jarno d0583c4039 ptsname_r: don't leak uninitialized memory (BZ #16917)
If the fd refers to a terminal device, but not a pty master, the
TIOCGPTN ioctl returns with ENOTTY. This error is not caught, and the
possibly undefined buffer passed to ptsname_r is sent directly to the
stat64 syscall.

Fix this by using a fallback to the old method only if the TIOCGPTN
ioctl fails with EINVAL. This also fix the return value in that specific
case (it return ENOENT without this patch).

Also add tests to the ptsname_r function (and ptsname at the same time).

Note: this is Debian bug#741482, reported by Jakub Wilk <jwilk@debian.org>
2014-05-16 00:07:29 +02:00
Roland McGrath a5d87b3db4 x86: Move abilist files out of nptl/ subdirectories. 2014-05-14 15:45:23 -07:00