Commit Graph

4509 Commits

Author SHA1 Message Date
Adhemerval Zanella
d3573f61ac Fix wordsize-32 mmap offset for negative value (BZ#18877)
This patch fixes the default wordsize-32 mmap implementation offset
calculation for negative values.  Current code uses signed shift
operation to calculate the multiple size to use with syscall and
it is implementation defined.  Change it to use a division base
on mmap page size (default being as before, 4096).

Tested on armv7hf.

	[BZ #18877]
	* posix/Makefile (tests): Add tst-mmap-offset.
	* posix/tst-mmap.c: New file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c (__mmap): Fix
	offset calculation for negative values.
2015-08-28 10:42:07 -03:00
Paul E. Murphy
6eb901de9b powerpc: Revert to default atomic ops in elision code
Power ISA 2.07B section B.5.5 relaxed the barrier requirement around a
TLE enabled lock.  It is now identical to a traditional lock.

2015-08-26  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>

	* sysdeps/unix/sysv/linux/powerpc/elision-lock.c
	(__arch_compare_and_exchange_val_32_acq): Remove and use common
	definition.  ISA 2.07B no longer requires full sync.
2015-08-26 14:55:33 -03:00
Mike Frysinger
a2ab38c9b8 mips: siginfo.h: add SIGSYS details [BZ #18863]
Linux 3.13 added SIGSYS details to siginfo_t; update glibc's copy to
keep in sync with it.
2015-08-26 13:33:54 -04:00
Stefan Liebler
4e28fa8088 S390: Add hwcaps value for vector facility.
The HWCAP_S390_VX flag in hwcap field of auxiliary vector indicates
if the vector facility is available and the kernel is aware of it.
This can be tested with LD_SHOW_AUXV=1 <prog>.
Currently it does not show te, because it was not incremented
by commit "S/390: Add hwcap value for transactional execution.".
Thus _DL_HWCAP_COUNT is incremented by two.

ChangeLog:

	* sysdeps/s390/dl-procinfo.c (_dl_s390_platforms): Add vector flag.
	* sysdeps/s390/dl-procinfo.h: Add vector capability.
	* sysdeps/unix/sysv/linux/s390/bits/hwcap.h (HWCAP_S390_VX): Define.
2015-08-26 10:26:19 +02:00
H.J. Lu
ffee504f79 Don't run tst-getpid2 with LD_BIND_NOW=1
Since _dl_x86_64_save_sse and _dl_x86_64_restore_sse are removed now,
we don't need to run tst-getpid2 with LD_BIND_NOW=1.

	[BZ #11214]
	* sysdeps/unix/sysv/linux/Makefile (tst-getpid2-ENV): Removed.
2015-08-25 11:37:44 -07:00
Rajalakshmi Srinivasaraghavan
f4491417cc Call direct system calls for socket operations
Explicit system calls for the socket operations were added in Linux kernel
in commit 86250b9d12ca for powerpc. This patch make use of those instead of
calling socketcall to save number of cycles on networking syscalls.

2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>

	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h: Define new macros.
	* sysdeps/unix/sysv/linux/accept.c: Call direct system call.
	* sysdeps/unix/sysv/linux/bind.c: Call direct system call.
	* sysdeps/unix/sysv/linux/connect.c: Call direct system call.
	* sysdeps/unix/sysv/linux/getpeername.c: Call direct system call.
	* sysdeps/unix/sysv/linux/getsockname.c: Call direct system call.
	* sysdeps/unix/sysv/linux/getsockopt.c: Call direct system call.
	* sysdeps/unix/sysv/linux/listen.c: Call direct system call.
	* sysdeps/unix/sysv/linux/recv.c: Call direct system call.
	* sysdeps/unix/sysv/linux/recvfrom.c: Call direct system call.
	* sysdeps/unix/sysv/linux/recvmsg.c: Call direct system call.
	* sysdeps/unix/sysv/linux/send.c: Call direct system call.
	* sysdeps/unix/sysv/linux/sendmsg.c: Call direct system call.
	* sysdeps/unix/sysv/linux/sendto.c: Call direct system call.
	* sysdeps/unix/sysv/linux/setsockopt.c: Call direct system call.
	* sysdeps/unix/sysv/linux/shutdown.c: Call direct system call.
	* sysdeps/unix/sysv/linux/socket.c: Call direct system call.
	* sysdeps/unix/sysv/linux/socketpair.c: Call direct system call.
2015-08-25 13:45:56 -03:00
Paul E. Murphy
18173559a2 powerpc: Fix tabort usage in syscalls
Fix usage of tabort in generated syscalls.  r0 has special meaning
when used with this instruction, thus it will not generate
persistent errors, nor return an error code.  This mitigates poor
CPU usage when performing elided critical sections.

Additionally, transactions should be aborted when entering a user
invoked syscall.  Otherwise the results of the transaction may be
undefined.

2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>

	* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
	register other than r0 for tabort, it has special meaning.
	* sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION): Likewise
	* sysdeps/unix.sysv/linux/powerpc/syscall.S (syscall): Abort
	transaction before starting syscall.
2015-08-25 13:45:56 -03:00
Andreas Schwab
be481652f2 Remove __ASSUME_IPC64
PowerPC has always used __IPC_64 like most other architectures, which
means that __ASSUME_IPC64 can be always true.  Also, all other
architecture implementations that use the ipc syscall are effectively
identical to the generic version and can be removed.
2015-08-24 10:53:49 +02:00
H.J. Lu
e5dee2c896 Revert "Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN"
This reverts commit 0c5b8b5941.
2015-08-21 09:57:15 -07:00
H.J. Lu
8c7c251746 Revert "Fix a typo in linux lxstat.c"
This reverts commit e4ad5e722c.
2015-08-21 09:57:02 -07:00
H.J. Lu
e4ad5e722c Fix a typo in linux lxstat.c
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Fix a typo.
2015-08-21 08:32:36 -07:00
H.J. Lu
0c5b8b5941 Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN
For ia32 PIC, the first thing of many syscalls does is to call
__x86.get_pc_thunk.reg to load PC into reg in case there is an error,
which is required for setting errno.  In most cases, there are no
errors.  But we still call __x86.get_pc_thunk.reg.  This patch adds
INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN so that i386
can optimize setting errno by branching to the internal __syscall_error
without PLT.

INLINE_SYSCALL_ERROR_RETURN is designed to take the negative error
number returned from the majority of Linux kernels for which negating
is a no-op with INTERNAL_SYSCALL_ERRNO.

With i386 INLINE_SYSCALL_RETURN, INLINE_SYSCALL_ERROR_RETURN and
i386 syscall inlining optimization for GCC 5, for
sysdeps/unix/sysv/linux/fchmodat.c with -O2 -march=i686
-mtune=generic, GCC 5.2 now generates:

<fchmodat>:
   0:	push   %ebx
   1:	mov    0x14(%esp),%eax
   5:	mov    0x8(%esp),%ebx
   9:	mov    0xc(%esp),%ecx
   d:	mov    0x10(%esp),%edx
  11:	test   $0xfffffeff,%eax
  16:	jne    38 <fchmodat+0x38>
  18:	test   $0x1,%ah
  1b:	jne    48 <fchmodat+0x48>
  1d:	mov    $0x132,%eax
  22:	call   *%gs:0x10
  29:	cmp    $0xfffff000,%eax
  2e:	ja     58 <fchmodat+0x58>
  30:	pop    %ebx
  31:	ret
  32:	lea    0x0(%esi),%esi
  38:	pop    %ebx
  39:	mov    $0xffffffea,%eax
  3e:	jmp    3f <fchmodat+0x3f>	3f: R_386_PC32	__syscall_error
  43:	nop
  44:	lea    0x0(%esi,%eiz,1),%esi
  48:	pop    %ebx
  49:	mov    $0xffffffa1,%eax
  4e:	jmp    4f <fchmodat+0x4f>	4f: R_386_PC32	__syscall_error
  53:	nop
  54:	lea    0x0(%esi,%eiz,1),%esi
  58:	pop    %ebx
  59:	jmp    5a <fchmodat+0x5a>	5a: R_386_PC32	__syscall_error

instead of

<fchmodat>:
   0:	sub    $0x8,%esp
   3:	mov    0x18(%esp),%eax
   7:	mov    %ebx,(%esp)
   a:	call   b <fchmodat+0xb>	b: R_386_PC32	__x86.get_pc_thunk.bx
   f:	add    $0x2,%ebx	11: R_386_GOTPC	_GLOBAL_OFFSET_TABLE_
  15:	mov    %edi,0x4(%esp)
  19:	test   $0xfffffeff,%eax
  1e:	jne    70 <fchmodat+0x70>
  20:	test   $0x1,%ah
  23:	jne    88 <fchmodat+0x88>
  25:	mov    0x14(%esp),%edx
  29:	mov    0x10(%esp),%ecx
  2d:	mov    0xc(%esp),%edi
  31:	xchg   %ebx,%edi
  33:	mov    $0x132,%eax
  38:	call   *%gs:0x10
  3f:	xchg   %edi,%ebx
  41:	cmp    $0xfffff000,%eax
  46:	ja     58 <fchmodat+0x58>
  48:	mov    (%esp),%ebx
  4b:	mov    0x4(%esp),%edi
  4f:	add    $0x8,%esp
  52:	ret
  53:	nop
  54:	lea    0x0(%esi,%eiz,1),%esi
  58:	mov    0x0(%ebx),%edx	5a: R_386_TLS_GOTIE	__libc_errno
  5e:	neg    %eax
  60:	mov    %eax,%gs:(%edx)
  63:	mov    $0xffffffff,%eax
  68:	jmp    48 <fchmodat+0x48>
  6a:	lea    0x0(%esi),%esi
  70:	mov    0x0(%ebx),%eax	72: R_386_TLS_GOTIE	__libc_errno
  76:	movl   $0x16,%gs:(%eax)
  7d:	mov    $0xffffffff,%eax
  82:	jmp    48 <fchmodat+0x48>
  84:	lea    0x0(%esi,%eiz,1),%esi
  88:	mov    0x0(%ebx),%eax	8a: R_386_TLS_GOTIE	__libc_errno
  8e:	movl   $0x5f,%gs:(%eax)
  95:	mov    $0xffffffff,%eax
  9a:	jmp    48 <fchmodat+0x48>

	* sysdeps/unix/sysdep.h (INLINE_SYSCALL_RETURN): New.
	(INLINE_SYSCALL_ERROR_RETURN): Likewise.
	* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Use
	INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN.
	* sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue):
	Likewise.
	* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
	* sysdeps/unix/sysv/linux/eventfd.c (eventfd): Likewise.
	* sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
	* sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
	* sysdeps/unix/sysv/linux/fcntl.c (do_fcntl): Likewise.
	* sysdeps/unix/sysv/linux/fstatfs64.c (__fstatfs64): Likewise.
	* sysdeps/unix/sysv/linux/ftruncate64.c (__ftruncate64): Likewise.
	* sysdeps/unix/sysv/linux/futimens.c (futimens): Likewise.
	* sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise.
	* sysdeps/unix/sysv/linux/futimesat.c (futimesat): Likewise.
	* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c (___fxstat64): Likewise.
	* sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
	* sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
	* sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue):
	Likewise.
	* sysdeps/unix/sysv/linux/getpriority.c (__getpriority): Likewise.
	* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Likewise.
	* sysdeps/unix/sysv/linux/llseek.c (__llseek): Likewise.
	* sysdeps/unix/sysv/linux/lutimes.c (lutimes): Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise.
	* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Likewise.
	* sysdeps/unix/sysv/linux/mq_close.c (mq_close): Likewise.
	* sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Likewise.
	* sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise.
	* sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise.
	* sysdeps/unix/sysv/linux/prlimit.c (prlimit): Likewise.
	* sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise.
	* sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
	* sysdeps/unix/sysv/linux/readahead.c (__readahead): Likewise.
	* sysdeps/unix/sysv/linux/reboot.c (reboot): Likewise.
	* sysdeps/unix/sysv/linux/semget.c (semget): Likewise.
	* sysdeps/unix/sysv/linux/semop.c (semop): Likewise.
	* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise.
	* sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise.
	* sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise.
	* sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c ( __sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise.
	* sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Likewise.
	* sysdeps/unix/sysv/linux/statfs64.c (__statfs64): Likewise.
	* sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise.
	* sysdeps/unix/sysv/linux/tcsendbrk.c (tcsendbreak): Likewise.
	* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun):
	Likewise.
	* sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime):
	Likewise.
	* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime):
	Likewise.
	* sysdeps/unix/sysv/linux/truncate64.c (truncate64): Likewise.
	* sysdeps/unix/sysv/linux/ustat.c (ustat): Likewise.
	* sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise.
	* sysdeps/unix/sysv/linux/utimes.c (__utimes): Likewise.
	* sysdeps/unix/sysv/linux/xmknod.c (__xmknod): Likewise.
	* sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise.
	* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c (___xstat64): Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Likewise.
	(__xstat64_conv): Likewise.
	(__xstat32_conv): Likewise.
	* sysdeps/unix/sysv/linux/sched_getaffinity.c
	(__sched_getaffinity_new): Add libc_hidden_proto and
	libc_hidden_def.  Use INLINE_SYSCALL_ERROR_RETURN.
