summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/gnu/Makefile2
-rw-r--r--libc/sysdeps/gnu/ldsodefs.h48
-rw-r--r--libc/sysdeps/i386/fpu/fraiseexcpt.c2
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps72
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memset-sse2-rep.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memset-sse2.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcasecmp.S4
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcat-sse2.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S16
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S16
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcmp.S4
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strcpy-sse2.S6
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strncase.S4
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strstr-c.c2
-rw-r--r--libc/sysdeps/i386/stpncpy.S2
-rw-r--r--libc/sysdeps/i386/strpbrk.S2
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_jnf.c4
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c4
-rw-r--r--libc/sysdeps/ieee754/k_standard.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_expl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/strtold_l.c12
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h19
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c4
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c9
-rw-r--r--libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c12
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/strtold_l.c9
-rw-r--r--libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h2
-rw-r--r--libc/sysdeps/mach/hurd/bits/errno.h10
-rw-r--r--libc/sysdeps/mach/hurd/check_fds.c2
-rw-r--r--libc/sysdeps/mach/hurd/dl-sysdep.c2
-rw-r--r--libc/sysdeps/mach/hurd/errnos.awk8
-rw-r--r--libc/sysdeps/mach/hurd/i386/init-first.c4
-rw-r--r--libc/sysdeps/mach/hurd/profil.c2
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/backtrace.c66
-rw-r--r--libc/sysdeps/powerpc/powerpc32/cell/memcpy.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.c7
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/setjmp.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/memcmp.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/memcpy.S18
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/memset.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memcmp.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/setjmp.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/sysdep.h3
-rw-r--r--libc/sysdeps/powerpc/powerpc64/backtrace.c36
-rw-r--r--libc/sysdeps/powerpc/powerpc64/cell/memcpy.S2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power6/memcpy.S10
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power6/memset.S4
-rw-r--r--libc/sysdeps/pthread/aio_notify.c2
-rw-r--r--libc/sysdeps/s390/dl-procinfo.h2
-rw-r--r--libc/sysdeps/sparc/fpu/fraiseexcpt.c2
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h342
-rw-r--r--libc/sysdeps/unix/bsd/ptsname.c2
-rw-r--r--libc/sysdeps/unix/ifreq.c79
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/chown.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ifaddrs.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h23
-rw-r--r--libc/sysdeps/unix/sysv/linux/mmap64.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h19
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h124
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h75
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h84
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c48
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c142
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c52
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c155
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c170
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/init-first.c16
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ptsname.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/sa_len.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sa_len.c72
-rw-r--r--libc/sysdeps/unix/sysv/linux/socketcall.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/tst-fanotify.c56
-rw-r--r--libc/sysdeps/wordsize-32/divdi3.c2
-rw-r--r--libc/sysdeps/x86/fpu/bits/fenv.h2
-rw-r--r--libc/sysdeps/x86_64/dl-trampoline.S2
-rw-r--r--libc/sysdeps/x86_64/fpu/fraiseexcpt.c2
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps75
-rw-r--r--libc/sysdeps/x86_64/multiarch/Makefile6
-rw-r--r--libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c7
-rw-r--r--libc/sysdeps/x86_64/multiarch/rawmemchr.S103
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S210
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp-sse42.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp.S7
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S4
95 files changed, 859 insertions, 1529 deletions
diff --git a/libc/sysdeps/gnu/Makefile b/libc/sysdeps/gnu/Makefile
index 38fa88c24..9c313dec3 100644
--- a/libc/sysdeps/gnu/Makefile
+++ b/libc/sysdeps/gnu/Makefile
@@ -29,7 +29,7 @@ ifeq ($(subdir),stdio-common)
errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
-ifeq ($(versioning),yes)
+ifeq ($(build-shared),yes)
$(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
$(common-objpfx)Versions.v.i $(before-compile)
else
diff --git a/libc/sysdeps/gnu/ldsodefs.h b/libc/sysdeps/gnu/ldsodefs.h
new file mode 100644
index 000000000..3cc42845b
--- /dev/null
+++ b/libc/sysdeps/gnu/ldsodefs.h
@@ -0,0 +1,48 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects. GNU.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _GNU_LDSODEFS_H
+#define _GNU_LDSODEFS_H 1
+
+#include <elf.h>
+#include <libc-abis.h>
+#include <string.h>
+
+/* Accept binaries which identify the binary as using GNU extensions. */
+#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \
+ || memcmp (hdr, expected2, size) == 0)
+#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
+ || osabi == ELFOSABI_GNU)
+#define VALID_ELF_ABIVERSION(osabi,ver) \
+ (ver == 0 || (osabi == ELFOSABI_GNU && ver < LIBC_ABI_MAX))
+#define MORE_ELF_HEADER_DATA \
+ static const unsigned char expected2[EI_PAD] = \
+ { \
+ [EI_MAG0] = ELFMAG0, \
+ [EI_MAG1] = ELFMAG1, \
+ [EI_MAG2] = ELFMAG2, \
+ [EI_MAG3] = ELFMAG3, \
+ [EI_CLASS] = ELFW(CLASS), \
+ [EI_DATA] = byteorder, \
+ [EI_VERSION] = EV_CURRENT, \
+ [EI_OSABI] = ELFOSABI_GNU \
+ }
+
+#include_next <ldsodefs.h>
+
+#endif /* _GNU_LDSODEFS_H */
diff --git a/libc/sysdeps/i386/fpu/fraiseexcpt.c b/libc/sysdeps/i386/fpu/fraiseexcpt.c
index 141681d93..c359e5e5a 100644
--- a/libc/sysdeps/i386/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/i386/fpu/fraiseexcpt.c
@@ -31,7 +31,7 @@ __feraiseexcept (int excepts)
/* First: invalid exception. */
if ((FE_INVALID & excepts) != 0)
{
- /* One example of a invalid operation is 0.0 / 0.0. */
+ /* One example of an invalid operation is 0.0 / 0.0. */
double d;
__asm__ __volatile__ ("fldz; fdiv %%st, %%st(0); fwait" : "=t" (d));
(void) &d;
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 530dbd740..4759aa9f7 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -5470,9 +5470,35 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "gamma (-0x1p-10)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "gamma (-0x1p-15)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "gamma (-0x1p-20)":
+double: 1
+idouble: 1
+Test "gamma (-0x1p-30)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "gamma (-0x1p-5)":
+double: 1
+idouble: 1
Test "gamma (0.7)":
float: 1
ifloat: 1
+Test "gamma (0x1p-40)":
+ildouble: 1
+ldouble: 1
Test "gamma (1.2)":
double: 1
float: 2
@@ -5635,9 +5661,9 @@ ildouble: 1
ldouble: 1
Test "jn (10, 10.0)":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Test "jn (10, 2.0)":
@@ -5648,6 +5674,14 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "jn (2, 0x1p1023)":
+double: 1
+idouble: 1
+Test "jn (2, 0x1p127)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "jn (2, 2.4048255576957729)":
double: 1
float: 1
@@ -5715,9 +5749,35 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "lgamma (-0x1p-10)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "lgamma (-0x1p-15)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "lgamma (-0x1p-20)":
+double: 1
+idouble: 1
+Test "lgamma (-0x1p-30)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "lgamma (-0x1p-5)":
+double: 1
+idouble: 1
Test "lgamma (0.7)":
float: 1
ifloat: 1
+Test "lgamma (0x1p-40)":
+ildouble: 1
+ldouble: 1
Test "lgamma (1.2)":
double: 1
float: 2
@@ -6844,6 +6904,14 @@ ifloat: 1
Test "yn (10, 2.0)":
float: 3
ifloat: 3
+Test "yn (2, 0x1.ffff62p+99)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "yn (2, 0x1p127)":
+float: 2
+ifloat: 2
Test "yn (3, 0.125)":
ildouble: 1
ldouble: 1
diff --git a/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S b/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
index 14226f5a8..2984a374c 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
@@ -58,7 +58,7 @@
/* Get the entry and convert the relative offset to the \
absolute address. */ \
addl (%ebx,INDEX,SCALE), %ebx; \
-/* We loaded the jump table and adjuested EDX/ESI. Go. */ \
+/* We loaded the jump table and adjusted EDX/ESI. Go. */ \
jmp *%ebx
# else
# define JMPTBL(I, B) I
diff --git a/libc/sysdeps/i386/i686/multiarch/memset-sse2-rep.S b/libc/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
index 53a0b3df0..bcea296a9 100644
--- a/libc/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
+++ b/libc/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
@@ -62,7 +62,7 @@
absolute address. */ \
add (%ebx,%ecx,4), %ebx; \
add %ecx, %edx; \
- /* We loaded the jump table and adjuested EDX. Go. */ \
+ /* We loaded the jump table and adjusted EDX. Go. */ \
jmp *%ebx
#else
# define ENTRANCE
diff --git a/libc/sysdeps/i386/i686/multiarch/memset-sse2.S b/libc/sysdeps/i386/i686/multiarch/memset-sse2.S
index 2db588446..36bca84a7 100644
--- a/libc/sysdeps/i386/i686/multiarch/memset-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/memset-sse2.S
@@ -62,7 +62,7 @@
absolute address. */ \
add (%ebx,%ecx,4), %ebx; \
add %ecx, %edx; \
- /* We loaded the jump table and adjuested EDX. Go. */ \
+ /* We loaded the jump table and adjusted EDX. Go. */ \
jmp *%ebx
#else
# define ENTRANCE
diff --git a/libc/sysdeps/i386/i686/multiarch/strcasecmp.S b/libc/sysdeps/i386/i686/multiarch/strcasecmp.S
index 2444af26c..25de4daf4 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcasecmp.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcasecmp.S
@@ -37,6 +37,8 @@ ENTRY(__strcasecmp)
leal __strcasecmp_ssse3@GOTOFF(%ebx), %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+ jnz 2f
leal __strcasecmp_sse4_2@GOTOFF(%ebx), %eax
2: popl %ebx
cfi_adjust_cfa_offset (-4)
@@ -56,6 +58,8 @@ ENTRY(__strcasecmp)
leal __strcasecmp_ssse3, %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features
+ jnz 2f
leal __strcasecmp_sse4_2, %eax
2: ret
END(__strcasecmp)
diff --git a/libc/sysdeps/i386/i686/multiarch/strcat-sse2.S b/libc/sysdeps/i386/i686/multiarch/strcat-sse2.S
index 72a1acad4..62d60cdb7 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcat-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcat-sse2.S
@@ -49,7 +49,7 @@
/* Get the entry and convert the relative offset to the \
absolute address. */ \
addl (%ecx,INDEX,SCALE), %ecx; \
- /* We loaded the jump table and adjuested ECX. Go. */ \
+ /* We loaded the jump table and adjusted ECX. Go. */ \
jmp *%ecx
# else
# define JMPTBL(I, B) I
diff --git a/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index 7177205d0..355ed4e67 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -53,7 +53,7 @@
# define STR1 8
# endif
# define STR2 STR1+4
-# define LOCALE 12 /* Loaded before the adjustement. */
+# define LOCALE 12 /* Loaded before the adjustment. */
# ifdef PIC
# define RETURN POP (%edi); POP (%ebx); ret; \
.p2align 4; CFI_PUSH (%ebx); CFI_PUSH (%edi)
@@ -73,7 +73,7 @@
# endif
# define STR2 STR1+4
# define CNT STR2+4
-# define LOCALE 16 /* Loaded before the adjustement. */
+# define LOCALE 16 /* Loaded before the adjustment. */
# ifdef PIC
# define RETURN POP (%edi); POP (REM); POP (%ebx); ret; \
.p2align 4; \
@@ -121,8 +121,14 @@ ENTRY (__strcasecmp_sse4_2)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strcasecmp_nonascii
+# else
jne __strcasecmp_nonascii
jmp L(ascii)
+# endif
END (__strcasecmp_sse4_2)
#endif
@@ -152,8 +158,14 @@ ENTRY (__strncasecmp_sse4_2)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strncasecmp_nonascii
+# else
jne __strncasecmp_nonascii
jmp L(ascii)
+# endif
END (__strncasecmp_sse4_2)
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S b/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
index f2bc20427..3eb304bca 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -61,7 +61,7 @@
# define STR1 4
# endif
# define STR2 STR1+4
-# define LOCALE 12 /* Loaded before the adjustement. */
+# define LOCALE 12 /* Loaded before the adjustment. */
# ifdef PIC
# define RETURN POP (%ebx); ret; .p2align 4; CFI_PUSH (%ebx)
# else
@@ -82,7 +82,7 @@
# endif
# define STR2 STR1+4
# define CNT STR2+4
-# define LOCALE 16 /* Loaded before the adjustement. */
+# define LOCALE 16 /* Loaded before the adjustment. */
# ifdef PIC
# define RETURN POP (REM); POP (%ebx); ret; \
.p2align 4; CFI_PUSH (%ebx); CFI_PUSH (REM)
@@ -138,8 +138,14 @@ ENTRY (__strcasecmp_ssse3)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strcasecmp_nonascii
+# else
jne __strcasecmp_nonascii
jmp L(ascii)
+# endif
END (__strcasecmp_ssse3)
#endif
@@ -169,8 +175,14 @@ ENTRY (__strncasecmp_ssse3)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strncasecmp_nonascii
+# else
jne __strncasecmp_nonascii
jmp L(ascii)
+# endif
END (__strncasecmp_ssse3)
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/strcmp.S b/libc/sysdeps/i386/i686/multiarch/strcmp.S
index 7dc2cefab..41dd3b3f1 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcmp.S
@@ -68,6 +68,8 @@ ENTRY(STRCMP)
leal __STRCMP_SSSE3@GOTOFF(%ebx), %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+ jnz 2f
leal __STRCMP_SSE4_2@GOTOFF(%ebx), %eax
2: popl %ebx
cfi_adjust_cfa_offset (-4)
@@ -87,6 +89,8 @@ ENTRY(STRCMP)
leal __STRCMP_SSSE3, %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features
+ jnz 2f
leal __STRCMP_SSE4_2, %eax
2: ret
END(STRCMP)
diff --git a/libc/sysdeps/i386/i686/multiarch/strcpy-sse2.S b/libc/sysdeps/i386/i686/multiarch/strcpy-sse2.S
index 07db134fa..d942ac285 100644
--- a/libc/sysdeps/i386/i686/multiarch/strcpy-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/strcpy-sse2.S
@@ -64,7 +64,7 @@
/* Get the entry and convert the relative offset to the \
absolute address. */ \
addl (%ecx,INDEX,SCALE), %ecx; \
- /* We loaded the jump table and adjuested ECX. Go. */ \
+ /* We loaded the jump table and adjusted ECX. Go. */ \
jmp *%ecx
# else
# define JMPTBL(I, B) I
@@ -128,7 +128,7 @@ ENTRY (STRCPY)
sub %ecx, %edi
-/* If source adress alignment != destination adress alignment */
+/* If source address alignment != destination address alignment */
.p2align 4
L(Unalign16Both):
mov $16, %ecx
@@ -271,7 +271,7 @@ L(Unaligned64Leave):
lea 49(%edi, %edx), %edi
jmp L(StrncpyFillTailWithZero)
-/* If source adress alignment == destination adress alignment */
+/* If source address alignment == destination address alignment */
L(SourceStringAlignmentZero):
pxor %xmm0, %xmm0
diff --git a/libc/sysdeps/i386/i686/multiarch/strncase.S b/libc/sysdeps/i386/i686/multiarch/strncase.S
index 939cd96ce..de97e1b1a 100644
--- a/libc/sysdeps/i386/i686/multiarch/strncase.S
+++ b/libc/sysdeps/i386/i686/multiarch/strncase.S
@@ -37,6 +37,8 @@ ENTRY(__strncasecmp)
leal __strncasecmp_ssse3@GOTOFF(%ebx), %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features@GOTOFF(%ebx)
+ jnz 2f
leal __strncasecmp_sse4_2@GOTOFF(%ebx), %eax
2: popl %ebx
cfi_adjust_cfa_offset (-4)
@@ -56,6 +58,8 @@ ENTRY(__strncasecmp)
leal __strncasecmp_ssse3, %eax
testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
jz 2f
+ testl $bit_Slow_SSE4_2, CPUID_OFFSET+index_Slow_SSE4_2+__cpu_features
+ jnz 2f
leal __strncasecmp_sse4_2, %eax
2: ret
END(__strncasecmp)
diff --git a/libc/sysdeps/i386/i686/multiarch/strstr-c.c b/libc/sysdeps/i386/i686/multiarch/strstr-c.c
index 7516c7ffe..7b8794e9f 100644
--- a/libc/sysdeps/i386/i686/multiarch/strstr-c.c
+++ b/libc/sysdeps/i386/i686/multiarch/strstr-c.c
@@ -4,7 +4,7 @@
#include "init-arch.h"
#define STRSTR __strstr_ia32
-#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
+#if defined SHARED && !defined NO_HIDDEN
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name) \
__hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32);
diff --git a/libc/sysdeps/i386/stpncpy.S b/libc/sysdeps/i386/stpncpy.S
index 11882738d..b23e8208a 100644
--- a/libc/sysdeps/i386/stpncpy.S
+++ b/libc/sysdeps/i386/stpncpy.S
@@ -1,4 +1,4 @@
-/* copy no more then N bytes from SRC to DEST, returning the address of
+/* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2013 Free Software Foundation, Inc.
diff --git a/libc/sysdeps/i386/strpbrk.S b/libc/sysdeps/i386/strpbrk.S
index bbc0cbeb6..246ae27c5 100644
--- a/libc/sysdeps/i386/strpbrk.S
+++ b/libc/sysdeps/i386/strpbrk.S
@@ -205,7 +205,7 @@ L(1): leal -4(%edx), %eax /* prepare loop */
1. a character in the stopset was found
and
2. the end of the string was found
- But as a sign that the chracter is in the stopset we store its
+ But as a sign that the character is in the stopset we store its
value in the table. But the value of NUL is NUL so the loop
terminates for NUL in every case. */
diff --git a/libc/sysdeps/ieee754/flt-32/e_jnf.c b/libc/sysdeps/ieee754/flt-32/e_jnf.c
index ad26d7e8a..5984d94a3 100644
--- a/libc/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_jnf.c
@@ -54,7 +54,7 @@ __ieee754_jnf(int n, float x)
b = __ieee754_j1f(x);
for(i=1;i<n;i++){
temp = b;
- b = b*((float)(i+i)/x) - a; /* avoid underflow */
+ b = b*((double)(i+i)/x) - a; /* avoid underflow */
a = temp;
}
} else {
@@ -196,7 +196,7 @@ __ieee754_ynf(int n, float x)
GET_FLOAT_WORD(ib,b);
for(i=1;i<n&&ib!=0xff800000;i++){
temp = b;
- b = ((float)(i+i)/x)*b - a;
+ b = ((double)(i+i)/x)*b - a;
GET_FLOAT_WORD(ib,b);
a = temp;
}
diff --git a/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 2e9226908..0dba9af8d 100644
--- a/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -150,8 +150,8 @@ __ieee754_lgammaf_r(float x, int *signgamp)
*signgamp = -1;
return one/fabsf(x);
}
- if(__builtin_expect(ix<0x1c800000, 0)) {
- /* |x|<2**-70, return -log(|x|) */
+ if(__builtin_expect(ix<0x30800000, 0)) {
+ /* |x|<2**-30, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
return -__ieee754_logf(-x);
diff --git a/libc/sysdeps/ieee754/k_standard.c b/libc/sysdeps/ieee754/k_standard.c
index 150921f90..4a0d82d1a 100644
--- a/libc/sysdeps/ieee754/k_standard.c
+++ b/libc/sysdeps/ieee754/k_standard.c
@@ -31,7 +31,7 @@ static char rcsid[] = "$NetBSD: k_standard.c,v 1.6 1995/05/10 20:46:35 jtc Exp $
#endif /* !defined(_USE_WRITE) */
/* XXX gcc versions until now don't delay the 0.0/0.0 division until
- runtime but produce NaN at copile time. This is wrong since the
+ runtime but produce NaN at compile time. This is wrong since the
exceptions are not set correctly. */
#if 0
static const double zero = 0.0; /* used as const */
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_expl.c b/libc/sysdeps/ieee754/ldbl-128/e_expl.c
index 589f957c2..23c204ce0 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -117,7 +117,7 @@ static const long double C[] = {
#define TWO15 C[11]
32768.0L,
-/* Chebyshev polynom coeficients for (exp(x)-1)/x */
+/* Chebyshev polynom coefficients for (exp(x)-1)/x */
#define P1 C[12]
#define P2 C[13]
#define P3 C[14]
diff --git a/libc/sysdeps/ieee754/ldbl-128/strtold_l.c b/libc/sysdeps/ieee754/ldbl-128/strtold_l.c
index 8e0bc0319..d3a1d1e86 100644
--- a/libc/sysdeps/ieee754/ldbl-128/strtold_l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/strtold_l.c
@@ -34,11 +34,13 @@
#define SET_MANTISSA(flt, mant) \
do { union ieee854_long_double u; \
u.d = (flt); \
- u.ieee.mantissa0 = 0x8000; \
- u.ieee.mantissa1 = 0; \
- u.ieee.mantissa2 = ((mant) >> 32); \
- u.ieee.mantissa3 = (mant) & 0xffffffff; \
- (flt) = u.d; \
+ u.ieee_nan.mantissa0 = 0; \
+ u.ieee_nan.mantissa1 = 0; \
+ u.ieee_nan.mantissa2 = (mant) >> 32; \
+ u.ieee_nan.mantissa3 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
+ | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
+ (flt) = u.d; \
} while (0)
#include <strtod_l.c>
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index b599f369a..1b994cd7a 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -116,7 +116,7 @@ static const long double C[] = {
#define TWO15 C[11]
32768.0L,
-/* Chebyshev polynom coeficients for (exp(x)-1)/x */
+/* Chebyshev polynom coefficients for (exp(x)-1)/x */
#define P1 C[12]
#define P2 C[13]
#define P3 C[14]
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h
index e5644f5d3..9e94f53b0 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h
@@ -199,6 +199,25 @@ union ibm_extended_long_double
unsigned int mantissa2:20;
unsigned int mantissa3:32;
} ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ { /* Big endian. There is no other. */
+
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ unsigned int quiet_nan:1;
+ /* Together Mantissa0-3 comprise the mantissa. */
+ unsigned int mantissa0:19;
+ unsigned int mantissa1:32;
+
+ unsigned int negative2:1;
+ unsigned int exponent2:11;
+ /* There is an implied 1 here? */
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa2:20;
+ unsigned int mantissa3:32;
+ } ieee_nan;
};
#define IBM_EXTENDED_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent. */
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c
index 3b4af5423..a344e9288 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c
@@ -24,9 +24,7 @@
__complex__ long double
__cprojl (__complex__ long double x)
{
- if (isnan (__real__ x) && isnan (__imag__ x))
- return x;
- else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x))
{
__complex__ long double res;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
index 93415f0f0..04e328857 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
@@ -44,11 +44,10 @@ libc_hidden_proto (STRTOF)
# define SET_MANTISSA(flt, mant) \
do { union ibm_extended_long_double u; \
u.d = (flt); \
- if ((mant & 0xfffffffffffffULL) == 0) \
- mant = 0x8000000000000ULL; \
- u.ieee.mantissa0 = ((mant) >> 32) & 0xfffff; \
- u.ieee.mantissa1 = (mant) & 0xffffffff; \
- (flt) = u.d; \
+ u.ieee_nan.mantissa0 = (mant) >> 32; \
+ u.ieee_nan.mantissa1 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \
+ (flt) = u.d; \
} while (0)
#include <strtod_l.c>
diff --git a/libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c
index 8182b2bcd..e9b33f2d8 100644
--- a/libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c
+++ b/libc/sysdeps/ieee754/ldbl-64-128/strtold_l.c
@@ -44,11 +44,13 @@ libc_hidden_proto (STRTOF)
#define SET_MANTISSA(flt, mant) \
do { union ieee854_long_double u; \
u.d = (flt); \
- u.ieee.mantissa0 = 0x8000; \
- u.ieee.mantissa1 = 0; \
- u.ieee.mantissa2 = ((mant) >> 32); \
- u.ieee.mantissa3 = (mant) & 0xffffffff; \
- (flt) = u.d; \
+ u.ieee_nan.mantissa0 = 0; \
+ u.ieee_nan.mantissa1 = 0; \
+ u.ieee_nan.mantissa2 = (mant) >> 32; \
+ u.ieee_nan.mantissa3 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
+ | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
+ (flt) = u.d; \
} while (0)
#include <strtod_l.c>
diff --git a/libc/sysdeps/ieee754/ldbl-96/strtold_l.c b/libc/sysdeps/ieee754/ldbl-96/strtold_l.c
index ded84f342..dccf98c46 100644
--- a/libc/sysdeps/ieee754/ldbl-96/strtold_l.c
+++ b/libc/sysdeps/ieee754/ldbl-96/strtold_l.c
@@ -34,11 +34,10 @@
#define SET_MANTISSA(flt, mant) \
do { union ieee854_long_double u; \
u.d = (flt); \
- if ((mant & 0x7fffffffffffffffULL) == 0) \
- mant = 0x4000000000000000ULL; \
- u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \
- u.ieee.mantissa1 = (mant) & 0xffffffff; \
- (flt) = u.d; \
+ u.ieee_nan.mantissa0 = (mant) >> 32; \
+ u.ieee_nan.mantissa1 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \
+ (flt) = u.d; \
} while (0)
#include <stdlib/strtod_l.c>
diff --git a/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
index b0b863cba..af861c11e 100644
--- a/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
+++ b/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
@@ -10,7 +10,7 @@
SHLIB_COMPAT(lib, introduced, LONG_DOUBLE_COMPAT_VERSION)
#define long_double_symbol(lib, local, symbol) \
long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION)
-#if defined SHARED && defined DO_VERSIONING
+#ifdef SHARED
# define ldbl_hidden_def(local, name) libc_hidden_ver (local, name)
# define ldbl_strong_alias(name, aliasname) \
strong_alias (name, __GL_##name##_##aliasname) \
diff --git a/libc/sysdeps/mach/hurd/bits/errno.h b/libc/sysdeps/mach/hurd/bits/errno.h
index 3b6fe76b3..d20ffe654 100644
--- a/libc/sysdeps/mach/hurd/bits/errno.h
+++ b/libc/sysdeps/mach/hurd/bits/errno.h
@@ -9,6 +9,14 @@
enum __error_t_codes
{
+ /* The value zero always means success and it is perfectly fine for
+ code to use 0 explicitly (or implicitly, e.g. via Boolean coercion).
+ Having an enum entry for zero both makes the debugger print the name
+ for error_t-typed zero values, and prevents the compiler from
+ issuing warnings about 'case 0:' in a switch on an error_t-typed
+ value. */
+ ESUCCESS = 0,
+
#undef EDOM
#undef ERANGE
EPERM = _HURD_ERRNO (1),
@@ -151,7 +159,7 @@ enum __error_t_codes
EDQUOT = _HURD_ERRNO (69),
#define EDQUOT _HURD_ERRNO (69)/* Disk quota exceeded */
ESTALE = _HURD_ERRNO (70),
-#define ESTALE _HURD_ERRNO (70)/* Stale NFS file handle */
+#define ESTALE _HURD_ERRNO (70)/* Stale file handle */
EREMOTE = _HURD_ERRNO (71),
#define EREMOTE _HURD_ERRNO (71)/* Object is remote */
EBADRPC = _HURD_ERRNO (72),
diff --git a/libc/sysdeps/mach/hurd/check_fds.c b/libc/sysdeps/mach/hurd/check_fds.c
index 979fcb7de..cf2064367 100644
--- a/libc/sysdeps/mach/hurd/check_fds.c
+++ b/libc/sysdeps/mach/hurd/check_fds.c
@@ -42,7 +42,7 @@ check_one_fd (int fd, int mode)
{
/* This descriptor hasn't been opened. We try to allocate the
descriptor and open /dev/null on it so that the SUID program
- we are about to start does not accidently use this
+ we are about to start does not accidentally use this
descriptor. */
d = _hurd_alloc_fd (NULL, fd);
if (d != NULL)
diff --git a/libc/sysdeps/mach/hurd/dl-sysdep.c b/libc/sysdeps/mach/hurd/dl-sysdep.c
index d85c22a03..1788ede94 100644
--- a/libc/sysdeps/mach/hurd/dl-sysdep.c
+++ b/libc/sysdeps/mach/hurd/dl-sysdep.c
@@ -54,7 +54,7 @@ int __libc_enable_secure = 0;
INTVARDEF(__libc_enable_secure)
int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
of init-first. */
-/* This variable containts the lowest stack address ever used. */
+/* This variable contains the lowest stack address ever used. */
void *__libc_stack_end;
#if HP_TIMING_AVAIL
diff --git a/libc/sysdeps/mach/hurd/errnos.awk b/libc/sysdeps/mach/hurd/errnos.awk
index 35f5628b8..2434daab2 100644
--- a/libc/sysdeps/mach/hurd/errnos.awk
+++ b/libc/sysdeps/mach/hurd/errnos.awk
@@ -31,6 +31,14 @@ BEGIN {
print "";
print "#ifdef _ERRNO_H\n";
print "enum __error_t_codes\n{";
+ print "\t/* The value zero always means success and it is perfectly fine for";
+ print "\t code to use 0 explicitly (or implicitly, e.g. via Boolean coercion).";
+ print "\t Having an enum entry for zero both makes the debugger print the name";
+ print "\t for error_t-typed zero values, and prevents the compiler from";
+ print "\t issuing warnings about 'case 0:' in a switch on an error_t-typed";
+ print "\t value. */";
+ print "\tESUCCESS = 0,"
+ print "";
errnoh = 0;
maxerrno = 0;
in_mach_errors = "";
diff --git a/libc/sysdeps/mach/hurd/i386/init-first.c b/libc/sysdeps/mach/hurd/i386/init-first.c
index 70378d806..8fb613b55 100644
--- a/libc/sysdeps/mach/hurd/i386/init-first.c
+++ b/libc/sysdeps/mach/hurd/i386/init-first.c
@@ -122,8 +122,8 @@ init1 (int argc, char *arg0, ...)
/* We may need to see our own phdrs, e.g. for TLS setup.
Try the usual kludge to find the headers without help from
the exec server. */
- extern const void _start;
- const ElfW(Ehdr) *const ehdr = &_start;
+ extern const void __executable_start;
+ const ElfW(Ehdr) *const ehdr = &__executable_start;
_dl_phdr = (const void *) ehdr + ehdr->e_phoff;
_dl_phnum = ehdr->e_phnum;
assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
diff --git a/libc/sysdeps/mach/hurd/profil.c b/libc/sysdeps/mach/hurd/profil.c
index fee244a12..2ed24992b 100644
--- a/libc/sysdeps/mach/hurd/profil.c
+++ b/libc/sysdeps/mach/hurd/profil.c
@@ -216,7 +216,7 @@ fork_profil_parent (void)
}
text_set_element (_hurd_fork_parent_hook, fork_profil_parent);
-/* In the childs, unlock the interlock, and start a profiling thread up
+/* In the child, unlock the interlock, and start a profiling thread up
if necessary. */
static void
fork_profil_child (void)
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index 7bb3ded9a..52177e454 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -802,7 +802,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
&nip);
/* Initialize configurations. */
- if (__builtin_expect (!_res_hconf.initialized, 0))
+ if (__glibc_unlikely (!_res_hconf.initialized))
_res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
diff --git a/libc/sysdeps/powerpc/powerpc32/backtrace.c b/libc/sysdeps/powerpc/powerpc32/backtrace.c
index b4b11dd03..8d413e620 100644
--- a/libc/sysdeps/powerpc/powerpc32/backtrace.c
+++ b/libc/sysdeps/powerpc/powerpc32/backtrace.c
@@ -18,6 +18,9 @@
#include <execinfo.h>
#include <stddef.h>
+#include <string.h>
+#include <signal.h>
+#include <bits/libc-vdso.h>
/* This is the stack layout we see with every stack frame.
Note that every routine is required by the ABI to lay out the stack
@@ -35,6 +38,46 @@ struct layout
void *return_address;
};
+#define SIGNAL_FRAMESIZE 64
+
+/* Since the signal handler is just like any other function it needs to
+ save/restore its LR and it will save it into callers stack frame.
+ Since a signal handler doesn't have a caller, the kernel creates a
+ dummy frame to make it look like it has a caller. */
+struct signal_frame_32 {
+ char dummy[SIGNAL_FRAMESIZE];
+ struct sigcontext sctx;
+ mcontext_t mctx;
+ /* We don't care about the rest, since IP value is at 'mctx' field. */
+};
+
+static inline int
+is_sigtramp_address (unsigned int nip)
+{
+#ifdef SHARED
+ if (nip == (unsigned int)__vdso_sigtramp32)
+ return 1;
+#endif
+ return 0;
+}
+
+struct rt_signal_frame_32 {
+ char dummy[SIGNAL_FRAMESIZE + 16];
+ siginfo_t info;
+ struct ucontext uc;
+ /* We don't care about the rest, since IP value is at 'uc' field. */
+};
+
+static inline int
+is_sigtramp_address_rt (unsigned int nip)
+{
+#ifdef SHARED
+ if (nip == (unsigned int)__vdso_sigtramp_rt32)
+ return 1;
+#endif
+ return 0;
+}
+
int
__backtrace (void **array, int size)
{
@@ -50,7 +93,28 @@ __backtrace (void **array, int size)
for ( count = 0;
current != NULL && count < size;
current = current->next, count++)
- array[count] = current->return_address;
+ {
+ gregset_t *gregset = NULL;
+
+ array[count] = current->return_address;
+
+ /* Check if the symbol is the signal trampoline and get the interrupted
+ * symbol address from the trampoline saved area. */
+ if (is_sigtramp_address ((unsigned int)current->return_address))
+ {
+ struct signal_frame_32 *sigframe =
+ (struct signal_frame_32*) current;
+ gregset = &sigframe->mctx.gregs;
+ }
+ else if (is_sigtramp_address_rt ((unsigned int)current->return_address))
+ {
+ struct rt_signal_frame_32 *sigframe =
+ (struct rt_signal_frame_32*) current;
+ gregset = &sigframe->uc.uc_mcontext.uc_regs->gregs;
+ }
+ if (gregset)
+ array[++count] = (void*)((*gregset)[PT_NIP]);
+ }
/* It's possible the second-last stack frame can't return
(that is, it's __libc_start_main), in which case
diff --git a/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S b/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
index f3605d790..24a0f1248 100644
--- a/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
@@ -49,7 +49,7 @@ EALIGN (memcpy, 5, 0)
.Lbigcopy:
neg r8,r3 /* LS 3 bits = # bytes to 8-byte dest bdry */
- clrlwi r8,r8,32-4 /* aling to 16byte boundary */
+ clrlwi r8,r8,32-4 /* align to 16byte boundary */
sub r7,r4,r3
cmplwi cr0,r8,0
beq+ .Ldst_aligned
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.c b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
index 188f72cdb..3e7202d86 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -29,13 +29,6 @@
by _dl_sysdep_start via DL_PLATFORM_INIT. */
extern int __cache_line_size attribute_hidden;
-/* Because ld.so is now versioned, these functions can be in their own file;
- no relocations need to be done to call them.
- Of course, if ld.so is not versioned... */
-#if defined SHARED && !(DO_VERSIONING - 0)
-#error This will not work with versioning turned off, sorry.
-#endif
-
/* Stuff for the PLT. */
#define PLT_INITIAL_ENTRY_WORDS 18
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp.S
index dc93db385..60cd35052 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp.S
@@ -1,4 +1,4 @@
-/* non alitivec (old) version of setjmp for PowerPC.
+/* non altivec (old) version of setjmp for PowerPC.
Copyright (C) 1995-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S b/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
index d7050a2f7..9a455a3c6 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -512,7 +512,7 @@ L(zeroLength):
of rBITDIF to 0. If rBITDIF == 0 then rStr1 is word aligned and can
perform the Wunaligned loop.
- Otherwise we know that rSTR1 is not aready word aligned yet.
+ Otherwise we know that rSTR1 is not already word aligned yet.
So we can force the string addresses to the next lower word
boundary and special case this first word using shift left to
eliminate bits preceding the first byte. Since we want to join the
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
index c3d55b768..a76f71e04 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
@@ -269,7 +269,7 @@ L(wus_tail16): /* Move 16 bytes. */
addi 1,1,32
blr
.align 4
-L(wus_tail16p8): /* less then 8 bytes left. */
+L(wus_tail16p8): /* less than 8 bytes left. */
beq cr1,L(wus_tailX) /* exactly 16 bytes, early exit. */
cmplwi cr1,10,20
bf 29,L(wus_tail16p2)
@@ -283,7 +283,7 @@ L(wus_tail16p8): /* less then 8 bytes left. */
addi 1,1,32
blr
.align 4
-L(wus_tail16p4): /* less then 4 bytes left. */
+L(wus_tail16p4): /* less than 4 bytes left. */
addi 12,12,24
addi 11,11,24
bgt cr0,L(wus_tail2)
@@ -291,7 +291,7 @@ L(wus_tail16p4): /* less then 4 bytes left. */
addi 1,1,32
blr
.align 4
-L(wus_tail16p2): /* 16 bytes moved, less then 4 bytes left. */
+L(wus_tail16p2): /* 16 bytes moved, less than 4 bytes left. */
addi 12,12,16
addi 11,11,16
b L(wus_tail2)
@@ -315,7 +315,7 @@ L(wus_tail8): /* Move 8 bytes. */
addi 1,1,32
blr
.align 4
-L(wus_tail8p4): /* less then 4 bytes left. */
+L(wus_tail8p4): /* less than 4 bytes left. */
addi 12,12,8
addi 11,11,8
bgt cr1,L(wus_tail2)
@@ -326,7 +326,7 @@ L(wus_tail8p4): /* less then 4 bytes left. */
.align 4
L(wus_tail4): /* Move 4 bytes. */
/* r6 already loaded speculatively. If we are here we know there is
- more then 4 bytes left. So there is no need to test. */
+ more than 4 bytes left. So there is no need to test. */
addi 12,12,4
stw 6,0(11)
addi 11,11,4
@@ -426,14 +426,14 @@ L(wdu):
First we need to copy word up to but not crossing the next 32-byte
boundary. Then perform aligned loads just before and just after
the boundary and use shifts and or to generate the next aligned
- word for dst. If more then 32 bytes remain we copy (unaligned src)
- the next 7 words and repeat the loop until less then 32-bytes
+ word for dst. If more than 32 bytes remain we copy (unaligned src)
+ the next 7 words and repeat the loop until less than 32-bytes
remain.
- Then if more then 4 bytes remain we again use aligned loads,
+ Then if more than 4 bytes remain we again use aligned loads,
shifts and or to generate the next dst word. We then process the
remaining words using unaligned loads as needed. Finally we check
- if there more then 0 bytes (1-3) bytes remaining and use
+ if there are more than 0 bytes (1-3) bytes remaining and use
halfword and or byte load/stores to complete the copy.
*/
mr 4,12 /* restore unaligned adjusted src ptr */
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/memset.S b/libc/sysdeps/powerpc/powerpc32/power6/memset.S
index ce0663001..8c23c8d13 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -101,7 +101,7 @@ L(nondcbz):
boundary may not be at cache line (128-byte) boundary. */
L(nzloopstart):
/* memset in 32-byte chunks until we get to a cache line boundary.
- If rLEN is less then the distance to the next cache-line boundary use
+ If rLEN is less than the distance to the next cache-line boundary use
cacheAligned1 code to finish the tail. */
cmplwi cr1,rLEN,128
@@ -306,7 +306,7 @@ L(nzCacheAligned256):
block zero instruction. */
L(zloopstart):
/* memset in 32-byte chunks until we get to a cache line boundary.
- If rLEN is less then the distance to the next cache-line boundary use
+ If rLEN is less than the distance to the next cache-line boundary use
cacheAligned1 code to finish the tail. */
cmplwi cr1,rLEN,128
beq L(medium)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S b/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f764b7ce3..075e19f14 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -515,7 +515,7 @@ L(zeroLength):
of rBITDIF to 0. If rBITDIF == 0 then rStr1 is word aligned and can
perform the Wunaligned loop.
- Otherwise we know that rSTR1 is not aready word aligned yet.
+ Otherwise we know that rSTR1 is not already word aligned yet.
So we can force the string addresses to the next lower word
boundary and special case this first word using shift left to
eliminate bits preceding the first byte. Since we want to join the
diff --git a/libc/sysdeps/powerpc/powerpc32/setjmp.S b/libc/sysdeps/powerpc/powerpc32/setjmp.S
index 851a5b908..8a8cf0d6e 100644
--- a/libc/sysdeps/powerpc/powerpc32/setjmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/setjmp.S
@@ -1,4 +1,4 @@
-/* non alitivec (old) version of setjmp for PowerPC.
+/* non altivec (old) version of setjmp for PowerPC.
Copyright (C) 1995-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libc/sysdeps/powerpc/powerpc32/sysdep.h b/libc/sysdeps/powerpc/powerpc32/sysdep.h
index 47d02a804..78f54f91c 100644
--- a/libc/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/libc/sysdeps/powerpc/powerpc32/sysdep.h
@@ -99,8 +99,7 @@ GOT_LABEL: ; \
# define JUMPTARGET(name) name
#endif
-#if defined SHARED && defined DO_VERSIONING && defined PIC \
- && !defined NO_HIDDEN
+#if defined SHARED && defined PIC && !defined NO_HIDDEN
# undef HIDDEN_JUMPTARGET
# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
#endif
diff --git a/libc/sysdeps/powerpc/powerpc64/backtrace.c b/libc/sysdeps/powerpc/powerpc64/backtrace.c
index 2d3e051cb..9b9a9f19d 100644
--- a/libc/sysdeps/powerpc/powerpc64/backtrace.c
+++ b/libc/sysdeps/powerpc/powerpc64/backtrace.c
@@ -18,6 +18,9 @@
#include <execinfo.h>
#include <stddef.h>
+#include <string.h>
+#include <signal.h>
+#include <bits/libc-vdso.h>
/* This is the stack layout we see with every stack frame.
Note that every routine is required by the ABI to lay out the stack
@@ -38,6 +41,27 @@ struct layout
void *return_address;
};
+/* Since the signal handler is just like any other function it needs to
+ save/restore its LR and it will save it into callers stack frame.
+ Since a signal handler doesn't have a caller, the kernel creates a
+ dummy frame to make it look like it has a caller. */
+struct signal_frame_64 {
+#define SIGNAL_FRAMESIZE 128
+ char dummy[SIGNAL_FRAMESIZE];
+ struct ucontext uc;
+ /* We don't care about the rest, since the IP value is at 'uc' field. */
+};
+
+static inline int
+is_sigtramp_address (unsigned long nip)
+{
+#ifdef SHARED
+ if (nip == (unsigned long)__vdso_sigtramp_rt64)
+ return 1;
+#endif
+ return 0;
+}
+
int
__backtrace (void **array, int size)
{
@@ -53,7 +77,17 @@ __backtrace (void **array, int size)
for ( count = 0;
current != NULL && count < size;
current = current->next, count++)
- array[count] = current->return_address;
+ {
+ array[count] = current->return_address;
+
+ /* Check if the symbol is the signal trampoline and get the interrupted
+ * symbol address from the trampoline saved area. */
+ if (is_sigtramp_address ((unsigned long)current->return_address))
+ {
+ struct signal_frame_64 *sigframe = (struct signal_frame_64*) current;
+ array[++count] = (void*)sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
+ }
+ }
/* It's possible the second-last stack frame can't return
(that is, it's __libc_start_main), in which case
diff --git a/libc/sysdeps/powerpc/powerpc64/cell/memcpy.S b/libc/sysdeps/powerpc/powerpc64/cell/memcpy.S
index a271965dd..104900ea5 100644
--- a/libc/sysdeps/powerpc/powerpc64/cell/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/cell/memcpy.S
@@ -49,7 +49,7 @@ EALIGN (memcpy, 5, 0)
.Lbigcopy:
neg r8,r3 /* LS 3 bits = # bytes to 8-byte dest bdry */
- clrldi r8,r8,64-4 /* aling to 16byte boundary */
+ clrldi r8,r8,64-4 /* align to 16byte boundary */
sub r7,r4,r3
cmpldi cr0,r8,0
beq+ .Ldst_aligned
diff --git a/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S b/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
index db29e2b06..d6d242d29 100644
--- a/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/power6/memcpy.S
@@ -450,7 +450,7 @@ L(dus_tail16): /* Move 16 bytes. */
ld 3,-16(1)
blr
.align 4
-L(dus_tail16p8): /* less then 8 bytes left. */
+L(dus_tail16p8): /* less than 8 bytes left. */
beq cr1,L(dus_tailX) /* exactly 16 bytes, early exit. */
cmpldi cr1,10,20
bf 29,L(dus_tail16p2)
@@ -464,7 +464,7 @@ L(dus_tail16p8): /* less then 8 bytes left. */
ld 3,-16(1)
blr
.align 4
-L(dus_tail16p4): /* less then 4 bytes left. */
+L(dus_tail16p4): /* less than 4 bytes left. */
addi 12,12,24
addi 3,3,24
bgt cr0,L(dus_tail2)
@@ -472,7 +472,7 @@ L(dus_tail16p4): /* less then 4 bytes left. */
ld 3,-16(1)
blr
.align 4
-L(dus_tail16p2): /* 16 bytes moved, less then 4 bytes left. */
+L(dus_tail16p2): /* 16 bytes moved, less than 4 bytes left. */
addi 12,12,16
addi 3,3,16
b L(dus_tail2)
@@ -497,7 +497,7 @@ L(dus_tail8): /* Move 8 bytes. */
ld 3,-16(1)
blr
.align 4
-L(dus_tail8p4): /* less then 4 bytes left. */
+L(dus_tail8p4): /* less than 4 bytes left. */
addi 12,12,8
addi 3,3,8
bgt cr1,L(dus_tail2)
@@ -508,7 +508,7 @@ L(dus_tail8p4): /* less then 4 bytes left. */
.align 4
L(dus_tail4): /* Move 4 bytes. */
/* r6 already loaded speculatively. If we are here we know there is
- more then 4 bytes left. So there is no need to test. */
+ more than 4 bytes left. So there is no need to test. */
addi 12,12,4
stw 6,0(3)
addi 3,3,4
diff --git a/libc/sysdeps/powerpc/powerpc64/power6/memset.S b/libc/sysdeps/powerpc/powerpc64/power6/memset.S
index 541a45fd3..3e8ae2d25 100644
--- a/libc/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/libc/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -110,7 +110,7 @@ L(caligned):
boundary may not be at cache line (128-byte) boundary. */
L(nzloopstart):
/* memset in 32-byte chunks until we get to a cache line boundary.
- If rLEN is less then the distance to the next cache-line boundary use
+ If rLEN is less than the distance to the next cache-line boundary use
cacheAligned1 code to finish the tail. */
cmpldi cr1,rLEN,128
@@ -186,7 +186,7 @@ L(nzCacheAligned128):
block zero instruction. */
L(zloopstart):
/* memset in 32-byte chunks until we get to a cache line boundary.
- If rLEN is less then the distance to the next cache-line boundary use
+ If rLEN is less than the distance to the next cache-line boundary use
cacheAligned1 code to finish the tail. */
cmpldi cr1,rLEN,128
beq L(medium)
diff --git a/libc/sysdeps/pthread/aio_notify.c b/libc/sysdeps/pthread/aio_notify.c
index f3953f182..deedd2df6 100644
--- a/libc/sysdeps/pthread/aio_notify.c
+++ b/libc/sysdeps/pthread/aio_notify.c
@@ -157,7 +157,7 @@ __aio_notify (struct requestlist *req)
#endif
}
else
- /* This is part of a asynchronous `lio_listio' operation. If
+ /* This is part of an asynchronous `lio_listio' operation. If
this request is the last one, send the signal. */
if (--*waitlist->counterp == 0)
{
diff --git a/libc/sysdeps/s390/dl-procinfo.h b/libc/sysdeps/s390/dl-procinfo.h
index 45e27f102..65f037b8c 100644
--- a/libc/sysdeps/s390/dl-procinfo.h
+++ b/libc/sysdeps/s390/dl-procinfo.h
@@ -31,7 +31,7 @@
#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
<< _DL_FIRST_PLATFORM)
-/* Hardware capablity bit numbers are derived directly from the
+/* Hardware capability bit numbers are derived directly from the
facility indications as stored by the "store facility list" (STFL)
instruction.
highgprs is an alien in that list. It describes a *kernel*
diff --git a/libc/sysdeps/sparc/fpu/fraiseexcpt.c b/libc/sysdeps/sparc/fpu/fraiseexcpt.c
index 0350df9ca..050e105d8 100644
--- a/libc/sysdeps/sparc/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/sparc/fpu/fraiseexcpt.c
@@ -39,7 +39,7 @@ __feraiseexcept (int excepts)
/* First: invalid exception. */
if ((FE_INVALID & excepts) != 0)
{
- /* One example of a invalid operation is 0/0. */
+ /* One example of an invalid operation is 0/0. */
__asm ("" : "=e" (d) : "0" (c.zero));
d /= c.zero;
__asm __volatile ("" : : "e" (d));
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
deleted file mode 100644
index 849d2fc3e..000000000
--- a/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/* System-specific socket constants and types. 4.4 BSD version.
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef __BITS_SOCKET_H
-#define __BITS_SOCKET_H 1
-
-#ifndef _SYS_SOCKET_H
-# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
-#endif
-
-#define __need_size_t
-#define __need_NULL
-#include <stddef.h>
-
-#include <limits.h> /* XXX Is this allowed? */
-#include <bits/types.h>
-
-/* Type for length arguments in socket calls. */
-#ifndef __socklen_t_defined
-typedef __socklen_t socklen_t;
-# define __socklen_t_defined
-#endif
-
-
-/* Types of sockets. */
-enum __socket_type
-{
- SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
- byte streams. */
-#define SOCK_STREAM SOCK_STREAM
- SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
- of fixed maximum length. */
-#define SOCK_DGRAM SOCK_DGRAM
- SOCK_RAW = 3, /* Raw protocol interface. */
-#define SOCK_RAW SOCK_RAW
- SOCK_RDM = 4, /* Reliably-delivered messages. */
-#define SOCK_RDM SOCK_RDM
- SOCK_SEQPACKET = 5 /* Sequenced, reliable, connection-based,
- datagrams of fixed maximum length. */
-#define SOCK_SEQPACKET SOCK_SEQPACKET
-};
-
-/* Protocol families. */
-#define PF_UNSPEC 0 /* Unspecified. */
-#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
-#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
-#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */
-#define PF_INET 2 /* IP protocol family. */
-#define PF_IMPLINK 3 /* ARPAnet IMP protocol. */
-#define PF_PUP 4 /* PUP protocols. */
-#define PF_CHAOS 5 /* MIT Chaos protocols. */
-#define PF_NS 6 /* Xerox NS protocols. */
-#define PF_ISO 7 /* ISO protocols. */
-#define PF_OSI PF_ISO
-#define PF_ECMA 8 /* ECMA protocols. */
-#define PF_DATAKIT 9 /* AT&T Datakit protocols. */
-#define PF_CCITT 10 /* CCITT protocols (X.25 et al). */
-#define PF_SNA 11 /* IBM SNA protocol. */
-#define PF_DECnet 12 /* DECnet protocols. */
-#define PF_DLI 13 /* Direct data link interface. */
-#define PF_LAT 14 /* DEC Local Area Transport protocol. */
-#define PF_HYLINK 15 /* NSC Hyperchannel protocol. */
-#define PF_APPLETALK 16 /* Don't use this. */
-#define PF_ROUTE 17 /* Internal Routing Protocol. */
-#define PF_LINK 18 /* Link layer interface. */
-#define PF_XTP 19 /* eXpress Transfer Protocol (no AF). */
-#define PF_COIP 20 /* Connection-oriented IP, aka ST II. */
-#define PF_CNT 21 /* Computer Network Technology. */
-#define PF_RTIP 22 /* Help Identify RTIP packets. **/
-#define PF_IPX 23 /* Novell Internet Protocol. */
-#define PF_SIP 24 /* Simple Internet Protocol. */
-#define PF_PIP 25 /* Help Identify PIP packets. */
-#define PF_INET6 26 /* IP version 6. */
-#define PF_MAX 27
-
-/* Address families. */
-#define AF_UNSPEC PF_UNSPEC
-#define AF_LOCAL PF_LOCAL
-#define AF_UNIX PF_UNIX
-#define AF_FILE PF_FILE
-#define AF_INET PF_INET
-#define AF_IMPLINK PF_IMPLINK
-#define AF_PUP PF_PUP
-#define AF_CHAOS PF_CHAOS
-#define AF_NS PF_NS
-#define AF_ISO PF_ISO
-#define AF_OSI PF_OSI
-#define AF_ECMA PF_ECMA
-#define AF_DATAKIT PF_DATAKIT
-#define AF_CCITT PF_CCITT
-#define AF_SNA PF_SNA
-#define AF_DECnet PF_DECnet
-#define AF_DLI PF_DLI
-#define AF_LAT PF_LAT
-#define AF_HYLINK PF_HYLINK
-#define AF_APPLETALK PF_APPLETALK
-#define AF_ROUTE PF_ROUTE
-#define AF_LINK PF_LINK
-#define pseudo_AF_XTP PF_XTP
-#define AF_COIP PF_COIP
-#define AF_CNT PF_CNT
-#define pseudo_AF_RTIP PF_RTIP
-#define AF_IPX PF_IPX
-#define AF_SIP PF_SIP
-#define pseudo_AF_PIP PF_PIP
-#define AF_INET6 PF_INET6
-#define AF_MAX PF_MAX
-
-/* Maximum queue length specifiable by listen. */
-#define SOMAXCONN 128 /* 5 on the origional 4.4 BSD. */
-
-/* Get the definition of the macro to define the common sockaddr members. */
-#include <bits/sockaddr.h>
-
-/* Structure describing a generic socket address. */
-struct sockaddr
- {
- __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
- char sa_data[14]; /* Address data. */
- };
-
-
-/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
-#if ULONG_MAX > 0xffffffff
-# define __ss_aligntype __uint64_t
-#else
-# define __ss_aligntype __uint32_t
-#endif
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
-
-struct sockaddr_storage
- {
- __SOCKADDR_COMMON (ss_); /* Address family, etc. */
- __ss_aligntype __ss_align; /* Force desired alignment. */
- char __ss_padding[_SS_PADSIZE];
- };
-
-
-/* Bits in the FLAGS argument to `send', `recv', et al. */
-enum
- {
- MSG_OOB = 0x01, /* Process out-of-band data. */
-#define MSG_OOB MSG_OOB
- MSG_PEEK = 0x02, /* Peek at incoming messages. */
-#define MSG_PEEK MSG_PEEK
- MSG_DONTROUTE = 0x04, /* Don't use local routing. */
-#define MSG_DONTROUTE MSG_DONTROUTE
- MSG_EOR = 0x08, /* Data completes record. */
-#define MSG_EOR MSG_EOR
- MSG_TRUNC = 0x10, /* Data discarded before delivery. */
-#define MSG_TRUNC MSG_TRUNC
- MSG_CTRUNC = 0x20, /* Control data lost before delivery. */
-#define MSG_CTRUNC MSG_CTRUNC
- MSG_WAITALL = 0x40, /* Wait for full request or error. */
-#define MSG_WAITALL MSG_WAITALL
- MSG_DONTWAIT = 0x80, /* This message should be nonblocking. */
-#define MSG_DONTWAIT MSG_DONTWAIT
- MSG_NOSIGNAL = 0x0400 /* Do not generate SIGPIPE on EPIPE. */
-#define MSG_NOSIGNAL MSG_NOSIGNAL
- };
-
-
-/* Structure describing messages sent by
- `sendmsg' and received by `recvmsg'. */
-struct msghdr
- {
- void *msg_name; /* Address to send to/receive from. */
- socklen_t msg_namelen; /* Length of address data. */
-
- struct iovec *msg_iov; /* Vector of data to send/receive into. */
- int msg_iovlen; /* Number of elements in the vector. */
-
- void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
- socklen_t msg_controllen; /* Ancillary data buffer length. */
-
- int msg_flags; /* Flags in received message. */
- };
-
-/* Structure used for storage of ancillary data object information. */
-struct cmsghdr
- {
- socklen_t cmsg_len; /* Length of data in cmsg_data plus length
- of cmsghdr structure. */
- int cmsg_level; /* Originating protocol. */
- int cmsg_type; /* Protocol specific type. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
- __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
-#endif
- };
-
-/* Ancillary data object manipulation macros. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
-# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
-#else
-# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
-#endif
-
-#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
-
-#define CMSG_FIRSTHDR(mhdr) \
- ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
- ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
-
-#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
- & (size_t) ~(sizeof (size_t) - 1))
-#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
- + CMSG_ALIGN (sizeof (struct cmsghdr)))
-#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-
-extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
- struct cmsghdr *__cmsg) __THROW;
-#ifdef __USE_EXTERN_INLINES
-# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE __extern_inline
-# endif
-_EXTERN_INLINE struct cmsghdr *
-__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
-{
- if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
- /* The kernel header does this so there may be a reason. */
- return NULL;
-
- __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
- + CMSG_ALIGN (__cmsg->cmsg_len));
- if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
- + __mhdr->msg_controllen)
- || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
- > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
- /* No more entries. */
- return NULL;
- return __cmsg;
-}
-#endif /* Use `extern inline'. */
-
-/* Socket level message types. */
-enum
- {
- SCM_RIGHTS = 0x01, /* Access rights (array of int). */
-#define SCM_RIGHTS SCM_RIGHTS
- SCM_TIMESTAMP = 0x02, /* Timestamp (struct timeval). */
-#define SCM_TIMESTAMP SCM_TIMESTAMP
- SCM_CREDS = 0x03 /* Process creds (struct cmsgcred). */
-#define SCM_CREDS SCM_CREDS
- };
-
-/* Unfortunately, BSD practice dictates this structure be of fixed size.
- If there are more than CMGROUP_MAX groups, the list is truncated.
- (On GNU systems, the `cmcred_euid' field is just the first in the
- list of effective UIDs.) */
-#define CMGROUP_MAX 16
-
-/* Structure delivered by SCM_CREDS. This describes the identity of the
- sender of the data simultaneously received on the socket. By BSD
- convention, this is included only when a sender on a AF_LOCAL socket
- sends cmsg data of this type and size; the sender's structure is
- ignored, and the system fills in the various IDs of the sender process. */
-struct cmsgcred
- {
- __pid_t cmcred_pid;
- __uid_t cmcred_uid;
- __uid_t cmcred_euid;
- __gid_t cmcred_gid;
- int cmcred_ngroups;
- __gid_t cmcred_groups[CMGROUP_MAX];
- };
-
-/* Protocol number used to manipulate socket-level options
- with `getsockopt' and `setsockopt'. */
-#define SOL_SOCKET 0xffff
-
-/* Socket-level options for `getsockopt' and `setsockopt'. */
-enum
- {
- SO_DEBUG = 0x0001, /* Record debugging information. */
-#define SO_DEBUG SO_DEBUG
- SO_ACCEPTCONN = 0x0002, /* Accept connections on socket. */
-#define SO_ACCEPTCONN SO_ACCEPTCONN
- SO_REUSEADDR = 0x0004, /* Allow reuse of local addresses. */
-#define SO_REUSEADDR SO_REUSEADDR
- SO_KEEPALIVE = 0x0008, /* Keep connections alive and send
- SIGPIPE when they die. */
-#define SO_KEEPALIVE SO_KEEPALIVE
- SO_DONTROUTE = 0x0010, /* Don't do local routing. */
-#define SO_DONTROUTE SO_DONTROUTE
- SO_BROADCAST = 0x0020, /* Allow transmission of
- broadcast messages. */
-#define SO_BROADCAST SO_BROADCAST
- SO_USELOOPBACK = 0x0040, /* Use the software loopback to avoid
- hardware use when possible. */
-#define SO_USELOOPBACK SO_USELOOPBACK
- SO_LINGER = 0x0080, /* Block on close of a reliable
- socket to transmit pending data. */
-#define SO_LINGER SO_LINGER
- SO_OOBINLINE = 0x0100, /* Receive out-of-band data in-band. */
-#define SO_OOBINLINE SO_OOBINLINE
- SO_REUSEPORT = 0x0200, /* Allow local address and port reuse. */
-#define SO_REUSEPORT SO_REUSEPORT
- SO_SNDBUF = 0x1001, /* Send buffer size. */
-#define SO_SNDBUF SO_SNDBUF
- SO_RCVBUF = 0x1002, /* Receive buffer. */
-#define SO_RCVBUF SO_RCVBUF
- SO_SNDLOWAT = 0x1003, /* Send low-water mark. */
-#define SO_SNDLOWAT SO_SNDLOWAT
- SO_RCVLOWAT = 0x1004, /* Receive low-water mark. */
-#define SO_RCVLOWAT SO_RCVLOWAT
- SO_SNDTIMEO = 0x1005, /* Send timeout. */
-#define SO_SNDTIMEO SO_SNDTIMEO
- SO_RCVTIMEO = 0x1006, /* Receive timeout. */
-#define SO_RCVTIMEO SO_RCVTIMEO
- SO_ERROR = 0x1007, /* Get and clear error status. */
-#define SO_ERROR SO_ERROR
- SO_STYLE = 0x1008, /* Get socket connection style. */
-#define SO_STYLE SO_STYLE
- SO_TYPE = SO_STYLE /* Compatible name for SO_STYLE. */
-#define SO_TYPE SO_TYPE
- };
-
-/* Structure used to manipulate the SO_LINGER option. */
-struct linger
- {
- int l_onoff; /* Nonzero to linger on close. */
- int l_linger; /* Time to linger. */
- };
-
-#endif /* bits/socket.h */
diff --git a/libc/sysdeps/unix/bsd/ptsname.c b/libc/sysdeps/unix/bsd/ptsname.c
index 3b22a8ca6..60e38d79d 100644
--- a/libc/sysdeps/unix/bsd/ptsname.c
+++ b/libc/sysdeps/unix/bsd/ptsname.c
@@ -26,7 +26,7 @@
static char buffer[sizeof (_PATH_TTY) + 2];
-/* Return the pathname of the pseudo terminal slave assoicated with
+/* Return the pathname of the pseudo terminal slave associated with
the master FD is open on, or NULL on errors.
The returned storage is good until the next call to this function. */
char *
diff --git a/libc/sysdeps/unix/ifreq.c b/libc/sysdeps/unix/ifreq.c
new file mode 100644
index 000000000..2db6d0c30
--- /dev/null
+++ b/libc/sysdeps/unix/ifreq.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 1999-2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Jaeger <aj@suse.de>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "ifreq.h"
+
+
+void
+__ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
+{
+ int fd = sockfd;
+ struct ifconf ifc;
+ int rq_len;
+ int nifs;
+# define RQ_IFS 4
+
+ if (fd < 0)
+ fd = __opensock ();
+ if (fd < 0)
+ {
+ *num_ifs = 0;
+ *ifreqs = NULL;
+ return;
+ }
+
+ ifc.ifc_buf = NULL;
+ rq_len = RQ_IFS * sizeof (struct ifreq) / 2; /* Doubled in the loop. */
+ do
+ {
+ ifc.ifc_len = rq_len *= 2;
+ void *newp = realloc (ifc.ifc_buf, ifc.ifc_len);
+ if (newp == NULL || __ioctl (fd, SIOCGIFCONF, &ifc) < 0)
+ {
+ free (ifc.ifc_buf);
+
+ if (fd != sockfd)
+ __close (fd);
+ *num_ifs = 0;
+ *ifreqs = NULL;
+ return;
+ }
+ ifc.ifc_buf = newp;
+ }
+ while (rq_len < sizeof (struct ifreq) + ifc.ifc_len);
+
+ if (fd != sockfd)
+ __close (fd);
+
+#ifdef _HAVE_SA_LEN
+ struct ifreq *ifr = *ifreqs;
+ nifs = 0;
+ while ((char *) ifr < ifc.ifc_buf + ifc.ifc_len)
+ {
+ ++nifs;
+ ifr = __if_nextreq (ifr);
+ if (ifr == NULL)
+ break;
+ }
+#else
+ nifs = ifc.ifc_len / sizeof (struct ifreq);
+#endif
+
+ *num_ifs = nifs;
+ *ifreqs = realloc (ifc.ifc_buf, nifs * sizeof (struct ifreq));
+}
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index 94916a2b1..234d5a747 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -38,7 +38,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
bits/mman-linux.h
-tests += tst-clone
+tests += tst-clone tst-fanotify
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
@@ -120,7 +120,7 @@ ifeq ($(subdir),socket)
sysdep_headers += net/if_ppp.h net/ppp-comp.h \
net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
net/if_slip.h net/if_packet.h net/if_shaper.h
-sysdep_routines += cmsg_nxthdr sa_len
+sysdep_routines += cmsg_nxthdr
endif
ifeq ($(subdir),sunrpc)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/chown.c b/libc/sysdeps/unix/sysv/linux/i386/chown.c
index 94f294007..5fa640285 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/chown.c
@@ -49,7 +49,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-/* Compiling for compatibiity. */
+/* Compiling for compatibility. */
int
attribute_compat_text_section
__chown_is_lchown (const char *file, uid_t owner, gid_t group)
diff --git a/libc/sysdeps/unix/sysv/linux/ifaddrs.c b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
index 5c1e380fc..89fda156a 100644
--- a/libc/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -301,7 +301,7 @@ map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
return i;
}
- /* This means interfaces changed inbetween the reading of the
+ /* This means interfaces changed between the reading of the
RTM_GETLINK and RTM_GETADDR information. We have to repeat
everything. */
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index 18ff8528c..ef4866727 100644
--- a/libc/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -18,14 +18,11 @@
#ifndef _LDSODEFS_H
-#include <libc-abis.h>
#include <kernel-features.h>
/* Get the real definitions. */
#include_next <ldsodefs.h>
-/* Now define our stuff. */
-
/* We have the auxiliary vector. */
#define HAVE_AUX_VECTOR
@@ -41,24 +38,4 @@
up the page size information. */
#define HAVE_AUX_PAGESIZE
-/* Accept binaries which identify the binary as using Linux extensions. */
-#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \
- || memcmp (hdr, expected2, size) == 0)
-#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
- || osabi == ELFOSABI_LINUX)
-#define VALID_ELF_ABIVERSION(osabi,ver) \
- (ver == 0 || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX))
-#define MORE_ELF_HEADER_DATA \
- static const unsigned char expected2[EI_PAD] = \
- { \
- [EI_MAG0] = ELFMAG0, \
- [EI_MAG1] = ELFMAG1, \
- [EI_MAG2] = ELFMAG2, \
- [EI_MAG3] = ELFMAG3, \
- [EI_CLASS] = ELFW(CLASS), \
- [EI_DATA] = byteorder, \
- [EI_VERSION] = EV_CURRENT, \
- [EI_OSABI] = ELFOSABI_LINUX \
- }
-
#endif /* ldsodefs.h */
diff --git a/libc/sysdeps/unix/sysv/linux/mmap64.c b/libc/sysdeps/unix/sysv/linux/mmap64.c
index e2dcdc4d9..7d367ca83 100644
--- a/libc/sysdeps/unix/sysv/linux/mmap64.c
+++ b/libc/sysdeps/unix/sysv/linux/mmap64.c
@@ -19,6 +19,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <string.h>
#include <sysdep.h>
#include <sys/syscall.h>
@@ -42,9 +43,8 @@ __mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
#if MMAP2_PAGE_SHIFT == -1
if (page_shift == 0)
{
- int page_size = getpagesize ();
- while ((1 << ++page_shift) != page_size)
- ;
+ int page_size = __getpagesize ();
+ page_shift = __ffs (page_size) - 1;
}
#endif
if (offset & ((1 << page_shift) - 1))
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
deleted file mode 100644
index c18e9fa4b..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "aix-types.h"
-
-struct aixdirent
- {
- aixino_t d_ino;
- aixoff_t d_off;
- unsigned short int d_reclen;
- unsigned short int d_namlen;
- char d_name[256]; /* We must not include limits.h! */
- };
-
-struct aixdirent64
- {
- aixino64_t d_ino;
- aixoff64_t d_off;
- unsigned short int d_reclen;
- unsigned short int d_namlen;
- char d_name[256]; /* We must not include limits.h! */
- };
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
deleted file mode 100644
index 38f6e210d..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright (C) 1999-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define AIX_EPERM 1
-#define AIX_ENOENT 2
-#define AIX_ESRCH 3
-#define AIX_EINTR 4
-#define AIX_EIO 5
-#define AIX_ENXIO 6
-#define AIX_E2BIG 7
-#define AIX_ENOEXEC 8
-#define AIX_EBADF 9
-#define AIX_ECHILD 10
-#define AIX_EAGAIN 11
-#define AIX_ENOMEM 12
-#define AIX_EACCES 13
-#define AIX_EFAULT 14
-#define AIX_ENOTBLK 15
-#define AIX_EBUSY 16
-#define AIX_EEXIST 17
-#define AIX_EXDEV 18
-#define AIX_ENODEV 19
-#define AIX_ENOTDIR 20
-#define AIX_EISDIR 21
-#define AIX_EINVAL 22
-#define AIX_ENFILE 23
-#define AIX_EMFILE 24
-#define AIX_ENOTTY 25
-#define AIX_ETXTBSY 26
-#define AIX_EFBIG 27
-#define AIX_ENOSPC 28
-#define AIX_ESPIPE 29
-#define AIX_EROFS 30
-#define AIX_EMLINK 31
-#define AIX_EPIPE 32
-#define AIX_EDOM 33
-#define AIX_ERANGE 34
-#define AIX_ENOMSG 35
-#define AIX_EIDRM 36
-#define AIX_ECHRNG 37
-#define AIX_EL2NSYNC 38
-#define AIX_EL3HLT 39
-#define AIX_EL3RST 40
-#define AIX_ELNRNG 41
-#define AIX_EUNATCH 42
-#define AIX_ENOCSI 43
-#define AIX_EL2HLT 44
-#define AIX_EDEADLK 45
-#define AIX_ENOTREADY 46
-#define AIX_EWRPROTECT 47
-#define AIX_EFORMAT 48
-#define AIX_ENOLCK 49
-#define AIX_ENOCONNECT 50
-#define AIX_ESTALE 52
-#define AIX_EDIST 53
-#define AIX_EWOULDBLOCK 54
-#define AIX_EINPROGRESS 55
-#define AIX_EALREADY 56
-#define AIX_ENOTSOCK 57
-#define AIX_EDESTADDRREQ 58
-#define AIX_EMSGSIZE 59
-#define AIX_EPROTOTYPE 60
-#define AIX_ENOPROTOOPT 61
-#define AIX_EPROTONOSUPPORT 62
-#define AIX_ESOCKTNOSUPPORT 63
-#define AIX_EOPNOTSUPP 64
-#define AIX_EPFNOSUPPORT 65
-#define AIX_EAFNOSUPPORT 66
-#define AIX_EADDRINUSE 67
-#define AIX_EADDRNOTAVAIL 68
-#define AIX_ENETDOWN 69
-#define AIX_ENETUNREACH 70
-#define AIX_ENETRESET 71
-#define AIX_ECONNABORTED 72
-#define AIX_ECONNRESET 73
-#define AIX_ENOBUFS 74
-#define AIX_EISCONN 75
-#define AIX_ENOTCONN 76
-#define AIX_ESHUTDOWN 77
-#define AIX_ETIMEDOUT 78
-#define AIX_ECONNREFUSED 79
-#define AIX_EHOSTDOWN 80
-#define AIX_EHOSTUNREACH 81
-#define AIX_ERESTART 82
-#define AIX_EPROCLIM 83
-#define AIX_EUSERS 84
-#define AIX_ELOOP 85
-#define AIX_ENAMETOOLONG 86
-#define AIX_EDQUOT 88
-#define AIX_ECORRUPT 89
-#define AIX_EREMOTE 93
-#define AIX_ENOSYS 109
-#define AIX_EMEDIA 110
-#define AIX_ESOFT 111
-#define AIX_ENOATTR 112
-#define AIX_ESAD 113
-#define AIX_ENOTRUST 114
-#define AIX_ETOOMANYREFS 115
-#define AIX_EILSEQ 116
-#define AIX_ECANCELED 117
-#define AIX_ENOSR 118
-#define AIX_ETIME 119
-#define AIX_EBADMSG 120
-#define AIX_EPROTO 121
-#define AIX_ENODATA 122
-#define AIX_ENOSTR 123
-#define AIX_ENOTSUP 124
-#define AIX_EMULTIHOP 125
-#define AIX_ENOLINK 126
-#define AIX_EOVERFLOW 127
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
deleted file mode 100644
index 2b092c2b1..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (C) 1999-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-struct aixstat
- {
- aixdev_t st_dev;
- aixino_t st_ino;
- aixmode_t st_mode;
- aixnlink_t st_nlink;
- unsigned short int st_flag;
- aixuid_t st_uid;
- aixgid_t st_gid;
- aixdev_t st_rdev;
- aixoff_t st_size;
- aixtime_t st_atime;
- unsigned long int __unused1;
- aixtime_t st_mtime;
- unsigned long int __unused2;
- aixtime_t st_ctime;
- unsigned long int __unused3;
- aixblksize_t st_blksize;
- aixblkcnt_t st_blocks;
- int st_vfstype;
- unsigned int st_vfs;
- unsigned int st_type;
- unsigned int st_gen;
-
-#define _STATBUF_RESERVED_SPACE 9
- unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
- };
-
-struct aixstat64
- {
- aixdev_t st_dev;
- aixino64_t st_ino;
- aixmode_t st_mode;
- aixnlink_t st_nlink;
- unsigned short int st_flag;
- aixuid_t st_uid;
- aixgid_t st_gid;
- aixdev_t st_rdev;
- int st_ssize;
- aixtime_t st_atime;
- unsigned long int __unused1;
- aixtime_t st_mtime;
- unsigned long int __unused2;
- aixtime_t st_ctime;
- unsigned long int __unused3;
- aixblksize_t st_blksize;
- aixblkcnt64_t st_blocks;
- int st_vfstype;
- unsigned int st_vfs;
- unsigned int st_type;
- unsigned int st_gen;
- unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
- unsigned int st_padto_ll;
- aixoff64_t st_size;
- };
-
-#define aix_major(x) (int) ((unsigned int) (x) >> 16)
-#define aix_minor(x) (int) ((x) & 0xFFFF)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
deleted file mode 100644
index b4414e687..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "aix-types.h"
-
-#define AIX_NCCS 16
-struct aixtermios
-{
- aixtcflag_t c_iflag;
- aixtcflag_t c_oflag;
- aixtcflag_t c_cflag;
- aixtcflag_t c_lflag;
- aixcc_t c_line;
- aixcc_t c_cc[AIX_NCCS];
- aixspeed_t c_ispeed;
- aixspeed_t c_ospeed;
-};
-
-#define AIX_VINTR 0
-#define AIX_VQUIT 1
-#define AIX_VERASE 2
-#define AIX_VKILL 3
-#define AIX_VEOF 4
-#define AIX_VEOL 5
-#define AIX_VEOL2 6
-#define AIX_VSTART 7
-#define AIX_VSTOP 8
-#define AIX_VSUSP 9
-#define AIX_VDSUSP 10
-#define AIX_VREPRINT 11
-#define AIX_VDISCRD 12
-#define AIX_VWERSE 13
-#define AIX_VLNEXT 14
-
-#define AIX_IUCLC 0x00000800
-#define AIX_IXANY 0x00001000
-#define AIX_IMAXBE 0x00010000
-
-#define AIX_OLCUC 0x00000002
-#define AIX_ONLCR 0x00000004
-#define AIX_TABDLY 0x00000c00
-#define AIX_TAB0 0x00000000
-#define AIX_TAB1 0x00000400
-#define AIX_TAB2 0x00000800
-#define AIX_TAB3 0x00000c00
-#define AIX_BSDLY 0x00001000
-#define AIX_BS0 0x00000000
-#define AIX_BS1 0x00001000
-#define AIX_FFDLY 0x00002000
-#define AIX_FF0 0x00000000
-#define AIX_FF1 0x00002000
-#define AIX_NLDLY 0x00004000
-#define AIX_NL0 0x00000000
-#define AIX_NL1 0x00004000
-#define AIX_VTDLY 0x00008000
-#define AIX_VT0 0x00000000
-#define AIX_VT1 0x00008000
-
-#define AIX_CBAUD 0x0000000f
-#define AIX_CSIZE 0x00000030
-#define AIX_CS5 0x00000000
-#define AIX_CS6 0x00000010
-#define AIX_CS7 0x00000020
-#define AIX_CS8 0x00000030
-#define AIX_CSTOPB 0x00000040
-#define AIX_CREAD 0x00000080
-#define AIX_PARENB 0x00000100
-#define AIX_PARODD 0x00000200
-#define AIX_HUPCL 0x00000400
-#define AIX_CLOCAL 0x00000800
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
deleted file mode 100644
index 315ebacbf..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <dirent.h>
-#include <string.h>
-#include "linux-dirent.h"
-
-#ifndef DT_UNKNOWN
-# define DT_UNKNOWN 0
-#endif
-
-
-void
-__dirent_aix_to_linux (const struct aixdirent *aixdir,
- struct dirent *linuxdir)
-{
- linuxdir->d_ino = aixdir->d_ino;
- linuxdir->d_off = aixdir->d_off;
- linuxdir->d_reclen = aixdir->d_reclen;
- linuxdir->d_type = DT_UNKNOWN;
- memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
-}
-
-
-void
-__dirent64_aix_to_linux (const struct aixdirent64 *aixdir,
- struct dirent64 *linuxdir)
-{
- linuxdir->d_ino = aixdir->d_ino;
- linuxdir->d_off = aixdir->d_off;
- linuxdir->d_reclen = aixdir->d_reclen;
- linuxdir->d_type = DT_UNKNOWN;
- memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
deleted file mode 100644
index d543f1777..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Convert the error number the AIX kernel returns to what the Linux
- application expects.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include "linux-errno.h"
-
-
-static int mapping[] =
-{
- [AIX_EPERM] = EPERM,
- [AIX_ENOENT] = ENOENT,
- [AIX_ESRCH] = ESRCH,
- [AIX_EINTR] = EINTR,
- [AIX_EIO] = EIO,
- [AIX_ENXIO] = ENXIO,
- [AIX_E2BIG] = E2BIG,
- [AIX_ENOEXEC] = ENOEXEC,
- [AIX_EBADF] = EBADF,
- [AIX_ECHILD] = ECHILD,
- [AIX_EAGAIN] = EAGAIN,
- [AIX_ENOMEM] = ENOMEM,
- [AIX_EACCES] = EACCES,
- [AIX_EFAULT] = EFAULT,
- [AIX_ENOTBLK] = ENOTBLK,
- [AIX_EBUSY] = EBUSY,
- [AIX_EEXIST] = EEXIST,
- [AIX_EXDEV] = EXDEV,
- [AIX_ENODEV] = ENODEV,
- [AIX_ENOTDIR] = ENOTDIR,
- [AIX_EISDIR] = EISDIR,
- [AIX_EINVAL] = EINVAL,
- [AIX_ENFILE] = ENFILE,
- [AIX_EMFILE] = EMFILE,
- [AIX_ENOTTY] = ENOTTY,
- [AIX_ETXTBSY] = ETXTBSY,
- [AIX_EFBIG] = EFBIG,
- [AIX_ENOSPC] = ENOSPC,
- [AIX_EIDRM] = EIDRM,
- [AIX_ECHRNG] = ECHRNG,
- [AIX_EL2NSYNC] = EL2NSYNC,
- [AIX_EL3HLT] = EL3HLT,
- [AIX_EL3RST] = EL3RST,
- [AIX_ELNRNG] = ELNRNG,
- [AIX_EUNATCH] = EUNATCH,
- [AIX_ENOCSI] = ENOCSI,
- [AIX_EL2HLT] = EL2HLT,
- [AIX_EDEADLK] = EDEADLK,
- [AIX_ENOTREADY] = ENOTREADY,
- // EWPROTECT: no Linux equivalent
- // EFORMAT: no Linux equivalent
- [AIX_ENOLCK] = ENOLCK,
- // ENOCONNECT: No Linux equivalent
- [AIX_ESTALE] = ESTALE,
- // EDIST: no Linux equivalent
- [54] = EAGAIN, // EWOULDBLOCK
- [AIX_EINPROGRESS] = EINPROGRESS,
- [AIX_EALREADY] = EALREADY,
- [AIX_ENOTSOCK] = ENOTSOCK,
- [AIX_EDESTADDRREQ] = EDESTADDRREQ,
- [AIX_EMSGSIZE] = EMSGSIZE,
- [AIX_EPROTOTYPE] = EPROTOTYPE,
- [AIX_ENOPROTOOPT] = ENOPROTOOPT,
- [AIX_EPROTONOSUPPORT] = EPROTONOSUPPORT,
- [AIX_ESOCKTNOSUPPORT] = ESOCKTNOSUPPORT,
- [AIX_EOPNOTSUPP] = EOPNOTSUPP,
- [AIX_EPFNOSUPPORT] = EPFNOSUPPORT,
- [AIX_EAFNOSUPPORT] = EAFNOSUPPORT,
- [AIX_EADDRINUSE] = EADDRINUSE,
- [AIX_EADDRNOTAVAIL] = EADDRNOTAVAIL,
- [AIX_ENETDOWN] = ENETDOWN,
- [AIX_ENETUNREACH] = ENETUNREACH,
- [AIX_ENETRESET] = ENETRESET,
- [AIX_ECONNABORTED] = ECONNABORTED,
- [AIX_ECONNRESET] = ECONNRESET,
- [AIX_ENOBUFS] = ENOBUFS,
- [AIX_EISCONN] = EISCONN,
- [AIX_ENOTCONN] = ENOTCONN,
- [AIX_ESHUTDOWN] = ESHUTDOWN,
- [AIX_ETIMEDOUT] = ETIMEDOUT,
- [AIX_ECONNREFUSED] = ECONNREFUSED,
- [AIX_EHOSTDOWN] = EHOSTDOWN,
- [AIX_EHOSTUNREACH] = EHOSTUNREACH,
- [AIX_ERESTART] = ERESTART,
- [AIX_EPROCLIM] = EPROCLIM,
- [AIX_EUSERS] = EUSERS,
- [AIX_ELOOP] = ELOOP,
- [AIX_ENAMETOOLONG] = ENAMETOOLONG,
- [87] = ENOTEMPTY, // ENOTEMPTY
- [AIX_EDQUOT] = EDQUOT,
- [AIX_ECORRUPT] = ECORRUPT,
- [AIX_EREMOTE] = EREMOTE,
- [AIX_ENOSYS] = ENOSYS,
- [AIX_EMEDIA] = EMEDIA,
- [AIX_ESOFT] = ESOFT,
- [AIX_ENOATTR] = ENOATTR,
- [AIX_ESAD] = ESAD,
- // ENOTRUST: no Linux equivalent
- [AIX_ETOOMANYREFS] = ETOOMANYREFS,
- [AIX_EILSEQ] = EILSEQ,
- [AIX_ECANCELED] = ECANCELED,
- [AIX_ENOSR] = ENOSR,
- [AIX_ETIME] = ETIME,
- [AIX_EBADMSG] = EBADMSG,
- [AIX_EPROTO] = EPROTO,
- [AIX_ENODATA] = ENODATA,
- [AIX_ENOSTR] = ENOSTR,
- [AIX_ENOTSUP] = ENOTSUP,
- [AIX_EMULTIHOP] = EMULTIHOP,
- [AIX_ENOLINK] = ENOLINK,
- [AIX_EOVERFLOW] = EOVERFLOW
-};
-
-
-int
-__errno_aix_to_linux (int err)
-{
- int conv;
-
- if (err >= 0 && err < (sizeof (mapping) / sizeof (mapping[0]))
- && ((conv = mapping[err]) != 0 || err == 0))
- return conv;
-
- /* The error value is not known. Create a special value which can
- be easily recognized as an invalid result. */
- return 512 + err;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
deleted file mode 100644
index a01cc0a20..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-void
-__stat_aix_to_linux (const struct aixstat *aixstat, struct stat *linuxstat)
-{
- linuxstat->st_dev = makedev (aix_major (aixstat->st_dev),
- aix_minor (aixstat->st_dev));
- linuxstat->st_ino = aixstat->st_ino;
- /* The following assumes that the mode values are the same on AIX
- and Linux which is true in the moment. */
- linuxstat->st_mode = aixstat->st_mode;
- linuxstat->st_nlink = aixstat->st_nlink;
- /* There is no st_flag field in Linux. */
- linuxstat->st_uid = aixstat->st_uid;
- linuxstat->st_gid = aixstat->st_gid;
- linuxstat->st_rdev = makedev (aix_major (aixstat->st_rdev),
- aix_minor (aixstat->st_rdev));
- linuxstat->st_size = aixstat->st_size;
- linuxstat->st_atime = aixstat->st_atime;
- linuxstat->st_mtime = aixstat->st_mtime;
- linuxstat->st_ctime = aixstat->st_ctime;
- linuxstat->st_blksize = aixstat->st_blksize;
- linuxstat->st_blocks = aixstat->st_blocks;
- /* There is no st_vfstype in Linux. */
- /* There is no st_vfs in Linux. */
- /* There is no st_type in Linux. */
- /* There is no st_gen in Linux. */
-
- /* File in the padding values with repeatable values. */
- linuxstat->__pad1 = 0;
- linuxstat->__pad2 = 0;
- linuxstat->__unused1 = 0;
- linuxstat->__unused2 = 0;
- linuxstat->__unused3 = 0;
- linuxstat->__unused4 = 0;
- linuxstat->__unused5 = 0;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c
deleted file mode 100644
index 5e281f661..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <termios.h>
-#include "aix-termios.h"
-
-int
-tcgetattr (fd, linuxtermios_p)
- int fd;
- struct termios *linuxtermios_p;
-{
- struct aixtermios aixtermios;
- int result;
-
- result = /* make syscall */;
-
- if (result != -1)
- {
- /* Convert the result. */
-
- linuxtermios_p->c_cc[VINTR] = aixtermios.c_cc[AIX_VINTR];
- linuxtermios_p->c_cc[VQUIT] = aixtermios.c_cc[AIX_VQUIT];
- linuxtermios_p->c_cc[VERASE] = aixtermios.c_cc[AIX_VERASE];
- linuxtermios_p->c_cc[VKILL] = aixtermios.c_cc[AIX_VKILL];
- linuxtermios_p->c_cc[VEOF] = aixtermios.c_cc[AIX_VEOF];
- // XXX VMIN has the same value as VEOF !?
- linuxtermios_p->c_cc[VEOL] = aixtermios.c_cc[AIX_VEOL];
- // XXX VTIME has the same value as VEOL !?
- linuxtermios_p->c_cc[VEOL2] = aixtermios.c_cc[AIX_VEOL2];
- linuxtermios_p->c_cc[VSTART] = aixtermios.c_cc[AIX_VSTART];
- linuxtermios_p->c_cc[VSTOP] = aixtermios.c_cc[AIX_VSTOP];
- linuxtermios_p->c_cc[VSUSP] = aixtermios.c_cc[AIX_VSUSP];
- // XXX No Linux equivalent for VDSUSP !?
- linuxtermios_p->c_cc[VREPRINT] = aixtermios.c_cc[AIX_VREPRINT];
- linuxtermios_p->c_cc[VDISCARD] = aixtermios.c_cc[AIX_VDISCARD];
- linuxtermios_p->c_cc[VWERASE] = aixtermios.c_cc[AIX_VWERASE];
- linuxtermios_p->c_cc[VLNEXT] = aixtermios.c_cc[AIX_VLNEXT];
-
- linuxtermios_p->c_cflag = aixtermios.c_c_flag & AIX_CBAUD;
-
- /* Only the IUCLC, IXANY, and IMAXBEL values are different in the
- c_iflag member. */
- linuxtermios_p->c_iflag = aixtermios.c_iflag & 0x7ff;
- if (aixtermios.c_iflag & AIX_IXANY)
- linuxtermios_p->c_iflag |= IXANY;
- if (aixtermios.c_iflag & AIX_IUCLC)
- linuxtermios_p->c_iflag |= IUCLC;
- if (aixtermios.c_iflag & AIX_IMAXBEL)
- linuxtermios_p->c_iflag |= IMAXBEL;
-
- /* Many of the c_oflag files differ. Bummer. */
- linuxtermios_p->c_oflag = (aixtermios.c_oflag
- & (OPOST | OCRNL | ONOCR | ONLRET | OFILL
- | OFDEL | TABDLY));
- if (aixtermios.c_oflag & AIX_OLCUC)
- linuxtermios_p->c_oflag |= OLCUC;
- if (aixtermios.c_oflag & AIX_ONLCR)
- linuxtermios_p->c_oflag |= ONLCR;
- if (aixtermiosc_oflag & AIX_NLDLY)
- linuxtermios_p->c_oflag |= NL1;
-
- if (aixtermiosc_oflag.c_oflag & AIX_TABDLY)
- {
-#define offset 2
-#if AIX_TAB1 << offset != TAB1 || AIX_TAB3 << offset != TAB3
-# error "Check the offset"
-#endif
- linuxtermios_p->c_oflag |= (aixtermios.c_oflag >> offset) & TABDLY;
-#undef offset
- }
- if (aixtermios.c_oflag & AIX_FFDLY)
- linuxtermios_p->c_oflag |= FF1;
- if (aixtermios.c_oflag & AIX_BSDLY)
- linuxtermios_p->c_oflag |= BS1;
- if (aixtermios.c_oflag & AIX_VTDLY)
- linuxtermios_p->c_oflag |= VT1;
-
- /* A lot of the c_cflag member is also different. */
- if (aixtermios.c_cflag & AIX_CSIZE)
- {
-#define offset 4
-#if CSIZE >> offset != AIX_CSIZE
-# error "Check the offset"
-#endif
- linuxtermios_p->c_cflag |= (aixtermios.c_cflag >> offset) & CSIZE;
-#undef offset
- }
-
- if (aixtermios.c_cflag & AIX_STOPB)
- linuxtermios_p->c_cflag |= STOPB;
- if (aixtermios.c_cflag & AIX_CREAD)
- linuxtermios_p->c_cflag |= CREAD;
- if (aixtermios.cflag & AIX_PARENB)
- linuxtermios_p->c_cflag |= PARENB;
- if (aixtermios.cflag & AIX_PARODD)
- linuxtermios_p->c_cflag |= PARODD;
- if (aixtermios.c_cflag & AIX_HUPCL)
- linuxtermios_p->c_cflag |= HUPCL;
- if (aixtermios.c_cflag & AIX_CLOCAL)
- linuxtermios_p->c_cflag |= CLOCAL;
-
- /* The c_lflag is information is also different. */
- aixtermios.c_lflag = 0;
- if (aixtermios.c_lflag & AIX_ISIG)
- linuxtermios_p->c_lflag |= ISIG;
- if (aixtermios.c_lflag & AIX_ICANON)
- linuxtermios_p->c_lflag |= ICANON;
- if (aixtermios.c_lflag & AIX_XCASE)
- linuxtermios_p->c_lflag |= XCASE;
- if (aixtermios.c_lflag & AIX_ECHO)
- linuxtermios_p->c_lflag |= ECHO;
- if (aixtermios.c_lflag & AIX_ECHOE)
- linuxtermios_p->c_lflag |= ECHOE;
- if (aixtermios.c_lflag & AIX_ECHOK)
- linuxtermios_p->c_lflag |= ECHOK;
- if (aixtermios.c_lflag & AIX_ECHONL)
- linuxtermios_p->c_lflag |= ECHONL;
- if (aixtermios.c_lflag & AIX_NOFLSH)
- linuxtermios_p->c_lflag |= NOFLSH;
- if (aixtermios.c_lflag & AIX_TOSTOP)
- linuxtermios_p->c_lflag |= TOSTOP;
- if (aixtermios.c_lflag & AIX_ECHOCTL)
- linuxtermios_p->c_lflag |= ECHOCTL;
- if (aixtermios.c_lflag & AIX_ECHOPRT)
- linuxtermios_p->c_lflag |= ECHOPRT;
- if (aixtermios.c_lflag & AIX_ECHOKE)
- linuxtermios_p->c_lflag |= ECHOKE;
- if (aixtermios.c_lflag & AIX_FLUSHO)
- linuxtermios_p->c_lflag |= FLUSHO;
- if (aixtermios.c_lflag & AIX_PENDIN)
- linuxtermios_p->c_lflag |= PENDIN;
- if (aixtermios->c_lflag & AIX_IEXTEN)
- linuxtermios_p->c_lflag |= IEXTEN;
- }
- else
- // Convert error here or in syscall.
- ;
-
- return result;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
deleted file mode 100644
index b7330a3de..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <termios.h>
-#include "aix-termios.h"
-
-int
-tcsetattr (fd, optional_actions, linuxtermios_p)
- int fd;
- int optional_actions;
- const struct termios *linuxtermios_p;
-{
- struct aixtermios aixtermios;
- int result;
-
- /* `optional_actions' does not have to be changed, AIX uses the
- same values as Linux. */
-
- aixtermios.c_cc[AIX_VINTR] = linuxtermios_p->c_cc[VINTR];
- aixtermios.c_cc[AIX_VQUIT] = linuxtermios_p->c_cc[VQUIT];
- aixtermios.c_cc[AIX_VERASE] = linuxtermios_p->c_cc[VERASE];
- aixtermios.c_cc[AIX_VKILL] = linuxtermios_p->c_cc[VKILL];
- aixtermios.c_cc[AIX_VEOF] = linuxtermios_p->c_cc[VEOF];
- // XXX VMIN has the same value as VEOF !?
- aixtermios.c_cc[AIX_VEOL] = linuxtermios_p->c_cc[VEOL];
- // XXX VTIME has the same value as VEOL !?
- aixtermios.c_cc[AIX_VEOL2] = linuxtermios_p->c_cc[VEOL2];
- aixtermios.c_cc[AIX_VSTART] = linuxtermios_p->c_cc[VSTART];
- aixtermios.c_cc[AIX_VSTOP] = linuxtermios_p->c_cc[VSTOP];
- aixtermios.c_cc[AIX_VSUSP] = linuxtermios_p->c_cc[VSUSP];
- aixtermios.c_cc[AIX_VDSUSP] = 0; // XXX No Linux equivalent !?
- aixtermios.c_cc[AIX_VREPRINT] = linuxtermios_p->c_cc[VREPRINT];
- aixtermios.c_cc[AIX_VDISCARD] = linuxtermios_p->c_cc[VDISCARD];
- aixtermios.c_cc[AIX_VWERASE] = linuxtermios_p->c_cc[VWERASE];
- aixtermios.c_cc[AIX_VLNEXT] = linuxtermios_p->c_cc[VLNEXT];
-
- /* AIX has not all the speeds (the high one) Linux supports. The
- symbol names and values used for the speeds are fortunately the
- same. */
- if ((linuxtermios_p->c_cflag & CBAUD) > B38400)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- aixtermios.c_c_flag = linuxtermios_p->c_cflag & CBAUD;
-
- /* Only the IUCLC, IXANY, and IMAXBEL values are different in the
- c_iflag member. */
- aixtermios.c_iflag = linuxtermios_p->c_iflag & 0x7ff;
- if (linuxtermios_p->c_iflag & IXANY)
- aixtermios.c_iflag |= AIX_IXANY;
- if (linuxtermios_p->c_iflag & IUCLC)
- aixtermios.c_iflag |= AIX_IUCLC;
- if (linuxtermios_p->c_iflag & IMAXBEL)
- aixtermios.c_iflag |= AIX_IMAXBEL;
-
- /* Many of the c_oflag files differ. Bummer. */
- aixtermios.c_oflag = (linuxtermios_p->c_oflag
- & (OPOST | OCRNL | ONOCR | ONLRET | OFILL
- | OFDEL | TABDLY));
- if (linuxtermios_p->c_oflag & OLCUC)
- aixtermios.c_oflag |= AIX_OLCUC;
- if (linuxtermios_p->c_oflag & ONLCR)
- aixtermios.c_oflag |= AIX_ONLCR;
- if (linuxtermios_p->c_oflag & NLDLY)
- {
- if ((linuxtermios_p->c_oflag & NLDLY) >= NL2)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (linuxtermios_p->c_oflag & NLDLY)
- aixtermios.c_oflag |= AIX_NL1;
- }
- if (linuxtermios_p->c_oflag & TABDLY)
- {
-#define offset 2
-#if TAB1 >> offset != AIX_TAB1 || TAB3 >> offset != AIX_TAB3
-# error "Check the offset"
-#endif
- aixtermios.c_oflag |= (linuxtermios_p->c_oflag >> offset) & AIX_TABDLY;
-#undef offset
- }
- if (linuxtermios_p->c_oflag & FFDLY)
- aixtermios.c_oflag |= AIX_FF1;
- if (linuxtermios_p->c_oflag & BSDLY)
- aixtermios.c_oflag |= AIX_BS1;
- if (linuxtermios_p->c_oflag & VTDLY)
- aixtermios.c_oflag |= AIX_VT1;
-
- /* A lot of the c_cflag member is also different. */
- if (linuxtermios_p->c_cflag & CSIZE)
- {
-#define offset 4
-#if CSIZE >> offset != AIX_CSIZE
-# error "Check the offset"
-#endif
- aixtermios.c_cflag |= (linuxtermios_p->c_cflag >> offset) & AIX_CSIZE;
-#undef offset
- }
-
- if (linuxtermios_p->c_cflag & STOPB)
- aixtermios.c_cflag |= AIX_STOPB;
- if (linuxtermios_p->c_cflag & CREAD)
- aixtermios.c_cflag |= AIX_CREAD;
- if (linuxtermios_p->c_cflag & PARENB)
- aixtermios.c_cflag |= AIX_PARENB;
- if (linuxtermios_p->c_cflag & PARODD)
- aixtermios.c_cflag |= AIX_PARODD;
- if (linuxtermios_p->c_cflag & HUPCL)
- aixtermios.c_cflag |= AIX_HUPCL;
- if (linuxtermios_p->c_cflag & CLOCAL)
- aixtermios.c_cflag |= AIX_CLOCAL;
-
- /* The c_lflag is information is also different. */
- aixtermios.c_lflag = 0;
- if (linuxtermios_p->c_lflag & ISIG)
- aixtermios.c_lflag |= AIX_ISIG;
- if (linuxtermios_p->c_lflag & ICANON)
- aixtermios.c_lflag |= AIX_ICANON;
- if (linuxtermios_p->c_lflag & XCASE)
- aixtermios.c_lflag |= AIX_XCASE;
- if (linuxtermios_p->c_lflag & ECHO)
- aixtermios.c_lflag |= AIX_ECHO;
- if (linuxtermios_p->c_lflag & ECHOE)
- aixtermios.c_lflag |= AIX_ECHOE;
- if (linuxtermios_p->c_lflag & ECHOK)
- aixtermios.c_lflag |= AIX_ECHOK;
- if (linuxtermios_p->c_lflag & ECHONL)
- aixtermios.c_lflag |= AIX_ECHONL;
- if (linuxtermios_p->c_lflag & NOFLSH)
- aixtermios.c_lflag |= AIX_NOFLSH;
- if (linuxtermios_p->c_lflag & TOSTOP)
- aixtermios.c_lflag |= AIX_TOSTOP;
- if (linuxtermios_p->c_lflag & ECHOCTL)
- aixtermios.c_lflag |= AIX_ECHOCTL;
- if (linuxtermios_p->c_lflag & ECHOPRT)
- aixtermios.c_lflag |= AIX_ECHOPRT;
- if (linuxtermios_p->c_lflag & ECHOKE)
- aixtermios.c_lflag |= AIX_ECHOKE;
- if (linuxtermios_p->c_lflag & FLUSHO)
- aixtermios.c_lflag |= AIX_FLUSHO;
- if (linuxtermios_p->c_lflag & PENDIN)
- aixtermios.c_lflag |= AIX_PENDIN;
- if (linuxtermios_p->c_lflag & IEXTEN)
- aixtermios.c_lflag |= AIX_IEXTEN;
-
- result = /* XXX syscall */;
-
- // Convert error here or in syscall.
-
- return result;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index 8b195db1b..ba54de4eb 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -34,6 +34,13 @@ extern void *__vdso_getcpu;
extern void *__vdso_time;
+#if defined(__PPC64__) || defined(__powerpc64__)
+extern void *__vdso_sigtramp_rt64;
+#else
+extern void *__vdso_sigtramp32;
+extern void *__vdso_sigtramp_rt32;
+#endif
+
/* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO
symbol. This works because _dl_vdso_vsym always return the function
address, and no vDSO symbols use the TOC or chain pointers from the OPD
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c b/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
index f6f05f0ba..061715f87 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -29,6 +29,12 @@ void *__vdso_clock_getres;
void *__vdso_get_tbfreq;
void *__vdso_getcpu;
void *__vdso_time;
+#if defined(__PPC64__) || defined(__powerpc64__)
+void *__vdso_sigtramp_rt64;
+#else
+void *__vdso_sigtramp32;
+void *__vdso_sigtramp_rt32;
+#endif
static inline void
_libc_vdso_platform_setup (void)
@@ -46,6 +52,16 @@ _libc_vdso_platform_setup (void)
__vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
__vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
+
+ /* PPC64 uses only one signal trampoline symbol, while PPC32 will use
+ two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not
+ (__kernel_sigtramp32). */
+#if defined(__PPC64__) || defined(__powerpc64__)
+ __vdso_sigtramp_rt64 = _dl_vdso_vsym ("__kernel_sigtramp_rt64", &linux2615);
+#else
+ __vdso_sigtramp32 = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615);
+ __vdso_sigtramp_rt32 = _dl_vdso_vsym ("__kernel_sigtramp_rt32", &linux2615);
+#endif
}
# define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
index ba3dc5a18..0fd674a35 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
@@ -54,7 +54,7 @@ __libc_start_main (int argc, char **argv,
char **temp;
/* ...in which case, we have argc as the top thing on the
stack, followed by argv (NULL-terminated), envp (likewise),
- and the auxilary vector. */
+ and the auxiliary vector. */
/* 32/64-bit agnostic load from stack */
argc = *(long int *) stack_on_entry;
argv = stack_on_entry + 1;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
index 9273238a1..926f34207 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 1f653bf50..fb7744839 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 086d15b91..7e0612595 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/ptsname.c b/libc/sysdeps/unix/sysv/linux/ptsname.c
index ea6f0fed9..70f1f34be 100644
--- a/libc/sysdeps/unix/sysv/linux/ptsname.c
+++ b/libc/sysdeps/unix/sysv/linux/ptsname.c
@@ -56,7 +56,7 @@ extern const char __libc_ptyname2[] attribute_hidden;
static char buffer[sizeof (_PATH_DEVPTS) + 20];
-/* Return the pathname of the pseudo terminal slave assoicated with
+/* Return the pathname of the pseudo terminal slave associated with
the master FD is open on, or NULL on errors.
The returned storage is good until the next call to this function. */
char *
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
index cd0cb743b..7fbd28a25 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
@@ -46,7 +46,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-/* Compiling for compatibiity. */
+/* Compiling for compatibility. */
int
attribute_compat_text_section
__chown_is_lchown (const char *file, uid_t owner, gid_t group)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/sa_len.c b/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
index 6575b83e9..7b47aa8d6 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
@@ -1,2 +1,3 @@
-#define NEED_AF_IUCV 1
-#include "../sa_len.c"
+#define HAVE_NETIUCV_IUCV_H
+
+#include <sysdeps/unix/sysv/linux/sa_len.c>
diff --git a/libc/sysdeps/unix/sysv/linux/sa_len.c b/libc/sysdeps/unix/sysv/linux/sa_len.c
index 09fc8eb9b..0e657fa09 100644
--- a/libc/sysdeps/unix/sysv/linux/sa_len.c
+++ b/libc/sysdeps/unix/sysv/linux/sa_len.c
@@ -1,63 +1,9 @@
-/* Copyright (C) 1998-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-
-#include <netash/ash.h>
-#include <netatalk/at.h>
-#include <netax25/ax25.h>
-#include <neteconet/ec.h>
-#include <netinet/in.h>
-#include <netipx/ipx.h>
-#include <netpacket/packet.h>
-#include <netrose/rose.h>
-#include <netiucv/iucv.h>
-#include <sys/un.h>
-
-int
-__libc_sa_len (sa_family_t af)
-{
- switch (af)
- {
- case AF_APPLETALK:
- return sizeof (struct sockaddr_at);
- case AF_ASH:
- return sizeof (struct sockaddr_ash);
- case AF_AX25:
- return sizeof (struct sockaddr_ax25);
- case AF_ECONET:
- return sizeof (struct sockaddr_ec);
- case AF_INET:
- return sizeof (struct sockaddr_in);
- case AF_INET6:
- return sizeof (struct sockaddr_in6);
- case AF_IPX:
- return sizeof (struct sockaddr_ipx);
-#ifdef NEED_AF_IUCV
- case AF_IUCV:
- return sizeof (struct sockaddr_iucv);
-#endif
- case AF_LOCAL:
- return sizeof (struct sockaddr_un);
- case AF_PACKET:
- return sizeof (struct sockaddr_ll);
- case AF_ROSE:
- return sizeof (struct sockaddr_rose);
- }
- return 0;
-}
-libc_hidden_def (__libc_sa_len)
+#define HAVE_NETASH_ASH_H
+#define HAVE_NETATALK_AT_H
+#define HAVE_NETAX25_AX25_H
+#define HAVE_NETECONET_EC_H
+#define HAVE_NETIPX_IPX_H
+#define HAVE_NETPACKET_PACKET_H
+#define HAVE_NETROSE_ROSE_H
+
+#include <socket/sa_len.c>
diff --git a/libc/sysdeps/unix/sysv/linux/socketcall.h b/libc/sysdeps/unix/sysv/linux/socketcall.h
index d1dffa340..d15671720 100644
--- a/libc/sysdeps/unix/sysv/linux/socketcall.h
+++ b/libc/sysdeps/unix/sysv/linux/socketcall.h
@@ -22,7 +22,7 @@
/* Define unique numbers for the operations permitted on socket. Linux
uses a single system call for all these functions. The relevant code
file is /usr/include/linux/net.h.
- We cannot use a enum here because the values are used in assembler
+ We cannot use an enum here because the values are used in assembler
code. */
#define SOCKOP_socket 1
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
index bd3d4f925..5e64efa6a 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
@@ -28,7 +28,7 @@
Returning to the correct parent context is pretty simple on
Sparc. We only need to link up the register windows correctly.
Since global registers are clobbered by calls, we need not be
- concernred about those, and thus is all could be worked out without
+ concerned about those, and thus is all could be worked out without
using a trampoline.
Except that we must deal with the signal mask, thus a trampoline
diff --git a/libc/sysdeps/unix/sysv/linux/tst-fanotify.c b/libc/sysdeps/unix/sysv/linux/tst-fanotify.c
new file mode 100644
index 000000000..b88995d6f
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -0,0 +1,56 @@
+/* Basic fanotify test.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/fanotify.h>
+
+static int
+do_test (void)
+{
+ int fd, ret;
+
+ fd = fanotify_init (0, 0);
+ if (fd < 0)
+ {
+ if (errno == ENOSYS)
+ {
+ puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
+ return 0;
+ }
+
+ perror ("fanotify_init (0, 0) failed");
+ return 1;
+ }
+
+ ret = fanotify_mark (fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS
+ | FAN_MODIFY | FAN_OPEN | FAN_CLOSE | FAN_ONDIR
+ | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
+ if (ret)
+ {
+ perror ("fanotify_mark (...) failed");
+ return 1;
+ }
+
+ puts ("All OK");
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/sysdeps/wordsize-32/divdi3.c b/libc/sysdeps/wordsize-32/divdi3.c
index 7898541eb..fa122aa5f 100644
--- a/libc/sysdeps/wordsize-32/divdi3.c
+++ b/libc/sysdeps/wordsize-32/divdi3.c
@@ -333,7 +333,7 @@ strong_alias (__umoddi3, __umoddi3_internal)
/* We declare these with compat_symbol so that they are not visible at
link time. Programs must use the functions from libgcc. */
-#if defined SHARED && defined DO_VERSIONING
+#ifdef SHARED
# include <shlib-compat.h>
compat_symbol (libc, __divdi3, __divdi3, GLIBC_2_0);
compat_symbol (libc, __moddi3, __moddi3, GLIBC_2_0);
diff --git a/libc/sysdeps/x86/fpu/bits/fenv.h b/libc/sysdeps/x86/fpu/bits/fenv.h
index e2fa21dc1..b9040cce9 100644
--- a/libc/sysdeps/x86/fpu/bits/fenv.h
+++ b/libc/sysdeps/x86/fpu/bits/fenv.h
@@ -115,7 +115,7 @@ __NTH (feraiseexcept (int __excepts))
{
if ((FE_INVALID & __excepts) != 0)
{
- /* One example of a invalid operation is 0.0 / 0.0. */
+ /* One example of an invalid operation is 0.0 / 0.0. */
float __f = 0.0;
# ifdef __SSE_MATH__
diff --git a/libc/sysdeps/x86_64/dl-trampoline.S b/libc/sysdeps/x86_64/dl-trampoline.S
index 5770c64bf..a25e390a7 100644
--- a/libc/sysdeps/x86_64/dl-trampoline.S
+++ b/libc/sysdeps/x86_64/dl-trampoline.S
@@ -119,7 +119,7 @@ _dl_runtime_profile:
movq %rax, LR_RSP_OFFSET(%rsp)
/* We always store the XMM registers even if AVX is available.
- This is to provide backward binary compatility for existing
+ This is to provide backward binary compatibility for existing
audit modules. */
movaps %xmm0, (LR_XMM_OFFSET)(%rsp)
movaps %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp)
diff --git a/libc/sysdeps/x86_64/fpu/fraiseexcpt.c b/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
index 9a251e101..e5f553adf 100644
--- a/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
@@ -30,7 +30,7 @@ __feraiseexcept (int excepts)
/* First: invalid exception. */
if ((FE_INVALID & excepts) != 0)
{
- /* One example of a invalid operation is 0.0 / 0.0. */
+ /* One example of an invalid operation is 0.0 / 0.0. */
float f = 0.0;
__asm__ __volatile__ ("divss %0, %0 " : : "x" (f));
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index d02618a0a..6fbfa64ae 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -6222,11 +6222,39 @@ idouble: 1
Test "gamma (-0.5)":
ildouble: 1
ldouble: 1
+Test "gamma (-0x1p-10)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "gamma (-0x1p-15)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "gamma (-0x1p-20)":
+double: 1
+idouble: 1
+Test "gamma (-0x1p-30)":
+ildouble: 1
+ldouble: 1
+Test "gamma (-0x1p-5)":
+double: 1
+idouble: 1
Test "gamma (0.7)":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "gamma (0x1p-10)":
+float: 1
+ifloat: 1
+Test "gamma (0x1p-30)":
+double: 1
+idouble: 1
+Test "gamma (0x1p-40)":
+ildouble: 1
+ldouble: 1
Test "gamma (1.2)":
double: 1
float: 2
@@ -6403,6 +6431,11 @@ idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
+Test "jn (2, 0x1p127)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "jn (2, 2.4048255576957729)":
double: 2
float: 1
@@ -6486,11 +6519,39 @@ ldouble: 2
Test "lgamma (-0.5)":
ildouble: 1
ldouble: 1
+Test "lgamma (-0x1p-10)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "lgamma (-0x1p-15)":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "lgamma (-0x1p-20)":
+double: 1
+idouble: 1
+Test "lgamma (-0x1p-30)":
+ildouble: 1
+ldouble: 1
+Test "lgamma (-0x1p-5)":
+double: 1
+idouble: 1
Test "lgamma (0.7)":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "lgamma (0x1p-10)":
+float: 1
+ifloat: 1
+Test "lgamma (0x1p-30)":
+double: 1
+idouble: 1
+Test "lgamma (0x1p-40)":
+ildouble: 1
+ldouble: 1
Test "lgamma (1.2)":
double: 1
float: 2
@@ -7728,6 +7789,16 @@ double: 3
float: 1
idouble: 3
ifloat: 1
+Test "yn (2, 0x1.ffff62p+99)":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "yn (2, 0x1p127)":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
Test "yn (3, 0.125)":
double: 1
idouble: 1
@@ -8428,9 +8499,9 @@ ldouble: 2
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 4
ldouble: 4
diff --git a/libc/sysdeps/x86_64/multiarch/Makefile b/libc/sysdeps/x86_64/multiarch/Makefile
index 203d16eed..5ab950a53 100644
--- a/libc/sysdeps/x86_64/multiarch/Makefile
+++ b/libc/sysdeps/x86_64/multiarch/Makefile
@@ -6,8 +6,10 @@ endif
ifeq ($(subdir),string)
-sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 strncmp-ssse3 \
- strend-sse4 memcmp-sse4 memcpy-ssse3 memcpy-sse2-unaligned mempcpy-ssse3 \
+sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 \
+ strcmp-sse2-unaligned strncmp-ssse3 \
+ strend-sse4 memcmp-sse4 memcpy-ssse3 \
+ memcpy-sse2-unaligned mempcpy-ssse3 \
memmove-ssse3 memcpy-ssse3-back mempcpy-ssse3-back \
memmove-ssse3-back strcasestr-nonascii strcasecmp_l-ssse3 \
strncase_l-ssse3 strcat-ssse3 strncat-ssse3\
diff --git a/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c
index 28d35793c..f8756d7af 100644
--- a/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+++ b/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c
@@ -61,12 +61,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memmove_ssse3)
IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2))
- /* Support sysdeps/x86_64/multiarch/rawmemchr.S. */
- IFUNC_IMPL (i, name, rawmemchr,
- IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE4_2,
- __rawmemchr_sse42)
- IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_sse2))
-
/* Support sysdeps/x86_64/multiarch/stpncpy.S. */
IFUNC_IMPL (i, name, stpncpy,
IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSSE3,
@@ -124,6 +118,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL (i, name, strcmp,
IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2, __strcmp_sse42)
IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSSE3, __strcmp_ssse3)
+ IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2))
/* Support sysdeps/x86_64/multiarch/strcpy.S. */
diff --git a/libc/sysdeps/x86_64/multiarch/rawmemchr.S b/libc/sysdeps/x86_64/multiarch/rawmemchr.S
deleted file mode 100644
index 50de38ffb..000000000
--- a/libc/sysdeps/x86_64/multiarch/rawmemchr.S
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Multiple versions of rawmemchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@redhat.com>.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-
-/* Define multiple versions only for the definition in lib. */
-#ifndef NOT_IN_libc
- .text
-ENTRY(rawmemchr)
- .type rawmemchr, @gnu_indirect_function
- cmpl $0, __cpu_features+KIND_OFFSET(%rip)
- jne 1f
- call __init_cpu_features
-1: testl $bit_Prefer_PMINUB_for_stringop, __cpu_features+FEATURE_OFFSET+index_Prefer_PMINUB_for_stringop(%rip)
- jnz 2f
- testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
- jz 2f
- leaq __rawmemchr_sse42(%rip), %rax
- ret
-2: leaq __rawmemchr_sse2(%rip), %rax
- ret
-
-END(rawmemchr)
-strong_alias (rawmemchr, __rawmemchr)
-
-
- .section .text.sse4.2,"ax",@progbits
- .align 16
- .type __rawmemchr_sse42, @function
- .globl __rawmemchr_sse42
- .hidden __rawmemchr_sse42
-__rawmemchr_sse42:
- cfi_startproc
- CALL_MCOUNT
- movd %esi, %xmm1
- movq %rdi, %rcx
- pxor %xmm2, %xmm2
- andq $~15, %rdi
- orl $0xffffffff, %esi
- pshufb %xmm2, %xmm1
- movdqa (%rdi), %xmm0
- subq %rdi, %rcx
- pcmpeqb %xmm1, %xmm0
- shl %cl, %esi
- pmovmskb %xmm0, %ecx
- movl $16, %eax
- movl $16, %edx
- andl %esi, %ecx
- jnz 1f
-
-2: pcmpestri $0x08, 16(%rdi), %xmm1
- leaq 16(%rdi), %rdi
- jnc 2b
-
- leaq (%rdi,%rcx), %rax
- ret
-
-1: bsfl %ecx, %eax
- addq %rdi, %rax
- ret
- cfi_endproc
- .size __rawmemchr_sse42, .-__rawmemchr_sse42
-
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __rawmemchr_sse2, @function; \
- .align 16; \
- .globl __rawmemchr_sse2; \
- .hidden __rawmemchr_sse2; \
- __rawmemchr_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __rawmemchr_sse2, .-__rawmemchr_sse2
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal rawmemchr calls through a PLT.
- The speedup we get from using SSE4.2 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr_sse2
-#endif
-
-#include "../rawmemchr.S"
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S b/libc/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S
new file mode 100644
index 000000000..eed843297
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S
@@ -0,0 +1,210 @@
+/* strcmp with unaligned loads
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#define ALIGN(x) .p2align x
+
+ENTRY ( __strcmp_sse2_unaligned)
+ movl %edi, %eax
+ xorl %edx, %edx
+ pxor %xmm7, %xmm7
+ orl %esi, %eax
+ andl $4095, %eax
+ cmpl $4032, %eax
+ jg L(cross_page)
+ movdqu (%rdi), %xmm1
+ movdqu (%rsi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pminub %xmm1, %xmm0
+ pxor %xmm1, %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ testq %rax, %rax
+ je L(next_48_bytes)
+L(return):
+ bsfq %rax, %rdx
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+ ret
+
+ ALIGN (4)
+L(next_48_bytes):
+ movdqu 16(%rdi), %xmm6
+ movdqu 16(%rsi), %xmm3
+ movdqu 32(%rdi), %xmm5
+ pcmpeqb %xmm6, %xmm3
+ movdqu 32(%rsi), %xmm2
+ pminub %xmm6, %xmm3
+ pcmpeqb %xmm1, %xmm3
+ movdqu 48(%rdi), %xmm4
+ pcmpeqb %xmm5, %xmm2
+ pmovmskb %xmm3, %edx
+ movdqu 48(%rsi), %xmm0
+ pminub %xmm5, %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm4, %xmm0
+ pmovmskb %xmm2, %eax
+ salq $16, %rdx
+ pminub %xmm4, %xmm0
+ pcmpeqb %xmm1, %xmm0
+ salq $32, %rax
+ orq %rdx, %rax
+ pmovmskb %xmm0, %ecx
+ movq %rcx, %rdx
+ salq $48, %rdx
+ orq %rdx, %rax
+ jne L(return)
+L(main_loop_header):
+ leaq 64(%rdi), %rdx
+ movl $4096, %ecx
+ pxor %xmm9, %xmm9
+ andq $-64, %rdx
+ subq %rdi, %rdx
+ leaq (%rdi, %rdx), %rax
+ addq %rsi, %rdx
+ movq %rdx, %rsi
+ andl $4095, %esi
+ subq %rsi, %rcx
+ shrq $6, %rcx
+ movq %rcx, %rsi
+ jmp L(loop_start)
+
+ ALIGN (4)
+L(loop):
+ addq $64, %rax
+ addq $64, %rdx
+L(loop_start):
+ testq %rsi, %rsi
+ leaq -1(%rsi), %rsi
+ je L(loop_cross_page)
+L(back_to_loop):
+ movdqu (%rdx), %xmm0
+ movdqu 16(%rdx), %xmm1
+ movdqa (%rax), %xmm2
+ movdqa 16(%rax), %xmm3
+ pcmpeqb %xmm2, %xmm0
+ movdqu 32(%rdx), %xmm5
+ pcmpeqb %xmm3, %xmm1
+ pminub %xmm2, %xmm0
+ movdqu 48(%rdx), %xmm6
+ pminub %xmm3, %xmm1
+ movdqa 32(%rax), %xmm2
+ pminub %xmm1, %xmm0
+ movdqa 48(%rax), %xmm3
+ pcmpeqb %xmm2, %xmm5
+ pcmpeqb %xmm3, %xmm6
+ pminub %xmm2, %xmm5
+ pminub %xmm3, %xmm6
+ pminub %xmm5, %xmm0
+ pminub %xmm6, %xmm0
+ pcmpeqb %xmm7, %xmm0
+ pmovmskb %xmm0, %ecx
+ testl %ecx, %ecx
+ je L(loop)
+ pcmpeqb %xmm7, %xmm5
+ movdqu (%rdx), %xmm0
+ pcmpeqb %xmm7, %xmm1
+ movdqa (%rax), %xmm2
+ pcmpeqb %xmm2, %xmm0
+ pminub %xmm2, %xmm0
+ pcmpeqb %xmm7, %xmm6
+ pcmpeqb %xmm7, %xmm0
+ pmovmskb %xmm1, %ecx
+ pmovmskb %xmm5, %r8d
+ pmovmskb %xmm0, %edi
+ salq $16, %rcx
+ salq $32, %r8
+ pmovmskb %xmm6, %esi
+ orq %r8, %rcx
+ orq %rdi, %rcx
+ salq $48, %rsi
+ orq %rsi, %rcx
+ bsfq %rcx, %rcx
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+ ret
+
+ ALIGN (4)
+L(loop_cross_page):
+ xor %r10, %r10
+ movq %rdx, %r9
+ and $63, %r9
+ subq %r9, %r10
+
+ movdqa (%rdx, %r10), %xmm0
+ movdqa 16(%rdx, %r10), %xmm1
+ movdqu (%rax, %r10), %xmm2
+ movdqu 16(%rax, %r10), %xmm3
+ pcmpeqb %xmm2, %xmm0
+ movdqa 32(%rdx, %r10), %xmm5
+ pcmpeqb %xmm3, %xmm1
+ pminub %xmm2, %xmm0
+ movdqa 48(%rdx, %r10), %xmm6
+ pminub %xmm3, %xmm1
+ movdqu 32(%rax, %r10), %xmm2
+ movdqu 48(%rax, %r10), %xmm3
+ pcmpeqb %xmm2, %xmm5
+ pcmpeqb %xmm3, %xmm6
+ pminub %xmm2, %xmm5
+ pminub %xmm3, %xmm6
+
+ pcmpeqb %xmm7, %xmm0
+ pcmpeqb %xmm7, %xmm1
+ pcmpeqb %xmm7, %xmm5
+ pcmpeqb %xmm7, %xmm6
+
+ pmovmskb %xmm1, %ecx
+ pmovmskb %xmm5, %r8d
+ pmovmskb %xmm0, %edi
+ salq $16, %rcx
+ salq $32, %r8
+ pmovmskb %xmm6, %esi
+ orq %r8, %rdi
+ orq %rcx, %rdi
+ salq $48, %rsi
+ orq %rsi, %rdi
+ movq %r9, %rcx
+ movq $63, %rsi
+ shrq %cl, %rdi
+ test %rdi, %rdi
+ je L(back_to_loop)
+ bsfq %rdi, %rcx
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+ ret
+
+ ALIGN (4)
+L(cross_page_loop):
+ cmpb %cl, %al
+ jne L(different)
+ addq $1, %rdx
+ cmpq $64, %rdx
+ je L(main_loop_header)
+L(cross_page):
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %ecx
+ testb %al, %al
+ jne L(cross_page_loop)
+ xorl %eax, %eax
+L(different):
+ subl %ecx, %eax
+ ret
+END (__strcmp_sse2_unaligned)
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
index a503e9211..c84f1c2b3 100644
--- a/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
+++ b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
@@ -206,7 +206,7 @@ LABEL(touppermask):
jnz LABEL(less16bytes)/* If not, find different value or null char */
#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
sub $16, %r11
- jbe LABEL(strcmp_exitz)/* finish comparision */
+ jbe LABEL(strcmp_exitz)/* finish comparison */
#endif
add $16, %rsi /* prepare to search next 16 bytes */
add $16, %rdi /* prepare to search next 16 bytes */
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp.S b/libc/sysdeps/x86_64/multiarch/strcmp.S
index 1d4d71183..c5dcd1aa5 100644
--- a/libc/sysdeps/x86_64/multiarch/strcmp.S
+++ b/libc/sysdeps/x86_64/multiarch/strcmp.S
@@ -66,6 +66,7 @@
# define STRCMP_SSE2 __strncasecmp_l_sse2
# define __GI_STRCMP __GI___strncasecmp_l
#else
+# define USE_AS_STRCMP
# define UPDATE_STRNCMP_COUNTER
# ifndef STRCMP
# define STRCMP strcmp
@@ -88,11 +89,17 @@ ENTRY(STRCMP)
jne 1f
call __init_cpu_features
1:
+#ifdef USE_AS_STRCMP
+ leaq __strcmp_sse2_unaligned(%rip), %rax
+ testl $bit_Fast_Unaligned_Load, __cpu_features+CPUID_OFFSET+index_Fast_Unaligned_Load(%rip)
+ jnz 3f
+#else
testl $bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
jnz 2f
leaq STRCMP_SSE42(%rip), %rax
testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
jnz 3f
+#endif
2: leaq STRCMP_SSSE3(%rip), %rax
testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
jnz 3f
diff --git a/libc/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S b/libc/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
index cd56e5637..7710173c6 100644
--- a/libc/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
+++ b/libc/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
@@ -93,7 +93,7 @@ ENTRY (STRCPY)
movdqu (%rsi, %rcx), %xmm1 /* copy 16 bytes */
movdqu %xmm1, (%rdi)
-/* If source adress alignment != destination adress alignment */
+/* If source address alignment != destination address alignment */
.p2align 4
L(Unalign16Both):
sub %rcx, %rdi
@@ -289,7 +289,7 @@ L(Unaligned64Leave):
BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %rdx, 4)
# endif
-/* If source adress alignment == destination adress alignment */
+/* If source address alignment == destination address alignment */
L(SourceStringAlignmentLess32):
pxor %xmm0, %xmm0