Get canonical name in getaddrinfo from hosts file for AF_INET (fixes 16077)
AF_INET lookup in hosts file uses _nss_files_gethostbyname2_r, which
is not capable of returning a canonical name if it has found one.
This change adds _nss_files_gethostbyname3_r, which wraps around
_nss_files_gethostbyname2_r and then returns result.h_name as the
canonical name.
Aurelien Jarno [Wed, 27 Nov 2013 13:42:06 +0000 (14:42 +0100)]
MIPS: Fix RLIM64_INFINITY constant for O32 and N32 ABIs
Fix the RLIM64_INFINITY constant for O32 and N32 ABIs to match the
kernel one. Change the getrlimit64/setrlimit64 into old compat symbols,
and provide the Linux generic getrlimit64/setrlimit64 functions as
GLIBC_2_19 version.
Aurelien Jarno [Wed, 27 Nov 2013 13:42:06 +0000 (14:42 +0100)]
MIPS: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant
RLIM64_INFINITY was supposed to be a glibc convention rather than
anything seen by the kernel, but it ended being passed to the kernel
through the prlimit64 syscall. On O32 and N32 ABIs, we therefore
end-up with different values on the userland and kernel side:
* On the kernel side, the value is defined for all architectures as
include/uapi/linux/resource.h:
#define RLIM64_INFINITY (~0ULL)
* On the GNU libc side, the value is defined in
ports/sysdeps/unix/sysv/linux/mips/bits/resource.h:
For the O32 and N32 ABI:
# define RLIM64_INFINITY 0x7fffffffffffffffULL
and for the N64 ABI:
# define RLIM64_INFINITY 0xffffffffffffffffUL
This was not a problem until the prlimit64 syscall was wired in the
2.6.36 kernel. Given the GLIBC uses the prlimit64 syscall to implement
getrlimit64 and setrlimit64, pam_limits.so is setting the limits to
a very big value instead of infinity. As a normal user process can
later only decrease the value and not increase it, it will later get
and EPERM error when trying to set the value to infinity with setrlimit.
The GLIBC has this constant for more than 7 years, and as it is defined
in a header file, it means a lot of binaries are in the wild. This patch
fixes that by adding a wrapper to fix the value passed to or received
from the kernel, before or after calling the prlimit64 syscall.
Carlos O'Donell [Mon, 25 Nov 2013 19:57:42 +0000 (14:57 -0500)]
Fix typo in sys/ptrace.h.
The event code is PTRACE_EVENT_SECCOMP, not PTRAVE_EVENT_SECCOMP.
This patch fixes the V->C typo. There are no ABI issues since the
number remains the same for the code. Code using the old wrong
name will need to be updated.
PowerPC: Set/restore rounding mode only when needed
This patch helps some math functions performance by adding the libc_fexxx
variant of inline functions to handle both FPU round and exception set/restore
and by using them on the libc_fexxx_ctx functions. It is based on already coded
fexxx family functions for PPC with fpu.
Here is the summary of performance improvements due this patch (measured on a
POWER7 machine):
Meador Inge [Thu, 21 Nov 2013 21:57:37 +0000 (16:57 -0500)]
Use __glibc_block in public headers.
As detailed in PR11157, the use of '__block' is known to interfere
with keywords in some environments, such as the Clang -fblocks extension.
Recently a similar issue was raised concerning the use of '__unused'
and a '__glibc' prefix was proposed to create a glibc implementation
namespace for these sorts of issues [1]. This patches takes that
approach.
Guy Martin [Thu, 21 Nov 2013 18:23:16 +0000 (13:23 -0500)]
Don't use broken DL_AUTO_FUNCTION_ADDRESS()
On hppa and ia64, the macro DL_AUTO_FUNCTION_ADDRESS() uses the
variable fptr[2] in it's own scope.
The content of fptr[] is thus undefined right after the macro exits.
Newer gcc's (>= 4.7) reuse the stack space of this variable triggering
a segmentation fault in dl-init.c:69.
To fix this we rewrite the macros to make the call directly to init
and fini without needing to pass back a constructed function pointer.
Chung-Lin Tang [Wed, 20 Nov 2013 21:12:18 +0000 (16:12 -0500)]
linux-generic: fix alignment of struct stat/statfs for nios2
The hard alignment of 8 was appropriate for most platforms for
which 8-byte values are 8-byte aligned, but this is not true
for the nios2 platform, so only align to the alignment of the
8-byte type on the platform.
Remove the explicit alignment of struct statfs as it's redundant.
Chris Metcalf [Mon, 18 Nov 2013 18:27:09 +0000 (13:27 -0500)]
test-fpucw-ieee: Don't use _FPU_IEEE if not defined
Not all architectures define this value, and if they don't,
just let the test run the same as test-fpucw, with __fpu_control
set to _FPU_DEFAULT explicitly.
David S. Miller [Tue, 12 Nov 2013 20:48:01 +0000 (12:48 -0800)]
Fix sparc 64-bit GMP ifunc resolution in static builds.
[BZ #16150]
* sysdeps/sparc/sparc64/multiarch/add_n.S: Resolve to the correct generic
symbol in the non-vis3 case in static builds.
* sysdeps/sparc/sparc64/multiarch/addmul_1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/mul_1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/sub_n.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/submul_1.S: Likewise.
This patch fixes the vDSO symbol used directed in IFUNC resolver where
they do not have an associated ODP entry leading to undefined behavior
in some cases. It adds an artificial OPD static entry to such cases
and set its TOC to non 0 to avoid triggering lazy resolutions.