2015-08-21 04:46:53 -07:00
H.J. Lu
1ae6c72dc1 Move x86_64 init-arch.h to sysdeps/x86/init-arch.h
Move sysdeps/x86_64/multiarch/init-arch.h to sysdeps/x86/init-arch.h
which can be used for both i386 and x86_64.

	* sysdeps/i386/i686/multiarch/init-arch.h: Removed.
	* sysdeps/unix/sysv/linux/x86/init-arch.h: Likewise.
	* sysdeps/x86_64/cacheinfo.c: Include <init-arch.h> instead
	of "multiarch/init-arch.h".
	* sysdeps/x86_64/multiarch/init-arch.h: Renamed to ...
	* sysdeps/x86/init-arch.h: This.
2015-08-20 04:29:23 -07:00
H.J. Lu
a452ef24d5 Remove x86 init-arch.c
Both files include sysdeps/x86_64/multiarch/init-arch.c which has been
removed.

	* sysdeps/i386/i686/multiarch/init-arch.c: Removed.
	* sysdeps/unix/sysv/linux/x86/init-arch.c: Likewise.
2015-08-20 04:19:59 -07:00
H.J. Lu
33c898d160 Mark __xstatXX_conv as hidden
__xstat_conv, __xstat64_conv and __xstat32_conv are internal to glibc.
They should be marked as hidden so that they can't be called without
PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/xstatconv.h (__xstat_conv): Add
	attribute_hidden.
	(__xstat64_conv): Likewise.
	(__xstat32_conv): Likewise.
