| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes the way cancellation entrypoints are defined to
instead call the macro SYSCALL_CANCEL. An usual cnacellation definition
is defined as:
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (syscall, NARGS, args...)
int oldtype = LIBC_CANCEL_ASYNC ();
return INLINE_SYSCALL (syscall, NARGS, args...)
LIBC_CANCEL_RESET (oldtype);
And it is rewrited as just:
SYSCALL_CANCEL (syscall, args...)
The idea is to remove LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET explicit
usage.
Tested on i386, x86_64, powerpc32, powerpc64le, arm, and aarch64.
* sysdeps/unix/sysdep.h [SYSCALL_CANCEL]: New macro: define
cancellable syscalls.
(SYS_ify): Add guard to no redefine it.
(INLINE_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/accept4.c (accept4): Remove
LIBC_CANCEL_ASYNC/INLINE_SYSCALL/LIBC_CANCEL_RESET and use
SYSCALL_CANCEL instead.
* sysdeps/unix/sysv/linux/alpha/fdatasync.c (__fdatasync): Likewise.
* sysdeps/unix/sysv/linux/arm/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/arm/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/arm/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/arm/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/epoll_pwait.c (epoll_pwait): Likewise.
* sysdeps/unix/sysv/linux/fallocate.c (fallocate): Likewise.
* sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Likewise.
* sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise.
* sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/generic/pause.c (__libc_pause): Likewise.
* sysdeps/unix/sysv/linux/generic/poll.c (__poll): Likewise.
* sysdeps/unix/sysv/linux/generic/recv.c (__libc_recv): Likewise.
* sysdeps/unix/sysv/linux/generic/select.c (__select): Likewise.
* sysdeps/unix/sysv/linux/generic/send.c (__libc_send): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
(__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
(__libc_preadv): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
(__libc_readv64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
(__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
(__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c
(__libc_pwritev): Likewise.
* sysdeps/sysv/linux/generic/wordsize-32/pwritev64.c
(__libc_pwritev64): Likewise.
* sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl): Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
(sync_file_range): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c (fallocate):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c (fallocate64):
Likewise.
* sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/msgrcv.c (__libc_msgrcv): Likewise.
* sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Likewise.
* sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/openat.c (__libc_openat): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
(__libc_read64): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c (__libc_write):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c (__libc_write64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c (__libc_fcntl):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
(__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c (__libc_pwrite):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
(__libc_pwrite64): Likewise.
* sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c
(sync_file_range): Likewise.
* sysdeps/unix/sysv/linux/ppoll.c (ppoll): Likewise.
* sysdeps/unix/sysv/linux/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/preadv.c (__libc_preadv): Likewise.
* sysdeps/unix/sysv/linux/pselect.c (__pselect): Likewise.
* sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/pwritev.c (PWRITEV): Likewise.
* sysdeps/unix/sysv/linux/readv.c (__libc_readv): Likewise.
* sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Likewise.
* sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise.
* sysdeps/unix/sysv/linux/sh/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/sh/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Likewise.
* sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c (__libc_msgrcv):
Likewise.
* sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
Likewise.
* sysdeps/unix/sysv/linux/tcdrain.c (__libc_tcdrain): Likewise.
* sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
Likewise.
* sysdeps/unix/sysv/linux/wait.c (__libc_wait): Likewise.
* sysdeps/unix/sysv/linux/waitid.c (__waitid): Likewise.
* sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c (fallocate):
Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/preadv.c (preadv): Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/pwritev.c (pwritev): Likewise.
* sysdeps/unix/sysv/linux/writev.c (__libc_writev): Likewise.
* sysdeps/unix/sysv/linux/x86_64/recv.c (__libc_recv): Likewise.
* sysdeps/unix/sysv/linux/x86_64/send.c (__libc_send): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Beginning with the upcoming 4.1 release, Linux on a subset of 32-bit
ARM hardware will provide fast user-space implementations of the
following system calls:
- gettimeofday
- clock_gettime
The kernel implementation depends on the ARMv7 Generic Timers
Extension to accelerate these system calls. So CPUs such as
Cortex-A15 and -A7 benefit, while Cortex-A9, -A8, and pre-v7 CPUs do
not. On systems where the VDSO does not provide any speedup, the
kernel prevents the relevant symbol lookups from succeeding.
On OMAP5 (Cortex-A15) gettimeofday latency decreases from ~350ns to
~120ns. On BeagleBone Black (Cortex-A8) it goes from ~650ns to
~660ns, which to my mind is an acceptable cost.
Verified that no new test failures are introduced on kernels with and
without the VDSO.
* sysdeps/unix/sysv/linux/arm/Makefile: (sysdep_routines):
Include dl-vdso.
* sysdeps/unix/sysv/linux/arm/init-first.c: New file:
Use VDSO routines for gettimeofday, clock_gettime if
available.
* sysdeps/unix/sysv/linux/arm/libc-vdso.h: New file:
Declare VDSO symbols.
* sysdeps/unix/sysv/linux/arm/sysdep.h:
[HAVE_GETTIMEOFDAY_VSYSCALL]: Define.
[HAVE_CLOCK_GETTIME_VSYSCALL]: Define.
* sysdeps/unix/sysv/linux/arm/Versions: Add
__vdso_clock_gettime.
|
|
|
|
|
|
| |
This patch uses inline calls (through INLINE_SYSCALL macro) to define
the non-cancellable functions macros to avoid use of the
syscall_nocancel entrypoint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Carlos noted in
<https://sourceware.org/ml/libc-alpha/2015-05/msg00680.html> that
various ports use potentially problematic short variables names in
their syscall macros, which could shadow variables with the same name
from containing scopes.
This patch fixes variables called err and ret in MIPS macros. (I left
result_var and _sys_result - separate variables in different macros,
which need separate names - alone.)
Tested for mips64 (all three ABIs) that installed stripped shared
libraries are unchanged by this patch.
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (INLINE_SYSCALL):
Use variable name _sc_err instead of err.
[__mips16] (INTERNAL_SYSCALL_NCS): Use variable name _sc_ret
instead of ret.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
(INLINE_SYSCALL): Use variable name _sc_err instead of err.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
(INLINE_SYSCALL): Likewise.
|
|
|
|
|
| |
This patch removes the x86 specific timespec_get and clock_gettime
implementation to use generic HAVE_CLOCK_GETTIME_VSYSCALL way.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The attached patch fixes a glibc build failure with gcc 5 on powerpc64le
caused by a recent change in gcc where the compiler defines the
_ARCH_PWR6 macro when processing assembly files but doesn't invoke the
assembler in the corresponding machine mode (unless it has been
explicitly configured to target POWER 6 or later). A bug had been filed
with gcc for this (65341) but was closed as won't fix. Glibc relies on
the _ARCH_PWR6 macro in a few .S files to make use of Power ISA 2.5
instructions (specifically, the four-argument form of the mtfsf insn).
A similar problem had occurred in the past (bug 10118) but the fix that
was committed for it didn't anticipate this new problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At issue for INLINE_SYSCALL was that it used "err" and "val"
as variable names in a #define, so that if it was used in a context
where the "caller" was also using "err" or "val", and those
variables were passed in to INLINE_SYSCALL, we would end up
referencing the internal shadowed variables instead.
For example, "char val" in check_may_shrink_heap() in
sysdeps/unix/sysv/linux/malloc-sysdep.h was being shadowed by
the syscall return "val" in INLINE_SYSCALL, causing the "char val"
not to get updated at all, and may_shrink_heap ended up always false.
A similar fix was made to INTERNAL_VSYSCALL_CALL.
|
| |
|
|
|
|
|
|
|
|
| |
This patch removes the architecture specific gettimeofday implementation
to use the vDSO symbol and consolidate it on a common Linux one.
Similar to clock_gettime and clock_getres vDSO implementation, each port
that supports gettimeofday through vDSO should just implement INLINE_VSYSCALL
to access the symbol and define HAVE_{GETTIME,GETRES}_VSYSCAL as 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On 21/05/15 05:29, Siddhesh Poyarekar wrote:
> On Wed, May 20, 2015 at 06:55:02PM +0100, Szabolcs Nagy wrote:
>> i guess it's ok for consistency if i fix struct stat64
>> too to use __USE_XOPEN2K8.
>>
>> i will run some tests and come back with a patch
>
> I also think it would be appropriate to change this code in other
> architectures (microblaze and nacl IIRC) to make all of them
> consistent. It is a mechanical enough change IMO that all arch
> maintainer acks is not necessary.
>
here is the patch with consistent __USE_XOPEN2K8
ok to commit?
2015-05-21 Szabolcs Nagy <szabolcs.nagy@arm.com>
[BZ #18234]
* conform/data/sys/stat.h-data (struct stat): Add tests for st_atim,
st_mtim and st_ctim members.
* sysdeps/nacl/bits/stat.h (struct stat, struct stat64): Make
st_atim, st_ctim, st_mtim visible under __USE_XOPEN2K8 only.
* sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat,):
(struct stat64): Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat,):
(struct stat64): Likewise.
* sysdeps/unix/sysv/linux/microblaze/bits/stat.h (struct stat,):
(struct stat64): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch consolidate the Linux vDSO define and usage across all ports
that uses it. The common vDSO definitions and calling through
{INLINE/INTERNAL}_VSYSCALL macros are moved to a common header
sysdep-vdso.h and vDSO name declaration and prototype is defined
using a common macro.
Also PTR_{MANGLE,DEMANGLE} is added to ports that does not use them
for vDSO calls (aarch64, powerpc, s390, and tile) and thus it will
reflect in code changes. For ports that already implement pointer
mangling/demangling in vDSO system (i386, x32, x86_64) this patch
is mainly a code refactor.
Checked on x32, x86_64, x32, ppc64le, and aarch64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes the socket.S implementation for all ports and replace
it by a C implementation using socketcall. For ports that implement
the syscall directly, there is no change.
The patch idea is to simplify the socket function implementation that
uses the socketcall to be based on C implemetation instead of a pseudo
assembly implementation with arch specific parts. The patch then remove
the assembly implementatation for the ports which uses socketcall
(i386, microblaze, mips, powerpc, sparc, m68k, s390 and sh).
I have cross-build GLIBC for afore-mentioned ports and tested on both
i386 and ppc32 without regressions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pathconf (sysdeps/unix/sysv/linux/pathconf.c) uses basename. But
pathconf is in POSIX back to 1990 while basename is only reserved with
external linkage in those standards including XPG functions. This
patch fixes this namespace issue in the usual way, renaming basename
to __basename and making it into a weak alias.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).
[BZ #18444]
* string/basename.c (basename): Rename to __basename and define as
weak alias of __basename. Use libc_hidden_weak.
* include/string.h (__basename): Declare. Use libc_hidden_proto.
* sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Call
__basename instead of basename.
* conform/Makefile (test-xfail-POSIX2008/unistd.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
|
| |
|
| |
|
|
|
|
|
|
| |
This patch removes the specialized i386 assembly implementations for
fallocate{64}, pselect, and sync_file_range now that i386 have
support for 6 argument syscalls.
|
|
|
|
|
| |
This patch changes the way make-syscall-sh script uses echo to follow
POSIX spec.
|
| |
|
| |
|
|
|
|
|
| |
[BZ #18409]
* sysdeps/unix/make-syscalls.sh: Remove a trailing `\'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This means we can clean up the generic code a bit. The 64-bit
variant still needs to support !__ASSUME_FALLOCATE for alpha.
|
|
|
|
|
| |
With 6-argument system call support, the generic Linux implementations of
these system calls work, and there is no need for i386-specific versions.
|
|
|
|
|
|
|
|
|
| |
Since glibc is no longer built with -Winline, a special MIPS version
of waitid.c to disable -Winline is no longer needed, and this patch
removes it. Tested that glibc does indeed build with the patch
applied.
* sysdeps/unix/sysv/linux/mips/mips32/waitid.c: Remove file.
|
|
|
|
|
|
| |
* sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Remove
__tls_get_addr.
* sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data: Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support to query cache information on s390
via sysconf() function - e.g. with _SC_LEVEL1_ICACHE_SIZE.
The attributes size, linesize and assoc can be queried
for cache level 1 - 4 via "extract cpu attribute" instruction,
which was first available with z10.
* NEWS: Mention sysconf() cache information support for s390.
* sysdeps/unix/sysv/linux/s390/sysconf.c: New File.
|
|
|
|
|
|
| |
This patch moves the libc-vdso.h internal header from bits folder to
default architecture one and also corrects the remaning includes in
the files.
|
|
|
|
|
| |
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Make use of
lowlevellock-futex.h
|
|
|
|
|
| |
[BZ #17930]
* sysdeps/unix/sysv/linux/mips/bits/shm.h (SHM_NORESERVE): Define.
|
|
|
|
| |
Fixes a -Wundef error wrt RTLD_PRIVATE_ERRNO.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the course of the work on six-argument syscalls I noticed that the
i386 lowlevellock.h contained some unused macro definitions (already
unused before my patch). This patch removes them.
Tested for x86 that installed stripped shared libraries are unchanged
by this patch.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (LLL_EBX_LOAD):
Remove macro.
(LLL_EBX_REG): Likewise.
(LLL_ENTER_KERNEL): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lowlevellock-futex.h (bug 18138).
This patch follows the approach outlined in
<https://sourceware.org/ml/libc-alpha/2015-03/msg00656.html> to
support six-argument syscalls from INTERNAL_SYSCALL for 32-bit x86,
making them call a function __libc_do_syscall that takes the syscall
number and three syscall arguments in the registers in which the
kernel expects them, along with a pointer to a structure containing
the other three arguments.
In turn, this allows the generic lowlevellock-futex.h to be used on
32-bit x86, so supporting lll_futex_timed_wait_bitset (and so allowing
FUTEX_CLOCK_REALTIME to be used in various cases, so fixing bug 18138
for 32-bit x86 and leaving hppa as the only architecture missing
lll_futex_timed_wait_bitset). The change to lowlevellock.h's
definition of SYS_futex is because the generic lowlevelloc-futex.h
ends up bringing in bits/syscall.h which defines SYS_futex to
__NR_futex, so resulting in redefinition errors. The revised
definition in lowlevellock.h is in line with what the x86_64 version
does.
__libc_do_syscall is only needed in libpthread at present (meaning
nothing special needs to be done to make it shared-only in most
libraries containing it, static in libc only, as on ARM).
Tested for 32-bit x86, with the glibc testsuite and with the test in
bug 18138. The failures seen
FAIL: nptl/tst-cleanupx4
FAIL: rt/tst-cpuclock2
are pre-existing.
[BZ #18138]
* sysdeps/unix/sysv/linux/i386/sysdep.h (struct
libc_do_syscall_args): New structure.
(INTERNAL_SYSCALL_MAIN_0): New macro.
(INTERNAL_SYSCALL_MAIN_1): Likewise.
(INTERNAL_SYSCALL_MAIN_2): Likewise.
(INTERNAL_SYSCALL_MAIN_3): Likewise.
(INTERNAL_SYSCALL_MAIN_4): Likewise.
(INTERNAL_SYSCALL_MAIN_5): Likewise.
(INTERNAL_SYSCALL_MAIN_6): Likewise. Call __libc_do_syscall.
(INTERNAL_SYSCALL): Define to use INTERNAL_SYSCALL_MAIN_##nr.
Replace conditional definitions by conditional definitions of ....
(INTERNAL_SYSCALL_MAIN_INLINE): ... this. New macro.
* sysdeps/unix/sysv/linux/i386/libc-do-syscall.S: New file.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = nptl]
(libpthread-sysdep_routines): Add libc-do-syscall.
* sysdeps/unix/sysv/linux/i386/lowlevellock-futex.h: Remove file.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (SYS_futex): Define
to __NR_futex not 240.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is glibc support for a PowerPC TLS optimization, inspired
by Alexandre Oliva's TLS optimization for other processors,
http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
In essence, this optimization uses a zero module id in the tls_index
GOT entry to indicate that a TLS variable is allocated space in the
static TLS area. A special plt call linker stub for __tls_get_addr
checks for such a tls_index and if found, returns the offset
immediately. The linker communicates the fact that the special
__tls_get_addr stub is used by setting a bit in the dynamic tag
DT_PPC64_OPT/DT_PPC_OPT. glibc communicates to the linker that this
optimization is available by the presence of __tls_get_addr_opt.
tst-tlsmod2.so is built with -Wl,--no-tls-get-addr-optimize for
tst-tls-dlinfo, which otherwise would fail since it tests that no
static tls is allocated. The ld option --no-tls-get-addr-optimize has
been available since binutils-2.20 so doesn't need a configure test.
* NEWS: Advertise TLS optimization.
* elf/elf.h (R_PPC_TLSGD, R_PPC_TLSLD, DT_PPC_OPT, PPC_OPT_TLS): Define.
(DT_PPC_NUM): Increment.
* elf/dynamic-link.h (HAVE_STATIC_TLS): Define.
(CHECK_STATIC_TLS): Use here.
* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Optimize
TLS descriptors.
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/powerpc/dl-tls.c: New file.
* sysdeps/powerpc/Versions: Add __tls_get_addr_opt.
* sysdeps/powerpc/tst-tlsopt-powerpc.c: New tls test.
* sysdeps/unix/sysv/linux/powerpc/Makefile: Add new test.
Build tst-tlsmod2.so with --no-tls-get-addr-optimize.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Update.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
|
|
|
|
|
|
|
| |
extend_alloca was used to emulate VLA deallocation. The new version
also handles the res == 0 corner case more explicitly, by returning 0
instead of the (potentially undefined, but usually zero) system call
error.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In bc0cdc498 the configure check for HAVE_ASM_PPC_REL16 was removed
on the grounds that the minimum binutils supports rel16 relocs. This
is true, but not all references to HAVE_ASM_PPC_REL16 in the sources
were removed.
* config.h.in: Remove HAVE_ASM_PPC_REL16.
* sysdeps/powerpc/powerpc32/tls-macros.h: Remove HAVE_ASM_PPC_REL16
and false branch of conditional.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
Likewise.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
With AIX port deprecated there is no need to check/define
HAVE_ASM_GLOBAL_DOT_NAME anymore since the current minimum binutils
supported (2.22) does not emit global symbol with dot.
This patch removes all the HAVE_ASM_GLOBAL_DOT_NAME definition and
checks for powerpc64 port.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__ASSUME_PRLIMIT64 is defined in kernel-features.h for kernels 2.6.36
and later, but hppa, microblaze and sh did not add the prlimit64
syscall until 2.6.37. This patch adds corresponding undefines of
__ASSUME_PRLIMIT64 to those architectures' kernel-features.h files.
(This concludes the kernel-features.h fixes arising out of the review
- limited to macros defined in the architecture-independent
kernel-features.h file - I did in connection with the move to 2.6.32
minimum kernel version. For that subset of macros - I didn't check
any purely architecture-specific macros - I think they are now defined
for the correct kernel versions on each architecture after this
patch.)
[BZ #17779]
* sysdeps/unix/sysv/linux/hppa/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64):
Undefine.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64):
Likewise.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64):
Likewise.
|
| |
|
|
|
|
|
|
|
|
| |
Similarly to what we did for in6_addr, we need a macro
to guard in6_pktinfo and ip6_mtuinfo too.
Cc: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
|
|
|
|
|
| |
ADJ_SETOFFSET is a new adjtimex() mode that can be used to precisely
step the clock. It was introduced in kernel 2.6.39.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both open and openat load their last argument 'mode' lazily, using
va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also
necessary if O_TMPFILE is in oflag.
By chance on x86_64, the problem wasn't evident when using O_TMPFILE
with open, as the 3rd argument of open, even when not loaded with
va_arg, is left untouched in RDX, where the syscall expects it.
However, openat was not so lucky, and O_TMPFILE couldn't be used: mode
is the 4th argument, in RCX, but the syscall expects its 4th argument in
a different register than the glibc wrapper, in R10.
Introduce a macro __OPEN_NEEDS_MODE (oflag) to test if either O_CREAT or
O_TMPFILE is set in oflag.
Tested on Linux x86_64.
[BZ #17523]
* io/fcntl.h (__OPEN_NEEDS_MODE): New macro.
* io/bits/fcntl2.h (open): Use it.
(openat): Likewise.
* io/open.c (__libc_open): Likewise.
* io/open64.c (__libc_open64): Likewise.
* io/open64_2.c (__open64_2): Likewise.
* io/open_2.c (__open_2): Likewise.
* io/openat.c (__openat): Likewise.
* io/openat64.c (__openat64): Likewise.
* io/openat64_2.c (__openat64_2): Likewise.
* io/openat_2.c (__openat_2): Likewise.
* sysdeps/mach/hurd/open.c (__libc_open): Likewise.
* sysdeps/mach/hurd/openat.c (__openat): Likewise.
* sysdeps/posix/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
* sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise.
(__open_nocancel): Likewise.
* sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/openat.c (__OPENAT): Likewise.
|
|
|
|
|
| |
Pull in dl-sysdep.h like every other linux sysdep.h header does when it
wants to use RTLD_PRIVATE_ERRNO.
|
|
|
|
|
|
|
|
|
| |
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include
<sysdeps/nptl/lowlevellock.h> and remove macros and
functions that are now defined there.
(SYS_futex): Remove.
(lll_compare_and_swap): Remove.
* sysdeps/s390/bits/atomic.h (atomic_exchange_acq): Define.
|
|
|
|
|
| |
* sysdeps/unix/sysv/linux/mips/bits/endian.h: Remove.
* sysdeps/mips/bits/endian.h: Fix comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
posix_spawn (a standard POSIX function) brings in a use of getrlimit64
(not a standard POSIX function). This patch fixes this by using
__getrlimit64 and making getrlimit64 a weak alias.
This is more complicated than some such changes because of files that
define getrlimit64 in their own way using symbol versioning after
including the main sysdeps/unix/sysv/linux/getrlimit64.c with a
getrlimit macro defined. There are various existing patterns for such
cases in glibc; the one I've used here is that a getrlimit64 macro
disables the weak_alias / libc_hidden_weak calls, leaving it to the
including file to define the getrlimit64 name in whatever way is
appropriate.
Tested for x86_64 and x86 that installed stripped shared libraries are
unchanged by this patch.
[BZ #17991]
* include/sys/resource.h (__getrlimit64): Declare. Use
libc_hidden_proto.
* resource/getrlimit64.c (getrlimit64): Rename to __getrlimit64
and define as weak alias of __getrlimit64. Use libc_hidden_weak.
* sysdeps/posix/spawni.c (__spawni): Call __getrlimit64 instead of
getrlimit64.
* sysdeps/unix/sysv/linux/getrlimit64.c (getrlimit64): Rename to
__getrlimit64.
[!getrlimit64] (getrlimit64): Define as weak alias of
__getrlimit64. Use libc_hidden_weak.
* sysdeps/unix/sysv/linux/i386/getrlimit64.c (getrlimit64): Define
using __getrlimit64 not __new_getrlimit64.
(__GI_getrlimit64): Likewise.
* sysdeps/unix/sysv/linux/mips/getrlimit64.c (getrlimit64):
Likewise.
(__GI_getrlimit64): Likewise.
(__old_getrlimit64): Use __getrlimit64 not __new_getrlimit64.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(getrlimit): Add __getrlimit64 alias.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (getrlimit):
Likewise.
* conform/Makefile (test-xfail-XOPEN2K/spawn.h/linknamespace):
Remove variable.
(test-xfail-POSIX2008/spawn.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
ia64 seems to use the same implementation of low-level locks as the
generic Linux lowlevellock.h. The futex syscalls are somewhat
different, but Roland thought it shouldn't matter. Note that the futex
calls are on the slow path always (except for PI mutexes).
Removing the custom low-level lock implementation will make further
refactoring easier, for example adding proper error checking to futex
operations.
|