2015-08-19 04:41:06 -07:00
H.J. Lu
7e58ab243d Call __setcontext with HIDDEN_JUMPTARGET
i386 __makecontext should call __setcontext with HIDDEN_JUMPTARGET.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/makecontext.S (__makecontext):
	Don't load %ebx when calling __setcontext.  Call __setcontext
	with HIDDEN_JUMPTARGET.
	* sysdeps/unix/sysv/linux/i386/setcontext.S (__setcontext): Add
	libc_hidden_def.
2015-08-19 04:41:01 -07:00
H.J. Lu
3552daa7ac Use x86-64 cacheinfo.c and sysconf.c for x86
Since _dl_x86_cpu_features is always available, we can use x86-64
cacheinfo.c and sysconf.c for both i386 and x86-64.

	* sysdeps/i386/i686/Makefile
	[$(subdir) == string] (sysdep_routines): Moved to ...
	* sysdeps/i386/Makefile: Here.
	* sysdeps/i386/i686/cacheinfo.c: Moved to ...
	* sysdeps/i386/cacheinfo.c: Here.
	* sysdeps/unix/sysv/linux/i386/sysconf.c: Removed.
	* sysdeps/unix/sysv/linux/i386/i686/sysconf.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysconf.c: Moved to ...
	* sysdeps/unix/sysv/linux/x86/sysconf.c: Here.
2015-08-19 04:27:04 -07:00
Mike Frysinger
352d0eafb6 hppa: timerfd.h: move to common sys/timerfd.h
Use the common sys/timerfd.h to avoid duplication and move the
arch-specific settings into bits/timerfd.h.
2015-08-18 02:37:16 -04:00
Mike Frysinger
55b14dda43 hppa: signalfd.h: move to common sys/signalfd.h
Use the common sys/signalfd.h to avoid duplication and move the
arch-specific settings into bits/signalfd.h.
2015-08-18 02:37:15 -04:00
Mike Frysinger
605021b6b9 hppa: inotify.h: move to common sys/inotify.h
Use the common sys/inotify.h to avoid duplication and move the
arch-specific settings into bits/inotify.h.
2015-08-18 02:37:15 -04:00
Mike Frysinger
4454e161cb hppa: eventfd.h: move to common sys/eventfd.h
Use the common sys/eventfd.h to avoid duplication and move the
arch-specific settings into bits/eventfd.h.
2015-08-18 02:37:14 -04:00
Mike Frysinger
44e01f06a0 hppa: epoll.h: move to common sys/epoll.h
Use the common sys/epoll.h to avoid duplication and move the arch-specific
settings into bits/epoll.h.
2015-08-18 02:37:13 -04:00
Mike Frysinger
d5a77fcafd hppa: sigaction.h: update define export based on __USE_XOPEN2K8
This brings hppa in line with other ports by exporting a few more defines
based on the __USE_XOPEN2K8 define and not just __USE_MISC.
2015-08-18 02:37:04 -04:00
Mike Frysinger
c5bf7f84bf hppa: shm.h: add SHM_EXEC
This brings hppa in line with all the other arches.
2015-08-18 02:36:55 -04:00
Mike Frysinger
8584204806 hppa: drop __ASSUME_LWS_CAS define
We require recent enough kernels for this now, and we've been hardcoding
it to 1, so drop it entirely now.
2015-08-18 02:36:43 -04:00
Andreas Schwab
1e15a853ed Add version set GLIBC_2.19 for linux/powerpc 2015-08-17 16:21:51 +02:00
H.J. Lu
e54388bd8b Don't include <cpuid.h> in elision-conf.h
Don't include the unused <cpuid.h> in Linux/x86 elision-conf.h.

	* sysdeps/unix/sysv/linux/x86/elision-conf.h: Don't include
	<cpuid.h>.
2015-08-13 03:46:26 -07:00
H.J. Lu
b376899d27 Update x86 elision-conf.c for <cpu-features.h>
This patch updates x86 elision-conf.c to use the newly defined
HAS_CPU_FEATURE from <cpu-features.h>.

	* sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
	Replace HAS_RTM with HAS_CPU_FEATURE (RTM).
2015-08-13 03:41:59 -07:00
H.J. Lu
e2e4f56056 Add _dl_x86_cpu_features to rtld_global
This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
and initializes it early before __libc_start_main is called so that
cpu_features is always available when it is used and we can avoid
calling __init_cpu_features in IFUNC selectors.

	* sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
	(dl_platform_init): Call init_cpu_features.
	* sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
	* sysdeps/i386/i686/cacheinfo.c
	(DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
	* sysdeps/i386/i686/multiarch/Makefile (aux): Remove init-arch.
	* sysdeps/i386/i686/multiarch/Versions: Removed.
	* sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
	Removed.
	* sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
	* sysdeps/unix/sysv/linux/x86/Makefile
	(libpthread-sysdep_routines): Remove init-arch.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
	<sysdeps/x86_64/dl-procinfo.c> instead of
	sysdeps/generic/dl-procinfo.c>.
	* sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
	Add cpu-features-offsets.sym and rtld-global-offsets.sym.
	[$(subdir) == elf] (sysdep-dl-routines): Add dl-get-cpu-features.
	[$(subdir) == elf] (tests): Add tst-get-cpu-features.
	[$(subdir) == elf] (tests-static): Add
	tst-get-cpu-features-static.
	* sysdeps/x86/Versions: New file.
	* sysdeps/x86/cpu-features-offsets.sym: Likewise.
	* sysdeps/x86/cpu-features.c: Likewise.
	* sysdeps/x86/cpu-features.h: Likewise.
	* sysdeps/x86/dl-get-cpu-features.c: Likewise.
	* sysdeps/x86/libc-start.c: Likewise.
	* sysdeps/x86/rtld-global-offsets.sym: Likewise.
	* sysdeps/x86/tst-get-cpu-features-static.c: Likewise.
	* sysdeps/x86/tst-get-cpu-features.c: Likewise.
	* sysdeps/x86_64/dl-procinfo.c: Likewise.
	* sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
	Assume USE_MULTIARCH is defined and don't check it.
	(is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
	(is_amd): Likewise.
	(max_cpuid): Likewise.
	(intel_check_word): Likewise.
	(__cache_sysconf): Don't call __init_cpu_features.
	(__x86_preferred_memory_instruction): Removed.
	(init_cacheinfo): Don't call __init_cpu_features. Replace
	__cpu_features with GLRO(dl_x86_cpu_features).
	* sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
	(dl_platform_init): Call init_cpu_features.
	* sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
	* sysdeps/x86_64/multiarch/Makefile (aux): Remove init-arch.
	* sysdeps/x86_64/multiarch/Versions: Removed.
	* sysdeps/x86_64/multiarch/cacheinfo.c: Likewise.
	* sysdeps/x86_64/multiarch/init-arch.c: Likewise.
	* sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
	Removed.
	* sysdeps/x86_64/multiarch/init-arch.h: Rewrite.
2015-08-13 03:41:22 -07:00
Andreas Schwab
dc8a7ff24d Remove unused definition of __openat(64)_nocancel 2015-08-11 09:37:38 +02:00
Andreas Schwab
eb32b0d403 Readd O_LARGEFILE flag for openat64 (bug 18781) 2015-08-10 18:10:19 +02:00
Mike Frysinger
ef086ef8ba hppa: put custom madvise defines behind __USE_MISC
No other arch exports these defines, and having them in the default
namespace causes conformance header tests to fail.  Put them behind
the __USE_MISC define as that is what other arches seem to use.
2015-08-08 23:46:44 -04:00
John David Anglin
04ece7d2de hppa: Fix miscompilation of sched_setaffinity() [BZ #18480]
The attached change fixes the miscompilation of sched_setaffinity() on
hppa.  This is an old problem that was fixed on other architectures using
a similar approach to the attached change.  See:
https://sourceware.org/ml/libc-hacker/2004-04/msg00016.html

Build tested on trunk.  Patch has been applied to debian glibc for some time.
2015-08-08 22:56:01 -04:00
John David Anglin
74bc0c3a16 hppa: Fix reload error with atomic code [BZ #18787]
As noted in the bug, the asm operands need to be copied to register
variables to avoid operand reloads in the principal asm of the macro.
See the arm implementation for reference.  Otherwise we get:
../sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
	can't find a register in class 'R1_REGS' while reloading 'asm'

Build tested on trunk with gcc-4.8.  Similar patch has been tested
with 2.19 on Debian hppa-unknown-linux-gnu.
2015-08-08 01:11:44 -04:00
Mike Frysinger
5d5de49c3c microblaze: include unix/sysdep.h
The semi-recent SYSCALL_CANCEL inclusion broke microblaze due to the
sysdep.h header not including the unix/sysdep.h header.  Include it
here like all other ports.
2015-08-07 23:39:42 -04:00
Andreas Schwab
bb1d31d06e Properly terminate FDE in makecontext for m68k (bug 18635) 2015-08-05 23:35:28 +02:00
H.J. Lu
b4425b95ad Align stack to 16 bytes when calling __gettimeofday
Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
to 16 bytes when calling __gettimeofday.

	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
	(__lll_timedwait_tid): Align stack to 16 bytes when calling
	__gettimeofday.
2015-08-05 08:36:18 -07:00
H.J. Lu
8e1f346462 Align stack to 16 bytes when calling __setcontext
Don't use pop to restore %rdi so that stack is aligned to 16 bytes
when calling __setcontext.

	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/__start_context.S
	(__start_context): Don't use pop to restore %rdi so that stack
	is aligned to 16 bytes when calling __setcontext.
2015-08-05 08:36:12 -07:00
Adhemerval Zanella
2aa6c8af26 arm: Assembly implementation cleanup
This patch removes arm assembly implementation of mmap and mmap64.
The new implementation used is the wordsize-32 generic linux one.

Tested on armhf.
2015-08-05 10:41:03 -03:00
Mike Frysinger
182d6096fe mmap64: fix undef warnings
The only target that defines this is m68k, so move the existing fallback
define up to avoid warnings on other systems.
2015-08-05 04:38:56 -04:00
Andreas Schwab
bbab82c25d Properly terminate FDE in makecontext for ix86 (bug 18635) 2015-08-04 17:46:56 +02:00
Torvald Riegel
87ab9d55f7 hppa: Remove custom lowlevellock.h.
This untested patch removes the custom lowlevellock.h on hppa.  It seems
to contain an implementation equivalent to the generic lowlevellock.h.
2015-07-30 03:37:27 -04:00
Mike Frysinger
827e01851f hppa: sigaction.h: change sa_flags to an int
This fixes the conform test for the sigaction.h header and makes it match
all the other arches.
2015-07-29 23:14:03 -04:00
Mike Frysinger
979900af98 hppa: fix sysdep.h header setup
The semi-recent SYSCALL_CANCEL inclusion broke hppa due to the sysdep.h
headers not including the unix/sysdep.h headers.  Rework the includes so
we match the other ports:
* hppa/sysdep.h:
	- Do not include sys/syscall.h as the unix sysdep.h headers do it.
	- Do not include config.h as libc-symbols.h does it, and it has no
	#ifdef multiple-include protection, and it breaks when some files
	do things like #undef __OPTIMIZE__.
* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h:
	- Drop the generic/sysdep.h as the unix sysdep.h headers include it.
* sysdeps/unix/sysv/linux/hppa/sysdep.h:
	- Change to the unix & core hppa sysdep header stacks.
	- Undef a few defines that the core headers already set up for us.
2015-07-29 23:09:16 -04:00
Mike Frysinger
a822b0187a hppa: rewrite INLINE_SYSCALL
The semi-recent SYSCALL_CANCEL macro imposes a slight nuance on the
implementation of INLINE_SYSCALL: the nr argument cannot be expanded
directly but must be passed on to another macro which may expand it.
Most arches don't notice because INLINE_SYSCALL is defined in terms
of INTERNAL_SYSCALL which has the additional layer of expansion, but
on hppa, it was attempting to expand it directly.  That causes build
errors like so:
../sysdeps/unix/sysv/linux/sigsuspend.c: In function '__sigsuspend':
../sysdeps/unix/sysv/linux/sigsuspend.c:31:62: error:
	implicit declaration of function 'LOAD_ARGS___SYSCALL_NARGS'
../sysdeps/unix/sysv/linux/sigsuspend.c:31:304: error:
	called object 'LOAD_ARGS___SYSCALL_NARGS(set, 8)' is not a function

So rewrite hppa's INLINE_SYSCALL to use INTERNAL_SYSCALL like other
arches do.  This is also a nice clean up as the two macros had quite
a bit of duplicated logic.
2015-07-29 23:08:15 -04:00
H.J. Lu
9637d8a253 Extend local PLT reference check
On x86, linker in binutils 2.26 and newer consolidates R_*_JUMP_SLOT with
R_*_GLOB_DAT relocation against the same symbol.  This patch extends
local PLT reference check to support alternate relocations.

	[BZ #18078]
	* scripts/check-localplt.awk: Support alternate relocations.
	* scripts/localplt.awk: Also check relocations in DT_RELA/DT_REL
	sections.
	* sysdeps/unix/sysv/linux/i386/localplt.data: Mark free and
	malloc entries with + REL R_386_GLOB_DAT.
	* sysdeps/x86_64/localplt.data: New file.
2015-07-29 11:58:06 -07:00
Mike Frysinger
95d8f022bf ia64: drop __tls_get_addr from expected ld.so plt usage
This file was updated with an educated guess as to the symbols needed,
but on ia64, we don't have __tls_get_addr calls, so drop it from the
list.
2015-07-28 05:30:14 -04:00
Mike Frysinger
18855eca32 ia64: clean up old kernel headers cruft
This define made more sense in the pre-sanitized kernel headers days,
but since we require kernel versions that are sanitized, we don't need
this hack anymore.
2015-07-28 02:29:30 -04:00
Chung-Lin Tang
3f96834346 Fix order of arguments to rt_sigprocmask syscall when setting the signal mask
in setcontext/swapcontext.
2015-07-24 23:19:50 -07:00
Roland McGrath
b301e68e4b Make sysdeps/posix bring in login subdir. 2015-07-23 17:04:22 -07:00