diff --git a/SOURCES/glibc-aa64-commonpagesize-64k.patch b/SOURCES/glibc-aa64-commonpagesize-64k.patch index 657d1cb9..a18a0e32 100644 --- a/SOURCES/glibc-aa64-commonpagesize-64k.patch +++ b/SOURCES/glibc-aa64-commonpagesize-64k.patch @@ -3,9 +3,9 @@ @@ -8,7 +8,7 @@ case "$machine" in aarch64*) - # Parameters to allow auto-detection of -z relro. + # Parameters to allow auto-detection of -z relro. - libc_commonpagesize=0x1000 + libc_commonpagesize=0x10000 - libc_relro_required=yes - ;; + libc_relro_required=yes + ;; esac diff --git a/SOURCES/glibc-aa64-setcontext.patch b/SOURCES/glibc-aa64-setcontext.patch index f76849c5..60fc6a5b 100644 --- a/SOURCES/glibc-aa64-setcontext.patch +++ b/SOURCES/glibc-aa64-setcontext.patch @@ -14,41 +14,41 @@ index aff2e32..70b2e32 100644 +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S @@ -1,6 +1,6 @@ /* Save current context. - + - Copyright (C) 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. - + This file is part of the GNU C Library. - + @@ -53,6 +53,9 @@ ENTRY(__getcontext) - mov x2, sp - str x2, [x0, oSP] - + mov x2, sp + str x2, [x0, oSP] + + /* Initialize the pstate. */ + str xzr, [x0, oPSTATE] + - /* Figure out where to place the first context extension - block. */ - add x2, x0, #oEXTENSION + /* Figure out where to place the first context extension + block. */ + add x2, x0, #oEXTENSION diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S index a98f67f..f45a655 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S @@ -1,6 +1,6 @@ /* Set current context. - + - Copyright (C) 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. - + This file is part of the GNU C Library. - + @@ -22,68 +22,108 @@ #include "ucontext_i.h" #include "ucontext-internal.h" - + -/* int setcontext (const ucontext_t *ucp) */ +/* int __setcontext (const ucontext_t *ucp) - + - .text - -ENTRY(__setcontext) @@ -74,13 +74,13 @@ index a98f67f..f45a655 100644 - sub sp, sp, x3 + Restores the machine context in UCP and thereby resumes execution + in that context. - + - /* Compute the base address of the ucontext structure. */ - add x1, sp, #RT_SIGFRAME_UCONTEXT + This implementation is intended to be used for *synchronous* context + switches only. Therefore, it does not have to restore anything + other than the PRESERVED state. */ - + - /* Only ucontext is required in the frame, *copy* it in. */ - -#if UCONTEXT_SIZE % 16 @@ -94,7 +94,7 @@ index a98f67f..f45a655 100644 - sub x2, x2, 1 - cbnz x2, 0b + .text - + - /* rt_sigreturn () -- no arguments, sp points to struct rt_sigframe. */ - mov x8, SYS_ify (rt_sigreturn) +ENTRY (__setcontext) @@ -108,7 +108,7 @@ index a98f67f..f45a655 100644 + mov x2, #0 + mov x3, #_NSIG8 + mov x8, SYS_ify (rt_sigprocmask) - svc 0 + svc 0 - - /* Ooops we failed. Recover the stack */ - @@ -197,11 +197,11 @@ index a98f67f..f45a655 100644 + br x16 PSEUDO_END (__setcontext) weak_alias (__setcontext, setcontext) - + -ENTRY(__startcontext) +ENTRY (__startcontext) - mov x0, x19 - cbnz x0, __setcontext + mov x0, x19 + cbnz x0, __setcontext -1: b HIDDEN_JUMPTARGET(_exit) -END(__startcontext) +1: b HIDDEN_JUMPTARGET (_exit) @@ -216,5 +216,5 @@ index 1afff78..ab3930c 100644 oPC mcontext (pc) +oPSTATE mcontext (pstate) oEXTENSION mcontext (__reserved) - + #define fpsimd_context(member) offsetof (struct fpsimd_context, member) diff --git a/SOURCES/glibc-aarch64-add-ptr_mangle-support.patch b/SOURCES/glibc-aarch64-add-ptr_mangle-support.patch index cf3bfdad..dbdc5512 100644 --- a/SOURCES/glibc-aarch64-add-ptr_mangle-support.patch +++ b/SOURCES/glibc-aarch64-add-ptr_mangle-support.patch @@ -9,23 +9,23 @@ index 250f2af..2d38bbf 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S @@ -50,8 +50,12 @@ ENTRY (__longjmp) - ldp x23, x24, [x0, #JB_X23<<3] - ldp x25, x26, [x0, #JB_X25<<3] - ldp x27, x28, [x0, #JB_X27<<3] + ldp x23, x24, [x0, #JB_X23<<3] + ldp x25, x26, [x0, #JB_X25<<3] + ldp x27, x28, [x0, #JB_X27<<3] +#ifdef PTR_DEMANGLE + ldp x29, x4, [x0, #JB_X29<<3] + PTR_DEMANGLE (x30, x4, x3, x2) +#else - ldp x29, x30, [x0, #JB_X29<<3] + ldp x29, x30, [x0, #JB_X29<<3] - +#endif - ldp d8, d9, [x0, #JB_D8<<3] - ldp d10, d11, [x0, #JB_D10<<3] - ldp d12, d13, [x0, #JB_D12<<3] + ldp d8, d9, [x0, #JB_D8<<3] + ldp d10, d11, [x0, #JB_D10<<3] + ldp d12, d13, [x0, #JB_D12<<3] @@ -87,8 +91,12 @@ ENTRY (__longjmp) - cfi_same_value(d13) - cfi_same_value(d14) - cfi_same_value(d15) + cfi_same_value(d13) + cfi_same_value(d14) + cfi_same_value(d15) - - ldr x5, [x0, #JB_SP<<3] +#ifdef PTR_DEMANGLE @@ -34,9 +34,9 @@ index 250f2af..2d38bbf 100644 +#else + ldr x5, [x0, #JB_SP<<3] +#endif - mov sp, x5 - cmp x1, #0 - mov x0, #1 + mov sp, x5 + cmp x1, #0 + mov x0, #1 diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h index 84c2ccc..bcf2afa 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h @@ -44,7 +44,7 @@ index 84c2ccc..bcf2afa 100644 @@ -39,6 +39,22 @@ #define JB_D14 20 #define JB_D15 21 - + +#ifndef __ASSEMBLER__ +#include +#include @@ -72,7 +72,7 @@ index 22c6c2b..39a5dc2 100644 @@ -29,16 +29,6 @@ #define _JMPBUF_CFA_UNWINDS_ADJ(jmpbuf, context, adj) \ _JMPBUF_UNWINDS_ADJ (jmpbuf, (void *) _Unwind_GetCFA (context), adj) - + -static inline uintptr_t __attribute__ ((unused)) -_jmpbuf_sp (__jmp_buf jmpbuf) -{ @@ -85,37 +85,37 @@ index 22c6c2b..39a5dc2 100644 - #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) - + diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S index cb94e01..5822abd 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S @@ -39,13 +39,25 @@ ENTRY (__sigsetjmp) - stp x23, x24, [x0, #JB_X23<<3] - stp x25, x26, [x0, #JB_X25<<3] - stp x27, x28, [x0, #JB_X27<<3] + stp x23, x24, [x0, #JB_X23<<3] + stp x25, x26, [x0, #JB_X25<<3] + stp x27, x28, [x0, #JB_X27<<3] + +#ifdef PTR_MANGLE + PTR_MANGLE (x4, x30, x3, x2) + stp x29, x4, [x0, #JB_X29<<3] +#else - stp x29, x30, [x0, #JB_X29<<3] + stp x29, x30, [x0, #JB_X29<<3] +#endif - stp d8, d9, [x0, #JB_D8<<3] - stp d10, d11, [x0, #JB_D10<<3] - stp d12, d13, [x0, #JB_D12<<3] - stp d14, d15, [x0, #JB_D14<<3] + stp d8, d9, [x0, #JB_D8<<3] + stp d10, d11, [x0, #JB_D10<<3] + stp d12, d13, [x0, #JB_D12<<3] + stp d14, d15, [x0, #JB_D14<<3] +#ifdef PTR_MANGLE + mov x4, sp + PTR_MANGLE (x5, x4, x3, x2) + str x5, [x0, #JB_SP<<3] +#else - mov x2, sp - str x2, [x0, #JB_SP<<3] + mov x2, sp + str x2, [x0, #JB_SP<<3] +#endif #if defined NOT_IN_libc && defined IS_IN_rtld - /* In ld.so we never save the signal mask */ - mov w0, #0 + /* In ld.so we never save the signal mask */ + mov w0, #0 diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h index 0dd597a..7169ba7 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h @@ -123,7 +123,7 @@ index 0dd597a..7169ba7 100644 @@ -78,6 +78,17 @@ # define L(name) .L##name #endif - + +/* Load or store to/from a pc-relative EXPR into/from R, using T. */ +#define LDST_PCREL(OP, R, T, EXPR) \ + adrp T, EXPR; \ @@ -143,9 +143,9 @@ index f3f0ada..5ccf1da 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -371,8 +371,44 @@ __local_syscall_error: \ - + #endif /* __ASSEMBLER__ */ - + -/* Pointer mangling is not yet supported for AArch64. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) @@ -188,14 +188,14 @@ index f3f0ada..5ccf1da 100644 +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif - + #endif /* linux/aarch64/sysdep.h */ commit 0b1f8e35640f5b3f7af11764ade3ff060211c309 Author: Carlos O'Donell Date: Mon Sep 23 01:44:38 2013 -0400 BZ #15754: Fix test case for ARM. - + Statically built binaries use __pointer_chk_guard_local, while dynamically built binaries use __pointer_chk_guard. Provide the right definition depending on the test case @@ -207,13 +207,13 @@ index cb8da93..27d249b 100644 +++ glibc-2.17-c758a686/elf/Makefile @@ -1019,6 +1019,9 @@ tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child" tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" - + tst-ptrguard1-ARGS = --command "$(host-built-program-cmd) --child" +# When built statically, the pointer guard interface uses +# __pointer_chk_guard_local. +CFLAGS-tst-ptrguard1-static.c = -DPTRGUARD_LOCAL tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child" - + $(objpfx)tst-leaks1: $(libdl) diff --git glibc-2.17-c758a686/sysdeps/generic/stackguard-macros.h glibc-2.17-c758a686/sysdeps/generic/stackguard-macros.h index 4fa3d96..b4a6b23 100644 @@ -222,7 +222,7 @@ index 4fa3d96..b4a6b23 100644 @@ -3,5 +3,10 @@ extern uintptr_t __stack_chk_guard; #define STACK_CHK_GUARD __stack_chk_guard - + +#ifdef PTRGUARD_LOCAL extern uintptr_t __pointer_chk_guard_local; -#define POINTER_CHK_GUARD __pointer_chk_guard_local diff --git a/SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch b/SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch index e6fdd91f..0afa504a 100644 --- a/SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch +++ b/SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch @@ -3,7 +3,7 @@ Author: Marcus Shawcroft Date: Fri Mar 7 14:05:20 2014 +0000 [PATCH] [AArch64] Optional trapping exceptions support. - + Trapping exceptions in AArch64 are optional. The relevant exception control bits in FPCR are are defined as RES0 hence the absence of support can be detected by reading back the FPCR and comparing with @@ -12,9 +12,9 @@ Date: Fri Mar 7 14:05:20 2014 +0000 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/fpu/feenablxcpt.c +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/fpu/feenablxcpt.c @@ -35,5 +35,18 @@ feenableexcept (int excepts) - + _FPU_SETCW (fpcr); - + + /* Trapping exceptions are optional in AArch64 the relevant enable + bits in FPCR are RES0 hence the absence of support can be + detected by reading back the FPCR and comparing with the required @@ -37,13 +37,13 @@ Date: Fri Mar 7 14:05:20 2014 +0000 fpu_control_t fpcr; fpu_fpsr_t fpsr; + fpu_control_t updated_fpcr; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); @@ -51,6 +52,15 @@ fesetenv (const fenv_t *envp) - + _FPU_SETCW (fpcr); - + + /* Trapping exceptions are optional in AArch64 the relevant enable + bits in FPCR are RES0 hence the absence of support can be + detected by reading back the FPCR and comparing with the required @@ -55,7 +55,7 @@ Date: Fri Mar 7 14:05:20 2014 +0000 + return 0; } - + commit 423a7160af7fcffc61aac5e2e36d0b6b5b083214 Author: Wilco Date: Thu Apr 17 09:39:27 2014 +0100 @@ -71,7 +71,7 @@ Date: Thu Apr 17 09:39:27 2014 +0100 int status; pid_t pid; - fenv_t saved; - + - fegetenv (&saved); - errno = 0; - fesetenv (FE_NOMASK_ENV); @@ -86,7 +86,7 @@ Date: Thu Apr 17 09:39:27 2014 +0100 @@ -349,7 +345,13 @@ feexcp_nomask_test (const char *flag_name, int fe_exc) int status; pid_t pid; - + - printf ("Test: after fedisableexcept (%s) processes will abort\n", + if (1 && feenableexcept (fe_exc) == -1) + { @@ -95,19 +95,19 @@ Date: Thu Apr 17 09:39:27 2014 +0100 + } + + printf ("Test: after feenableexcept (%s) processes will abort\n", - flag_name); + flag_name); printf (" when feraiseexcept (%s) is called.\n", flag_name); pid = fork (); @@ -470,7 +472,6 @@ feenable_test (const char *flag_name, int fe_exc) { int excepts; - + - printf ("Tests for feenableexcepts etc. with flag %s\n", flag_name); - + /* First disable all exceptions. */ @@ -488,8 +489,12 @@ feenable_test (const char *flag_name, int fe_exc) - flag_name, excepts); + flag_name, excepts); ++count_errors; } - diff --git a/SOURCES/glibc-aarch64-ifunc.patch b/SOURCES/glibc-aarch64-ifunc.patch index 62da5556..7ee9f1f0 100644 --- a/SOURCES/glibc-aarch64-ifunc.patch +++ b/SOURCES/glibc-aarch64-ifunc.patch @@ -125,9 +125,9 @@ index 8686fd5..2b10581 100644 #define R_AARCH64_TLS_TPREL64 1030 /* TP-relative offset, 64 bit. */ #define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */ +#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */ - + /* ARM relocs. */ - + diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-irel.h glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-irel.h index 32dee0f..9a48dc2 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-irel.h @@ -138,18 +138,18 @@ index 32dee0f..9a48dc2 100644 - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2014 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 @@ -22,15 +22,31 @@ - + #include #include +#include - + -/* AArch64 does not yet implement IFUNC support. However since - 2011-06-20 provision of a elf_ifunc_invoke has been mandatory. */ +#define ELF_MACHINE_IRELA 1 - + static inline ElfW(Addr) __attribute ((always_inline)) elf_ifunc_invoke (ElfW(Addr) addr) @@ -173,36 +173,36 @@ index 32dee0f..9a48dc2 100644 + else + __libc_fatal ("unexpected reloc type in static binary"); } - + #endif diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-machine.h glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-machine.h index b1878a7..1db5a5b 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-machine.h +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/dl-machine.h @@ -23,6 +23,7 @@ - + #include #include +#include - + /* Return nonzero iff ELF header is compatible with the running host. */ static inline int __attribute__ ((unused)) @@ -336,6 +337,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, - } - break; - + } + break; + + case R_AARCH64_IRELATIVE: + value = map->l_addr + reloc->r_addend; + value = elf_ifunc_invoke (value); + *reloc_addr = value; + break; + - default: - _dl_reloc_bad_type (map, r_type, 0); - break; + default: + _dl_reloc_bad_type (map, r_type, 0); + break; @@ -379,6 +386,13 @@ elf_machine_lazy_rel (struct link_map *map, td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) - + map->l_addr); + + map->l_addr); } + else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE)) + { diff --git a/SOURCES/glibc-aarch64-rh1076760.patch b/SOURCES/glibc-aarch64-rh1076760.patch index e8123e39..801bfd63 100644 --- a/SOURCES/glibc-aarch64-rh1076760.patch +++ b/SOURCES/glibc-aarch64-rh1076760.patch @@ -2,19 +2,19 @@ +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/nptl/tls.h @@ -63,7 +63,7 @@ typedef struct # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) - + /* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread) - + /* This is the size of the TCB. */ # define TLS_TCB_SIZE sizeof (tcbhead_t) @@ -72,7 +72,7 @@ typedef struct # define TLS_PRE_TCB_SIZE sizeof (struct pthread) - + /* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_TCB_ALIGN __alignof__ (struct pthread) - + /* Install the dtv pointer. The pointer passed is to the element with index -1 which contain the length. */ diff --git a/SOURCES/glibc-aarch64-syscall-rewrite.patch b/SOURCES/glibc-aarch64-syscall-rewrite.patch index e0bf93ad..ad4ab32f 100644 --- a/SOURCES/glibc-aarch64-syscall-rewrite.patch +++ b/SOURCES/glibc-aarch64-syscall-rewrite.patch @@ -40,8 +40,8 @@ index 8be1464..d5c31f3 100644 + mov x10, x0 + mov x11, x2 + mov x12, x3 -+ - /* Sanity check args. */ ++ + /* Sanity check args. */ - cbz x0, 1f - cbz x1, 1f - /* Insert the args onto the new stack. */ @@ -49,16 +49,16 @@ index 8be1464..d5c31f3 100644 + mov x0, #-EINVAL + cbz x10, .Lsyscall_error + cbz x1, .Lsyscall_error - - /* Do the system call. */ + + /* Do the system call. */ + /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ - mov x0, x2 /* flags */ + mov x0, x2 /* flags */ - - /* New sp is already in x1. */ - mov x2, x4 /* ptid */ - mov x3, x5 /* tls */ - mov x4, x6 /* ctid */ - + /* New sp is already in x1. */ + mov x2, x4 /* ptid */ + mov x3, x5 /* tls */ + mov x4, x6 /* ctid */ + -#ifdef RESET_PID - /* We rely on the kernel preserving the argument regsiters across a - each system call so that we can inspect the flags against after @@ -66,41 +66,41 @@ index 8be1464..d5c31f3 100644 - mov x5, x0 -#endif - - mov x8, #SYS_ify(clone) + mov x8, #SYS_ify(clone) - /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ - svc 0x0 + svc 0x0 - cfi_endproc - cmp x0, #0 + cmp x0, #0 - beq 2f - blt C_SYMBOL_NAME(__syscall_error) + beq thread_start + blt .Lsyscall_error - RET + RET -1: mov x0, #-EINVAL - b syscall_error +PSEUDO_END (__clone) - + -2: + .align 4 + .type thread_start, %function +thread_start: - cfi_startproc - cfi_undefined (x30) - mov x29, 0 + cfi_startproc + cfi_undefined (x30) + mov x29, 0 + #ifdef RESET_PID - tbnz x5, #CLONE_THREAD_BIT, 3f + tbnz x11, #CLONE_THREAD_BIT, 3f - mov x0, #-1 + mov x0, #-1 - tbnz x5, #CLONE_VM_BIT, 2f + tbnz x11, #CLONE_VM_BIT, 2f - mov x8, #SYS_ify(getpid) - svc 0x0 + mov x8, #SYS_ify(getpid) + svc 0x0 2: @@ -86,18 +83,16 @@ ENTRY(__clone) - sub x1, x1, #PTHREAD_SIZEOF - str w0, [x1, #PTHREAD_PID_OFFSET] - str w0, [x1, #PTHREAD_TID_OFFSET] + sub x1, x1, #PTHREAD_SIZEOF + str w0, [x1, #PTHREAD_PID_OFFSET] + str w0, [x1, #PTHREAD_TID_OFFSET] - 3: #endif @@ -112,22 +112,22 @@ index 8be1464..d5c31f3 100644 + /* Pick the function arg execute. */ + mov x0, x12 + blr x10 - - /* We are done, pass the return value through x0. */ - b HIDDEN_JUMPTARGET(_exit) - cfi_endproc + + /* We are done, pass the return value through x0. */ + b HIDDEN_JUMPTARGET(_exit) + cfi_endproc - cfi_startproc -PSEUDO_END (__clone) + .size thread_start, .-thread_start - + weak_alias (__clone, clone) diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S index f01fb84..be6c026 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S @@ -20,13 +20,12 @@ - - .text + + .text ENTRY(__ioctl) - movz x8, #__NR_ioctl - sxtw x0, w0 @@ -139,11 +139,11 @@ index f01fb84..be6c026 100644 + svc #0x0 + cmn x0, #4095 + b.cs .Lsyscall_error - ret + ret - - PSEUDO_END (__ioctl) +PSEUDO_END (__ioctl) - + weak_alias (__ioctl, ioctl) diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data index 84af95d..dfca9a7 100644 @@ -159,7 +159,7 @@ index e0e5cc0..a3b9284 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h @@ -26,119 +26,60 @@ - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ - .section ".text"; \ @@ -248,7 +248,7 @@ index e0e5cc0..a3b9284 100644 +# define DOCARGS_4 DOCARGS_3; str x3, [sp, 32] +# define DOCARGS_5 DOCARGS_3; stp x3, x4, [sp, 32] +# define DOCARGS_6 DOCARGS_5; str x5, [sp, 48] - + # define UNDOCARGS_0 - -# define DOCARGS_1 \ @@ -327,7 +327,7 @@ index e0e5cc0..a3b9284 100644 +# define UNDOCARGS_4 UNDOCARGS_2; ldp x2, x3, [sp, 24] +# define UNDOCARGS_5 UNDOCARGS_3; ldp x3, x4, [sp, 32] +# define UNDOCARGS_6 UNDOCARGS_4; ldp x4, x5, [sp, 40] - + # ifdef IS_IN_libpthread # define CENABLE bl __pthread_enable_asynccancel @@ -160,11 +101,9 @@ @@ -347,7 +347,7 @@ index e0e5cc0..a3b9284 100644 /* There is no __local_multiple_threads for librt, so use the TCB. */ @@ -173,20 +112,10 @@ extern int __local_multiple_threads attribute_hidden; __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ - header.multiple_threads) == 0, 1) + header.multiple_threads) == 0, 1) # else -# define SINGLE_THREAD_P \ - stp x0, x30, [sp, -16]!; \ @@ -369,18 +369,18 @@ index e0e5cc0..a3b9284 100644 + ldr w##R, [x##R, PTHREAD_MULTIPLE_THREADS_OFFSET] # endif # endif - + diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S index 574fdf1..fac6416 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S @@ -37,8 +37,6 @@ ENTRY (syscall) - mov x6, x7 - svc 0x0 - cmn x0, #4095 + mov x6, x7 + svc 0x0 + cmn x0, #4095 - b.cs 1f + b.cs .Lsyscall_error - RET + RET -1: - b SYSCALL_ERROR PSEUDO_END (syscall) @@ -407,13 +407,13 @@ index 713bf7d..9961c03 100644 -# define ret PSEUDO_RET + cmn x0, #4095; \ + b.cs .Lsyscall_error - + # undef PSEUDO_END # define PSEUDO_END(name) \ @@ -83,15 +72,7 @@ ENTRY (name); \ DO_CALL (syscall_name, args); - + -/* Notice the use of 'RET' instead of 'ret' the assembler is case - insensitive and eglibc already uses the preprocessor symbol 'ret' - so we use the upper case 'RET' to force through a ret instruction @@ -424,16 +424,16 @@ index 713bf7d..9961c03 100644 -# undef ret_NOERRNO -# define ret_NOERRNO PSEUDO_RET_NOERRNO +# define ret_NOERRNO ret - + # undef PSEUDO_END_NOERRNO # define PSEUDO_END_NOERRNO(name) \ @@ -109,47 +90,38 @@ # define PSEUDO_END_ERRVAL(name) \ END (name) - + -# define ret_ERRVAL PSEUDO_RET_NOERRNO +# define ret_ERRVAL ret - + +# define SYSCALL_ERROR .Lsyscall_error # if NOT_IN_libc -# define SYSCALL_ERROR __local_syscall_error @@ -441,15 +441,15 @@ index 713bf7d..9961c03 100644 # define SYSCALL_ERROR_HANDLER \ -__local_syscall_error: \ +.Lsyscall_error: \ - adrp x1, C_SYMBOL_NAME(rtld_errno); \ + adrp x1, C_SYMBOL_NAME(rtld_errno); \ - add x1, x1, #:lo12:C_SYMBOL_NAME(rtld_errno); \ - neg w0, w0; \ + neg w0, w0; \ - str w0, [x1]; \ + str w0, [x1, :lo12:C_SYMBOL_NAME(rtld_errno)]; \ - mov x0, -1; \ - RET; + mov x0, -1; \ + RET; # else - + # define SYSCALL_ERROR_HANDLER \ -__local_syscall_error: \ - stp x29, x30, [sp, -32]!; \ @@ -466,14 +466,14 @@ index 713bf7d..9961c03 100644 + neg w2, w0; \ + ldr x1, [x1, :gottprel_lo12:errno]; \ + mrs x3, tpidr_el0; \ - mov x0, -1; \ + mov x0, -1; \ - ldr x19, [sp,16]; \ - ldp x29, x30, [sp], 32; \ - cfi_adjust_cfa_offset (-32); \ - cfi_restore (x29); \ - cfi_restore (x30); \ + str w2, [x1, x3]; \ - RET; + RET; # endif # else -# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ @@ -482,15 +482,15 @@ index 713bf7d..9961c03 100644 +.Lsyscall_error: \ + b __syscall_error; # endif - + /* Linux takes system call args in registers: - syscall number in the SVC instruction + syscall number x8 - arg 1 x0 - arg 2 x1 - arg 3 x2 + arg 1 x0 + arg 2 x1 + arg 3 x2 @@ -177,28 +149,8 @@ __local_syscall_error: \ - + # undef DO_CALL # define DO_CALL(syscall_name, args) \ - DOARGS_##args \ @@ -516,24 +516,25 @@ index 713bf7d..9961c03 100644 -# define UNDOARGS_6 /* nothing */ -# define UNDOARGS_7 /* nothing */ + svc 0 - + #else /* not __ASSEMBLER__ */ - + diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S index f2dc49b..3fb68b9 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S @@ -38,10 +38,8 @@ ENTRY (__vfork) - RESTORE_PID + RESTORE_PID #endif - cmn x0, #4095 + cmn x0, #4095 - b.cs 1f + b.cs .Lsyscall_error - RET + RET -1: - b SYSCALL_ERROR - + PSEUDO_END (__vfork) libc_hidden_def (__vfork) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-arm-hardfloat-3.patch b/SOURCES/glibc-arm-hardfloat-3.patch index 5bbe5fc3..d9bebf3c 100644 --- a/SOURCES/glibc-arm-hardfloat-3.patch +++ b/SOURCES/glibc-arm-hardfloat-3.patch @@ -4,18 +4,19 @@ diff -Nru glibc-2.17-c758a686/elf/dl-load.c glibc-2.17-c758a686/elf/dl-load.c --- glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:07:41.727524312 -0600 +++ glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:11:19.308681002 -0600 @@ -2093,10 +2093,14 @@ _dl_map_object (struct link_map *loader, - soname = ((const char *) D_PTR (l, l_info[DT_STRTAB]) - + l->l_info[DT_SONAME]->d_un.d_val); - if (strcmp (name, soname) != 0) + soname = ((const char *) D_PTR (l, l_info[DT_STRTAB]) + + l->l_info[DT_SONAME]->d_un.d_val); + if (strcmp (name, soname) != 0) - continue; +#ifdef __arm__ + if (strcmp (name, "ld-linux.so.3") + || strcmp (soname, "ld-linux-armhf.so.3")) +#endif + continue; - - /* We have a match on a new name -- cache it. */ + + /* We have a match on a new name -- cache it. */ - add_name_to_object (l, soname); + add_name_to_object (l, name); - l->l_soname_added = 1; - } + l->l_soname_added = 1; + } + diff --git a/SOURCES/glibc-fedora-__libc_multiple_libcs.patch b/SOURCES/glibc-fedora-__libc_multiple_libcs.patch index 2dd43ef5..54c6d427 100644 --- a/SOURCES/glibc-fedora-__libc_multiple_libcs.patch +++ b/SOURCES/glibc-fedora-__libc_multiple_libcs.patch @@ -20,19 +20,19 @@ Subject: [PATCH] Properly set __libc_multiple_libcs @@ -23,11 +23,9 @@ /* Type of the initializer. */ typedef void (*init_t) (int, char **, char **); - + -#ifndef HAVE_INLINED_SYSCALLS /* Flag, nonzero during startup phase. */ extern int _dl_starting_up; extern int _dl_starting_up_internal attribute_hidden; -#endif - - + + static void @@ -132,9 +130,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env) while (i-- > 0) call_init (main_map->l_initfini[i], argc, argv, env); - + -#ifndef HAVE_INLINED_SYSCALLS /* Finished starting up. */ INTUSE(_dl_starting_up) = 0; @@ -44,12 +44,12 @@ Subject: [PATCH] Properly set __libc_multiple_libcs @@ -81,10 +81,8 @@ unsigned long long _dl_load_adds; create a fake scope containing nothing. */ struct r_scope_elem _dl_initial_searchlist; - + -#ifndef HAVE_INLINED_SYSCALLS /* Nonzero during startup. */ int _dl_starting_up = 1; -#endif - + /* Random data provided by the kernel. */ void *_dl_random; --- glibc-2.17-c758a686/elf/rtld.c @@ -57,7 +57,7 @@ Subject: [PATCH] Properly set __libc_multiple_libcs @@ -106,7 +106,6 @@ static struct audit_list struct audit_list *next; } *audit_list; - + -#ifndef HAVE_INLINED_SYSCALLS /* Set nonzero during loading and initialization of executable and libraries, cleared before the executable's entry point runs. This @@ -67,17 +67,17 @@ Subject: [PATCH] Properly set __libc_multiple_libcs int _dl_starting_up = 0; INTVARDEF(_dl_starting_up) -#endif - + /* This is the structure which defines all variables global to ld.so (except those which cannot be added for some reason). */ @@ -929,10 +927,8 @@ dl_main (const ElfW(Phdr) *phdr, /* Process the environment variable which control the behaviour. */ process_envvars (&mode); - + -#ifndef HAVE_INLINED_SYSCALLS /* Set up a flag which tells we are just starting. */ INTUSE(_dl_starting_up) = 1; -#endif - + if (*user_entry == (ElfW(Addr)) ENTRY_POINT) { diff --git a/SOURCES/glibc-fedora-elf-ORIGIN.patch b/SOURCES/glibc-fedora-elf-ORIGIN.patch index 2002969a..581f2cf2 100644 --- a/SOURCES/glibc-fedora-elf-ORIGIN.patch +++ b/SOURCES/glibc-fedora-elf-ORIGIN.patch @@ -18,8 +18,8 @@ index 18a83d2..6e16a9a 100644 --- glibc-2.17-c758a686/elf/dl-load.c +++ glibc-2.17-c758a686/elf/dl-load.c @@ -249,8 +249,7 @@ is_trusted_path_normalize (const char *path, size_t len) - - + + static size_t -is_dst (const char *start, const char *name, const char *str, - int is_path, int secure) @@ -28,9 +28,9 @@ index 18a83d2..6e16a9a 100644 size_t len; bool is_curly = false; @@ -279,12 +278,6 @@ is_dst (const char *start, const char *name, const char *str, - && (!is_path || name[len] != ':')) + && (!is_path || name[len] != ':')) return 0; - + - if (__builtin_expect (secure, 0) - && ((name[len] != '\0' && name[len] != '/' - && (!is_path || name[len] != ':')) @@ -39,11 +39,11 @@ index 18a83d2..6e16a9a 100644 - return len; } - + @@ -299,13 +292,10 @@ _dl_dst_count (const char *name, int is_path) { size_t len; - + - /* $ORIGIN is not expanded for SUID/GUID programs (except if it - is $ORIGIN alone) and it must always appear first in path. */ ++name; @@ -54,17 +54,17 @@ index 18a83d2..6e16a9a 100644 + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0 + || (len = is_dst (start, name, "PLATFORM", is_path)) != 0 + || (len = is_dst (start, name, "LIB", is_path)) != 0) - ++cnt; - + ++cnt; + name = strchr (name + len, '$'); @@ -338,9 +328,16 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, - size_t len; - - ++name; + size_t len; + + ++name; - if ((len = is_dst (start, name, "ORIGIN", is_path, - INTUSE(__libc_enable_secure))) != 0) + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0) - { + { + /* For SUID/GUID programs $ORIGIN must always appear + first in a path element. */ + if (__builtin_expect (INTUSE(__libc_enable_secure), 0) @@ -74,25 +74,25 @@ index 18a83d2..6e16a9a 100644 + repl = (const char *) -1; + else #ifndef SHARED - if (l == NULL) - repl = _dl_get_origin (); + if (l == NULL) + repl = _dl_get_origin (); @@ -351,9 +348,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, - check_for_trusted = (INTUSE(__libc_enable_secure) - && l->l_type == lt_executable); - } + check_for_trusted = (INTUSE(__libc_enable_secure) + && l->l_type == lt_executable); + } - else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0) + else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0) - repl = GLRO(dl_platform); + repl = GLRO(dl_platform); - else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0) + else if ((len = is_dst (start, name, "LIB", is_path)) != 0) - repl = DL_DST_LIB; - - if (repl != NULL && repl != (const char *) -1) + repl = DL_DST_LIB; + + if (repl != NULL && repl != (const char *) -1) @@ -373,6 +370,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, - element, but keep an empty element at the end. */ - if (wp == result && is_path && *name == ':' && name[1] != '\0') - ++name; + element, but keep an empty element at the end. */ + if (wp == result && is_path && *name == ':' && name[1] != '\0') + ++name; + check_for_trusted = false; - } - else - /* No DST we recognize. */ + } + else + /* No DST we recognize. */ diff --git a/SOURCES/glibc-fedora-elf-init-hidden_undef.patch b/SOURCES/glibc-fedora-elf-init-hidden_undef.patch index 30f618ba..df667ec9 100644 --- a/SOURCES/glibc-fedora-elf-init-hidden_undef.patch +++ b/SOURCES/glibc-fedora-elf-init-hidden_undef.patch @@ -7,7 +7,7 @@ diff -Nru glibc-2.17-c758a686/csu/elf-init.c glibc-2.17-c758a686/csu/elf-init.c @@ -63,6 +63,23 @@ extern void (*__init_array_end []) (int, extern void (*__fini_array_start []) (void) attribute_hidden; extern void (*__fini_array_end []) (void) attribute_hidden; - + +#if defined HAVE_VISIBILITY_ATTRIBUTE \ + && (defined SHARED || defined LIBC_NONSHARED) +# define hidden_undef_2(x) #x @@ -25,6 +25,6 @@ diff -Nru glibc-2.17-c758a686/csu/elf-init.c glibc-2.17-c758a686/csu/elf-init.c +hidden_undef (__init_array_end) +hidden_undef (__fini_array_start) +hidden_undef (__fini_array_end) - + /* These function symbols are provided for the .init/.fini section entry points automagically by the linker. */ diff --git a/SOURCES/glibc-fedora-elf-rh737223.patch b/SOURCES/glibc-fedora-elf-rh737223.patch index 860a3d57..376f6874 100644 --- a/SOURCES/glibc-fedora-elf-rh737223.patch +++ b/SOURCES/glibc-fedora-elf-rh737223.patch @@ -3,13 +3,13 @@ diff -Nru glibc-2.17-c758a686/elf/setup-vdso.h glibc-2.17-c758a686/elf/setup-vds --- glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-10 21:34:38.000000000 -0600 +++ glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-11 09:43:14.152958832 -0600 @@ -93,7 +93,9 @@ setup_vdso (struct link_map *main_map __ - char *copy = malloc (len); - if (copy == NULL) - _dl_fatal_printf ("out of memory\n"); + char *copy = malloc (len); + if (copy == NULL) + _dl_fatal_printf ("out of memory\n"); - l->l_libname->name = l->l_name = memcpy (copy, dsoname, len); + l->l_libname->name = memcpy (copy, dsoname, len); + if (GLRO(dl_debug_mask)) + l->l_name = copy; - } - + } + /* Add the vDSO to the object list. */ diff --git a/SOURCES/glibc-fedora-gai-canonical.patch b/SOURCES/glibc-fedora-gai-canonical.patch index 419c0036..7f767aed 100644 --- a/SOURCES/glibc-fedora-gai-canonical.patch +++ b/SOURCES/glibc-fedora-gai-canonical.patch @@ -10,24 +10,24 @@ Date: Tue Oct 15 10:21:13 2013 +0200 --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -565,8 +565,8 @@ gaih_inet (const char *name, const struct gaih_service *service, - - /* If we do not have to look for IPv6 addresses, use - the simple, old functions, which do not support + + /* If we do not have to look for IPv6 addresses, use + the simple, old functions, which do not support - IPv6 scope ids. */ - if (req->ai_family == AF_INET) + IPv6 scope ids, nor retrieving the canonical name. */ + if (req->ai_family == AF_INET && (req->ai_flags & AI_CANONNAME) == 0) - { - /* Allocate additional room for struct host_data. */ - size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*) + { + /* Allocate additional room for struct host_data. */ + size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*) @@ -1107,70 +1107,10 @@ gaih_inet (const char *name, const struct gaih_service *service, - /* Only the first entry gets the canonical name. */ - if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0) - { + /* Only the first entry gets the canonical name. */ + if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0) + { - char *tmpbuf2 = NULL; - bool malloc_tmpbuf2 = false; - - if (canon == NULL) + if (canon == NULL) - { - struct hostent *h = NULL; - int herrno; @@ -91,34 +91,34 @@ Date: Tue Oct 15 10:21:13 2013 +0200 + /* If the canonical name cannot be determined, use + the passed in string. */ + canon = orig_name; - + #ifdef HAVE_LIBIDN - if (req->ai_flags & AI_CANONIDN) + if (req->ai_flags & AI_CANONIDN) @@ -1185,9 +1125,6 @@ gaih_inet (const char *name, const struct gaih_service *service, - int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags); - if (rc != IDNA_SUCCESS) - { + int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags); + if (rc != IDNA_SUCCESS) + { - if (malloc_tmpbuf2) - free (tmpbuf2); - - if (rc == IDNA_MALLOC_ERROR) - result = -EAI_MEMORY; - else if (rc == IDNA_DLOPEN_ERROR) + if (rc == IDNA_MALLOC_ERROR) + result = -EAI_MEMORY; + else if (rc == IDNA_DLOPEN_ERROR) @@ -1217,17 +1154,11 @@ gaih_inet (const char *name, const struct gaih_service *service, - canon = strdup (canon); - if (canon == NULL) - { + canon = strdup (canon); + if (canon == NULL) + { - if (malloc_tmpbuf2) - free (tmpbuf2); - - result = -EAI_MEMORY; - goto free_and_return; - } - } - } + result = -EAI_MEMORY; + goto free_and_return; + } + } + } - - if (malloc_tmpbuf2) - free (tmpbuf2); - } - - family = at2->family; + } + + family = at2->family; diff --git a/SOURCES/glibc-fedora-getrlimit-PLT.patch b/SOURCES/glibc-fedora-getrlimit-PLT.patch index 94495ead..43cabea8 100644 --- a/SOURCES/glibc-fedora-getrlimit-PLT.patch +++ b/SOURCES/glibc-fedora-getrlimit-PLT.patch @@ -9,9 +9,9 @@ Date: Sat Dec 6 23:40:48 2014 +0000 --- glibc-2.17-c758a686/include/sys/resource.h +++ glibc-2.17-c758a686/include/sys/resource.h @@ -14,5 +14,6 @@ extern int __getrusage (enum __rusage_who __who, struct rusage *__usage) - + extern int __setrlimit (enum __rlimit_resource __resource, - const struct rlimit *__rlimits); + const struct rlimit *__rlimits); +libc_hidden_proto (__getrlimit) #endif #endif @@ -23,12 +23,12 @@ Date: Sat Dec 6 23:40:48 2014 +0000 } +libc_hidden_def (__getrlimit) weak_alias (__getrlimit, getrlimit) - + stub_warning (getrlimit) --- glibc-2.17-c758a686/sysdeps/mach/hurd/getrlimit.c +++ glibc-2.17-c758a686/sysdeps/mach/hurd/getrlimit.c @@ -43,4 +43,5 @@ __getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits) - + return 0; } +libc_hidden_def (__getrlimit) diff --git a/SOURCES/glibc-fedora-i386-tls-direct-seg-refs.patch b/SOURCES/glibc-fedora-i386-tls-direct-seg-refs.patch index 3f9d89ec..451ebf98 100644 --- a/SOURCES/glibc-fedora-i386-tls-direct-seg-refs.patch +++ b/SOURCES/glibc-fedora-i386-tls-direct-seg-refs.patch @@ -2,7 +2,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/i386/Makefile glibc-2.17-c758a686/sysdeps/ --- glibc-2.17-c758a686/sysdeps/i386/Makefile 2012-06-05 07:42:49.000000000 -0600 +++ glibc-2.17-c758a686/sysdeps/i386/Makefile 2012-06-07 12:15:21.826318641 -0600 @@ -62,6 +64,14 @@ endif - + ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS))) defines += -DNO_TLS_DIRECT_SEG_REFS +else @@ -14,5 +14,5 @@ diff -Nru glibc-2.17-c758a686/sysdeps/i386/Makefile glibc-2.17-c758a686/sysdeps/ +CPPFLAGS-.oS += -DNO_TLS_DIRECT_SEG_REFS +CFLAGS-.oS += -mno-tls-direct-seg-refs endif - + ifeq ($(subdir),elf) diff --git a/SOURCES/glibc-fedora-ldd.patch b/SOURCES/glibc-fedora-ldd.patch index 2f2bd2a3..28f18d34 100644 --- a/SOURCES/glibc-fedora-ldd.patch +++ b/SOURCES/glibc-fedora-ldd.patch @@ -28,7 +28,7 @@ Date: Wed Aug 16 15:59:55 2017 +0200 # This can be a non-ELF binary or no binary at all. nonelf "$file" || { @@ -185,7 +173,7 @@ warning: you do not have execution permission for" "\`$file'" >&2 - result=1 + result=1 } ;; - 2) diff --git a/SOURCES/glibc-fedora-linux-tcsetattr.patch b/SOURCES/glibc-fedora-linux-tcsetattr.patch index 3ce8ff32..e47d5ecc 100644 --- a/SOURCES/glibc-fedora-linux-tcsetattr.patch +++ b/SOURCES/glibc-fedora-linux-tcsetattr.patch @@ -6,13 +6,13 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/tcsetattr.c glibc-2.17-c75 struct __kernel_termios k_termios; unsigned long int cmd; + int retval; - + switch (optional_actions) { @@ -79,6 +80,35 @@ tcsetattr (fd, optional_actions, termios memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0], - __KERNEL_NCCS * sizeof (cc_t)); - + __KERNEL_NCCS * sizeof (cc_t)); + - return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios); + retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios); + diff --git a/SOURCES/glibc-fedora-localedef.patch b/SOURCES/glibc-fedora-localedef.patch index 5cb2bab0..41deb0ab 100644 --- a/SOURCES/glibc-fedora-localedef.patch +++ b/SOURCES/glibc-fedora-localedef.patch @@ -2,10 +2,10 @@ diff -Nru glibc-2.17-c758a686/localedata/Makefile glibc-2.17-c758a686/localedata --- glibc-2.17-c758a686/localedata/Makefile 2012-06-05 07:42:49.000000000 -0600 +++ glibc-2.17-c758a686/localedata/Makefile 2012-06-07 12:15:21.776318827 -0600 @@ -211,6 +211,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-lo - echo -n '...'; \ - input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \ - $(LOCALEDEF) --alias-file=../intl/locale.alias \ + echo -n '...'; \ + input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \ + $(LOCALEDEF) --alias-file=../intl/locale.alias \ + --no-archive \ - -i locales/$$input -c -f charmaps/$$charset \ - $(addprefix --prefix=,$(install_root)) $$locale; \ - echo ' done'; \ + -i locales/$$input -c -f charmaps/$$charset \ + $(addprefix --prefix=,$(install_root)) $$locale; \ + echo ' done'; \ diff --git a/SOURCES/glibc-fedora-locarchive.patch b/SOURCES/glibc-fedora-locarchive.patch index fe779d90..245850a5 100644 --- a/SOURCES/glibc-fedora-locarchive.patch +++ b/SOURCES/glibc-fedora-locarchive.patch @@ -5,47 +5,47 @@ diff -Nru glibc-2.17-c758a686/ChangeLog.17 glibc-2.17-c758a686/ChangeLog.17 --- glibc-2.17-c758a686/ChangeLog.17 2012-06-05 07:42:49.000000000 -0600 +++ glibc-2.17-c758a686/ChangeLog.17 2012-06-07 12:15:21.564319619 -0600 @@ -11818,6 +11829,10 @@ d2009-10-30 Ulrich Drepper + + * locale/programs/locarchive.c (add_alias, insert_name): Remove static. + 2007-04-16 Ulrich Drepper - - [BZ #4364] + + [BZ #4364] diff -Nru glibc-2.17-c758a686/locale/programs/locarchive.c glibc-2.17-c758a686/locale/programs/locarchive.c --- glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-05 07:42:49.000000000 -0600 +++ glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-07 12:15:21.585319540 -0600 @@ -252,9 +252,9 @@ oldlocrecentcmp (const void *a, const vo /* forward decls for below */ static uint32_t add_locale (struct locarhandle *ah, const char *name, - locale_data_t data, bool replace); + locale_data_t data, bool replace); -static void add_alias (struct locarhandle *ah, const char *alias, - bool replace, const char *oldname, - uint32_t *locrec_offset_p); +void add_alias (struct locarhandle *ah, const char *alias, + bool replace, const char *oldname, + uint32_t *locrec_offset_p); - - + + static bool @@ -635,7 +635,7 @@ close_archive (struct locarhandle *ah) #include "../../intl/explodename.c" #include "../../intl/l10nflist.c" - + -static struct namehashent * +struct namehashent * insert_name (struct locarhandle *ah, - const char *name, size_t name_len, bool replace) + const char *name, size_t name_len, bool replace) { @@ -693,7 +693,7 @@ insert_name (struct locarhandle *ah, return &namehashtab[idx]; } - + -static void +void add_alias (struct locarhandle *ah, const char *alias, bool replace, - const char *oldname, uint32_t *locrec_offset_p) + const char *oldname, uint32_t *locrec_offset_p) { diff --git a/SOURCES/glibc-fedora-manual-dircategory.patch b/SOURCES/glibc-fedora-manual-dircategory.patch index 8fc2babc..9dce8321 100644 --- a/SOURCES/glibc-fedora-manual-dircategory.patch +++ b/SOURCES/glibc-fedora-manual-dircategory.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Change @dircategory. +++ glibc-2.17-c758a686/manual/libc.texinfo @@ -7,7 +7,7 @@ @include macros.texi - + @comment Tell install-info what to do. -@dircategory Software libraries +@dircategory Libraries diff --git a/SOURCES/glibc-fedora-nptl-linklibc.patch b/SOURCES/glibc-fedora-nptl-linklibc.patch index e679fa19..e6866ee5 100644 --- a/SOURCES/glibc-fedora-nptl-linklibc.patch +++ b/SOURCES/glibc-fedora-nptl-linklibc.patch @@ -3,7 +3,7 @@ diff -Nru glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile 2012-06-07 12:15:21.816318678 -0600 @@ -529,15 +529,19 @@ $(addprefix $(objpfx), \ $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \ - $(objpfx)libpthread_nonshared.a + $(objpfx)libpthread_nonshared.a $(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so -# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, +# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so, @@ -14,7 +14,7 @@ diff -Nru glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile $(objpfx)libpthread_nonshared.a $(objpfx)../libc.so: $(common-objpfx)libc.so ; $(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a - + $(objpfx)tst-atfork2.out: $(objpfx)tst-atfork2mod.so + +$(objpfx)linklibc.so: $(common-objpfx)libc.so diff --git a/SOURCES/glibc-fedora-nscd.patch b/SOURCES/glibc-fedora-nscd.patch index 68294631..b236ecc4 100644 --- a/SOURCES/glibc-fedora-nscd.patch +++ b/SOURCES/glibc-fedora-nscd.patch @@ -8,5 +8,5 @@ diff -Nru glibc-2.17-c758a686/nscd/nscd.conf glibc-2.17-c758a686/nscd/nscd.conf -# server-user nobody + server-user nscd # stat-user somebody - debug-level 0 + debug-level 0 # reload-count 5 diff --git a/SOURCES/glibc-fedora-ppc-unwind.patch b/SOURCES/glibc-fedora-ppc-unwind.patch index df44802b..28a1e585 100644 --- a/SOURCES/glibc-fedora-ppc-unwind.patch +++ b/SOURCES/glibc-fedora-ppc-unwind.patch @@ -15,7 +15,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/Makefile glibc-2.17-c758 @@ -35,6 +35,8 @@ CFLAGS-rtld-memmove.os = $(no-special-re CFLAGS-rtld-memchr.os = $(no-special-regs) CFLAGS-rtld-strnlen.os = $(no-special-regs) - + +CFLAGS-libc-start.c += -fno-asynchronous-unwind-tables + ifeq ($(subdir),csu) diff --git a/SOURCES/glibc-fedora-regcomp-sw11561.patch b/SOURCES/glibc-fedora-regcomp-sw11561.patch index 44c4d5b5..3366dd94 100644 --- a/SOURCES/glibc-fedora-regcomp-sw11561.patch +++ b/SOURCES/glibc-fedora-regcomp-sw11561.patch @@ -23,13 +23,13 @@ elements compare against the byte sequence of it, not its name. --- glibc-2.17-c758a686/posix/regcomp.c +++ glibc-2.17-c758a686/posix/regcomp.c @@ -2772,40 +2772,29 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - + /* Local function for parse_bracket_exp used in _LIBC environement. Seek the collating symbol entry correspondings to NAME. - Return the index of the symbol in the SYMB_TABLE. */ + Return the index of the symbol in the SYMB_TABLE, + or -1 if not found. */ - + auto inline int32_t __attribute ((always_inline)) - seek_collating_symbol_entry (name, name_len) @@ -57,7 +57,7 @@ elements compare against the byte sequence of it, not its name. - break; - } + int32_t elem; - + - /* Next entry. */ - elem += second; - } @@ -79,10 +79,10 @@ elements compare against the byte sequence of it, not its name. + } + return -1; } - + /* Local function for parse_bracket_exp used in _LIBC environment. @@ -2814,8 +2803,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - + auto inline unsigned int __attribute ((always_inline)) - lookup_collation_sequence_value (br_elem) @@ -90,27 +90,27 @@ elements compare against the byte sequence of it, not its name. + lookup_collation_sequence_value (bracket_elem_t *br_elem) { if (br_elem->type == SB_CHAR) - { + { @@ -2843,7 +2831,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - int32_t elem, idx; - elem = seek_collating_symbol_entry (br_elem->opr.name, - sym_name_len); + int32_t elem, idx; + elem = seek_collating_symbol_entry (br_elem->opr.name, + sym_name_len); - if (symb_table[2 * elem] != 0) + if (elem != -1) - { - /* We found the entry. */ - idx = symb_table[2 * elem + 1]; + { + /* We found the entry. */ + idx = symb_table[2 * elem + 1]; @@ -2861,7 +2849,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - /* Return the collation sequence value. */ - return *(unsigned int *) (extra + idx); - } + /* Return the collation sequence value. */ + return *(unsigned int *) (extra + idx); + } - else if (symb_table[2 * elem] == 0 && sym_name_len == 1) + else if (sym_name_len == 1) - { - /* No valid character. Match it as a single byte - character. */ + { + /* No valid character. Match it as a single byte + character. */ @@ -2883,11 +2871,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - + auto inline reg_errcode_t __attribute ((always_inline)) - build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem) @@ -124,7 +124,7 @@ elements compare against the byte sequence of it, not its name. unsigned int ch; uint32_t start_collseq; @@ -2966,25 +2951,22 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, - + auto inline reg_errcode_t __attribute ((always_inline)) - build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name) @@ -138,18 +138,18 @@ elements compare against the byte sequence of it, not its name. int32_t elem, idx; size_t name_len = strlen ((const char *) name); if (nrules != 0) - { - elem = seek_collating_symbol_entry (name, name_len); + { + elem = seek_collating_symbol_entry (name, name_len); - if (symb_table[2 * elem] != 0) + if (elem != -1) - { - /* We found the entry. */ - idx = symb_table[2 * elem + 1]; - /* Skip the name of collating element name. */ - idx += 1 + extra[idx]; - } + { + /* We found the entry. */ + idx = symb_table[2 * elem + 1]; + /* Skip the name of collating element name. */ + idx += 1 + extra[idx]; + } - else if (symb_table[2 * elem] == 0 && name_len == 1) + else if (name_len == 1) - { - /* No valid character, treat it as a normal - character. */ + { + /* No valid character, treat it as a normal + character. */ diff --git a/SOURCES/glibc-fedora-streams-rh436349.patch b/SOURCES/glibc-fedora-streams-rh436349.patch index 597c9708..6b862db0 100644 --- a/SOURCES/glibc-fedora-streams-rh436349.patch +++ b/SOURCES/glibc-fedora-streams-rh436349.patch @@ -9,7 +9,7 @@ diff -Nru glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h glib @@ -188,4 +188,7 @@ /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 - + +/* Streams are not available. */ +#define _XOPEN_STREAMS -1 + @@ -20,9 +20,9 @@ diff -Nru glibc-2.17-c758a686/streams/Makefile glibc-2.17-c758a686/streams/Makef @@ -20,7 +20,7 @@ # subdir := streams - + -headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h +#headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h routines = isastream getmsg getpmsg putmsg putpmsg fattach fdetach - + include ../Rules diff --git a/SOURCES/glibc-fedora-uname-getrlimit.patch b/SOURCES/glibc-fedora-uname-getrlimit.patch index c137a121..3529d0cf 100644 --- a/SOURCES/glibc-fedora-uname-getrlimit.patch +++ b/SOURCES/glibc-fedora-uname-getrlimit.patch @@ -18,7 +18,7 @@ be used nowadays to change the uname result. + __getrlimit; } } - + --- glibc-2.17-c758a686/nptl/nptl-init.c +++ glibc-2.17-c758a686/nptl/nptl-init.c @@ -414,7 +414,7 @@ __pthread_initialize_minimal_internal (void) @@ -43,7 +43,7 @@ be used nowadays to change the uname result. +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/smp.h @@ -36,7 +36,7 @@ is_smp_system (void) char *cp; - + /* Try reading the number using `sysctl' first. */ - if (uname (&u.uts) == 0) + if (__uname (&u.uts) == 0) diff --git a/SOURCES/glibc-fix-test-write-buf-size.patch b/SOURCES/glibc-fix-test-write-buf-size.patch index 57e796a7..104b97b8 100644 --- a/SOURCES/glibc-fix-test-write-buf-size.patch +++ b/SOURCES/glibc-fix-test-write-buf-size.patch @@ -1,29 +1,29 @@ # This patch fixes tst-cancel4, tst-cancel5, tst-cancelx4 and tst-cancelx5 -# failures on newer kernels where the write buffers are larger. +# failures on newer kernels where the write buffers are larger. # # commit e7074e4c5edb0acaa979ea08e533736f906a9d68 # Author: David S. Miller # Date: Tue Jul 23 02:31:37 2013 -0700 -# +# # Increase nptl test case buffer size so we really block on current Linux kernels. -# +# # * tst-cancel4.c (WRITE_BUFFER_SIZE): Increase to 16384. -# +# # commit 135529b443631f840cc66d0cc395f79c416434d9 # Author: David S. Miller # Date: Tue Jul 23 11:31:39 2013 -0700 -# +# # Remove Linux kernel version ambiguity in comment added by previous commit. -# +# # * tst-cancel4.c (WRITE_BUFFER_SIZE): Adjust comment. -# +# diff -urN glibc-2.17-c758a686/nptl/tst-cancel4.c glibc-2.17-c758a686/nptl/tst-cancel4.c --- glibc-2.17-c758a686/nptl/tst-cancel4.c 2014-07-25 22:07:09.130021164 -0400 +++ glibc-2.17-c758a686/nptl/tst-cancel4.c 2014-07-25 22:12:07.580022919 -0400 @@ -83,7 +83,30 @@ # define IPC_ADDVAL 0 #endif - + -#define WRITE_BUFFER_SIZE 4096 +/* The WRITE_BUFFER_SIZE value needs to be choosen such that if we set + the socket send buffer size to '1', a write of this size on that @@ -49,6 +49,6 @@ diff -urN glibc-2.17-c758a686/nptl/tst-cancel4.c glibc-2.17-c758a686/nptl/tst-ca + slack space. */ + +#define WRITE_BUFFER_SIZE 16384 - + /* Cleanup handling test. */ static int cl_called; diff --git a/SOURCES/glibc-gmake.patch b/SOURCES/glibc-gmake.patch index 883c1b85..8431c0ef 100644 --- a/SOURCES/glibc-gmake.patch +++ b/SOURCES/glibc-gmake.patch @@ -22,7 +22,7 @@ diff -urN glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure + 3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; - + diff -urN glibc-2.17-c758a686/configure.in glibc-2.17-c758a686/configure.in --- glibc-2.17-c758a686/configure.in 2015-01-15 16:32:14.781441511 -0500 +++ glibc-2.17-c758a686/configure.in 2015-01-15 16:32:34.970817501 -0500 @@ -32,6 +32,6 @@ diff -urN glibc-2.17-c758a686/configure.in glibc-2.17-c758a686/configure.in [GNU Make[^0-9]*\([0-9][0-9.]*\)], - [3.79* | 3.[89]*], critic_missing="$critic_missing make") + [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make") - + AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version, [GNU gettext.* \([0-9]*\.[0-9.]*\)], diff --git a/SOURCES/glibc-manual-update.patch b/SOURCES/glibc-manual-update.patch index ef9e70f6..bed496bd 100644 --- a/SOURCES/glibc-manual-update.patch +++ b/SOURCES/glibc-manual-update.patch @@ -274,7 +274,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This is a generic macro which works on all floating-point types and which returns a value of type @code{int}. The possible values are: - + @@ -354,6 +360,7 @@ @comment math.h @comment ISO @@ -282,7 +282,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns a nonzero value if @var{x} is finite: not plus or minus infinity, and not NaN. It is equivalent to - + @@ -368,6 +375,7 @@ @comment math.h @comment ISO @@ -290,7 +290,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns a nonzero value if @var{x} is finite and normalized. It is equivalent to - + @@ -379,6 +387,7 @@ @comment math.h @comment ISO @@ -298,11 +298,11 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns a nonzero value if @var{x} is NaN. It is equivalent to - + @@ -387,6 +396,15 @@ @end smallexample @end deftypefn - + +@comment math.h +@comment GNU +@deftypefn {Macro} int issignaling (@emph{float-type} @var{x}) @@ -330,7 +330,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function returns a nonzero value if @var{x} is a ``not a number'' value, and zero otherwise. - + @@ -437,6 +457,7 @@ @comment math.h @comment BSD @@ -346,7 +346,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith -new programs. +new programs. When this interface is used, exceptions may not be +raised. - + @noindent The exceptions defined in @w{IEEE 754} are: @@ -705,6 +727,14 @@ @@ -363,7 +363,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@c handlers. This function clears all of the supported exception flags indicated by @var{excepts}. - + @@ -715,6 +745,7 @@ @comment fenv.h @comment ISO @@ -429,7 +429,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +guaranteed; it is intended that @theglibc{} should set it when the +underflow is to an appropriately signed zero, but not necessarily for +other underflows. - + Some of the math functions are defined mathematically to result in a complex value over parts of their domains. The most familiar example of @@ -932,6 +976,7 @@ @@ -455,7 +455,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} Store the floating-point environment in the variable pointed to by @var{envp}. - + @@ -996,6 +1043,7 @@ @comment fenv.h @comment ISO @@ -470,7 +470,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith @deftypefun int fesetenv (const fenv_t *@var{envp}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} Set the floating-point environment to that described by @var{envp}. - + The function returns zero in case the operation was successful, a @@ -1043,6 +1092,7 @@ @comment fenv.h @@ -497,7 +497,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith the parameter @var{except}. The individual exceptions are described in @ref{Status bit operations}. Only the specified exceptions are @@ -1086,7 +1138,8 @@ - + @comment fenv.h @comment GNU -@deftypefun int fegetexcept (int @var{excepts}) @@ -512,7 +512,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith @deftypefunx intmax_t imaxabs (intmax_t @var{number}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return the absolute value of @var{number}. - + Most computers use a two's complement integer representation, in which @@ -1159,6 +1213,7 @@ @comment math.h @@ -529,16 +529,16 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return the absolute value of the complex number @var{z} (@pxref{Complex Numbers}). The absolute value of a complex number is: - + @@ -1181,7 +1237,7 @@ - + This function should always be used instead of the direct formula because it takes special care to avoid losing precision. It may also -take advantage of hardware support for this operation. See @code{hypot} +take advantage of hardware support for this operation. See @code{hypot} in @ref{Exponents and Logarithms}. @end deftypefun - + @@ -1209,12 +1265,13 @@ @comment math.h @comment ISO @@ -546,7 +546,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions are used to split the number @var{value} into a normalized fraction and an exponent. - + If the argument @var{value} is not zero, the return value is @var{value} -times a power of two, and is always in the range 1/2 (inclusive) to 1 -(exclusive). The corresponding exponent is stored in @@ -554,7 +554,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +(inclusive) to 1 (exclusive). The corresponding exponent is stored in @code{*@var{exponent}}; the return value multiplied by 2 raised to this exponent equals the original number @var{value}. - + @@ -1234,6 +1291,7 @@ @comment math.h @comment ISO @@ -564,7 +564,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith number @var{value} by 2 raised to the power @var{exponent}. (It can be used to reassemble floating-point numbers that were taken apart @@ -1248,51 +1306,55 @@ - + @comment math.h @comment BSD -@deftypefun double scalb (double @var{value}, int @var{exponent}) @@ -580,7 +580,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{scalb} function is the BSD name for @code{ldexp}. @end deftypefun - + @comment math.h @comment BSD -@deftypefun {long long int} scalbn (double @var{x}, int @var{n}) @@ -597,7 +597,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith @code{scalbn} is identical to @code{scalb}, except that the exponent @var{n} is an @code{int} instead of a floating-point number. @end deftypefun - + @comment math.h @comment BSD -@deftypefun {long long int} scalbln (double @var{x}, long int @var{n}) @@ -614,7 +614,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith @code{scalbln} is identical to @code{scalb}, except that the exponent @var{n} is a @code{long int} instead of a floating-point number. @end deftypefun - + @comment math.h @comment BSD -@deftypefun {long long int} significand (double @var{x}) @@ -632,14 +632,14 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith @math{[1, 2)}. It is equivalent to @w{@code{scalb (@var{x}, (double) -ilogb (@var{x}))}}. @@ -1307,7 +1369,7 @@ - + @pindex math.h The functions listed here perform operations such as rounding and -truncation of floating-point values. Some of these functions convert +truncation of floating-point values. Some of these functions convert floating point numbers to integer values. They are all declared in @file{math.h}. - + @@ -1327,6 +1389,7 @@ @comment math.h @comment ISO @@ -751,7 +751,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is another name for @code{drem}. @end deftypefun - + @@ -1561,6 +1637,7 @@ @comment math.h @comment ISO @@ -856,7 +856,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{fmax} function returns the greater of the two values @var{x} and @var{y}. - + @@ -1779,6 +1869,7 @@ @comment math.h @comment ISO @@ -880,7 +880,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return the real part of the complex number @var{z}. @end deftypefun - + @@ -1937,6 +2030,7 @@ @comment complex.h @comment ISO @@ -888,7 +888,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return the imaginary part of the complex number @var{z}. @end deftypefun - + @@ -1949,6 +2043,7 @@ @comment complex.h @comment ISO @@ -915,7 +915,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +the Riemann sphere. Values with an infinite imaginary part are projected to positive infinity on the real axis, even if the real part is NaN. If the real part is infinite, the result is equivalent to - + @@ -2026,6 +2123,15 @@ @comment stdlib.h @comment ISO @@ -939,7 +939,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstol} function is equivalent to the @code{strtol} function in nearly all aspects but handles wide character strings. - + @@ -2098,6 +2205,7 @@ @comment stdlib.h @comment ISO @@ -955,7 +955,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoul} function is equivalent to the @code{strtoul} function in nearly all aspects but handles wide character strings. - + @@ -2125,6 +2234,7 @@ @comment stdlib.h @comment ISO @@ -971,7 +971,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoll} function is equivalent to the @code{strtoll} function in nearly all aspects but handles wide character strings. - + @@ -2150,12 +2261,14 @@ @comment stdlib.h @comment BSD @@ -979,14 +979,14 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} @code{strtoq} (``string-to-quad-word'') is the BSD name for @code{strtoll}. @end deftypefun - + @comment wchar.h @comment GNU @deftypefun {long long int} wcstoq (const wchar_t *restrict @var{string}, wchar_t **restrict @var{tailptr}, int @var{base}) +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoq} function is equivalent to the @code{strtoq} function in nearly all aspects but handles wide character strings. - + @@ -2165,6 +2278,7 @@ @comment stdlib.h @comment ISO @@ -994,7 +994,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{strtoull} function is related to @code{strtoll} the same way @code{strtoul} is related to @code{strtol}. - + @@ -2174,6 +2288,7 @@ @comment wchar.h @comment ISO @@ -1002,7 +1002,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoull} function is equivalent to the @code{strtoull} function in nearly all aspects but handles wide character strings. - + @@ -2183,12 +2298,14 @@ @comment stdlib.h @comment BSD @@ -1010,14 +1010,14 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} @code{strtouq} is the BSD name for @code{strtoull}. @end deftypefun - + @comment wchar.h @comment GNU @deftypefun {unsigned long long int} wcstouq (const wchar_t *restrict @var{string}, wchar_t **restrict @var{tailptr}, int @var{base}) +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstouq} function is equivalent to the @code{strtouq} function in nearly all aspects but handles wide character strings. - + @@ -2198,6 +2315,7 @@ @comment inttypes.h @comment ISO @@ -1025,7 +1025,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{strtoimax} function is like @code{strtol} except that it returns a @code{intmax_t} value, and accepts numbers of a corresponding range. - + @@ -2214,6 +2332,7 @@ @comment wchar.h @comment ISO @@ -1033,7 +1033,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoimax} function is equivalent to the @code{strtoimax} function in nearly all aspects but handles wide character strings. - + @@ -2223,6 +2342,7 @@ @comment inttypes.h @comment ISO @@ -1041,7 +1041,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{strtoumax} function is related to @code{strtoimax} the same way that @code{strtoul} is related to @code{strtol}. - + @@ -2233,6 +2353,7 @@ @comment wchar.h @comment ISO @@ -1049,7 +1049,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} The @code{wcstoumax} function is equivalent to the @code{strtoumax} function in nearly all aspects but handles wide character strings. - + @@ -2242,6 +2363,7 @@ @comment stdlib.h @comment ISO @@ -1073,7 +1073,7 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} This function is similar to @code{atol}, except it returns a @code{long long int}. - + @@ -2323,6 +2447,35 @@ @comment stdlib.h @comment ISO @@ -1135,13 +1135,13 @@ diff -urN glibc-2.17-c758a686/manual/arith.texi glibc-2.17-c758a686/manual/arith need not detect overflow and underflow errors. The @code{atof} function is provided mostly for compatibility with existing code; using @@ -2447,7 +2603,8 @@ - + @Theglibc{} also provides @samp{_l} versions of these functions, which take an additional argument, the locale to use in conversion. -@xref{Parsing of Integers}. + +See also @ref{Parsing of Integers}. - + @node System V Number Conversion @section Old-fashioned System V number-to-string functions @@ -2465,9 +2622,10 @@ @@ -1443,12 +1443,12 @@ diff -urN glibc-2.17-c758a686/manual/charset.texi glibc-2.17-c758a686/manual/cha source and destination character set for the conversion, and if the @@ -1625,7 +1709,7 @@ function returns a handle. - + If the wanted conversion is not available, the @code{iconv_open} function -returns @code{(iconv_t) -1}. In this case the global variable +returns @code{(iconv_t) -1}. In this case the global variable @code{errno} can have the following values: - + @table @code @@ -1682,6 +1766,12 @@ @comment iconv.h @@ -1477,14 +1477,14 @@ diff -urN glibc-2.17-c758a686/manual/charset.texi glibc-2.17-c758a686/manual/cha @@ -1744,7 +1838,7 @@ Therefore an @code{iconv} call to reset the state should always be performed if some protocol requires this for the output text. - + -The conversion stops for one of three reasons. The first is that all +The conversion stops for one of three reasons. The first is that all characters from the input buffer are converted. This actually can mean two things: either all bytes from the input buffer are consumed or there are some bytes at the end of the buffer that possibly can form a @@ -2039,7 +2133,7 @@ - + Unfortunately, the answer is: there is no general solution. On some systems guessing might help. On those systems most character sets can -convert to and from UTF-8 encoded @w{ISO 10646} or Unicode text. Beside @@ -1493,27 +1493,27 @@ diff -urN glibc-2.17-c758a686/manual/charset.texi glibc-2.17-c758a686/manual/cha conversion functions come from loadable modules and these modules must be stored somewhere in the filesystem, one @emph{could} try to find them @@ -2239,7 +2333,7 @@ - + So far this section has described how modules are located and considered to be used. What remains to be described is the interface of the modules -so that one can write new ones. This section describes the interface as +so that one can write new ones. This section describes the interface as it is in use in January 1999. The interface will change a bit in the future but, with luck, only in an upwardly compatible way. - + @@ -2485,7 +2579,7 @@ same size, the minimum and maximum values are the same. - + @item __stateful -This element must be initialized to an nonzero value if the source +This element must be initialized to a nonzero value if the source character set is stateful. Otherwise it must be zero. @end table - + @@ -2824,7 +2918,7 @@ /* @r{Run the conversion loop. @code{status} is set} @r{appropriately afterwards.} */ - + - /* @r{If this is the last step, leave the loop. There is} + /* @r{If this is the last step, leave the loop. There is} @r{nothing we can do.} */ @@ -1646,7 +1646,7 @@ diff -urN glibc-2.17-c758a686/manual/conf.texi glibc-2.17-c758a686/manual/conf.t --- glibc-2.17-c758a686/manual/conf.texi 2014-09-12 16:08:17.965070383 -0400 +++ glibc-2.17-c758a686/manual/conf.texi 2014-09-12 16:10:06.047792712 -0400 @@ -114,7 +114,7 @@ - + @comment limits.h @comment POSIX.1 -@deftypevr Macro int SSIZE_MAX @@ -1674,7 +1674,7 @@ diff -urN glibc-2.17-c758a686/manual/conf.texi glibc-2.17-c758a686/manual/conf.t below. @@ -1121,7 +1132,7 @@ have on @emph{any} POSIX system. @xref{File Minimums}. - + @cindex limits, link count of files -@comment limits.h +@comment limits.h (optional) @@ -1692,7 +1692,7 @@ diff -urN glibc-2.17-c758a686/manual/conf.texi glibc-2.17-c758a686/manual/conf.t +@c /proc/sys/fs/xfs/restrict_chown as a file descriptor. This function is used to inquire about the limits that apply to the file named @var{filename}. - + @@ -1375,6 +1391,8 @@ @comment unistd.h @comment POSIX.1 @@ -1716,7 +1716,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @@ -30,15 +30,15 @@ and the other based on the Data Encryption Standard (DES) that is compatible with Unix systems. - + -@cindex AUTH_DES +@vindex AUTH_DES @cindex FIPS 140-2 @@ -1733,7 +1733,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt +within @theglibc{}. It is recommended that Secure RPC should not be used +for systems that need to comply with FIPS 140-2 since all flavors of +encrypted authentication use normal DES. - + @menu * Legal Problems:: This software can get you locked up, or worse. @@ -99,6 +99,13 @@ @@ -1747,7 +1747,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt +@c then restore the terminal mode. It has a cleanup to close the stream +@c in case of (synchronous) cancellation, but not to restore the +@c terminal mode. - + @code{getpass} outputs @var{prompt}, then reads a string in from the terminal without echoing it. It tries to connect to the real terminal, @@ -134,6 +141,13 @@ @@ -1761,7 +1761,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt +@c NSS implementations of may leak file descriptors if canceled. The +@c The MD5, SHA256 and SHA512 implementations will malloc on long keys, +@c and NSS relies on dlopening, which brings about another can of worms. - + The @code{crypt} function takes a password, @var{key}, as a string, and a @var{salt} character array which is described below, and returns a @@ -195,6 +209,9 @@ @@ -1771,7 +1771,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt +@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{} @ascuheap{} @ascudlopen{}}@acunsafe{@aculock{} @acsmem{}}} +@c Compared with crypt, this function fixes the @mtasurace:crypt +@c problem, but nothing else. - + The @code{crypt_r} function does the same thing as @code{crypt}, but takes an extra parameter which includes space for its result (among @@ -241,6 +258,11 @@ @@ -1783,7 +1783,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt +@c thread-unsafe. The locking issues are only in the initialization +@c path; cancelling the initialization will leave the lock held, it +@c would otherwise repeat the initialization on the next call. - + The @code{setkey} function sets an internal data structure to be an expanded form of @var{key}. @var{key} is specified as an array of 64 @@ -252,6 +274,8 @@ @@ -1792,7 +1792,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @deftypefun void encrypt (char *@var{block}, int @var{edflag}) +@safety{@prelim{}@mtunsafe{@mtasurace{:crypt}}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} +@c Same issues as setkey. - + The @code{encrypt} function encrypts @var{block} if @var{edflag} is 0, otherwise it decrypts @var{block}, using a key @@ -265,9 +289,11 @@ @@ -1804,7 +1804,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @comment GNU @deftypefunx void encrypt_r (char *@var{block}, int @var{edflag}, {struct crypt_data *} @var{data}) +@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} - + These are reentrant versions of @code{setkey} and @code{encrypt}. The only difference is the extra parameter, which stores the expanded @@ -282,6 +308,7 @@ @@ -1812,7 +1812,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @comment SUNRPC @deftypefun int ecb_crypt (char *@var{key}, char *@var{blocks}, unsigned @var{len}, unsigned @var{mode}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The function @code{ecb_crypt} encrypts or decrypts one or more blocks using DES. Each block is encrypted independently. @@ -356,6 +383,7 @@ @@ -1828,7 +1828,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @comment SUNRPC @deftypefun int cbc_crypt (char *@var{key}, char *@var{blocks}, unsigned @var{len}, unsigned @var{mode}, char *@var{ivec}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The function @code{cbc_crypt} encrypts or decrypts one or more blocks using DES in Cipher Block Chaining mode. @@ -389,6 +418,7 @@ @@ -1836,7 +1836,7 @@ diff -urN glibc-2.17-c758a686/manual/crypt.texi glibc-2.17-c758a686/manual/crypt @comment SUNRPC @deftypefun void des_setparity (char *@var{key}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The function @code{des_setparity} changes the 64-bit @var{key}, stored packed in 8-bit bytes, to have odd parity by altering the low bits of diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype.texi @@ -1882,7 +1882,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} Returns true if @var{c} is a decimal digit (@samp{0} through @samp{9}). @end deftypefun - + @@ -104,6 +117,7 @@ @comment ctype.h @comment ISO @@ -2058,7 +2058,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} Returns true if @var{wc} is a control character (that is, a character that is not a printing character). - + @@ -412,6 +468,7 @@ @comment wctype.h @comment ISO @@ -2082,7 +2082,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} Returns true if @var{wc} is a lower-case letter. The letter need not be from the Latin alphabet, any alphabet representable is valid. - + @@ -479,6 +538,7 @@ @comment wctype.h @comment ISO @@ -2090,7 +2090,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} Returns true if @var{wc} is a printing character. Printing characters include all the graphic characters, plus the space (@samp{ }) character. - + @@ -497,6 +557,7 @@ @comment wctype.h @comment ISO @@ -2114,7 +2114,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} Returns true if @var{wc} is an upper-case letter. The letter need not be from the Latin alphabet, any alphabet representable is valid. - + @@ -573,6 +636,7 @@ @comment wctype.h @comment ISO @@ -2166,7 +2166,7 @@ diff -urN glibc-2.17-c758a686/manual/ctype.texi glibc-2.17-c758a686/manual/ctype +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}} If @var{wc} is a lower-case letter, @code{towupper} returns the corresponding upper-case letter. Otherwise @var{wc} is returned unchanged. - + diff -urN glibc-2.17-c758a686/manual/debug.texi glibc-2.17-c758a686/manual/debug.texi --- glibc-2.17-c758a686/manual/debug.texi 2014-09-12 16:08:17.824070745 -0400 +++ glibc-2.17-c758a686/manual/debug.texi 2014-09-12 16:10:06.045792717 -0400 @@ -2176,7 +2176,7 @@ diff -urN glibc-2.17-c758a686/manual/debug.texi glibc-2.17-c758a686/manual/debug +@c @node Debugging Support, POSIX Threads, Cryptographic Functions, Top @c %MENU% Functions to help debugging applications @chapter Debugging support - + @@ -36,6 +36,16 @@ @comment execinfo.h @comment GNU @@ -2249,7 +2249,7 @@ diff -urN glibc-2.17-c758a686/manual/errno.texi glibc-2.17-c758a686/manual/errno +thread. This might be either some permanent global data or a message string in the user supplied buffer starting at @var{buf} with the length of @var{n} bytes. - + @@ -1331,6 +1335,10 @@ @comment stdio.h @comment ISO @@ -2288,11 +2288,11 @@ diff -urN glibc-2.17-c758a686/manual/errno.texi glibc-2.17-c758a686/manual/errno +@c before disabling cancellation, so it can be interrupted after only +@c one of the two variables is modified. After that, it's very much +@c like error. - + The @code{error_at_line} function is very similar to the @code{error} function. The only difference are the additional parameters @var{fname} @@ -1508,7 +1532,7 @@ - + @comment error.h @comment GNU -@deftypevar {void (*) error_print_progname } (void) @@ -2323,7 +2323,7 @@ diff -urN glibc-2.17-c758a686/manual/errno.texi glibc-2.17-c758a686/manual/errno -in as an value of type @code{va_list}. +in as a value of type @code{va_list}. @end deftypefun - + @comment err.h @comment BSD @deftypefun void warnx (const char *@var{format}, @dots{}) @@ -2343,7 +2343,7 @@ diff -urN glibc-2.17-c758a686/manual/errno.texi glibc-2.17-c758a686/manual/errno -in as an value of type @code{va_list}. +in as a value of type @code{va_list}. @end deftypefun - + @comment err.h @comment BSD @deftypefun void err (int @var{status}, const char *@var{format}, @dots{}) @@ -2363,7 +2363,7 @@ diff -urN glibc-2.17-c758a686/manual/errno.texi glibc-2.17-c758a686/manual/errno -in as an value of type @code{va_list}. +in as a value of type @code{va_list}. @end deftypefun - + @comment err.h @comment BSD @deftypefun void errx (int @var{status}, const char *@var{format}, @dots{}) @@ -2390,7 +2390,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/add.c glibc-2.17-c758a686/manual/e /* Example of a Variadic Function - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/argp-ex1.c glibc-2.17-c758a686/manual/examples/argp-ex1.c @@ -2400,7 +2400,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/argp-ex1.c glibc-2.17-c758a686/man /* Argp example #1 -- a minimal program using argp - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/argp-ex2.c glibc-2.17-c758a686/manual/examples/argp-ex2.c @@ -2410,7 +2410,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/argp-ex2.c glibc-2.17-c758a686/man /* Argp example #2 -- a pretty minimal program using argp - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/argp-ex3.c glibc-2.17-c758a686/manual/examples/argp-ex3.c @@ -2420,7 +2420,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/argp-ex3.c glibc-2.17-c758a686/man /* Argp example #3 -- a program with options and arguments using argp - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/argp-ex4.c glibc-2.17-c758a686/manual/examples/argp-ex4.c @@ -2430,7 +2430,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/argp-ex4.c glibc-2.17-c758a686/man /* Argp example #4 -- a program with somewhat more complicated options - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/atexit.c glibc-2.17-c758a686/manual/examples/atexit.c @@ -2440,7 +2440,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/atexit.c glibc-2.17-c758a686/manua /* Cleanups on Exit - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/db.c glibc-2.17-c758a686/manual/examples/db.c @@ -2450,7 +2450,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/db.c glibc-2.17-c758a686/manual/ex /* User and Group Database Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/dir2.c glibc-2.17-c758a686/manual/examples/dir2.c @@ -2460,7 +2460,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/dir2.c glibc-2.17-c758a686/manual/ /* Simple Program to List a Directory, Mark II - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/dir.c glibc-2.17-c758a686/manual/examples/dir.c @@ -2470,7 +2470,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/dir.c glibc-2.17-c758a686/manual/e /* Simple Program to List a Directory - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/execinfo.c glibc-2.17-c758a686/manual/examples/execinfo.c @@ -2480,7 +2480,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/execinfo.c glibc-2.17-c758a686/man /* Obtain a backtrace and print it. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/filecli.c glibc-2.17-c758a686/manual/examples/filecli.c @@ -2490,7 +2490,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/filecli.c glibc-2.17-c758a686/manu /* Example of Reading Datagrams - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/filesrv.c glibc-2.17-c758a686/manual/examples/filesrv.c @@ -2500,7 +2500,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/filesrv.c glibc-2.17-c758a686/manu /* Datagram Socket Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/fmtmsgexpl.c glibc-2.17-c758a686/manual/examples/fmtmsgexpl.c @@ -2510,7 +2510,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/fmtmsgexpl.c glibc-2.17-c758a686/m /* How to use fmtmsg and addseverity. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/genpass.c glibc-2.17-c758a686/manual/examples/genpass.c @@ -2520,7 +2520,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/genpass.c glibc-2.17-c758a686/manu /* Encrypting Passwords - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/inetcli.c glibc-2.17-c758a686/manual/examples/inetcli.c @@ -2530,7 +2530,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/inetcli.c glibc-2.17-c758a686/manu /* Byte Stream Socket Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/inetsrv.c glibc-2.17-c758a686/manual/examples/inetsrv.c @@ -2540,7 +2540,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/inetsrv.c glibc-2.17-c758a686/manu /* Byte Stream Connection Server Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/isockad.c glibc-2.17-c758a686/manual/examples/isockad.c @@ -2550,7 +2550,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/isockad.c glibc-2.17-c758a686/manu /* Internet Socket Example using sockaddr_in. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/longopt.c glibc-2.17-c758a686/manual/examples/longopt.c @@ -2560,7 +2560,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/longopt.c glibc-2.17-c758a686/manu /* Example of Parsing Long Options with getopt_long. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/memopen.c glibc-2.17-c758a686/manual/examples/memopen.c @@ -2570,7 +2570,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/memopen.c glibc-2.17-c758a686/manu /* String Streams - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/memstrm.c glibc-2.17-c758a686/manual/examples/memstrm.c @@ -2580,7 +2580,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/memstrm.c glibc-2.17-c758a686/manu /* open_memstream example. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/mkfsock.c glibc-2.17-c758a686/manual/examples/mkfsock.c @@ -2590,11 +2590,11 @@ diff -urN glibc-2.17-c758a686/manual/examples/mkfsock.c glibc-2.17-c758a686/manu /* Example of Local-Namespace Sockets - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -45,13 +45,12 @@ - + /* The size of the address is the offset of the start of the filename, - plus its length, @@ -2606,7 +2606,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/mkfsock.c glibc-2.17-c758a686/manu size = (offsetof (struct sockaddr_un, sun_path) - + strlen (name.sun_path) + 1); + + strlen (name.sun_path)); - + if (bind (sock, (struct sockaddr *) &name, size) < 0) { diff -urN glibc-2.17-c758a686/manual/examples/mkisock.c glibc-2.17-c758a686/manual/examples/mkisock.c @@ -2616,7 +2616,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/mkisock.c glibc-2.17-c758a686/manu /* Internet Socket Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/mygetpass.c glibc-2.17-c758a686/manual/examples/mygetpass.c @@ -2626,7 +2626,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/mygetpass.c glibc-2.17-c758a686/ma /* Reading Passwords - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/pipe.c glibc-2.17-c758a686/manual/examples/pipe.c @@ -2636,7 +2636,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/pipe.c glibc-2.17-c758a686/manual/ /* Creating a Pipe - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/popen.c glibc-2.17-c758a686/manual/examples/popen.c @@ -2646,7 +2646,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/popen.c glibc-2.17-c758a686/manual /* Pipe to a Subprocess - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/rprintf.c glibc-2.17-c758a686/manual/examples/rprintf.c @@ -2656,7 +2656,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/rprintf.c glibc-2.17-c758a686/manu /* Printf Extension Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/search.c glibc-2.17-c758a686/manual/examples/search.c @@ -2666,7 +2666,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/search.c glibc-2.17-c758a686/manua /* Searching and Sorting Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/select.c glibc-2.17-c758a686/manual/examples/select.c @@ -2676,7 +2676,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/select.c glibc-2.17-c758a686/manua /* Waiting for Input or Output - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/setjmp.c glibc-2.17-c758a686/manual/examples/setjmp.c @@ -2686,7 +2686,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/setjmp.c glibc-2.17-c758a686/manua /* Introduction to Non-Local Exits - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/sigh1.c glibc-2.17-c758a686/manual/examples/sigh1.c @@ -2696,7 +2696,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/sigh1.c glibc-2.17-c758a686/manual /* Signal Handlers that Return - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/sigusr.c glibc-2.17-c758a686/manual/examples/sigusr.c @@ -2706,7 +2706,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/sigusr.c glibc-2.17-c758a686/manua /* Using kill for Communication - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/stpcpy.c glibc-2.17-c758a686/manual/examples/stpcpy.c @@ -2716,7 +2716,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/stpcpy.c glibc-2.17-c758a686/manua /* stpcpy example. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/strdupa.c glibc-2.17-c758a686/manual/examples/strdupa.c @@ -2726,7 +2726,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/strdupa.c glibc-2.17-c758a686/manu /* strdupa example. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/strftim.c glibc-2.17-c758a686/manual/examples/strftim.c @@ -2736,7 +2736,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/strftim.c glibc-2.17-c758a686/manu /* Time Functions Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/strncat.c glibc-2.17-c758a686/manual/examples/strncat.c @@ -2746,7 +2746,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/strncat.c glibc-2.17-c758a686/manu /* strncat example. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/subopt.c glibc-2.17-c758a686/manual/examples/subopt.c @@ -2756,7 +2756,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/subopt.c glibc-2.17-c758a686/manua /* Parsing of Suboptions Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/swapcontext.c glibc-2.17-c758a686/manual/examples/swapcontext.c @@ -2766,7 +2766,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/swapcontext.c glibc-2.17-c758a686/ /* Complete Context Control - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/termios.c glibc-2.17-c758a686/manual/examples/termios.c @@ -2776,7 +2776,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/termios.c glibc-2.17-c758a686/manu /* Noncanonical Mode Example - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/testopt.c glibc-2.17-c758a686/manual/examples/testopt.c @@ -2786,7 +2786,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/testopt.c glibc-2.17-c758a686/manu /* Example of Parsing Arguments with getopt. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/testpass.c glibc-2.17-c758a686/manual/examples/testpass.c @@ -2796,7 +2796,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/testpass.c glibc-2.17-c758a686/man /* Verify a password. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/examples/timeval_subtract.c glibc-2.17-c758a686/manual/examples/timeval_subtract.c @@ -2806,7 +2806,7 @@ diff -urN glibc-2.17-c758a686/manual/examples/timeval_subtract.c glibc-2.17-c758 /* struct timeval subtraction. - Copyright (C) 1991-2012 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/filesys.texi @@ -2865,7 +2865,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is used to set the process's working directory to @var{filename}. - + @@ -158,6 +184,7 @@ @comment unistd.h @comment XPG @@ -2873,7 +2873,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is used to set the process's working directory to directory associated with the file descriptor @var{filedes}. - + @@ -294,12 +321,14 @@ @comment dirent.h @comment BSD @@ -2881,7 +2881,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This returns the @code{d_type} value corresponding to @var{mode}. @end deftypefun - + @comment dirent.h @comment BSD @deftypefun mode_t DTTOIF (int @var{dtype}) @@ -2963,7 +2963,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@c other threads could still be using the dir stream while it's closed. This function closes the directory stream @var{dirstream}. It returns @code{0} on success and @code{-1} on failure. - + @@ -609,6 +657,7 @@ @comment dirent.h @comment POSIX.1 @@ -2995,7 +2995,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil stream @var{dirstream} to @var{pos}. The value @var{pos} must be the result of a previous call to @code{telldir} on this particular stream; @@ -648,7 +705,20 @@ - + @comment dirent.h @comment BSD/SVID -@deftypefun int scandir (const char *@var{dir}, struct dirent ***@var{namelist}, int (*@var{selector}) (const struct dirent *), int (*@var{cmp}) (const void *, const void *)) @@ -3013,11 +3013,11 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@c makes the use safe, and the fact that the dir stream is private to +@c each scandir call does away with the lock issues in readdir and +@c closedir. - + The @code{scandir} function scans the contents of the directory selected by @var{dir}. The result in *@var{namelist} is an array of pointers to @@ -678,7 +748,9 @@ - + @comment dirent.h @comment BSD/SVID -@deftypefun int alphasort (const void *@var{a}, const void *@var{b}) @@ -3028,7 +3028,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil (@pxref{String/Array Comparison}). The difference is that the arguments are not string pointers but instead they are of type @@ -690,7 +762,10 @@ - + @comment dirent.h @comment GNU -@deftypefun int versionsort (const void *@var{a}, const void *@var{b}) @@ -3040,7 +3040,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil uses the @code{strverscmp} function internally. @end deftypefun @@ -702,7 +777,9 @@ - + @comment dirent.h @comment GNU -@deftypefun int scandir64 (const char *@var{dir}, struct dirent64 ***@var{namelist}, int (*@var{selector}) (const struct dirent64 *), int (*@var{cmp}) (const void *, const void *)) @@ -3051,7 +3051,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil except that the directory entries it returns are described by elements of type @w{@code{struct dirent64}}. The function pointed to by @@ -720,7 +797,9 @@ - + @comment dirent.h @comment GNU -@deftypefun int alphasort64 (const void *@var{a}, const void *@var{b}) @@ -3062,7 +3062,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil (@pxref{String/Array Comparison}). The difference is that the arguments are not string pointers but instead they are of type @@ -732,7 +811,9 @@ - + @comment dirent.h @comment GNU -@deftypefun int versionsort64 (const void *@var{a}, const void *@var{b}) @@ -3074,13 +3074,13 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @end deftypefun @@ -812,7 +893,7 @@ file does not exist. The situation for @code{nftw} is different. - + This value is only available if the program is compiled with -@code{_BSD_SOURCE} or @code{_XOPEN_EXTENDED} defined before including +@code{_XOPEN_EXTENDED} defined before including the first header. The original SVID systems do not have symbolic links. @end vtable - + @@ -913,6 +994,8 @@ @comment ftw.h @comment SVID @@ -3131,7 +3131,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{link} function makes a new link to the existing file named by @var{oldname}, under the new name @var{newname}. - + @@ -1186,6 +1283,7 @@ @comment unistd.h @comment BSD @@ -3139,9 +3139,9 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{symlink} function makes a symbolic link to @var{oldname} named @var{newname}. - + @@ -1222,7 +1320,8 @@ - + @comment unistd.h @comment BSD -@deftypefun int readlink (const char *@var{filename}, char *@var{buffer}, size_t @var{size}) @@ -3156,7 +3156,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @deftypefun {char *} canonicalize_file_name (const char *@var{name}) +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{} @acsfd{}}} +@c Calls realpath. - + The @code{canonicalize_file_name} function returns the absolute name of the file named by @var{name} which contains no @code{.}, @code{..} @@ -1323,6 +1424,8 @@ @@ -3165,7 +3165,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @deftypefun {char *} realpath (const char *restrict @var{name}, char *restrict @var{resolved}) +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{} @acsfd{}}} +@c Calls malloc, realloc, getcwd, lxstat64, readlink, alloca. - + A call to @code{realpath} where the @var{resolved} parameter is @code{NULL} behaves exactly like @code{canonicalize_file_name}. The @@ -1362,6 +1465,7 @@ @@ -3211,7 +3211,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{mkdir} function creates a new, empty directory with name @var{filename}. - + @@ -1882,6 +1994,7 @@ @comment sys/stat.h @comment POSIX.1 @@ -3219,7 +3219,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stat} function returns information about the attributes of the file named by @w{@var{filename}} in the structure pointed to by @var{buf}. - + @@ -1908,8 +2021,9 @@ @comment sys/stat.h @comment Unix98 @@ -3230,7 +3230,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +files larger than @math{2^31} bytes on 32-bit systems. To be able to do this the result is stored in a variable of type @code{struct stat64} to which @var{buf} must point. - + @@ -1921,6 +2035,7 @@ @comment sys/stat.h @comment POSIX.1 @@ -3250,7 +3250,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @@ -1953,9 +2069,16 @@ replaces the interface for small files on 32-bit machines. @end deftypefun - + +@c fstatat will call alloca and snprintf if the syscall is not +@c available. +@c @safety{@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}} @@ -3276,7 +3276,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +files larger than @math{2^31} bytes on 32-bit systems. To be able to do this the result is stored in a variable of type @code{struct stat64} to which @var{buf} must point. - + @@ -2007,12 +2133,14 @@ @comment sys/stat.h @comment POSIX @@ -3284,7 +3284,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns non-zero if the file is a directory. @end deftypefn - + @comment sys/stat.h @comment POSIX @deftypefn Macro int S_ISCHR (mode_t @var{m}) @@ -3307,7 +3307,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns non-zero if the file is a regular file. @end deftypefn - + @comment sys/stat.h @comment POSIX @deftypefn Macro int S_ISFIFO (mode_t @var{m}) @@ -3330,7 +3330,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns non-zero if the file is a socket. @xref{Sockets}. @end deftypefn - + @@ -2129,6 +2262,7 @@ @comment sys/stat.h @comment POSIX @@ -3357,7 +3357,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +and the file is a shared memory object, this macro returns a non-zero value. In all other cases the result is zero. @end deftypefn - + @@ -2189,6 +2325,7 @@ @comment unistd.h @comment POSIX.1 @@ -3365,9 +3365,9 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{chown} function changes the owner of the file @var{filename} to @var{owner}, and its group owner to @var{group}. - + @@ -2222,7 +2359,8 @@ - + @comment unistd.h @comment BSD -@deftypefun int fchown (int @var{filedes}, int @var{owner}, int @var{group}) @@ -3375,7 +3375,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This is like @code{chown}, except that it changes the owner of the open file with descriptor @var{filedes}. - + @@ -2502,6 +2641,7 @@ @comment sys/stat.h @comment POSIX.1 @@ -3399,9 +3399,9 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{chmod} function sets the access permission bits for the file named by @var{filename} to @var{mode}. - + @@ -2574,7 +2716,8 @@ - + @comment sys/stat.h @comment BSD -@deftypefun int fchmod (int @var{filedes}, int @var{mode}) @@ -3409,7 +3409,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This is like @code{chmod}, except that it changes the permissions of the currently open file given by @var{filedes}. - + @@ -2645,6 +2788,7 @@ @comment unistd.h @comment POSIX.1 @@ -3421,7 +3421,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @@ -2746,7 +2890,7 @@ need to include the header file @file{utime.h} to use this facility. @pindex utime.h - + -@comment time.h +@comment utime.h @comment POSIX.1 @@ -3430,7 +3430,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @@ -2762,9 +2906,12 @@ @end table @end deftp - + -@comment time.h +@comment utime.h @comment POSIX.1 @@ -3440,9 +3440,9 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@c to a struct timeval and calls utimes. This function is used to modify the file times associated with the file named @var{filename}. - + @@ -2815,7 +2962,11 @@ - + @comment sys/time.h @comment BSD -@deftypefun int utimes (const char *@var{filename}, struct timeval @var{tvp}@t{[2]}) @@ -3455,7 +3455,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @var{filename}. The new file access time is specified by @code{@var{tvp}[0]}, and the new modification time by @@ -2829,7 +2980,10 @@ - + @comment sys/time.h @comment BSD -@deftypefun int lutimes (const char *@var{filename}, struct timeval @var{tvp}@t{[2]}) @@ -3467,7 +3467,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil symbolic links. If @var{filename} is the name of a symbolic link, @code{lutimes} sets the file access and modification times of the @@ -2845,7 +2999,11 @@ - + @comment sys/time.h @comment BSD -@deftypefun int futimes (int @var{fd}, struct timeval @var{tvp}@t{[2]}) @@ -3485,7 +3485,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @deftypefun int truncate (const char *@var{filename}, off_t @var{length}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c In the absence of a truncate syscall, we use open and ftruncate. - + The @code{truncate} function changes the size of @var{filename} to @var{length}. If @var{length} is shorter than the previous length, data @@ -2944,6 +3104,8 @@ @@ -3502,7 +3502,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil @comment POSIX @deftypefun int ftruncate (int @var{fd}, off_t @var{length}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + This is like @code{truncate}, but it works on a file descriptor @var{fd} for an opened file instead of a file name to identify the object. The @@ -3021,6 +3184,8 @@ @@ -3515,7 +3515,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil difference is that the @var{length} argument is 64 bits wide even on 32 bits machines which allows the handling of files with sizes up to @@ -3082,7 +3247,11 @@ - + @comment sys/stat.h @comment BSD -@deftypefun int mknod (const char *@var{filename}, int @var{mode}, int @var{dev}) @@ -3557,7 +3557,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil pointer to was opened using @code{tmpfile64}. Therefore this stream can -be used for files larger then @math{2^31} bytes on 32-bit machines. +be used for files larger than @math{2^31} bytes on 32-bit machines. - + Please note that the return type is still @code{FILE *}. There is no special @code{FILE} type for the LFS interface. @@ -3165,6 +3349,11 @@ @@ -3579,7 +3579,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is nearly identical to the @code{tmpnam} function, except that if @var{result} is a null pointer it returns a null pointer. - + @@ -3225,6 +3415,13 @@ @comment stdio.h @comment SVID @@ -3623,7 +3623,7 @@ diff -urN glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/fil directory, and returns @var{template}. As with @code{mktemp} and @@ -3349,3 +3552,23 @@ @xref{Creating Directories}. - + The @code{mkdtemp} function comes from OpenBSD. + +@c FIXME these are undocumented: @@ -3655,13 +3655,13 @@ diff -urN glibc-2.17-c758a686/manual/freemanuals.texi glibc-2.17-c758a686/manual +@c hence no sectioning command or @node. + @cindex free documentation - + The biggest deficiency in the free software community today is not in diff -urN glibc-2.17-c758a686/manual/getopt.texi glibc-2.17-c758a686/manual/getopt.texi --- glibc-2.17-c758a686/manual/getopt.texi 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/manual/getopt.texi 2014-09-12 16:10:06.044792719 -0400 @@ -59,7 +59,29 @@ - + @comment unistd.h @comment POSIX.2 -@deftypefun int getopt (int @var{argc}, char **@var{argv}, const char *@var{options}) @@ -3706,7 +3706,7 @@ diff -urN glibc-2.17-c758a686/manual/getopt.texi glibc-2.17-c758a686/manual/geto @deftypefun int getopt_long_only (int @var{argc}, char *const *@var{argv}, const char *@var{shortopts}, const struct option *@var{longopts}, int *@var{indexptr}) +@safety{@prelim{}@mtunsafe{@mtasurace{:getopt} @mtsenv{}}@asunsafe{@ascuheap{} @ascuintl{} @asulock{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}} +@c Same issues as getopt. - + The @code{getopt_long_only} function is equivalent to the @code{getopt_long} function but it allows to specify the user of the diff -urN glibc-2.17-c758a686/manual/install-plain.texi glibc-2.17-c758a686/manual/install-plain.texi @@ -3727,18 +3727,18 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins -@setfilename INSTALL @include macros.texi @include pkgvers.texi - + +@ifclear plain @node Installation, Maintenance, Library Summary, Top +@end ifclear + @c %MENU% How to install the GNU C Library @appendix Installing @theglibc{} - + @@ -21,6 +21,7 @@ You will need recent versions of several GNU tools: definitely GCC and GNU Make, and possibly others. @xref{Tools for Compilation}, below. - + +@ifclear plain @menu * Configuring and compiling:: How to compile and test GNU libc. @@ -3748,13 +3748,13 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins * Reporting Bugs:: So they'll get fixed. @end menu +@end ifclear - + @node Configuring and compiling @appendixsec Configuring and compiling @theglibc{} @@ -138,11 +140,6 @@ Don't build libraries with profiling information. You may want to use this option if you don't plan to do profiling. - + -@item --disable-versioning -Don't compile the shared libraries with symbol version information. -Doing this will make the resulting library incompatible with old @@ -3766,7 +3766,7 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins @@ -155,6 +152,14 @@ prevented though there generally is no reason since it creates compatibility problems. - + +@item --enable-hardcoded-path-in-tests +By default, dynamic tests are linked to run with the installed C library. +This option hardcodes the newly built C library path in dynamic tests @@ -3779,7 +3779,7 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins @findex grantpt @item --enable-pt_chown @@ -180,11 +185,11 @@ - + If you only specify @samp{--host}, @code{configure} will prepare for a native compile but use what you specify instead of guessing what your -system is. This is most useful to change the CPU submodel. For example, @@ -3793,12 +3793,12 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins +@samp{--host=i586-pc-linux-gnu} or just @samp{--host=i586-linux} and add +the appropriate compiler flags (@samp{-mcpu=i586} will do the trick) to @var{CFLAGS}. - + If you specify just @samp{--build}, @code{configure} will get confused. @@ -230,6 +235,12 @@ system such as @file{/etc/passwd}, @file{/etc/nsswitch.conf} and others. These files must all contain correct and sensible content. - + +Normally, @code{make check} will run all the tests before reporting +all problems found and exiting with error status if any problems +occurred. You can specify @samp{stop-on-test-failure=y} when running @@ -3824,12 +3824,12 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins +@samp{@var{var}=@var{value}} before the name of the program to be +run. If multiple assignments to the same variable are specified, +the last assignment specified must take precedence. - - + + @node Running make install @@ -278,7 +291,7 @@ @cindex installing - + To install the library and its header files, and the Info files of the -manual, type @code{env LANGUAGE=C LC_ALL=C make install}. This will +manual, type @code{make install}. This will @@ -3838,7 +3838,7 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins primary C library, we recommend that you shut the system down to @@ -317,14 +330,11 @@ well. - + One auxiliary program, @file{/usr/libexec/pt_chown}, is installed setuid -@code{root}. This program is invoked by the @code{grantpt} function; it -sets the permissions on a pseudoterminal so it can be used by the @@ -3853,48 +3853,48 @@ diff -urN glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/ins +permissions on a pseudoterminal so it can be used by the calling process. +If you are using a Linux kernel with the @code{devpts} filesystem enabled +and mounted at @file{/dev/pts}, you don't need this program. - + After installation you might want to configure the timezone and locale installation of your system. @Theglibc{} comes with a locale @@ -362,9 +372,9 @@ bugs or lack features. - + @item -GCC 4.3 or newer, GCC 4.6 recommended +GCC 4.4 or newer, GCC 4.6 recommended - + -GCC 4.3 or higher is required; as of this writing, GCC 4.6 is the +GCC 4.4 or higher is required; as of this writing, GCC 4.6 is the compiler we advise to use to build @theglibc{}. - + You can use whatever compiler you like to compile programs that use @@ -388,10 +398,11 @@ mechanism for the info files is not present or works differently. - + @item -GNU @code{awk} 3.0, or higher +GNU @code{awk} 3.1.2, or higher - + -@code{Awk} is used in several places to generate files. -@code{gawk} 3.0 is known to work. +@code{awk} is used in several places to generate files. +Some @code{gawk} extensions are used, including the @code{asorti} +function, which was introduced in version 3.1.2 of @code{gawk}. - + @item Perl 5 @@ -412,7 +423,7 @@ @end itemize - + @noindent -If you change any of the @file{configure.in} files you will also need +If you change any of the @file{configure.ac} files you will also need - + @itemize @bullet @item @@ -436,7 +447,7 @@ @cindex kernel header files - + If you are installing @theglibc{} on @gnulinuxsystems{}, you need to have -the header files from a 2.6.19.1 or newer kernel around for reference. +the header files from a 2.6.32 or newer kernel around for reference. @@ -3907,7 +3907,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro @@ -159,6 +159,14 @@ These include utilities for dealing with regular expressions and other pattern matching facilities (@pxref{Pattern Matching}). - + +@menu +* POSIX Safety Concepts:: Safety concepts from POSIX. +* Unsafe Features:: Features that make functions unsafe. @@ -3922,7 +3922,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro @@ -172,6 +180,725 @@ @comment (not yet implemented) @comment confstr - + +@node POSIX Safety Concepts, Unsafe Features, , POSIX +@subsubsection POSIX Safety Concepts +@cindex POSIX Safety Concepts @@ -4642,13 +4642,13 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro + +@end itemize + - + @node Berkeley Unix, SVID, POSIX, Standards and Portability @subsection Berkeley Unix @@ -556,19 +1283,59 @@ Here is an overview of the contents of the remaining chapters of this manual. - + +@c The chapter overview ordering is: +@c Error Reporting (2) +@c Virtual Memory Allocation and Paging (3) @@ -4701,7 +4701,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro @item @ref{Error Reporting}, describes how errors detected by the library are reported. - + -@item -@ref{Language Features}, contains information about library support for -standard parts of the C language, including things like the @code{sizeof} @@ -4710,12 +4710,12 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro -ranges and other properties of the numerical types. There is also a simple -debugging mechanism which allows you to put assertions in your code, and -have diagnostic messages printed if the tests fail. - + @item @ref{Memory}, describes @theglibc{}'s facilities for managing and @@ -588,6 +1355,26 @@ byte arrays, including operations such as copying and comparison. - + @item +@ref{Character Set Handling}, contains information about manipulating +characters and strings using character sets larger than will fit in @@ -4742,7 +4742,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro such as file names. @@ -639,30 +1426,10 @@ numbers from strings. - + @item -@ref{Searching and Sorting}, contains information about functions -for searching and sorting arrays. You can use these functions on any @@ -4755,7 +4755,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro -@item @ref{Date and Time}, describes functions for measuring both calendar time and CPU time, as well as functions for setting alarms and timers. - + @item -@ref{Character Set Handling}, contains information about manipulating -characters and strings using character sets larger than will fit in @@ -4773,7 +4773,7 @@ diff -urN glibc-2.17-c758a686/manual/intro.texi glibc-2.17-c758a686/manual/intro @code{goto}-like jumps which can jump from one function to another. @@ -708,6 +1475,15 @@ compatibility with POSIX. - + @item +@ref{Language Features}, contains information about library support for +standard parts of the C language, including things like the @code{sizeof} @@ -4915,7 +4915,7 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex +@node Job Control, Name Service Switch, Inter-Process Communication, Top @c %MENU% All about process groups and sessions @chapter Job Control - + @@ -1039,6 +1039,10 @@ @comment stdio.h @comment POSIX.1 @@ -4946,13 +4946,13 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex @deftypefun pid_t getsid (pid_t @var{pid}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Stub or direct syscall, except on hurd, where it is equally safe. - + The @code{getsid} function returns the process group ID of the session leader of the specified process. If a @var{pid} is @code{0}, the @@ -1118,39 +1130,21 @@ @end table @end deftypefun - + -The @code{getpgrp} function has two definitions: one derived from BSD -Unix, and one from the POSIX.1 standard. The feature test macros you -have selected (@pxref{Feature Test Macros}) determine which definition @@ -4984,7 +4984,7 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex -argument to get information about the calling process. -@end deftypefn +@end deftypefun - + @comment unistd.h -@comment SVID -@deftypefn {System V Function} int getpgid (pid_t @var{pid}) @@ -4992,7 +4992,7 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex +@deftypefun int getpgid (pid_t @var{pid}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Stub or direct syscall, except on hurd, where it is equally safe. - + -@code{getpgid} is the same as the BSD function @code{getpgrp}. It +The @code{getpgid} function returns the process group ID of the process @var{pid}. You can supply a @@ -5004,7 +5004,7 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex @end table -@end deftypefn +@end deftypefun - + @comment unistd.h @comment POSIX.1 @deftypefun int setpgid (pid_t @var{pid}, pid_t @var{pgid}) @@ -5030,7 +5030,7 @@ diff -urN glibc-2.17-c758a686/manual/job.texi glibc-2.17-c758a686/manual/job.tex +@c Stub, or ioctl on BSD and GNU/Linux. This function returns the process group ID of the foreground process group associated with the terminal open on descriptor @var{filedes}. - + @@ -1258,6 +1258,8 @@ @comment unistd.h @comment POSIX.1 @@ -5060,7 +5060,7 @@ diff -urN glibc-2.17-c758a686/manual/lang.texi glibc-2.17-c758a686/manual/lang.t +@c assert_fail_base calls asprintf, and fflushes stderr. Verify the programmer's belief that @var{expression} is nonzero at this point in the program. - + @@ -91,6 +93,8 @@ @comment assert.h @comment GNU @@ -5068,7 +5068,7 @@ diff -urN glibc-2.17-c758a686/manual/lang.texi glibc-2.17-c758a686/manual/lang.t +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}} +@c assert_fail_base calls asprintf, and fflushes stderr. Similar to @code{assert}, but verifies that @var{errnum} is zero. - + If @code{NDEBUG} is not defined, @code{assert_perror} tests the value of @@ -423,6 +427,8 @@ @comment stdarg.h @@ -5125,7 +5125,7 @@ diff -urN glibc-2.17-c758a686/manual/libc.texinfo glibc-2.17-c758a686/manual/lib +++ glibc-2.17-c758a686/manual/libc.texinfo 2014-09-12 16:10:25.996741462 -0400 @@ -7,7 +7,7 @@ @include macros.texi - + @comment Tell install-info what to do. -@dircategory Libraries +@dircategory Software libraries @@ -5135,19 +5135,19 @@ diff -urN glibc-2.17-c758a686/manual/libc.texinfo glibc-2.17-c758a686/manual/lib @@ -46,7 +46,7 @@ @value{VERSION} @value{PKGVERSION}. @end ifclear - + -Copyright @copyright{} 1993--2012 Free Software Foundation, Inc. +Copyright @copyright{} 1993--2014 Free Software Foundation, Inc. - + Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version @@ -118,6 +118,7 @@ @include chapters.texi - + @node Free Manuals, Copying, Contributors, Top +@appendix Free Software Needs Free Documentation @include freemanuals.texi - + @node Copying, Documentation License, Free Manuals, Top diff -urN glibc-2.17-c758a686/manual/libc-texinfo.sh glibc-2.17-c758a686/manual/libc-texinfo.sh --- glibc-2.17-c758a686/manual/libc-texinfo.sh 2012-12-24 22:02:13.000000000 -0500 @@ -5155,7 +5155,7 @@ diff -urN glibc-2.17-c758a686/manual/libc-texinfo.sh glibc-2.17-c758a686/manual/ @@ -91,9 +91,11 @@ * Variable Index:: Index of variables and variable-like macros. * File Index:: Index of programs and files. - + + @detailmenu --- The Detailed Node Listing --- EOF @@ -5163,7 +5163,7 @@ diff -urN glibc-2.17-c758a686/manual/libc-texinfo.sh glibc-2.17-c758a686/manual/ + echo '@end detailmenu' echo '@end menu'; } >${OUTDIR}top-menu.texi.$$ mv -f ${OUTDIR}top-menu.texi.$$ ${OUTDIR}top-menu.texi - + diff -urN glibc-2.17-c758a686/manual/libdl.texi glibc-2.17-c758a686/manual/libdl.texi --- glibc-2.17-c758a686/manual/libdl.texi 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.17-c758a686/manual/libdl.texi 2014-09-12 16:10:06.045792717 -0400 @@ -5203,7 +5203,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @deftypefn {Obsolete function} int creat (const char *@var{filename}, mode_t @var{mode}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} This function is obsolete. The call: - + @smallexample @@ -202,6 +209,7 @@ @comment fcntl.h @@ -5220,7 +5220,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} The function @code{close} closes the file descriptor @var{filedes}. Closing a file has the following consequences: - + @@ -300,6 +309,7 @@ @comment unistd.h @comment POSIX.1 @@ -5288,7 +5288,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{lseek} function is used to change the file position of the file with descriptor @var{filedes}. - + @@ -713,6 +741,7 @@ @comment unistd.h @comment Unix98 @@ -5304,7 +5304,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@acsmem{} @aculock{}}} The @code{fdopen} function returns a new stream for the file descriptor @var{filedes}. - + @@ -853,6 +883,7 @@ @comment stdio.h @comment POSIX.1 @@ -5324,12 +5324,12 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -1055,7 +1087,7 @@ @comment BSD @deftp {Data Type} {struct iovec} - + -The @code{iovec} structure describes a buffer. It contains two fields: +The @code{iovec} structure describes a buffer. It contains two fields: - + @table @code - + @@ -1071,6 +1103,11 @@ @comment sys/uio.h @comment BSD @@ -5339,7 +5339,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@c with old kernels that lack a full readv/writev implementation, may +@c malloc the buffer into which data is read, if the total read size is +@c too large for alloca. - + The @code{readv} function reads data from @var{filedes} and scatters it into the buffers described in @var{vector}, which is taken to be @@ -1089,6 +1126,11 @@ @@ -5351,18 +5351,18 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@c with old kernels that lack a full readv/writev implementation, may +@c malloc the buffer from which data is written, if the total write size +@c is too large for alloca. - + The @code{writev} function gathers data from the buffers described in @var{vector}, which is taken to be @var{count} structures long, and writes @@ -1103,8 +1145,8 @@ - + @end deftypefun - + -@c Note - I haven't read this anywhere. I surmised it from my knowledge -@c of computer science. Thus, there could be subtleties I'm missing. +@c Note - I haven't read this anywhere. I surmised it from my knowledge +@c of computer science. Thus, there could be subtleties I'm missing. - + Note that if the buffers are small (under about 1kB), high-level streams may be easier to use than these functions. However, @code{readv} and @@ -1149,6 +1191,7 @@ @@ -5370,37 +5370,37 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @comment POSIX @deftypefun {void *} mmap (void *@var{address}, size_t @var{length}, int @var{protect}, int @var{flags}, int @var{filedes}, off_t @var{offset}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The @code{mmap} function creates a new mapping, connected to bytes (@var{offset}) to (@var{offset} + @var{length} - 1) in the file open on @@ -1156,8 +1199,8 @@ is created, which is not removed by closing the file. - + @var{address} gives a preferred starting address for the mapping. -@code{NULL} expresses no preference. Any previous mapping at that -address is automatically removed. The address you give may still be +@code{NULL} expresses no preference. Any previous mapping at that +address is automatically removed. The address you give may still be changed, unless you use the @code{MAP_FIXED} flag. - + @vindex PROT_READ @@ -1221,13 +1264,13 @@ - + @c Linux has some other MAP_ options, which I have not discussed here. @c MAP_DENYWRITE, MAP_EXECUTABLE and MAP_GROWSDOWN don't seem applicable to -@c user programs (and I don't understand the last two). MAP_LOCKED does +@c user programs (and I don't understand the last two). MAP_LOCKED does @c not appear to be implemented. - + @end vtable - + -@code{mmap} returns the address of the new mapping, or @math{-1} for an -error. +@code{mmap} returns the address of the new mapping, or +@code{MAP_FAILED} for an error. - + Possible errors include: - + @@ -1268,6 +1311,9 @@ @comment sys/mman.h @comment LFS @@ -5416,7 +5416,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @comment POSIX @deftypefun int munmap (void *@var{addr}, size_t @var{length}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + @code{munmap} removes any memory maps from (@var{addr}) to (@var{addr} + @var{length}). @var{length} should be the length of the mapping. @@ -1310,6 +1357,7 @@ @@ -5424,7 +5424,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @comment POSIX @deftypefun int msync (void *@var{address}, size_t @var{length}, int @var{flags}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + When using shared mappings, the kernel can write the file at any time before the mapping is removed. To be certain data has actually been @@ -1357,17 +1405,18 @@ @@ -5432,49 +5432,49 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @comment GNU @deftypefun {void *} mremap (void *@var{address}, size_t @var{length}, size_t @var{new_length}, int @var{flag}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + This function can be used to change the size of an existing memory area. @var{address} and @var{length} must cover a region entirely mapped -in the same @code{mmap} statement. A new mapping with the same +in the same @code{mmap} statement. A new mapping with the same characteristics will be returned with the length @var{new_length}. - + -One option is possible, @code{MREMAP_MAYMOVE}. If it is given in +One option is possible, @code{MREMAP_MAYMOVE}. If it is given in @var{flags}, the system may remove the existing mapping and create a new one of the desired length in another location. - + -The address of the resulting mapping is returned, or @math{-1}. Possible +The address of the resulting mapping is returned, or @math{-1}. Possible error codes include: - + @table @code @@ -1405,6 +1454,7 @@ @comment sys/mman.h @comment POSIX @deftypefun int madvise (void *@var{addr}, size_t @var{length}, int @var{advice}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + This function can be used to provide the system with @var{advice} about the intended usage patterns of the memory region starting at @var{addr} @@ -1418,11 +1468,11 @@ The region should receive no further special treatment. - + @item MADV_RANDOM -The region will be accessed via random page references. The kernel +The region will be accessed via random page references. The kernel should page-in the minimal number of pages for each page fault. - + @item MADV_SEQUENTIAL -The region will be accessed via sequential page references. This +The region will be accessed via sequential page references. This may cause the kernel to aggressively read-ahead, expecting further sequential references after any page fault within this region. - + @@ -1471,6 +1521,58 @@ @end table @end deftypefun - + +@comment sys/mman.h +@comment POSIX +@deftypefn Function int shm_open (const char *@var{name}, int @var{oflag}, mode_t @var{mode}) @@ -5546,7 +5546,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@c Setting a bit isn't necessarily atomic, so there's a potential race +@c here if set is not used exclusively. This macro adds @var{filedes} to the file descriptor set @var{set}. - + The @var{filedes} parameter must not have side effects since it is @@ -1547,6 +1653,9 @@ @comment sys/types.h @@ -5556,7 +5556,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@c Setting a bit isn't necessarily atomic, so there's a potential race +@c here if set is not used exclusively. This macro removes @var{filedes} from the file descriptor set @var{set}. - + The @var{filedes} parameter must not have side effects since it is @@ -1556,6 +1665,7 @@ @comment sys/types.h @@ -5565,7 +5565,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@safety{@prelim{}@mtsafe{@mtsrace{:set}}@assafe{}@acsafe{}} This macro returns a nonzero value (true) if @var{filedes} is a member of the file descriptor set @var{set}, and zero (false) otherwise. - + @@ -1568,6 +1678,10 @@ @comment sys/types.h @comment BSD @@ -5578,7 +5578,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t activity on any of the specified sets of file descriptors, or until the timeout period has expired. @@ -1669,15 +1783,14 @@ - + @comment unistd.h @comment X/Open -@deftypefun int sync (void) @@ -5588,12 +5588,12 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t has not been written to the device. All dirty buffers in the kernel will be written and so an overall consistent system can be achieved (if no other process in parallel writes data). - + A prototype for @code{sync} can be found in @file{unistd.h}. - -The return value is zero to indicate no error. @end deftypefun - + Programs more often want to ensure that data written to a given file is @@ -1687,6 +1800,7 @@ @comment unistd.h @@ -5771,7 +5771,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t immediately returns after the operation was enqueued or when an error was encountered. @@ -1989,7 +2256,8 @@ - + @comment aio.h @comment Unix98 -@deftypefun int aio_read64 (struct aiocb *@var{aiocbp}) @@ -5788,16 +5788,16 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t This function initiates an asynchronous write operation. The function call immediately returns after the operation was enqueued or if before this happens an error was encountered. - + The first @code{aiocbp->aio_nbytes} bytes from the buffer starting at @code{aiocbp->aio_buf} are written to the file for which -@code{aiocbp->aio_fildes} is an descriptor, starting at the absolute +@code{aiocbp->aio_fildes} is a descriptor, starting at the absolute position @code{aiocbp->aio_offset} in the file. - + If prioritized I/O is supported by the platform, the @@ -2073,7 +2342,8 @@ - + @comment aio.h @comment Unix98 -@deftypefun int aio_write64 (struct aiocb *@var{aiocbp}) @@ -5820,7 +5820,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t number of read and write requests at one time. The requests can all be meant for the same file, all for different files or every solution in @@ -2177,7 +2453,8 @@ - + @comment aio.h @comment Unix98 -@deftypefun int lio_listio64 (int @var{mode}, struct aiocb *const @var{list}, int @var{nent}, struct sigevent *@var{sig}) @@ -5846,7 +5846,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t that the argument is a reference to a variable of type @code{struct aiocb64}. @@ -2239,7 +2518,8 @@ - + @comment aio.h @comment POSIX.1b -@deftypefun ssize_t aio_return (const struct aiocb *@var{aiocbp}) @@ -5856,7 +5856,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t carried out by the request described in the variable pointed to by @var{aiocbp}. As long as the error status of this request as returned @@ -2262,7 +2542,8 @@ - + @comment aio.h @comment Unix98 -@deftypefun int aio_return64 (const struct aiocb64 *@var{aiocbp}) @@ -5955,11 +5955,11 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t require additional arguments to be supplied. These additional arguments @@ -2592,7 +2894,7 @@ Set flags associated with the open file. @xref{File Status Flags}. - + @item F_GETLK -Get a file lock. @xref{File Locks}. +Test a file lock. @xref{File Locks}. - + @item F_SETLK Set or clear a file lock. @xref{File Locks}. @@ -2648,6 +2962,7 @@ @@ -5977,25 +5977,25 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function copies the descriptor @var{old} to descriptor number @var{new}. - + @@ -2929,19 +3245,19 @@ But most programs will want to be portable to other POSIX.1 systems and should use the POSIX.1 names above instead. - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @deftypevr Macro int O_READ Open the file for reading. Same as @code{O_RDONLY}; only defined on GNU. @end deftypevr - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @deftypevr Macro int O_WRITE Open the file for writing. Same as @code{O_WRONLY}; only defined on GNU. @end deftypevr - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @@ -6004,7 +6004,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -3045,7 +3361,7 @@ The following three file name translation flags exist only on @gnuhurdsystems{}. - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @@ -6013,7 +6013,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -3054,7 +3370,7 @@ @xref{Job Control}. @end deftypevr - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @@ -6022,7 +6022,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -3063,7 +3379,7 @@ @cindex symbolic link, opening @end deftypevr - + -@comment fcntl.h +@comment fcntl.h (optional) @comment GNU @@ -6031,7 +6031,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -3095,7 +3411,7 @@ The remaining operating modes are BSD extensions. They exist only on some systems. On other systems, these macros are not defined. - + -@comment fcntl.h +@comment fcntl.h (optional) @comment BSD @@ -6040,7 +6040,7 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @@ -3106,7 +3422,7 @@ the lock on the new file first. @end deftypevr - + -@comment fcntl.h +@comment fcntl.h (optional) @comment BSD @@ -6052,15 +6052,15 @@ diff -urN glibc-2.17-c758a686/manual/llio.texi glibc-2.17-c758a686/manual/llio.t @code{write} and @code{lseek}. However, most devices also have a few -peculiar operations which do not fit into this model. Such as: +peculiar operations which do not fit into this model. Such as: - + @itemize @bullet - + @@ -3634,6 +4169,7 @@ @comment sys/ioctl.h @comment BSD @deftypefun int ioctl (int @var{filedes}, int @var{command}, @dots{}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The @code{ioctl} function performs the generic I/O operation @var{command} on @var{filedes}. @@ -3653,3 +4189,6 @@ @@ -6209,7 +6209,7 @@ diff -urN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loca +@c strcasecmp_l ok (C locale) The function @code{setlocale} sets the current locale for category @var{category} to @var{locale}. - + @@ -496,6 +626,10 @@ @comment locale.h @comment ISO @@ -6233,7 +6233,7 @@ diff -urN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loca function, which returns all the information, @code{nl_langinfo} @@ -1056,6 +1193,11 @@ numbers according to these rules. - + @deftypefun ssize_t strfmon (char *@var{s}, size_t @var{maxsize}, const char *@var{format}, @dots{}) +@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}} +@c It (and strfmon_l) both call vstrfmon_l, which, besides accessing the @@ -6257,7 +6257,7 @@ diff -urN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loca @@ -1318,5 +1464,5 @@ free (line); @end smallexample - + -Note that the loop continues until an read error is detected or until a +Note that the loop continues until a read error is detected or until a definitive (positive or negative) answer is read. @@ -6267,21 +6267,21 @@ diff -urN glibc-2.17-c758a686/manual/macros.texi glibc-2.17-c758a686/manual/macr @@ -35,16 +35,225 @@ GNU/Linux and GNU/Hurd systems @end macro - + -@c Descrption applying to GNU/Hurd systems; that is, systems using the +@c Description applying to GNU/Hurd systems; that is, systems using the @c GNU Hurd with the GNU C Library. @macro gnuhurdsystems GNU/Hurd systems @end macro - + -@c Descrption applying to GNU/Linux systems; that is, systems using +@c Description applying to GNU/Linux systems; that is, systems using @c the Linux kernel with the GNU C Library. @macro gnulinuxsystems GNU/Linux systems @end macro - + +@c Document the safety functions as preliminary. It does NOT expand its +@c comments. +@macro prelim {comments} @@ -6501,16 +6501,16 @@ diff -urN glibc-2.17-c758a686/manual/maint.texi glibc-2.17-c758a686/manual/maint chosen, in order. The @file{configure} files are often generated from -@file{configure.in} files using Autoconf. +@file{configure.ac} files using Autoconf. - + A system-dependent @file{configure} script will usually add things to the shell variables @samp{DEFS} and @samp{config_vars}; see the @@ -329,14 +329,14 @@ just @w{@samp{--with-@var{package}}} (no argument), then it sets @w{@samp{with_@var{package}}} to @samp{yes}. - + -@item configure.in +@item configure.ac - + This file is an Autoconf input fragment to be processed into the file @file{configure} in this subdirectory. @xref{Introduction,,, autoconf.info, Autoconf: Generating Automatic Configuration Scripts}, @@ -6530,7 +6530,7 @@ diff -urN glibc-2.17-c758a686/manual/maint.texi glibc-2.17-c758a686/manual/maint +@w{@file{sysdeps/m68k/68020}}. Code which is specific to the floating-point coprocessor used with a particular machine should go in @w{@file{sysdeps/@var{machine}/fpu}}. - + diff -urN glibc-2.17-c758a686/manual/Makefile glibc-2.17-c758a686/manual/Makefile --- glibc-2.17-c758a686/manual/Makefile 2014-09-12 16:08:17.823070748 -0400 +++ glibc-2.17-c758a686/manual/Makefile 2014-09-12 16:10:06.045792717 -0400 @@ -6539,62 +6539,62 @@ diff -urN glibc-2.17-c758a686/manual/Makefile glibc-2.17-c758a686/manual/Makefil -# Free Software Foundation, Inc. +# Copyright (C) 1992-2014 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 @@ -20,14 +19,10 @@ - + subdir := manual - + -# Allow override -INSTALL_INFO = install-info +include ../Makeconfig - + .PHONY: dvi pdf info html - + -# Get glibc's configuration info. -include ../Makeconfig - dvi: $(objpfx)libc.dvi pdf: $(objpfx)libc.pdf - + @@ -42,8 +37,8 @@ - intro errno memory ctype string charset locale \ - message search pattern io stdio llio filesys \ - pipe socket terminal syslog math arith time \ + intro errno memory ctype string charset locale \ + message search pattern io stdio llio filesys \ + pipe socket terminal syslog math arith time \ - resource setjmp signal startup process job nss \ - users sysinfo conf crypt debug probes) + resource setjmp signal startup process ipc job \ + nss users sysinfo conf crypt debug threads probes) add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi)) appendices = lang.texi header.texi install.texi maint.texi platform.texi \ - contrib.texi + contrib.texi @@ -89,6 +84,7 @@ $(objpfx)summary.texi: $(objpfx)stamp-summary ; $(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \ - $(texis-path)) + $(texis-path)) + -$(SHELL) ./check-safety.sh $(filter-out $(objpfx)%, $(texis-path)) - $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' \ - > $(objpfx)summary-tmp - $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi + $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' \ + > $(objpfx)summary-tmp + $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi @@ -145,8 +141,7 @@ - mv -f $@.new $@ - + mv -f $@.new $@ + $(objpfx)%.info: %.texinfo - LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=`basename $@` $< - mv `basename $@`* $(objpfx) + LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $< - + $(objpfx)%.dvi: %.texinfo - cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(getdtablesize->getrlimit. - + @code{ulimit} gets the current limit or sets the current and maximum limit for a particular resource for the calling process according to the @@ -480,6 +495,10 @@ @@ -10244,16 +10244,16 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c It calls getrlimit and modifies the rlim_cur field before calling +@c setrlimit. There's a window for a concurrent call to setrlimit that +@c modifies e.g. rlim_max, which will be lost if running as super-user. - + @code{vlimit} sets the current limit for a resource for a process. - + @@ -778,6 +797,8 @@ @comment sched.h @comment POSIX @deftypefun int sched_setscheduler (pid_t @var{pid}, int @var{policy}, const struct sched_param *@var{param}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function sets both the absolute priority and the scheduling policy for a process. @@ -848,6 +869,8 @@ @@ -10262,7 +10262,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re @deftypefun int sched_getscheduler (pid_t @var{pid}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function returns the scheduling policy assigned to the process with Process ID (pid) @var{pid}, or the calling process if @var{pid} is zero. @@ -881,6 +904,8 @@ @@ -10271,40 +10271,40 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re @deftypefun int sched_setparam (pid_t @var{pid}, const struct sched_param *@var{param}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function sets a process' absolute priority. - + @@ -893,7 +918,9 @@ - + @comment sched.h @comment POSIX -@deftypefun int sched_getparam (pid_t @var{pid}, const struct sched_param *@var{param}) +@deftypefun int sched_getparam (pid_t @var{pid}, struct sched_param *@var{param}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function returns a process' absolute priority. - + @@ -922,7 +949,9 @@ - + @comment sched.h @comment POSIX -@deftypefun int sched_get_priority_min (int *@var{policy}) +@deftypefun int sched_get_priority_min (int @var{policy}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function returns the lowest absolute priority value that is allowable for a process with scheduling policy @var{policy}. @@ -942,7 +971,9 @@ - + @comment sched.h @comment POSIX -@deftypefun int sched_get_priority_max (int *@var{policy}) +@deftypefun int sched_get_priority_max (int @var{policy}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function returns the highest absolute priority value that is allowable for a process that with scheduling policy @var{policy}. @@ -963,6 +994,8 @@ @@ -10313,7 +10313,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re @deftypefun int sched_rr_get_interval (pid_t @var{pid}, struct timespec *@var{interval}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + This function returns the length of the quantum (time slice) used with the Round Robin scheduling policy, if it is used, for the process with @@ -987,6 +1020,8 @@ @@ -10322,12 +10322,12 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re @deftypefun int sched_yield (void) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall on Linux; alias to swtch on HURD. - + This function voluntarily gives up the process' claim on the CPU. - + @@ -1045,7 +1080,7 @@ about. - + But just to be clear about the scope of this scheduling: Any time a -process with a absolute priority of 0 and a process with an absolute +process with an absolute priority of 0 and a process with an absolute @@ -10351,7 +10351,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c Direct syscall on UNIX. On HURD, calls _hurd_priority_which_map. Set the nice value of a set of processes to @var{niceval}; @var{class} and @var{id} specify which ones (see below). - + @@ -1222,6 +1261,11 @@ @comment unistd.h @comment BSD @@ -10373,7 +10373,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c __CPU_ZERO_S ok +@c memset dup ok This macro initializes the CPU set @var{set} to be the empty set. - + This macro is a GNU extension and is defined in @file{sched.h}. @@ -1327,6 +1375,11 @@ @comment sched.h @@ -10385,7 +10385,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c __CPUELT ok +@c __CPUMASK ok This macro adds @var{cpu} to the CPU set @var{set}. - + The @var{cpu} parameter must not have side effects since it is @@ -1338,6 +1391,11 @@ @comment sched.h @@ -10397,7 +10397,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c __CPUELT dup ok +@c __CPUMASK dup ok This macro removes @var{cpu} from the CPU set @var{set}. - + The @var{cpu} parameter must not have side effects since it is @@ -1349,6 +1407,11 @@ @comment sched.h @@ -10410,7 +10410,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c __CPUMASK dup ok This macro returns a nonzero value (true) if @var{cpu} is a member of the CPU set @var{set}, and zero (false) otherwise. - + @@ -1365,6 +1428,9 @@ @comment sched.h @comment GNU @@ -10418,7 +10418,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Wrapped syscall to zero out past the kernel cpu set size; Linux +@c only. - + This functions stores the CPU affinity mask for the process or thread with the ID @var{pid} in the @var{cpusetsize} bytes long bitmap @@ -1393,6 +1459,9 @@ @@ -10428,7 +10428,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Wrapped syscall to detect attempts to set bits past the kernel cpu +@c set size; Linux only. - + This function installs the @var{cpusetsize} bytes long affinity mask pointed to by @var{cpuset} for the process or thread with the ID @var{pid}. @@ -1516,6 +1585,9 @@ @@ -10459,7 +10459,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +The @code{get_avphys_pages} function returns the number of available pages of physical the system has. To get the amount of memory this number has to be multiplied by the page size. - + @@ -1614,6 +1689,9 @@ @comment sys/sysinfo.h @comment GNU @@ -10469,7 +10469,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@c no @mtasurace issue), and on some arches, from /proc using streams. The @code{get_nprocs_conf} function returns the number of processors the operating system configured. - + @@ -1623,6 +1701,8 @@ @comment sys/sysinfo.h @comment GNU @@ -10477,7 +10477,7 @@ diff -urN glibc-2.17-c758a686/manual/resource.texi glibc-2.17-c758a686/manual/re +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} +@c This function reads from /proc using file descriptor I/O. The @code{get_nprocs} function returns the number of available processors. - + This function is a GNU extension. @@ -1638,8 +1718,12 @@ @comment stdlib.h @@ -10497,7 +10497,7 @@ diff -urN glibc-2.17-c758a686/manual/search.texi glibc-2.17-c758a686/manual/sear --- glibc-2.17-c758a686/manual/search.texi 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/manual/search.texi 2014-09-12 16:10:06.043792722 -0400 @@ -71,7 +71,8 @@ - + @comment search.h @comment SVID -@deftypefun {void *} lfind (const void *@var{key}, void *@var{base}, size_t *@var{nmemb}, size_t @var{size}, comparison_fn_t @var{compar}) @@ -10543,7 +10543,7 @@ diff -urN glibc-2.17-c758a686/manual/search.texi glibc-2.17-c758a686/manual/sear +@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@acucorrupt{}}} The @var{qsort} function sorts the array @var{array}. The array contains @var{count} elements, each of which is of size @var{size}. - + @@ -256,6 +274,9 @@ @comment search.h @comment SVID @@ -10562,7 +10562,7 @@ diff -urN glibc-2.17-c758a686/manual/search.texi glibc-2.17-c758a686/manual/sear +provides an additional set of functions with a reentrant interface which provide a similar interface but which allow to keep arbitrarily many hashing tables. - + @@ -285,6 +306,9 @@ @comment search.h @comment SVID @@ -10640,7 +10640,7 @@ diff -urN glibc-2.17-c758a686/manual/search.texi glibc-2.17-c758a686/manual/sear meaning of the first two arguments is identical. But instead of operating on a single global hashing table the function works on the @@ -401,7 +463,7 @@ - + @table @code @item ENOMEM -The table is filled and @code{hsearch_r} was called with an so far @@ -10730,13 +10730,13 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj established that return point. Returning from @code{setjmp} by means of @@ -141,7 +159,7 @@ statement (such as @samp{if}, @samp{switch}, or @samp{while}). - + @item -As one operand of a equality or comparison operator that appears as the +As one operand of an equality or comparison operator that appears as the test expression of a selection or iteration statement. The other operand must be an integer constant expression. - + @@ -199,6 +217,11 @@ @comment setjmp.h @comment POSIX.1 @@ -10761,11 +10761,11 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj @@ -237,7 +262,7 @@ @comment SVID @deftp {Data Type} ucontext_t - + -The @code{ucontext_t} type is defined as a structure with as least the +The @code{ucontext_t} type is defined as a structure with at least the following elements: - + @table @code @@ -267,6 +292,10 @@ @comment ucontext.h @@ -10780,7 +10780,7 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj the content of the registers, the signal mask, and the current stack. @@ -278,25 +307,26 @@ @end deftypefun - + The @code{getcontext} function is similar to @code{setjmp} but it does -not provide an indication of whether the function returns for the first -time or whether the initialized context was used and the execution is @@ -10794,20 +10794,20 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj +be done carefully since the context contains registers which might contain +register variables. This is a good situation to define variables with +@code{volatile}. - + Once the context variable is initialized it can be used as is or it can -be modified. The latter is normally done to implement co-routines or -similar constructs. The @code{makecontext} function is what has to be -used to do that. +be modified using the @code{makecontext} function. The latter is normally +done when implementing co-routines or similar constructs. - + @comment ucontext.h @comment SVID @deftypefun void makecontext (ucontext_t *@var{ucp}, void (*@var{func}) (void), int @var{argc}, @dots{}) +@safety{@prelim{}@mtsafe{@mtsrace{:ucp}}@assafe{}@acsafe{}} +@c Linux-only implementations mostly in assembly, nothing unsafe. - + -The @var{ucp} parameter passed to the @code{makecontext} shall be +The @var{ucp} parameter passed to @code{makecontext} shall be initialized by a call to @code{getcontext}. The context will be @@ -10833,7 +10833,7 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj +can, depending on the direction the stack grows, be different). This difference makes the @code{makecontext} function hard to use and it requires detection of the platform at compile time. - + @comment ucontext.h @comment SVID @deftypefun int setcontext (const ucontext_t *@var{ucp}) @@ -10846,13 +10846,13 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj +@c to an earlier state on the same stack, may conflict with pthread +@c cleanups. This is not quite MT-Unsafe, it's a different kind of +@c safety issue. - + The @code{setcontext} function restores the context described by @var{ucp}. The context is not modified and can be reused as often as @@ -357,6 +396,9 @@ terminates normally with an exit status value of @code{EXIT_SUCCESS} (@pxref{Program Termination}). - + +If the context was created by a call to a signal handler or from any +other source then the behaviour of @code{setcontext} is unspecified. + @@ -10867,7 +10867,7 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj +@c Linux-only implementations mostly in assembly. Some ports call or +@c inline getcontext and/or setcontext, adjusting the saved context in +@c between, so we inherit the potential issues of both. - + The @code{swapcontext} function is similar to @code{setcontext} but instead of just replacing the current context the latter is first saved @@ -385,15 +431,15 @@ @@ -10877,9 +10877,9 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj -function fails it returns @code{-1} and set @var{errno} accordingly. +function fails it returns @code{-1} and sets @var{errno} accordingly. @end deftypefun - + @heading Example for SVID Context Handling - + The easiest way to use the context handling functions is as a replacement for @code{setjmp} and @code{longjmp}. The context contains -on most platforms more information which might lead to less surprises @@ -10887,7 +10887,7 @@ diff -urN glibc-2.17-c758a686/manual/setjmp.texi glibc-2.17-c758a686/manual/setj +on most platforms more information which may lead to fewer surprises +but this also means using these functions is more expensive (besides being less portable). - + @smallexample @@ -440,11 +486,11 @@ This an example how the context functions can be used to implement @@ -10945,7 +10945,7 @@ diff -urN glibc-2.17-c758a686/manual/signal.texi glibc-2.17-c758a686/manual/sign +@c free dup @ascuheap @acsmem This function prints a message describing the signal @var{signum} to the standard error output stream @code{stderr}; see @ref{Standard Streams}. - + @@ -972,6 +992,12 @@ @comment signal.h @comment ISO @@ -10958,7 +10958,7 @@ diff -urN glibc-2.17-c758a686/manual/signal.texi glibc-2.17-c758a686/manual/sign +@c sigaction dup ok The @code{signal} function establishes @var{action} as the action for the signal @var{signum}. - + @@ -1094,6 +1120,10 @@ @comment signal.h @comment GNU @@ -11074,7 +11074,7 @@ diff -urN glibc-2.17-c758a686/manual/signal.texi glibc-2.17-c758a686/manual/sign a member of the signal set @var{set}. It returns @code{1} if the signal is in the set, @code{0} if not, and @code{-1} if there is an error. @@ -2566,7 +2615,7 @@ - + Note that you must not use @code{sigprocmask} in multi-threaded processes, because each thread has its own signal mask and there is no single process -signal mask. According to POSIX, the behavior of @code{sigprocmask} in a @@ -11105,7 +11105,7 @@ diff -urN glibc-2.17-c758a686/manual/signal.texi glibc-2.17-c758a686/manual/sign in @var{set}. If there is a pending signal that is blocked from delivery, then that signal is a member of the returned set. (You can @@ -2921,7 +2978,18 @@ - + @comment unistd.h @comment POSIX.1 -@deftypefun int pause () @@ -11154,7 +11154,7 @@ diff -urN glibc-2.17-c758a686/manual/signal.texi glibc-2.17-c758a686/manual/sign during signal handling. When a signal is received by the process and its action indicates that the signal stack is used, the system arranges @@ -3195,7 +3278,9 @@ - + @comment signal.h @comment BSD -@deftypefun int sigstack (const struct sigstack *@var{stack}, struct sigstack *@var{oldstack}) @@ -11346,7 +11346,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The macro computes the length of socket address in the local namespace. @end deftypefn - + @@ -689,7 +742,7 @@ To create a socket in the IPv4 Internet namespace, use the symbolic name @code{PF_INET} of this namespace as the @var{namespace} argument to @@ -11354,7 +11354,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock -macro @code{PF_INET6}. These macros are defined in @file{sys/socket.h}. +macro @code{PF_INET6}. These macros are defined in @file{sys/socket.h}. @pindex sys/socket.h - + @comment sys/socket.h @@ -726,12 +779,12 @@ * Internet Address Formats:: How socket addresses are specified in the @@ -11369,7 +11369,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +* Protocols Database:: Referring to protocols by name. * Inet Example:: Putting it all together. @end menu - + @@ -1035,6 +1088,13 @@ @comment arpa/inet.h @comment BSD @@ -11415,7 +11415,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +given in the standard numbers-and-dots notation. The returned address is +in host order. If the input is not valid, @code{inet_network} returns @code{-1}. - + The function works only with traditional IPv4 class A, B and C network @@ -1069,6 +1138,10 @@ @comment arpa/inet.h @@ -11449,7 +11449,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c IN_CLASSB ok This function returns the local-address-within-network part of the Internet host address @var{addr}. - + @@ -1106,6 +1187,11 @@ @comment arpa/inet.h @comment BSD @@ -11461,7 +11461,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c IN_CLASSB ok This function returns the network number part of the Internet host address @var{addr}. - + @@ -1117,6 +1203,16 @@ @comment arpa/inet.h @comment IPv6 basic API @@ -11480,7 +11480,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock presentation (textual) to network (binary) format. @var{af} should be either @code{AF_INET} or @code{AF_INET6}, as appropriate for the type of @@ -1127,7 +1223,17 @@ - + @comment arpa/inet.h @comment IPv6 basic API -@deftypefun {const char *} inet_ntop (int @var{af}, const void *@var{cp}, char *@var{buf}, size_t @var{len}) @@ -11588,7 +11588,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock allows the caller to specify the desired address family (e.g.@: @code{AF_INET} or @code{AF_INET6}) of the result. @@ -1225,11 +1406,20 @@ - + @comment netdb.h @comment BSD -@deftypefun {struct hostent *} gethostbyaddr (const char *@var{addr}, size_t @var{length}, int @var{format}) @@ -11689,7 +11689,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock @code{struct hostent} in the @var{result_buf} parameter. In addition @@ -1290,37 +1550,42 @@ parameters. - + A pointer to the buffer, in which the result is stored, is available in -@code{*@var{result}} after the function call successfully returned. If -an error occurs or if no entry is found, the pointer @code{*@var{result}} @@ -11710,7 +11710,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +should be repeated with a larger buffer. Additional error information is +not stored in the global variable @code{h_errno} but instead in the object +pointed to by @var{h_errnop}. - + Here's a small example: @smallexample struct hostent * @@ -11722,12 +11722,12 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock char *tmphstbuf; int res; int herr; - + + hostbuf = malloc (sizeof (struct hostent)); hstbuflen = 1024; - /* Allocate buffer, remember to free it to avoid memory leakage. */ tmphstbuf = malloc (hstbuflen); - + - while ((res = gethostbyname_r (host, &hostbuf, tmphstbuf, hstbuflen, + while ((res = gethostbyname_r (host, hostbuf, tmphstbuf, hstbuflen, &hp, &herr)) == ERANGE) @@ -11760,7 +11760,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock allows the caller to specify the desired address family (e.g.@: @code{AF_INET} or @code{AF_INET6}) for the result. @@ -1339,11 +1615,26 @@ - + @comment netdb.h @comment GNU -@deftypefun int gethostbyaddr_r (const char *@var{addr}, size_t @var{length}, int @var{format}, struct hostent *restrict @var{result_buf}, char *restrict @var{buf}, size_t @var{buflen}, struct hostent **restrict @var{result}, int *restrict @var{h_errnop}) @@ -11806,7 +11806,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c libc_lock_unlock dup @aculock This function opens the hosts database to begin scanning it. You can then call @code{gethostent} to read the entries. - + @@ -1377,6 +1680,27 @@ @comment netdb.h @comment BSD @@ -11850,7 +11850,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c libc_lock_unlock @aculock This function closes the hosts database. @end deftypefun - + @@ -1483,6 +1816,34 @@ @comment netdb.h @comment BSD @@ -11923,7 +11923,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c nss_next2 dup @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem +@c libc_lock_unlock dup @aculock This function opens the services database to begin scanning it. - + If the @var{stayopen} argument is nonzero, this sets a flag so that @@ -1519,6 +1905,25 @@ @comment netdb.h @@ -11965,7 +11965,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c libc_lock_unlock @aculock This function closes the services database. @end deftypefun - + @@ -1571,6 +1984,11 @@ @comment netinet/in.h @comment BSD @@ -11996,7 +11996,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c bswap_32 dup ok This function converts the @code{uint32_t} integer @var{hostlong} from host byte order to network byte order. - + @@ -1594,6 +2017,8 @@ @comment netinet/in.h @comment BSD @@ -12005,7 +12005,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c Alias to htonl. This function converts the @code{uint32_t} integer @var{netlong} from network byte order to host byte order. - + @@ -1658,6 +2083,20 @@ @comment netdb.h @comment BSD @@ -12063,7 +12063,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c nss_next2 dup @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem +@c libc_lock_unlock dup @aculock This function opens the protocols database to begin scanning it. - + If the @var{stayopen} argument is nonzero, this sets a flag so that @@ -1690,6 +2153,25 @@ @comment netdb.h @@ -12105,7 +12105,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c libc_lock_unlock @aculock This function closes the protocols database. @end deftypefun - + @@ -1766,6 +2256,7 @@ @comment sys/socket.h @comment BSD @@ -12145,7 +12145,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} The @code{listen} function enables the socket @var{socket} to accept connections, thus making it a server socket. - + @@ -2123,6 +2618,7 @@ @comment sys/socket.h @comment BSD @@ -12153,7 +12153,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} This function is used to accept a connection request on the server socket @var{socket}. - + @@ -2181,6 +2677,7 @@ @comment sys/socket.h @comment BSD @@ -12163,7 +12163,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock @var{socket} is connected to; it stores the address in the memory space specified by @var{addr} and @var{length-ptr}. It stores the length of @@ -2248,7 +2745,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int send (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}) @@ -12173,7 +12173,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock flags @var{flags}. The possible values of @var{flags} are described in @ref{Socket Data Options}. @@ -2315,7 +2813,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int recv (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}) @@ -12183,7 +12183,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock flags @var{flags}. The possible values of @var{flags} are described in @ref{Socket Data Options}. @@ -2643,7 +3142,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int sendto (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t @var{length}) @@ -12193,7 +12193,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock through the socket @var{socket} to the destination address specified by the @var{addr} and @var{length} arguments. The @var{size} argument @@ -2678,7 +3178,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr}) @@ -12203,23 +12203,23 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock @var{socket} into the buffer @var{buffer}. The @var{size} argument specifies the maximum number of bytes to be read. @@ -2725,7 +3226,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int sendmsg (int @var{socket}, const struct msghdr *@var{message}, int @var{flags}) +@deftypefun ssize_t sendmsg (int @var{socket}, const struct msghdr *@var{message}, int @var{flags}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + This function is defined as a cancellation point in multi-threaded programs, so one has to be prepared for this and make sure that @@ -2736,7 +3238,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int recvmsg (int @var{socket}, struct msghdr *@var{message}, int @var{flags}) +@deftypefun ssize_t recvmsg (int @var{socket}, struct msghdr *@var{message}, int @var{flags}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + This function is defined as a cancellation point in multi-threaded programs, so one has to be prepared for this and make sure that @@ -2924,6 +3427,7 @@ @@ -12229,9 +12229,9 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{getsockopt} function gets information about the value of option @var{optname} at level @var{level} for socket @var{socket}. - + @@ -2953,7 +3457,8 @@ - + @comment sys/socket.h @comment BSD -@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t @var{optlen}) @@ -12263,7 +12263,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock named @var{name}. It returns a null pointer if there is no such network. @@ -3157,7 +3677,21 @@ - + @comment netdb.h @comment BSD -@deftypefun {struct netent *} getnetbyaddr (unsigned long int @var{net}, int @var{type}) @@ -12301,7 +12301,7 @@ diff -urN glibc-2.17-c758a686/manual/socket.texi glibc-2.17-c758a686/manual/sock +@c nss_next2 dup @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem +@c libc_lock_unlock dup @aculock This function opens and rewinds the networks database. - + If the @var{stayopen} argument is nonzero, this sets a flag so that @@ -3185,6 +3730,26 @@ @comment netdb.h @@ -12351,7 +12351,7 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta @@ -41,7 +41,7 @@ * Program Termination:: Telling the system you're done; return status @end menu - + -@node Program Arguments +@node Program Arguments, Environment Variables, , Program Basics @section Program Arguments @@ -12359,7 +12359,7 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta @cindex command line arguments @@ -220,7 +220,12 @@ available. - + @comment stdlib.h -@deftypefun int getsubopt (char **@var{optionp}, const char* const *@var{tokens}, char **@var{valuep}) +@deftypefun int getsubopt (char **@var{optionp}, char *const *@var{tokens}, char **@var{valuep}) @@ -12368,17 +12368,17 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta +@c strchrnul dup ok +@c memchr dup ok +@c strncmp dup ok - + The @var{optionp} parameter must be a pointer to a variable containing the address of the string to process. When the function returns the @@ -258,7 +263,7 @@ @end smallexample - - + + -@node Environment Variables +@node Environment Variables, Auxiliary Vector, Program Arguments, Program Basics @section Environment Variables - + @cindex environment variable @@ -322,6 +327,8 @@ @comment stdlib.h @@ -12422,15 +12422,15 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta +@var{string} not be an automatic variable whose scope is left before the variable is removed from the environment. The same applies of course to dynamically allocated variables which are freed later. - + -This function is part of the extended Unix interface. Since it was also -available in old SVID libraries you should define either -@var{_XOPEN_SOURCE} or @var{_SVID_SOURCE} before including any header. +This function is part of the extended Unix interface. You should define +@var{_XOPEN_SOURCE} before including any header. @end deftypefun - - + + @comment stdlib.h @comment BSD @deftypefun int setenv (const char *@var{name}, const char *@var{value}, int @var{replace}) @@ -12494,16 +12494,16 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta +returned; if the entry is not found, zero is returned and @code{errno} is +set to @code{ENOENT}. @end deftypefun - + For some platforms, the key @code{AT_HWCAP} is the easiest way to inquire @@ -677,6 +725,7 @@ @comment unistd.h @comment ??? @deftypefun {long int} syscall (long int @var{sysno}, @dots{}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + @code{syscall} performs a generic system call. - + @@ -782,6 +831,10 @@ @comment stdlib.h @comment ISO @@ -12514,7 +12514,7 @@ diff -urN glibc-2.17-c758a686/manual/startup.texi glibc-2.17-c758a686/manual/sta +@c AS and AC issues with streams. The @code{exit} function tells the system that the program is done, which causes it to terminate the process. - + @@ -898,6 +951,15 @@ @comment stdlib.h @comment ISO @@ -12583,7 +12583,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@c fopen may leak the list lock if cancelled within _IO_link_in. The @code{fopen} function opens a stream for I/O to the file @var{filename}, and returns a pointer to the stream. - + @@ -265,9 +267,10 @@ @comment stdio.h @comment Unix98 @@ -12593,7 +12593,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio pointer for is opened using @code{open64}. Therefore this stream can be -used even on files larger then @math{2^31} bytes on 32 bit machines. +used even on files larger than @math{2^31} bytes on 32 bit machines. - + Please note that the return type is still @code{FILE *}. There is no special @code{FILE} type for the LFS interface. @@ -294,6 +297,16 @@ @@ -12730,7 +12730,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@c lock themselves to be safe, and even concurrent uses with external +@c locking will be fine, as long as functions that require external +@c locking are not called without holding locks. - + The @code{__fsetlocking} function can be used to select whether the stream operations will implicitly acquire the locking object of the @@ -725,6 +778,10 @@ @@ -12741,7 +12741,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@c Querying is always safe, but changing the stream when it's in use +@c upthread may be problematic. Like most lock-acquiring functions, +@c this one may leak the lock if canceled. - + The @code{fwide} function can be used to set and query the state of the orientation of the stream @var{stream}. If the @var{mode} parameter has @@ -811,6 +868,16 @@ @@ -12780,7 +12780,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio The @code{fputc_unlocked} function is equivalent to the @code{fputc} function except that it does not implicitly lock the stream. @end deftypefun - + @comment wchar.h @comment POSIX -@deftypefun wint_t fputwc_unlocked (wint_t @var{wc}, FILE *@var{stream}) @@ -12788,7 +12788,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fputwc_unlocked} function is equivalent to the @code{fputwc} function except that it does not implicitly lock the stream. - + @@ -844,6 +917,7 @@ @comment stdio.h @comment ISO @@ -12820,7 +12820,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{putwc_unlocked} function is equivalent to the @code{putwc} function except that it does not implicitly lock the stream. - + @@ -880,6 +957,7 @@ @comment stdio.h @comment ISO @@ -12852,7 +12852,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtunsafe{@mtasurace{:stdout}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{putwchar_unlocked} function is equivalent to the @code{putwchar} function except that it does not implicitly lock the stream. - + @@ -910,6 +991,7 @@ @comment stdio.h @comment ISO @@ -12876,7 +12876,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fputs_unlocked} function is equivalent to the @code{fputs} function except that it does not implicitly lock the stream. - + @@ -954,6 +1038,7 @@ @comment wchar.h @comment GNU @@ -12884,7 +12884,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fputws_unlocked} function is equivalent to the @code{fputws} function except that it does not implicitly lock the stream. - + @@ -963,6 +1048,7 @@ @comment stdio.h @comment ISO @@ -12936,7 +12936,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fgetwc_unlocked} function is equivalent to the @code{fgetwc} function except that it does not implicitly lock the stream. - + @@ -1047,6 +1142,7 @@ @comment stdio.h @comment ISO @@ -12968,7 +12968,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{getwc_unlocked} function is equivalent to the @code{getwc} function except that it does not implicitly lock the stream. - + @@ -1082,6 +1181,7 @@ @comment stdio.h @comment ISO @@ -13000,7 +13000,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtunsafe{@mtasurace{:stdin}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{getwchar_unlocked} function is equivalent to the @code{getwchar} function except that it does not implicitly lock the stream. - + @@ -1145,6 +1248,7 @@ @comment stdio.h @comment SVID @@ -13023,13 +13023,13 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio (including the newline and a terminating null character) in a buffer and storing the buffer address in @code{*@var{lineptr}}. @@ -1188,7 +1298,8 @@ - + If you set @code{*@var{lineptr}} to a null pointer, and @code{*@var{n}} to zero, before the call, then @code{getline} allocates the initial -buffer for you by calling @code{malloc}. +buffer for you by calling @code{malloc}. This buffer remains allocated +even if @code{getline} encounters errors and is unable to read any bytes. - + In either case, when @code{getline} returns, @code{*@var{lineptr}} is a @code{char *} which points to the text of the line. @@ -1208,6 +1319,8 @@ @@ -13064,7 +13064,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fgets_unlocked} function is equivalent to the @code{fgets} function except that it does not implicitly lock the stream. - + @@ -1289,6 +1405,7 @@ @comment wchar.h @comment GNU @@ -13072,7 +13072,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fgetws_unlocked} function is equivalent to the @code{fgetws} function except that it does not implicitly lock the stream. - + @@ -1298,6 +1415,7 @@ @comment stdio.h @comment ISO @@ -13112,7 +13112,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fread_unlocked} function is equivalent to the @code{fread} function except that it does not implicitly lock the stream. - + @@ -1507,6 +1629,7 @@ @comment stdio.h @comment ISO @@ -13128,9 +13128,9 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} The @code{fwrite_unlocked} function is equivalent to the @code{fwrite} function except that it does not implicitly lock the stream. - + @@ -1670,7 +1794,7 @@ - + @defvr Macro NL_ARGMAX The value of @code{NL_ARGMAX} is the maximum value allowed for the -specification of an positional parameter in a @code{printf} call. The @@ -13194,7 +13194,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +again and decided to not define a function exactly corresponding to @code{sprintf}. @end deftypefun - + @comment stdio.h @comment GNU @deftypefun int snprintf (char *@var{s}, size_t @var{size}, const char *@var{template}, @dots{}) @@ -13212,12 +13212,12 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio Allocation}) to hold the output, instead of putting the output in a @@ -2416,7 +2548,7 @@ location. - + The return value is the number of characters allocated for the buffer, or -less than zero if an error occurred. Usually this means that the buffer +less than zero if an error occurred. Usually this means that the buffer could not be allocated. - + Here is how to use @code{asprintf} to get the same result as the @@ -2439,6 +2571,7 @@ @comment stdio.h @@ -13226,7 +13226,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:obstack} @mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @acsmem{}}} This function is similar to @code{asprintf}, except that it uses the obstack @var{obstack} to allocate the space. @xref{Obstacks}. - + @@ -2509,6 +2642,7 @@ @comment stdio.h @comment ISO @@ -13391,19 +13391,19 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio character and a following @samp{]} character, using the same syntax used -in regular expressions. As special cases: +in regular expressions for explicit sets of characters. As special cases: - + @itemize @bullet @item @@ -3692,6 +3892,10 @@ The @samp{%[} conversion does not skip over initial whitespace characters. - + +Note that the @dfn{character class} syntax available in character sets +that appear inside regular expressions (such as @samp{[:alpha:]}) is +@emph{not} available in the @samp{%[} conversion. + Here are some examples of @samp{%[} conversions and what they mean: - + @table @samp @@ -3799,6 +4003,7 @@ @comment stdio.h @@ -13446,7 +13446,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio null-terminated string @var{s} instead of from a stream. Reaching the end of the string is treated as an end-of-file condition. @@ -3853,7 +4062,8 @@ - + @comment wchar.h @comment ISO -@deftypefun int swscanf (const wchar_t *@var{ws}, const char *@var{template}, @dots{}) @@ -13510,7 +13510,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@aculock{}}} The @code{feof} function returns nonzero if and only if the end-of-file indicator for the stream @var{stream} is set. - + @@ -3975,6 +4192,9 @@ @comment stdio.h @comment GNU @@ -13520,7 +13520,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@c testing a bit in it. The @code{feof_unlocked} function is equivalent to the @code{feof} function except that it does not implicitly lock the stream. - + @@ -3986,6 +4206,7 @@ @comment stdio.h @comment ISO @@ -13536,7 +13536,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{ferror_unlocked} function is equivalent to the @code{ferror} function except that it does not implicitly lock the stream. - + @@ -4023,6 +4245,7 @@ @comment stdio.h @comment ISO @@ -13544,7 +13544,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@aculock{}}} This function clears the end-of-file and error indicators for the stream @var{stream}. - + @@ -4033,6 +4256,7 @@ @comment stdio.h @comment GNU @@ -13552,7 +13552,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@assafe{}@acsafe{}} The @code{clearerr_unlocked} function is equivalent to the @code{clearerr} function except that it does not implicitly lock the stream. - + @@ -4146,6 +4370,7 @@ @comment stdio.h @comment ISO @@ -13560,7 +13560,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}} This function returns the current file position of the stream @var{stream}. - + @@ -4158,6 +4383,7 @@ @comment stdio.h @comment Unix98 @@ -13664,7 +13664,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}} The @code{_flushlbf} function flushes all line buffered streams currently opened. - + @@ -4609,6 +4847,7 @@ @comment stdio_ext.h @comment GNU @@ -13704,7 +13704,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio +@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@aculock{} @acucorrupt{}}} This function makes @var{stream} be line buffered, and allocates the buffer for you. - + @@ -4748,6 +4991,7 @@ @comment stdio_ext.h @comment GNU @@ -13757,7 +13757,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio @var{cookie} using the functions in the @var{io-functions} argument. The @var{opentype} argument is interpreted as for @code{fopen}; @@ -5053,26 +5305,26 @@ - + @comment stdio.h @comment GNU -@deftp {Data Type} cookie_read_function @@ -13765,28 +13765,28 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio This is the data type that the read function for a custom stream should have. If you declare the function as shown above, this is the type it will have. @end deftp - + @comment stdio.h @comment GNU -@deftp {Data Type} cookie_write_function +@deftp {Data Type} cookie_write_function_t The data type of the write function for a custom stream. @end deftp - + @comment stdio.h @comment GNU -@deftp {Data Type} cookie_seek_function +@deftp {Data Type} cookie_seek_function_t The data type of the seek function for a custom stream. @end deftp - + @comment stdio.h @comment GNU -@deftp {Data Type} cookie_close_function +@deftp {Data Type} cookie_close_function_t The data type of the close function for a custom stream. @end deftp - + @@ -5166,6 +5418,7 @@ @comment fmtmsg.h @comment XPG @@ -13797,7 +13797,7 @@ diff -urN glibc-2.17-c758a686/manual/stdio.texi glibc-2.17-c758a686/manual/stdio identifies the source of the message. The string should consist of two @@ -5306,6 +5559,7 @@ but this is toilsome. - + @deftypefun int addseverity (int @var{severity}, const char *@var{string}) +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{}}} This function allows the introduction of new severity classes which can be @@ -13846,7 +13846,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} @code{wcsnlen} is the wide character equivalent to @code{strnlen}. The @var{maxlen} parameter specifies the maximum number of wide characters. - + @@ -367,6 +371,7 @@ @comment string.h @comment ISO @@ -13888,7 +13888,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri @var{size} bytes at @var{to}, even if those two blocks of space overlap. In the case of overlap, @code{memmove} is careful to copy the @@ -479,7 +488,8 @@ - + @comment wchar.h @comment ISO -@deftypefun {wchar_t *} wmemmove (wchar *@var{wto}, const wchar_t *@var{wfrom}, size_t @var{size}) @@ -13944,7 +13944,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is similar to @code{strcpy} but always copies exactly @var{size} characters into @var{to}. - + @@ -576,6 +592,7 @@ @comment wchar.h @comment ISO @@ -13952,7 +13952,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is similar to @code{wcscpy} but always copies exactly @var{size} wide characters into @var{wto}. - + @@ -602,6 +619,7 @@ @comment string.h @comment SVID @@ -13976,7 +13976,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}} This function is similar to @code{strdup} but always copies at most @var{size} characters into the newly allocated string. - + @@ -642,6 +662,7 @@ @comment string.h @comment Unknown origin @@ -14000,7 +14000,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is similar to @code{stpcpy} but copies always exactly @var{size} characters into @var{to}. - + -If the length of @var{from} is more then @var{size}, then @code{stpncpy} +If the length of @var{from} is more than @var{size}, then @code{stpncpy} copies just the first @var{size} characters and returns a pointer to the @@ -14013,7 +14013,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is similar to @code{wcpcpy} but copies always exactly @var{wsize} characters into @var{wto}. - + -If the length of @var{wfrom} is more then @var{size}, then +If the length of @var{wfrom} is more than @var{size}, then @code{wcpncpy} copies just the first @var{size} wide characters and @@ -14116,7 +14116,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri @@ -1065,9 +1098,10 @@ @code{0}. @end deftypefun - + -@comment wcjar.h +@comment wchar.h @comment ISO @@ -14138,7 +14138,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri @comment ISO @deftypefun int wcscmp (const wchar_t *@var{ws1}, const wchar_t *@var{ws2}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + The @code{wcscmp} function compares the wide character string @var{ws1} against @var{ws2}. The value returned is smaller than or larger than zero @@ -1159,6 +1195,11 @@ @@ -14154,7 +14154,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri ignored. How uppercase and lowercase characters are related is determined by the currently selected locale. In the standard @code{"C"} @@ -1171,7 +1212,10 @@ - + @comment wchar.h @comment GNU -@deftypefun int wcscasecmp (const wchar_t *@var{ws1}, const wchar_T *@var{ws2}) @@ -14213,7 +14213,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri -"integral" and "fractional" (those begin with a '0'). The types +"integral" and "fractional" (those begin with a '0'). The types of the numeric parts affect the way we sort them: - + @itemize @bullet @@ -1297,6 +1347,7 @@ @comment string.h @@ -14222,7 +14222,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This is an obsolete alias for @code{memcmp}, derived from BSD. @end deftypefun - + @@ -1343,6 +1394,9 @@ @comment string.h @comment ISO @@ -14248,7 +14248,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri char * const *p1 = v1; - char * const *p1 = v2; + char * const *p2 = v2; - + return strcoll (*p1, *p2); @} @@ -1391,6 +1447,7 @@ @@ -14269,13 +14269,13 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri selected for collation, and stores the transformed string in the array @@ -1514,8 +1572,8 @@ @} - + /* @r{Sort @code{temp_array} by comparing transformed strings.} */ - qsort (temp_array, sizeof (struct sorter), - nstrings, compare_elements); + qsort (temp_array, nstrings, + sizeof (struct sorter), compare_elements); - + /* @r{Put the elements back in the permanent array} @r{in their sorted order.} */ @@ -1579,6 +1637,7 @@ @@ -14473,9 +14473,9 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtunsafe{@mtasurace{:strtok}}@asunsafe{}@acsafe{}} A string can be split into tokens by making a series of calls to the function @code{strtok}. - + @@ -1978,7 +2062,8 @@ - + @comment wchar.h @comment ISO -@deftypefun {wchar_t *} wcstok (wchar_t *@var{newstring}, const char *@var{delimiters}) @@ -14483,7 +14483,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} A string can be split into tokens by making a series of calls to the function @code{wcstok}. - + @@ -1986,11 +2071,8 @@ the first call only. The @code{wcstok} function uses this to set up some internal state information. Subsequent calls to get additional @@ -14495,7 +14495,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri -information). +null pointer as the @var{newstring} argument, which causes the pointer +previously stored in @var{save_ptr} to be used instead. - + The @var{delimiters} argument is a wide character string that specifies a set of delimiters that may surround the token being extracted. All @@ -1999,8 +2081,10 @@ @@ -14508,7 +14508,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +pointer past the overwritten wide character is saved in @var{save_ptr}, +and the pointer to the beginning of the token in @var{newstring} is +returned. - + On the next call to @code{wcstok}, the searching begins at the next wide character beyond the one that marked the end of the previous token. @@ -2010,11 +2094,6 @@ @@ -14521,17 +14521,17 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri -more than one byte are not treated as an entity. Each byte is treated -separately. The function is not locale-dependent. @end deftypefun - + @strong{Warning:} Since @code{strtok} and @code{wcstok} alter the string @@ -2039,7 +2118,7 @@ structure, then it is error-prone to modify the data structure temporarily. - + -The functions @code{strtok} and @code{wcstok} are not reentrant. +The function @code{strtok} is not reentrant, whereas @code{wcstok} is. @xref{Nonreentrancy}, for a discussion of where and why reentrancy is important. - + @@ -2075,13 +2154,15 @@ @comment string.h @comment POSIX @@ -14550,7 +14550,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri +@code{strtok_r} with a null pointer for @var{newstring} and leaving +@var{save_ptr} between the calls unchanged does the job without +hindering reentrancy. - + This function is defined in POSIX.1 and can be found on many systems which support multi-threading. @@ -2090,6 +2171,7 @@ @@ -14570,7 +14570,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri component of the path in @var{filename}. This function is the preferred usage, since it does not modify the argument, @var{filename}, and @@ -2175,8 +2258,9 @@ - + @comment libgen.h @comment XPG -@deftypefun {char *} basename (char *@var{path}) @@ -14595,7 +14595,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri @deftypefun {char *} strfry (char *@var{string}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Calls initstate_r, time, getpid, strlen, and random_r. - + @code{strfry} creates a pseudorandom anagram of a string, replacing the input with the anagram in place. For each position in the string, @@ -2268,6 +2355,7 @@ @@ -14603,18 +14603,18 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri @comment GNU @deftypefun {void *} memfrob (void *@var{mem}, size_t @var{length}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - + @code{memfrob} transforms (frobnicates) each byte of the data structure at @var{mem}, which is @var{length} bytes long, by bitwise exclusive @@ -2291,13 +2379,14 @@ - + To store or transfer binary data in environments which only support text one has to encode the binary data by mapping the input bytes to -characters in the range allowed for storing or transfering. SVID +characters in the range allowed for storing or transferring. SVID systems (and nowadays XPG compliant systems) provide minimal support for this task. - + @comment stdlib.h @comment XPG @deftypefun {char *} l64a (long int @var{n}) @@ -14654,7 +14654,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri Returns the number of elements in the argz vector @var{argz} and @var{argz_len}. @end deftypefun - + @comment argz.h @comment GNU -@deftypefun {void} argz_extract (char *@var{argz}, size_t @var{argz_len}, char **@var{argv}) @@ -14715,7 +14715,7 @@ diff -urN glibc-2.17-c758a686/manual/string.texi glibc-2.17-c758a686/manual/stri argz vector @code{*@var{argz}} at a point just before the existing element pointed to by @var{before}, reallocating @code{*@var{argz}} and @@ -2561,7 +2664,8 @@ - + @comment argz.h @comment GNU -@deftypefun {char *} argz_next (char *@var{argz}, size_t @var{argz_len}, const char *@var{entry}) @@ -14785,7 +14785,7 @@ diff -urN glibc-2.17-c758a686/manual/summary.awk glibc-2.17-c758a686/manual/summ -# Copyright (C) 1992, 1993, 1997, 2001 Free Software Foundation, Inc. +# Copyright (C) 1992-2014 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 diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sysinfo.texi --- glibc-2.17-c758a686/manual/sysinfo.texi 2012-12-24 22:02:13.000000000 -0500 @@ -14818,7 +14818,7 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys +@c Syscalls uname, then strlen and memcpy. @cindex NIS domain name @cindex YP domain name - + @@ -159,6 +167,8 @@ @comment unistd.h @comment ??? @@ -14827,7 +14827,7 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys +@c Direct syscall. @cindex NIS domain name @cindex YP domain name - + @@ -173,6 +183,10 @@ @comment unistd.h @comment BSD @@ -14848,14 +14848,14 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys to @var{id}. Only privileged processes are permitted to do this. Usually it happens just once, at system boot time. @@ -226,7 +241,7 @@ - + As a bonus, @code{uname} also gives some information identifying the particular system your program is running on. This is the same information -which you can get with functions targetted to this purpose described in +which you can get with functions targeted to this purpose described in @ref{Host Identification}. - - + + @@ -296,6 +311,10 @@ @comment sys/utsname.h @comment POSIX.1 @@ -14968,7 +14968,7 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys previously returned by successful call to @code{setmntent}. It returns a pointer to a static variable of type @code{struct mntent} which is @@ -691,7 +754,17 @@ - + @comment mntent.h @comment BSD -@deftypefun {struct mntent *} getmntent_r (FILE *@var{stream}, struct mentent *@var{result}, char *@var{buffer}, int @var{bufsize}) @@ -15017,7 +15017,7 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys @deftypefun {int} mount (const char *@var{special_file}, const char *@var{dir}, const char *@var{fstype}, unsigned long int @var{options}, const void *@var{data}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall. - + @code{mount} mounts or remounts a filesystem. The two operations are quite different and are merged rather unnaturally into this one function. @@ -982,6 +1068,8 @@ @@ -15026,32 +15026,32 @@ diff -urN glibc-2.17-c758a686/manual/sysinfo.texi glibc-2.17-c758a686/manual/sys @deftypefun {int} umount2 (const char *@var{file}, int @var{flags}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall. - + @code{umount2} unmounts a filesystem. - + @@ -1047,6 +1135,8 @@ @comment sys/mount.h @comment SVID, GNU @deftypefun {int} umount (const char *@var{file}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall or wrapper for umount2. - + @code{umount} does the same thing as @code{umount2} with @var{flags} set to zeroes. It is more widely available than @code{umount2} but since it @@ -1062,11 +1152,13 @@ This section describes the @code{sysctl} function, which gets and sets a variety of system parameters. - + -The symbols used in this section are declared in the file @file{sysctl.h}. +The symbols used in this section are declared in the file @file{sys/sysctl.h}. - + -@comment sysctl.h +@comment sys/sysctl.h @comment BSD @deftypefun int sysctl (int *@var{names}, int @var{nlen}, void *@var{oldval}, size_t *@var{oldlenp}, void *@var{newval}, size_t @var{newlen}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct syscall, Linux only. - + @code{sysctl} gets or sets a specified system parameter. There are so many of these parameters that it is not practical to list them all here, @@ -1090,7 +1182,7 @@ @@ -15081,7 +15081,7 @@ diff -urN glibc-2.17-c758a686/manual/syslog.texi glibc-2.17-c758a686/manual/sysl +@c close dup @acsfd +@c cancel_handler(NULL) @aculock +@c libc_lock_unlock @aculock - + @code{openlog} opens or reopens a connection to Syslog in preparation for submitting messages. @@ -275,7 +286,39 @@ @@ -15122,11 +15122,11 @@ diff -urN glibc-2.17-c758a686/manual/syslog.texi glibc-2.17-c758a686/manual/sysl +@c libc_lock_unlock @asulock @aculock +@c free dup @acsuheap @acsmem +@c va_end dup ok - + @code{syslog} submits a message to the Syslog facility. It does this by writing to the Unix domain socket @code{/dev/log}. @@ -403,7 +446,10 @@ - + @comment syslog.h @comment BSD -@deftypefun void vsyslog (int @var{facility_priority}, char *@var{format}, va_list @var{arglist}) @@ -15134,7 +15134,7 @@ diff -urN glibc-2.17-c758a686/manual/syslog.texi glibc-2.17-c758a686/manual/sysl +@safety{@prelim{}@mtsafe{@mtsenv{} @mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{} @asulock{} @ascudlopen{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{} @acsfd{}}} +@c vsyslog @mtsenv @mtslocale @asucorrupt @ascuheap @asulock @ascudlopen @acucorrupt @aculock @acsmem @acsfd +@c vsyslog_chk dup @mtsenv @mtslocale @asucorrupt @ascuheap @asulock @ascudlopen @acucorrupt @aculock @acsmem @acsfd - + This is functionally identical to @code{syslog}, with the BSD style variable length argument. @@ -420,6 +466,13 @@ @@ -15148,7 +15148,7 @@ diff -urN glibc-2.17-c758a686/manual/syslog.texi glibc-2.17-c758a686/manual/sysl +@c close dup@acsfd +@c cancel_handler(NULL) @aculock +@c libc_lock_unlock @aculock - + @code{closelog} closes the current Syslog connection, if there is one. This includes closing the @file{/dev/log} socket, if it is open. @@ -450,6 +503,10 @@ @@ -15159,7 +15159,7 @@ diff -urN glibc-2.17-c758a686/manual/syslog.texi glibc-2.17-c758a686/manual/sysl +@c Read and modify are not guarded by syslog_lock, so concurrent changes +@c or even uses are undefined. This should use an atomic swap instead, +@c at least for modifications. - + @code{setlogmask} sets a mask (the ``logmask'') that determines which future @code{syslog} calls shall be ignored. If a program has not diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/terminal.texi @@ -15238,7 +15238,7 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te @@ -621,7 +656,7 @@ of characters, carriage return followed by linefeed. @end deftypevr - + -@comment termios.h +@comment termios.h (optional) @comment BSD @@ -15247,7 +15247,7 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te @@ -630,7 +665,7 @@ @gnulinuxsystems{} it is available as @code{XTABS}. @end deftypevr - + -@comment termios.h +@comment termios.h (optional) @comment BSD @@ -15256,7 +15256,7 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te @@ -962,7 +997,7 @@ While this bit is set, all output is discarded. @xref{Other Special}. @end deftypevr - + -@comment termios.h +@comment termios.h (optional) @comment BSD @@ -15330,19 +15330,19 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct ioctl, BSD only. This function gets the attributes of a terminal. - + @code{gtty} sets *@var{attributes} to describe the terminal attributes @@ -1686,7 +1742,9 @@ - + @comment sgtty.h @comment BSD -@deftypefun int stty (int @var{filedes}, struct sgttyb *@var{attributes}) +@deftypefun int stty (int @var{filedes}, const struct sgttyb *@var{attributes}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c Direct ioctl, BSD only. - + This function sets the attributes of a terminal. - + @@ -1710,6 +1768,12 @@ @comment termios.h @comment POSIX.1 @@ -15364,7 +15364,7 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te +@c Direct ioctl. The @code{tcdrain} function waits until all queued output to the terminal @var{filedes} has been transmitted. - + @@ -1772,6 +1838,8 @@ @comment termios.h @comment POSIX.1 @@ -15385,7 +15385,7 @@ diff -urN glibc-2.17-c758a686/manual/terminal.texi glibc-2.17-c758a686/manual/te +@c another thread to change the xon/xoff characters. The @code{tcflow} function is used to perform operations relating to XON/XOFF flow control on the terminal file specified by @var{filedes}. - + @@ -1931,6 +2004,14 @@ @comment stdlib.h @comment GNU @@ -15603,11 +15603,11 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % Have to do this stuff outside the \shipout because we want it to @@ -594,7 +598,7 @@ \def\:{\spacefactor=1000 } - + % @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} - + % @/ allows a line break. \let\/=\allowbreak @@ -887,7 +891,7 @@ @@ -15617,7 +15617,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi - +% \def\thisfile{} - + % @center line @@ -895,36 +899,46 @@ % @@ -15661,12 +15661,12 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \line{\kern\leftskip #1\kern\rightskip}% } -\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} - + % @sp n outputs n lines of vertical space - +% \parseargdef\sp{\vskip #1\baselineskip} - + % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment @@ -15679,13 +15679,13 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi - +% \let\c=\comment - + % @paragraphindent NCHARS @@ -1097,7 +1111,7 @@ % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. --% +-% +% % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user @@ -15700,7 +15700,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % Many times it won't matter. \else @@ -1124,10 +1138,12 @@ - + \ifpdf % - % Color manipulation macros based on pdfcolor.tex, @@ -15774,8 +15774,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \else @@ -1459,9 +1479,6 @@ \def\ttsl{\setfontstyle{ttsl}} - - + + -% Default leading. -\newdimen\textleading \textleading = 13.2pt - @@ -15792,8 +15792,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \normalbaselineskip = \baselinefactor\dimen0 @@ -1745,18 +1763,24 @@ \fi\fi - - + + -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). +% Set the font macro #1 to the font named \fontprefix#2. @@ -15817,7 +15817,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi -% emacs-page end of cmaps +% +% (end of cmaps) - + % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -1766,7 +1790,7 @@ @@ -15832,7 +15832,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -1781,8 +1805,7 @@ \def\scshape{csc} \def\scbshape{csc} - + -% Definitions for a main text size of 11pt. This is the default in -% Texinfo. +% Definitions for a main text size of 11pt. (The default in Texinfo.) @@ -15845,8 +15845,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \rm -} % end of 11pt text font size definitions +} % end of 11pt text font size definitions, \definetextfontsizexi - - + + % Definitions to make the main text be 10pt Computer Modern, with @@ -2039,7 +2062,7 @@ \textleading = 12pt % line spacing for 10pt CM @@ -15854,8 +15854,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \rm -} % end of 10pt text font size definitions +} % end of 10pt text font size definitions, \definetextfontsizex - - + + % We provide the user-level command @@ -2123,7 +2146,7 @@ \let\tenttsl=\secttsl @@ -15867,13 +15867,13 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc @@ -2254,8 +2277,6 @@ - + \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} - -\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} } - + \let\markupsetuplqcode \markupsetcodequoteleft @@ -2264,6 +2285,9 @@ \let\markupsetuplqexample \markupsetcodequoteleft @@ -15888,7 +15888,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -2273,8 +2297,6 @@ \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright - + -\let\markupsetuplqkbd \markupsetnoligaturesquoteleft - % Allow an option to not use regular directed right quote/apostrophe @@ -15905,17 +15905,17 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \fi\fi\fi\fi\fi \aftersmartic } - + -% like \smartslanted except unconditionally uses \ttsl, and no ic. -% @var is set to this for defun arguments. +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} - + % @cite is like \smartslanted except unconditionally use \sl. We never want @@ -2430,34 +2453,12 @@ % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} - + -% definition of @key that produces a lozenge. Doesn't adjust to text size. -%\setfont\keyrm\rmshape{8}{1000}{OT1} -%\font\keysy=cmsy9 @@ -15939,7 +15939,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi -\def\ctrl #1{{\tt \rawbackslash \hat}#1} +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp - + -% @file, @option are the same as @samp. -\let\file=\samp -\let\option=\samp @@ -15954,7 +15954,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % Change normal interword space to be same as for the current font. @@ -2480,14 +2481,14 @@ } - + % We *must* turn on hyphenation at `-' and `_' in @code. +% (But see \codedashfinish below.) % Otherwise, it is too hard to avoid overfull hboxes @@ -16007,7 +16007,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi +\def\normaldash{-} +% \def\codex #1{\tclose{#1}\endgroup} - + -\def\realdash{-} -\def\codedash{-\discretionary{}{}{}} \def\codeunder{% @@ -16015,7 +16015,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) @@ -2525,9 +2547,9 @@ } - + % An additional complication: the above will allow breaks after, e.g., -% each of the four underscores in __typeof__. This is undesirable in -% some manuals, especially if they don't have long identifiers in @@ -16025,11 +16025,11 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi +% and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue - + @@ -2546,37 +2568,28 @@ \fi\fi } - + -% @uref (abbreviation for `urlref') takes an optional (comma-separated) -% second argument specifying the text to display and an optional third -% arg as text to display instead of (rather than in addition to) the url @@ -16063,7 +16063,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi +\let\env=\code +\let\file=\code +\let\option=\code - + -% This \urefbreak definition is the active one. +% @uref (abbreviation for `urlref') aka @url takes an optional +% (comma-separated) second argument specifying the text to display and @@ -16122,7 +16122,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -2692,10 +2714,6 @@ \let\email=\uref \fi - + -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. -\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} @@ -16133,7 +16133,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -2719,16 +2737,36 @@ % Default is `distinct'. \kbdinputstyle distinct - + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} @@ -16149,7 +16149,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} - + -% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. -\let\indicateurl=\code -\let\env=\code @@ -16172,13 +16172,13 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} - + % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} @@ -2836,6 +2874,9 @@ } } - + +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + @@ -16204,7 +16204,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -2863,6 +2913,23 @@ \endgroup % close group opened by \tex. } - + +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} @@ -16222,7 +16222,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + - + \message{glyphs,} % and logos. @@ -3126,12 +3193,17 @@ @@ -16252,7 +16252,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -3244,6 +3316,20 @@ \finishedtitlepagetrue } - + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because @@ -16268,10 +16268,10 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi +} + % Macros to be used within @titlepage: - + \let\subtitlerm=\tenrm @@ -3251,7 +3337,7 @@ - + \parseargdef\title{% \checkenv\titlepage - \leftline{\titlefonts\rmisbold #1} @@ -16289,7 +16289,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if @@ -3850,18 +3936,22 @@ - + % multitable-only commands. % -% @headitem starts a heading row, which we typeset in bold. @@ -16354,7 +16354,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \let-\normaldash \let_\normalunderscore } } - + @@ -4160,6 +4250,11 @@ % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). @@ -16380,7 +16380,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -4188,7 +4284,7 @@ } \def\ifsetfail{\doignore{ifset}} - + -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. @@ -16389,7 +16389,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -4199,6 +4295,35 @@ \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} - + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered @@ -16490,7 +16490,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + % expanded for the sake of the index, so we end up just seeing "bar". + \let\xeatspaces = \eatspaces } - + +% For testing: output @{ and @} in index sort strings as \{ and \}. +\newif\ifusebracesinindexes + @@ -16544,13 +16544,13 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi -\fi -} +\fi} - + % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} @@ -5520,14 +5667,6 @@ - + % Define @majorheading, @heading and @subheading - + -% NOTE on use of \vbox for chapter headings, section headings, and such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. @@ -16563,7 +16563,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz @@ -5535,10 +5674,8 @@ - + \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 @@ -16574,7 +16574,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \nobreak\bigskip \nobreak \suppressfirstparagraphindent } - + @@ -5697,8 +5834,7 @@ % % Typeset the actual heading. @@ -16640,7 +16640,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + % and do the needful. \penalty 10001 } - + @@ -6188,8 +6325,8 @@ \catcode `\|=\other \catcode `\<=\other @@ -16662,8 +16662,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% @@ -6297,13 +6434,11 @@ - % side, and for 6pt waste from - % each corner char, and rule thickness + % side, and for 6pt waste from + % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing = t% @@ -16686,8 +16686,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output @@ -6465,9 +6600,13 @@ - - + + % @raggedright does more-or-less normal line breaking but no right -% justification. From plain.tex. +% justification. From plain.tex. Don't stretch around special @@ -16700,7 +16700,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \def\urefpoststretchamount{0pt}% } \let\Eraggedright\par - + @@ -6496,16 +6635,9 @@ \makedispenvdef{quotation}{\quotationstart} % @@ -16722,7 +16722,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -6531,6 +6663,32 @@ \fi } - + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% @@ -16749,7 +16749,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi +} +\def\Esmallindentedblock{\Eindentedblock} + - + % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, @@ -7009,7 +7167,10 @@ @@ -16765,7 +16765,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi #1% \sl\hyphenchar\font=45 @@ -7338,7 +7499,7 @@ - + % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH -% in the params list to some hook where the argument si to be expanded. If @@ -16776,7 +16776,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -7793,7 +7954,7 @@ \fi\fi } - + - +% % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is @@ -16889,7 +16889,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi \fi \endlink \endgroup} - + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither @@ -16942,7 +16942,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi @@ -8233,13 +8427,19 @@ } }%end \catcode `\@=11 - + +\def\errfootnote{% + \errhelp=\EMsimple + \errmessage{Nested footnotes not supported in texinfo.tex, @@ -17010,8 +17010,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \fi + \ifx\centersub\centerV \egroup \fi \endgroup} - - + + @@ -9793,11 +10007,9 @@ \catcode`\"=\active \def\activedoublequote{{\tt\char34}} @@ -17023,11 +17023,11 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi -\catcode`\^=\active -\def^{{\tt \hat}} +\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat - + \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} @@ -9807,16 +10019,26 @@ - + \catcode`\|=\active \def|{{\tt\char124}} + @@ -17058,12 +17058,12 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} - + % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. @@ -9866,22 +10088,26 @@ @gdef@otherbackslash{@let\=@realbackslash} - + % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. +% the literal character `\'. Also revert - to its normal character, in @@ -17101,7 +17101,7 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi + @unsepspaces + } } - + % Make _ and + \other characters, temporarily. diff -urN glibc-2.17-c758a686/manual/threads.texi glibc-2.17-c758a686/manual/threads.texi --- glibc-2.17-c758a686/manual/threads.texi 1969-12-31 19:00:00.000000000 -0500 @@ -17397,7 +17397,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c for clock_t counts that look like error values. The @code{times} function stores the processor time information for the calling process in @var{buffer}. - + @@ -409,6 +422,7 @@ @comment time.h @comment ISO @@ -17457,7 +17457,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t @deftypefun int adjtimex (struct timex *@var{timex}) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +@c It's a syscall, only available on linux. - + @code{adjtimex} is functionally identical to @code{ntp_adjtime}. @xref{High Accuracy Clock}. @@ -674,6 +705,10 @@ @@ -17474,14 +17474,14 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t @@ -687,9 +722,8 @@ as a broken-down time; typically this is because the year cannot fit into an @code{int}. - + -Calling @code{localtime} has one other effect: it sets the variable -@code{tzname} with information about the current time zone. @xref{Time -Zone Functions}. +Calling @code{localtime} also sets the current time zone as if +@code{tzset} were called. @xref{Time Zone Functions}. @end deftypefun - + Using the @code{localtime} function is a big problem in multi-threaded @@ -699,6 +733,87 @@ @comment time.h @@ -17596,7 +17596,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c tz_convert(gmtime_r) dup @mtsenv @mtslocale @ascuheap @asulock @aculock @acsmem @acsfd This function is similar to @code{localtime_r}, except that it converts just like @code{gmtime} the given time as Coordinated Universal Time. - + @@ -739,30 +866,58 @@ @comment time.h @comment ISO @@ -17632,7 +17632,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +simple time representation. It also normalizes the contents of the +broken-down time structure, and fills in some components based on the +values of the others. - + The @code{mktime} function ignores the specified contents of the -@code{tm_wday} and @code{tm_yday} members of the broken-down time +@code{tm_wday}, @code{tm_yday}, @code{tm_gmtoff}, and @code{tm_zone} @@ -17643,11 +17643,11 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t @code{mktime} does is adjust the components of the @var{brokentime} -structure (including the @code{tm_wday} and @code{tm_yday}). +structure, including the members that were initially ignored. - + If the specified broken-down time cannot be represented as a simple time, @code{mktime} returns a value of @code{(time_t)(-1)} and does not modify the contents of @var{brokentime}. - + -Calling @code{mktime} also sets the variable @code{tzname} with -information about the current time zone. @xref{Time Zone Functions}. +Calling @code{mktime} also sets the current time zone as if @@ -17655,13 +17655,13 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +of @var{brokentime}'s initial @code{tm_gmtoff} and @code{tm_zone} +members. @xref{Time Zone Functions}. @end deftypefun - + @comment time.h @comment ??? @deftypefun time_t timelocal (struct tm *@var{brokentime}) +@safety{@prelim{}@mtsafe{@mtsenv{} @mtslocale{}}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{} @acsfd{}}} +@c Alias to mktime. - + @code{timelocal} is functionally identical to @code{mktime}, but more mnemonically named. Note that it is the inverse of the @code{localtime} @@ -776,6 +931,19 @@ @@ -17681,7 +17681,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c tz_convert(!use_localtime) @asulock @aculock +@c ... dup @asulock @aculock +@c tzfile_compute(!use_localtime) ok - + @code{timegm} is functionally identical to @code{mktime} except it always takes the input values to be Coordinated Universal Time (UTC) @@ -837,6 +1005,8 @@ @@ -17701,7 +17701,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c Alias to adjtimex syscall. The @code{ntp_adjtime} function sets the structure specified by @var{tptr} to current values. - + @@ -1008,6 +1180,13 @@ @comment time.h @comment ISO @@ -17715,7 +17715,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c ab_month_name @mtslocale The @code{asctime} function converts the broken-down time value that @var{brokentime} points to into a string in a standard format: - + @@ -1031,6 +1210,9 @@ @comment time.h @comment POSIX.1c @@ -17740,13 +17740,13 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t @@ -1053,13 +1239,17 @@ asctime (localtime (@var{time})) @end smallexample - + -@code{ctime} sets the variable @code{tzname}, because @code{localtime} -does so. @xref{Time Zone Functions}. +Calling @code{ctime} also sets the current time zone as if +@code{tzset} were called. @xref{Time Zone Functions}. @end deftypefun - + @comment time.h @comment POSIX.1c @deftypefun {char *} ctime_r (const time_t *@var{time}, char *@var{buffer}) @@ -17825,7 +17825,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t -time conversion (@pxref{Locales}). +time conversion (@pxref{Locales}) and the current time zone +(@pxref{Time Zone Functions}). - + Ordinary characters appearing in the @var{template} are copied to the output string @var{s}; this can include multibyte character sequences. Conversion specifiers are introduced by a @samp{%} character, followed @@ -17833,12 +17833,12 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t -are all GNU extensions. The first three affect only the output of +are all GNU extensions. The first three affect only the output of numbers: - + @table @code @@ -1392,9 +1640,10 @@ If @var{s} is a null pointer, @code{strftime} does not actually write anything, but instead returns the number of characters it would have written. - + -According to POSIX.1 every call to @code{strftime} implies a call to -@code{tzset}. So the contents of the environment variable @code{TZ} -is examined before any output is produced. @@ -17846,7 +17846,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@code{tzset} were called; @code{strftime} uses this information +instead of @var{brokentime}'s @code{tm_gmtoff} and @code{tm_zone} +members. @xref{Time Zone Functions}. - + For an example of @code{strftime}, see @ref{Time Functions Example}. @end deftypefun @@ -1402,6 +1651,53 @@ @@ -17983,11 +17983,11 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t negative if it is east. The hour must be between @code{0} and -@code{23}, and the minute and seconds between @code{0} and @code{59}. +@code{24}, and the minute and seconds between @code{0} and @code{59}. - + For example, here is how we would specify Eastern Standard Time, but without any Daylight Saving Time alternative: @@ -2082,17 +2431,51 @@ - + The @var{time} fields specify when, in the local time currently in effect, the change to the other time occurs. If omitted, the default is -@code{02:00:00}. @@ -18007,7 +18007,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t -the first Sunday in April at 2:00am, and ends on the last Sunday in October +March's second Sunday at 2:00am, and ends on November's first Sunday at 2:00am. - + @smallexample -EST+5EDT,M4.1.0/2,M10.5.0/2 +EST+5EDT,M3.2.0/2,M11.1.0/2 @@ -18043,7 +18043,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@smallexample +WGT3WGST,M3.5.0/-2,M10.5.0/-1 @end smallexample - + The schedule of Daylight Saving Time in any particular jurisdiction has @@ -2177,6 +2560,11 @@ @comment time.h @@ -18058,7 +18058,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t the value of the @code{TZ} environment variable. It is not usually necessary for your program to call this function, because it is called @@ -2314,7 +2702,16 @@ - + @comment sys/time.h @comment BSD -@deftypefun int setitimer (int @var{which}, struct itimerval *@var{new}, struct itimerval *@var{old}) @@ -18082,7 +18082,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{getitimer} function stores information about the timer specified by @var{which} in the structure pointed at by @var{old}. - + @@ -2367,6 +2765,8 @@ @comment unistd.h @comment POSIX.1 @@ -18102,7 +18102,7 @@ diff -urN glibc-2.17-c758a686/manual/time.texi glibc-2.17-c758a686/manual/time.t +@c AS-Unsafe, and in a way that makes it AC-Unsafe (C-unsafe, even!). The @code{sleep} function waits for @var{seconds} or until a signal is delivered, whichever happens first. - + @@ -2470,6 +2874,9 @@ @comment time.h @comment POSIX.1 @@ -18122,7 +18122,7 @@ diff -urN glibc-2.17-c758a686/manual/tsort.awk glibc-2.17-c758a686/manual/tsort. -# (C) Copyright 1998, 1999 Free Software Foundation, Inc. +# Copyright (C) 1998-2014 Free Software Foundation, Inc. # Written by Ulrich Drepper , 1998. - + BEGIN { diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users.texi --- glibc-2.17-c758a686/manual/users.texi 2012-12-24 22:02:13.000000000 -0500 @@ -18145,28 +18145,28 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users +@c critical section. The @code{getuid} function returns the real user ID of the process. @end deftypefun - + @comment unistd.h @comment POSIX.1 @deftypefun gid_t getgid (void) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{getgid} function returns the real group ID of the process. @end deftypefun - + @comment unistd.h @comment POSIX.1 @deftypefun uid_t geteuid (void) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{geteuid} function returns the effective user ID of the process. @end deftypefun - + @comment unistd.h @comment POSIX.1 @deftypefun gid_t getegid (void) +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{getegid} function returns the effective group ID of the process. @end deftypefun - + @comment unistd.h @comment POSIX.1 @deftypefun int getgroups (int @var{count}, gid_t *@var{groups}) @@ -18260,7 +18260,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users the effective group ID to @var{egid}. If @var{rgid} is @code{-1}, it means not to change the real group ID; likewise if @var{egid} is @@ -437,7 +487,10 @@ - + @comment grp.h @comment BSD -@deftypefun int setgroups (size_t @var{count}, gid_t *@var{groups}) @@ -18330,7 +18330,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users +especially bad news. Less obviously, the @code{execlp} and @code{execvp} functions are a potential risk (since the program they execute depends on the user's @code{PATH} environment variable). - + @@ -792,6 +882,41 @@ @comment unistd.h @comment POSIX.1 @@ -18437,7 +18437,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users +@c libc_lock_unlock dup ok This function closes the user accounting database. @end deftypefun - + @comment utmp.h @comment SVID @deftypefun {struct utmp *} getutid (const struct utmp *@var{id}) @@ -18742,7 +18742,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users +@c endutent dup @mtasurace:utent @asulock @aculock This function modifies the user accounting database to indicate that the user on @var{ut_line} has logged out. - + @@ -1454,6 +1782,14 @@ @comment utmp.h @comment BSD @@ -19090,7 +19090,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users initialized by @code{setpwent}. It returns a pointer to the entry. The structure is statically allocated and is rewritten on subsequent calls @@ -1655,7 +2266,21 @@ - + @comment pwd.h @comment GNU -@deftypefun int getpwent_r (struct passwd *@var{result_buf}, char *@var{buffer}, int @var{buflen}, struct passwd **@var{result}) @@ -19325,7 +19325,7 @@ diff -urN glibc-2.17-c758a686/manual/users.texi glibc-2.17-c758a686/manual/users selected netgroup. The string pointers, in which addresses are passed in the arguments @var{hostp}, @var{userp}, and @var{domainp}, will contain @@ -2005,7 +2744,20 @@ - + @comment netdb.h @comment GNU -@deftypefun int getnetgrent_r (char **@var{hostp}, char **@var{userp}, char **@var{domainp}, char *@var{buffer}, int @var{buflen}) diff --git a/SOURCES/glibc-powerpc-ldbl_high.patch b/SOURCES/glibc-powerpc-ldbl_high.patch index 0cdc34fc..68faeee4 100644 --- a/SOURCES/glibc-powerpc-ldbl_high.patch +++ b/SOURCES/glibc-powerpc-ldbl_high.patch @@ -4,7 +4,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 @@ -190,6 +190,9 @@ # define ldbl_unpack default_ldbl_unpack #endif - + +/* Extract high double. */ +#define ldbl_high(x) ((double) x) + diff --git a/SOURCES/glibc-ppc64le-01.patch b/SOURCES/glibc-ppc64le-01.patch index a8a38883..e2a86d72 100644 --- a/SOURCES/glibc-ppc64le-01.patch +++ b/SOURCES/glibc-ppc64le-01.patch @@ -3,7 +3,7 @@ # Date: Tue Feb 4 09:48:47 2014 -0200 # # abilist-pattern configurability -# +# # This patch creates implicit rules to match the abifiles if # abilist-pattern is defined in the architecture Makefile. This allows # machine specific Makefiles to define different abifiles names @@ -13,9 +13,9 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules --- glibc-2.17-c758a686/Makerules 2014-06-02 15:29:42.000000000 +0000 +++ glibc-2.17-c758a686/Makerules 2014-06-02 15:25:21.000000000 +0000 @@ -1152,6 +1152,14 @@ - LC_ALL=C $(OBJDUMP) --dynamic-syms $< > $@T - mv -f $@T $@ - + LC_ALL=C $(OBJDUMP) --dynamic-syms $< > $@T + mv -f $@T $@ + +# A sysdeps/.../Makefile can set abilist-pattern to something like +# %-foo.abilist to look for libc-foo.abilist instead of libc.abilist. +# This makes sense if multiple ABIs can be most cleanly supported by a @@ -25,12 +25,12 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules +endif + vpath %.abilist $(+sysdep_dirs) - + # The .PRECIOUS rule prevents the files built by an implicit rule whose @@ -1161,18 +1169,42 @@ .PRECIOUS: %.symlist generated += $(extra-libs:=.symlist) - + +ifdef abilist-pattern +check-abi-%: $(common-objpfx)config.make $(abilist-pattern) $(objpfx)%.symlist + $(check-abi-pattern) @@ -39,16 +39,16 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules + $(check-abi-pattern) +endif check-abi-%: $(common-objpfx)config.make %.abilist $(objpfx)%.symlist - $(check-abi) + $(check-abi) check-abi-%: $(common-objpfx)config.make %.abilist $(common-objpfx)%.symlist - $(check-abi) + $(check-abi) +define check-abi-pattern + diff -p -U 0 $(filter $(abilist-pattern),$^) $(filter %.symlist,$^) +endef define check-abi - diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^) + diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^) endef - + +ifdef abilist-pattern +update-abi-%: $(objpfx)%.symlist $(abilist-pattern) + $(update-abi-pattern) @@ -56,9 +56,9 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules + $(update-abi-pattern) +endif update-abi-%: $(objpfx)%.symlist %.abilist - $(update-abi) + $(update-abi) update-abi-%: $(common-objpfx)%.symlist %.abilist - $(update-abi) + $(update-abi) +define update-abi-pattern +@if cmp -s $^ 2> /dev/null; \ + then \ diff --git a/SOURCES/glibc-ppc64le-02.patch b/SOURCES/glibc-ppc64le-02.patch index 268f7930..3878826f 100644 --- a/SOURCES/glibc-ppc64le-02.patch +++ b/SOURCES/glibc-ppc64le-02.patch @@ -3,7 +3,7 @@ # Date: Tue Feb 4 09:49:34 2014 -0200 # # PowerPC: powerpc64le abilist for 2.17 -# +# # This patch is the abifiles for powerpc64le based on GLIBC 2.17. # diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/ld-le.abilist glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/ld-le.abilist diff --git a/SOURCES/glibc-ppc64le-03.patch b/SOURCES/glibc-ppc64le-03.patch index b6886d4b..40b6e717 100644 --- a/SOURCES/glibc-ppc64le-03.patch +++ b/SOURCES/glibc-ppc64le-03.patch @@ -1,9 +1,9 @@ # commit 9e54314bb06aace405553552f7e7b7d8c172968c # Author: Joseph Myers # Date: Thu Jun 6 19:02:09 2013 +0000 -# +# # Update miscellaneous scripts from upstream. -# +# diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/config.guess --- glibc-2.17-c758a686/scripts/config.guess 2014-05-26 15:59:45.000000000 -0500 +++ glibc-2.17-c758a686/scripts/config.guess 2014-05-26 16:01:00.000000000 -0500 @@ -14,10 +14,10 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. - + -timestamp='2012-09-25' +timestamp='2013-11-29' - + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or @@ -49,24 +49,24 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + - + me=`echo "$0" | sed -e 's,.*/,,'` - + @@ -54,9 +50,7 @@ GNU config.guess ($timestamp) - + Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. @@ -89,38 +89,38 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c +esac + # Note: order is significant - the case branches are not exclusive. - + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -859,21 +874,21 @@ - exit ;; + exit ;; *:GNU:*:*) - # the GNU system + # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit ;; *:GNU/*:*:*) - # other systems with GNU libc and userland + # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; + exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be + UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -886,59 +901,54 @@ - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi @@ -128,46 +128,46 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else + else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; + fi + fi + exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build @@ -179,58 +179,58 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build + eval $set_cc_for_build @@ -957,54 +967,63 @@ - #endif + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} - exit ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} - exit ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; + esac + exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} - exit ;; + exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} @@ -240,45 +240,45 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} - exit ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1237,19 +1256,31 @@ - exit ;; + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build @@ -317,8 +317,8 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/config.sub --- glibc-2.17-c758a686/scripts/config.sub 2014-05-26 15:59:45.000000000 -0500 @@ -367,8 +367,8 @@ diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/con +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). - - + + -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. @@ -378,206 +378,206 @@ diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/con @@ -73,9 +68,7 @@ version="\ GNU config.sub ($timestamp) - + -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -156,7 +149,7 @@ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; + os= + basic_machine=$1 + ;; @@ -259,10 +252,12 @@ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ - | bfin \ + | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ @@ -270,10 +265,11 @@ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ @@ -291,16 +287,17 @@ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 \ + | ns16k | ns32k \ + | open8 \ - | or32 \ + | or1k | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ @@ -328,7 +325,7 @@ - c6x) - basic_machine=tic6x-unknown - ;; + c6x) + basic_machine=tic6x-unknown + ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; + basic_machine=$basic_machine-unknown + os=-none + ;; @@ -370,13 +367,13 @@ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -385,11 +382,13 @@ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ @@ -407,12 +406,13 @@ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ @@ -788,7 +788,7 @@ - basic_machine=ns32k-utek - os=-sysv - ;; + basic_machine=ns32k-utek + os=-sysv + ;; - microblaze) + microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) + basic_machine=microblaze-xilinx + ;; + mingw64) @@ -796,7 +796,7 @@ - os=-mingw64 - ;; - mingw32) + os=-mingw64 + ;; + mingw32) - basic_machine=i386-pc + basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) + os=-mingw32 + ;; + mingw32ce) @@ -832,7 +832,7 @@ - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) - basic_machine=i386-pc + basic_machine=i686-pc - os=-msys - ;; - mvs) + os=-msys + ;; + mvs) @@ -1023,7 +1023,11 @@ - basic_machine=i586-unknown - os=-pw32 - ;; + basic_machine=i586-unknown + os=-pw32 + ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) - basic_machine=i386-pc - os=-rdos - ;; + basic_machine=i386-pc + os=-rdos + ;; @@ -1350,7 +1354,7 @@ - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1496,9 +1500,6 @@ - -aros*) - os=-aros - ;; + -aros*) + os=-aros + ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; + -zvmoe) + os=-zvmoe + ;; @@ -1547,6 +1548,9 @@ - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; - hexagon-*) - os=-elf - ;; + hexagon-*) + os=-elf + ;; @@ -1590,6 +1594,9 @@ - mips*-*) - os=-elf - ;; + mips*-*) + os=-elf + ;; + or1k-*) + os=-elf + ;; - or32-*) - os=-coff - ;; + or32-*) + os=-coff + ;; diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/install-sh --- glibc-2.17-c758a686/scripts/install-sh 2014-05-26 15:59:45.000000000 -0500 +++ glibc-2.17-c758a686/scripts/install-sh 2014-05-26 16:00:34.000000000 -0500 @@ -640,13 +640,13 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. - + +nl=' +' +IFS=" "" $nl" - + # set DOITPROG to echo to test this script - + # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - @@ -736,11 +736,11 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins - true + doit_exec=$doit fi - + -if [ x"$dir_arg" != x ]; then - dst=$src - src="" -- +- - if [ -d $dst ]; then - instcmd=: - else @@ -749,9 +749,9 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins -else +# Put in absolute file names if you don't have them in your path; +# or use environment vars. - + -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command --# might cause directories to be created, which would be especially bad +-# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] @@ -761,7 +761,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins - echo "install: $src does not exist" - exit 1 - fi -- +- - if [ x"$dst" = x ] - then - echo "install: no destination specified" @@ -803,19 +803,19 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + fi + } +' - + -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script +posix_mkdir= - + -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then --defaultIFS=' +-defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" +# Desired mode of installed file. +mode=0755 - + -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' @@ -840,7 +840,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= - + - pathcomp="${pathcomp}/" +src= +dst= @@ -947,7 +947,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + esac + done fi - + -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && @@ -966,7 +966,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + # This can happen when creating conditional directories. + exit 0 +fi - + -# If we're going to rename the final executable, determine the name now. +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' @@ -998,8 +998,8 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + cp_umask=$mode$u_plus_rw;; + esac +fi - -- if [ x"$transformarg" = x ] + +- if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` +for src @@ -1098,12 +1098,12 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode - else -- dstfile=`basename $dst $transformbasename | + else +- dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename + mkdir_mode= - fi - + fi + -# don't allow the sed command to completely eliminate the filename + posix_mkdir=false + case $umask in @@ -1144,8 +1144,8 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + trap '' 0;; + esac;; + esac - -- if [ x"$dstfile" = x ] + +- if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` + if @@ -1185,7 +1185,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= - else + else - true + if $posix_mkdir; then + (umask=$mkdir_umask && @@ -1199,10 +1199,10 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + esac + prefixes="$prefixes '$qprefix'" + fi - fi + fi + prefix=$prefix/ + done - + -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# @@ -1227,7 +1227,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && -- $doit $mvcmd $dsttmp $dstdir/$dstfile +- $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && + if test -n "$prefixes"; then @@ -1311,11 +1311,11 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 - + + trap '' 0 + fi +done - + -exit 0 +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) @@ -1333,7 +1333,7 @@ diff -urN glibc-2.17-c758a686/scripts/mkinstalldirs glibc-2.17-c758a686/scripts/ -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - + +scriptversion=2009-04-28.21; # UTC + +# Original author: Noah Friedman @@ -1388,7 +1388,7 @@ diff -urN glibc-2.17-c758a686/scripts/mkinstalldirs glibc-2.17-c758a686/scripts/ + ;; + esac +done - + for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` @@ -1438,7 +1438,7 @@ diff -urN glibc-2.17-c758a686/scripts/mkinstalldirs glibc-2.17-c758a686/scripts/ + fi + ;; +esac - + - pathcomp= - for d - do @@ -1496,15 +1496,15 @@ diff -urN glibc-2.17-c758a686/scripts/mkinstalldirs glibc-2.17-c758a686/scripts/ + fi + fi + fi - + - pathcomp="$pathcomp/" - done + pathcomp=$pathcomp/ + done done - + exit $errstatus - + -# mkinstalldirs ends here +# Local Variables: +# mode: shell-script diff --git a/SOURCES/glibc-ppc64le-04.patch b/SOURCES/glibc-ppc64le-04.patch index 57612763..8f6840b6 100644 --- a/SOURCES/glibc-ppc64le-04.patch +++ b/SOURCES/glibc-ppc64le-04.patch @@ -1,15 +1,15 @@ # commit 9605ca6c085a749f29b6866a3e00bce1ba1a2698 # Author: Alan Modra # Date: Sat Aug 17 18:12:56 2013 +0930 -# +# # IBM long double mechanical changes to support little-endian # http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html -# +# # This patch starts the process of supporting powerpc64 little-endian # long double in glibc. IBM long double is an array of two ieee # doubles, so making union ibm_extended_long_double reflect this fact is # the correct way to access fields of the doubles. -# +# # * sysdeps/ieee754/ldbl-128ibm/ieee754.h # (union ibm_extended_long_double): Define as an array of ieee754_double. # (IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete. @@ -23,14 +23,14 @@ # * sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise. # * sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise. # * sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c 2014-05-26 21:08:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c 2014-05-26 21:08:10.000000000 -0500 @@ -36,9 +36,9 @@ else if (arg > LDBL_MAX_10_EXP + 1) return LDBL_MAX * LDBL_MAX; - + - u.d = arg; - arg_high = u.dd[0]; - arg_low = u.dd[1]; @@ -45,7 +45,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c 2014-05-26 21:08:10.000000000 -0500 @@ -162,39 +162,39 @@ x = x + xl; - + /* Compute ex2 = 2^n_0 e^(argtable[tval1]) e^(argtable[tval2]). */ - ex2_u.d = __expl_table[T_EXPL_RES1 + tval1] - * __expl_table[T_EXPL_RES2 + tval2]; @@ -57,8 +57,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7 - ex2_u.ieee.exponent += n_i >> unsafe; + ex2_u.d[0].ieee.exponent += n_i >> unsafe; /* Fortunately, there are no subnormal lowpart doubles in - __expl_table, only normal values and zeros. - But after scaling it can be subnormal. */ + __expl_table, only normal values and zeros. + But after scaling it can be subnormal. */ - exponent2 = ex2_u.ieee.exponent2 + (n_i >> unsafe); - if (ex2_u.ieee.exponent2 == 0) - /* assert ((ex2_u.ieee.mantissa2|ex2_u.ieee.mantissa3) == 0) */; @@ -69,47 +69,47 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7 - ex2_u.ieee.exponent2 = exponent2; + ex2_u.d[1].ieee.exponent = exponent2; else if (exponent2 <= -54) - { + { - ex2_u.ieee.exponent2 = 0; - ex2_u.ieee.mantissa2 = 0; - ex2_u.ieee.mantissa3 = 0; + ex2_u.d[1].ieee.exponent = 0; + ex2_u.d[1].ieee.mantissa0 = 0; + ex2_u.d[1].ieee.mantissa1 = 0; - } + } else - { - static const double - two54 = 1.80143985094819840000e+16, /* 4350000000000000 */ - twom54 = 5.55111512312578270212e-17; /* 3C90000000000000 */ + { + static const double + two54 = 1.80143985094819840000e+16, /* 4350000000000000 */ + twom54 = 5.55111512312578270212e-17; /* 3C90000000000000 */ - ex2_u.dd[1] *= two54; - ex2_u.ieee.exponent2 += n_i >> unsafe; - ex2_u.dd[1] *= twom54; + ex2_u.d[1].d *= two54; + ex2_u.d[1].ieee.exponent += n_i >> unsafe; + ex2_u.d[1].d *= twom54; - } - + } + /* Compute scale = 2^n_1. */ - scale_u.d = 1.0L; - scale_u.ieee.exponent += n_i - (n_i >> unsafe); + scale_u.ld = 1.0L; + scale_u.d[0].ieee.exponent += n_i - (n_i >> unsafe); - + /* Approximate e^x2 - 1, using a seventh-degree polynomial, - with maximum error in [-2^-16-2^-53,2^-16+2^-53] + with maximum error in [-2^-16-2^-53,2^-16+2^-53] @@ -204,7 +204,7 @@ /* Return result. */ fesetenv (&oldenv); - + - result = x22 * ex2_u.d + ex2_u.d; + result = x22 * ex2_u.ld + ex2_u.ld; - + /* Now we can test whether the result is ultimate or if we are unsure. - In the later case we should probably call a mpn based routine to give + In the later case we should probably call a mpn based routine to give @@ -238,7 +238,7 @@ if (!unsafe) - return result; + return result; else - return result * scale_u.d; + return result * scale_u.ld; @@ -120,7 +120,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h glibc-2.17-c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h 2014-05-26 21:08:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h 2014-05-26 21:08:10.000000000 -0500 @@ -180,29 +180,9 @@ - + union ibm_extended_long_double { - long double d; @@ -149,9 +149,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h glibc-2.17-c + long double ld; + union ieee754_double d[2]; + }; - + __END_DECLS - + diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c 2014-05-26 21:08:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c 2014-05-26 21:08:10.000000000 -0500 @@ -161,12 +161,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- int ediff; - u.d = value; + u.ld = value; - + - *is_neg = u.ieee.negative; - *expt = (int) u.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS; + *is_neg = u.d[0].ieee.negative; + *expt = (int) u.d[0].ieee.exponent - IEEE754_DOUBLE_BIAS; - + - lo = ((long long) u.ieee.mantissa2 << 32) | u.ieee.mantissa3; - hi = ((long long) u.ieee.mantissa0 << 32) | u.ieee.mantissa1; + lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; @@ -177,13 +177,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- + if (u.d[1].ieee.exponent > 0) { lo |= 1LL << 52; - + /* The lower double is normalized separately from the upper. We may - need to adjust the lower manitissa to reflect this. */ + need to adjust the lower manitissa to reflect this. */ - ediff = u.ieee.exponent - u.ieee.exponent2; + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; if (ediff > 53) - lo = lo >> (ediff-53); + lo = lo >> (ediff-53); } @@ -59,8 +59,8 @@ difference between the long double and the rounded high double @@ -198,13 +198,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- if (hi == 0LL) @@ -92,7 +92,7 @@ #define NUM_LEADING_ZEROS (BITS_PER_MP_LIMB \ - - (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB))) - + - (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB))) + - if (u.ieee.exponent == 0) + if (u.d[0].ieee.exponent == 0) { /* A biased exponent of zero is a special case. - Either it is a zero or it is a denormal number. */ + Either it is a zero or it is a denormal number. */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:10.000000000 -0500 @@ -218,7 +218,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + union ibm_extended_long_double u; + u.ld = x; + *exp = u.d[0].ieee.exponent - IEEE754_DOUBLE_BIAS; - + - lo = ((int64_t)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; - hi = ((int64_t)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; + lo = ((uint64_t)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; @@ -231,14 +231,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 lo |= (1ULL << 52); lo = lo << 7; /* pre-shift lo to match ieee854. */ /* The lower double is normalized separately from the upper. We - may need to adjust the lower manitissa to reflect this. */ + may need to adjust the lower manitissa to reflect this. */ - ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; if (ediff > 53) - lo = lo >> (ediff-53); + lo = lo >> (ediff-53); hi |= (1ULL << 52); } - + - if ((eldbl.ieee.negative != eldbl.ieee.negative2) - && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL))) + if ((u.d[0].ieee.negative != u.d[1].ieee.negative) @@ -249,7 +249,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 @@ -58,10 +58,10 @@ unsigned long hidden2, lzcount; unsigned long long hi, lo; - + - u.ieee.negative = sign; - u.ieee.negative2 = sign; - u.ieee.exponent = exp + IBM_EXTENDED_LONG_DOUBLE_BIAS; @@ -259,38 +259,38 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.d[0].ieee.exponent = exp + IEEE754_DOUBLE_BIAS; + u.d[1].ieee.exponent = exp-53 + IEEE754_DOUBLE_BIAS; /* Expect 113 bits (112 bits + hidden) right justified in two longs. - The low order 53 bits (52 + hidden) go into the lower double */ + The low order 53 bits (52 + hidden) go into the lower double */ lo = (lo64 >> 7)& ((1ULL << 53) - 1); @@ -78,7 +78,7 @@ if (hidden2) - { - hi++; + { + hi++; - u.ieee.negative2 = !sign; + u.d[1].ieee.negative = !sign; - lo = (1ULL << 53) - lo; - } + lo = (1ULL << 53) - lo; + } /* The hidden bit of the lo mantissa is zero so we need to @@ -94,32 +94,32 @@ lzcount = lzcount - 11; if (lzcount > 0) - { + { - int expnt2 = u.ieee.exponent2 - lzcount; + int expnt2 = u.d[1].ieee.exponent - lzcount; - if (expnt2 >= 1) - { - /* Not denormal. Normalize and set low exponent. */ - lo = lo << lzcount; + if (expnt2 >= 1) + { + /* Not denormal. Normalize and set low exponent. */ + lo = lo << lzcount; - u.ieee.exponent2 = expnt2; + u.d[1].ieee.exponent = expnt2; - } - else - { - /* Is denormal. */ - lo = lo << (lzcount + expnt2); + } + else + { + /* Is denormal. */ + lo = lo << (lzcount + expnt2); - u.ieee.exponent2 = 0; + u.d[1].ieee.exponent = 0; - } - } + } + } } else { @@ -299,7 +299,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.d[1].ieee.negative = 0; + u.d[1].ieee.exponent = 0; } - + - u.ieee.mantissa3 = lo & ((1ULL << 32) - 1); - u.ieee.mantissa2 = (lo >> 32) & ((1ULL << 20) - 1); - u.ieee.mantissa1 = hi & ((1ULL << 32) - 1); @@ -311,7 +311,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.d[0].ieee.mantissa0 = (hi >> 32) & ((1ULL << 20) - 1); + return u.ld; } - + /* Handy utility functions to pack/unpack/cononicalize and find the nearbyint @@ -128,18 +128,18 @@ default_ldbl_pack (double a, double aa) @@ -324,7 +324,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.d[1].d = aa; + return u.ld; } - + static inline void default_ldbl_unpack (long double l, double *a, double *aa) { @@ -336,7 +336,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + *a = u.d[0].d; + *aa = u.d[1].d; } - + #ifndef ldbl_pack diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c 2014-05-26 21:08:01.000000000 -0500 @@ -344,7 +344,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- @@ -34,11 +34,11 @@ unsigned long long hi, lo; int exponent2; - + - u.ieee.negative = sign; - u.ieee.negative2 = sign; - u.ieee.exponent = expt + IBM_EXTENDED_LONG_DOUBLE_BIAS; @@ -355,54 +355,54 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- + u.d[0].ieee.exponent = expt + IEEE754_DOUBLE_BIAS; + u.d[1].ieee.exponent = 0; + exponent2 = expt - 53 + IEEE754_DOUBLE_BIAS; - + #if BITS_PER_MP_LIMB == 32 /* The low order 53 bits (52 + hidden) go into the lower double */ @@ -74,15 +74,15 @@ else - lzcount = lzcount + 42; - + lzcount = lzcount + 42; + - if (lzcount > u.ieee.exponent) + if (lzcount > u.d[0].ieee.exponent) - { + { - lzcount = u.ieee.exponent; - u.ieee.exponent = 0; + lzcount = u.d[0].ieee.exponent; + u.d[0].ieee.exponent = 0; - exponent2 -= lzcount; - } + exponent2 -= lzcount; + } else - { + { - u.ieee.exponent -= (lzcount - 1); + u.d[0].ieee.exponent -= (lzcount - 1); - exponent2 -= (lzcount - 1); - } - + exponent2 -= (lzcount - 1); + } + @@ -112,9 +112,9 @@ - { - if ((hi & (1LL << 53)) != 0) - hi -= 1LL << 52; + { + if ((hi & (1LL << 53)) != 0) + hi -= 1LL << 52; - u.ieee.exponent++; + u.d[0].ieee.exponent++; - } + } - u.ieee.negative2 = !sign; + u.d[1].ieee.negative = !sign; - lo = (1LL << 53) - lo; - } - + lo = (1LL << 53) - lo; + } + @@ -135,17 +135,17 @@ - exponent2 = exponent2 - lzcount; - } + exponent2 = exponent2 - lzcount; + } if (exponent2 > 0) - u.ieee.exponent2 = exponent2; + u.d[1].ieee.exponent = exponent2; else - lo >>= 1 - exponent2; + lo >>= 1 - exponent2; } else - u.ieee.negative2 = 0; + u.d[1].ieee.negative = 0; - + - u.ieee.mantissa3 = lo & 0xffffffffLL; - u.ieee.mantissa2 = (lo >> 32) & 0xfffff; - u.ieee.mantissa1 = hi & 0xffffffffLL; @@ -411,7 +411,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- + u.d[1].ieee.mantissa0 = (lo >> 32) & 0xfffff; + u.d[0].ieee.mantissa1 = hi & 0xffffffffLL; + u.d[0].ieee.mantissa0 = (hi >> 32) & ((1LL << (LDBL_MANT_DIG - 86)) - 1); - + - return u.d; + return u.ld; } @@ -426,83 +426,83 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2 - eldbl.d = fpnum.ldbl.d; \ + union ibm_extended_long_double u; \ + u.ld = fpnum.ldbl.d; \ - \ + \ assert (sizeof (long double) == 16); \ - \ + \ - lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; \ - hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; \ + lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \ + hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \ lo <<= 7; /* pre-shift lo to match ieee854. */ \ /* If the lower double is not a denomal or zero then set the hidden \ - 53rd bit. */ \ + 53rd bit. */ \ - if (eldbl.ieee.exponent2 != 0) \ + if (u.d[1].ieee.exponent != 0) \ - lo |= (1ULL << (52 + 7)); \ + lo |= (1ULL << (52 + 7)); \ else \ - lo <<= 1; \ + lo <<= 1; \ /* The lower double is normalized separately from the upper. We \ - may need to adjust the lower manitissa to reflect this. */ \ + may need to adjust the lower manitissa to reflect this. */ \ - ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; \ + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \ if (ediff > 53 + 63) \ - lo = 0; \ + lo = 0; \ else if (ediff > 53) \ - lo = lo >> (ediff - 53); \ + lo = lo >> (ediff - 53); \ - else if (eldbl.ieee.exponent2 == 0 && ediff < 53) \ + else if (u.d[1].ieee.exponent == 0 && ediff < 53) \ - lo = lo << (53 - ediff); \ + lo = lo << (53 - ediff); \ - if (eldbl.ieee.negative != eldbl.ieee.negative2 \ - && (eldbl.ieee.exponent2 != 0 || lo != 0L)) \ + if (u.d[0].ieee.negative != u.d[1].ieee.negative \ + && (u.d[1].ieee.exponent != 0 || lo != 0L)) \ - { \ - lo = (1ULL << 60) - lo; \ - if (hi == 0L) \ + { \ + lo = (1ULL << 60) - lo; \ + if (hi == 0L) \ @@ -59,7 +59,7 @@ - /* we have a borrow from the hidden bit, so shift left 1. */ \ - hi = 0xffffffffffffeLL | (lo >> 59); \ - lo = 0xfffffffffffffffLL & (lo << 1); \ + /* we have a borrow from the hidden bit, so shift left 1. */ \ + hi = 0xffffffffffffeLL | (lo >> 59); \ + lo = 0xfffffffffffffffLL & (lo << 1); \ - eldbl.ieee.exponent--; \ + u.d[0].ieee.exponent--; \ - } \ - else \ - hi--; \ + } \ + else \ + hi--; \ @@ -110,9 +110,9 @@ - *--wnumstr = L'0'; \ - } \ - \ + *--wnumstr = L'0'; \ + } \ + \ - leading = eldbl.ieee.exponent == 0 ? '0' : '1'; \ + leading = u.d[0].ieee.exponent == 0 ? '0' : '1'; \ - \ + \ - exponent = eldbl.ieee.exponent; \ + exponent = u.d[0].ieee.exponent; \ - \ + \ if (exponent == 0) \ - { \ + { \ @@ -122,18 +122,18 @@ - { \ - /* This is a denormalized number. */ \ - expnegative = 1; \ + { \ + /* This is a denormalized number. */ \ + expnegative = 1; \ - exponent = IBM_EXTENDED_LONG_DOUBLE_BIAS - 1; \ + exponent = IEEE754_DOUBLE_BIAS - 1; \ - } \ - } \ + } \ + } \ - else if (exponent >= IBM_EXTENDED_LONG_DOUBLE_BIAS) \ + else if (exponent >= IEEE754_DOUBLE_BIAS) \ - { \ - expnegative = 0; \ + { \ + expnegative = 0; \ - exponent -= IBM_EXTENDED_LONG_DOUBLE_BIAS; \ + exponent -= IEEE754_DOUBLE_BIAS; \ - } \ + } \ else \ - { \ - expnegative = 1; \ + { \ + expnegative = 1; \ - exponent = -(exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS); \ + exponent = -(exponent - IEEE754_DOUBLE_BIAS); \ - } \ + } \ } while (0) - + diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c 2014-05-26 21:08:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c 2014-05-26 21:08:10.000000000 -0500 @@ -512,7 +512,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2 union ibm_extended_long_double u; - u.d = x; + u.ld = x; - + - if (fabs (u.dd[0]) < TWO52) + if (fabs (u.d[0].d) < TWO52) { @@ -520,11 +520,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2 + double high = u.d[0].d; feholdexcept (&env); if (high > 0.0) - { + { @@ -51,11 +51,11 @@ - high += TWO52; + high += TWO52; if (high == 0.0) high = -0.0; - } + } - u.dd[0] = high; - u.dd[1] = 0.0; + u.d[0].d = high; @@ -542,23 +542,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2 feholdexcept (&env); - if (u.dd[0] > 0.0) + if (u.d[0].d > 0.0) - { + { - if (u.dd[1] > 0.0) + if (u.d[1].d > 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ + { + /* If the high/low doubles are the same sign then simply + round the low double. */ - high = u.dd[0]; - low = u.dd[1]; + high = u.d[0].d; + low = u.d[1].d; - } + } - else if (u.dd[1] < 0.0) + else if (u.d[1].d < 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ - + { + /* Else the high double is pre rounded and we need to + adjust for that. */ + - tau = __nextafter (u.dd[0], 0.0); - tau = (u.dd[0] - tau) * 2.0; - high = u.dd[0] - tau; @@ -567,28 +567,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2 + tau = (u.d[0].d - tau) * 2.0; + high = u.d[0].d - tau; + low = u.d[1].d + tau; - } - low += TWO52; - low -= TWO52; - } + } + low += TWO52; + low -= TWO52; + } - else if (u.dd[0] < 0.0) + else if (u.d[0].d < 0.0) - { + { - if (u.dd[1] < 0.0) + if (u.d[1].d < 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ + { + /* If the high/low doubles are the same sign then simply + round the low double. */ - high = u.dd[0]; - low = u.dd[1]; + high = u.d[0].d; + low = u.d[1].d; - } + } - else if (u.dd[1] > 0.0) + else if (u.d[1].d > 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ + { + /* Else the high double is pre rounded and we need to + adjust for that. */ - tau = __nextafter (u.dd[0], 0.0); - tau = (u.dd[0] - tau) * 2.0; - high = u.dd[0] - tau; @@ -597,21 +597,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2 + tau = (u.d[0].d - tau) * 2.0; + high = u.d[0].d - tau; + low = u.d[1].d + tau; - } - low = TWO52 - low; - low = -(low - TWO52); - } + } + low = TWO52 - low; + low = -(low - TWO52); + } - u.dd[0] = high + low; - u.dd[1] = high - u.dd[0] + low; + u.d[0].d = high + low; + u.d[1].d = high - u.d[0].d + low; fesetenv (&env); } - + - return u.d; + return u.ld; } - + long_double_symbol (libm, __nearbyintl, nearbyintl); diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c 2014-05-26 21:08:01.000000000 -0500 @@ -632,7 +632,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c glibc-2.17 + if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0) \ + (flt) = u.ld; \ } while (0) - + #include diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c 2014-05-26 21:08:01.000000000 -0500 diff --git a/SOURCES/glibc-ppc64le-05.patch b/SOURCES/glibc-ppc64le-05.patch index fcb37cc2..d089fdaa 100644 --- a/SOURCES/glibc-ppc64le-05.patch +++ b/SOURCES/glibc-ppc64le-05.patch @@ -1,28 +1,28 @@ # commit 4cf69995e26e16005d4e3843ad4d18c75cf21a04 # Author: Alan Modra # Date: Sat Aug 17 18:19:44 2013 +0930 -# +# # Fix for [BZ #15680] IBM long double inaccuracy # http://sourceware.org/ml/libc-alpha/2013-06/msg00919.html -# +# # I discovered a number of places where denormals and other corner cases # were being handled wrongly. -# +# # - printf_fphex.c: Testing for the low double exponent being zero is # unnecessary. If the difference in exponents is less than 53 then the # high double exponent must be nearing the low end of its range, and the # low double exponent hit rock bottom. -# +# # - ldbl2mpn.c: A denormal (ie. exponent of zero) value is treated as # if the exponent was one, so shift mantissa left by one. Code handling # normalisation of the low double mantissa lacked a test for shift count # greater than bits in type being shifted, and lacked anything to handle # the case where the difference in exponents is less than 53 as in # printf_fphex.c. -# +# # - math_ldbl.h (ldbl_extract_mantissa): Same as above, but worse, with # code testing for exponent > 1 for some reason, probably a typo for >= 1. -# +# # - math_ldbl.h (ldbl_insert_mantissa): Round the high double as per # mpn2ldbl.c (hi is odd or explicit mantissas non-zero) so that the # number we return won't change when applying ldbl_canonicalize(). @@ -32,12 +32,12 @@ # mantissa. Also by inspection, lzcount can never be less than zero so # remove that test. Lastly, masking bitfields to their widths can be # left to the compiler. -# +# # - mpn2ldbl.c: The overflow checks here on rounding of high double were # just plain wrong. Incrementing the exponent must be accompanied by a # shift right of the mantissa to keep the value unchanged. Above notes # for ldbl_insert_mantissa are also relevant. -# +# # [BZ #15680] # * sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c: Comment fix. # * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c @@ -55,7 +55,7 @@ # * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c # (__mpn_construct_long_double): Fix test for overflow of high # mantissa and correct normalisation. Avoid undefined shift. -# +# diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c 2014-05-27 19:13:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c 2014-05-27 19:14:45.000000000 -0500 @@ -77,10 +77,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- int ediff; + u.ld = value; - + *is_neg = u.d[0].ieee.negative; @@ -43,27 +44,36 @@ - + lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; hi = ((long long) u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; - /* If the lower double is not a denomal or zero then set the hidden @@ -94,7 +94,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- + lo |= 1ULL << 52; + else + lo = lo << 1; - + - /* The lower double is normalized separately from the upper. We may - need to adjust the lower manitissa to reflect this. */ - ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; @@ -125,9 +125,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17- lo = (1ULL << 53) - lo; - if (hi == 0LL) + if (hi == 0) - { - /* we have a borrow from the hidden bit, so shift left 1. */ - hi = 0x0ffffffffffffeLL | (lo >> 51); + { + /* we have a borrow from the hidden bit, so shift left 1. */ + hi = 0x0ffffffffffffeLL | (lo >> 51); diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:13:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:51:13.000000000 -0500 @@ -140,7 +140,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.ld = x; *exp = u.d[0].ieee.exponent - IEEE754_DOUBLE_BIAS; - + lo = ((uint64_t)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; hi = ((uint64_t)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; - /* If the lower double is not a denomal or zero then set the hidden @@ -156,7 +156,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 - lo = lo >> (ediff-53); - hi |= (1ULL << 52); - } - + - if ((u.d[0].ieee.negative != u.d[1].ieee.negative) - && ((u.d[1].ieee.exponent != 0) && (lo != 0LL))) + if (u.d[0].ieee.exponent != 0) @@ -192,7 +192,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + double is denormal ie. has an exponent of zero). */ + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53; + if (ediff > 0) - { + { - /* we have a borrow from the hidden bit, so shift left 1. */ - hi = (hi << 1) | (lo >> 59); - lo = 0xfffffffffffffffLL & (lo << 1); @@ -217,7 +217,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + lo = (((uint64_t) 1 << 60) - 1) & (lo << 1); + *exp = *exp - 1; + } - } + } } + else + /* If the larger magnitude double is denormal then the smaller @@ -227,7 +227,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 *lo64 = (hi << 60) | lo; *hi64 = hi >> 4; } - + static inline long double -ldbl_insert_mantissa (int sign, int exp, int64_t hi64, u_int64_t lo64) +ldbl_insert_mantissa (int sign, int exp, int64_t hi64, uint64_t lo64) @@ -237,16 +237,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 - unsigned long long hi, lo; + int expnt2; + uint64_t hi, lo; - + u.d[0].ieee.negative = sign; u.d[1].ieee.negative = sign; u.d[0].ieee.exponent = exp + IEEE754_DOUBLE_BIAS; - u.d[1].ieee.exponent = exp-53 + IEEE754_DOUBLE_BIAS; + u.d[1].ieee.exponent = 0; + expnt2 = exp - 53 + IEEE754_DOUBLE_BIAS; -+ ++ /* Expect 113 bits (112 bits + hidden) right justified in two longs. - The low order 53 bits (52 + hidden) go into the lower double */ + The low order 53 bits (52 + hidden) go into the lower double */ - lo = (lo64 >> 7)& ((1ULL << 53) - 1); - hidden2 = (lo64 >> 59) & 1ULL; + lo = (lo64 >> 7) & (((uint64_t) 1 << 53) - 1); @@ -255,7 +255,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 - hi |= (hi64 << 4); + hi = lo64 >> 60; + hi |= hi64 << 4; - + - if (lo != 0LL) + if (lo != 0) { @@ -266,33 +266,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + /* hidden bit of low double controls rounding of the high double. + If hidden is '1' and either the explicit mantissa is non-zero + or hi is odd, then round up hi and adjust lo (2nd mantissa) - plus change the sign of the low double to compensate. */ + plus change the sign of the low double to compensate. */ - if (hidden2) + if ((lo & ((uint64_t) 1 << 52)) != 0 + && ((hi & 1) != 0 || (lo & (((uint64_t) 1 << 52) - 1)) != 0)) - { - hi++; + { + hi++; + if ((hi & ((uint64_t) 1 << 53)) != 0) + { + hi = hi >> 1; + u.d[0].ieee.exponent++; + } - u.d[1].ieee.negative = !sign; + u.d[1].ieee.negative = !sign; - lo = (1ULL << 53) - lo; + lo = ((uint64_t) 1 << 53) - lo; - } + } - /* The hidden bit of the lo mantissa is zero so we need to - normalize the it for the low double. Shift it left until the -- hidden bit is '1' then adjust the 2nd exponent accordingly. */ +- hidden bit is '1' then adjust the 2nd exponent accordingly. */ + /* Normalize the low double. Shift the mantissa left until + the hidden bit is '1' and adjust the exponent accordingly. */ - + if (sizeof (lo) == sizeof (long)) - lzcount = __builtin_clzl (lo); + lzcount = __builtin_clzl (lo); @@ -91,34 +132,30 @@ - lzcount = __builtin_clzl ((long) (lo >> 32)); + lzcount = __builtin_clzl ((long) (lo >> 32)); else - lzcount = __builtin_clzl ((long) lo) + 32; + lzcount = __builtin_clzl ((long) lo) + 32; - lzcount = lzcount - 11; - if (lzcount > 0) + lzcount = lzcount - (64 - 53); @@ -303,7 +303,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + /* Not denormal. */ + u.d[1].ieee.exponent = expnt2; + else - { + { - int expnt2 = u.d[1].ieee.exponent - lzcount; - if (expnt2 >= 1) - { @@ -315,14 +315,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + as if it was 1, hence the extra shift. */ + if (expnt2 > -53) + lo >>= 1 - expnt2; - else + else - { - /* Is denormal. */ - lo = lo << (lzcount + expnt2); - u.d[1].ieee.exponent = 0; - } + lo = 0; - } + } } else - { @@ -330,7 +330,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 - u.d[1].ieee.exponent = 0; - } + u.d[1].ieee.negative = 0; - + - u.d[1].ieee.mantissa1 = lo & ((1ULL << 32) - 1); - u.d[1].ieee.mantissa0 = (lo >> 32) & ((1ULL << 20) - 1); - u.d[0].ieee.mantissa1 = hi & ((1ULL << 32) - 1); @@ -341,11 +341,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 + u.d[0].ieee.mantissa0 = hi >> 32; return u.ld; } - + @@ -133,6 +170,10 @@ return u.ld; } - + +/* To suit our callers we return *hi64 and *lo64 as if they came from + an ieee854 112 bit mantissa, that is, 48 bits in *hi64 (plus one + implicit bit) and 64 bits in *lo64. */ @@ -356,7 +356,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 @@ -162,13 +203,13 @@ *aa = xl; } - + -/* Simple inline nearbyint (double) function . +/* Simple inline nearbyint (double) function. Only works in the default rounding mode @@ -366,7 +366,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 { - double two52 = 0x10000000000000LL; + double two52 = 0x1p52; - + if (__builtin_expect ((__builtin_fabs (a) < two52), 1)) { diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c @@ -374,20 +374,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c 2014-05-27 19:14:45.000000000 -0500 @@ -70,9 +70,9 @@ else - lzcount = __builtin_clzl ((long) val) + 32; + lzcount = __builtin_clzl ((long) val) + 32; if (hi) - lzcount = lzcount - 11; + lzcount = lzcount - (64 - 53); else - lzcount = lzcount + 42; + lzcount = lzcount + 53 - (64 - 53); - + if (lzcount > u.d[0].ieee.exponent) - { + { @@ -98,29 +98,27 @@ - } + } } - + - if (lo != 0L) + if (lo != 0) { @@ -395,37 +395,37 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- - If hidden2 is '1' and either the explicit mantissa is non-zero + /* hidden bit of low double controls rounding of the high double. + If hidden is '1' and either the explicit mantissa is non-zero - or hi is odd, then round up hi and adjust lo (2nd mantissa) - plus change the sign of the low double to compensate. */ + or hi is odd, then round up hi and adjust lo (2nd mantissa) + plus change the sign of the low double to compensate. */ if ((lo & (1LL << 52)) != 0 - && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1)))) + && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1)) != 0)) - { - hi++; + { + hi++; - if ((hi & ((1LL << 52) - 1)) == 0) + if ((hi & (1LL << 53)) != 0) - { + { - if ((hi & (1LL << 53)) != 0) - hi -= 1LL << 52; + hi >>= 1; - u.d[0].ieee.exponent++; - } - u.d[1].ieee.negative = !sign; - lo = (1LL << 53) - lo; - } - + u.d[0].ieee.exponent++; + } + u.d[1].ieee.negative = !sign; + lo = (1LL << 53) - lo; + } + - /* The hidden bit of the lo mantissa is zero so we need to normalize - it for the low double. Shift it left until the hidden bit is '1' - then adjust the 2nd exponent accordingly. */ + /* Normalize the low double. Shift the mantissa left until + the hidden bit is '1' and adjust the exponent accordingly. */ - + if (sizeof (lo) == sizeof (long)) - lzcount = __builtin_clzl (lo); + lzcount = __builtin_clzl (lo); @@ -128,24 +126,24 @@ - lzcount = __builtin_clzl ((long) (lo >> 32)); + lzcount = __builtin_clzl ((long) (lo >> 32)); else - lzcount = __builtin_clzl ((long) lo) + 32; + lzcount = __builtin_clzl ((long) lo) + 32; - lzcount = lzcount - 11; - if (lzcount > 0) - { @@ -437,16 +437,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- + exponent2 -= lzcount; + if (exponent2 > 0) - u.d[1].ieee.exponent = exponent2; + u.d[1].ieee.exponent = exponent2; - else + else if (exponent2 > -53) - lo >>= 1 - exponent2; + lo >>= 1 - exponent2; + else + lo = 0; } else u.d[1].ieee.negative = 0; - + - u.d[1].ieee.mantissa1 = lo & 0xffffffffLL; - u.d[1].ieee.mantissa0 = (lo >> 32) & 0xfffff; - u.d[0].ieee.mantissa1 = hi & 0xffffffffLL; @@ -455,21 +455,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17- + u.d[1].ieee.mantissa0 = lo >> 32; + u.d[0].ieee.mantissa1 = hi; + u.d[0].ieee.mantissa0 = hi >> 32; - + return u.ld; } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:13:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:14:45.000000000 -0500 @@ -43,15 +43,15 @@ - lo <<= 1; \ + lo <<= 1; \ /* The lower double is normalized separately from the upper. We \ - may need to adjust the lower manitissa to reflect this. */ \ + may need to adjust the lower manitissa to reflect this. */ \ - ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \ - if (ediff > 53 + 63) \ + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53; \ + if (ediff > 63) \ - lo = 0; \ + lo = 0; \ - else if (ediff > 53) \ - lo = lo >> (ediff - 53); \ - else if (u.d[1].ieee.exponent == 0 && ediff < 53) \ @@ -481,6 +481,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2 if (u.d[0].ieee.negative != u.d[1].ieee.negative \ - && (u.d[1].ieee.exponent != 0 || lo != 0L)) \ + && lo != 0) \ - { \ - lo = (1ULL << 60) - lo; \ - if (hi == 0L) \ + { \ + lo = (1ULL << 60) - lo; \ + if (hi == 0L) \ diff --git a/SOURCES/glibc-ppc64le-06.patch b/SOURCES/glibc-ppc64le-06.patch index ea9451a5..fe7cf610 100644 --- a/SOURCES/glibc-ppc64le-06.patch +++ b/SOURCES/glibc-ppc64le-06.patch @@ -1,18 +1,18 @@ # commit 1b6adf888de14675bc3207578dcb7132ed5f8ecc # Author: Alan Modra # Date: Sat Aug 17 18:21:58 2013 +0930 -# +# # PowerPC floating point little-endian [1 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html -# +# # This is the first of a series of patches to ban ieee854_long_double # and the ieee854_long_double macros when using IBM long double. union # ieee854_long_double just isn't correct for IBM long double, especially # when little-endian, and pretending it is OK has allowed a number of # bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/. -# +# # This changes the few places in generic code that use it. -# +# # * stdio-common/printf_size.c (__printf_size): Don't use # union ieee854_long_double in fpnum union. # * stdio-common/printf_fphex.c (__printf_fphex): Likewise. Use @@ -26,19 +26,19 @@ # * math/test-misc.c (main): Don't use union ieee854_long_double. # ports/ # * sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change. -# +# diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-misc.c --- glibc-2.17-c758a686/math/test-misc.c 2014-05-27 19:53:22.000000000 -0500 +++ glibc-2.17-c758a686/math/test-misc.c 2014-05-27 19:53:45.000000000 -0500 @@ -721,300 +721,161 @@ - + #ifndef NO_LONG_DOUBLE { - union ieee854_long_double v1; - union ieee854_long_double v2; - long double ld; + long double v1, v2; - + - v1.d = ld = LDBL_MIN; - if (fpclassify (ld) != FP_NORMAL) + v1 = LDBL_MIN; @@ -47,29 +47,29 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("fpclassify (LDBL_MIN) failed: %d\n", fpclassify (ld)); + printf ("fpclassify (LDBL_MIN) failed: %d (%La)\n", + fpclassify (v1), v1); - result = 1; + result = 1; } - ld = nextafterl (ld, LDBL_MIN / 2.0); - if (fpclassify (ld) != FP_SUBNORMAL) + v2 = nextafterl (v1, LDBL_MIN / 2.0); + if (fpclassify (v2) != FP_SUBNORMAL) { - printf ("fpclassify (LDBL_MIN-epsilon) failed: %d (%La)\n", + printf ("fpclassify (LDBL_MIN-epsilon) failed: %d (%La)\n", - fpclassify (ld), ld); + fpclassify (v2), v2); - result = 1; + result = 1; } - v2.d = ld = nextafterl (ld, LDBL_MIN); - if (fpclassify (ld) != FP_NORMAL) + v2 = nextafterl (v2, LDBL_MIN); + if (fpclassify (v2) != FP_NORMAL) { - printf ("fpclassify (LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", + printf ("fpclassify (LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", - fpclassify (ld), ld); + fpclassify (v2), v2); - result = 1; + result = 1; } - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) + if (v1 != v2) { @@ -94,9 +94,9 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("LDBL_MIN: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("LDBL_MIN-epsilon+epsilon != LDBL_MIN: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - v1.d = ld = -LDBL_MIN; - if (fpclassify (ld) != FP_NORMAL) + v1 = -LDBL_MIN; @@ -105,29 +105,29 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("fpclassify (-LDBL_MIN) failed: %d\n", fpclassify (ld)); + printf ("fpclassify (-LDBL_MIN) failed: %d (%La)\n", + fpclassify (v1), v1); - result = 1; + result = 1; } - ld = nextafterl (ld, -LDBL_MIN / 2.0); - if (fpclassify (ld) != FP_SUBNORMAL) + v2 = nextafterl (v1, -LDBL_MIN / 2.0); + if (fpclassify (v2) != FP_SUBNORMAL) { - printf ("fpclassify (-LDBL_MIN-epsilon) failed: %d (%La)\n", + printf ("fpclassify (-LDBL_MIN-epsilon) failed: %d (%La)\n", - fpclassify (ld), ld); + fpclassify (v2), v2); - result = 1; + result = 1; } - v2.d = ld = nextafterl (ld, -LDBL_MIN); - if (fpclassify (ld) != FP_NORMAL) + v2 = nextafterl (v2, -LDBL_MIN); + if (fpclassify (v2) != FP_NORMAL) { - printf ("fpclassify (-LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", + printf ("fpclassify (-LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", - fpclassify (ld), ld); + fpclassify (v2), v2); - result = 1; + result = 1; } - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) + if (v1 != v2) { @@ -152,9 +152,9 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("-LDBL_MIN: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("-LDBL_MIN-epsilon+epsilon != -LDBL_MIN: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - ld = LDBL_MAX; - if (fpclassify (ld) != FP_NORMAL) + v1 = LDBL_MAX; @@ -163,7 +163,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("fpclassify (LDBL_MAX) failed: %d\n", fpclassify (ld)); + printf ("fpclassify (LDBL_MAX) failed: %d (%La)\n", + fpclassify (v1), v1); - result = 1; + result = 1; } - ld = nextafterl (ld, INFINITY); - if (fpclassify (ld) != FP_INFINITE) @@ -173,9 +173,9 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("fpclassify (LDBL_MAX+epsilon) failed: %d\n", fpclassify (ld)); + printf ("fpclassify (LDBL_MAX+epsilon) failed: %d (%La)\n", + fpclassify (v2), v2); - result = 1; + result = 1; } - + - ld = -LDBL_MAX; - if (fpclassify (ld) != FP_NORMAL) + v1 = -LDBL_MAX; @@ -184,7 +184,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("fpclassify (-LDBL_MAX) failed: %d\n", fpclassify (ld)); + printf ("fpclassify (-LDBL_MAX) failed: %d (%La)\n", + fpclassify (v1), v1); - result = 1; + result = 1; } - ld = nextafterl (ld, -INFINITY); - if (fpclassify (ld) != FP_INFINITE) @@ -195,16 +195,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - fpclassify (ld)); + printf ("fpclassify (-LDBL_MAX-epsilon) failed: %d (%La)\n", + fpclassify (v2), v2); - result = 1; + result = 1; } - + - v1.d = ld = 0.0625; - ld = nextafterl (ld, 0.0); - v2.d = ld = nextafterl (ld, 1.0); + v1 = 0.0625; + v2 = nextafterl (v1, 0.0); + v2 = nextafterl (v2, 1.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("0.0625L down: mantissa0 differs: %8x vs %8x\n", @@ -229,16 +229,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0625L down: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("0.0625L-epsilon+epsilon != 0.0625L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - v1.d = ld = 0.0625; - ld = nextafterl (ld, 1.0); - v2.d = ld = nextafterl (ld, 0.0); + v1 = 0.0625; + v2 = nextafterl (v1, 1.0); + v2 = nextafterl (v2, 0.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("0.0625L up: mantissa0 differs: %8x vs %8x\n", @@ -263,16 +263,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0625L up: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("0.0625L+epsilon-epsilon != 0.0625L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - v1.d = ld = -0.0625; - ld = nextafterl (ld, 0.0); - v2.d = ld = nextafterl (ld, -1.0); + v1 = -0.0625; + v2 = nextafterl (v1, 0.0); + v2 = nextafterl (v2, -1.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("-0.0625L up: mantissa0 differs: %8x vs %8x\n", @@ -297,16 +297,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("-0.0625L up: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("-0.0625L+epsilon-epsilon != -0.0625L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - v1.d = ld = -0.0625; - ld = nextafterl (ld, -1.0); - v2.d = ld = nextafterl (ld, 0.0); + v1 = -0.0625; + v2 = nextafterl (v1, -1.0); + v2 = nextafterl (v2, 0.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("-0.0625L down: mantissa0 differs: %8x vs %8x\n", @@ -331,16 +331,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("-0.0625L down: negative differs: %d vs %d\n", - v1.ieee.negative, v2.ieee.negative); + printf ("-0.0625L-epsilon+epsilon != -0.0625L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - + - v1.d = ld = 0.0; - ld = nextafterl (ld, 1.0); - v2.d = nextafterl (ld, -1.0); + v1 = 0.0; + v2 = nextafterl (v1, 1.0); + v2 = nextafterl (v2, -1.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("0.0L up: mantissa0 differs: %8x vs %8x\n", @@ -359,7 +359,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0L up: exponent differs: %4x vs %4x\n", - v1.ieee.exponent, v2.ieee.exponent); + printf ("0.0+epsilon-epsilon != 0.0L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - if (0 != v2.ieee.negative) + if (signbit (v2)) @@ -367,16 +367,16 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0L up: negative differs: 0 vs %d\n", - v2.ieee.negative); + printf ("0.0+epsilon-epsilon is negative\n"); - result = 1; + result = 1; } - + - v1.d = ld = 0.0; - ld = nextafterl (ld, -1.0); - v2.d = nextafterl (ld, 1.0); + v1 = 0.0; + v2 = nextafterl (v1, -1.0); + v2 = nextafterl (v2, 1.0); - + - if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - { - printf ("0.0L down: mantissa0 differs: %8x vs %8x\n", @@ -395,7 +395,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0L down: exponent differs: %4x vs %4x\n", - v1.ieee.exponent, v2.ieee.exponent); + printf ("0.0-epsilon+epsilon != 0.0L: %La vs %La\n", v2, v1); - result = 1; + result = 1; } - if (1 != v2.ieee.negative) + if (!signbit (v2)) @@ -403,50 +403,50 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis - printf ("0.0L down: negative differs: 1 vs %d\n", - v2.ieee.negative); + printf ("0.0-epsilon+epsilon is positive\n"); - result = 1; + result = 1; } - + diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c --- glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c 2014-05-27 19:53:21.000000000 -0500 +++ glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -25,9 +25,11 @@ /* The "strange" 80 bit format on ia64 has an explicit \ - leading digit in the 64 bit mantissa. */ \ + leading digit in the 64 bit mantissa. */ \ unsigned long long int num; \ + union ieee854_long_double u; \ + u.d = fpnum.ldbl; \ - \ + \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - | fpnum.ldbl.ieee.mantissa1); \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + | u.ieee.mantissa1); \ - \ + \ zero_mantissa = num == 0; \ - \ + \ @@ -49,8 +51,8 @@ - \ + \ /* We have 3 bits from the mantissa in the leading nibble. \ - Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ + Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ - exponent = fpnum.ldbl.ieee.exponent; \ - \ + exponent = u.ieee.exponent; \ + \ if (exponent == 0) \ - { \ - if (zero_mantissa) \ + { \ + if (zero_mantissa) \ diff -urN glibc-2.17-c758a686/stdio-common/printf_fp.c glibc-2.17-c758a686/stdio-common/printf_fp.c --- glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:22.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:45.000000000 -0500 @@ -335,8 +335,7 @@ int res; if (__isnanl (fpnum.ldbl)) - { + { - union ieee854_long_double u = { .d = fpnum.ldbl }; - is_neg = u.ieee.negative != 0; + is_neg = signbit (fpnum.ldbl); - if (isupper (info->spec)) - { - special = "NAN"; + if (isupper (info->spec)) + { + special = "NAN"; diff -urN glibc-2.17-c758a686/stdio-common/printf_fphex.c glibc-2.17-c758a686/stdio-common/printf_fphex.c --- glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:22.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -458,41 +458,41 @@ diff -urN glibc-2.17-c758a686/stdio-common/printf_fphex.c glibc-2.17-c758a686/st + long double ldbl; } fpnum; - + @@ -162,12 +162,11 @@ #ifndef __NO_LONG_DOUBLE_MATH if (info->is_long_double && sizeof (long double) > sizeof (double)) { - fpnum.ldbl.d = *(const long double *) args[0]; + fpnum.ldbl = *(const long double *) args[0]; - + /* Check for special values: not a number or infinity. */ - if (__isnanl (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl)) - { + { - negative = fpnum.ldbl.ieee.negative != 0; - if (isupper (info->spec)) - { - special = "NAN"; + if (isupper (info->spec)) + { + special = "NAN"; @@ -181,8 +180,7 @@ - } + } else - { + { - int res = __isinfl (fpnum.ldbl.d); - if (res) + if (__isinfl (fpnum.ldbl)) - { - if (isupper (info->spec)) - { + { + if (isupper (info->spec)) + { @@ -194,11 +192,9 @@ - special = "inf"; - wspecial = L"inf"; - } + special = "inf"; + wspecial = L"inf"; + } - negative = res < 0; - } + } - else - negative = signbit (fpnum.ldbl.d); - } + } + negative = signbit (fpnum.ldbl); } else @@ -515,43 +515,43 @@ diff -urN glibc-2.17-c758a686/stdio-common/printf_size.c glibc-2.17-c758a686/std { - fpnum.ldbl.d = *(const long double *) args[0]; + fpnum.ldbl = *(const long double *) args[0]; - + /* Check for special values: not a number or infinity. */ - if (__isnanl (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl)) - { - special = "nan"; - wspecial = L"nan"; - // fpnum_sign = 0; Already zero - } + { + special = "nan"; + wspecial = L"nan"; + // fpnum_sign = 0; Already zero + } - else if ((res = __isinfl (fpnum.ldbl.d))) + else if ((res = __isinfl (fpnum.ldbl))) - { - fpnum_sign = res; - special = "inf"; - wspecial = L"inf"; - } + { + fpnum_sign = res; + special = "inf"; + wspecial = L"inf"; + } else - while (fpnum.ldbl.d >= divisor && tag[1] != '\0') + while (fpnum.ldbl >= divisor && tag[1] != '\0') - { + { - fpnum.ldbl.d /= divisor; + fpnum.ldbl /= divisor; - ++tag; - } + ++tag; + } } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -24,13 +24,15 @@ - digits we use only the implicit digits for the number before \ - the decimal point. */ \ + digits we use only the implicit digits for the number before \ + the decimal point. */ \ unsigned long long int num0, num1; \ + union ieee854_long_double u; \ + u.d = fpnum.ldbl; \ - \ + \ assert (sizeof (long double) == 16); \ - \ + \ - num0 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - | fpnum.ldbl.ieee.mantissa1); \ - num1 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa2) << 32 \ @@ -560,21 +560,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c glibc-2.17 + | u.ieee.mantissa1); \ + num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \ + | u.ieee.mantissa3); \ - \ + \ zero_mantissa = (num0|num1) == 0; \ - \ + \ @@ -75,9 +77,9 @@ - *--wnumstr = L'0'; \ - } \ - \ + *--wnumstr = L'0'; \ + } \ + \ - leading = fpnum.ldbl.ieee.exponent == 0 ? '0' : '1'; \ + leading = u.ieee.exponent == 0 ? '0' : '1'; \ - \ + \ - exponent = fpnum.ldbl.ieee.exponent; \ + exponent = u.ieee.exponent; \ - \ + \ if (exponent == 0) \ - { \ + { \ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -584,69 +584,69 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2 union ibm_extended_long_double u; \ - u.ld = fpnum.ldbl.d; \ + u.ld = fpnum.ldbl; \ - \ + \ assert (sizeof (long double) == 16); \ - \ + \ lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \ hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \ lo <<= 7; /* pre-shift lo to match ieee854. */ \ - /* If the lower double is not a denomal or zero then set the hidden \ + /* If the lower double is not a denormal or zero then set the hidden \ - 53rd bit. */ \ + 53rd bit. */ \ if (u.d[1].ieee.exponent != 0) \ - lo |= (1ULL << (52 + 7)); \ + lo |= (1ULL << (52 + 7)); \ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -25,11 +25,13 @@ /* The "strange" 80 bit format on ix86 and m68k has an explicit \ - leading digit in the 64 bit mantissa. */ \ + leading digit in the 64 bit mantissa. */ \ unsigned long long int num; \ + union ieee854_long_double u; \ + u.d = fpnum.ldbl; \ - \ + \ assert (sizeof (long double) == 12); \ - \ + \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - | fpnum.ldbl.ieee.mantissa1); \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + | u.ieee.mantissa1); \ - \ + \ zero_mantissa = num == 0; \ - \ + \ @@ -62,7 +64,7 @@ - \ + \ /* We have 3 bits from the mantissa in the leading nibble. \ - Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ + Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ - exponent = fpnum.ldbl.ieee.exponent; \ + exponent = u.ieee.exponent; \ - \ + \ if (exponent == 0) \ - { \ + { \ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c --- glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 @@ -25,10 +25,11 @@ /* The "strange" 80 bit format on ix86 and m68k has an explicit \ - leading digit in the 64 bit mantissa. */ \ + leading digit in the 64 bit mantissa. */ \ unsigned long long int num; \ + union ieee854_long_double u; \ + u.d = fpnum.ldbl; \ - \ + \ - \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - | fpnum.ldbl.ieee.mantissa1); \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + | u.ieee.mantissa1); \ - \ + \ zero_mantissa = num == 0; \ - \ + \ @@ -61,7 +62,7 @@ - \ + \ /* We have 3 bits from the mantissa in the leading nibble. \ - Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ + Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ - exponent = fpnum.ldbl.ieee.exponent; \ + exponent = u.ieee.exponent; \ - \ + \ if (exponent == 0) \ - { \ + { \ diff --git a/SOURCES/glibc-ppc64le-07.patch b/SOURCES/glibc-ppc64le-07.patch index 566501d9..120576e1 100644 --- a/SOURCES/glibc-ppc64le-07.patch +++ b/SOURCES/glibc-ppc64le-07.patch @@ -1,15 +1,15 @@ # commit 4ebd120cd983c8d2ac7a234884b3ac6805d82973 # Author: Alan Modra # Date: Sat Aug 17 18:24:05 2013 +0930 -# +# # PowerPC floating point little-endian [2 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00082.html -# +# # This patch replaces occurrences of GET_LDOUBLE_* and SET_LDOUBLE_* # macros, and union ieee854_long_double_shape_type in ldbl-128ibm/, # and a stray one in the 32-bit fpu support. These files have no # significant changes apart from rewriting the long double bit access. -# +# # * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_high): Define. # * sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Rewrite # all uses of ieee854 long double macros and unions. @@ -41,14 +41,14 @@ # * sysdeps/ieee754/ldbl-128ibm/s_sinl.c (__sinl): Likewise. # * sysdeps/ieee754/ldbl-128ibm/s_tanl.c (__tanl): Likewise. # * sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c (__logbl): Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c 2014-05-27 19:59:00.000000000 -0500 @@ -36,8 +36,12 @@ { - long double t; - int64_t hx; + long double t; + int64_t hx; - u_int64_t lx; - GET_LDOUBLE_WORDS64(hx,lx,x); + uint64_t lx; @@ -57,9 +57,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c glibc-2.17- + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - if(hx<0x3ff0000000000000LL) { /* x < 1 */ - return (x-x)/(x-x); - } else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */ + if(hx<0x3ff0000000000000LL) { /* x < 1 */ + return (x-x)/(x-x); + } else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:59:00.000000000 -0500 @@ -70,16 +70,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c - long double z, r, w, p, q, s, t, f2; - ieee854_long_double_shape_type u; + long double a, z, r, w, p, q, s, t, f2; - + - u.value = __builtin_fabsl (x); - if (u.value == 1.0L) + a = __builtin_fabsl (x); + if (a == 1.0L) { if (x > 0.0L) - return 0.0; /* acos(1) = 0 */ + return 0.0; /* acos(1) = 0 */ else - return (2.0 * pio2_hi) + (2.0 * pio2_lo); /* acos(-1)= pi */ + return (2.0 * pio2_hi) + (2.0 * pio2_lo); /* acos(-1)= pi */ } - else if (u.value > 1.0L) + else if (a > 1.0L) @@ -91,23 +91,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c { - if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */ + if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */ - return pio2_hi + pio2_lo; + return pio2_hi + pio2_lo; - if (u.value < 0.4375L) + if (a < 0.4375L) - { - /* Arcsine of x. */ - z = x * x; + { + /* Arcsine of x. */ + z = x * x; @@ -199,7 +198,7 @@ - return z; - } + return z; + } /* .4375 <= |x| < .5 */ - t = u.value - 0.4375L; + t = a - 0.4375L; p = ((((((((((P10 * t - + P9) * t - + P8) * t + + P9) * t + + P8) * t @@ -230,9 +229,9 @@ - r = acosr4375 + r; + r = acosr4375 + r; return r; } - else if (u.value < 0.625L) @@ -116,8 +116,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c - t = u.value - 0.5625L; + t = a - 0.5625L; p = ((((((((((rS10 * t - + rS9) * t - + rS8) * t + + rS9) * t + + rS8) * t @@ -264,7 +263,9 @@ } else @@ -128,11 +128,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c + z = (one - a) * 0.5; s = __ieee754_sqrtl (z); /* Compute an extended precision square root from - the Newton iteration s -> 0.5 * (s + z / s). + the Newton iteration s -> 0.5 * (s + z / s). @@ -273,12 +274,11 @@ - Express s = f1 + f2 where f1 * f1 is exactly representable. - w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s . - s + w has extended precision. */ + Express s = f1 + f2 where f1 * f1 is exactly representable. + w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s . + s + w has extended precision. */ - u.value = s; - u.parts32.w2 = 0; - u.parts32.w3 = 0; @@ -158,7 +158,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c + long double a, t, w, p, q, c, r, s; int flag; - ieee854_long_double_shape_type u; - + flag = 0; - u.value = __builtin_fabsl (x); - if (u.value == 1.0L) /* |x|>= 1 */ @@ -173,12 +173,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c { - if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */ + if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */ - { - if (huge + x > one) - return x; /* return x with inexact if x!=0 */ + { + if (huge + x > one) + return x; /* return x with inexact if x!=0 */ @@ -155,9 +154,9 @@ - flag = 1; - } + flag = 1; + } } - else if (u.value < 0.625L) + else if (a < 0.625L) @@ -186,8 +186,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c - t = u.value - 0.5625; + t = a - 0.5625; p = ((((((((((rS10 * t - + rS9) * t - + rS8) * t + + rS9) * t + + rS8) * t @@ -190,7 +189,7 @@ else { @@ -196,10 +196,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c + w = one - a; t = w * 0.5; } - + @@ -223,17 +222,14 @@ } - + s = __ieee754_sqrtl (t); - if (u.value > 0.975L) + if (a > 0.975L) @@ -222,32 +222,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c glibc-2.17- +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c 2014-05-27 19:59:00.000000000 -0500 @@ -40,8 +40,10 @@ { - long double t; - int64_t hx,ix; + long double t; + int64_t hx,ix; - u_int64_t lx __attribute__ ((unused)); - GET_LDOUBLE_WORDS64(hx,lx,x); + double xhi; + + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); - ix = hx&0x7fffffffffffffffLL; - if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */ - if (ix > 0x3ff0000000000000LL) + ix = hx&0x7fffffffffffffffLL; + if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */ + if (ix > 0x3ff0000000000000LL) diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:59:00.000000000 -0500 @@ -41,9 +41,11 @@ { - long double t,w; - int64_t ix; + long double t,w; + int64_t ix; + double xhi; - + /* High word of |x|. */ - GET_LDOUBLE_MSW64(ix,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ix, xhi); - ix &= 0x7fffffffffffffffLL; - + ix &= 0x7fffffffffffffffLL; + /* x is INF or NaN */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c 2014-05-27 19:58:07.000000000 -0500 @@ -259,7 +259,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c glibc-2.17-c - int64_t hx, lx; + int64_t hx; + double xhi; - + /* Test for domain */ - GET_LDOUBLE_WORDS64 (hx, lx, x); - if (((hx & 0x7fffffffffffffffLL) | (lx & 0x7fffffffffffffffLL)) == 0) @@ -279,7 +279,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c glibc-2. - u_int64_t lx __attribute__ ((unused)); u_int64_t lxd; + double xhi; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); @@ -291,16 +291,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c glibc-2.17-c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c 2014-05-27 19:59:00.000000000 -0500 @@ -38,9 +38,11 @@ { - long double t,w,h; - int64_t ix,jx; + long double t,w,h; + int64_t ix,jx; + double xhi; - + /* High word of |x|. */ - GET_LDOUBLE_MSW64(jx,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (jx, xhi); - ix = jx&0x7fffffffffffffffLL; - + ix = jx&0x7fffffffffffffffLL; + /* x is INF or NaN */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c 2014-05-27 19:58:07.000000000 -0500 @@ -320,8 +320,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c7 tix &= ~0x80000000; /* tix = |x|'s high 32 bits */ if (tix < 0x3fc30000) /* |x| < 0.1484375 */ @@ -136,7 +139,8 @@ - case 2: index = (hix - 0x3fc30000) >> 14; break; - } + case 2: index = (hix - 0x3fc30000) >> 14; break; + } */ - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); @@ -349,14 +349,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c glibc-2.17 if (tix < 0x3fc30000) /* |x| < 0.1484375 */ { @@ -164,7 +167,8 @@ - case 2: index = (hix - 0x3fc30000) >> 14; break; - } + case 2: index = (hix - 0x3fc30000) >> 14; break; + } */ - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); + h = hhi; if (iy) - l = y - (h - x); + l = y - (h - x); else diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c 2014-05-27 19:58:07.000000000 -0500 @@ -374,30 +374,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c7 tix &= ~0x80000000; /* tix = |x|'s high 32 bits */ if (tix < 0x3fc30000) /* |x| < 0.1484375 */ @@ -132,7 +135,8 @@ - case 2: index = (hix - 0x3fc30000) >> 14; break; - } + case 2: index = (hix - 0x3fc30000) >> 14; break; + } */ - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); + h = hhi; if (iy) - l = (ix < 0 ? -y : y) - (h - x); + l = (ix < 0 ? -y : y) - (h - x); else diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:59:00.000000000 -0500 @@ -38,7 +38,10 @@ { - long double t,w; - int64_t hx,ix; + long double t,w; + int64_t hx,ix; - GET_LDOUBLE_MSW64(hx,x); + double xhi; + + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); - ix = hx&0x7fffffffffffffffLL; - if(ix>=0x7ff0000000000000LL) return x+x; /* x is inf or NaN */ - if(ix< 0x3e20000000000000LL) { /* |x|<2**-29 */ + ix = hx&0x7fffffffffffffffLL; + if(ix>=0x7ff0000000000000LL) return x+x; /* x is inf or NaN */ + if(ix< 0x3e20000000000000LL) { /* |x|<2**-29 */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:59:00.000000000 -0500 @@ -410,7 +410,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c long double t, u, p, q; - ieee854_long_double_shape_type s; + double xhi; - + - s.value = x; - k = s.parts32.w0; - if (k & 0x80000000) @@ -420,7 +420,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c + xhi = ldbl_high (x); + EXTRACT_WORDS (k, lx, xhi); + sign = k & 0x80000000; - + /* Check for IEEE special cases. */ k &= 0x7fffffff; if (k >= 0x7ff00000) @@ -428,45 +428,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c /* NaN. */ - if ((k & 0xfffff) | s.parts32.w1 ) + if (((k - 0x7ff00000) | lx) != 0) - return (x + x); - + return (x + x); + /* Infinity. */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c 2014-05-27 19:59:00.000000000 -0500 @@ -53,9 +53,11 @@ { - long double y[2],z=0.0L; - int64_t n, ix; + long double y[2],z=0.0L; + int64_t n, ix; + double xhi; - + /* High word of x. */ - GET_LDOUBLE_MSW64(ix,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ix, xhi); - + /* |x| ~< pi/4 */ - ix &= 0x7fffffffffffffffLL; + ix &= 0x7fffffffffffffffLL; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:59:00.000000000 -0500 @@ -29,10 +29,16 @@ long double __fabsl(long double x) { - u_int64_t hx, lx; + u_int64_t hx, lx; - GET_LDOUBLE_WORDS64(hx,lx,x); + double xhi, xlo; + + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - lx = lx ^ ( hx & 0x8000000000000000LL ); - hx = hx & 0x7fffffffffffffffLL; + lx = lx ^ ( hx & 0x8000000000000000LL ); + hx = hx & 0x7fffffffffffffffLL; - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; + return x; } long_double_symbol (libm, __fabsl, fabsl); diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c @@ -499,7 +499,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c glibc- u_int64_t hx, lx; int retval = FP_NORMAL; + double xhi, xlo; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); @@ -507,13 +507,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c glibc- /* +/-NaN or +/-Inf */ if (hx & 0x000fffffffffffffULL) { @@ -65,6 +67,7 @@ - retval = FP_NORMAL; - } else { - if ((hx & 0x7ff0000000000000ULL) == 0x0360000000000000ULL) { + retval = FP_NORMAL; + } else { + if ((hx & 0x7ff0000000000000ULL) == 0x0360000000000000ULL) { + EXTRACT_WORDS64 (lx, xlo); - if ((lx & 0x7fffffffffffffff) /* lower is non-zero */ - && ((lx^hx) & 0x8000000000000000ULL)) { /* and sign differs */ - /* +/- denormal */ + if ((lx & 0x7fffffffffffffff) /* lower is non-zero */ + && ((lx^hx) & 0x8000000000000000ULL)) { /* and sign differs */ + /* +/- denormal */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:59:00.000000000 -0500 @@ -547,7 +547,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_logbl.c glibc-2.17-c int64_t hx, rhx; - int64_t lx __attribute__ ((unused)); + double xhi; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); @@ -562,7 +562,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c glibc-2.1 { int64_t e; + double xhi; - + - GET_LDOUBLE_MSW64 (e, x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (e, xhi); @@ -577,12 +577,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c glibc-2.17 { int64_t ix; + double xhi; - + /* High word of x. */ - GET_LDOUBLE_MSW64 (ix, x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ix, xhi); - + /* |x| ~< pi/4 */ ix &= 0x7fffffffffffffffLL; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c @@ -590,33 +590,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c glibc-2.17-c7 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c 2014-05-27 19:59:19.000000000 -0500 @@ -53,9 +53,11 @@ { - long double y[2],z=0.0L; - int64_t n, ix; + long double y[2],z=0.0L; + int64_t n, ix; + double xhi; - + /* High word of x. */ - GET_LDOUBLE_MSW64(ix,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ix, xhi); - + /* |x| ~< pi/4 */ - ix &= 0x7fffffffffffffffLL; + ix &= 0x7fffffffffffffffLL; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:59:19.000000000 -0500 @@ -53,9 +53,11 @@ { - long double y[2],z=0.0L; - int64_t n, ix; + long double y[2],z=0.0L; + int64_t n, ix; + double xhi; - + /* High word of x. */ - GET_LDOUBLE_MSW64(ix,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ix, xhi); - + /* |x| ~< pi/4 */ - ix &= 0x7fffffffffffffffLL; + ix &= 0x7fffffffffffffffLL; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:58:07.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:59:19.000000000 -0500 @@ -627,11 +627,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c gli - double xh, xl; + double xh; double ret; - + if (__builtin_expect (x == 0.0L, 0)) /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */ return -1.0L / __builtin_fabsl (x); - + - ldbl_unpack (x, &xh, &xl); + xh = ldbl_high (x); /* ret = x & 0x7ff0000000000000; */ @@ -643,7 +643,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c gli though it were normalized. */ - int64_t lx, hx; + int64_t hx; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + EXTRACT_WORDS64 (hx, xh); return (long double) (-1023 - (__builtin_clzll (hx) - 12)); diff --git a/SOURCES/glibc-ppc64le-08.patch b/SOURCES/glibc-ppc64le-08.patch index 39911d0f..5f798447 100644 --- a/SOURCES/glibc-ppc64le-08.patch +++ b/SOURCES/glibc-ppc64le-08.patch @@ -1,10 +1,10 @@ # commit 765714cafcad7e6168518c61111f07bd955a9fee # Author: Alan Modra # Date: Sat Aug 17 18:24:58 2013 +0930 -# +# # PowerPC floating point little-endian [3 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00083.html -# +# # Further replacement of ieee854 macros and unions. These files also # have some optimisations for comparison against 0.0L, infinity and nan. # Since the ABI specifies that the high double of an IBM long double @@ -13,7 +13,7 @@ # nan are encoded in the high double, with the low double unspecified. # This means that tests for 0.0L, +/-Infinity and +/-NaN need only check # the high double. -# +# # * sysdeps/ieee754/ldbl-128ibm/e_atan2l.c (__ieee754_atan2l): Rewrite # all uses of ieee854 long double macros and unions. Simplify tests # for long doubles that are fully specified by the high double. @@ -46,47 +46,47 @@ # * sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c (__scalbnl): Likewise. # * sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Likewise. # * sysdeps/powerpc/fpu/libm-test-ulps: Adjust tan_towardzero ulps. -# +# diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c 2014-05-27 23:05:55.000000000 -0500 @@ -56,11 +56,15 @@ { - long double z; - int64_t k,m,hx,hy,ix,iy; + long double z; + int64_t k,m,hx,hy,ix,iy; - u_int64_t lx,ly; + uint64_t lx; + double xhi, xlo, yhi; - + - GET_LDOUBLE_WORDS64(hx,lx,x); + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - ix = hx&0x7fffffffffffffffLL; + ix = hx&0x7fffffffffffffffLL; - GET_LDOUBLE_WORDS64(hy,ly,y); + yhi = ldbl_high (y); + EXTRACT_WORDS64 (hy, yhi); - iy = hy&0x7fffffffffffffffLL; - if(((ix)>0x7ff0000000000000LL)|| - ((iy)>0x7ff0000000000000LL)) /* x or y is NaN */ + iy = hy&0x7fffffffffffffffLL; + if(((ix)>0x7ff0000000000000LL)|| + ((iy)>0x7ff0000000000000LL)) /* x or y is NaN */ @@ -70,7 +74,7 @@ - m = ((hy>>63)&1)|((hx>>62)&2); /* 2*sign(x)+sign(y) */ - + m = ((hy>>63)&1)|((hx>>62)&2); /* 2*sign(x)+sign(y) */ + /* when y = 0 */ - if((iy|(ly&0x7fffffffffffffffLL))==0) { + if(iy==0) { - switch(m) { - case 0: - case 1: return y; /* atan(+-0,+anything)=+-0 */ + switch(m) { + case 0: + case 1: return y; /* atan(+-0,+anything)=+-0 */ @@ -79,7 +83,7 @@ - } - } + } + } /* when x = 0 */ - if((ix|(lx&0x7fffffffffffffff))==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; - + /* when x is INF */ - if(ix==0x7ff0000000000000LL) { + if(ix==0x7ff0000000000000LL) { diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:55.000000000 -0500 @@ -96,11 +96,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c glibc-2.1 int64_t hx; - u_int64_t lx; + double xhi; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); - + - if (((hx | lx) & 0x7fffffffffffffffLL) == 0) + if ((hx & 0x7fffffffffffffffLL) == 0) { @@ -110,39 +110,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c glibc-2.17- --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c 2014-05-27 23:05:55.000000000 -0500 @@ -31,26 +31,24 @@ - + int __ieee754_ilogbl(long double x) { - int64_t hx,lx; + int64_t hx; - int ix; + int ix; + double xhi; - + - GET_LDOUBLE_WORDS64(hx,lx,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); - hx &= 0x7fffffffffffffffLL; - if(hx <= 0x0010000000000000LL) { + hx &= 0x7fffffffffffffffLL; + if(hx <= 0x0010000000000000LL) { - if((hx|(lx&0x7fffffffffffffffLL))==0) + if(hx==0) - return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ - else /* subnormal x */ + return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ + else /* subnormal x */ - if(hx==0) { - for (ix = -1043; lx>0; lx<<=1) ix -=1; - } else { - for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1; - } + for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1; - return ix; - } - else if (hx<0x7ff0000000000000LL) return (hx>>52)-0x3ff; - else if (FP_ILOGBNAN != INT_MAX) { - /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */ + return ix; + } + else if (hx<0x7ff0000000000000LL) return (hx>>52)-0x3ff; + else if (FP_ILOGBNAN != INT_MAX) { + /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */ - if (((hx^0x7ff0000000000000LL)|lx) == 0) + if (hx==0x7ff0000000000000LL) - return INT_MAX; - } - return FP_ILOGBNAN; + return INT_MAX; + } + return FP_ILOGBNAN; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:55.000000000 -0500 @@ -157,27 +157,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75 long double z, w; - ieee854_long_double_shape_type u; + double xhi; - - + + /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x) * Thus, J(-n,x) = J(n,-x) */ - + - u.value = x; - se = u.parts32.w0; + xhi = ldbl_high (x); + EXTRACT_WORDS (se, lx, xhi); ix = se & 0x7fffffff; - + /* if J(n,NaN) is NaN */ if (ix >= 0x7ff00000) { - if ((u.parts32.w0 & 0xfffff) | u.parts32.w1 - | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3) + if (((ix - 0x7ff00000) | lx) != 0) - return x + x; + return x + x; } - + @@ -298,21 +297,20 @@ long double __ieee754_ynl (int n, long double x) @@ -189,20 +189,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75 long double a, b, temp; - ieee854_long_double_shape_type u; + double xhi; - + - u.value = x; - se = u.parts32.w0; + xhi = ldbl_high (x); + EXTRACT_WORDS (se, lx, xhi); ix = se & 0x7fffffff; - + /* if Y(n,NaN) is NaN */ if (ix >= 0x7ff00000) { - if ((u.parts32.w0 & 0xfffff) | u.parts32.w1 - | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3) + if (((ix - 0x7ff00000) | lx) != 0) - return x + x; + return x + x; } if (x <= 0.0L) @@ -377,14 +375,16 @@ @@ -215,16 +215,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75 + GET_HIGH_WORD (se, xhi); + se &= 0xfff00000; for (i = 1; i < n && se != 0xfff00000; i++) - { - temp = b; - b = ((long double) (i + i) / x) * b - a; + { + temp = b; + b = ((long double) (i + i) / x) * b - a; - u.value = b; - se = u.parts32.w0 & 0xfff00000; + xhi = ldbl_high (b); + GET_HIGH_WORD (se, xhi); + se &= 0xfff00000; - a = temp; - } + a = temp; + } } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c 2014-05-27 23:05:51.000000000 -0500 @@ -236,7 +236,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c glibc-2.17- - int64_t hx, lx; + int64_t hx; + double xhi; - + /* Test for domain */ - GET_LDOUBLE_WORDS64 (hx, lx, x); - if (((hx & 0x7fffffffffffffffLL) | (lx & 0x7fffffffffffffffLL)) == 0) @@ -260,13 +260,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_logl.c glibc-2.17-c7 int k, e; + double xhi; + uint32_t hx, lx; - + - u.value = x; - m = u.parts32.w0; + xhi = ldbl_high (x); + EXTRACT_WORDS (hx, lx, xhi); + m = hx; - + /* Check for IEEE special cases. */ k = m & 0x7fffffff; /* log(0) = -infinity. */ @@ -285,35 +285,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_logl.c glibc-2.17-c7 } else @@ -233,10 +235,8 @@ - k = (m - 0xff000) >> 13; - /* t is the argument 0.5 + (k+26)/128 - of the nearest item to u in the lookup table. */ + k = (m - 0xff000) >> 13; + /* t is the argument 0.5 + (k+26)/128 + of the nearest item to u in the lookup table. */ - t.parts32.w0 = 0x3ff00000 + (k << 13); - t.parts32.w1 = 0; - t.parts32.w2 = 0; - t.parts32.w3 = 0; + INSERT_WORDS (xhi, 0x3ff00000 + (k << 13), 0); + t = xhi; - w0 += 0x100000; - e -= 1; - k += 64; + w0 += 0x100000; + e -= 1; + k += 64; @@ -244,17 +244,15 @@ else - { - k = (m - 0xfe000) >> 14; + { + k = (m - 0xfe000) >> 14; - t.parts32.w0 = 0x3fe00000 + (k << 14); - t.parts32.w1 = 0; - t.parts32.w2 = 0; - t.parts32.w3 = 0; + INSERT_WORDS (xhi, 0x3fe00000 + (k << 14), 0); + t = xhi; - } + } - u.value = __scalbnl (u.value, ((int) ((w0 - u.parts32.w0) * 2)) >> 21); + x = __scalbnl (x, ((int) ((w0 - hx) * 2)) >> 21); /* log(u) = log( t u/t ) = log(t) + log(u/t) - log(t) is tabulated in the lookup table. - Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t. - cf. Cody & Waite. */ + log(t) is tabulated in the lookup table. + Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t. + cf. Cody & Waite. */ - z = (u.value - t.value) / t.value; + z = (x - t) / t; } @@ -342,25 +342,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 + int32_t hx, hy, hax; + double ohi, xhi, xlo, yhi, ylo; + uint32_t lx, ly, lj; - + - p.value = x; - hx = p.parts32.w0; + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS (hx, lx, xhi); ix = hx & 0x7fffffff; - + - q.value = y; - hy = q.parts32.w0; + ldbl_unpack (y, &yhi, &ylo); + EXTRACT_WORDS (hy, ly, yhi); iy = hy & 0x7fffffff; - + - /* y==zero: x**0 = 1 */ - if ((iy | q.parts32.w1 | (q.parts32.w2 & 0x7fffffff) | q.parts32.w3) == 0) + if ((iy | ly) == 0) return one; - + /* 1.0**y = 1; -1.0**+-Inf = 1 */ if (x == one) return one; @@ -368,7 +368,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 - && (q.parts32.w1 | (q.parts32.w2 & 0x7fffffff) | q.parts32.w3) == 0) + if (x == -1.0L && ((iy - 0x7ff00000) | ly) == 0) return one; - + /* +-NaN return x+y */ - if ((ix > 0x7ff00000) - || ((ix == 0x7ff00000) @@ -379,7 +379,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 + if ((ix >= 0x7ff00000 && ((ix - 0x7ff00000) | lx) != 0) + || (iy >= 0x7ff00000 && ((iy - 0x7ff00000) | ly) != 0)) return x + y; - + /* determine if y is an odd int when x < 0 @@ -192,7 +187,10 @@ yisint = 0; @@ -390,13 +390,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 + + GET_HIGH_WORD (low_ye, ylo); + if ((low_ye & 0x7fffffff) >= 0x43400000) /* Low part >= 2^53 */ - yisint = 2; /* even integer y */ + yisint = 2; /* even integer y */ else if (iy >= 0x3ff00000) /* 1.0 */ - { + { @@ -207,42 +205,43 @@ - } + } } - + + ax = fabsl (x); + /* special value of y */ @@ -405,18 +405,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 { - if (iy == 0x7ff00000 && q.parts32.w1 == 0) /* y is +-inf */ + if (iy == 0x7ff00000) /* y is +-inf */ - { + { - if (((ix - 0x3ff00000) | p.parts32.w1 - | (p.parts32.w2 & 0x7fffffff) | p.parts32.w3) == 0) - return y - y; /* inf**+-1 is NaN */ - else if (ix > 0x3ff00000 || fabsl (x) > 1.0L) + if (ax > one) - /* (|x|>1)**+-inf = inf,0 */ - return (hy >= 0) ? y : zero; - else - /* (|x|<1)**-,+inf = inf,0 */ - return (hy < 0) ? -y : zero; - } + /* (|x|>1)**+-inf = inf,0 */ + return (hy >= 0) ? y : zero; + else + /* (|x|<1)**-,+inf = inf,0 */ + return (hy < 0) ? -y : zero; + } - if (iy == 0x3ff00000) - { /* y is +-1 */ - if (hy < 0) @@ -446,9 +446,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 + if (hx >= 0) /* x >= +0 */ + return __ieee754_sqrtl (x); + } - } + } } - + - ax = fabsl (x); /* special value of x */ - if ((p.parts32.w1 | (p.parts32.w2 & 0x7fffffff) | p.parts32.w3) == 0) @@ -456,9 +456,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 { - if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) + if (ix == 0x7ff00000 || ix == 0 || (ix == 0x3ff00000 && xlo == 0.0)) - { - z = ax; /*x is +-0,+-inf,+-1 */ - if (hy < 0) + { + z = ax; /*x is +-0,+-inf,+-1 */ + if (hy < 0) @@ -294,8 +293,8 @@ { ax *= two113; @@ -473,21 +473,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 @@ -312,26 +311,19 @@ ix -= 0x00100000; } - + - o.value = ax; - o.value = __scalbnl (o.value, ((int) ((ix - o.parts32.w0) * 2)) >> 21); - ax = o.value; + ohi = ldbl_high (ax); + GET_HIGH_WORD (hax, ohi); + ax = __scalbnl (ax, ((int) ((ix - hax) * 2)) >> 21); - + /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */ u = ax - bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ v = one / (ax + bp[k]); s = u * v; - s_h = s; + s_h = ldbl_high (s); - + - o.value = s_h; - o.parts32.w3 = 0; - o.parts32.w2 = 0; @@ -534,11 +534,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 - t1 = o.value; + t1 = ldbl_high (t1); t2 = z_l - (((t1 - t) - dp_h[k]) - z_h); - + /* s (sign of result -ve**odd) = -1 else = 1 */ @@ -374,21 +357,16 @@ s = -one; /* (-ve)**(odd int) */ - + /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ - y1 = y; - o.value = y1; @@ -559,9 +559,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 - if (((j - 0x40d00000) | o.parts32.w1 - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) + if (((j - 0x40d00000) | lj) != 0) - return s * huge * huge; /* overflow */ + return s * huge * huge; /* overflow */ else - { + { @@ -399,8 +377,7 @@ else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */ { @@ -569,9 +569,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7 - if (((j - 0xc0d01bc0) | o.parts32.w1 - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) + if (((j - 0xc0d01bc0) | lj) != 0) - return s * tiny * tiny; /* underflow */ + return s * tiny * tiny; /* underflow */ else - { + { @@ -419,10 +396,7 @@ p_h -= t; } @@ -595,7 +595,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_tanl.c glibc-2.17-c7 - ieee854_long_double_shape_type u, u1; + int32_t ix, sign, hx, lx; + double xhi; - + - u.value = x; - ix = u.parts32.w0 & 0x7fffffff; + xhi = ldbl_high (x); @@ -610,21 +610,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_tanl.c glibc-2.17-c7 + if ((int) x == 0) /* generate inexact */ + { + if ((ix | lx | (iy + 1)) == 0) - return one / fabs (x); - else - return (iy == 1) ? x : -one / x; + return one / fabs (x); + else + return (iy == 1) ? x : -one / x; @@ -103,7 +103,7 @@ } if (ix >= 0x3fe59420) /* |x| >= 0.6743316650390625 */ { - if ((u.parts32.w0 & 0x80000000) != 0) + if ((hx & 0x80000000) != 0) - { - x = -x; - y = -y; + { + x = -x; + y = -y; @@ -139,15 +139,13 @@ { /* if allow error up to 2 ulp, - simply return -1.0/(x+r) here */ + simply return -1.0/(x+r) here */ /* compute -1.0/(x+r) accurately */ - u1.value = w; - u1.parts32.w2 = 0; @@ -657,7 +657,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c glibc-2.17- + int32_t ix, lx, sign; int k; + double xhi; - + /* Detect infinity and NaN. */ - u.value = x; - ix = u.parts32.w0; @@ -670,65 +670,65 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c glibc-2.17- /* Infinity. */ - if (((ix & 0xfffff) | u.parts32.w1 | (u.parts32.w2&0x7fffffff) | u.parts32.w3) == 0) + if (((ix - 0x7ff00000) | lx) == 0) - { - if (sign) - return -1.0L; + { + if (sign) + return -1.0L; @@ -116,7 +116,7 @@ } - + /* expm1(+- 0) = +- 0. */ - if ((ix == 0) && (u.parts32.w1 | (u.parts32.w2&0x7fffffff) | u.parts32.w3) == 0) + if ((ix | lx) == 0) return x; - + /* Overflow. */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c 2014-05-27 23:05:55.000000000 -0500 @@ -36,16 +36,21 @@ - + long double __frexpl(long double x, int *eptr) { - u_int64_t hx, lx, ix, ixl; + uint64_t hx, lx, ix, ixl; - int64_t explo; + int64_t explo; - GET_LDOUBLE_WORDS64(hx,lx,x); + double xhi, xlo; + + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - ixl = 0x7fffffffffffffffULL&lx; - ix = 0x7fffffffffffffffULL&hx; - *eptr = 0; + ixl = 0x7fffffffffffffffULL&lx; + ix = 0x7fffffffffffffffULL&hx; + *eptr = 0; - if(ix>=0x7ff0000000000000ULL||((ix|ixl)==0)) return x; /* 0,inf,nan */ + if(ix>=0x7ff0000000000000ULL||ix==0) return x; /* 0,inf,nan */ - if (ix<0x0010000000000000ULL) { /* subnormal */ - x *= two107; + if (ix<0x0010000000000000ULL) { /* subnormal */ + x *= two107; - GET_LDOUBLE_MSW64(hx,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (hx, xhi); - ix = hx&0x7fffffffffffffffULL; - *eptr = -107; - } + ix = hx&0x7fffffffffffffffULL; + *eptr = -107; + } @@ -54,7 +59,7 @@ - if (ixl != 0ULL) { - explo = (ixl>>52) - (ix>>52) + 0x3fe; - if ((ixl&0x7ff0000000000000ULL) == 0LL) { + if (ixl != 0ULL) { + explo = (ixl>>52) - (ix>>52) + 0x3fe; + if ((ixl&0x7ff0000000000000ULL) == 0LL) { - /* the lower double is a denomal so we need to correct its + /* the lower double is a denormal so we need to correct its - mantissa and perhaps its exponent. */ - int cnt; - + mantissa and perhaps its exponent. */ + int cnt; + @@ -73,7 +78,9 @@ - lx = 0ULL; - - hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL; + lx = 0ULL; + + hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL; - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; + return x; } #ifdef IS_IN_libm diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c @@ -740,7 +740,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c glibc-2. * no branching! + * slightly dodgy in relying on signed shift right copying sign bit */ - + #include @@ -9,8 +10,14 @@ int @@ -770,7 +770,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c glibc-2.17- * no branching! + * slightly dodgy in relying on signed shift right copying sign bit */ - + #include @@ -20,12 +21,16 @@ int @@ -807,7 +807,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c glibc-2.17- + double xhi; + int32_t hx, lx; int e; - + /* Test for NaN or infinity input. */ - u.value = xm1; - hx = u.parts32.w0; @@ -815,85 +815,85 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c glibc-2.17- + EXTRACT_WORDS (hx, lx, xhi); if (hx >= 0x7ff00000) return xm1; - + /* log1p(+- 0) = +- 0. */ - if (((hx & 0x7fffffff) == 0) - && (u.parts32.w1 | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3) == 0) + if (((hx & 0x7fffffff) | lx) == 0) return xm1; - + x = xm1 + 1.0L; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c 2014-05-27 23:05:55.000000000 -0500 @@ -37,43 +37,54 @@ { - int64_t i0,i1,j0; - u_int64_t i; + int64_t i0,i1,j0; + u_int64_t i; - GET_LDOUBLE_WORDS64(i0,i1,x); + double xhi, xlo; + + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (i0, xhi); + EXTRACT_WORDS64 (i1, xlo); - i1 &= 0x000fffffffffffffLL; - j0 = ((i0>>52)&0x7ff)-0x3ff; /* exponent of x */ - if(j0<52) { /* integer part in high x */ - if(j0<0) { /* |x|<1 */ - /* *iptr = +-0 */ + i1 &= 0x000fffffffffffffLL; + j0 = ((i0>>52)&0x7ff)-0x3ff; /* exponent of x */ + if(j0<52) { /* integer part in high x */ + if(j0<0) { /* |x|<1 */ + /* *iptr = +-0 */ - SET_LDOUBLE_WORDS64(*iptr,i0&0x8000000000000000ULL,0); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + *iptr = xhi; - return x; - } else { - i = (0x000fffffffffffffLL)>>j0; - if(((i0&i)|(i1&0x7fffffffffffffffLL))==0) { /* x is integral */ - *iptr = x; - /* return +-0 */ + return x; + } else { + i = (0x000fffffffffffffLL)>>j0; + if(((i0&i)|(i1&0x7fffffffffffffffLL))==0) { /* x is integral */ + *iptr = x; + /* return +-0 */ - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + x = xhi; - return x; - } else { + return x; + } else { - SET_LDOUBLE_WORDS64(*iptr,i0&(~i),0); + INSERT_WORDS64 (xhi, i0&(~i)); + *iptr = xhi; - return x - *iptr; - } - } - } else if (j0>103) { /* no fraction part */ - *iptr = x*one; - /* We must handle NaNs separately. */ + return x - *iptr; + } + } + } else if (j0>103) { /* no fraction part */ + *iptr = x*one; + /* We must handle NaNs separately. */ - if (j0 == 0x400 && ((i0 & 0x000fffffffffffffLL) | i1)) + if ((i0 & 0x7fffffffffffffffLL) > 0x7ff0000000000000LL) - return x*one; - /* return +-0 */ + return x*one; + /* return +-0 */ - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + x = xhi; - return x; - } else { /* fraction part in low x */ - i = -1ULL>>(j0-52); - if((i1&i)==0) { /* x is integral */ - *iptr = x; - /* return +-0 */ + return x; + } else { /* fraction part in low x */ + i = -1ULL>>(j0-52); + if((i1&i)==0) { /* x is integral */ + *iptr = x; + /* return +-0 */ - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + x = xhi; - return x; - } else { + return x; + } else { - SET_LDOUBLE_WORDS64(*iptr,i0,i1&(~i)); + INSERT_WORDS64 (xhi, i0); + INSERT_WORDS64 (xlo, i1&(~i)); + *iptr = ldbl_pack (xhi, xlo); - return x - *iptr; - } - } + return x - *iptr; + } + } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:55.000000000 -0500 @@ -30,27 +30,28 @@ - + long double __nextafterl(long double x, long double y) { - int64_t hx,hy,ihx,ihy,ilx; @@ -902,7 +902,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2 + int64_t hx,hy,ihx,ihy; + uint64_t lx; + double xhi, xlo, yhi; - + - GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hy,ly,y); + ldbl_unpack (x, &xhi, &xlo); @@ -910,148 +910,148 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2 + EXTRACT_WORDS64 (lx, xlo); + yhi = ldbl_high (y); + EXTRACT_WORDS64 (hy, yhi); - ihx = hx&0x7fffffffffffffffLL; /* |hx| */ + ihx = hx&0x7fffffffffffffffLL; /* |hx| */ - ilx = lx&0x7fffffffffffffffLL; /* |lx| */ - ihy = hy&0x7fffffffffffffffLL; /* |hy| */ - + ihy = hy&0x7fffffffffffffffLL; /* |hy| */ + - if((((ihx&0x7ff0000000000000LL)==0x7ff0000000000000LL)&& - ((ihx&0x000fffffffffffffLL)!=0)) || /* x is nan */ - (((ihy&0x7ff0000000000000LL)==0x7ff0000000000000LL)&& - ((ihy&0x000fffffffffffffLL)!=0))) /* y is nan */ + if((ihx>0x7ff0000000000000LL) || /* x is nan */ + (ihy>0x7ff0000000000000LL)) /* y is nan */ - return x+y; /* signal the nan */ - if(x==y) - return y; /* x=y, return y */ + return x+y; /* signal the nan */ + if(x==y) + return y; /* x=y, return y */ - if(ihx == 0 && ilx == 0) { /* x == 0 */ - long double u; + if(ihx == 0) { /* x == 0 */ + long double u; /* return +-minsubnormal */ - hy = (hy & 0x8000000000000000ULL) | 1; + hy = (hy & 0x8000000000000000ULL) | 1; - SET_LDOUBLE_WORDS64(x,hy,0ULL);/* return +-minsubnormal */ + INSERT_WORDS64 (yhi, hy); + x = yhi; - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ + u = math_opt_barrier (x); + u = u * u; + math_force_eval (u); /* raise underflow flag */ @@ -59,10 +60,16 @@ - - long double u; - if(x > y) { /* x > y, x -= ulp */ + + long double u; + if(x > y) { /* x > y, x -= ulp */ + /* This isn't the largest magnitude correctly rounded + long double as you can see from the lowest mantissa + bit being zero. It is however the largest magnitude + long double with a 106 bit mantissa, and nextafterl + is insane with variable precision. So to make + nextafterl sane we assume 106 bit precision. */ - if((hx==0xffefffffffffffffLL)&&(lx==0xfc8ffffffffffffeLL)) - return x+x; /* overflow, return -inf */ - if (hx >= 0x7ff0000000000000LL) { + if((hx==0xffefffffffffffffLL)&&(lx==0xfc8ffffffffffffeLL)) + return x+x; /* overflow, return -inf */ + if (hx >= 0x7ff0000000000000LL) { - SET_LDOUBLE_WORDS64(u,0x7fefffffffffffffLL,0x7c8ffffffffffffeLL); + u = 0x1.fffffffffffff7ffffffffffff8p+1023L; - return u; - } - if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ + return u; + } + if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ @@ -77,16 +84,19 @@ - return x; - } - if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ + return x; + } + if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL); + INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); + u = yhi; - u *= 0x1.0000000000000p-105L; + u *= 0x1.0000000000000p-105L; - } else - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL); + } else { + INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + u = yhi; + } - return x - u; - } else { /* x < y, x += ulp */ - if((hx==0x7fefffffffffffffLL)&&(lx==0x7c8ffffffffffffeLL)) - return x+x; /* overflow, return +inf */ + return x - u; + } else { /* x < y, x += ulp */ + if((hx==0x7fefffffffffffffLL)&&(lx==0x7c8ffffffffffffeLL)) + return x+x; /* overflow, return +inf */ - if ((u_int64_t) hx >= 0xfff0000000000000ULL) { - SET_LDOUBLE_WORDS64(u,0xffefffffffffffffLL,0xfc8ffffffffffffeLL); + if ((uint64_t) hx >= 0xfff0000000000000ULL) { + u = -0x1.fffffffffffff7ffffffffffff8p+1023L; - return u; - } - if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ + return u; + } + if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ @@ -103,10 +113,13 @@ - return x; - } - if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ + return x; + } + if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL); + INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); + u = yhi; - u *= 0x1.0000000000000p-105L; + u *= 0x1.0000000000000p-105L; - } else - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL); + } else { + INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + u = yhi; + } - return x + u; - } + return x + u; + } } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:10:26.000000000 -0500 @@ -34,23 +34,23 @@ { - int32_t hx,ix; - int64_t hy,iy; + int32_t hx,ix; + int64_t hy,iy; - u_int32_t lx; - u_int64_t ly,uly; + uint32_t lx; + double yhi; + - - EXTRACT_WORDS(hx,lx,x); + + EXTRACT_WORDS(hx,lx,x); - GET_LDOUBLE_WORDS64(hy,ly,y); + yhi = ldbl_high (y); + EXTRACT_WORDS64(hy,yhi); - ix = hx&0x7fffffff; /* |x| */ - iy = hy&0x7fffffffffffffffLL; /* |y| */ + ix = hx&0x7fffffff; /* |x| */ + iy = hy&0x7fffffffffffffffLL; /* |y| */ - uly = ly&0x7fffffffffffffffLL; /* |y| */ - - if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ + + if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ - ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0)) - /* y is nan */ + iy>0x7ff0000000000000LL) /* y is nan */ - return x+y; - if((long double) x==y) return y; /* x=y, return y */ - if((ix|lx)==0) { /* x == 0 */ - double u; + return x+y; + if((long double) x==y) return y; /* x=y, return y */ + if((ix|lx)==0) { /* x == 0 */ + double u; - INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */ + INSERT_WORDS(x,(uint32_t)((hy>>32)&0x80000000),1);/* return +-minsub */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ + u = math_opt_barrier (x); + u = u * u; + math_force_eval (u); /* raise underflow flag */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:55.000000000 -0500 @@ -27,16 +27,16 @@ { - int32_t hx,ix; - int64_t hy,iy; + int32_t hx,ix; + int64_t hy,iy; - u_int64_t ly, uly; + double yhi; - - GET_FLOAT_WORD(hx,x); + + GET_FLOAT_WORD(hx,x); - GET_LDOUBLE_WORDS64(hy,ly,y); + yhi = ldbl_high (y); + EXTRACT_WORDS64 (hy, yhi); - ix = hx&0x7fffffff; /* |x| */ - iy = hy&0x7fffffffffffffffLL; /* |y| */ + ix = hx&0x7fffffff; /* |x| */ + iy = hy&0x7fffffffffffffffLL; /* |y| */ - uly = ly&0x7fffffffffffffffLL; /* |y| */ - - if((ix>0x7f800000) || /* x is nan */ + + if((ix>0x7f800000) || /* x is nan */ - ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0)) + (iy>0x7ff0000000000000LL)) - /* y is nan */ - return x+y; - if((long double) x==y) return y; /* x=y, return y */ + /* y is nan */ + return x+y; + if((long double) x==y) return y; /* x=y, return y */ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:55.000000000 -0500 @@ -1060,7 +1060,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17 u_int64_t sx,lx,ly,qs; int cquo; + double xhi, xlo, yhi, ylo; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); - GET_LDOUBLE_WORDS64 (hy, ly, y); + ldbl_unpack (x, &xhi, &xlo); @@ -1073,7 +1073,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17 qs = sx ^ (hy & 0x8000000000000000ULL); hy &= 0x7fffffffffffffffLL; hx &= 0x7fffffffffffffffLL; - + /* Purge off exception values. */ - if ((hy | (ly & 0x7fffffffffffffff)) == 0) + if (hy == 0) @@ -1083,60 +1083,60 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17 - && (((hy - 0x7ff0000000000000LL) | ly) != 0))) + || (hy > 0x7ff0000000000000LL)) /* y is NaN */ return (x * y) / (x * y); - + if (hy <= 0x7fbfffffffffffffLL) diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c 2014-05-27 23:15:30.000000000 -0500 @@ -41,11 +41,15 @@ { - int64_t k,l,hx,lx; - union { int64_t i; double d; } u; + int64_t k,l,hx,lx; + union { int64_t i; double d; } u; - GET_LDOUBLE_WORDS64(hx,lx,x); + double xhi, xlo; + + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - k = (hx>>52)&0x7ff; /* extract exponent */ - l = (lx>>52)&0x7ff; - if (k==0) { /* 0 or subnormal x */ + k = (hx>>52)&0x7ff; /* extract exponent */ + l = (lx>>52)&0x7ff; + if (k==0) { /* 0 or subnormal x */ - if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */ + if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */ - u.i = hx; - u.d *= two54; - hx = u.i; + u.i = hx; + u.d *= two54; + hx = u.i; @@ -61,7 +65,9 @@ - if (k > 0) { /* normal result */ - hx = (hx&0x800fffffffffffffULL)|(k<<52); - if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ + if (k > 0) { /* normal result */ + hx = (hx&0x800fffffffffffffULL)|(k<<52); + if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; - } - if (l == 0) { /* low part subnormal */ + return x; + } + if (l == 0) { /* low part subnormal */ @@ -81,14 +87,19 @@ - u.d *= twom54; - lx = u.i; - } + u.d *= twom54; + lx = u.i; + } - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; - } - if (k <= -54) - return tiny*__copysignl(tiny,x); /*underflow*/ - k += 54; /* subnormal result */ - lx &= 0x8000000000000000ULL; + return x; + } + if (k <= -54) + return tiny*__copysignl(tiny,x); /*underflow*/ + k += 54; /* subnormal result */ + lx &= 0x8000000000000000ULL; - SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx); + hx &= 0x800fffffffffffffULL; + INSERT_WORDS64 (xhi, hx|(k<<52)); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x*twolm54; + return x*twolm54; } long_double_symbol (libm, __scalblnl, scalblnl); diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c @@ -1144,53 +1144,53 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c glibc-2.17 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c 2014-05-27 23:16:25.000000000 -0500 @@ -41,11 +41,15 @@ { - int64_t k,l,hx,lx; - union { int64_t i; double d; } u; + int64_t k,l,hx,lx; + union { int64_t i; double d; } u; - GET_LDOUBLE_WORDS64(hx,lx,x); + double xhi, xlo; + + ldbl_unpack (x, &xhi, &xlo); + EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (lx, xlo); - k = (hx>>52)&0x7ff; /* extract exponent */ - l = (lx>>52)&0x7ff; - if (k==0) { /* 0 or subnormal x */ + k = (hx>>52)&0x7ff; /* extract exponent */ + l = (lx>>52)&0x7ff; + if (k==0) { /* 0 or subnormal x */ - if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */ + if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */ - u.i = hx; - u.d *= two54; - hx = u.i; + u.i = hx; + u.d *= two54; + hx = u.i; @@ -61,7 +65,9 @@ - if (k > 0) { /* normal result */ - hx = (hx&0x800fffffffffffffULL)|(k<<52); - if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ + if (k > 0) { /* normal result */ + hx = (hx&0x800fffffffffffffULL)|(k<<52); + if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; - } - if (l == 0) { /* low part subnormal */ + return x; + } + if (l == 0) { /* low part subnormal */ @@ -81,14 +87,19 @@ - u.d *= twom54; - lx = u.i; - } + u.d *= twom54; + lx = u.i; + } - SET_LDOUBLE_WORDS64(x,hx,lx); + INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x; - } - if (k <= -54) - return tiny*__copysignl(tiny,x); /*underflow*/ - k += 54; /* subnormal result */ - lx &= 0x8000000000000000ULL; + return x; + } + if (k <= -54) + return tiny*__copysignl(tiny,x); /*underflow*/ + k += 54; /* subnormal result */ + lx &= 0x8000000000000000ULL; - SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx); + hx &= 0x800fffffffffffffULL; + INSERT_WORDS64 (xhi, hx|(k<<52)); + INSERT_WORDS64 (xlo, lx); + x = ldbl_pack (xhi, xlo); - return x*twolm54; + return x*twolm54; } #ifdef IS_IN_libm diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c @@ -1199,27 +1199,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c @@ -47,10 +47,12 @@ long double __tanhl(long double x) { - long double t,z; + long double t,z; - int64_t jx,ix,lx; + int64_t jx,ix; + double xhi; - + /* High word of |x|. */ - GET_LDOUBLE_WORDS64(jx,lx,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (jx, xhi); - ix = jx&0x7fffffffffffffffLL; - + ix = jx&0x7fffffffffffffffLL; + /* x is INF or NaN */ @@ -61,7 +63,7 @@ - + /* |x| < 22 */ - if (ix < 0x4036000000000000LL) { /* |x|<22 */ + if (ix < 0x4036000000000000LL) { /* |x|<22 */ - if ((ix | (lx&0x7fffffffffffffffLL)) == 0) + if (ix == 0) - return x; /* x == +-0 */ - if (ix<0x3c60000000000000LL) /* |x|<2**-57 */ - return x*(one+x); /* tanh(small) = small */ + return x; /* x == +-0 */ + if (ix<0x3c60000000000000LL) /* |x|<2**-57 */ + return x*(one+x); /* tanh(small) = small */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:05:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:08:26.000000000 -0500 diff --git a/SOURCES/glibc-ppc64le-09.patch b/SOURCES/glibc-ppc64le-09.patch index bcf17b4d..969d3a16 100644 --- a/SOURCES/glibc-ppc64le-09.patch +++ b/SOURCES/glibc-ppc64le-09.patch @@ -1,10 +1,10 @@ # commit 650ef4bd7976e36831cba22d838b567d3b5f6e8f # Author: Alan Modra # Date: Sat Aug 17 18:25:51 2013 +0930 -# +# # PowerPC floating point little-endian [4 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00084.html -# +# # Another batch of ieee854 macros and union replacement. These four # files also have bugs fixed with this patch. The fact that the two # doubles in an IBM long double may have different signs means that @@ -16,7 +16,7 @@ # flag. The e_hypotl.c tests for large "a" and small "b" are mutually # exclusive because we've already exited when x/y > 2**120. That allows # some further small simplifications. -# +# # [BZ #15734], [BZ #15735] # * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Rewrite # all uses of ieee875 long double macros and unions. Simplify test @@ -41,7 +41,7 @@ # (__erfcl): Likewise. # * math/libm-test.inc: Add tests for errors discovered in IBM long # double versions of fmodl, remainderl, erfl and erfcl. -# +# diff -urN glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-test.inc --- glibc-2.17-c758a686/math/libm-test.inc 2014-05-27 20:02:29.000000000 -0500 +++ glibc-2.17-c758a686/math/libm-test.inc 2014-05-27 20:09:59.000000000 -0500 @@ -53,7 +53,7 @@ diff -urN glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-t + /* The input is not exactly representable as a double. */ + TEST_f_f (erf, -0x1.fffffffffffff8p-2L, -0.5204998778130465132916303345518417673509L); +#endif - + END (erf); } @@ -4071,6 +4075,10 @@ @@ -78,7 +78,7 @@ diff -urN glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-t + TEST_ff_f (fmod, 0x1.fffffffffffffap-1L, -0x1.fffffffffffff8p-1L, 0x1p-56L); + TEST_ff_f (fmod, -0x1.fffffffffffffap-1L, -0x1.fffffffffffff8p-1L, -0x1p-56L); +#endif - + END (fmod); } @@ -8642,6 +8657,9 @@ @@ -88,7 +88,7 @@ diff -urN glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-t +#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 56 + TEST_ff_f (remainder, -0x1.80000000000002p1L, 2.0, 0x1.fffffffffffff8p-1L); +#endif - + END (remainder); } diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c @@ -115,19 +115,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c + ldbl_unpack (y, &yhi, &ylo); + EXTRACT_WORDS64 (hy, yhi); + EXTRACT_WORDS64 (ly, ylo); - sx = hx&0x8000000000000000ULL; /* sign of x */ + sx = hx&0x8000000000000000ULL; /* sign of x */ - hx ^=sx; /* |x| */ - hy &= 0x7fffffffffffffffLL; /* |y| */ + hx ^= sx; /* |x| */ + sy = hy&0x8000000000000000ULL; /* sign of y */ + hy ^= sy; /* |y| */ - + /* purge off exception values */ - if(__builtin_expect((hy|(ly&0x7fffffffffffffff))==0 || + if(__builtin_expect(hy==0 || - (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */ - (hy>0x7ff0000000000000LL),0)) /* or y is NaN */ - return (x*y)/(x*y); + (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */ + (hy>0x7ff0000000000000LL),0)) /* or y is NaN */ + return (x*y)/(x*y); - if(__builtin_expect(hx<=hy,0)) { - if((hx> 63]; - } - + } + - /* determine ix = ilogb(x) */ - if(__builtin_expect(hx<0x0010000000000000LL,0)) { /* subnormal x */ - if(hx==0) { @@ -186,7 +186,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c - ldbl_extract_mantissa(&hy, &ly, &temp, y); + ldbl_extract_mantissa(&hx, &lx, &ix, x); + ldbl_extract_mantissa(&hy, &ly, &iy, y); - + - /* set up {hx,lx}, {hy,ly} and align y to x */ - if(__builtin_expect(ix >= -1022, 1)) - hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx); @@ -233,34 +233,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c + iy -= 1; + } + } - + /* fix point fmod */ - n = ix - iy; + n = ix - iy; @@ -104,7 +111,7 @@ - hz=hx-hy;lz=lx-ly; if(lx>63); lx = lx+lx;} - else { + hz=hx-hy;lz=lx-ly; if(lx>63); lx = lx+lx;} + else { - if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */ + if((hz|lz)==0) /* return sign(x)*0 */ - return Zero[(u_int64_t)sx>>63]; - hx = hz+hz+(lz>>63); lx = lz+lz; - } + return Zero[(u_int64_t)sx>>63]; + hx = hz+hz+(lz>>63); lx = lz+lz; + } @@ -113,7 +120,7 @@ - if(hz>=0) {hx=hz;lx=lz;} - + if(hz>=0) {hx=hz;lx=lz;} + /* convert back to floating value and restore the sign */ - if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */ + if((hx|lx)==0) /* return sign(x)*0 */ - return Zero[(u_int64_t)sx>>63]; - while(hx<0x0001000000000000LL) { /* normalize x */ - hx = hx+hx+(lx>>63); lx = lx+lx; + return Zero[(u_int64_t)sx>>63]; + while(hx<0x0001000000000000LL) { /* normalize x */ + hx = hx+hx+(lx>>63); lx = lx+lx; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:02:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:04:08.000000000 -0500 @@ -45,76 +45,84 @@ #include #include - + -static const long double two600 = 0x1.0p+600L; -static const long double two1022 = 0x1.0p+1022L; - @@ -269,39 +269,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- { - long double a,b,t1,t2,y1,y2,w,kld; + long double a,b,a1,a2,b1,b2,w,kld; - int64_t j,k,ha,hb; + int64_t j,k,ha,hb; + double xhi, yhi, hi, lo; - + - GET_LDOUBLE_MSW64(ha,x); + xhi = ldbl_high (x); + EXTRACT_WORDS64 (ha, xhi); + yhi = ldbl_high (y); + EXTRACT_WORDS64 (hb, yhi); - ha &= 0x7fffffffffffffffLL; + ha &= 0x7fffffffffffffffLL; - GET_LDOUBLE_MSW64(hb,y); - hb &= 0x7fffffffffffffffLL; - if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;} - a = fabsl(a); /* a <- |a| */ - b = fabsl(b); /* b <- |b| */ + hb &= 0x7fffffffffffffffLL; + if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;} + a = fabsl(a); /* a <- |a| */ + b = fabsl(b); /* b <- |b| */ - if((ha-hb)>0x780000000000000LL) {return a+b;} /* x/y > 2**120 */ + if((ha-hb)>0x0780000000000000LL) {return a+b;} /* x/y > 2**120 */ - k=0; - kld = 1.0L; - if(ha > 0x5f30000000000000LL) { /* a>2**500 */ - if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */ + k=0; + kld = 1.0L; + if(ha > 0x5f30000000000000LL) { /* a>2**500 */ + if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */ - u_int64_t low; - w = a+b; /* for sNaN */ + w = a+b; /* for sNaN */ - GET_LDOUBLE_LSW64(low,a); - if(((ha&0xfffffffffffffLL)|(low&0x7fffffffffffffffLL))==0) + if(ha == 0x7ff0000000000000LL) - w = a; + w = a; - GET_LDOUBLE_LSW64(low,b); - if(((hb^0x7ff0000000000000LL)|(low&0x7fffffffffffffffLL))==0) + if(hb == 0x7ff0000000000000LL) - w = b; - return w; - } - /* scale a and b by 2**-600 */ + w = b; + return w; + } + /* scale a and b by 2**-600 */ - ha -= 0x2580000000000000LL; hb -= 0x2580000000000000LL; k += 600; - a /= two600; - b /= two600; @@ -311,10 +311,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- + b *= 0x1p-600L; + k = 600; + kld = 0x1p+600L; - } + } - if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */ + else if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */ - if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */ + if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */ - u_int64_t low; - GET_LDOUBLE_LSW64(low,b); - if((hb|(low&0x7fffffffffffffffLL))==0) return a; @@ -328,7 +328,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- + b *= 0x1p+1022L; + k = -1022; + kld = 0x1p-1022L; - } else { /* scale a and b by 2^600 */ + } else { /* scale a and b by 2^600 */ - ha += 0x2580000000000000LL; /* a *= 2^600 */ - hb += 0x2580000000000000LL; /* b *= 2^600 */ - k -= 600; @@ -339,11 +339,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- + b *= 0x1p+600L; + k = -600; + kld = 0x1p-600L; - } - } + } + } /* medium size a and b */ - w = a-b; - if (w>b) { + w = a-b; + if (w>b) { - SET_LDOUBLE_WORDS64(t1,ha,0); - t2 = a-t1; - w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1))); @@ -357,8 +357,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- + = a1*a1 + a1*a2 + a2*a + b*b + = a1*a1 + a2*(a+a1) + b*b */ + w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1))); - } else { - a = a+a; + } else { + a = a+a; - SET_LDOUBLE_WORDS64(y1,hb,0); - y2 = b - y1; - SET_LDOUBLE_WORDS64(t1,ha+0x0010000000000000LL,0); @@ -379,18 +379,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17- + = w*w + a1*(b1+b2) + a2*b + = w*w + a1*b1 + a1*b2 + a2*b */ + w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b))); - } - if(k!=0) - return w*kld; + } + if(k!=0) + return w*kld; diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:02:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:04:08.000000000 -0500 @@ -33,18 +33,22 @@ - int64_t hx,hp; - u_int64_t sx,lx,lp; - long double p_half; + int64_t hx,hp; + u_int64_t sx,lx,lp; + long double p_half; + double xhi, xlo, phi, plo; - + - GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hp,lp,p); + ldbl_unpack (x, &xhi, &xlo); @@ -399,29 +399,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c glibc-2 + ldbl_unpack (p, &phi, &plo); + EXTRACT_WORDS64 (hp, phi); + EXTRACT_WORDS64 (lp, plo); - sx = hx&0x8000000000000000ULL; - hp &= 0x7fffffffffffffffLL; - hx &= 0x7fffffffffffffffLL; - + sx = hx&0x8000000000000000ULL; + hp &= 0x7fffffffffffffffLL; + hx &= 0x7fffffffffffffffLL; + /* purge off exception values */ - if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */ + if(hp==0) return (x*p)/(x*p); /* p = 0 */ - if((hx>=0x7ff0000000000000LL)|| /* x not finite */ + if((hx>=0x7ff0000000000000LL)|| /* x not finite */ - ((hp>=0x7ff0000000000000LL)&& /* p is NaN */ - (((hp-0x7ff0000000000000LL)|lp)!=0))) + (hp>0x7ff0000000000000LL)) /* p is NaN */ - return (x*p)/(x*p); - - + return (x*p)/(x*p); + + @@ -64,8 +68,8 @@ - if(x>=p_half) x -= p; - } - } + if(x>=p_half) x -= p; + } + } - GET_LDOUBLE_MSW64(hx,x); - SET_LDOUBLE_MSW64(x,hx^sx); + if (sx) + x = -x; - return x; + return x; } strong_alias (__ieee754_remainderl, __remainderl_finite) diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c @@ -435,33 +435,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 - ieee854_long_double_shape_type u; + int32_t i, ix, hx; + double xhi; - + - u.value = x; - sign = u.parts32.w0; - ix = sign & 0x7fffffff; + xhi = ldbl_high (x); + GET_HIGH_WORD (hx, xhi); + ix = hx & 0x7fffffff; - + if (ix >= 0x7ff00000) { /* erf(nan)=nan */ - i = ((sign & 0xfff00000) >> 31) << 1; + i = ((uint32_t) hx >> 31) << 1; return (long double) (1 - i) + one / x; /* erf(+-inf)=+-1 */ } - + @@ -778,7 +778,7 @@ if (ix >= 0x4039A0DE) - { - /* __erfcl (x) underflows if x > 25.6283 */ + { + /* __erfcl (x) underflows if x > 25.6283 */ - if (sign) + if ((hx & 0x80000000) == 0) - return one-tiny; - else - return tiny-one; + return one-tiny; + else + return tiny-one; @@ -789,8 +789,9 @@ - return (one - y); - } + return (one - y); + } } - u.parts32.w0 = ix; - a = u.value; @@ -474,7 +474,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 @@ -814,7 +815,7 @@ y = erf_const + neval (a, TN2, NTN2) / deval (a, TD2, NTD2); } - + - if (sign & 0x80000000) /* x < 0 */ + if (hx & 0x80000000) /* x < 0 */ y = -y; @@ -498,14 +498,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 + xhi = ldbl_high (x); + GET_HIGH_WORD (hx, xhi); + ix = hx & 0x7fffffff; - + if (ix >= 0x7ff00000) { /* erfc(nan)=nan */ /* erfc(+-inf)=0,2 */ - return (long double) (((u_int32_t) sign >> 31) << 1) + one / x; + return (long double) ((hx >> 31) << 1) + one / x; } - + if (ix < 0x3fd00000) /* |x| <1/4 */ @@ -846,7 +847,8 @@ } @@ -516,14 +516,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 + x = -x; i = 8.0 * x; switch (i) - { + { @@ -891,7 +893,7 @@ - y += C20a; - break; - } + y += C20a; + break; + } - if (sign & 0x80000000) + if (hx & 0x80000000) - y = 2.0L - y; + y = 2.0L - y; return y; } @@ -899,10 +901,11 @@ @@ -532,8 +532,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 /* x < -9 */ - if ((ix >= 0x40220000) && (sign & 0x80000000)) + if (hx >= 0xc0220000) - return two - tiny; - + return two - tiny; + - x = fabsl (x); + if ((hx & 0x80000000) != 0) + x = -x; @@ -541,9 +541,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 i = 8.0 / x; switch (i) @@ -933,21 +936,17 @@ - p = neval (z, RNr8, NRNr8) / deval (z, RDr8, NRDr8); - break; - } + p = neval (z, RNr8, NRNr8) / deval (z, RDr8, NRDr8); + break; + } - u.value = x; - u.parts32.w3 = 0; - u.parts32.w2 = 0; @@ -551,17 +551,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7 - z = u.value; + z = (float) x; r = __ieee754_expl (-z * z - 0.5625) * - __ieee754_expl ((z - x) * (z + x) + p); + __ieee754_expl ((z - x) * (z + x) + p); - if ((sign & 0x80000000) == 0) + if ((hx & 0x80000000) == 0) - return r / x; + return r / x; else - return two - r / x; + return two - r / x; } else { - if ((sign & 0x80000000) == 0) + if ((hx & 0x80000000) == 0) - return tiny * tiny; + return tiny * tiny; else - return two - tiny; + return two - tiny; diff --git a/SOURCES/glibc-ppc64le-10.patch b/SOURCES/glibc-ppc64le-10.patch index ac82dd73..ae80fe6c 100644 --- a/SOURCES/glibc-ppc64le-10.patch +++ b/SOURCES/glibc-ppc64le-10.patch @@ -1,25 +1,25 @@ # commit 32c301dfc9b786453e59b61fe4a821a89e1a206b # Author: Alan Modra # Date: Sat Aug 17 18:26:39 2013 +0930 -# +# # PowerPC floating point little-endian [5 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00085.html -# +# # Rid ourselves of ieee854. -# +# # * sysdeps/ieee754/ldbl-128ibm/ieee754.h (union ieee854_long_double): # Delete. # (IEEE854_LONG_DOUBLE_BIAS): Delete. # * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Don't include ieee854 # version of math_ldbl.h. -# +# diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h 2014-05-27 22:10:43.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h 2014-05-27 22:11:10.000000000 -0500 @@ -112,61 +112,6 @@ #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - - + + -union ieee854_long_double - { - long double d; @@ -76,7 +76,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h glibc-2.17-c - - /* IBM extended format for long double. - + Each long double is made up of two IEEE doubles. The value of the diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 22:10:43.000000000 -0500 @@ -84,8 +84,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17 @@ -2,7 +2,6 @@ #error "Never use directly; include instead." #endif - + -#include #include - + static inline void diff --git a/SOURCES/glibc-ppc64le-11.patch b/SOURCES/glibc-ppc64le-11.patch index ae68a41f..ec127974 100644 --- a/SOURCES/glibc-ppc64le-11.patch +++ b/SOURCES/glibc-ppc64le-11.patch @@ -1,12 +1,12 @@ # commit 62a728aeff93507ce5975f245a5f1d2046fb4503 # Author: Alan Modra # Date: Sat Aug 17 18:27:19 2013 +0930 -# +# # PowerPC floating point little-endian [6 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00197.html -# +# # A rewrite to make this code correct for little-endian. -# +# # * sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (mynumber): Replace # union 32-bit int array member with 64-bit int array. # (t515, tm256): Double rather than long double. @@ -16,13 +16,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c 2014-05-27 22:20:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c 2014-05-27 22:21:39.000000000 -0500 @@ -34,15 +34,13 @@ - + #include - + -typedef unsigned int int4; -typedef union {int4 i[4]; long double x; double d[2]; } mynumber; +typedef union {int64_t i[2]; long double x; double d[2]; } mynumber; - + -static const mynumber - t512 = {{0x5ff00000, 0x00000000, 0x00000000, 0x00000000 }}, /* 2^512 */ - tm256 = {{0x2ff00000, 0x00000000, 0x00000000, 0x00000000 }}; /* 2^-256 */ @@ -33,7 +33,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c + tm256 = 0x1p-256, + two54 = 0x1p54, /* 0x4350000000000000 */ + twom54 = 0x1p-54; /* 0x3C90000000000000 */ - + /*********************************************************************/ /* An ultimate sqrt routine. Given an IEEE double machine number x */ @@ -54,56 +52,53 @@ @@ -45,7 +45,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c + uint64_t k, l; + int64_t m, n; double d; - + a.x=x; - k=a.i[0] & 0x7fffffff; + k=a.i[0] & INT64_C(0x7fffffffffffffff); @@ -62,7 +62,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c + n = (int64_t) ((l - k) * 2) >> 53; + m = (a.i[1] >> 52) & 0x7ff; if (m == 0) { - a.d[1] *= two54; + a.d[1] *= two54; - m = ((a.i[2] >> 20) & 0x7ff) - 54; + m = ((a.i[1] >> 52) & 0x7ff) - 54; } @@ -77,10 +77,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c + else if (m <= -54) { + a.i[1] &= INT64_C(0x8000000000000000); } else { - m += 54; + m += 54; - a.i[2] = (a.i[2] & 0x800fffff) | (m << 20); + a.i[1] = (a.i[1] & INT64_C(0x800fffffffffffff)) | (m << 52); - a.d[1] *= twom54; + a.d[1] *= twom54; } } a.i[0] = l; @@ -101,7 +101,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c - if (a.i[0] == 0xfff00000 && a.i[1] == 0) + if (k>=INT64_C(0x7ff0000000000000)) { + if (a.i[0] == INT64_C(0xfff0000000000000)) - return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */ + return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */ return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */ } if (x == 0) return x; diff --git a/SOURCES/glibc-ppc64le-12.patch b/SOURCES/glibc-ppc64le-12.patch index 89e38066..5e2d3783 100644 --- a/SOURCES/glibc-ppc64le-12.patch +++ b/SOURCES/glibc-ppc64le-12.patch @@ -1,16 +1,16 @@ # commit 2ca85d2bbbaa60b9c83bf1f57a2801c84e0a3625 # Author: Anton Blanchard # Date: Sat Aug 17 18:28:06 2013 +0930 -# +# # PowerPC floating point little-endian [7 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00086.html -# +# # * sysdeps/powerpc/bits/mathinline.h (__signbitf): Use builtin. # (__signbit): Likewise. Correct for little-endian. # (__signbitl): Call __signbit. # (lrint): Correct for little-endian. # (lrintf): Call lrint. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h 2014-05-27 22:28:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h 2014-05-27 22:28:37.000000000 -0500 @@ -58,7 +58,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h glibc-2.17-c - return __u.__ll[1]; + return __u.__ll; } - + __MATH_INLINE long int lrintf (float __x) __THROW; __MATH_INLINE long int __NTH (lrintf (float __x)) @@ -72,3 +72,4 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h glibc-2.17-c + return lrint ((double) __x); } # endif + diff --git a/SOURCES/glibc-ppc64le-13.patch b/SOURCES/glibc-ppc64le-13.patch index 1cc101f2..52830a18 100644 --- a/SOURCES/glibc-ppc64le-13.patch +++ b/SOURCES/glibc-ppc64le-13.patch @@ -1,12 +1,12 @@ # commit 4a28b3ca4bc52d9a3ac0d9edb53d3de510e1b77c # Author: Anton Blanchard # Date: Sat Aug 17 18:28:55 2013 +0930 -# +# # PowerPC floating point little-endian [8 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00199.html -# +# # Corrects floating-point environment code for little-endian. -# +# # * sysdeps/powerpc/fpu/fenv_libc.h (fenv_union_t): Replace int # array with long long. # * sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Adjust. @@ -22,50 +22,50 @@ # * sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Adjust. # * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Adjust. # * sysdeps/powerpc/fpu/ftestexcept.c (fetestexcept): Adjust. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrt.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrt.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrt.c 2014-05-27 22:31:43.000000000 -0500 @@ -145,7 +145,7 @@ feraiseexcept (FE_INVALID_SQRT); - + fenv_union_t u = { .fenv = fegetenv_register () }; - if ((u.l[1] & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0) #endif - feraiseexcept (FE_INVALID); + feraiseexcept (FE_INVALID); x = a_nan.value; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c 2014-05-27 22:31:43.000000000 -0500 @@ -121,7 +121,7 @@ feraiseexcept (FE_INVALID_SQRT); - + fenv_union_t u = { .fenv = fegetenv_register () }; - if ((u.l[1] & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0) #endif - feraiseexcept (FE_INVALID); + feraiseexcept (FE_INVALID); x = a_nan.value; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c 2014-05-27 22:31:43.000000000 -0500 @@ -28,8 +28,8 @@ u.fenv = fegetenv_register (); - + /* Clear the relevant bits. */ - u.l[1] = u.l[1] & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID) - | (excepts & FPSCR_STICKY_BITS)); + u.l = u.l & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID) + | (excepts & FPSCR_STICKY_BITS)); - + /* Put the new state in effect. */ fesetenv_register (u.fenv); diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fedisblxcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fedisblxcpt.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fedisblxcpt.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fedisblxcpt.c 2014-05-27 22:31:43.000000000 -0500 @@ -32,15 +32,15 @@ - + fe.fenv = fegetenv_register (); if (excepts & FE_INEXACT) - fe.l[1] &= ~(1 << (31 - FPSCR_XE)); @@ -83,13 +83,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fedisblxcpt.c glibc-2.17-c758a - fe.l[1] &= ~(1 << (31 - FPSCR_VE)); + fe.l &= ~(1 << (31 - FPSCR_VE)); fesetenv_register (fe.fenv); - + new = __fegetexcept (); diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feenablxcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/feenablxcpt.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/feenablxcpt.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/feenablxcpt.c 2014-05-27 22:31:43.000000000 -0500 @@ -32,15 +32,15 @@ - + fe.fenv = fegetenv_register (); if (excepts & FE_INEXACT) - fe.l[1] |= (1 << (31 - FPSCR_XE)); @@ -107,15 +107,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feenablxcpt.c glibc-2.17-c758a - fe.l[1] |= (1 << (31 - FPSCR_VE)); + fe.l |= (1 << (31 - FPSCR_VE)); fesetenv_register (fe.fenv); - + new = __fegetexcept (); diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fegetexcept.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fegetexcept.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fegetexcept.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fegetexcept.c 2014-05-27 22:31:43.000000000 -0500 @@ -27,15 +27,15 @@ - + fe.fenv = fegetenv_register (); - + - if (fe.l[1] & (1 << (31 - FPSCR_XE))) + if (fe.l & (1 << (31 - FPSCR_XE))) result |= FE_INEXACT; @@ -131,26 +131,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fegetexcept.c glibc-2.17-c758a - if (fe.l[1] & (1 << (31 - FPSCR_VE))) + if (fe.l & (1 << (31 - FPSCR_VE))) result |= FE_INVALID; - + return result; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feholdexcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/feholdexcpt.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/feholdexcpt.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/feholdexcpt.c 2014-05-27 22:33:09.000000000 -0500 @@ -30,13 +30,12 @@ - + /* Clear everything except for the rounding modes and non-IEEE arithmetic flag. */ - new.l[1] = old.l[1] & 7; - new.l[0] = old.l[0]; + new.l = old.l & 0xffffffff00000007LL; - + /* If the old env had any eabled exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the FPU to run faster because it always takes the default action and can not generate SIGFPE. */ - if ((old.l[1] & _FPU_MASK_ALL) != 0) + if ((old.l & _FPU_MASK_ALL) != 0) (void)__fe_mask_env (); - + /* Put the new state in effect. */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fenv_libc.h glibc-2.17-c758a686/sysdeps/powerpc/fpu/fenv_libc.h --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fenv_libc.h 2014-05-27 22:31:42.000000000 -0500 @@ -162,8 +162,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fenv_libc.h glibc-2.17-c758a68 - unsigned int l[2]; + unsigned long long l; } fenv_union_t; - - + + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fesetenv.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fesetenv.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fesetenv.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fesetenv.c 2014-05-27 22:35:18.000000000 -0500 @@ -174,15 +174,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fesetenv.c glibc-2.17-c758a686 - if ((old.l[1] & _FPU_MASK_ALL) == 0 && (new.l[1] & _FPU_MASK_ALL) != 0) + if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0) (void)__fe_nomask_env (); - + /* If the old env had any enabled exceptions and the new env has no enabled exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the - FPU to run faster because it always takes the default action and can not + FPU to run faster because it always takes the default action and can not generate SIGFPE. */ - if ((old.l[1] & _FPU_MASK_ALL) != 0 && (new.l[1] & _FPU_MASK_ALL) == 0) + if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0) (void)__fe_mask_env (); - + fesetenv_register (*envp); diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feupdateenv.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/feupdateenv.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/feupdateenv.c 2014-05-27 22:31:42.000000000 -0500 @@ -193,7 +193,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feupdateenv.c glibc-2.17-c758a unchanged. */ - new.l[1] = (old.l[1] & 0x1FFFFF00) | (new.l[1] & 0x1FF80FFF); + new.l = (old.l & 0xffffffff1fffff00LL) | (new.l & 0x1ff80fff); - + /* If the old env has no eabled exceptions and the new env has any enabled exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits. This will put the hardware into "precise mode" and may cause the FPU to run slower on @@ -201,26 +201,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/feupdateenv.c glibc-2.17-c758a - if ((old.l[1] & _FPU_MASK_ALL) == 0 && (new.l[1] & _FPU_MASK_ALL) != 0) + if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0) (void)__fe_nomask_env (); - + /* If the old env had any eabled exceptions and the new env has no enabled exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the - FPU to run faster because it always takes the default action and can not + FPU to run faster because it always takes the default action and can not generate SIGFPE. */ - if ((old.l[1] & _FPU_MASK_ALL) != 0 && (new.l[1] & _FPU_MASK_ALL) == 0) + if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0) (void)__fe_mask_env (); - + /* Atomically enable and raise (if appropriate) exceptions set in `new'. */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fgetexcptflg.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fgetexcptflg.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fgetexcptflg.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fgetexcptflg.c 2014-05-27 22:31:43.000000000 -0500 @@ -28,7 +28,7 @@ u.fenv = fegetenv_register (); - + /* Return (all of) it. */ - *flagp = u.l[1] & excepts & FE_ALL_EXCEPT; + *flagp = u.l & excepts & FE_ALL_EXCEPT; - + /* Success. */ return 0; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c @@ -228,7 +228,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c glibc-2.17-c758a +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c 2014-05-27 22:31:43.000000000 -0500 @@ -34,11 +34,11 @@ u.fenv = fegetenv_register (); - + /* Add the exceptions */ - u.l[1] = (u.l[1] - | (excepts & FPSCR_STICKY_BITS) @@ -240,24 +240,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c glibc-2.17-c758a + /* Turn FE_INVALID into FE_INVALID_SOFTWARE. */ + | (excepts >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT)) + & FE_INVALID_SOFTWARE)); - + /* Store the new status word (along with the rest of the environment), triggering any appropriate exceptions. */ @@ -50,7 +50,7 @@ - don't have FE_INVALID_SOFTWARE implemented. Detect this - case and raise FE_INVALID_SNAN instead. */ + don't have FE_INVALID_SOFTWARE implemented. Detect this + case and raise FE_INVALID_SNAN instead. */ u.fenv = fegetenv_register (); - if ((u.l[1] & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0) - set_fpscr_bit (FPSCR_VXSNAN); + set_fpscr_bit (FPSCR_VXSNAN); } - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c 2014-05-27 22:31:43.000000000 -0500 @@ -32,10 +32,10 @@ flag = *flagp & excepts; - + /* Replace the exception status */ - u.l[1] = ((u.l[1] & ~(FPSCR_STICKY_BITS & excepts)) - | (flag & FPSCR_STICKY_BITS) @@ -267,14 +267,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c glibc-2.17-c758 + | (flag & FPSCR_STICKY_BITS) + | (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT)) + & FE_INVALID_SOFTWARE)); - + /* Store the new status word (along with the rest of the environment). This may cause floating-point exceptions if the restored state diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/ftestexcept.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/ftestexcept.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/ftestexcept.c 2014-05-27 22:31:42.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/ftestexcept.c 2014-05-27 22:31:43.000000000 -0500 @@ -28,6 +28,6 @@ - + /* The FE_INVALID bit is dealt with correctly by the hardware, so we can just: */ - return u.l[1] & excepts; diff --git a/SOURCES/glibc-ppc64le-14.patch b/SOURCES/glibc-ppc64le-14.patch index 843ec216..9025fd7f 100644 --- a/SOURCES/glibc-ppc64le-14.patch +++ b/SOURCES/glibc-ppc64le-14.patch @@ -1,26 +1,26 @@ # commit 603e84104cdc709c8e7dcbac54b9a585bf8dff78 # Author: Alan Modra # Date: Sat Aug 17 18:29:43 2013 +0930 -# +# # PowerPC floating point little-endian [9 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00200.html -# +# # This works around the fact that vsx is disabled in current # little-endian gcc. Also, float constants take 4 bytes in memory # vs. 16 bytes for vector constants, and we don't need to write one lot # of masks for double (register format) and another for float (mem # format). -# +# # * sysdeps/powerpc/fpu/s_float_bitwise.h (__float_and_test28): Don't # use vector int constants. # (__float_and_test24, __float_and8, __float_get_exp): Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h 2014-05-27 22:37:18.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h 2014-05-27 22:37:20.000000000 -0500 @@ -23,18 +23,19 @@ #include - + /* Returns (int)(num & 0x7FFFFFF0 == value) */ -static inline -int __float_and_test28 (float num, float value) @@ -47,7 +47,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h glibc-2.17-c int32_t inum; @@ -46,16 +47,17 @@ } - + /* Returns (int)(num & 0x7FFFFF00 == value) */ -static inline -int __float_and_test24 (float num, float value) @@ -71,7 +71,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h glibc-2.17-c int32_t inum; @@ -67,16 +69,17 @@ } - + /* Returns (float)(num & 0x7F800000) */ -static inline -float __float_and8 (float num) @@ -95,7 +95,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h glibc-2.17-c int32_t inum; @@ -88,17 +91,18 @@ } - + /* Returns ((int32_t)(num & 0x7F800000) >> 23) */ -static inline -int32_t __float_get_exp (float num) diff --git a/SOURCES/glibc-ppc64le-15.patch b/SOURCES/glibc-ppc64le-15.patch index fbf68d02..29b3b54f 100644 --- a/SOURCES/glibc-ppc64le-15.patch +++ b/SOURCES/glibc-ppc64le-15.patch @@ -1,10 +1,10 @@ # commit da13146da10360436941e843834c90a9aef5fd7a # Author: Alan Modra # Date: Sat Aug 17 18:30:23 2013 +0930 -# +# # PowerPC floating point little-endian [10 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00201.html -# +# # These two functions oddly test x+1>0 when a double x is >= 0.0, and # similarly when x is negative. I don't see the point of that since the # test should always be true. I also don't see any need to convert x+1 @@ -12,21 +12,21 @@ # allows these functions to return any value when the input is outside # the range of long long, but it's not too hard to prevent xr+1 # overflowing so that's what I've done. -# +# # (With rounding mode FE_UPWARD, x+1 can be a lot more than what you # might naively expect, but perhaps that situation was covered by the # x - xrf < 1.0 test.) -# +# # * sysdeps/powerpc/fpu/s_llround.c (__llround): Rewrite. # * sysdeps/powerpc/fpu/s_llroundf.c (__llroundf): Rewrite. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c 2014-05-27 22:38:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c 2014-05-27 22:38:58.000000000 -0500 @@ -19,29 +19,28 @@ #include #include - + -/* I think that what this routine is supposed to do is round a value - to the nearest integer, with values exactly on the boundary rounded - away from zero. */ @@ -36,7 +36,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c glibc-2.17-c758a68 + rounded away from zero, regardless of the current rounding mode. + If (long long)x, when x is out of range of a long long, clips at + LLONG_MAX or LLONG_MIN, then this implementation also clips. */ - + long long int __llround (double x) { @@ -73,9 +73,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llroundf.c glibc-2.17-c758a6 --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llroundf.c 2014-05-27 22:38:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llroundf.c 2014-05-27 22:38:58.000000000 -0500 @@ -18,28 +18,27 @@ - + #include - + -/* I think that what this routine is supposed to do is round a value - to the nearest integer, with values exactly on the boundary rounded - away from zero. */ @@ -85,7 +85,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llroundf.c glibc-2.17-c758a6 + rounded away from zero, regardless of the current rounding mode. + If (long long)x, when x is out of range of a long long, clips at + LLONG_MAX or LLONG_MIN, then this implementation also clips. */ - + long long int __llroundf (float x) { diff --git a/SOURCES/glibc-ppc64le-16.patch b/SOURCES/glibc-ppc64le-16.patch index 24918f66..0da08651 100644 --- a/SOURCES/glibc-ppc64le-16.patch +++ b/SOURCES/glibc-ppc64le-16.patch @@ -1,28 +1,28 @@ # commit 9c008155b7d5d1bd81d909497850a2ece28aec50 # Author: Alan Modra # Date: Sat Aug 17 18:31:05 2013 +0930 -# +# # PowerPC floating point little-endian [11 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00202.html -# +# # Another little-endian fix. -# +# # * sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Rewrite using # 64-bit int/double union. # (_FPU_SETCW): Likewise. # * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_GET_DI_FPSCR): Likewise. # (_SET_DI_FPSCR, _GET_SI_FPSCR, _SET_SI_FPSCR): Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fpu_control.h glibc-2.17-c758a686/sysdeps/powerpc/fpu/fpu_control.h --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fpu_control.h 2014-05-27 22:40:18.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/fpu_control.h 2014-05-27 22:43:40.000000000 -0500 @@ -45,22 +45,26 @@ #define _FPU_IEEE 0x000000f0 - + /* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int fpu_control_t; - + /* Macros for accessing the hardware control word. */ -#define _FPU_GETCW(__cw) ( { \ - union { double d; fpu_control_t cw[2]; } \ @@ -54,7 +54,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fpu_control.h glibc-2.17-c758a + __fr = __u.__d; \ + __asm__ ("mtfsf 255,%0" : : "f" (__fr)); \ + } - + /* Default control word set at startup. */ extern fpu_control_t __fpu_control; diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c @@ -63,15 +63,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c glibc-2 @@ -83,7 +83,7 @@ return 0; } - + -typedef unsigned long long di_fpscr_t __attribute__ ((__mode__ (__DI__))); +typedef unsigned int di_fpscr_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__))); - + #define _FPSCR_RESERVED 0xfffffff8ffffff04ULL @@ -95,50 +95,51 @@ #define _FPSCR_TEST1_RN 0x0000000000000002ULL - + /* Macros for accessing the hardware control word on Power6[x]. */ -# define _GET_DI_FPSCR(__fpscr) ({ \ - union { double d; \ @@ -88,7 +88,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c glibc-2 + (__fpscr) = u.fpscr; \ + u.fpscr; \ + }) - + -/* We make sure to zero fp0 after we use it in order to prevent stale data +/* We make sure to zero fp after we use it in order to prevent stale data in an fp register from making a test-case pass erroneously. */ @@ -134,7 +134,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c glibc-2 + (__fpscr) = (si_fpscr_t) u.fpscr; \ + (si_fpscr_t) u.fpscr; \ + }) - + -/* We make sure to zero fp0 after we use it in order to prevent stale data +/* We make sure to zero fp after we use it in order to prevent stale data in an fp register from making a test-case pass erroneously. */ @@ -158,6 +158,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c glibc-2 + __asm__ ("mtfsf 255,%0" : : "f" (fr)); \ + fr = 0.0; \ + } - + void prime_special_regs(int which) { diff --git a/SOURCES/glibc-ppc64le-17.patch b/SOURCES/glibc-ppc64le-17.patch index a42eab07..5ed69a9c 100644 --- a/SOURCES/glibc-ppc64le-17.patch +++ b/SOURCES/glibc-ppc64le-17.patch @@ -1,12 +1,12 @@ # commit 7b88401f3b25325b1381798a0eccb3efe7751fec # Author: Alan Modra # Date: Sat Aug 17 18:31:45 2013 +0930 -# +# # PowerPC floating point little-endian [12 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00087.html -# +# # Fixes for little-endian in 32-bit assembly. -# +# # * sysdeps/powerpc/sysdep.h (LOWORD, HIWORD, HISHORT): Define. # * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Load little-endian # words of double from correct stack offsets. @@ -27,271 +27,271 @@ # * sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise. # * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Use HISHORT. # * sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:46.000000000 -0500 @@ -29,7 +29,7 @@ - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) - stfd fp2,8(r1) + stwu r1,-16(r1) + cfi_adjust_cfa_offset (16) + stfd fp2,8(r1) - lwz r3,8(r1) + lwz r3,8+HIWORD(r1) - cmpwi r3,0 - addi r1,r1,16 - cfi_adjust_cfa_offset (-16) + cmpwi r3,0 + addi r1,r1,16 + cfi_adjust_cfa_offset (-16) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:46.000000000 -0500 @@ -30,7 +30,7 @@ - fmr fp0,fp1 - fabs fp1,fp1 - fcmpu cr7,fp0,fp1 + fmr fp0,fp1 + fabs fp1,fp1 + fcmpu cr7,fp0,fp1 - lwz r3,8(r1) + lwz r3,8+HIWORD(r1) - cmpwi cr6,r3,0 - addi r1,r1,16 - cfi_adjust_cfa_offset (-16) + cmpwi cr6,r3,0 + addi r1,r1,16 + cfi_adjust_cfa_offset (-16) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:46.000000000 -0500 @@ -24,10 +24,10 @@ - stwu r1,-16(r1) - fctiw fp13,fp1 - stfd fp13,8(r1) + stwu r1,-16(r1) + fctiw fp13,fp1 + stfd fp13,8(r1) - nop /* Insure the following load is in a different dispatch group */ + nop /* Ensure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop + nop /* to avoid pipe stall on POWER4&5. */ + nop - lwz r3,12(r1) + lwz r3,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__lrint) + addi r1,r1,16 + blr + END (__lrint) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500 @@ -67,7 +67,7 @@ - nop /* Ensure the following load is in a different dispatch */ - nop /* group to avoid pipe stall on POWER4&5. */ - nop + nop /* Ensure the following load is in a different dispatch */ + nop /* group to avoid pipe stall on POWER4&5. */ + nop - lwz r3,12(r1) /* Load return as integer. */ + lwz r3,8+LOWORD(r1) /* Load return as integer. */ .Lout: - addi r1,r1,16 - blr + addi r1,r1,16 + blr diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:48:09.000000000 -0500 @@ -29,8 +29,8 @@ - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop + nop /* Insure the following load is in a different dispatch group */ + nop /* to avoid pipe stall on POWER4&5. */ + nop - lwz r3,8(r1) - lwz r4,12(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llrint) + addi r1,r1,16 + blr + END (__llrint) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:48:44.000000000 -0500 @@ -28,8 +28,8 @@ - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop + nop /* Insure the following load is in a different dispatch group */ + nop /* to avoid pipe stall on POWER4&5. */ + nop - lwz r3,8(r1) - lwz r4,12(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llrintf) + addi r1,r1,16 + blr + END (__llrintf) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 @@ -27,8 +27,8 @@ - ori r1,r1,0 - stfd fp1,24(r1) /* copy FPR to GPR */ - ori r1,r1,0 + ori r1,r1,0 + stfd fp1,24(r1) /* copy FPR to GPR */ + ori r1,r1,0 - lwz r4,24(r1) - lwz r5,28(r1) + lwz r4,24+HIWORD(r1) + lwz r5,24+LOWORD(r1) - lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ + lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ + clrlwi r4,r4,1 /* x = fabs(x) */ + cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500 @@ -39,8 +39,8 @@ - nop /* Ensure the following load is in a different dispatch */ - nop /* group to avoid pipe stall on POWER4&5. */ - nop + nop /* Ensure the following load is in a different dispatch */ + nop /* group to avoid pipe stall on POWER4&5. */ + nop - lwz r4,12(r1) - lwz r3,8(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llround) + addi r1,r1,16 + blr + END (__llround) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500 @@ -38,7 +38,7 @@ - nop /* Ensure the following load is in a different dispatch */ - nop /* group to avoid pipe stall on POWER4&5. */ - nop + nop /* Ensure the following load is in a different dispatch */ + nop /* group to avoid pipe stall on POWER4&5. */ + nop - lwz r3,12(r1) + lwz r3,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__lround) + addi r1,r1,16 + blr + END (__lround) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 @@ -27,8 +27,8 @@ - ori r1,r1,0 - stfd fp1,24(r1) /* copy FPR to GPR */ - ori r1,r1,0 + ori r1,r1,0 + stfd fp1,24(r1) /* copy FPR to GPR */ + ori r1,r1,0 - lwz r4,24(r1) - lwz r5,28(r1) + lwz r4,24+HIWORD(r1) + lwz r5,24+LOWORD(r1) - lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ + lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ + clrlwi r4,r4,1 /* x = fabs(x) */ + cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:46:52.000000000 -0500 @@ -29,8 +29,8 @@ /* Insure the following load is in a different dispatch group by inserting "group ending nop". */ - ori r1,r1,0 + ori r1,r1,0 - lwz r3,8(r1) - lwz r4,12(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llrint) + addi r1,r1,16 + blr + END (__llrint) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:47:29.000000000 -0500 @@ -28,8 +28,8 @@ /* Insure the following load is in a different dispatch group by inserting "group ending nop". */ - ori r1,r1,0 + ori r1,r1,0 - lwz r3,8(r1) - lwz r4,12(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llrintf) + addi r1,r1,16 + blr + END (__llrintf) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500 @@ -39,8 +39,8 @@ /* Insure the following load is in a different dispatch group by inserting "group ending nop". */ - ori r1,r1,0 + ori r1,r1,0 - lwz r4,12(r1) - lwz r3,8(r1) + lwz r3,8+HIWORD(r1) + lwz r4,8+LOWORD(r1) - addi r1,r1,16 - blr - END (__llround) + addi r1,r1,16 + blr + END (__llround) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500 @@ -54,9 +54,8 @@ - stfd fp1,8(r1) /* Transfer FP to GPR's. */ - - ori 2,2,0 /* Force a new dispatch group. */ + stfd fp1,8(r1) /* Transfer FP to GPR's. */ + + ori 2,2,0 /* Force a new dispatch group. */ - lhz r0,8(r1) /* Fetch the upper portion of the high word of - the FP value (where the exponent and sign bits - are). */ + lhz r0,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + (biased exponent and sign bit). */ - clrlwi r0,r0,17 /* r0 = abs(r0). */ - addi r1,r1,16 /* Reset the stack pointer. */ - cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */ + clrlwi r0,r0,17 /* r0 = abs(r0). */ + addi r1,r1,16 /* Reset the stack pointer. */ + cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500 @@ -48,14 +48,13 @@ - li r3,0 - bflr 29 /* If not INF, return. */ - + li r3,0 + bflr 29 /* If not INF, return. */ + - /* Either we have -INF/+INF or a denormal. */ + /* Either we have +INF or -INF. */ - - stwu r1,-16(r1) /* Allocate stack space. */ - stfd fp1,8(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ + + stwu r1,-16(r1) /* Allocate stack space. */ + stfd fp1,8(r1) /* Transfer FP to GPR's. */ + ori 2,2,0 /* Force a new dispatch group. */ - lhz r4,8(r1) /* Fetch the upper portion of the high word of - the FP value (where the exponent and sign bits - are). */ + lhz r4,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + (biased exponent and sign bit). */ - addi r1,r1,16 /* Reset the stack pointer. */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - li r3,1 + addi r1,r1,16 /* Reset the stack pointer. */ + cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ + li r3,1 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 @@ -53,8 +53,8 @@ - stwu r1,-16(r1) /* Allocate stack space. */ - stfd fp1,8(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ + stwu r1,-16(r1) /* Allocate stack space. */ + stfd fp1,8(r1) /* Transfer FP to GPR's. */ + ori 2,2,0 /* Force a new dispatch group. */ - lwz r4,8(r1) /* Load the upper half of the FP value. */ - lwz r5,12(r1) /* Load the lower half of the FP value. */ + lwz r4,8+HIWORD(r1) /* Load the upper half of the FP value. */ + lwz r5,8+LOWORD(r1) /* Load the lower half of the FP value. */ - addi r1,r1,16 /* Reset the stack pointer. */ - lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */ - clrlwi r4,r4,1 /* r4 = abs(r4). */ + addi r1,r1,16 /* Reset the stack pointer. */ + lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */ + clrlwi r4,r4,1 /* r4 = abs(r4). */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500 @@ -39,10 +39,8 @@ - - stfd fp1,-16(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ + + stfd fp1,-16(r1) /* Transfer FP to GPR's. */ + ori 2,2,0 /* Force a new dispatch group. */ - - lhz r4,-16(r1) /* Fetch the upper portion of the high word of - the FP value (where the exponent and sign bits - are). */ + lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + (biased exponent and sign bit). */ - clrlwi r4,r4,17 /* r4 = abs(r4). */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - bltlr cr7 /* LT means finite, other non-finite. */ + clrlwi r4,r4,17 /* r4 = abs(r4). */ + cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ + bltlr cr7 /* LT means finite, other non-finite. */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500 @@ -38,9 +38,8 @@ - - stfd fp1,-16(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ + + stfd fp1,-16(r1) /* Transfer FP to GPR's. */ + ori 2,2,0 /* Force a new dispatch group. */ - lhz r4,-16(r1) /* Fetch the upper portion of the high word of - the FP value (where the exponent and sign bits - are). */ + lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + (biased exponent and sign bit). */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - li r3,1 - beqlr cr7 /* EQ means INF, otherwise -INF. */ + cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ + li r3,1 + beqlr cr7 /* EQ means INF, otherwise -INF. */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h --- glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:46.000000000 -0500 @@ -144,6 +144,21 @@ - + #define VRSAVE 256 - + +/* The 32-bit words of a 64-bit dword are at these offsets in memory. */ +#if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# define LOWORD 0 @@ -307,6 +307,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h glibc-2.17-c758a686/sysde +#else +# define HISHORT 0 +#endif - + /* This seems to always be the case on PPC. */ #define ALIGNARG(log2) log2 diff --git a/SOURCES/glibc-ppc64le-18.patch b/SOURCES/glibc-ppc64le-18.patch index 22e408ea..f5e327e0 100644 --- a/SOURCES/glibc-ppc64le-18.patch +++ b/SOURCES/glibc-ppc64le-18.patch @@ -1,44 +1,44 @@ # commit 6a31fe7f9cce72b69fce8fe499a2c6ad492c2311 # Author: Alan Modra # Date: Sat Aug 17 18:32:18 2013 +0930 -# +# # PowerPC floating point little-endian [13 of 15] # http://sourceware.org/ml/libc-alpha/2013-08/msg00088.html -# +# # * sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Increase alignment of # constants to usual value for .cst8 section, and remove redundant # high address load. # * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Use float # constant for 0x1p52. Load little-endian words of double from # correct stack offsets. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S 2014-05-27 22:50:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S 2014-05-27 22:50:13.000000000 -0500 @@ -19,7 +19,7 @@ #include - - .section .rodata.cst8,"aM",@progbits,8 + + .section .rodata.cst8,"aM",@progbits,8 - .align 2 + .align 3 .LC0: /* 2**23 */ - .long 0x4b000000 + .long 0x4b000000 .LC1: /* 0.5 */ @@ -60,7 +60,6 @@ #ifdef SHARED - lfs fp10,.LC1-.LC0(r9) + lfs fp10,.LC1-.LC0(r9) #else - lis r9,.LC1@ha - lfs fp10,.LC1@l(r9) + lfs fp10,.LC1@l(r9) #endif - ble- cr6,.L4 + ble- cr6,.L4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500 @@ -19,12 +19,10 @@ #include #include - + - .section .rodata.cst12,"aM",@progbits,12 + .section .rodata.cst8,"aM",@progbits,8 .align 3 @@ -48,34 +48,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S g - .long 0x3f000000 /* Use this for 0.5 */ + .LC0: .long (52+127)<<23 /* 0x1p+52 */ + .long (-1+127)<<23 /* 0.5 */ - - .section ".text" - + + .section ".text" + @@ -57,12 +55,12 @@ - addi r9,r9,.LC0-got_label@l - mtlr r11 - cfi_same_value (lr) + addi r9,r9,.LC0-got_label@l + mtlr r11 + cfi_same_value (lr) - lfd fp9,0(r9) - lfs fp10,8(r9) + lfs fp9,0(r9) + lfs fp10,4(r9) #else - lis r9,.LC0@ha + lis r9,.LC0@ha - lfd fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ - lfs fp10,.LC0@l+8(r9) /* Load 0.5 into fpr10. */ + lfs fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ + lfs fp10,.LC0@l+4(r9) /* Load 0.5 into fpr10. */ #endif - fabs fp2,fp1 /* Get the absolute value of x. */ - fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */ + fabs fp2,fp1 /* Get the absolute value of x. */ + fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */ @@ -80,8 +78,8 @@ - nop - nop - nop + nop + nop + nop - lwz r4,12(r1) /* Load return as integer. */ - lwz r3,8(r1) + lwz r3,8+HIWORD(r1) /* Load return as integer. */ + lwz r4,8+LOWORD(r1) .Lout: - addi r1,r1,16 - blr + addi r1,r1,16 + blr diff --git a/SOURCES/glibc-ppc64le-19.patch b/SOURCES/glibc-ppc64le-19.patch index c0c650a2..bbf72287 100644 --- a/SOURCES/glibc-ppc64le-19.patch +++ b/SOURCES/glibc-ppc64le-19.patch @@ -1,12 +1,12 @@ # commit 76a66d510a3737674563133a420f4fd22da42c1b # Author: Anton Blanchard # Date: Sat Aug 17 18:33:02 2013 +0930 -# +# # PowerPC floating point little-endian [14 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00205.html -# +# # These all wrongly specified float constants in a 64-bit word. -# +# # * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Correct float constants # for little-endian. # * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise. @@ -20,68 +20,68 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S glibc-2.17 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S 2014-05-27 22:52:18.000000000 -0500 @@ -19,8 +19,10 @@ #include - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 + .long 0x4b000000 + .long 0x0 - .section ".text" - + .section ".text" + EALIGN (__ceilf, 4, 0) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S 2014-05-27 22:52:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S 2014-05-27 22:52:18.000000000 -0500 @@ -19,8 +19,10 @@ #include - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 + .long 0x4b000000 + .long 0x0 - .section ".text" - + .section ".text" + EALIGN (__floorf, 4, 0) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S 2014-05-27 22:52:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S 2014-05-27 22:52:18.000000000 -0500 @@ -26,8 +26,10 @@ /* float [fp1] nearbyintf(float [fp1]) */ - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 + .long 0x4b000000 + .long 0x0 - .section ".text" - + .section ".text" + EALIGN (__nearbyintf, 4, 0) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S 2014-05-27 22:52:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S 2014-05-27 22:52:18.000000000 -0500 @@ -19,8 +19,10 @@ #include - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 + .long 0x4b000000 + .long 0x0 - .section ".text" - + .section ".text" + EALIGN (__rintf, 4, 0) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S 2014-05-27 22:52:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S 2014-05-27 22:52:18.000000000 -0500 @@ -19,10 +19,12 @@ #include - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 @@ -90,21 +90,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.1 - .tc FD_3f000000_0[TC],0x3f00000000000000 + .long 0x3f000000 + - .section ".text" - + .section ".text" + /* float [fp1] roundf (float x [fp1]) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S 2014-05-27 22:52:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S 2014-05-27 22:52:18.000000000 -0500 @@ -19,8 +19,10 @@ #include - - .section ".toc","aw" + + .section ".toc","aw" + .p2align 3 .LC0: /* 2**23 */ - .tc FD_4b000000_0[TC],0x4b00000000000000 + .long 0x4b000000 + .long 0x0 - .section ".text" - + .section ".text" + /* float [fp1] truncf (float x [fp1]) diff --git a/SOURCES/glibc-ppc64le-20.patch b/SOURCES/glibc-ppc64le-20.patch index 2ec0d0e5..1342f979 100644 --- a/SOURCES/glibc-ppc64le-20.patch +++ b/SOURCES/glibc-ppc64le-20.patch @@ -1,20 +1,20 @@ # commit fef13a78ea30d4c26d6bab48d731ebe864ee31b0 # Author: Alan Modra # Date: Sat Aug 17 18:33:45 2013 +0930 -# +# # PowerPC floating point little-endian [15 of 15] # http://sourceware.org/ml/libc-alpha/2013-07/msg00206.html -# +# # The union loses when little-endian. -# +# # * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_NOW): # Don't use a union to pack hi/low value. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h 2014-05-27 22:53:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h 2014-05-27 22:53:39.000000000 -0500 @@ -87,18 +87,15 @@ - + #define HP_TIMING_NOW(Var) \ do { \ - union { long long ll; long ii[2]; } _var; \ @@ -39,3 +39,5 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc + : : "cr0"); \ + Var = ((hp_timing_t) hi << 32) | lo; \ } while (0) + + diff --git a/SOURCES/glibc-ppc64le-21.patch b/SOURCES/glibc-ppc64le-21.patch index 786bd228..a945404d 100644 --- a/SOURCES/glibc-ppc64le-21.patch +++ b/SOURCES/glibc-ppc64le-21.patch @@ -1,21 +1,21 @@ # commit be1e5d311342e08ae1f8013342df27b7ded2c156 # Author: Anton Blanchard # Date: Sat Aug 17 18:34:40 2013 +0930 -# +# # PowerPC LE setjmp/longjmp # http://sourceware.org/ml/libc-alpha/2013-08/msg00089.html -# +# # Little-endian fixes for setjmp/longjmp. When writing these I noticed # the setjmp code corrupts the non volatile VMX registers when using an # unaligned buffer. Anton fixed this, and also simplified it quite a # bit. -# +# # The current code uses boilerplate for the case where we want to store # 16 bytes to an unaligned address. For that we have to do a # read/modify/write of two aligned 16 byte quantities. In our case we # are storing a bunch of back to back data (consective VMX registers), # and only the start and end of the region need the read/modify/write. -# +# # [BZ #15723] # * sysdeps/powerpc/jmpbuf-offsets.h: Comment fix. # * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Correct @@ -25,7 +25,7 @@ # * sysdeps/powerpc/powerpc64/__longjmp-common.S: Correct CR load. # * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise CR save. Don't # destroy vmx regs when saving unaligned. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/jmpbuf-offsets.h glibc-2.17-c758a686/sysdeps/powerpc/jmpbuf-offsets.h --- glibc-2.17-c758a686/sysdeps/powerpc/jmpbuf-offsets.h 2014-05-27 22:55:23.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/jmpbuf-offsets.h 2014-05-27 22:55:27.000000000 -0500 @@ -49,14 +49,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S g +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500 @@ -46,16 +46,16 @@ # endif - mtlr r6 - cfi_same_value (lr) + mtlr r6 + cfi_same_value (lr) - lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5) + lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5) # else - lwz r5,_dl_hwcap@got(r5) - mtlr r6 - cfi_same_value (lr) + lwz r5,_dl_hwcap@got(r5) + mtlr r6 + cfi_same_value (lr) - lwz r5,4(r5) + lwz r5,LOWORD(r5) # endif @@ -66,19 +66,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S g + lis r5,(_dl_hwcap+LOWORD)@ha + lwz r5,(_dl_hwcap+LOWORD)@l(r5) # endif - andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) - beq L(no_vmx) + andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) + beq L(no_vmx) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500 @@ -97,14 +97,14 @@ # else - lwz r5,_rtld_global_ro@got(r5) + lwz r5,_rtld_global_ro@got(r5) # endif - lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5) + lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5) # else - lwz r5,_dl_hwcap@got(r5) + lwz r5,_dl_hwcap@got(r5) - lwz r5,4(r5) + lwz r5,LOWORD(r5) # endif @@ -88,14 +88,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glib + lis r6,(_dl_hwcap+LOWORD)@ha + lwz r5,(_dl_hwcap+LOWORD)@l(r6) # endif - andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) - beq L(no_vmx) + andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) + beq L(no_vmx) @@ -114,44 +114,43 @@ - stw r0,((JB_VRSAVE)*4)(3) - addi r6,r5,16 - beq+ L(aligned_save_vmx) + stw r0,((JB_VRSAVE)*4)(3) + addi r6,r5,16 + beq+ L(aligned_save_vmx) + - lvsr v0,0,r5 + lvsr v0,0,r5 - vspltisb v1,-1 /* set v1 to all 1's */ - vspltisb v2,0 /* set v2 to all 0's */ - vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes on left = misalignment */ @@ -168,52 +168,52 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glib + vperm v2,v2,v2,v1 + save_misaligned_vmx(v2,v31,v0,v3,r5,r6) + - b L(no_vmx) - + b L(no_vmx) + L(aligned_save_vmx): diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:23.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500 @@ -60,7 +60,7 @@ - beq L(no_vmx) - la r5,((JB_VRS)*8)(3) - andi. r6,r5,0xf + beq L(no_vmx) + la r5,((JB_VRS)*8)(3) + andi. r6,r5,0xf - lwz r0,((JB_VRSAVE)*8)(3) + lwz r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */ - mtspr VRSAVE,r0 - beq+ L(aligned_restore_vmx) - addi r6,r5,16 + mtspr VRSAVE,r0 + beq+ L(aligned_restore_vmx) + addi r6,r5,16 @@ -156,7 +156,7 @@ - lfd fp21,((JB_FPRS+7)*8)(r3) - ld r22,((JB_GPRS+8)*8)(r3) - lfd fp22,((JB_FPRS+8)*8)(r3) + lfd fp21,((JB_FPRS+7)*8)(r3) + ld r22,((JB_GPRS+8)*8)(r3) + lfd fp22,((JB_FPRS+8)*8)(r3) - ld r0,(JB_CR*8)(r3) + lwz r0,((JB_CR*8)+4)(r3) /* 32-bit CR. */ - ld r23,((JB_GPRS+9)*8)(r3) - lfd fp23,((JB_FPRS+9)*8)(r3) - ld r24,((JB_GPRS+10)*8)(r3) + ld r23,((JB_GPRS+9)*8)(r3) + lfd fp23,((JB_FPRS+9)*8)(r3) + ld r24,((JB_GPRS+10)*8)(r3) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500 @@ -98,7 +98,7 @@ - mfcr r0 - std r16,((JB_GPRS+2)*8)(3) - stfd fp16,((JB_FPRS+2)*8)(3) + mfcr r0 + std r16,((JB_GPRS+2)*8)(3) + stfd fp16,((JB_FPRS+2)*8)(3) - std r0,(JB_CR*8)(3) + stw r0,((JB_CR*8)+4)(3) /* 32-bit CR. */ - std r17,((JB_GPRS+3)*8)(3) - stfd fp17,((JB_FPRS+3)*8)(3) - std r18,((JB_GPRS+4)*8)(3) + std r17,((JB_GPRS+3)*8)(3) + stfd fp17,((JB_FPRS+3)*8)(3) + std r18,((JB_GPRS+4)*8)(3) @@ -142,50 +142,46 @@ - la r5,((JB_VRS)*8)(3) - andi. r6,r5,0xf - mfspr r0,VRSAVE + la r5,((JB_VRS)*8)(3) + andi. r6,r5,0xf + mfspr r0,VRSAVE - stw r0,((JB_VRSAVE)*8)(3) + stw r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */ - addi r6,r5,16 - beq+ L(aligned_save_vmx) + addi r6,r5,16 + beq+ L(aligned_save_vmx) + - lvsr v0,0,r5 + lvsr v0,0,r5 - vspltisb v1,-1 /* set v1 to all 1's */ - vspltisb v2,0 /* set v2 to all 0's */ - vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes @@ -289,6 +289,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2. + vperm v2,v2,v2,v1 + save_misaligned_vmx(v2,v31,v0,v3,r5,r6) + - b L(no_vmx) - + b L(no_vmx) + L(aligned_save_vmx): diff --git a/SOURCES/glibc-ppc64le-22.patch b/SOURCES/glibc-ppc64le-22.patch index 23e4872f..12a0ff01 100644 --- a/SOURCES/glibc-ppc64le-22.patch +++ b/SOURCES/glibc-ppc64le-22.patch @@ -1,18 +1,18 @@ # commit 9b874b2f1eb2550e39d3e9c38772e64a767e9de2 # Author: Alan Modra # Date: Sat Aug 17 18:35:40 2013 +0930 -# +# # PowerPC ugly symbol versioning # http://sourceware.org/ml/libc-alpha/2013-08/msg00090.html -# +# # This patch fixes symbol versioning in setjmp/longjmp. The existing # code uses raw versions, which results in wrong symbol versioning when # you want to build glibc with a base version of 2.19 for LE. -# +# # Note that the merging the 64-bit and 32-bit versions in novmx-lonjmp.c # and pt-longjmp.c doesn't result in GLIBC_2.0 versions for 64-bit, due # to the base in shlib_versions. -# +# # * sysdeps/powerpc/longjmp.c: Use proper symbol versioning macros. # * sysdeps/powerpc/novmx-longjmp.c: Likewise. # * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise. @@ -23,14 +23,14 @@ # * sysdeps/powerpc/powerpc32/setjmp.S: Likewise. # * sysdeps/powerpc/powerpc64/setjmp.S: Likewise. # * nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Likewise. -# +# diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c --- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c 2014-05-27 23:22:12.000000000 -0500 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c 2014-05-27 23:23:44.000000000 -0500 @@ -41,13 +41,8 @@ __novmx__libc_longjmp (env, val); } - + -# if __WORDSIZE == 64 -symbol_version (__novmx_longjmp,longjmp,GLIBC_2.3); -symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.3); @@ -40,13 +40,13 @@ diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c -# endif +compat_symbol (libpthread, __novmx_longjmp, longjmp, GLIBC_2_0); +compat_symbol (libpthread, __novmx_siglongjmp, siglongjmp, GLIBC_2_0); - #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */ - + #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */ + void @@ -62,5 +57,5 @@ __libc_siglongjmp (env, val); } - + -versioned_symbol (libc, __vmx_longjmp, longjmp, GLIBC_2_3_4); -versioned_symbol (libc, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4); +versioned_symbol (libpthread, __vmx_longjmp, longjmp, GLIBC_2_3_4); @@ -55,7 +55,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c glibc-2.17-c758a686/sysd --- glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c 2014-05-27 23:22:12.000000000 -0500 @@ -56,6 +56,6 @@ - + default_symbol_version (__vmx__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE); default_symbol_version (__vmx__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE); -default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4); @@ -70,7 +70,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/novmx-longjmp.c glibc-2.17-c758a68 @@ -51,13 +51,7 @@ weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp) weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp) - + -# if __WORDSIZE == 64 -symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.3); -symbol_version (__novmxlongjmp,longjmp,GLIBC_2.3); @@ -89,17 +89,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S glibc-2.17 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -32,7 +32,7 @@ /* Build a versioned object for libc. */ - + # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) -symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.0); +compat_symbol (libc, __novmx_setjmp, _setjmp, GLIBC_2_0); - + ENTRY (BP_SYM (__novmx_setjmp)) - li r4,0 /* Set second argument to 0. */ + li r4,0 /* Set second argument to 0. */ @@ -41,7 +41,7 @@ libc_hidden_def (__novmx_setjmp) # endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */ - + -default_symbol_version (__vmx_setjmp,_setjmp,GLIBC_2.3.4) +versioned_symbol (libc, __vmx_setjmp, _setjmp, GLIBC_2_3_4) /* __GI__setjmp prototype is needed for ntpl i.e. _setjmp is defined @@ -109,14 +109,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S glibc-2.17- --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -27,7 +27,7 @@ - b __novmx__sigsetjmp@local + b __novmx__sigsetjmp@local END (__novmxsetjmp) strong_alias (__novmxsetjmp, __novmx__setjmp) -symbol_version (__novmxsetjmp, setjmp, GLIBC_2.0) +compat_symbol (libc, __novmxsetjmp, setjmp, GLIBC_2_0) - + #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) ) */ - + @@ -37,4 +37,4 @@ END (__vmxsetjmp) strong_alias (__vmxsetjmp, __vmx__setjmp) @@ -127,14 +127,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S glibc-2. --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -26,14 +26,14 @@ - + #else /* !NOT_IN_libc */ /* Build a versioned object for libc. */ -default_symbol_version (__vmx__longjmp,__longjmp,GLIBC_2.3.4); +versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4); # define __longjmp __vmx__longjmp # include "__longjmp-common.S" - + # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) # define __NO_VMX__ # undef JB_SIZE @@ -147,7 +147,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S glibc-2.17- --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -26,7 +26,7 @@ - + #else /* !NOT_IN_libc */ /* Build a versioned object for libc. */ -default_symbol_version (__vmx__sigsetjmp,__sigsetjmp,GLIBC_2.3.4) @@ -173,14 +173,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/mcount.c glibc-2.17-c758 GLIBC_PRIVATE version obsolete and add it to GLIBC_2.16 instead. */ -default_symbol_version (___mcount_internal, __mcount_internal, GLIBC_2.16); +versioned_symbol (libc, ___mcount_internal, __mcount_internal, GLIBC_2_16); - + #if SHLIB_COMPAT (libc, GLIBC_2_15, GLIBC_2_16) strong_alias (___mcount_internal, ___mcount_internal_private); diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -25,7 +25,7 @@ - + #else /* !NOT_IN_libc */ /* Build a versioned object for libc. */ -default_symbol_version (__vmx__sigsetjmp,__sigsetjmp,GLIBC_2.3.4) @@ -201,7 +201,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S glibc-2.17-c758 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S 2014-05-27 23:22:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S 2014-05-27 23:22:12.000000000 -0500 @@ -26,9 +26,9 @@ - + #else /* !NOT_IN_libc */ /* Build a versioned object for libc. */ -default_symbol_version (__vmxsetjmp, setjmp, GLIBC_2.3.4) diff --git a/SOURCES/glibc-ppc64le-23.patch b/SOURCES/glibc-ppc64le-23.patch index 6e1cb23e..00288b91 100644 --- a/SOURCES/glibc-ppc64le-23.patch +++ b/SOURCES/glibc-ppc64le-23.patch @@ -1,29 +1,29 @@ # commit 02f04a6c7fea2b474b026bbce721d8c658d71fda # Author: Alan Modra # Date: Sat Aug 17 18:36:11 2013 +0930 -# +# # PowerPC LE _dl_hwcap access # http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html -# +# # More LE support, correcting word accesses to _dl_hwcap. -# +# # * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use # HIWORD/LOWORD. # * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto. # * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto. -# +# diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S 2014-05-27 23:25:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S 2014-05-27 23:25:38.000000000 -0500 @@ -151,15 +151,15 @@ # ifdef SHARED - lwz r7,_rtld_global_ro@got(r7) - mtlr r8 + lwz r7,_rtld_global_ro@got(r7) + mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else - lwz r7,_dl_hwcap@got(r7) - mtlr r8 + lwz r7,_dl_hwcap@got(r7) + mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif @@ -33,20 +33,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getconte + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif - andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) - + andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) + diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:38.000000000 -0500 @@ -79,15 +79,15 @@ # ifdef SHARED - lwz r7,_rtld_global_ro@got(r7) - mtlr r8 + lwz r7,_rtld_global_ro@got(r7) + mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else - lwz r7,_dl_hwcap@got(r7) - mtlr r8 + lwz r7,_dl_hwcap@got(r7) + mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif @@ -56,20 +56,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setconte + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) #endif - + #ifdef __CONTEXT_ENABLE_FPRS diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S 2014-05-27 23:25:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S 2014-05-27 23:25:38.000000000 -0500 @@ -152,15 +152,15 @@ # ifdef SHARED - lwz r7,_rtld_global_ro@got(r7) - mtlr r8 + lwz r7,_rtld_global_ro@got(r7) + mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else - lwz r7,_dl_hwcap@got(r7) - mtlr r8 + lwz r7,_dl_hwcap@got(r7) + mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif @@ -79,16 +79,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcont + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif - + # ifdef __CONTEXT_ENABLE_VRS @@ -308,14 +308,14 @@ - mtlr r8 + mtlr r8 # ifdef SHARED - lwz r7,_rtld_global_ro@got(r7) + lwz r7,_rtld_global_ro@got(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else - lwz r7,_dl_hwcap@got(r7) + lwz r7,_dl_hwcap@got(r7) - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif @@ -98,5 +98,5 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcont + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif - andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) - la r10,(_UC_VREGS)(r31) + andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) + la r10,(_UC_VREGS)(r31) diff --git a/SOURCES/glibc-ppc64le-24.patch b/SOURCES/glibc-ppc64le-24.patch index 8fdc4679..5870d4f8 100644 --- a/SOURCES/glibc-ppc64le-24.patch +++ b/SOURCES/glibc-ppc64le-24.patch @@ -1,47 +1,47 @@ # commit 0b2c2ace3601d5d59cf89130b16840e7f132f7a6 # Author: Alan Modra # Date: Sat Aug 17 18:36:45 2013 +0930 -# +# # PowerPC makecontext # http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html -# +# # Use conditional form of branch and link to avoid destroying the cpu # link stack used to predict blr return addresses. -# +# # * sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use # conditional form of branch and link when obtaining pc. # * sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2014-05-28 12:25:49.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2014-05-28 12:25:51.000000000 -0500 @@ -47,7 +47,9 @@ #ifdef PIC - mflr r0 - cfi_register(lr,r0) + mflr r0 + cfi_register(lr,r0) - bl 1f + /* Use this conditional form of branch and link to avoid destroying + the cpu link stack used to predict blr return addresses. */ + bcl 20,31,1f 1: mflr r6 - addi r6,r6,L(exitcode)-1b - mtlr r0 + addi r6,r6,L(exitcode)-1b + mtlr r0 @@ -136,7 +138,9 @@ #ifdef PIC - mflr r0 - cfi_register(lr,r0) + mflr r0 + cfi_register(lr,r0) - bl 1f + /* Use this conditional form of branch and link to avoid destroying + the cpu link stack used to predict blr return addresses. */ + bcl 20,31,1f 1: mflr r6 - addi r6,r6,L(novec_exitcode)-1b - mtlr r0 + addi r6,r6,L(novec_exitcode)-1b + mtlr r0 diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:49.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:51.000000000 -0500 @@ -124,8 +124,10 @@ - + /* If the target function returns we need to do some cleanup. We use a code trick to get the address of our cleanup function into the link - register. Do not add any code between here and L(exitcode). */ @@ -50,6 +50,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecont + Use this conditional form of branch and link to avoid destroying + the cpu link stack used to predict blr return addresses. */ + bcl 20,31,L(gotexitcodeaddr); - - /* This is the helper code which gets called if a function which - is registered with 'makecontext' returns. In this case we + + /* This is the helper code which gets called if a function which + is registered with 'makecontext' returns. In this case we diff --git a/SOURCES/glibc-ppc64le-25.patch b/SOURCES/glibc-ppc64le-25.patch index 03f14e1f..144d3f3a 100644 --- a/SOURCES/glibc-ppc64le-25.patch +++ b/SOURCES/glibc-ppc64le-25.patch @@ -1,10 +1,10 @@ # commit db9b4570c5dc550074140ac1d1677077fba29a26 # Author: Alan Modra # Date: Sat Aug 17 18:40:11 2013 +0930 -# +# # PowerPC LE strlen # http://sourceware.org/ml/libc-alpha/2013-08/msg00097.html -# +# # This is the first of nine patches adding little-endian support to the # existing optimised string and memory functions. I did spend some # time with a power7 simulator looking at cycle by cycle behaviour for @@ -14,50 +14,50 @@ # loops unchanged, so I'm banking on previous authors having done a # good job on big-endian.. As with most code you stare at long enough, # I found some improvements for big-endian too. -# +# # Little-endian support for strlen. Like most of the string functions, # I leave the main word or multiple-word loops substantially unchanged, # just needing to modify the tail. -# +# # Removing the branch in the power7 functions is just a tidy. .align # produces a branch anyway. Modifying regs in the non-power7 functions # is to suit the new little-endian tail. -# +# # * sysdeps/powerpc/powerpc64/power7/strlen.S (strlen): Add little-endian # support. Don't branch over align. # * sysdeps/powerpc/powerpc32/power7/strlen.S: Likewise. # * sysdeps/powerpc/powerpc64/strlen.S (strlen): Add little-endian support. # Rearrange tmp reg use to suit. Comment. # * sysdeps/powerpc/powerpc32/strlen.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500 @@ -31,7 +31,11 @@ - li r0,0 /* Word with null chars to use with cmpb. */ - li r5,-1 /* MASK = 0xffffffffffffffff. */ - lwz r12,0(r4) /* Load word from memory. */ + li r0,0 /* Word with null chars to use with cmpb. */ + li r5,-1 /* MASK = 0xffffffffffffffff. */ + lwz r12,0(r4) /* Load word from memory. */ +#ifdef __LITTLE_ENDIAN__ + slw r5,r5,r6 +#else - srw r5,r5,r6 /* MASK = MASK >> padding. */ + srw r5,r5,r6 /* MASK = MASK >> padding. */ +#endif - orc r9,r12,r5 /* Mask bits that are not part of the string. */ - cmpb r10,r9,r0 /* Check for null bytes in WORD1. */ - cmpwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ + orc r9,r12,r5 /* Mask bits that are not part of the string. */ + cmpb r10,r9,r0 /* Check for null bytes in WORD1. */ + cmpwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ @@ -49,9 +53,6 @@ - cmpb r10,r12,r0 - cmpwi cr7,r10,0 - bne cr7,L(done) + cmpb r10,r12,r0 + cmpwi cr7,r10,0 + bne cr7,L(done) - b L(loop) /* We branch here (rather than falling through) - to skip the nops due to heavy alignment - of the loop below. */ - - /* Main loop to look for the end of the string. Since it's a - small loop (< 8 instructions), align it to 32-bytes. */ + + /* Main loop to look for the end of the string. Since it's a + small loop (< 8 instructions), align it to 32-bytes. */ @@ -88,9 +89,15 @@ - 0xff in the same position as the null byte in the original - word from the string. Use that to calculate the length. */ + 0xff in the same position as the null byte in the original + word from the string. Use that to calculate the length. */ L(done): - cntlzw r0,r10 /* Count leading zeroes before the match. */ +#ifdef __LITTLE_ENDIAN__ @@ -67,11 +67,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S glibc-2. +#else + cntlzw r0,r10 /* Count leading zeros before the match. */ +#endif - subf r5,r3,r4 + subf r5,r3,r4 - srwi r0,r0,3 /* Convert leading zeroes to bytes. */ + srwi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r5,r0 /* Compute final length. */ - blr + add r3,r5,r0 /* Compute final length. */ + blr END (BP_SYM (strlen)) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S 2014-05-28 12:28:44.000000000 -0500 @@ -87,13 +87,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758 + of no consequence since the least significant match is the one + we're interested in, but big-endian needs method 2 to find which + byte matches. - + 2) Given a word 'x', we can test to see _which_ byte was zero by calculating ~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f). @@ -74,7 +79,7 @@ - + ENTRY (BP_SYM (strlen)) - + -#define rTMP1 r0 +#define rTMP4 r0 #define rRTN r3 /* incoming STR arg, outgoing result */ @@ -109,13 +109,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758 +#define rTMP1 r10 +#define rTMP2 r11 +#define rTMP3 r12 - - CHECK_BOUNDS_LOW (rRTN, rTMP1, rTMP2) - + + CHECK_BOUNDS_LOW (rRTN, rTMP1, rTMP2) + @@ -96,15 +101,20 @@ - lwz rWORD1, 0(rSTR) - li rMASK, -1 - addi r7F7F, r7F7F, 0x7f7f + lwz rWORD1, 0(rSTR) + li rMASK, -1 + addi r7F7F, r7F7F, 0x7f7f -/* That's the setup done, now do the first pair of words. - We make an exception and use method (2) on the first two words, to reduce - overhead. */ @@ -126,54 +126,54 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758 +#ifdef __LITTLE_ENDIAN__ + slw rMASK, rMASK, rPADN +#else - srw rMASK, rMASK, rPADN + srw rMASK, rMASK, rPADN +#endif - and rTMP1, r7F7F, rWORD1 - or rTMP2, r7F7F, rWORD1 - add rTMP1, rTMP1, r7F7F + and rTMP1, r7F7F, rWORD1 + or rTMP2, r7F7F, rWORD1 + add rTMP1, rTMP1, r7F7F - nor rTMP1, rTMP2, rTMP1 - and. rWORD1, rTMP1, rMASK + nor rTMP3, rTMP2, rTMP1 + and. rTMP3, rTMP3, rMASK - mtcrf 0x01, rRTN - bne L(done0) - lis rFEFE, -0x101 + mtcrf 0x01, rRTN + bne L(done0) + lis rFEFE, -0x101 @@ -113,11 +123,12 @@ - bt 29, L(loop) - + bt 29, L(loop) + /* Handle second word of pair. */ +/* Perhaps use method (1) here for little-endian, saving one instruction? */ - lwzu rWORD1, 4(rSTR) - and rTMP1, r7F7F, rWORD1 - or rTMP2, r7F7F, rWORD1 - add rTMP1, rTMP1, r7F7F + lwzu rWORD1, 4(rSTR) + and rTMP1, r7F7F, rWORD1 + or rTMP2, r7F7F, rWORD1 + add rTMP1, rTMP1, r7F7F - nor. rWORD1, rTMP2, rTMP1 + nor. rTMP3, rTMP2, rTMP1 - bne L(done0) - + bne L(done0) + /* The loop. */ @@ -131,29 +142,53 @@ - add rTMP3, rFEFE, rWORD2 - nor rTMP4, r7F7F, rWORD2 - bne L(done1) + add rTMP3, rFEFE, rWORD2 + nor rTMP4, r7F7F, rWORD2 + bne L(done1) - and. rTMP1, rTMP3, rTMP4 + and. rTMP3, rTMP3, rTMP4 - beq L(loop) - + beq L(loop) + +#ifndef __LITTLE_ENDIAN__ - and rTMP1, r7F7F, rWORD2 - add rTMP1, rTMP1, r7F7F + and rTMP1, r7F7F, rWORD2 + add rTMP1, rTMP1, r7F7F - andc rWORD1, rTMP4, rTMP1 + andc rTMP3, rTMP4, rTMP1 - b L(done0) - + b L(done0) + L(done1): - and rTMP1, r7F7F, rWORD1 - subi rSTR, rSTR, 4 - add rTMP1, rTMP1, r7F7F + and rTMP1, r7F7F, rWORD1 + subi rSTR, rSTR, 4 + add rTMP1, rTMP1, r7F7F - andc rWORD1, rTMP2, rTMP1 + andc rTMP3, rTMP2, rTMP1 - + /* When we get to here, rSTR points to the first word in the string that - contains a zero byte, and the most significant set bit in rWORD1 is in that - byte. */ @@ -182,11 +182,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758 L(done0): - cntlzw rTMP3, rWORD1 + cntlzw rTMP3, rTMP3 - subf rTMP1, rRTN, rSTR - srwi rTMP3, rTMP3, 3 - add rRTN, rTMP1, rTMP3 - /* GKM FIXME: check high bound. */ - blr + subf rTMP1, rRTN, rSTR + srwi rTMP3, rTMP3, 3 + add rRTN, rTMP1, rTMP3 + /* GKM FIXME: check high bound. */ + blr +#else + +L(done0): @@ -216,30 +216,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S glibc-2. --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500 @@ -32,7 +32,11 @@ - with cmpb. */ - li r5,-1 /* MASK = 0xffffffffffffffff. */ - ld r12,0(r4) /* Load doubleword from memory. */ + with cmpb. */ + li r5,-1 /* MASK = 0xffffffffffffffff. */ + ld r12,0(r4) /* Load doubleword from memory. */ +#ifdef __LITTLE_ENDIAN__ + sld r5,r5,r6 +#else - srd r5,r5,r6 /* MASK = MASK >> padding. */ + srd r5,r5,r6 /* MASK = MASK >> padding. */ +#endif - orc r9,r12,r5 /* Mask bits that are not part of the string. */ - cmpb r10,r9,r0 /* Check for null bytes in DWORD1. */ - cmpdi cr7,r10,0 /* If r10 == 0, no null's have been found. */ + orc r9,r12,r5 /* Mask bits that are not part of the string. */ + cmpb r10,r9,r0 /* Check for null bytes in DWORD1. */ + cmpdi cr7,r10,0 /* If r10 == 0, no null's have been found. */ @@ -50,9 +54,6 @@ - cmpb r10,r12,r0 - cmpdi cr7,r10,0 - bne cr7,L(done) + cmpb r10,r12,r0 + cmpdi cr7,r10,0 + bne cr7,L(done) - b L(loop) /* We branch here (rather than falling through) - to skip the nops due to heavy alignment - of the loop below. */ - - /* Main loop to look for the end of the string. Since it's a - small loop (< 8 instructions), align it to 32-bytes. */ + + /* Main loop to look for the end of the string. Since it's a + small loop (< 8 instructions), align it to 32-bytes. */ @@ -89,9 +90,15 @@ - 0xff in the same position as the null byte in the original - doubleword from the string. Use that to calculate the length. */ + 0xff in the same position as the null byte in the original + doubleword from the string. Use that to calculate the length. */ L(done): - cntlzd r0,r10 /* Count leading zeroes before the match. */ +#ifdef __LITTLE_ENDIAN__ @@ -249,11 +249,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S glibc-2. +#else + cntlzd r0,r10 /* Count leading zeros before the match. */ +#endif - subf r5,r3,r4 + subf r5,r3,r4 - srdi r0,r0,3 /* Convert leading zeroes to bytes. */ + srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */ - add r3,r5,r0 /* Compute final length. */ - blr + add r3,r5,r0 /* Compute final length. */ + blr END (BP_SYM (strlen)) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S 2014-05-28 12:28:44.000000000 -0500 @@ -269,22 +269,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758 + of no consequence since the least significant match is the one + we're interested in, but big-endian needs method 2 to find which + byte matches. - + 2) Given a word 'x', we can test to see _which_ byte was zero by calculating ~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f). @@ -64,7 +69,7 @@ Answer: - 1) Added a Data Cache Block Touch early to prefetch the first 128 - byte cache line. Adding dcbt instructions to the loop would not be + 1) Added a Data Cache Block Touch early to prefetch the first 128 + byte cache line. Adding dcbt instructions to the loop would not be - effective since most strings will be shorter than the cache line.*/ + effective since most strings will be shorter than the cache line. */ - + /* Some notes on register usage: Under the SVR4 ABI, we can use registers 0 and 3 through 12 (so long as we don't call any procedures) without @@ -80,7 +85,7 @@ ENTRY (BP_SYM (strlen)) - CALL_MCOUNT 1 - + CALL_MCOUNT 1 + -#define rTMP1 r0 +#define rTMP4 r0 #define rRTN r3 /* incoming STR arg, outgoing result */ @@ -300,15 +300,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758 +#define rTMP1 r10 +#define rTMP2 r11 +#define rTMP3 r12 - + /* Note: The Bounded pointer support in this code is broken. This code was inherited from PPC32 and that support was never completed. @@ -109,30 +114,36 @@ - addi r7F7F, r7F7F, 0x7f7f - li rMASK, -1 - insrdi r7F7F, r7F7F, 32, 0 + addi r7F7F, r7F7F, 0x7f7f + li rMASK, -1 + insrdi r7F7F, r7F7F, 32, 0 -/* That's the setup done, now do the first pair of doublewords. -- We make an exception and use method (2) on the first two doublewords, +- We make an exception and use method (2) on the first two doublewords, - to reduce overhead. */ - srd rMASK, rMASK, rPADN +/* We use method (2) on the first two doublewords, because rFEFE isn't @@ -320,57 +320,57 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758 +#else + srd rMASK, rMASK, rPADN +#endif - and rTMP1, r7F7F, rWORD1 - or rTMP2, r7F7F, rWORD1 - lis rFEFE, -0x101 - add rTMP1, rTMP1, r7F7F - addi rFEFE, rFEFE, -0x101 + and rTMP1, r7F7F, rWORD1 + or rTMP2, r7F7F, rWORD1 + lis rFEFE, -0x101 + add rTMP1, rTMP1, r7F7F + addi rFEFE, rFEFE, -0x101 - nor rTMP1, rTMP2, rTMP1 - and. rWORD1, rTMP1, rMASK + nor rTMP3, rTMP2, rTMP1 + and. rTMP3, rTMP3, rMASK - mtcrf 0x01, rRTN - bne L(done0) + mtcrf 0x01, rRTN + bne L(done0) - sldi rTMP1, rFEFE, 32 - add rFEFE, rFEFE, rTMP1 + sldi rTMP1, rFEFE, 32 + add rFEFE, rFEFE, rTMP1 /* Are we now aligned to a doubleword boundary? */ - bt 28, L(loop) - + bt 28, L(loop) + /* Handle second doubleword of pair. */ +/* Perhaps use method (1) here for little-endian, saving one instruction? */ - ldu rWORD1, 8(rSTR) - and rTMP1, r7F7F, rWORD1 - or rTMP2, r7F7F, rWORD1 - add rTMP1, rTMP1, r7F7F + ldu rWORD1, 8(rSTR) + and rTMP1, r7F7F, rWORD1 + or rTMP2, r7F7F, rWORD1 + add rTMP1, rTMP1, r7F7F - nor. rWORD1, rTMP2, rTMP1 + nor. rTMP3, rTMP2, rTMP1 - bne L(done0) - + bne L(done0) + /* The loop. */ @@ -146,29 +157,53 @@ - add rTMP3, rFEFE, rWORD2 - nor rTMP4, r7F7F, rWORD2 - bne L(done1) + add rTMP3, rFEFE, rWORD2 + nor rTMP4, r7F7F, rWORD2 + bne L(done1) - and. rTMP1, rTMP3, rTMP4 + and. rTMP3, rTMP3, rTMP4 - beq L(loop) - + beq L(loop) + +#ifndef __LITTLE_ENDIAN__ - and rTMP1, r7F7F, rWORD2 - add rTMP1, rTMP1, r7F7F + and rTMP1, r7F7F, rWORD2 + add rTMP1, rTMP1, r7F7F - andc rWORD1, rTMP4, rTMP1 + andc rTMP3, rTMP4, rTMP1 - b L(done0) - + b L(done0) + L(done1): - and rTMP1, r7F7F, rWORD1 - subi rSTR, rSTR, 8 - add rTMP1, rTMP1, r7F7F + and rTMP1, r7F7F, rWORD1 + subi rSTR, rSTR, 8 + add rTMP1, rTMP1, r7F7F - andc rWORD1, rTMP2, rTMP1 + andc rTMP3, rTMP2, rTMP1 - + /* When we get to here, rSTR points to the first doubleword in the string that - contains a zero byte, and the most significant set bit in rWORD1 is in that - byte. */ @@ -379,11 +379,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758 L(done0): - cntlzd rTMP3, rWORD1 + cntlzd rTMP3, rTMP3 - subf rTMP1, rRTN, rSTR - srdi rTMP3, rTMP3, 3 - add rRTN, rTMP1, rTMP3 - /* GKM FIXME: check high bound. */ - blr + subf rTMP1, rRTN, rSTR + srdi rTMP3, rTMP3, 3 + add rRTN, rTMP1, rTMP3 + /* GKM FIXME: check high bound. */ + blr +#else + +L(done0): diff --git a/SOURCES/glibc-ppc64le-26.patch b/SOURCES/glibc-ppc64le-26.patch index 1a7dad76..93fd255d 100644 --- a/SOURCES/glibc-ppc64le-26.patch +++ b/SOURCES/glibc-ppc64le-26.patch @@ -1,14 +1,14 @@ # commit 33ee81de05e83ce12f32a491270bb4c1611399c7 # Author: Alan Modra # Date: Sat Aug 17 18:40:48 2013 +0930 -# +# # PowerPC LE strnlen # http://sourceware.org/ml/libc-alpha/2013-08/msg00098.html -# +# # The existing strnlen code has a number of defects, so this patch is more # than just adding little-endian support. The changes here are similar to # those for memchr. -# +# # * sysdeps/powerpc/powerpc64/power7/strnlen.S (strnlen): Add # little-endian support. Remove unnecessary "are we done" tests. # Handle "s" wrapping around zero and extremely large "size". @@ -16,17 +16,17 @@ # loop inline rather than by using small_loop. Correct comments. # Delete "zero" tail, use "end_max" instead. # * sysdeps/powerpc/powerpc32/power7/strnlen.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:40:17.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:44:52.000000000 -0500 @@ -30,51 +30,47 @@ - add r7,r3,r4 /* Calculate the last acceptable address. */ - cmplwi r4,16 - li r0,0 /* Word with null chars. */ + add r7,r3,r4 /* Calculate the last acceptable address. */ + cmplwi r4,16 + li r0,0 /* Word with null chars. */ + addi r7,r7,-1 - ble L(small_range) - + ble L(small_range) + - cmplw cr7,r3,r7 /* Is the address equal or less than r3? If - it's equal or less, it means size is either 0 - or a negative number. */ @@ -34,38 +34,38 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2 - - li r7,-1 /* Make r11 the biggest if r4 <= 0. */ -L(proceed): - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - lwz r12,0(r8) /* Load word from memory. */ - cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + lwz r12,0(r8) /* Load word from memory. */ + cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ +#ifdef __LITTLE_ENDIAN__ + srw r10,r10,r6 + slw r10,r10,r6 +#else - slw r10,r10,r6 - srw r10,r10,r6 + slw r10,r10,r6 + srw r10,r10,r6 +#endif - cmplwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ - bne cr7,L(done) - + cmplwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,4 - cmplw cr6,r9,r7 - bge cr6,L(end_max) - + clrrwi r7,r7,2 /* Address of last word. */ - mtcrf 0x01,r8 - /* Are we now aligned to a doubleword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ - - bt 29,L(loop_setup) - + mtcrf 0x01,r8 + /* Are we now aligned to a doubleword boundary? If so, skip to + the main loop. Otherwise, go through the alignment code. */ + + bt 29,L(loop_setup) + - /* Handle DWORD2 of pair. */ + /* Handle WORD2 of pair. */ - lwzu r12,4(r8) - cmpb r10,r12,r0 - cmplwi cr7,r10,0 - bne cr7,L(done) - + lwzu r12,4(r8) + cmpb r10,r12,r0 + cmplwi cr7,r10,0 + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,4 - cmplw cr6,r9,r7 @@ -80,19 +80,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2 + be at r8 + 4 + 8 * cnt - 4. Solving for cnt gives + cnt = (r7 - r8) / 8 */ + sub r5,r7,r8 - srwi r6,r5,3 /* Number of loop iterations. */ - mtctr r6 /* Setup the counter. */ + srwi r6,r5,3 /* Number of loop iterations. */ + mtctr r6 /* Setup the counter. */ - b L(loop) - /* Main loop to look for the null byte backwards in the string. Since + + /* Main loop to look for the null byte in the string. Since - it's a small loop (< 8 instructions), align it to 32-bytes. */ - .p2align 5 + it's a small loop (< 8 instructions), align it to 32-bytes. */ + .p2align 5 L(loop): @@ -90,15 +86,18 @@ - cmplwi cr7,r5,0 - bne cr7,L(found) - bdnz L(loop) + cmplwi cr7,r5,0 + bne cr7,L(found) + bdnz L(loop) - /* We're here because the counter reached 0, and that means we - didn't have any matches for null in the whole range. Just return - the original size. */ @@ -108,16 +108,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2 + cmpb r10,r12,r0 + cmplwi cr6,r10,0 + bne cr6,L(done) - + L(end_max): - sub r3,r7,r3 + mr r3,r4 - blr - - /* OK, one (or both) of the words contains a null byte. Check + blr + + /* OK, one (or both) of the words contains a null byte. Check @@ -123,49 +122,56 @@ - We need to make sure the null char is *before* the end of the - range. */ + We need to make sure the null char is *before* the end of the + range. */ L(done): - cntlzw r0,r10 /* Count leading zeroes before the match. */ - srwi r0,r0,3 /* Convert leading zeroes to bytes. */ @@ -144,45 +144,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2 + cmplw r3,r4 + blelr + mr r3,r4 - blr - + blr + -/* Deals with size <= 32. */ +/* Deals with size <= 16. */ - .align 4 + .align 4 L(small_range): - cmplwi r4,0 + cmplwi r4,0 - beq L(zero) + beq L(end_max) + + clrrwi r7,r7,2 /* Address of last word. */ - - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - lwz r12,0(r8) /* Load word from memory. */ - cmpb r10,r12,r0 /* Check for null bytes in WORD1. */ + + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + lwz r12,0(r8) /* Load word from memory. */ + cmpb r10,r12,r0 /* Check for null bytes in WORD1. */ +#ifdef __LITTLE_ENDIAN__ + srw r10,r10,r6 + slw r10,r10,r6 +#else - slw r10,r10,r6 - srw r10,r10,r6 + slw r10,r10,r6 + srw r10,r10,r6 +#endif - cmplwi cr7,r10,0 - bne cr7,L(done) - + cmplwi cr7,r10,0 + bne cr7,L(done) + - addi r9,r8,4 - cmplw r9,r7 - bge L(end_max) - b L(loop_small) + cmplw r8,r7 + beq L(end_max) - - .p2align 5 + + .p2align 5 L(loop_small): - lwzu r12,4(r8) - cmpb r10,r12,r0 + lwzu r12,4(r8) + cmpb r10,r12,r0 - addi r9,r8,4 - cmplwi cr6,r10,0 - bne cr6,L(done) + cmplwi cr6,r10,0 + bne cr6,L(done) - cmplw r9,r7 - bge L(end_max) - b L(loop_small) @@ -199,18 +199,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S 2014-05-28 13:24:41.000000000 -0500 @@ -26,33 +26,29 @@ ENTRY (BP_SYM (__strnlen)) - CALL_MCOUNT 2 - dcbt 0,r3 + CALL_MCOUNT 2 + dcbt 0,r3 - clrrdi r8,r3,3 + clrrdi r8,r3,3 - add r7,r3,r4 /* Calculate the last acceptable address. */ - cmpldi r4,32 - li r0,0 /* Doubleword with null chars. */ + add r7,r3,r4 /* Calculate the last acceptable address. */ + cmpldi r4,32 + li r0,0 /* Doubleword with null chars. */ + addi r7,r7,-1 + - /* If we have less than 33 bytes to search, skip to a faster code. */ - ble L(small_range) - + /* If we have less than 33 bytes to search, skip to a faster code. */ + ble L(small_range) + - cmpld cr7,r3,r7 /* Is the address equal or less than r3? If - it's equal or less, it means size is either 0 - or a negative number. */ @@ -218,32 +218,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2 - - li r7,-1 /* Make r11 the biggest if r4 <= 0. */ -L(proceed): - rlwinm r6,r3,3,26,28 /* Calculate padding. */ - ld r12,0(r8) /* Load doubleword from memory. */ - cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ + rlwinm r6,r3,3,26,28 /* Calculate padding. */ + ld r12,0(r8) /* Load doubleword from memory. */ + cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ +#ifdef __LITTLE_ENDIAN__ + srd r10,r10,r6 + sld r10,r10,r6 +#else - sld r10,r10,r6 - srd r10,r10,r6 + sld r10,r10,r6 + srd r10,r10,r6 +#endif - cmpldi cr7,r10,0 /* If r10 == 0, no null's have been found. */ - bne cr7,L(done) - + cmpldi cr7,r10,0 /* If r10 == 0, no null's have been found. */ + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,8 - cmpld cr6,r9,r7 - bge cr6,L(end_max) - + clrrdi r7,r7,3 /* Address of last doubleword. */ - mtcrf 0x01,r8 - /* Are we now aligned to a quadword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ + mtcrf 0x01,r8 + /* Are we now aligned to a quadword boundary? If so, skip to + the main loop. Otherwise, go through the alignment code. */ @@ -65,17 +61,18 @@ - cmpldi cr7,r10,0 - bne cr7,L(done) - + cmpldi cr7,r10,0 + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,8 - cmpld cr6,r9,r7 @@ -258,19 +258,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2 + be at r8 + 8 + 16 * cnt - 8. Solving for cnt gives + cnt = (r7 - r8) / 16 */ + sub r5,r7,r8 - srdi r6,r5,4 /* Number of loop iterations. */ - mtctr r6 /* Setup the counter. */ + srdi r6,r5,4 /* Number of loop iterations. */ + mtctr r6 /* Setup the counter. */ - b L(loop) - /* Main loop to look for the null byte backwards in the string. Since + + /* Main loop to look for the null byte in the string. Since - it's a small loop (< 8 instructions), align it to 32-bytes. */ - .p2align 5 + it's a small loop (< 8 instructions), align it to 32-bytes. */ + .p2align 5 L(loop): @@ -91,15 +88,18 @@ - cmpldi cr7,r5,0 - bne cr7,L(found) - bdnz L(loop) + cmpldi cr7,r5,0 + bne cr7,L(found) + bdnz L(loop) - /* We're here because the counter reached 0, and that means we - didn't have any matches for null in the whole range. Just return - the original size. */ @@ -286,17 +286,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2 + cmpb r10,r12,r0 + cmpldi cr6,r10,0 + bne cr6,L(done) - + L(end_max): - sub r3,r7,r3 + mr r3,r4 - blr - - /* OK, one (or both) of the doublewords contains a null byte. Check + blr + + /* OK, one (or both) of the doublewords contains a null byte. Check @@ -121,52 +121,59 @@ - /* r10 has the output of the cmpb instruction, that is, it contains - 0xff in the same position as the null byte in the original - doubleword from the string. Use that to calculate the length. + /* r10 has the output of the cmpb instruction, that is, it contains + 0xff in the same position as the null byte in the original + doubleword from the string. Use that to calculate the length. - We need to make sure the null char is *before* the start of the - range (since we're going backwards). */ + We need to make sure the null char is *before* the end of the @@ -327,45 +327,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2 + cmpld r3,r4 + blelr + mr r3,r4 - blr - + blr + /* Deals with size <= 32. */ - .align 4 + .align 4 L(small_range): - cmpldi r4,0 + cmpldi r4,0 - beq L(zero) + beq L(end_max) + + clrrdi r7,r7,3 /* Address of last doubleword. */ - - rlwinm r6,r3,3,26,28 /* Calculate padding. */ + + rlwinm r6,r3,3,26,28 /* Calculate padding. */ - ld r12,0(r8) /* Load word from memory. */ + ld r12,0(r8) /* Load doubleword from memory. */ - cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ + cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ +#ifdef __LITTLE_ENDIAN__ + srd r10,r10,r6 + sld r10,r10,r6 +#else - sld r10,r10,r6 - srd r10,r10,r6 + sld r10,r10,r6 + srd r10,r10,r6 +#endif - cmpldi cr7,r10,0 - bne cr7,L(done) - + cmpldi cr7,r10,0 + bne cr7,L(done) + - addi r9,r8,8 - cmpld r9,r7 - bge L(end_max) - b L(loop_small) + cmpld r8,r7 + beq L(end_max) - - .p2align 5 + + .p2align 5 L(loop_small): - ldu r12,8(r8) - cmpb r10,r12,r0 + ldu r12,8(r8) + cmpb r10,r12,r0 - addi r9,r8,8 - cmpldi cr6,r10,0 - bne cr6,L(done) + cmpldi cr6,r10,0 + bne cr6,L(done) - cmpld r9,r7 - bge L(end_max) - b L(loop_small) diff --git a/SOURCES/glibc-ppc64le-27.patch b/SOURCES/glibc-ppc64le-27.patch index f8d4f25c..83ca794a 100644 --- a/SOURCES/glibc-ppc64le-27.patch +++ b/SOURCES/glibc-ppc64le-27.patch @@ -1,17 +1,17 @@ # commit 8a7413f9b036da83ffde491a37d9d2340bc321a7 # Author: Alan Modra # Date: Sat Aug 17 18:41:17 2013 +0930 -# +# # PowerPC LE strcmp and strncmp # http://sourceware.org/ml/libc-alpha/2013-08/msg00099.html -# +# # More little-endian support. I leave the main strcmp loops unchanged, # (well, except for renumbering rTMP to something other than r0 since # it's needed in an addi insn) and modify the tail for little-endian. -# +# # I noticed some of the big-endian tail code was a little untidy so have # cleaned that up too. -# +# # * sysdeps/powerpc/powerpc64/strcmp.S (rTMP2): Define as r0. # (rTMP): Define as r11. # (strcmp): Add little-endian support. Optimise tail. @@ -22,14 +22,14 @@ # * sysdeps/powerpc/powerpc32/power4/strncmp.S: Likewise. # * sysdeps/powerpc/powerpc64/power7/strncmp.S: Likewise. # * sysdeps/powerpc/powerpc32/power7/strncmp.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -26,7 +26,7 @@ - + EALIGN (BP_SYM(strncmp), 4, 0) - + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -40,13 +40,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - or rTMP, rSTR2, rSTR1 + + dcbt 0,rSTR1 + or rTMP, rSTR2, rSTR1 @@ -80,12 +81,45 @@ we don't compare two strings as different because of gunk beyond the end of the strings... */ - + +#ifdef __LITTLE_ENDIAN__ +L(endstring): + slwi rTMP, rTMP, 1 @@ -82,32 +82,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2 + +#else L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F - xor. rBITDIF, rWORD1, rWORD2 + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F + xor. rBITDIF, rWORD1, rWORD2 - - andc rNEG, rNEG, rTMP - blt- L(highbit) - cntlzw rBITDIF, rBITDIF + andc rNEG, rNEG, rTMP + blt- L(highbit) + cntlzw rBITDIF, rBITDIF @@ -93,28 +127,20 @@ - addi rNEG, rNEG, 7 - cmpw cr1, rNEG, rBITDIF - sub rRTN, rWORD1, rWORD2 + addi rNEG, rNEG, 7 + cmpw cr1, rNEG, rBITDIF + sub rRTN, rWORD1, rWORD2 - blt- cr1, L(equal) - srawi rRTN, rRTN, 31 - ori rRTN, rRTN, 1 - blr + bgelr+ cr1 L(equal): - li rRTN, 0 - blr - + li rRTN, 0 + blr + L(different): - lwzu rWORD1, -4(rSTR1) + lwz rWORD1, -4(rSTR1) - xor. rBITDIF, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2 + xor. rBITDIF, rWORD1, rWORD2 + sub rRTN, rWORD1, rWORD2 - blt- L(highbit) - srawi rRTN, rRTN, 31 - ori rRTN, rRTN, 1 @@ -118,19 +118,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2 - srwi rWORD1, rWORD1, 24 - sub rRTN, rWORD1, rWORD2 + ori rRTN, rWORD2, 1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -28,7 +28,7 @@ - + EALIGN (BP_SYM(strncmp),5,0) - + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -141,9 +141,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - nop + + dcbt 0,rSTR1 + nop @@ -83,13 +84,45 @@ /* OK. We've hit the end of the string. We need to be careful that we don't compare two strings as different because of gunk beyond @@ -180,35 +180,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2 + bgelr + ori rRTN, rTMP2, 1 + blr - + +#else L(endstring): - and rTMP,r7F7F,rWORD1 - beq cr1,L(equal) - add rTMP,rTMP,r7F7F - xor. rBITDIF,rWORD1,rWORD2 + and rTMP,r7F7F,rWORD1 + beq cr1,L(equal) + add rTMP,rTMP,r7F7F + xor. rBITDIF,rWORD1,rWORD2 - - andc rNEG,rNEG,rTMP - blt L(highbit) - cntlzw rBITDIF,rBITDIF + andc rNEG,rNEG,rTMP + blt L(highbit) + cntlzw rBITDIF,rBITDIF @@ -97,28 +130,20 @@ - addi rNEG,rNEG,7 - cmpw cr1,rNEG,rBITDIF - sub rRTN,rWORD1,rWORD2 + addi rNEG,rNEG,7 + cmpw cr1,rNEG,rBITDIF + sub rRTN,rWORD1,rWORD2 - blt cr1,L(equal) - srawi rRTN,rRTN,31 - ori rRTN,rRTN,1 - blr + bgelr cr1 L(equal): - li rRTN,0 - blr - + li rRTN,0 + blr + L(different): - lwzu rWORD1,-4(rSTR1) + lwz rWORD1,-4(rSTR1) - xor. rBITDIF,rWORD1,rWORD2 - sub rRTN,rWORD1,rWORD2 + xor. rBITDIF,rWORD1,rWORD2 + sub rRTN,rWORD1,rWORD2 - blt L(highbit) - srawi rRTN,rRTN,31 - ori rRTN,rRTN,1 @@ -219,19 +219,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2 - srwi rWORD1,rWORD1,24 - sub rRTN,rWORD1,rWORD2 + ori rRTN, rWORD2, 1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -26,7 +26,7 @@ - + EALIGN (BP_SYM (strcmp), 4, 0) - + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -242,13 +242,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758 #define rNEG r9 /* ~(word in s1 | 0x7f7f7f7f) */ #define rBITDIF r10 /* bits that differ in s1 & s2 words */ +#define rTMP r11 - - CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) - CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) + + CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) + CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) @@ -64,10 +65,45 @@ - and. rTMP, rTMP, rNEG - cmpw cr1, rWORD1, rWORD2 - beq+ L(g0) + and. rTMP, rTMP, rNEG + cmpw cr1, rWORD1, rWORD2 + beq+ L(g0) -L(endstring): + /* OK. We've hit the end of the string. We need to be careful that @@ -289,25 +289,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758 + +#else +L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F @@ -94,7 +130,7 @@ - ori rRTN, rWORD2, 1 - /* GKM FIXME: check high bounds. */ - blr + ori rRTN, rWORD2, 1 + /* GKM FIXME: check high bounds. */ + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -26,7 +26,7 @@ - + EALIGN (BP_SYM(strncmp), 4, 0) - + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -318,13 +318,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - or rTMP, rSTR2, rSTR1 + + dcbt 0,rSTR1 + or rTMP, rSTR2, rSTR1 @@ -78,12 +79,45 @@ we don't compare two strings as different because of gunk beyond the end of the strings... */ - + +#ifdef __LITTLE_ENDIAN__ +L(endstring): + slwi rTMP, rTMP, 1 @@ -360,32 +360,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75 + +#else L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F - xor. rBITDIF, rWORD1, rWORD2 + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F + xor. rBITDIF, rWORD1, rWORD2 - - andc rNEG, rNEG, rTMP - blt- L(highbit) - cntlzw rBITDIF, rBITDIF + andc rNEG, rNEG, rTMP + blt- L(highbit) + cntlzw rBITDIF, rBITDIF @@ -91,28 +125,20 @@ - addi rNEG, rNEG, 7 - cmpw cr1, rNEG, rBITDIF - sub rRTN, rWORD1, rWORD2 + addi rNEG, rNEG, 7 + cmpw cr1, rNEG, rBITDIF + sub rRTN, rWORD1, rWORD2 - blt- cr1, L(equal) - srawi rRTN, rRTN, 31 - ori rRTN, rRTN, 1 - blr + bgelr+ cr1 L(equal): - li rRTN, 0 - blr - + li rRTN, 0 + blr + L(different): - lwzu rWORD1, -4(rSTR1) + lwz rWORD1, -4(rSTR1) - xor. rBITDIF, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2 + xor. rBITDIF, rWORD1, rWORD2 + sub rRTN, rWORD1, rWORD2 - blt- L(highbit) - srawi rRTN, rRTN, 31 - ori rRTN, rRTN, 1 @@ -396,19 +396,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75 - srwi rWORD1, rWORD1, 24 - sub rRTN, rWORD1, rWORD2 + ori rRTN, rWORD2, 1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -27,7 +27,7 @@ EALIGN (BP_SYM(strncmp), 4, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -419,13 +419,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - or rTMP, rSTR2, rSTR1 + + dcbt 0,rSTR1 + or rTMP, rSTR2, rSTR1 @@ -84,12 +85,59 @@ we don't compare two strings as different because of gunk beyond the end of the strings... */ - + +#ifdef __LITTLE_ENDIAN__ +L(endstring): + addi rTMP2, rTMP, -1 @@ -475,54 +475,54 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2 + +#else L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F - xor. rBITDIF, rWORD1, rWORD2 + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F + xor. rBITDIF, rWORD1, rWORD2 - - andc rNEG, rNEG, rTMP - blt- L(highbit) - cntlzd rBITDIF, rBITDIF + andc rNEG, rNEG, rTMP + blt- L(highbit) + cntlzd rBITDIF, rBITDIF @@ -98,7 +146,7 @@ - cmpd cr1, rNEG, rBITDIF - sub rRTN, rWORD1, rWORD2 - blt- cr1, L(equal) + cmpd cr1, rNEG, rBITDIF + sub rRTN, rWORD1, rWORD2 + blt- cr1, L(equal) - sradi rRTN, rRTN, 63 + sradi rRTN, rRTN, 63 /* must return an int. */ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(equal): @@ -106,7 +154,7 @@ - blr - + blr + L(different): - ldu rWORD1, -8(rSTR1) + ld rWORD1, -8(rSTR1) - xor. rBITDIF, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2 - blt- L(highbit) + xor. rBITDIF, rWORD1, rWORD2 + sub rRTN, rWORD1, rWORD2 + blt- L(highbit) @@ -114,11 +162,10 @@ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(highbit): - srdi rWORD2, rWORD2, 56 - srdi rWORD1, rWORD1, 56 - sub rRTN, rWORD1, rWORD2 + sradi rRTN, rWORD2, 63 + ori rRTN, rRTN, 1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500 @@ -29,7 +29,7 @@ EALIGN (BP_SYM(strncmp),5,0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -533,13 +533,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - nop + + dcbt 0,rSTR1 + nop @@ -88,12 +89,57 @@ we don't compare two strings as different because of gunk beyond the end of the strings... */ - + +#ifdef __LITTLE_ENDIAN__ +L(endstring): + addi rTMP2, rTMP, -1 @@ -587,54 +587,54 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2 + +#else L(endstring): - and rTMP,r7F7F,rWORD1 - beq cr1,L(equal) - add rTMP,rTMP,r7F7F - xor. rBITDIF,rWORD1,rWORD2 + and rTMP,r7F7F,rWORD1 + beq cr1,L(equal) + add rTMP,rTMP,r7F7F + xor. rBITDIF,rWORD1,rWORD2 - - andc rNEG,rNEG,rTMP - blt L(highbit) - cntlzd rBITDIF,rBITDIF + andc rNEG,rNEG,rTMP + blt L(highbit) + cntlzd rBITDIF,rBITDIF @@ -102,7 +148,7 @@ - cmpd cr1,rNEG,rBITDIF - sub rRTN,rWORD1,rWORD2 - blt cr1,L(equal) + cmpd cr1,rNEG,rBITDIF + sub rRTN,rWORD1,rWORD2 + blt cr1,L(equal) - sradi rRTN,rRTN,63 + sradi rRTN,rRTN,63 /* must return an int. */ - ori rRTN,rRTN,1 - blr + ori rRTN,rRTN,1 + blr L(equal): @@ -110,7 +156,7 @@ - blr - + blr + L(different): - ldu rWORD1,-8(rSTR1) + ld rWORD1,-8(rSTR1) - xor. rBITDIF,rWORD1,rWORD2 - sub rRTN,rWORD1,rWORD2 - blt L(highbit) + xor. rBITDIF,rWORD1,rWORD2 + sub rRTN,rWORD1,rWORD2 + blt L(highbit) @@ -118,11 +164,10 @@ - ori rRTN,rRTN,1 - blr + ori rRTN,rRTN,1 + blr L(highbit): - srdi rWORD2,rWORD2,56 - srdi rWORD1,rWORD1,56 - sub rRTN,rWORD1,rWORD2 + sradi rRTN,rWORD2,63 + ori rRTN,rRTN,1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:37:15.000000000 -0500 @@ -27,7 +27,7 @@ EALIGN (BP_SYM(strcmp), 4, 0) - CALL_MCOUNT 2 - + CALL_MCOUNT 2 + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -645,17 +645,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758 #define rNEG r9 /* ~(word in s1 | 0x7f7f7f7f7f7f7f7f) */ #define rBITDIF r10 /* bits that differ in s1 & s2 words */ +#define rTMP r11 - - CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) - CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) + + CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) + CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) @@ -72,19 +73,66 @@ - ldu rWORD2, 8(rSTR2) + ldu rWORD2, 8(rSTR2) L(g1): add rTMP, rFEFE, rWORD1 - nor rNEG, r7F7F, rWORD1 + nor rNEG, r7F7F, rWORD1 - - and. rTMP, rTMP, rNEG - cmpd cr1, rWORD1, rWORD2 - beq+ L(g0) + and. rTMP, rTMP, rNEG + cmpd cr1, rWORD1, rWORD2 + beq+ L(g0) -L(endstring): + /* OK. We've hit the end of the string. We need to be careful that @@ -710,46 +710,46 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758 + +#else +L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F - xor. rBITDIF, rWORD1, rWORD2 + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F + xor. rBITDIF, rWORD1, rWORD2 - - andc rNEG, rNEG, rTMP - blt- L(highbit) - cntlzd rBITDIF, rBITDIF + andc rNEG, rNEG, rTMP + blt- L(highbit) + cntlzd rBITDIF, rBITDIF @@ -93,7 +141,7 @@ - cmpd cr1, rNEG, rBITDIF - sub rRTN, rWORD1, rWORD2 - blt- cr1, L(equal) + cmpd cr1, rNEG, rBITDIF + sub rRTN, rWORD1, rWORD2 + blt- cr1, L(equal) - sradi rRTN, rRTN, 63 + sradi rRTN, rRTN, 63 /* must return an int. */ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(equal): @@ -110,12 +158,11 @@ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(highbit): - srdi rWORD2, rWORD2, 56 - srdi rWORD1, rWORD1, 56 - sub rRTN, rWORD1, rWORD2 + sradi rRTN, rWORD2, 63 + ori rRTN, rRTN, 1 - /* GKM FIXME: check high bounds. */ - blr + /* GKM FIXME: check high bounds. */ + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:26:59.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:38:31.000000000 -0500 @@ -27,7 +27,7 @@ EALIGN (BP_SYM(strncmp), 4, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rTMP r0 +#define rTMP2 r0 #define rRTN r3 @@ -760,14 +760,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c75 #define rNEG r10 /* ~(word in s1 | 0x7f7f7f7f7f7f7f7f) */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */ +#define rTMP r12 - - dcbt 0,rSTR1 - or rTMP, rSTR2, rSTR1 + + dcbt 0,rSTR1 + or rTMP, rSTR2, rSTR1 @@ -81,13 +82,60 @@ /* OK. We've hit the end of the string. We need to be careful that we don't compare two strings as different because of gunk beyond the end of the strings... */ -- +- + +#ifdef __LITTLE_ENDIAN__ +L(endstring): @@ -818,44 +818,44 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c75 + +#else L(endstring): - and rTMP, r7F7F, rWORD1 - beq cr1, L(equal) - add rTMP, rTMP, r7F7F - xor. rBITDIF, rWORD1, rWORD2 + and rTMP, r7F7F, rWORD1 + beq cr1, L(equal) + add rTMP, rTMP, r7F7F + xor. rBITDIF, rWORD1, rWORD2 - - andc rNEG, rNEG, rTMP - blt- L(highbit) - cntlzd rBITDIF, rBITDIF + andc rNEG, rNEG, rTMP + blt- L(highbit) + cntlzd rBITDIF, rBITDIF @@ -96,7 +144,7 @@ - cmpd cr1, rNEG, rBITDIF - sub rRTN, rWORD1, rWORD2 - blt- cr1, L(equal) + cmpd cr1, rNEG, rBITDIF + sub rRTN, rWORD1, rWORD2 + blt- cr1, L(equal) - sradi rRTN, rRTN, 63 + sradi rRTN, rRTN, 63 /* must return an int. */ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(equal): @@ -104,7 +152,7 @@ - blr - + blr + L(different): - ldu rWORD1, -8(rSTR1) + ld rWORD1, -8(rSTR1) - xor. rBITDIF, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2 - blt- L(highbit) + xor. rBITDIF, rWORD1, rWORD2 + sub rRTN, rWORD1, rWORD2 + blt- L(highbit) @@ -112,11 +160,10 @@ - ori rRTN, rRTN, 1 - blr + ori rRTN, rRTN, 1 + blr L(highbit): - srdi rWORD2, rWORD2, 56 - srdi rWORD1, rWORD1, 56 - sub rRTN, rWORD1, rWORD2 + sradi rRTN, rWORD2, 63 + ori rRTN, rRTN, 1 - blr + blr - +#endif - + /* Oh well. In this case, we just do a byte-by-byte comparison. */ - .align 4 + .align 4 diff --git a/SOURCES/glibc-ppc64le-28.patch b/SOURCES/glibc-ppc64le-28.patch index e4451b1f..05f63e9a 100644 --- a/SOURCES/glibc-ppc64le-28.patch +++ b/SOURCES/glibc-ppc64le-28.patch @@ -1,27 +1,27 @@ # commit 43b84013714c46e6dcae4a5564c5527777ad5e08 # Author: Alan Modra # Date: Sat Aug 17 18:45:31 2013 +0930 -# +# # PowerPC LE strcpy # http://sourceware.org/ml/libc-alpha/2013-08/msg00100.html -# +# # The strcpy changes for little-endian are quite straight-forward, just # a matter of rotating the last word differently. -# +# # I'll note that the powerpc64 version of stpcpy is just begging to be # converted to use 64-bit loads and stores.. -# +# # * sysdeps/powerpc/powerpc64/strcpy.S: Add little-endian support: # * sysdeps/powerpc/powerpc32/strcpy.S: Likewise. # * sysdeps/powerpc/powerpc64/stpcpy.S: Likewise. # * sysdeps/powerpc/powerpc32/stpcpy.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 @@ -74,7 +74,22 @@ - - mr rALT, rWORD + + mr rALT, rWORD /* We've hit the end of the string. Do the rest byte-by-byte. */ -L(g1): rlwinm. rTMP, rALT, 8, 24, 31 +L(g1): @@ -40,23 +40,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S glibc-2.17-c758 + blr +#else + rlwinm. rTMP, rALT, 8, 24, 31 - stbu rTMP, 4(rDEST) - beqlr- - rlwinm. rTMP, rALT, 16, 24, 31 + stbu rTMP, 4(rDEST) + beqlr- + rlwinm. rTMP, rALT, 16, 24, 31 @@ -87,6 +102,7 @@ - CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) - STORE_RETURN_VALUE (rDEST) - blr + CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) + STORE_RETURN_VALUE (rDEST) + blr +#endif - + /* Oh well. In this case, we just do a byte-by-byte copy. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500 @@ -78,7 +78,22 @@ - - mr rALT, rWORD + + mr rALT, rWORD /* We've hit the end of the string. Do the rest byte-by-byte. */ -L(g1): rlwinm. rTMP, rALT, 8, 24, 31 +L(g1): @@ -75,23 +75,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S glibc-2.17-c758 + blr +#else + rlwinm. rTMP, rALT, 8, 24, 31 - stb rTMP, 4(rDEST) - beqlr- - rlwinm. rTMP, rALT, 16, 24, 31 + stb rTMP, 4(rDEST) + beqlr- + rlwinm. rTMP, rALT, 16, 24, 31 @@ -90,6 +105,7 @@ - stb rALT, 7(rDEST) - /* GKM FIXME: check high bound. */ - blr + stb rALT, 7(rDEST) + /* GKM FIXME: check high bound. */ + blr +#endif - + /* Oh well. In this case, we just do a byte-by-byte copy. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 @@ -75,7 +75,22 @@ - - mr rALT, rWORD + + mr rALT, rWORD /* We've hit the end of the string. Do the rest byte-by-byte. */ -L(g1): rlwinm. rTMP, rALT, 8, 24, 31 +L(g1): @@ -110,22 +110,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S glibc-2.17-c758 + blr +#else + rlwinm. rTMP, rALT, 8, 24, 31 - stbu rTMP, 4(rDEST) - beqlr- - rlwinm. rTMP, rALT, 16, 24, 31 + stbu rTMP, 4(rDEST) + beqlr- + rlwinm. rTMP, rALT, 16, 24, 31 @@ -88,6 +103,7 @@ - CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) - STORE_RETURN_VALUE (rDEST) - blr + CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) + STORE_RETURN_VALUE (rDEST) + blr +#endif - + /* Oh well. In this case, we just do a byte-by-byte copy. */ - .align 4 + .align 4 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500 @@ -90,6 +90,32 @@ - mr rALT, rWORD + mr rALT, rWORD /* We've hit the end of the string. Do the rest byte-by-byte. */ L(g1): +#ifdef __LITTLE_ENDIAN__ @@ -154,14 +154,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S glibc-2.17-c758 + stb rTMP, 15(rDEST) + blr +#else - extrdi. rTMP, rALT, 8, 0 - stb rTMP, 8(rDEST) - beqlr- + extrdi. rTMP, rALT, 8, 0 + stb rTMP, 8(rDEST) + beqlr- @@ -114,6 +140,7 @@ - stb rALT, 15(rDEST) - /* GKM FIXME: check high bound. */ - blr + stb rALT, 15(rDEST) + /* GKM FIXME: check high bound. */ + blr +#endif - + /* Oh well. In this case, we just do a byte-by-byte copy. */ - .align 4 + .align 4 diff --git a/SOURCES/glibc-ppc64le-29.patch b/SOURCES/glibc-ppc64le-29.patch index ec5ee74f..291155e6 100644 --- a/SOURCES/glibc-ppc64le-29.patch +++ b/SOURCES/glibc-ppc64le-29.patch @@ -1,21 +1,21 @@ # commit 664318c3eb07032e2bfcf47cb2aa3c89280c19e7 # Author: Alan Modra # Date: Sat Aug 17 18:46:05 2013 +0930 -# +# # PowerPC LE strchr # http://sourceware.org/ml/libc-alpha/2013-08/msg00101.html -# +# # Adds little-endian support to optimised strchr assembly. I've also # tweaked the big-endian code a little. In power7/strchr.S there's a # check in the tail of the function that we didn't match 0 before # finding a c match, done by comparing leading zero counts. It's just # as valid, and quicker, to compare the raw output from cmpb. -# +# # Another little tweak is to use rldimi/insrdi in place of rlwimi for # the power7 strchr functions. Since rlwimi is cracked, it is a few # cycles slower. rldimi can be used on the 32-bit power7 functions # too. -# +# # * sysdeps/powerpc/powerpc64/power7/strchr.S (strchr): Add little-endian # support. Correct typos, formatting. Optimize tail. Use insrdi # rather than rlwimi. @@ -29,26 +29,26 @@ # (strchr): Add little-endian support. Comment. Move cntlzd # earlier in tail. # * sysdeps/powerpc/powerpc32/strchr.S: Likewise. -# +# Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S.orig +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S @@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr)) - beq cr7,L(null_match) - - /* Replicate byte to word. */ + beq cr7,L(null_match) + + /* Replicate byte to word. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - - /* Now r4 has a word of c bytes and r0 has - a word of null bytes. */ + + /* Now r4 has a word of c bytes and r0 has + a word of null bytes. */ @@ -48,11 +48,17 @@ ENTRY (BP_SYM(strchr)) - - /* Move the words left and right to discard the bits that are - not part of the string and to bring them back as zeros. */ + + /* Move the words left and right to discard the bits that are + not part of the string and to bring them back as zeros. */ - +#ifdef __LITTLE_ENDIAN__ + srw r10,r10,r6 @@ -56,40 +56,40 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S + slw r10,r10,r6 + slw r11,r11,r6 +#else - slw r10,r10,r6 - slw r11,r11,r6 - srw r10,r10,r6 - srw r11,r11,r6 + slw r10,r10,r6 + slw r11,r11,r6 + srw r10,r10,r6 + srw r11,r11,r6 +#endif - or r5,r10,r11 /* OR the results to speed things up. */ - cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes - have been found. */ + or r5,r10,r11 /* OR the results to speed things up. */ + cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes + have been found. */ @@ -67,7 +73,7 @@ ENTRY (BP_SYM(strchr)) - - /* Handle WORD2 of pair. */ - lwzu r12,4(r8) + + /* Handle WORD2 of pair. */ + lwzu r12,4(r8) - cmpb r10,r12,r4 + cmpb r10,r12,r4 - cmpb r11,r12,r0 - or r5,r10,r11 - cmpwi cr7,r5,0 + cmpb r11,r12,r0 + or r5,r10,r11 + cmpwi cr7,r5,0 @@ -102,22 +108,31 @@ L(loop): - bne cr6,L(done) - - /* The c/null byte must be in the second word. Adjust the address + bne cr6,L(done) + + /* The c/null byte must be in the second word. Adjust the address - again and move the result of cmpb to r10 so we can calculate the - pointer. */ + again and move the result of cmpb to r10/r11 so we can calculate + the pointer. */ - - mr r10,r6 - mr r11,r7 - addi r8,r8,4 - + + mr r10,r6 + mr r11,r7 + addi r8,r8,4 + - /* r5 has the output of the cmpb instruction, that is, it contains + /* r10/r11 have the output of the cmpb instructions, that is, - 0xff in the same position as the c/null byte in the original - word from the string. Use that to calculate the pointer. */ + 0xff in the same position as the c/null byte in the original + word from the string. Use that to calculate the pointer. */ L(done): - cntlzw r4,r10 /* Count leading zeroes before c matches. */ - cntlzw r0,r11 /* Count leading zeroes before null matches. */ @@ -105,17 +105,17 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S +#else + cntlzw r0,r10 /* Count leading zeros before c matches. */ + cmplw cr7,r11,r10 - bgt cr7,L(no_match) + bgt cr7,L(no_match) - srwi r0,r4,3 /* Convert leading zeroes to bytes. */ +#endif + srwi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching c byte - or null in case c was not found. */ - blr + add r3,r8,r0 /* Return address of the matching c byte + or null in case c was not found. */ + blr @@ -135,10 +150,14 @@ L(null_match): - cmpb r5,r12,r0 /* Compare each byte against null bytes. */ - - /* Move the words left and right to discard the bits that are + cmpb r5,r12,r0 /* Compare each byte against null bytes. */ + + /* Move the words left and right to discard the bits that are - not part of the string and to bring them back as zeros. */ - + not part of the string and bring them back as zeros. */ @@ -123,104 +123,104 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S + srw r5,r5,r6 + slw r5,r5,r6 +#else - slw r5,r5,r6 - srw r5,r5,r6 + slw r5,r5,r6 + srw r5,r5,r6 +#endif - cmpwi cr7,r5,0 /* If r10 == 0, no c or null bytes - have been found. */ - bne cr7,L(done_null) + cmpwi cr7,r5,0 /* If r10 == 0, no c or null bytes + have been found. */ + bne cr7,L(done_null) @@ -193,7 +212,13 @@ L(loop_null): - 0xff in the same position as the null byte in the original - word from the string. Use that to calculate the pointer. */ + 0xff in the same position as the null byte in the original + word from the string. Use that to calculate the pointer. */ L(done_null): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntw r0,r0 +#else - cntlzw r0,r5 /* Count leading zeros before the match. */ + cntlzw r0,r5 /* Count leading zeros before the match. */ +#endif - srwi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching null byte. */ - blr + srwi r0,r0,3 /* Convert leading zeros to bytes. */ + add r3,r8,r0 /* Return address of the matching null byte. */ + blr Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S.orig +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul)) - clrrwi r8,r3,2 /* Align the address to word boundary. */ - - /* Replicate byte to word. */ + clrrwi r8,r3,2 /* Align the address to word boundary. */ + + /* Replicate byte to word. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - lwz r12,0(r8) /* Load word from memory. */ + + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + lwz r12,0(r8) /* Load word from memory. */ @@ -45,10 +45,17 @@ ENTRY (BP_SYM(__strchrnul)) - - /* Move the words left and right to discard the bits that are - not part of the string and bring them back as zeros. */ + + /* Move the words left and right to discard the bits that are + not part of the string and bring them back as zeros. */ +#ifdef __LITTLE_ENDIAN__ + srw r10,r10,r6 + srw r9,r9,r6 + slw r10,r10,r6 + slw r9,r9,r6 +#else - slw r10,r10,r6 - slw r9,r9,r6 - srw r10,r10,r6 - srw r9,r9,r6 + slw r10,r10,r6 + slw r9,r9,r6 + srw r10,r10,r6 + srw r9,r9,r6 +#endif - or r5,r9,r10 /* OR the results to speed things up. */ - cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes - have been found. */ + or r5,r9,r10 /* OR the results to speed things up. */ + cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes + have been found. */ @@ -56,7 +63,7 @@ ENTRY (BP_SYM(__strchrnul)) - - mtcrf 0x01,r8 - + + mtcrf 0x01,r8 + - /* Are we now aligned to a quadword boundary? If so, skip to + /* Are we now aligned to a doubleword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ - - bt 29,L(loop) + the main loop. Otherwise, go through the alignment code. */ + + bt 29,L(loop) @@ -78,7 +85,7 @@ L(loop): - single register for speed. This is an attempt - to speed up the null-checking process for bigger strings. */ - lwz r12,4(r8) + single register for speed. This is an attempt + to speed up the null-checking process for bigger strings. */ + lwz r12,4(r8) - lwzu r11,8(r8) + lwzu r11,8(r8) - cmpb r10,r12,r0 - cmpb r9,r12,r4 - cmpb r6,r11,r0 + cmpb r10,r12,r0 + cmpb r9,r12,r4 + cmpb r6,r11,r0 @@ -97,9 +104,9 @@ L(loop): - addi r8,r8,-4 - bne cr6,L(done) - + addi r8,r8,-4 + bne cr6,L(done) + - /* The c/null byte must be in the second word. Adjust the - address again and move the result of cmpb to r10 so we can calculate - the pointer. */ + /* The c/null byte must be in the second word. Adjust the address + again and move the result of cmpb to r5 so we can calculate the + pointer. */ - mr r5,r10 - addi r8,r8,4 - + mr r5,r10 + addi r8,r8,4 + @@ -107,7 +114,13 @@ L(loop): - 0xff in the same position as the c/null byte in the original - word from the string. Use that to calculate the pointer. */ + 0xff in the same position as the c/null byte in the original + word from the string. Use that to calculate the pointer. */ L(done): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntw r0,r0 +#else - cntlzw r0,r5 /* Count leading zeros before the match. */ + cntlzw r0,r5 /* Count leading zeros before the match. */ +#endif - srwi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of matching c/null byte. */ - blr + srwi r0,r0,3 /* Convert leading zeros to bytes. */ + add r3,r8,r0 /* Return address of matching c/null byte. */ + blr Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S.orig @@ -231,29 +231,29 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S #define rTMP3 r12 +#define rTMP4 rIGN +#define rTMP5 rMASK - - CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) - STORE_RETURN_BOUNDS (rTMP1, rTMP2) + + CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) + STORE_RETURN_BOUNDS (rTMP1, rTMP2) @@ -59,53 +61,74 @@ ENTRY (BP_SYM (strchr)) - addi r7F7F, r7F7F, 0x7f7f + addi r7F7F, r7F7F, 0x7f7f /* Test the first (partial?) word. */ - lwz rWORD, 0(rSTR) + lwz rWORD, 0(rSTR) +#ifdef __LITTLE_ENDIAN__ + slw rMASK, rMASK, rIGN +#else - srw rMASK, rMASK, rIGN + srw rMASK, rMASK, rIGN +#endif - orc rWORD, rWORD, rMASK - add rTMP1, rFEFE, rWORD - nor rTMP2, r7F7F, rWORD + orc rWORD, rWORD, rMASK + add rTMP1, rFEFE, rWORD + nor rTMP2, r7F7F, rWORD - and. rTMP1, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2 - xor rTMP3, rCHR, rWORD - orc rTMP3, rTMP3, rMASK - b L(loopentry) - + xor rTMP3, rCHR, rWORD + orc rTMP3, rTMP3, rMASK + b L(loopentry) + /* The loop. */ - + -L(loop):lwzu rWORD, 4(rSTR) - and. rTMP1, rTMP1, rTMP2 +L(loop): @@ -264,15 +264,15 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S - nor rTMP2, r7F7F, rWORD + add rTMP1, rFEFE, rWORD /* x - 0x01010101. */ + nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */ - bne L(foundit) + bne L(foundit) - and. rTMP1, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */ /* Start test for the bytes we're looking for. */ - xor rTMP3, rCHR, rWORD + xor rTMP3, rCHR, rWORD L(loopentry): - add rTMP1, rFEFE, rTMP3 - nor rTMP2, r7F7F, rTMP3 - beq L(loop) + add rTMP1, rFEFE, rTMP3 + nor rTMP2, r7F7F, rTMP3 + beq L(loop) + /* There is a zero byte in the word, but may also be a matching byte (either before or after the zero byte). In fact, we may be looking for a @@ -282,9 +282,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S - and. rTMP1, rTMP1, rTMP2 + zero byte, in which case we return a match. */ + and. rTMP5, rTMP1, rTMP2 - li rRTN, 0 - STORE_RETURN_VALUE (rSTR) - beqlr + li rRTN, 0 + STORE_RETURN_VALUE (rSTR) + beqlr -/* It did happen. Decide which one was first... - I'm not sure if this is actually faster than a sequence of - rotates, compares, and branches (we use it anyway because it's shorter). */ @@ -307,29 +307,29 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S +/* I think we could reduce this by two instructions by keeping the "nor" + results from the loop for reuse here. See strlen.S tail. Similarly + one instruction could be pruned from L(foundit). */ - and rFEFE, r7F7F, rWORD + and rFEFE, r7F7F, rWORD - or rMASK, r7F7F, rWORD + or rTMP5, r7F7F, rWORD - and rTMP1, r7F7F, rTMP3 + and rTMP1, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3 - add rFEFE, rFEFE, r7F7F - add rTMP1, rTMP1, r7F7F + add rFEFE, rFEFE, r7F7F + add rTMP1, rTMP1, r7F7F - nor rWORD, rMASK, rFEFE - nor rTMP2, rIGN, rTMP1 + nor rWORD, rTMP5, rFEFE + nor rTMP2, rTMP4, rTMP1 + cntlzw rCLZB, rTMP2 - cmplw rWORD, rTMP2 - bgtlr + cmplw rWORD, rTMP2 + bgtlr - cntlzw rCLZB, rTMP2 +#endif - srwi rCLZB, rCLZB, 3 - add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) + srwi rCLZB, rCLZB, 3 + add rRTN, rSTR, rCLZB + CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) @@ -113,13 +136,21 @@ L(missed): - blr - + blr + L(foundit): +#ifdef __LITTLE_ENDIAN__ + addi rTMP1, rTMP5, -1 @@ -338,38 +338,38 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S + subfic rCLZB, rCLZB, 32-7-32 + srawi rCLZB, rCLZB, 3 +#else - and rTMP1, r7F7F, rTMP3 + and rTMP1, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3 - add rTMP1, rTMP1, r7F7F + add rTMP1, rTMP1, r7F7F - nor rTMP2, rIGN, rTMP1 + nor rTMP2, rTMP4, rTMP1 - cntlzw rCLZB, rTMP2 - subi rSTR, rSTR, 4 - srwi rCLZB, rCLZB, 3 + cntlzw rCLZB, rTMP2 + subi rSTR, rSTR, 4 + srwi rCLZB, rCLZB, 3 +#endif - add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) - STORE_RETURN_VALUE (rSTR) + add rRTN, rSTR, rCLZB + CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) + STORE_RETURN_VALUE (rSTR) Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S.orig +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S @@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr)) - beq cr7,L(null_match) - - /* Replicate byte to doubleword. */ + beq cr7,L(null_match) + + /* Replicate byte to doubleword. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - insrdi r4,r4,32,0 - - /* Now r4 has a doubleword of c bytes and r0 has + insrdi r4,r4,32,0 + + /* Now r4 has a doubleword of c bytes and r0 has @@ -49,11 +49,17 @@ ENTRY (BP_SYM(strchr)) - - /* Move the doublewords left and right to discard the bits that are - not part of the string and bring them back as zeros. */ + + /* Move the doublewords left and right to discard the bits that are + not part of the string and bring them back as zeros. */ - +#ifdef __LITTLE_ENDIAN__ + srd r10,r10,r6 @@ -377,22 +377,22 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S + sld r10,r10,r6 + sld r11,r11,r6 +#else - sld r10,r10,r6 - sld r11,r11,r6 - srd r10,r10,r6 - srd r11,r11,r6 + sld r10,r10,r6 + sld r11,r11,r6 + srd r10,r10,r6 + srd r11,r11,r6 +#endif - or r5,r10,r11 /* OR the results to speed things up. */ - cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes - have been found. */ + or r5,r10,r11 /* OR the results to speed things up. */ + cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes + have been found. */ @@ -110,15 +116,24 @@ L(loop): - mr r11,r7 - addi r8,r8,8 - + mr r11,r7 + addi r8,r8,8 + - /* r5 has the output of the cmpb instruction, that is, it contains + /* r10/r11 have the output of the cmpb instructions, that is, - 0xff in the same position as the c/null byte in the original - doubleword from the string. Use that to calculate the pointer. */ + 0xff in the same position as the c/null byte in the original + doubleword from the string. Use that to calculate the pointer. */ L(done): - cntlzd r4,r10 /* Count leading zeroes before c matches. */ - cntlzd r0,r11 /* Count leading zeroes before null matches. */ @@ -404,7 +404,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S + addi r4,r11,-1 + andc r4,r4,r11 + cmpld cr7,r3,r4 - bgt cr7,L(no_match) + bgt cr7,L(no_match) - srdi r0,r4,3 /* Convert leading zeroes to bytes. */ +#else + cntlzd r0,r10 /* Count leading zeros before c matches. */ @@ -412,94 +412,94 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S + bgt cr7,L(no_match) +#endif + srdi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching c byte - or null in case c was not found. */ - blr + add r3,r8,r0 /* Return address of the matching c byte + or null in case c was not found. */ + blr @@ -137,9 +152,13 @@ L(null_match): - - /* Move the doublewords left and right to discard the bits that are - not part of the string and bring them back as zeros. */ + + /* Move the doublewords left and right to discard the bits that are + not part of the string and bring them back as zeros. */ - +#ifdef __LITTLE_ENDIAN__ + srd r5,r5,r6 + sld r5,r5,r6 +#else - sld r5,r5,r6 - srd r5,r5,r6 + sld r5,r5,r6 + srd r5,r5,r6 +#endif - cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes - have been found. */ - bne cr7,L(done_null) + cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes + have been found. */ + bne cr7,L(done_null) @@ -194,7 +213,13 @@ L(loop_null): - 0xff in the same position as the null byte in the original - doubleword from the string. Use that to calculate the pointer. */ + 0xff in the same position as the null byte in the original + doubleword from the string. Use that to calculate the pointer. */ L(done_null): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntd r0,r0 +#else - cntlzd r0,r5 /* Count leading zeros before the match. */ + cntlzd r0,r5 /* Count leading zeros before the match. */ +#endif - srdi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching null byte. */ - blr + srdi r0,r0,3 /* Convert leading zeros to bytes. */ + add r3,r8,r0 /* Return address of the matching null byte. */ + blr Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S.orig +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul)) - clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ - - /* Replicate byte to doubleword. */ + clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ + + /* Replicate byte to doubleword. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - insrdi r4,r4,32,0 - - rlwinm r6,r3,3,26,28 /* Calculate padding. */ + insrdi r4,r4,32,0 + + rlwinm r6,r3,3,26,28 /* Calculate padding. */ @@ -46,10 +46,17 @@ ENTRY (BP_SYM(__strchrnul)) - - /* Move the doublewords left and right to discard the bits that are - not part of the string and to bring them back as zeros. */ + + /* Move the doublewords left and right to discard the bits that are + not part of the string and to bring them back as zeros. */ +#ifdef __LITTLE_ENDIAN__ + srd r10,r10,r6 + srd r9,r9,r6 + sld r10,r10,r6 + sld r9,r9,r6 +#else - sld r10,r10,r6 - sld r9,r9,r6 - srd r10,r10,r6 - srd r9,r9,r6 + sld r10,r10,r6 + sld r9,r9,r6 + srd r10,r10,r6 + srd r9,r9,r6 +#endif - or r5,r9,r10 /* OR the results to speed things up. */ - cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes - have been found. */ + or r5,r9,r10 /* OR the results to speed things up. */ + cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes + have been found. */ @@ -99,7 +106,7 @@ L(loop): - bne cr6,L(done) - - /* The c/null byte must be in the second doubleword. Adjust the + bne cr6,L(done) + + /* The c/null byte must be in the second doubleword. Adjust the - address again and move the result of cmpb to r10 so we can calculate + address again and move the result of cmpb to r5 so we can calculate - the pointer. */ - mr r5,r10 - addi r8,r8,8 + the pointer. */ + mr r5,r10 + addi r8,r8,8 @@ -108,7 +115,13 @@ L(loop): - 0xff in the same position as the c/null byte in the original - doubleword from the string. Use that to calculate the pointer. */ + 0xff in the same position as the c/null byte in the original + doubleword from the string. Use that to calculate the pointer. */ L(done): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntd r0,r0 +#else - cntlzd r0,r5 /* Count leading zeros before the match. */ + cntlzd r0,r5 /* Count leading zeros before the match. */ +#endif - srdi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of matching c/null byte. */ - blr + srdi r0,r0,3 /* Convert leading zeros to bytes. */ + add r3,r8,r0 /* Return address of matching c/null byte. */ + blr Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S =================================================================== --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S.orig @@ -510,39 +510,39 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S #define rTMP3 r12 +#define rTMP4 rIGN +#define rTMP5 rMASK - - CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) - STORE_RETURN_BOUNDS (rTMP1, rTMP2) - - dcbt 0,rRTN + + CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) + STORE_RETURN_BOUNDS (rTMP1, rTMP2) + + dcbt 0,rRTN - rlwimi rCHR, rCHR, 8, 16, 23 + insrdi rCHR, rCHR, 8, 48 - li rMASK, -1 + li rMASK, -1 - rlwimi rCHR, rCHR, 16, 0, 15 + insrdi rCHR, rCHR, 16, 32 - rlwinm rIGN, rRTN, 3, 26, 28 - insrdi rCHR, rCHR, 32, 0 - lis rFEFE, -0x101 + rlwinm rIGN, rRTN, 3, 26, 28 + insrdi rCHR, rCHR, 32, 0 + lis rFEFE, -0x101 @@ -70,53 +72,74 @@ ENTRY (BP_SYM (strchr)) - add rFEFE, rFEFE, rTMP1 + add rFEFE, rFEFE, rTMP1 /* Test the first (partial?) word. */ - ld rWORD, 0(rSTR) + ld rWORD, 0(rSTR) +#ifdef __LITTLE_ENDIAN__ + sld rMASK, rMASK, rIGN +#else - srd rMASK, rMASK, rIGN + srd rMASK, rMASK, rIGN +#endif - orc rWORD, rWORD, rMASK - add rTMP1, rFEFE, rWORD - nor rTMP2, r7F7F, rWORD + orc rWORD, rWORD, rMASK + add rTMP1, rFEFE, rWORD + nor rTMP2, r7F7F, rWORD - and. rTMP1, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2 - xor rTMP3, rCHR, rWORD - orc rTMP3, rTMP3, rMASK - b L(loopentry) - + xor rTMP3, rCHR, rWORD + orc rTMP3, rTMP3, rMASK + b L(loopentry) + /* The loop. */ - + -L(loop):ldu rWORD, 8(rSTR) - and. rTMP1, rTMP1, rTMP2 +L(loop): @@ -553,15 +553,15 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S - nor rTMP2, r7F7F, rWORD + add rTMP1, rFEFE, rWORD /* x - 0x01010101. */ + nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */ - bne L(foundit) + bne L(foundit) - and. rTMP1, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */ /* Start test for the bytes we're looking for. */ - xor rTMP3, rCHR, rWORD + xor rTMP3, rCHR, rWORD L(loopentry): - add rTMP1, rFEFE, rTMP3 - nor rTMP2, r7F7F, rTMP3 - beq L(loop) + add rTMP1, rFEFE, rTMP3 + nor rTMP2, r7F7F, rTMP3 + beq L(loop) + /* There is a zero byte in the word, but may also be a matching byte (either before or after the zero byte). In fact, we may be looking for a @@ -571,9 +571,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S - and. rTMP1, rTMP1, rTMP2 + zero byte, in which case we return a match. */ + and. rTMP5, rTMP1, rTMP2 - li rRTN, 0 - STORE_RETURN_VALUE (rSTR) - beqlr + li rRTN, 0 + STORE_RETURN_VALUE (rSTR) + beqlr -/* It did happen. Decide which one was first... - I'm not sure if this is actually faster than a sequence of - rotates, compares, and branches (we use it anyway because it's shorter). */ @@ -596,29 +596,29 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S +/* I think we could reduce this by two instructions by keeping the "nor" + results from the loop for reuse here. See strlen.S tail. Similarly + one instruction could be pruned from L(foundit). */ - and rFEFE, r7F7F, rWORD + and rFEFE, r7F7F, rWORD - or rMASK, r7F7F, rWORD + or rTMP5, r7F7F, rWORD - and rTMP1, r7F7F, rTMP3 + and rTMP1, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3 - add rFEFE, rFEFE, r7F7F - add rTMP1, rTMP1, r7F7F + add rFEFE, rFEFE, r7F7F + add rTMP1, rTMP1, r7F7F - nor rWORD, rMASK, rFEFE - nor rTMP2, rIGN, rTMP1 + nor rWORD, rTMP5, rFEFE + nor rTMP2, rTMP4, rTMP1 + cntlzd rCLZB, rTMP2 - cmpld rWORD, rTMP2 - bgtlr + cmpld rWORD, rTMP2 + bgtlr - cntlzd rCLZB, rTMP2 +#endif - srdi rCLZB, rCLZB, 3 - add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) + srdi rCLZB, rCLZB, 3 + add rRTN, rSTR, rCLZB + CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) @@ -124,13 +147,21 @@ L(missed): - blr - + blr + L(foundit): +#ifdef __LITTLE_ENDIAN__ + addi rTMP1, rTMP5, -1 @@ -627,16 +627,16 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S + subfic rCLZB, rCLZB, 64-7-64 + sradi rCLZB, rCLZB, 3 +#else - and rTMP1, r7F7F, rTMP3 + and rTMP1, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3 - add rTMP1, rTMP1, r7F7F + add rTMP1, rTMP1, r7F7F - nor rTMP2, rIGN, rTMP1 + nor rTMP2, rTMP4, rTMP1 - cntlzd rCLZB, rTMP2 - subi rSTR, rSTR, 8 - srdi rCLZB, rCLZB, 3 + cntlzd rCLZB, rTMP2 + subi rSTR, rSTR, 8 + srdi rCLZB, rCLZB, 3 +#endif - add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) - STORE_RETURN_VALUE (rSTR) + add rRTN, rSTR, rCLZB + CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) + STORE_RETURN_VALUE (rSTR) diff --git a/SOURCES/glibc-ppc64le-30.patch b/SOURCES/glibc-ppc64le-30.patch index 68fa8261..3834dcc8 100644 --- a/SOURCES/glibc-ppc64le-30.patch +++ b/SOURCES/glibc-ppc64le-30.patch @@ -1,10 +1,10 @@ # commit fe6e95d7171eba5f3e07848f081676fae4e86322 # Author: Alan Modra # Date: Sat Aug 17 18:46:47 2013 +0930 -# +# # PowerPC LE memcmp # http://sourceware.org/ml/libc-alpha/2013-08/msg00102.html -# +# # This is a rather large patch due to formatting and renaming. The # formatting changes were to make it possible to compare power7 and # power4 versions of memcmp. Using different register defines came @@ -18,11 +18,11 @@ # in the main loop; Offsets to reload the regs were different first # time around the loop.. Anyway, I left the cr field usage changes in # place for consistency. -# +# # Aside from these more-or-less cosmetic changes, I fixed a number of # places where an early exit path restores regs unnecessarily, removed # some dead code, and optimised one or two exits. -# +# # * sysdeps/powerpc/powerpc64/power7/memcmp.S: Add little-endian support. # Formatting. Consistently use rXXX register defines or rN defines. # Use early exit labels that avoid restoring unused non-volatile regs. @@ -33,7 +33,7 @@ # * sysdeps/powerpc/powerpc32/power7/memcmp.S: Likewise. Exit with # addi 1,1,64 to pop stack frame. Simplify return value code. # * sysdeps/powerpc/powerpc32/power4/memcmp.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S 2014-05-28 19:22:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S 2014-05-28 23:55:52.000000000 -0500 @@ -42,21 +42,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. +/* Optimized strcmp implementation for PowerPC32. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. - + @@ -20,13 +20,14 @@ #include #include - + -/* int [r3] memcmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */ - +/* int [r3] memcmp (const char *s1 [r3], + const char *s2 [r4], + size_t size [r5]) */ -+ - .machine power4 ++ + .machine power4 EALIGN (BP_SYM(memcmp), 4, 0) - CALL_MCOUNT - + CALL_MCOUNT + -#define rTMP r0 #define rRTN r3 #define rSTR1 r3 /* first string arg */ @@ -68,45 +68,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. -#define rBITDIF r12 /* bits that differ in s1 & s2 words */ #define rWORD7 r30 /* next word in s1 */ #define rWORD8 r31 /* next word in s2 */ - + - xor rTMP, rSTR2, rSTR1 + xor r0, rSTR2, rSTR1 - cmplwi cr6, rN, 0 - cmplwi cr1, rN, 12 + cmplwi cr6, rN, 0 + cmplwi cr1, rN, 12 - clrlwi. rTMP, rTMP, 30 - clrlwi rBITDIF, rSTR1, 30 - cmplwi cr5, rBITDIF, 0 + clrlwi. r0, r0, 30 + clrlwi r12, rSTR1, 30 + cmplwi cr5, r12, 0 - beq- cr6, L(zeroLength) + beq- cr6, L(zeroLength) - dcbt 0,rSTR1 - dcbt 0,rSTR2 + dcbt 0, rSTR1 + dcbt 0, rSTR2 /* If less than 8 bytes or not aligned, use the unaligned byte loop. */ - blt cr1, L(bytealigned) + blt cr1, L(bytealigned) - stwu 1,-64(1) + stwu 1, -64(r1) - cfi_adjust_cfa_offset(64) -- stw r31,48(1) + cfi_adjust_cfa_offset(64) +- stw r31,48(1) - cfi_offset(31,(48-64)) -- stw r30,44(1) +- stw r30,44(1) - cfi_offset(30,(44-64)) + stw rWORD8, 48(r1) + cfi_offset(rWORD8, (48-64)) + stw rWORD7, 44(r1) + cfi_offset(rWORD7, (44-64)) - bne L(unaligned) + bne L(unaligned) /* At this point we know both strings have the same alignment and the - compare length is at least 8 bytes. rBITDIF contains the low order + compare length is at least 8 bytes. r12 contains the low order 2 bits of rSTR1 and cr5 contains the result of the logical compare -- of rBITDIF to 0. If rBITDIF == 0 then we are already word +- of rBITDIF to 0. If rBITDIF == 0 then we are already word + of r12 to 0. If r12 == 0 then we are already word aligned and can perform the word aligned loop. - + Otherwise we know the two strings have the same alignment (but not @@ -72,74 +72,95 @@ eliminate bits preceeding the first byte. Since we want to join the @@ -118,9 +118,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - .align 4 + .align 4 L(samealignment): - clrrwi rSTR1, rSTR1, 2 - clrrwi rSTR2, rSTR2, 2 - beq cr5, L(Waligned) + clrrwi rSTR1, rSTR1, 2 + clrrwi rSTR2, rSTR2, 2 + beq cr5, L(Waligned) - add rN, rN, rBITDIF - slwi r11, rBITDIF, 3 - srwi rTMP, rN, 4 /* Divide by 16 */ @@ -135,19 +135,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 0(rSTR1) - lwz rWORD2, 0(rSTR2) + lwz rWORD1, 0(rSTR1) + lwz rWORD2, 0(rSTR2) - cmplwi cr1, rBITDIF, 8 +#endif + cmplwi cr1, r12, 8 - cmplwi cr7, rN, 16 - clrlwi rN, rN, 30 - beq L(dPs4) + cmplwi cr7, rN, 16 + clrlwi rN, rN, 30 + beq L(dPs4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ - bgt cr1, L(dPs3) - beq cr1, L(dPs2) - + bgt cr1, L(dPs3) + beq cr1, L(dPs2) + /* Remainder is 4 */ - .align 3 + .align 3 @@ -156,8 +156,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - slw rWORD6, rWORD2, r11 + slw rWORD5, rWORD1, rWORD6 + slw rWORD6, rWORD2, rWORD6 - cmplw cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmplw cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) /* Do something useful in this cycle since we have to branch anyway. */ +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 @@ -165,12 +165,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 - b L(dP1e) + b L(dP1e) /* Remainder is 8 */ - .align 4 + .align 4 @@ -179,8 +179,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - slw rWORD6, rWORD2, r11 + slw rWORD5, rWORD1, rWORD6 + slw rWORD6, rWORD2, rWORD6 - cmplw cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmplw cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) /* Do something useful in this cycle since we have to branch anyway. */ +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD7, 0, rSTR1 @@ -188,11 +188,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD7, 4(rSTR1) - lwz rWORD8, 4(rSTR2) + lwz rWORD7, 4(rSTR1) + lwz rWORD8, 4(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 - b L(dP2e) + cmplw cr5, rWORD7, rWORD8 + b L(dP2e) /* Remainder is 12 */ - .align 4 + .align 4 @@ -201,8 +201,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - slw rWORD4, rWORD2, r11 + slw rWORD3, rWORD1, rWORD6 + slw rWORD4, rWORD2, rWORD6 - cmplw cr1, rWORD3, rWORD4 - b L(dP3e) + cmplw cr1, rWORD3, rWORD4 + b L(dP3e) /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 @@ -215,8 +215,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD1, rWORD1, rWORD6 + slw rWORD2, rWORD2, rWORD6 + cmplw cr7, rWORD1, rWORD2 - b L(dP4e) - + b L(dP4e) + /* At this point we know both strings are word aligned and the compare length is at least 8 bytes. */ - .align 4 @@ -228,12 +228,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + andi. r12, rN, 12 /* Get the word remainder */ + srwi r0, rN, 4 /* Divide by 16 */ + cmplwi cr1, r12, 8 - cmplwi cr7, rN, 16 - clrlwi rN, rN, 30 - beq L(dP4) + cmplwi cr7, rN, 16 + clrlwi rN, rN, 30 + beq L(dP4) @@ -147,177 +168,352 @@ - beq cr1, L(dP2) - + beq cr1, L(dP2) + /* Remainder is 4 */ - .align 4 + .align 4 @@ -244,7 +244,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. (8-15 byte compare), we want to use only volatile registers. This means we can avoid restoring non-volatile registers since we did not change any on the early exit path. The key here is the non-early - exit path only cares about the condition code (cr5), not about which + exit path only cares about the condition code (cr5), not about which register pair was used. */ +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD5, 0, rSTR1 @@ -252,19 +252,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 0(rSTR1) - lwz rWORD6, 0(rSTR2) + lwz rWORD5, 0(rSTR1) + lwz rWORD6, 0(rSTR2) +#endif - cmplw cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmplw cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 + lwbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 @@ -275,23 +275,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 8(rSTR1) - lwz rWORD4, 8(rSTR2) + lwz rWORD3, 8(rSTR1) + lwz rWORD4, 8(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD5, 0, rSTR1 + lwbrx rWORD6, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 12(rSTR1) - lwz rWORD6, 12(rSTR2) + lwz rWORD5, 12(rSTR1) + lwz rWORD6, 12(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 + cmplw cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5) - bne cr0, L(dLcr0) -- +- + bne cr5, L(dLcr5x) + bne cr7, L(dLcr7x) + @@ -301,13 +301,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwzu rWORD7, 16(rSTR1) - lwzu rWORD8, 16(rSTR2) + lwzu rWORD7, 16(rSTR1) + lwzu rWORD8, 16(rSTR2) +#endif - bne cr1, L(dLcr1) - cmplw cr5, rWORD7, rWORD8 - bdnz L(dLoop) - bne cr6, L(dLcr6) + bne cr1, L(dLcr1) + cmplw cr5, rWORD7, rWORD8 + bdnz L(dLoop) + bne cr6, L(dLcr6) - lwz r30,44(1) - lwz r31,48(1) - .align 3 @@ -315,17 +315,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD8, 48(r1) + .align 3 L(dP1x): - slwi. r12, rN, 3 + slwi. r12, rN, 3 - bne cr5, L(dLcr5) + bne cr5, L(dLcr5x) - subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ - lwz 1,0(1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) - li rRTN, 0 - blr - + bne L(d00) + li rRTN, 0 + blr + /* Remainder is 8 */ - .align 4 + .align 4 @@ -339,21 +339,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 0(rSTR1) - lwz rWORD6, 0(rSTR2) + lwz rWORD5, 0(rSTR1) + lwz rWORD6, 0(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmplw cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD7, 0, rSTR1 + lwbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD7, 4(rSTR1) - lwz rWORD8, 4(rSTR2) + lwz rWORD7, 4(rSTR1) + lwz rWORD8, 4(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 L(dP2e): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 @@ -361,8 +361,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 8(rSTR1) - lwz rWORD2, 8(rSTR2) + lwz rWORD1, 8(rSTR1) + lwz rWORD2, 8(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 @@ -372,17 +372,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 12(rSTR1) - lwz rWORD4, 12(rSTR2) + lwz rWORD3, 12(rSTR1) + lwz rWORD4, 12(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 4 - addi rSTR2, rSTR2, 4 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#endif - bne cr6, L(dLcr6) - bne cr5, L(dLcr5) - b L(dLoop2) + bne cr6, L(dLcr6) + bne cr5, L(dLcr5) + b L(dLoop2) /* Again we are on a early exit path (16-23 byte compare), we want to only use volatile registers and avoid restoring non-volatile registers. */ @@ -395,28 +395,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 4(rSTR1) - lwz rWORD4, 4(rSTR2) + lwz rWORD3, 4(rSTR1) + lwz rWORD4, 4(rSTR2) - cmplw cr5, rWORD3, rWORD4 +#endif + cmplw cr1, rWORD3, rWORD4 - slwi. r12, rN, 3 + slwi. r12, rN, 3 - bne cr6, L(dLcr6) + bne cr6, L(dLcr6x) +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 4 - addi rSTR2, rSTR2, 4 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 - bne cr5, L(dLcr5) +#endif + bne cr1, L(dLcr1x) - subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ - lwz 1,0(1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) - li rRTN, 0 - blr - + bne L(d00) + li rRTN, 0 + blr + /* Remainder is 12 */ - .align 4 + .align 4 @@ -430,10 +430,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 0(rSTR1) - lwz rWORD4, 0(rSTR2) + lwz rWORD3, 0(rSTR1) + lwz rWORD4, 0(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 L(dP3e): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD5, 0, rSTR1 @@ -441,39 +441,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 4(rSTR1) - lwz rWORD6, 4(rSTR2) + lwz rWORD5, 4(rSTR1) + lwz rWORD6, 4(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - blt cr7, L(dP3x) + cmplw cr6, rWORD5, rWORD6 + blt cr7, L(dP3x) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD7, 0, rSTR1 + lwbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD7, 8(rSTR1) - lwz rWORD8, 8(rSTR2) + lwz rWORD7, 8(rSTR1) + lwz rWORD8, 8(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 + lwbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 12(rSTR1) - lwz rWORD2, 12(rSTR2) + lwz rWORD1, 12(rSTR1) + lwz rWORD2, 12(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#endif - bne cr1, L(dLcr1) - bne cr6, L(dLcr6) - b L(dLoop1) + bne cr1, L(dLcr1) + bne cr6, L(dLcr6) + b L(dLoop1) /* Again we are on a early exit path (24-31 byte compare), we want to only use volatile registers and avoid restoring non-volatile registers. */ @@ -486,30 +486,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 8(rSTR1) - lwz rWORD2, 8(rSTR2) + lwz rWORD1, 8(rSTR1) + lwz rWORD2, 8(rSTR2) - cmplw cr5, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 - slwi. r12, rN, 3 + slwi. r12, rN, 3 - bne cr1, L(dLcr1) + bne cr1, L(dLcr1x) +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 - bne cr6, L(dLcr6) +#endif + bne cr6, L(dLcr6x) - subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ - bne cr5, L(dLcr5) - lwz 1,0(1) + bne cr7, L(dLcr7x) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) - li rRTN, 0 - blr - + bne L(d00) + li rRTN, 0 + blr + /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 @@ -523,8 +523,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 0(rSTR1) - lwz rWORD2, 0(rSTR2) + lwz rWORD1, 0(rSTR1) + lwz rWORD2, 0(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 @@ -535,34 +535,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 4(rSTR1) - lwz rWORD4, 4(rSTR2) + lwz rWORD3, 4(rSTR1) + lwz rWORD4, 4(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD5, 0, rSTR1 + lwbrx rWORD6, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 8(rSTR1) - lwz rWORD6, 8(rSTR2) + lwz rWORD5, 8(rSTR1) + lwz rWORD6, 8(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 + cmplw cr6, rWORD5, rWORD6 +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD7, 0, rSTR1 + lwbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwzu rWORD7, 12(rSTR1) - lwzu rWORD8, 12(rSTR2) + lwzu rWORD7, 12(rSTR1) + lwzu rWORD8, 12(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) - bne cr1, L(dLcr1) - bdz- L(d24) /* Adjust CTR as we start with +4 */ + bne cr1, L(dLcr1) + bdz- L(d24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 @@ -573,11 +573,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 - bne cr6, L(dLcr6) + cmplw cr1, rWORD3, rWORD4 + bne cr6, L(dLcr6) L(dLoop1): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD3, 0, rSTR1 @@ -585,11 +585,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 8(rSTR1) - lwz rWORD4, 8(rSTR2) + lwz rWORD3, 8(rSTR1) + lwz rWORD4, 8(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5) + cmplw cr6, rWORD5, rWORD6 + bne cr5, L(dLcr5) L(dLoop2): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD5, 0, rSTR1 @@ -597,10 +597,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 12(rSTR1) - lwz rWORD6, 12(rSTR2) + lwz rWORD5, 12(rSTR1) + lwz rWORD6, 12(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) L(dLoop3): @@ -610,27 +610,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwzu rWORD7, 16(rSTR1) - lwzu rWORD8, 16(rSTR2) + lwzu rWORD7, 16(rSTR1) + lwzu rWORD8, 16(rSTR2) +#endif - bne- cr1, L(dLcr1) + bne- cr1, L(dLcr1) - cmplw cr0, rWORD1, rWORD2 + cmplw cr7, rWORD1, rWORD2 - bdnz+ L(dLoop) - + bdnz+ L(dLoop) + L(dL4): @@ -327,7 +523,7 @@ - bne cr5, L(dLcr5) - cmplw cr5, rWORD7, rWORD8 + bne cr5, L(dLcr5) + cmplw cr5, rWORD7, rWORD8 L(d44): - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) L(d34): - bne cr1, L(dLcr1) + bne cr1, L(dLcr1) L(d24): @@ -336,69 +532,82 @@ - slwi. r12, rN, 3 - bne cr5, L(dLcr5) + slwi. r12, rN, 3 + bne cr5, L(dLcr5) L(d04): - lwz r30,44(1) - lwz r31,48(1) @@ -639,11 +639,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD8, 48(r1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ - beq L(zeroLength) + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + beq L(zeroLength) /* At this point we have a remainder of 1 to 3 bytes to compare. Since we are aligned it is safe to load the whole word, and use -- shift right to eliminate bits beyond the compare length. */ +- shift right to eliminate bits beyond the compare length. */ + shift right to eliminate bits beyond the compare length. */ L(d00): +#ifdef __LITTLE_ENDIAN__ @@ -652,11 +652,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) +#endif - srw rWORD1, rWORD1, rN - srw rWORD2, rWORD2, rN + srw rWORD1, rWORD1, rN + srw rWORD2, rWORD2, rN - cmplw rWORD1,rWORD2 - li rRTN,0 - beqlr @@ -678,14 +678,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD7, 44(r1) + lwz rWORD8, 48(r1) +L(dLcr7x): - li rRTN, 1 + li rRTN, 1 - lwz 1,0(1) - bgtlr cr0 + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) + bgtlr cr7 - li rRTN, -1 - blr + li rRTN, -1 + blr - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) @@ -695,13 +695,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD7, 44(r1) + lwz rWORD8, 48(r1) +L(dLcr1x): - li rRTN, 1 + li rRTN, 1 - lwz 1,0(1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr1 - li rRTN, -1 - blr + bgtlr cr1 + li rRTN, -1 + blr - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) @@ -711,13 +711,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD7, 44(r1) + lwz rWORD8, 48(r1) +L(dLcr6x): - li rRTN, 1 + li rRTN, 1 - lwz 1,0(1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr6 - li rRTN, -1 - blr + bgtlr cr6 + li rRTN, -1 + blr - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) @@ -727,117 +727,117 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD7, 44(r1) + lwz rWORD8, 48(r1) L(dLcr5x): - li rRTN, 1 + li rRTN, 1 - lwz 1,0(1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr5 - li rRTN, -1 - blr - + bgtlr cr5 + li rRTN, -1 + blr + - .align 4 + .align 4 L(bytealigned): - cfi_adjust_cfa_offset(-64) - mtctr rN /* Power4 wants mtctr 1st in dispatch group */ + mtctr rN /* Power4 wants mtctr 1st in dispatch group */ - + /* We need to prime this loop. This loop is swing modulo scheduled - to avoid pipe delays. The dependent instruction latencies (load to + to avoid pipe delays. The dependent instruction latencies (load to @@ -413,7 +622,7 @@ - lbz rWORD1, 0(rSTR1) - lbz rWORD2, 0(rSTR2) - bdz- L(b11) + lbz rWORD1, 0(rSTR1) + lbz rWORD2, 0(rSTR2) + bdz- L(b11) - cmplw cr0, rWORD1, rWORD2 + cmplw cr7, rWORD1, rWORD2 - lbz rWORD3, 1(rSTR1) - lbz rWORD4, 1(rSTR2) - bdz- L(b12) + lbz rWORD3, 1(rSTR1) + lbz rWORD4, 1(rSTR2) + bdz- L(b12) @@ -421,11 +630,11 @@ - lbzu rWORD5, 2(rSTR1) - lbzu rWORD6, 2(rSTR2) - bdz- L(b13) + lbzu rWORD5, 2(rSTR1) + lbzu rWORD6, 2(rSTR2) + bdz- L(b13) - .align 4 + .align 4 L(bLoop): - lbzu rWORD1, 1(rSTR1) - lbzu rWORD2, 1(rSTR2) + lbzu rWORD1, 1(rSTR1) + lbzu rWORD2, 1(rSTR2) - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - - cmplw cr6, rWORD5, rWORD6 - bdz- L(b3i) + + cmplw cr6, rWORD5, rWORD6 + bdz- L(b3i) @@ -434,7 +643,7 @@ - lbzu rWORD4, 1(rSTR2) - bne- cr1, L(bLcr1) - + lbzu rWORD4, 1(rSTR2) + bne- cr1, L(bLcr1) + - cmplw cr0, rWORD1, rWORD2 + cmplw cr7, rWORD1, rWORD2 - bdz- L(b2i) - - lbzu rWORD5, 1(rSTR1) + bdz- L(b2i) + + lbzu rWORD5, 1(rSTR1) @@ -451,23 +660,23 @@ tested. In this case we must complete the pending operations before returning. */ L(b1i): - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - bne- cr1, L(bLcr1) - b L(bx56) + bne- cr1, L(bLcr1) + b L(bx56) - .align 4 + .align 4 L(b2i): - bne- cr6, L(bLcr6) + bne- cr6, L(bLcr6) - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - b L(bx34) + b L(bx34) - .align 4 + .align 4 L(b3i): - bne- cr1, L(bLcr1) - bne- cr6, L(bLcr6) - b L(bx12) + bne- cr1, L(bLcr1) + bne- cr6, L(bLcr6) + b L(bx12) - .align 4 -L(bLcr0): + .align 4 +L(bLcr7): - li rRTN, 1 + li rRTN, 1 - bgtlr cr0 + bgtlr cr7 - li rRTN, -1 - blr + li rRTN, -1 + blr L(bLcr1): @@ -482,36 +691,31 @@ - blr - + blr + L(b13): - bne- cr0, L(bx12) + bne- cr7, L(bx12) - bne- cr1, L(bx34) + bne- cr1, L(bx34) L(bx56): - sub rRTN, rWORD5, rWORD6 - blr - nop + sub rRTN, rWORD5, rWORD6 + blr + nop L(b12): - bne- cr0, L(bx12) + bne- cr7, L(bx12) - L(bx34): - sub rRTN, rWORD3, rWORD4 - blr + L(bx34): + sub rRTN, rWORD3, rWORD4 + blr - L(b11): L(bx12): - sub rRTN, rWORD1, rWORD2 - blr + sub rRTN, rWORD1, rWORD2 + blr - -- .align 4 +- .align 4 -L(zeroLengthReturn): - + .align 4 L(zeroLength): - li rRTN, 0 - blr - + li rRTN, 0 + blr + - cfi_adjust_cfa_offset(64) - .align 4 + .align 4 @@ -845,10 +845,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - compare length is at least 8 bytes. rBITDIF contains the low order + compare length is at least 8 bytes. r12 contains the low order 2 bits of rSTR1 and cr5 contains the result of the logical compare -- of rBITDIF to 0. If rBITDIF == 0 then rStr1 is word aligned and can +- of rBITDIF to 0. If rBITDIF == 0 then rStr1 is word aligned and can + of r12 to 0. If r12 == 0 then rStr1 is word aligned and can perform the Wunaligned loop. - + Otherwise we know that rSTR1 is not aready word aligned yet. @@ -520,79 +724,88 @@ eliminate bits preceeding the first byte. Since we want to join the @@ -873,17 +873,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. +#define rWORD6_SHIFT r24 /* Left rotation temp for rWORD8. */ + cfi_adjust_cfa_offset(64) L(unaligned): -- stw r29,40(r1) -- cfi_offset(r29,(40-64)) +- stw r29,40(r1) +- cfi_offset(r29,(40-64)) + stw rSHL, 40(r1) + cfi_offset(rSHL, (40-64)) - clrlwi rSHL, rSTR2, 30 -- stw r28,36(r1) + clrlwi rSHL, rSTR2, 30 +- stw r28,36(r1) - cfi_offset(r28,(36-64)) + stw rSHR, 36(r1) + cfi_offset(rSHR, (36-64)) - beq cr5, L(Wunaligned) -- stw r27,32(r1) + beq cr5, L(Wunaligned) +- stw r27,32(r1) - cfi_offset(r27,(32-64)) + stw rWORD8_SHIFT, 32(r1) + cfi_offset(rWORD8_SHIFT, (32-64)) @@ -893,33 +893,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + sub rWORD8_SHIFT, rSTR2, r12 /* But do not attempt to address the W before that W that contains the actual start of rSTR2. */ - clrrwi rSTR2, rSTR2, 2 -- stw r26,28(r1) + clrrwi rSTR2, rSTR2, 2 +- stw r26,28(r1) - cfi_offset(r26,(28-64)) -/* Compute the left/right shift counts for the unalign rSTR2, + stw rWORD2_SHIFT, 28(r1) + cfi_offset(rWORD2_SHIFT, (28-64)) +/* Compute the left/right shift counts for the unaligned rSTR2, - compensating for the logical (W aligned) start of rSTR1. */ + compensating for the logical (W aligned) start of rSTR1. */ - clrlwi rSHL, r27, 30 + clrlwi rSHL, rWORD8_SHIFT, 30 - clrrwi rSTR1, rSTR1, 2 -- stw r25,24(r1) + clrrwi rSTR1, rSTR1, 2 +- stw r25,24(r1) - cfi_offset(r25,(24-64)) + stw rWORD4_SHIFT, 24(r1) + cfi_offset(rWORD4_SHIFT, (24-64)) - slwi rSHL, rSHL, 3 + slwi rSHL, rSHL, 3 - cmplw cr5, r27, rSTR2 - add rN, rN, rBITDIF - slwi r11, rBITDIF, 3 -- stw r24,20(r1) +- stw r24,20(r1) - cfi_offset(r24,(20-64)) + cmplw cr5, rWORD8_SHIFT, rSTR2 + add rN, rN, r12 + slwi rWORD6, r12, 3 + stw rWORD6_SHIFT, 20(r1) + cfi_offset(rWORD6_SHIFT, (20-64)) - subfic rSHR, rSHL, 32 + subfic rSHR, rSHL, 32 - srwi rTMP, rN, 4 /* Divide by 16 */ - andi. rBITDIF, rN, 12 /* Get the W remainder */ + srwi r0, rN, 4 /* Divide by 16 */ @@ -928,18 +928,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. this special case those bits may be discarded anyway. Also we must avoid loading a W where none of the bits are part of rSTR2 as this may cross a page boundary and cause a page fault. */ - li rWORD8, 0 - blt cr5, L(dus0) + li rWORD8, 0 + blt cr5, L(dus0) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD8, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD8, 0(rSTR2) + lwz rWORD8, 0(rSTR2) - la rSTR2, 4(rSTR2) + addi rSTR2, rSTR2, 4 +#endif - slw rWORD8, rWORD8, rSHL - + slw rWORD8, rWORD8, rSHL + L(dus0): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 @@ -947,23 +947,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 0(rSTR1) - lwz rWORD2, 0(rSTR2) + lwz rWORD1, 0(rSTR1) + lwz rWORD2, 0(rSTR2) - cmplwi cr1, rBITDIF, 8 +#endif + cmplwi cr1, r12, 8 - cmplwi cr7, rN, 16 + cmplwi cr7, rN, 16 - srw rG, rWORD2, rSHR + srw r12, rWORD2, rSHR - clrlwi rN, rN, 30 - beq L(duPs4) + clrlwi rN, rN, 30 + beq L(duPs4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ - or rWORD8, rG, rWORD8 + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ + or rWORD8, r12, rWORD8 - bgt cr1, L(duPs3) - beq cr1, L(duPs2) - + bgt cr1, L(duPs3) + beq cr1, L(duPs2) + /* Remainder is 4 */ - .align 4 + .align 4 @@ -974,25 +974,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD8_SHIFT, rWORD2, rSHL + slw rWORD7, rWORD1, rWORD6 + slw rWORD8, rWORD8, rWORD6 - bge cr7, L(duP1e) + bge cr7, L(duP1e) /* At this point we exit early with the first word compare complete and remainder of 0 to 3 bytes. See L(du14) for details on @@ -602,95 +815,133 @@ - bne cr5, L(duLcr5) - cmplw cr7, rN, rSHR - beq L(duZeroReturn) + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD2, 4(rSTR2) + lwz rWORD2, 4(rSTR2) - srw rA, rWORD2, rSHR +#endif + srw r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 8 */ - .align 4 + .align 4 @@ -1003,7 +1003,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD6_SHIFT, rWORD2, rSHL + slw rWORD5, rWORD1, rWORD6 + slw rWORD6, rWORD8, rWORD6 - b L(duP2e) + b L(duP2e) /* Remainder is 12 */ - .align 4 + .align 4 @@ -1014,7 +1014,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD4_SHIFT, rWORD2, rSHL + slw rWORD3, rWORD1, rWORD6 + slw rWORD4, rWORD8, rWORD6 - b L(duP3e) + b L(duP3e) /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 @@ -1029,25 +1029,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD2_SHIFT, rWORD2, rSHL + slw rWORD1, rWORD1, rWORD6 + slw rWORD2, rWORD8, rWORD6 - b L(duP4e) - + b L(duP4e) + /* At this point we know rSTR1 is word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(Wunaligned): -- stw r27,32(r1) +- stw r27,32(r1) - cfi_offset(r27,(32-64)) + stw rWORD8_SHIFT, 32(r1) + cfi_offset(rWORD8_SHIFT, (32-64)) - clrrwi rSTR2, rSTR2, 2 -- stw r26,28(r1) + clrrwi rSTR2, rSTR2, 2 +- stw r26,28(r1) - cfi_offset(r26,(28-64)) - srwi rTMP, rN, 4 /* Divide by 16 */ -- stw r25,24(r1) +- stw r25,24(r1) - cfi_offset(r25,(24-64)) - andi. rBITDIF, rN, 12 /* Get the W remainder */ -- stw r24,20(r1) +- stw r24,20(r1) - cfi_offset(r24,(20-64)) + stw rWORD2_SHIFT, 28(r1) + cfi_offset(rWORD2_SHIFT, (28-64)) @@ -1057,29 +1057,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + andi. r12, rN, 12 /* Get the W remainder */ + stw rWORD6_SHIFT, 20(r1) + cfi_offset(rWORD6_SHIFT, (20-64)) - slwi rSHL, rSHL, 3 + slwi rSHL, rSHL, 3 +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD6, 0, rSTR2 + addi rSTR2, rSTR2, 4 + lwbrx rWORD8, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD6, 0(rSTR2) - lwzu rWORD8, 4(rSTR2) + lwz rWORD6, 0(rSTR2) + lwzu rWORD8, 4(rSTR2) - cmplwi cr1, rBITDIF, 8 +#endif + cmplwi cr1, r12, 8 - cmplwi cr7, rN, 16 - clrlwi rN, rN, 30 - subfic rSHR, rSHL, 32 + cmplwi cr7, rN, 16 + clrlwi rN, rN, 30 + subfic rSHR, rSHL, 32 - slw rH, rWORD6, rSHL + slw rWORD6_SHIFT, rWORD6, rSHL - beq L(duP4) + beq L(duP4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ - bgt cr1, L(duP3) - beq cr1, L(duP2) - + bgt cr1, L(duP3) + beq cr1, L(duP2) + /* Remainder is 4 */ - .align 4 + .align 4 @@ -1090,13 +1090,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwbrx rWORD7, 0, rSTR1 + addi rSTR1, rSTR1, 4 +#else - lwz rWORD7, 0(rSTR1) + lwz rWORD7, 0(rSTR1) - slw rB, rWORD8, rSHL - or rWORD8, rG, rH +#endif + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP1x) + blt cr7, L(duP1x) L(duP1e): +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 @@ -1104,10 +1104,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 - srw rA, rWORD2, rSHR - slw rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -1120,8 +1120,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 8(rSTR1) - lwz rWORD4, 8(rSTR2) + lwz rWORD3, 8(rSTR1) + lwz rWORD4, 8(rSTR2) - cmplw cr0, rWORD1, rWORD2 - srw rC, rWORD4, rSHR - slw rF, rWORD4, rSHL @@ -1129,7 +1129,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + cmplw cr7, rWORD1, rWORD2 + srw r12, rWORD4, rSHR + slw rWORD4_SHIFT, rWORD4, rSHL - bne cr5, L(duLcr5) + bne cr5, L(duLcr5) - or rWORD4, rC, rD + or rWORD4, r12, rWORD2_SHIFT +#ifdef __LITTLE_ENDIAN__ @@ -1138,10 +1138,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 12(rSTR1) - lwz rWORD6, 12(rSTR2) + lwz rWORD5, 12(rSTR1) + lwz rWORD6, 12(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 - srw rE, rWORD6, rSHR - slw rH, rWORD6, rSHL - bne cr0, L(duLcr0) @@ -1150,20 +1150,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD6_SHIFT, rWORD6, rSHL + bne cr7, L(duLcr7) + or rWORD6, r0, rWORD4_SHIFT - cmplw cr6, rWORD5, rWORD6 - b L(duLoop3) + cmplw cr6, rWORD5, rWORD6 + b L(duLoop3) - .align 4 + .align 4 /* At this point we exit early with the first word compare complete and remainder of 0 to 3 bytes. See L(du14) for details on how we handle the remaining bytes. */ @@ -700,186 +951,321 @@ - bne cr5, L(duLcr5) - cmplw cr7, rN, rSHR - beq L(duZeroReturn) + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) - ld rWORD2, 8(rSTR2) - srw rA, rWORD2, rSHR +#ifdef __LITTLE_ENDIAN__ @@ -1173,7 +1173,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD2, 8(rSTR2) +#endif + srw r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 8 */ - .align 4 + .align 4 @@ -1184,7 +1184,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwbrx rWORD5, 0, rSTR1 + addi rSTR1, rSTR1, 4 +#else - lwz rWORD5, 0(rSTR1) + lwz rWORD5, 0(rSTR1) - or rWORD6, rE, rH - slw rH, rWORD8, rSHL +#endif @@ -1197,28 +1197,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD7, 4(rSTR1) - lwz rWORD8, 4(rSTR2) + lwz rWORD7, 4(rSTR1) + lwz rWORD8, 4(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 + cmplw cr6, rWORD5, rWORD6 - srw rG, rWORD8, rSHR - slw rB, rWORD8, rSHL - or rWORD8, rG, rH + srw r12, rWORD8, rSHR + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP2x) + blt cr7, L(duP2x) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 + lwbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 8(rSTR1) - lwz rWORD2, 8(rSTR2) + lwz rWORD1, 8(rSTR1) + lwz rWORD2, 8(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) + cmplw cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) - srw rA, rWORD2, rSHR - slw rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -1231,12 +1231,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 12(rSTR1) - lwz rWORD4, 12(rSTR2) + lwz rWORD3, 12(rSTR1) + lwz rWORD4, 12(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 - bne cr5, L(duLcr5) + bne cr5, L(duLcr5) - srw rC, rWORD4, rSHR - slw rF, rWORD4, rSHL - or rWORD4, rC, rD @@ -1244,37 +1244,37 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD4_SHIFT, rWORD4, rSHL + or rWORD4, r12, rWORD2_SHIFT +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 4 - addi rSTR2, rSTR2, 4 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#endif - cmplw cr1, rWORD3, rWORD4 - b L(duLoop2) + cmplw cr1, rWORD3, rWORD4 + b L(duLoop2) - .align 4 + .align 4 L(duP2x): - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 4 - addi rSTR2, rSTR2, 4 -+#endif - bne cr6, L(duLcr6) - slwi. rN, rN, 3 - bne cr5, L(duLcr5) - cmplw cr7, rN, rSHR - beq L(duZeroReturn) + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 ++#endif + bne cr6, L(duLcr6) + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD2, 4(rSTR2) + lwz rWORD2, 4(rSTR2) - srw rA, rWORD2, rSHR +#endif + srw r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Remainder is 12 */ - .align 4 + .align 4 @@ -1285,7 +1285,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwbrx rWORD3, 0, rSTR1 + addi rSTR1, rSTR1, 4 +#else - lwz rWORD3, 0(rSTR1) + lwz rWORD3, 0(rSTR1) - slw rF, rWORD8, rSHL - or rWORD4, rC, rH +#endif @@ -1298,10 +1298,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 4(rSTR1) - lwz rWORD6, 4(rSTR2) + lwz rWORD5, 4(rSTR1) + lwz rWORD6, 4(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 - srw rE, rWORD6, rSHR - slw rH, rWORD6, rSHL - or rWORD6, rE, rF @@ -1314,29 +1314,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD7, 8(rSTR1) - lwz rWORD8, 8(rSTR2) + lwz rWORD7, 8(rSTR1) + lwz rWORD8, 8(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) + cmplw cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) - srw rG, rWORD8, rSHR - slw rB, rWORD8, rSHL - or rWORD8, rG, rH + srw r12, rWORD8, rSHR + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP3x) + blt cr7, L(duP3x) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 + lwbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 12(rSTR1) - lwz rWORD2, 12(rSTR2) + lwz rWORD1, 12(rSTR1) + lwz rWORD2, 12(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) + cmplw cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) - srw rA, rWORD2, rSHR - slw rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -1344,42 +1344,42 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + slw rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 - b L(duLoop1) + b L(duLoop1) - .align 4 + .align 4 L(duP3x): +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#endif +#if 0 +/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) -+#endif - cmplw cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) - slwi. rN, rN, 3 - bne cr5, L(duLcr5) - cmplw cr7, rN, rSHR - beq L(duZeroReturn) + bne cr1, L(duLcr1) ++#endif + cmplw cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD2, 4(rSTR2) + lwz rWORD2, 4(rSTR2) - srw rA, rWORD2, rSHR +#endif + srw r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 @@ -1392,7 +1392,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwbrx rWORD1, 0, rSTR1 + addi rSTR1, rSTR1, 4 +#else - lwz rWORD1, 0(rSTR1) + lwz rWORD1, 0(rSTR1) - slw rD, rWORD8, rSHL - or rWORD2, rA, rH +#endif @@ -1405,8 +1405,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 4(rSTR1) - lwz rWORD4, 4(rSTR2) + lwz rWORD3, 4(rSTR1) + lwz rWORD4, 4(rSTR2) - cmplw cr0, rWORD1, rWORD2 - srw rC, rWORD4, rSHR - slw rF, rWORD4, rSHL @@ -1422,10 +1422,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 8(rSTR1) - lwz rWORD6, 8(rSTR2) + lwz rWORD5, 8(rSTR1) + lwz rWORD6, 8(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 + cmplw cr1, rWORD3, rWORD4 - bne cr0, L(duLcr0) - srw rE, rWORD6, rSHR - slw rH, rWORD6, rSHL @@ -1440,19 +1440,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwzu rWORD7, 12(rSTR1) - lwzu rWORD8, 12(rSTR2) + lwzu rWORD7, 12(rSTR1) + lwzu rWORD8, 12(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) + cmplw cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) - srw rG, rWORD8, rSHR - slw rB, rWORD8, rSHL - or rWORD8, rG, rH + srw r12, rWORD8, rSHR + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - cmplw cr5, rWORD7, rWORD8 - bdz- L(du24) /* Adjust CTR as we start with +4 */ + cmplw cr5, rWORD7, rWORD8 + bdz- L(du24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 @@ -1463,11 +1463,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD1, 4(rSTR1) - lwz rWORD2, 4(rSTR2) + lwz rWORD1, 4(rSTR1) + lwz rWORD2, 4(rSTR2) +#endif - cmplw cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) + cmplw cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) - srw rA, rWORD2, rSHR - slw rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -1481,11 +1481,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD3, 8(rSTR1) - lwz rWORD4, 8(rSTR2) + lwz rWORD3, 8(rSTR1) + lwz rWORD4, 8(rSTR2) +#endif - cmplw cr6, rWORD5, rWORD6 - bne cr5, L(duLcr5) + cmplw cr6, rWORD5, rWORD6 + bne cr5, L(duLcr5) - srw rC, rWORD4, rSHR - slw rF, rWORD4, rSHL - or rWORD4, rC, rD @@ -1499,10 +1499,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD5, 12(rSTR1) - lwz rWORD6, 12(rSTR2) + lwz rWORD5, 12(rSTR1) + lwz rWORD6, 12(rSTR2) +#endif - cmplw cr5, rWORD7, rWORD8 + cmplw cr5, rWORD7, rWORD8 - bne cr0, L(duLcr0) - srw rE, rWORD6, rSHR - slw rH, rWORD6, rSHL @@ -1518,58 +1518,58 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 4 + addi rSTR2, rSTR2, 4 +#else - lwzu rWORD7, 16(rSTR1) - lwzu rWORD8, 16(rSTR2) + lwzu rWORD7, 16(rSTR1) + lwzu rWORD8, 16(rSTR2) - cmplw cr0, rWORD1, rWORD2 +#endif + cmplw cr7, rWORD1, rWORD2 - bne- cr1, L(duLcr1) + bne- cr1, L(duLcr1) - srw rG, rWORD8, rSHR - slw rB, rWORD8, rSHL - or rWORD8, rG, rH + srw r12, rWORD8, rSHR + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - bdnz+ L(duLoop) - + bdnz+ L(duLoop) + L(duL4): +#if 0 +/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) + bne cr1, L(duLcr1) +#endif - cmplw cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) - cmplw cr6, rWORD5, rWORD6 - bne cr5, L(duLcr5) - cmplw cr5, rWORD7, rWORD8 + cmplw cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) + cmplw cr6, rWORD5, rWORD6 + bne cr5, L(duLcr5) + cmplw cr5, rWORD7, rWORD8 L(du44): - bne cr0, L(duLcr0) + bne cr7, L(duLcr7) L(du34): - bne cr1, L(duLcr1) + bne cr1, L(duLcr1) L(du24): @@ -889,95 +1275,101 @@ - bne cr5, L(duLcr5) + bne cr5, L(duLcr5) /* At this point we have a remainder of 1 to 3 bytes to compare. We use - shift right to eliminate bits beyond the compare length. + shift right to eliminate bits beyond the compare length. + This allows the use of word subtract to compute the final result. - - However it may not be safe to load rWORD2 which may be beyond the + + However it may not be safe to load rWORD2 which may be beyond the string length. So we compare the bit length of the remainder to the right shift count (rSHR). If the bit count is less than or equal we do not need to load rWORD2 (all significant bits are already in - rB). */ + rWORD8_SHIFT). */ - cmplw cr7, rN, rSHR - beq L(duZeroReturn) + cmplw cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 4 +#else - lwz rWORD2, 4(rSTR2) + lwz rWORD2, 4(rSTR2) - srw rA, rWORD2, rSHR - .align 4 +#endif @@ -1579,20 +1579,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. +#ifdef __LITTLE_ENDIAN__ + lwbrx rWORD1, 0, rSTR1 +#else - lwz rWORD1, 4(rSTR1) + lwz rWORD1, 4(rSTR1) - lwz r31,48(1) +#endif + lwz rWORD8, 48(r1) - subfic rN, rN, 32 /* Shift count is 32 - (rN * 8). */ + subfic rN, rN, 32 /* Shift count is 32 - (rN * 8). */ - or rWORD2, rA, rB - lwz r30,44(1) - lwz r29,40(r1) + or rWORD2, r0, rWORD8_SHIFT + lwz rWORD7, 44(r1) + lwz rSHL, 40(r1) - srw rWORD1, rWORD1, rN - srw rWORD2, rWORD2, rN -- lwz r28,36(r1) + srw rWORD1, rWORD1, rN + srw rWORD2, rWORD2, rN +- lwz r28,36(r1) - lwz r27,32(r1) - cmplw rWORD1,rWORD2 - li rRTN,0 @@ -1606,9 +1606,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - lwz r31,48(1) - lwz r30,44(1) - li rRTN, 1 -- bgt cr0, L(dureturn29) +- bgt cr0, L(dureturn29) - lwz r29,40(r1) -- lwz r28,36(r1) +- lwz r28,36(r1) + lwz rSHR, 36(r1) + lwz rWORD8_SHIFT, 32(r1) + sub rRTN, rWORD1, rWORD2 @@ -1621,8 +1621,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + bgt cr7, L(dureturn29) + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr1): @@ -1630,14 +1630,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - lwz r30,44(1) + lwz rWORD8, 48(r1) + lwz rWORD7, 44(r1) - li rRTN, 1 - bgt cr1, L(dureturn29) + li rRTN, 1 + bgt cr1, L(dureturn29) - lwz r29,40(r1) -- lwz r28,36(r1) +- lwz r28,36(r1) + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr6): @@ -1645,14 +1645,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - lwz r30,44(1) + lwz rWORD8, 48(r1) + lwz rWORD7, 44(r1) - li rRTN, 1 - bgt cr6, L(dureturn29) + li rRTN, 1 + bgt cr6, L(dureturn29) - lwz r29,40(r1) -- lwz r28,36(r1) +- lwz r28,36(r1) + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr5): @@ -1660,36 +1660,36 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. - lwz r30,44(1) + lwz rWORD8, 48(r1) + lwz rWORD7, 44(r1) - li rRTN, 1 - bgt cr5, L(dureturn29) + li rRTN, 1 + bgt cr5, L(dureturn29) - lwz r29,40(r1) -- lwz r28,36(r1) +- lwz r28,36(r1) + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) - li rRTN, -1 - b L(dureturn27) - .align 3 + li rRTN, -1 + b L(dureturn27) + .align 3 L(duZeroReturn): - li rRTN,0 + li rRTN, 0 - .align 4 + .align 4 L(dureturn): - lwz r31,48(1) - lwz r30,44(1) + lwz rWORD8, 48(r1) + lwz rWORD7, 44(r1) - L(dureturn29): + L(dureturn29): - lwz r29,40(r1) -- lwz r28,36(r1) +- lwz r28,36(r1) + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) - L(dureturn27): + L(dureturn27): - lwz r27,32(r1) + lwz rWORD8_SHIFT, 32(r1) - L(dureturn26): + L(dureturn26): - lwz r26,28(r1) + lwz rWORD2_SHIFT, 28(r1) - L(dureturn25): + L(dureturn25): - lwz r25,24(r1) - lwz r24,20(r1) - lwz 1,0(1) @@ -1697,20 +1697,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcmp.S glibc-2. + lwz rWORD6_SHIFT, 20(r1) + addi 1, 1, 64 + cfi_adjust_cfa_offset(-64) - blr + blr END (BP_SYM (memcmp)) - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S 2014-05-28 19:22:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S 2014-05-28 21:44:57.000000000 -0500 @@ -25,10 +25,9 @@ - size_t size [r5]) */ - - .machine power7 + size_t size [r5]) */ + + .machine power7 -EALIGN (BP_SYM(memcmp),4,0) +EALIGN (BP_SYM(memcmp), 4, 0) - CALL_MCOUNT - + CALL_MCOUNT + -#define rTMP r0 #define rRTN r3 #define rSTR1 r3 /* first string arg */ @@ -1722,7 +1722,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. -#define rBITDIF r12 /* bits that differ in s1 & s2 words */ #define rWORD7 r30 /* next word in s1 */ #define rWORD8 r31 /* next word in s2 */ - + - xor rTMP,rSTR2,rSTR1 - cmplwi cr6,rN,0 - cmplwi cr1,rN,12 @@ -1751,7 +1751,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + byte loop. */ + blt cr1, L(bytealigned) + stwu 1, -64(r1) - cfi_adjust_cfa_offset(64) + cfi_adjust_cfa_offset(64) - stw r31,48(1) - cfi_offset(31,(48-64)) - stw r30,44(1) @@ -1760,7 +1760,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cfi_offset(rWORD8, (48-64)) + stw rWORD7, 44(r1) + cfi_offset(rWORD7, (44-64)) - bne L(unaligned) + bne L(unaligned) /* At this point we know both strings have the same alignment and the - compare length is at least 8 bytes. rBITDIF contains the low order + compare length is at least 8 bytes. r12 contains the low order @@ -1768,7 +1768,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. - of rBITDIF to 0. If rBITDIF == 0 then we are already word + of r12 to 0. If r12 == 0 then we are already word aligned and can perform the word aligned loop. - + Otherwise we know the two strings have the same alignment (but not @@ -76,332 +72,541 @@ eliminate bits preceeding the first byte. Since we want to join the @@ -1777,7 +1777,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. - versioning for the first word. This insures that the loop count is + versioning for the first word. This ensures that the loop count is correct and the first word (shifted) is in the expected register pair. */ - .align 4 + .align 4 L(samealignment): - clrrwi rSTR1,rSTR1,2 - clrrwi rSTR2,rSTR2,2 @@ -1810,16 +1810,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cmplwi cr1, r12, 8 + cmplwi cr7, rN, 16 + clrlwi rN, rN, 30 - beq L(dPs4) + beq L(dPs4) - mtctr rTMP - bgt cr1,L(dPs3) - beq cr1,L(dPs2) + mtctr r0 + bgt cr1, L(dPs3) + beq cr1, L(dPs2) - + /* Remainder is 4 */ - .align 3 + .align 3 L(dsP1): - slw rWORD5,rWORD1,r11 - slw rWORD6,rWORD2,r11 @@ -1843,9 +1843,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 4(rSTR2) +#endif + cmplw cr7, rWORD1, rWORD2 - b L(dP1e) + b L(dP1e) /* Remainder is 8 */ - .align 4 + .align 4 L(dPs2): - slw rWORD5,rWORD1,r11 - slw rWORD6,rWORD2,r11 @@ -1869,9 +1869,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD8, 4(rSTR2) +#endif + cmplw cr5, rWORD7, rWORD8 - b L(dP2e) + b L(dP2e) /* Remainder is 12 */ - .align 4 + .align 4 L(dPs3): - slw rWORD3,rWORD1,r11 - slw rWORD4,rWORD2,r11 @@ -1879,9 +1879,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD3, rWORD1, rWORD6 + slw rWORD4, rWORD2, rWORD6 + cmplw cr1, rWORD3, rWORD4 - b L(dP3e) + b L(dP3e) /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 L(dPs4): - mtctr rTMP - slw rWORD1,rWORD1,r11 @@ -1891,11 +1891,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD1, rWORD1, rWORD6 + slw rWORD2, rWORD2, rWORD6 + cmplw cr7, rWORD1, rWORD2 - b L(dP4e) - + b L(dP4e) + /* At this point we know both strings are word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(Waligned): - andi. rBITDIF,rN,12 /* Get the word remainder */ - srwi rTMP,rN,4 /* Divide by 16 */ @@ -1907,14 +1907,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cmplwi cr1, r12, 8 + cmplwi cr7, rN, 16 + clrlwi rN, rN, 30 - beq L(dP4) + beq L(dP4) - bgt cr1,L(dP3) - beq cr1,L(dP2) + bgt cr1, L(dP3) + beq cr1, L(dP2) - + /* Remainder is 4 */ - .align 4 + .align 4 L(dP1): - mtctr rTMP + mtctr r0 @@ -2000,14 +2000,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + cmplw cr5, rWORD7, rWORD8 - bdnz L(dLoop) + bdnz L(dLoop) - bne cr6,L(dLcr6) - lwz r30,44(1) - lwz r31,48(1) + bne cr6, L(dLcr6) + lwz rWORD7, 44(r1) + lwz rWORD8, 48(r1) - .align 3 + .align 3 L(dP1x): - slwi. r12,rN,3 - bne cr5,L(dLcr5) @@ -2018,13 +2018,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Remainder is 8 */ - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) L(dP2): - mtctr rTMP @@ -2094,11 +2094,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. +#endif + bne cr6, L(dLcr6) + bne cr5, L(dLcr5) - b L(dLoop2) + b L(dLoop2) /* Again we are on a early exit path (16-23 byte compare), we want to only use volatile registers and avoid restoring non-volatile registers. */ - .align 4 + .align 4 L(dP2x): - lwz rWORD3,4(rSTR1) - lwz rWORD4,4(rSTR2) @@ -2130,13 +2130,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Remainder is 12 */ - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) L(dP3): - mtctr rTMP @@ -2206,11 +2206,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + bne cr6, L(dLcr6) - b L(dLoop1) + b L(dLoop1) /* Again we are on a early exit path (24-31 byte compare), we want to only use volatile registers and avoid restoring non-volatile registers. */ - .align 4 + .align 4 L(dP3x): - lwz rWORD1,8(rSTR1) - lwz rWORD2,8(rSTR2) @@ -2244,13 +2244,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + bne cr7, L(dLcr7x) + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 + cfi_adjust_cfa_offset(64) L(dP4): - mtctr rTMP @@ -2312,9 +2312,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cmplw cr5, rWORD7, rWORD8 + bne cr7, L(dLcr7) + bne cr1, L(dLcr1) - bdz- L(d24) /* Adjust CTR as we start with +4 */ + bdz- L(d24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 L(dLoop): - lwz rWORD1,4(rSTR1) - lwz rWORD2,4(rSTR2) @@ -2379,8 +2379,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + cmplw cr7, rWORD1, rWORD2 - bdnz L(dLoop) - + bdnz L(dLoop) + L(dL4): - cmplw cr1,rWORD3,rWORD4 - bne cr6,L(dLcr6) @@ -2416,7 +2416,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) + subfic rN, r12, 32 /* Shift count is 32 - (rN * 8). */ - beq L(zeroLength) + beq L(zeroLength) /* At this point we have a remainder of 1 to 3 bytes to compare. Since we are aligned it is safe to load the whole word, and use - shift right to eliminate bits beyond the compare length. */ @@ -2444,9 +2444,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + srw rWORD1, rWORD1, rN + srw rWORD2, rWORD2, rN + sub rRTN, rWORD1, rWORD2 - blr - - .align 4 + blr + + .align 4 -L(dLcr0): - lwz r30,44(1) - lwz r31,48(1) @@ -2464,8 +2464,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cfi_adjust_cfa_offset(-64) + bgtlr cr7 + li rRTN, -1 - blr - .align 4 + blr + .align 4 + cfi_adjust_cfa_offset(64) L(dLcr1): - lwz r30,44(1) @@ -2478,11 +2478,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + li rRTN, 1 + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr1 + bgtlr cr1 - li rRTN,-1 + li rRTN, -1 - blr - .align 4 + blr + .align 4 + cfi_adjust_cfa_offset(64) L(dLcr6): - lwz r30,44(1) @@ -2495,11 +2495,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + li rRTN, 1 + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr6 + bgtlr cr6 - li rRTN,-1 + li rRTN, -1 - blr - .align 4 + blr + .align 4 + cfi_adjust_cfa_offset(64) L(dLcr5): - lwz r30,44(1) @@ -2512,19 +2512,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + li rRTN, 1 + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - bgtlr cr5 + bgtlr cr5 - li rRTN,-1 + li rRTN, -1 - blr - - .align 4 + blr + + .align 4 L(bytealigned): - cfi_adjust_cfa_offset(-64) - mtctr rN - + mtctr rN + /* We need to prime this loop. This loop is swing modulo scheduled @@ -413,38 +618,39 @@ - + So we must precondition some registers and condition codes so that we don't exit the loop early on the first iteration. */ - lbz rWORD1,0(rSTR1) @@ -2532,22 +2532,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + + lbz rWORD1, 0(rSTR1) + lbz rWORD2, 0(rSTR2) - bdz L(b11) + bdz L(b11) - cmplw cr0,rWORD1,rWORD2 - lbz rWORD3,1(rSTR1) - lbz rWORD4,1(rSTR2) + cmplw cr7, rWORD1, rWORD2 + lbz rWORD3, 1(rSTR1) + lbz rWORD4, 1(rSTR2) - bdz L(b12) + bdz L(b12) - cmplw cr1,rWORD3,rWORD4 - lbzu rWORD5,2(rSTR1) - lbzu rWORD6,2(rSTR2) + cmplw cr1, rWORD3, rWORD4 + lbzu rWORD5, 2(rSTR1) + lbzu rWORD6, 2(rSTR2) - bdz L(b13) - .align 4 + bdz L(b13) + .align 4 L(bLoop): - lbzu rWORD1,1(rSTR1) - lbzu rWORD2,1(rSTR2) @@ -2555,33 +2555,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lbzu rWORD1, 1(rSTR1) + lbzu rWORD2, 1(rSTR2) + bne cr7, L(bLcr7) - + - cmplw cr6,rWORD5,rWORD6 + cmplw cr6, rWORD5, rWORD6 - bdz L(b3i) - + bdz L(b3i) + - lbzu rWORD3,1(rSTR1) - lbzu rWORD4,1(rSTR2) - bne cr1,L(bLcr1) + lbzu rWORD3, 1(rSTR1) + lbzu rWORD4, 1(rSTR2) + bne cr1, L(bLcr1) - + - cmplw cr0,rWORD1,rWORD2 + cmplw cr7, rWORD1, rWORD2 - bdz L(b2i) - + bdz L(b2i) + - lbzu rWORD5,1(rSTR1) - lbzu rWORD6,1(rSTR2) - bne cr6,L(bLcr6) + lbzu rWORD5, 1(rSTR1) + lbzu rWORD6, 1(rSTR2) + bne cr6, L(bLcr6) - + - cmplw cr1,rWORD3,rWORD4 + cmplw cr1, rWORD3, rWORD4 - bdnz L(bLoop) - + bdnz L(bLoop) + /* We speculatively loading bytes before we have tested the previous @@ -454,67 +660,62 @@ tested. In this case we must complete the pending operations @@ -2591,22 +2591,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. - bne cr1,L(bLcr1) + bne cr7, L(bLcr7) + bne cr1, L(bLcr1) - b L(bx56) - .align 4 + b L(bx56) + .align 4 L(b2i): - bne cr6,L(bLcr6) - bne cr0,L(bLcr0) + bne cr6, L(bLcr6) + bne cr7, L(bLcr7) - b L(bx34) - .align 4 + b L(bx34) + .align 4 L(b3i): - bne cr1,L(bLcr1) - bne cr6,L(bLcr6) + bne cr1, L(bLcr1) + bne cr6, L(bLcr6) - b L(bx12) - .align 4 + b L(bx12) + .align 4 -L(bLcr0): - li rRTN,1 - bgtlr cr0 @@ -2615,22 +2615,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + li rRTN, 1 + bgtlr cr7 + li rRTN, -1 - blr + blr L(bLcr1): - li rRTN,1 + li rRTN, 1 - bgtlr cr1 + bgtlr cr1 - li rRTN,-1 + li rRTN, -1 - blr + blr L(bLcr6): - li rRTN,1 + li rRTN, 1 - bgtlr cr6 + bgtlr cr6 - li rRTN,-1 + li rRTN, -1 - blr - + blr + L(b13): - bne cr0,L(bx12) - bne cr1,L(bx34) @@ -2639,32 +2639,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. L(bx56): - sub rRTN,rWORD5,rWORD6 + sub rRTN, rWORD5, rWORD6 - blr - nop + blr + nop L(b12): - bne cr0,L(bx12) + bne cr7, L(bx12) L(bx34): - sub rRTN,rWORD3,rWORD4 + sub rRTN, rWORD3, rWORD4 - blr + blr - L(b11): L(bx12): - sub rRTN,rWORD1,rWORD2 + sub rRTN, rWORD1, rWORD2 - blr + blr - - .align 4 + .align 4 -L(zeroLengthReturn): - L(zeroLength): - li rRTN,0 + li rRTN, 0 - blr - + blr + - cfi_adjust_cfa_offset(64) - .align 4 + .align 4 /* At this point we know the strings have different alignment and the - compare length is at least 8 bytes. rBITDIF contains the low order + compare length is at least 8 bytes. r12 contains the low order @@ -2672,7 +2672,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. - of rBITDIF to 0. If rBITDIF == 0 then rStr1 is word aligned and can + of r12 to 0. If r12 == 0 then rStr1 is word aligned and can perform the Wunaligned loop. - + Otherwise we know that rSTR1 is not aready word aligned yet. @@ -523,465 +724,654 @@ eliminate bits preceeding the first byte. Since we want to join the @@ -2773,7 +2773,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 4 +#endif + slw rWORD8, rWORD8, rSHL - + L(dus0): - lwz rWORD1,0(rSTR1) - lwz rWORD2,0(rSTR2) @@ -2794,7 +2794,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + cmplwi cr7, rN, 16 + srw r12, rWORD2, rSHR + clrlwi rN, rN, 30 - beq L(duPs4) + beq L(duPs4) - mtctr rTMP - or rWORD8,rG,rWORD8 - bgt cr1,L(duPs3) @@ -2803,9 +2803,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + or rWORD8, r12, rWORD8 + bgt cr1, L(duPs3) + beq cr1, L(duPs2) - + /* Remainder is 4 */ - .align 4 + .align 4 L(dusP1): - slw rB,rWORD2,rSHL - slw rWORD7,rWORD1,r11 @@ -2826,7 +2826,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - lwz rWORD2,4(rSTR2) @@ -2840,9 +2840,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 4(rSTR2) +#endif + srw r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 8 */ - .align 4 + .align 4 L(duPs2): - slw rH,rWORD2,rSHL - slw rWORD5,rWORD1,r11 @@ -2850,9 +2850,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD6_SHIFT, rWORD2, rSHL + slw rWORD5, rWORD1, rWORD6 + slw rWORD6, rWORD8, rWORD6 - b L(duP2e) + b L(duP2e) /* Remainder is 12 */ - .align 4 + .align 4 L(duPs3): - slw rF,rWORD2,rSHL - slw rWORD3,rWORD1,r11 @@ -2860,9 +2860,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD4_SHIFT, rWORD2, rSHL + slw rWORD3, rWORD1, rWORD6 + slw rWORD4, rWORD8, rWORD6 - b L(duP3e) + b L(duP3e) /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 L(duPs4): - mtctr rTMP - or rWORD8,rG,rWORD8 @@ -2874,11 +2874,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD2_SHIFT, rWORD2, rSHL + slw rWORD1, rWORD1, rWORD6 + slw rWORD2, rWORD8, rWORD6 - b L(duP4e) - + b L(duP4e) + /* At this point we know rSTR1 is word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(Wunaligned): - stw r27,32(r1) - cfi_offset(r27,(32-64)) @@ -2925,16 +2925,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + clrlwi rN, rN, 30 + subfic rSHR, rSHL, 32 + slw rWORD6_SHIFT, rWORD6, rSHL - beq L(duP4) + beq L(duP4) - mtctr rTMP - bgt cr1,L(duP3) - beq cr1,L(duP2) + mtctr r0 + bgt cr1, L(duP3) + beq cr1, L(duP2) - + /* Remainder is 4 */ - .align 4 + .align 4 L(duP1): - srw rG,rWORD8,rSHR - lwz rWORD7,0(rSTR1) @@ -3015,8 +3015,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + bne cr7, L(duLcr7) + or rWORD6, r0, rWORD4_SHIFT + cmplw cr6, rWORD5, rWORD6 - b L(duLoop3) - .align 4 + b L(duLoop3) + .align 4 /* At this point we exit early with the first word compare complete and remainder of 0 to 3 bytes. See L(du14) for details on how we handle the remaining bytes. */ @@ -3029,7 +3029,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -3043,9 +3043,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 8(rSTR2) +#endif + srw r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 8 */ - .align 4 + .align 4 L(duP2): - srw rE,rWORD8,rSHR - lwz rWORD5,0(rSTR1) @@ -3132,8 +3132,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 4 +#endif + cmplw cr1, rWORD3, rWORD4 - b L(duLoop2) - .align 4 + b L(duLoop2) + .align 4 L(duP2x): - cmplw cr5,rWORD7,rWORD8 - addi rSTR1,rSTR1,4 @@ -3151,7 +3151,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - lwz rWORD2,4(rSTR2) @@ -3165,10 +3165,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 4(rSTR2) +#endif + srw r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Remainder is 12 */ - .align 4 + .align 4 L(duP3): - srw rC,rWORD8,rSHR - lwz rWORD3,0(rSTR1) @@ -3255,8 +3255,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 8 +#endif + cmplw cr7, rWORD1, rWORD2 - b L(duLoop1) - .align 4 + b L(duLoop1) + .align 4 L(duP3x): - addi rSTR1,rSTR1,8 - addi rSTR2,rSTR2,8 @@ -3279,7 +3279,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slwi. rN, rN, 3 + bne cr5, L(duLcr5) + cmplw cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - lwz rWORD2,4(rSTR2) @@ -3293,10 +3293,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 4(rSTR2) +#endif + srw r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Count is a multiple of 16, remainder is 0 */ - .align 4 + .align 4 L(duP4): - mtctr rTMP - srw rA,rWORD8,rSHR @@ -3377,9 +3377,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT + cmplw cr5, rWORD7, rWORD8 - bdz L(du24) /* Adjust CTR as we start with +4 */ + bdz L(du24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 L(duLoop): - lwz rWORD1,4(rSTR1) - lwz rWORD2,4(rSTR2) @@ -3468,8 +3468,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + srw r12, rWORD8, rSHR + slw rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - bdnz L(duLoop) - + bdnz L(duLoop) + L(duL4): - bne cr1,L(duLcr1) - cmplw cr1,rWORD3,rWORD4 @@ -3503,7 +3503,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. /* At this point we have a remainder of 1 to 3 bytes to compare. We use shift right to eliminate bits beyond the compare length. + This allows the use of word subtract to compute the final result. - + However it may not be safe to load rWORD2 which may be beyond the string length. So we compare the bit length of the remainder to the right shift count (rSHR). If the bit count is less than or equal @@ -3512,7 +3512,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. - cmplw cr7,rN,rSHR + rWORD8_SHIFT). */ + cmplw cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - lwz rWORD2,4(rSTR2) @@ -3526,7 +3526,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD2, 4(rSTR2) +#endif + srw r0, rWORD2, rSHR - .align 4 + .align 4 L(dutrim): - lwz rWORD1,4(rSTR1) - lwz r31,48(1) @@ -3559,8 +3559,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rSHR, 36(r1) + lwz rWORD8_SHIFT, 32(r1) + sub rRTN, rWORD1, rWORD2 - b L(dureturn26) - .align 4 + b L(dureturn26) + .align 4 -L(duLcr0): - lwz r31,48(1) - lwz r30,44(1) @@ -3577,8 +3577,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr1): - lwz r31,48(1) - lwz r30,44(1) @@ -3594,8 +3594,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr6): - lwz r31,48(1) - lwz r30,44(1) @@ -3611,8 +3611,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr5): - lwz r31,48(1) - lwz r30,44(1) @@ -3628,12 +3628,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rSHL, 40(r1) + lwz rSHR, 36(r1) + li rRTN, -1 - b L(dureturn27) - .align 3 + b L(dureturn27) + .align 3 L(duZeroReturn): - li rRTN,0 + li rRTN, 0 - .align 4 + .align 4 L(dureturn): - lwz r31,48(1) - lwz r30,44(1) @@ -3658,7 +3658,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcmp.S glibc-2. + lwz rWORD6_SHIFT, 20(r1) + addi r1, r1, 64 + cfi_adjust_cfa_offset(-64) - blr + blr END (BP_SYM (memcmp)) + libc_hidden_builtin_def (memcmp) @@ -3672,25 +3672,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. +/* Optimized memcmp implementation for PowerPC64. + Copyright (C) 2003-2014 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 @@ -17,307 +17,492 @@ . */ - + #include -#include -#include - + -/* int [r3] memcmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */ +/* int [r3] memcmp (const char *s1 [r3], + const char *s2 [r4], + size_t size [r5]) */ - - .machine power4 + + .machine power4 -EALIGN (BP_SYM(memcmp), 4, 0) +EALIGN (memcmp, 4, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rTMP r0 #define rRTN r3 #define rSTR1 r3 /* first string arg */ @@ -3708,18 +3708,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. -#define rBITDIF r12 /* bits that differ in s1 & s2 words */ #define rWORD7 r30 /* next word in s1 */ #define rWORD8 r31 /* next word in s2 */ - + - xor rTMP, rSTR2, rSTR1 + xor r0, rSTR2, rSTR1 - cmpldi cr6, rN, 0 - cmpldi cr1, rN, 12 + cmpldi cr6, rN, 0 + cmpldi cr1, rN, 12 - clrldi. rTMP, rTMP, 61 - clrldi rBITDIF, rSTR1, 61 - cmpldi cr5, rBITDIF, 0 + clrldi. r0, r0, 61 + clrldi r12, rSTR1, 61 + cmpldi cr5, r12, 0 - beq- cr6, L(zeroLength) + beq- cr6, L(zeroLength) - dcbt 0,rSTR1 - dcbt 0,rSTR2 -/* If less than 8 bytes or not aligned, use the unalligned @@ -3727,23 +3727,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + dcbt 0, rSTR2 +/* If less than 8 bytes or not aligned, use the unaligned byte loop. */ - blt cr1, L(bytealigned) -- std rWORD8,-8(r1) + blt cr1, L(bytealigned) +- std rWORD8,-8(r1) - cfi_offset(rWORD8,-8) -- std rWORD7,-16(r1) +- std rWORD7,-16(r1) - cfi_offset(rWORD7,-16) + std rWORD8, -8(r1) + cfi_offset(rWORD8, -8) + std rWORD7, -16(r1) + cfi_offset(rWORD7, -16) - bne L(unaligned) + bne L(unaligned) /* At this point we know both strings have the same alignment and the - compare length is at least 8 bytes. rBITDIF containes the low order + compare length is at least 8 bytes. r12 contains the low order 3 bits of rSTR1 and cr5 contains the result of the logical compare -- of rBITDIF to 0. If rBITDIF == 0 then we are already double word +- of rBITDIF to 0. If rBITDIF == 0 then we are already double word - aligned and can perform the DWaligned loop. -- +- + of r12 to 0. If r12 == 0 then we are already double word + aligned and can perform the DW aligned loop. + @@ -3764,9 +3764,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + correct and the first DW (shifted) is in the expected register pair. */ + .align 4 L(samealignment): - clrrdi rSTR1, rSTR1, 3 - clrrdi rSTR2, rSTR2, 3 - beq cr5, L(DWaligned) + clrrdi rSTR1, rSTR1, 3 + clrrdi rSTR2, rSTR2, 3 + beq cr5, L(DWaligned) - add rN, rN, rBITDIF - sldi r11, rBITDIF, 3 - srdi rTMP, rN, 5 /* Divide by 32 */ @@ -3781,19 +3781,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 0(rSTR1) - ld rWORD2, 0(rSTR2) + ld rWORD1, 0(rSTR1) + ld rWORD2, 0(rSTR2) - cmpldi cr1, rBITDIF, 16 +#endif + cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - clrldi rN, rN, 61 - beq L(dPs4) + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 + beq L(dPs4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ - bgt cr1, L(dPs3) - beq cr1, L(dPs2) - + bgt cr1, L(dPs3) + beq cr1, L(dPs2) + /* Remainder is 8 */ - .align 3 + .align 3 @@ -3802,8 +3802,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - sld rWORD6, rWORD2, r11 + sld rWORD5, rWORD1, rWORD6 + sld rWORD6, rWORD2, rWORD6 - cmpld cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmpld cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) /* Do something useful in this cycle since we have to branch anyway. */ +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 @@ -3811,12 +3811,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) - ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) + ld rWORD2, 8(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 - b L(dP1e) + b L(dP1e) /* Remainder is 16 */ - .align 4 + .align 4 @@ -3825,8 +3825,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - sld rWORD6, rWORD2, r11 + sld rWORD5, rWORD1, rWORD6 + sld rWORD6, rWORD2, rWORD6 - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) /* Do something useful in this cycle since we have to branch anyway. */ +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD7, 0, rSTR1 @@ -3834,11 +3834,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD7, 8(rSTR1) - ld rWORD8, 8(rSTR2) + ld rWORD7, 8(rSTR1) + ld rWORD8, 8(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 - b L(dP2e) + cmpld cr5, rWORD7, rWORD8 + b L(dP2e) /* Remainder is 24 */ - .align 4 + .align 4 @@ -3847,8 +3847,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - sld rWORD4, rWORD2, r11 + sld rWORD3, rWORD1, rWORD6 + sld rWORD4, rWORD2, rWORD6 - cmpld cr1, rWORD3, rWORD4 - b L(dP3e) + cmpld cr1, rWORD3, rWORD4 + b L(dP3e) /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 @@ -3861,8 +3861,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD1, rWORD1, rWORD6 + sld rWORD2, rWORD2, rWORD6 + cmpld cr7, rWORD1, rWORD2 - b L(dP4e) - + b L(dP4e) + /* At this point we know both strings are double word aligned and the compare length is at least 8 bytes. */ - .align 4 @@ -3874,12 +3874,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + andi. r12, rN, 24 /* Get the DW remainder */ + srdi r0, rN, 5 /* Divide by 32 */ + cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - clrldi rN, rN, 61 - beq L(dP4) - bgt cr1, L(dP3) - beq cr1, L(dP2) -- + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 + beq L(dP4) + bgt cr1, L(dP3) + beq cr1, L(dP2) +- + /* Remainder is 8 */ - .align 4 @@ -3893,7 +3893,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + (8-15 byte compare), we want to use only volatile registers. This + means we can avoid restoring non-volatile registers since we did not change any on the early exit path. The key here is the non-early -- exit path only cares about the condition code (cr5), not about which +- exit path only cares about the condition code (cr5), not about which + exit path only cares about the condition code (cr5), not about which register pair was used. */ +#ifdef __LITTLE_ENDIAN__ @@ -3902,19 +3902,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 0(rSTR1) - ld rWORD6, 0(rSTR2) + ld rWORD5, 0(rSTR1) + ld rWORD6, 0(rSTR2) +#endif - cmpld cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmpld cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 + ldbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) - ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) + ld rWORD2, 8(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 @@ -3925,23 +3925,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 16(rSTR1) - ld rWORD4, 16(rSTR2) + ld rWORD3, 16(rSTR1) + ld rWORD4, 16(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD5, 0, rSTR1 + ldbrx rWORD6, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 24(rSTR1) - ld rWORD6, 24(rSTR2) + ld rWORD5, 24(rSTR1) + ld rWORD6, 24(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 + cmpld cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5) - bne cr0, L(dLcr0) -- +- + bne cr5, L(dLcr5x) + bne cr7, L(dLcr7x) + @@ -3951,13 +3951,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ldu rWORD7, 32(rSTR1) - ldu rWORD8, 32(rSTR2) + ldu rWORD7, 32(rSTR1) + ldu rWORD8, 32(rSTR2) +#endif - bne cr1, L(dLcr1) - cmpld cr5, rWORD7, rWORD8 - bdnz L(dLoop) - bne cr6, L(dLcr6) + bne cr1, L(dLcr1) + cmpld cr5, rWORD7, rWORD8 + bdnz L(dLoop) + bne cr6, L(dLcr6) - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) - .align 3 @@ -3965,14 +3965,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ld rWORD7, -16(r1) + .align 3 L(dP1x): - sldi. r12, rN, 3 + sldi. r12, rN, 3 - bne cr5, L(dLcr5) + bne cr5, L(dLcr5x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) - li rRTN, 0 - blr -- + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne L(d00) + li rRTN, 0 + blr +- + /* Remainder is 16 */ - .align 4 @@ -3986,21 +3986,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 0(rSTR1) - ld rWORD6, 0(rSTR2) + ld rWORD5, 0(rSTR1) + ld rWORD6, 0(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD7, 0, rSTR1 + ldbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD7, 8(rSTR1) - ld rWORD8, 8(rSTR2) + ld rWORD7, 8(rSTR1) + ld rWORD8, 8(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 L(dP2e): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 @@ -4008,8 +4008,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 16(rSTR1) - ld rWORD2, 16(rSTR2) + ld rWORD1, 16(rSTR1) + ld rWORD2, 16(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 @@ -4019,17 +4019,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 24(rSTR1) - ld rWORD4, 24(rSTR2) + ld rWORD3, 24(rSTR1) + ld rWORD4, 24(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#endif - bne cr6, L(dLcr6) - bne cr5, L(dLcr5) - b L(dLoop2) + bne cr6, L(dLcr6) + bne cr5, L(dLcr5) + b L(dLoop2) /* Again we are on a early exit path (16-23 byte compare), we want to - only use volitile registers and avoid restoring non-volitile + only use volatile registers and avoid restoring non-volatile @@ -4043,25 +4043,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 8(rSTR1) - ld rWORD4, 8(rSTR2) + ld rWORD3, 8(rSTR1) + ld rWORD4, 8(rSTR2) - cmpld cr5, rWORD3, rWORD4 +#endif + cmpld cr1, rWORD3, rWORD4 - sldi. r12, rN, 3 + sldi. r12, rN, 3 - bne cr6, L(dLcr6) + bne cr6, L(dLcr6x) +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 - bne cr5, L(dLcr5) +#endif + bne cr1, L(dLcr1x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) - li rRTN, 0 - blr -- + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne L(d00) + li rRTN, 0 + blr +- + /* Remainder is 24 */ - .align 4 @@ -4075,10 +4075,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 0(rSTR1) - ld rWORD4, 0(rSTR2) + ld rWORD3, 0(rSTR1) + ld rWORD4, 0(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 L(dP3e): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD5, 0, rSTR1 @@ -4086,39 +4086,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 8(rSTR1) - ld rWORD6, 8(rSTR2) + ld rWORD5, 8(rSTR1) + ld rWORD6, 8(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP3x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP3x) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD7, 0, rSTR1 + ldbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD7, 16(rSTR1) - ld rWORD8, 16(rSTR2) + ld rWORD7, 16(rSTR1) + ld rWORD8, 16(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 + ldbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 24(rSTR1) - ld rWORD2, 24(rSTR2) + ld rWORD1, 24(rSTR1) + ld rWORD2, 24(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 +#endif - bne cr1, L(dLcr1) - bne cr6, L(dLcr6) - b L(dLoop1) + bne cr1, L(dLcr1) + bne cr6, L(dLcr6) + b L(dLoop1) /* Again we are on a early exit path (24-31 byte compare), we want to - only use volitile registers and avoid restoring non-volitile + only use volatile registers and avoid restoring non-volatile @@ -4132,27 +4132,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 16(rSTR1) - ld rWORD2, 16(rSTR2) + ld rWORD1, 16(rSTR1) + ld rWORD2, 16(rSTR2) - cmpld cr5, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 - sldi. r12, rN, 3 + sldi. r12, rN, 3 - bne cr1, L(dLcr1) + bne cr1, L(dLcr1x) +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 - bne cr6, L(dLcr6) +#endif + bne cr6, L(dLcr6x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne cr5, L(dLcr5) + bne cr7, L(dLcr7x) - bne L(d00) - li rRTN, 0 - blr -- + bne L(d00) + li rRTN, 0 + blr +- + /* Count is a multiple of 32, remainder is 0 */ - .align 4 @@ -4166,8 +4166,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 0(rSTR1) - ld rWORD2, 0(rSTR2) + ld rWORD1, 0(rSTR1) + ld rWORD2, 0(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 @@ -4178,34 +4178,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 8(rSTR1) - ld rWORD4, 8(rSTR2) + ld rWORD3, 8(rSTR1) + ld rWORD4, 8(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD5, 0, rSTR1 + ldbrx rWORD6, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 16(rSTR1) - ld rWORD6, 16(rSTR2) + ld rWORD5, 16(rSTR1) + ld rWORD6, 16(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 + cmpld cr6, rWORD5, rWORD6 +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD7, 0, rSTR1 + ldbrx rWORD8, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ldu rWORD7, 24(rSTR1) - ldu rWORD8, 24(rSTR2) + ldu rWORD7, 24(rSTR1) + ldu rWORD8, 24(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) - bne cr1, L(dLcr1) - bdz- L(d24) /* Adjust CTR as we start with +4 */ + bne cr1, L(dLcr1) + bdz- L(d24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 @@ -4216,11 +4216,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) - ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) + ld rWORD2, 8(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(dLcr6) + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(dLcr6) L(dLoop1): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD3, 0, rSTR1 @@ -4228,11 +4228,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 16(rSTR1) - ld rWORD4, 16(rSTR2) + ld rWORD3, 16(rSTR1) + ld rWORD4, 16(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5) + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(dLcr5) L(dLoop2): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD5, 0, rSTR1 @@ -4240,10 +4240,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 24(rSTR1) - ld rWORD6, 24(rSTR2) + ld rWORD5, 24(rSTR1) + ld rWORD6, 24(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) L(dLoop3): @@ -4253,43 +4253,43 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ldu rWORD7, 32(rSTR1) - ldu rWORD8, 32(rSTR2) + ldu rWORD7, 32(rSTR1) + ldu rWORD8, 32(rSTR2) +#endif - bne- cr1, L(dLcr1) + bne- cr1, L(dLcr1) - cmpld cr0, rWORD1, rWORD2 -- bdnz+ L(dLoop) -- +- bdnz+ L(dLoop) +- + cmpld cr7, rWORD1, rWORD2 + bdnz+ L(dLoop) + L(dL4): - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(dLcr6) + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(dLcr6) @@ -325,84 +510,98 @@ - bne cr5, L(dLcr5) - cmpld cr5, rWORD7, rWORD8 + bne cr5, L(dLcr5) + cmpld cr5, rWORD7, rWORD8 L(d44): - bne cr0, L(dLcr0) + bne cr7, L(dLcr7) L(d34): - bne cr1, L(dLcr1) + bne cr1, L(dLcr1) L(d24): - bne cr6, L(dLcr6) + bne cr6, L(dLcr6) L(d14): - sldi. r12, rN, 3 -- bne cr5, L(dLcr5) + sldi. r12, rN, 3 +- bne cr5, L(dLcr5) + bne cr5, L(dLcr5) L(d04): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - beq L(zeroLength) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + beq L(zeroLength) /* At this point we have a remainder of 1 to 7 bytes to compare. Since we are aligned it is safe to load the whole double word, and use -- shift right double to elliminate bits beyond the compare length. */ +- shift right double to elliminate bits beyond the compare length. */ + shift right double to eliminate bits beyond the compare length. */ L(d00): +#ifdef __LITTLE_ENDIAN__ @@ -4298,18 +4298,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) -- ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) +- ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) +#endif - srd rWORD1, rWORD1, rN - srd rWORD2, rWORD2, rN + srd rWORD1, rWORD1, rN + srd rWORD2, rWORD2, rN - cmpld cr5, rWORD1, rWORD2 - bne cr5, L(dLcr5x) + cmpld cr7, rWORD1, rWORD2 + bne cr7, L(dLcr7x) - li rRTN, 0 - blr + li rRTN, 0 + blr - .align 4 -L(dLcr0): - ld rWORD8,-8(r1) @@ -4320,11 +4320,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) +L(dLcr7x): - li rRTN, 1 + li rRTN, 1 - bgtlr cr0 + bgtlr cr7 - li rRTN, -1 - blr + li rRTN, -1 + blr - .align 4 + .align 4 L(dLcr1): @@ -4333,10 +4333,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) +L(dLcr1x): - li rRTN, 1 - bgtlr cr1 - li rRTN, -1 - blr + li rRTN, 1 + bgtlr cr1 + li rRTN, -1 + blr - .align 4 + .align 4 L(dLcr6): @@ -4345,10 +4345,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) +L(dLcr6x): - li rRTN, 1 - bgtlr cr6 - li rRTN, -1 - blr + li rRTN, 1 + bgtlr cr6 + li rRTN, -1 + blr - .align 4 + .align 4 L(dLcr5): @@ -4357,11 +4357,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) L(dLcr5x): - li rRTN, 1 - bgtlr cr5 - li rRTN, -1 - blr -- + li rRTN, 1 + bgtlr cr5 + li rRTN, -1 + blr +- - .align 4 + + .align 4 @@ -4370,65 +4370,65 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + mtctr rN /* Power4 wants mtctr 1st in dispatch group */ +#if 0 +/* Huh? We've already branched on cr6! */ - beq- cr6, L(zeroLength) + beq- cr6, L(zeroLength) +#endif - + /* We need to prime this loop. This loop is swing modulo scheduled -- to avoid pipe delays. The dependent instruction latencies (load to +- to avoid pipe delays. The dependent instruction latencies (load to + to avoid pipe delays. The dependent instruction latencies (load to compare to conditional branch) is 2 to 3 cycles. In this loop each dispatch group ends in a branch and takes 1 cycle. Effectively -- the first iteration of the loop only serves to load operands and -- branches based on compares are delayed until the next loop. +- the first iteration of the loop only serves to load operands and +- branches based on compares are delayed until the next loop. + the first iteration of the loop only serves to load operands and + branches based on compares are delayed until the next loop. - + So we must precondition some registers and condition codes so that we don't exit the loop early on the first iteration. */ -- +- + - lbz rWORD1, 0(rSTR1) - lbz rWORD2, 0(rSTR2) - bdz- L(b11) + lbz rWORD1, 0(rSTR1) + lbz rWORD2, 0(rSTR2) + bdz- L(b11) - cmpld cr0, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 - lbz rWORD3, 1(rSTR1) - lbz rWORD4, 1(rSTR2) - bdz- L(b12) + lbz rWORD3, 1(rSTR1) + lbz rWORD4, 1(rSTR2) + bdz- L(b12) @@ -410,20 +609,20 @@ - lbzu rWORD5, 2(rSTR1) - lbzu rWORD6, 2(rSTR2) - bdz- L(b13) + lbzu rWORD5, 2(rSTR1) + lbzu rWORD6, 2(rSTR2) + bdz- L(b13) - .align 4 + .align 4 L(bLoop): - lbzu rWORD1, 1(rSTR1) - lbzu rWORD2, 1(rSTR2) + lbzu rWORD1, 1(rSTR1) + lbzu rWORD2, 1(rSTR2) - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - - cmpld cr6, rWORD5, rWORD6 - bdz- L(b3i) -- + + cmpld cr6, rWORD5, rWORD6 + bdz- L(b3i) +- + - lbzu rWORD3, 1(rSTR1) - lbzu rWORD4, 1(rSTR2) - bne- cr1, L(bLcr1) - + lbzu rWORD3, 1(rSTR1) + lbzu rWORD4, 1(rSTR2) + bne- cr1, L(bLcr1) + - cmpld cr0, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 - bdz- L(b2i) - - lbzu rWORD5, 1(rSTR1) + bdz- L(b2i) + + lbzu rWORD5, 1(rSTR1) @@ -432,31 +631,31 @@ - - cmpld cr1, rWORD3, rWORD4 - bdnz+ L(bLoop) -- + + cmpld cr1, rWORD3, rWORD4 + bdnz+ L(bLoop) +- + /* We speculatively loading bytes before we have tested the previous bytes. But we must avoid overrunning the length (in the ctr) to -- prevent these speculative loads from causing a segfault. In this +- prevent these speculative loads from causing a segfault. In this + prevent these speculative loads from causing a segfault. In this case the loop will exit early (before the all pending bytes are tested. In this case we must complete the pending operations @@ -4436,72 +4436,72 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. L(b1i): - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - bne- cr1, L(bLcr1) - b L(bx56) + bne- cr1, L(bLcr1) + b L(bx56) - .align 4 + .align 4 L(b2i): - bne- cr6, L(bLcr6) + bne- cr6, L(bLcr6) - bne- cr0, L(bLcr0) + bne- cr7, L(bLcr7) - b L(bx34) + b L(bx34) - .align 4 + .align 4 L(b3i): - bne- cr1, L(bLcr1) - bne- cr6, L(bLcr6) - b L(bx12) + bne- cr1, L(bLcr1) + bne- cr6, L(bLcr6) + b L(bx12) - .align 4 -L(bLcr0): + .align 4 +L(bLcr7): - li rRTN, 1 + li rRTN, 1 - bgtlr cr0 + bgtlr cr7 - li rRTN, -1 - blr + li rRTN, -1 + blr L(bLcr1): @@ -471,116 +670,121 @@ - blr - + blr + L(b13): - bne- cr0, L(bx12) + bne- cr7, L(bx12) - bne- cr1, L(bx34) + bne- cr1, L(bx34) L(bx56): - sub rRTN, rWORD5, rWORD6 - blr - nop + sub rRTN, rWORD5, rWORD6 + blr + nop L(b12): - bne- cr0, L(bx12) --L(bx34): +-L(bx34): + bne- cr7, L(bx12) +L(bx34): - sub rRTN, rWORD3, rWORD4 - blr + sub rRTN, rWORD3, rWORD4 + blr L(b11): L(bx12): - sub rRTN, rWORD1, rWORD2 - blr -- .align 4 + sub rRTN, rWORD1, rWORD2 + blr +- .align 4 -L(zeroLengthReturn): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) + .align 4 L(zeroLength): - li rRTN, 0 - blr - + li rRTN, 0 + blr + - .align 4 + .align 4 /* At this point we know the strings have different alignment and the - compare length is at least 8 bytes. rBITDIF containes the low order + compare length is at least 8 bytes. r12 contains the low order 3 bits of rSTR1 and cr5 contains the result of the logical compare -- of rBITDIF to 0. If rBITDIF == 0 then rStr1 is double word +- of rBITDIF to 0. If rBITDIF == 0 then rStr1 is double word + of r12 to 0. If r12 == 0 then rStr1 is double word aligned and can perform the DWunaligned loop. -- +- - Otherwise we know that rSTR1 is not aready DW aligned yet. + + Otherwise we know that rSTR1 is not already DW aligned yet. @@ -4532,18 +4532,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. +#define rWORD4_SHIFT r25 /* Left rotation temp for rWORD6. */ +#define rWORD6_SHIFT r24 /* Left rotation temp for rWORD8. */ L(unaligned): -- std r29,-24(r1) +- std r29,-24(r1) - cfi_offset(r29,-24) + std rSHL, -24(r1) + cfi_offset(rSHL, -24) - clrldi rSHL, rSTR2, 61 - beq- cr6, L(duzeroLength) -- std r28,-32(r1) + clrldi rSHL, rSTR2, 61 + beq- cr6, L(duzeroLength) +- std r28,-32(r1) - cfi_offset(r28,-32) + std rSHR, -32(r1) + cfi_offset(rSHR, -32) - beq cr5, L(DWunaligned) -- std r27,-40(r1) + beq cr5, L(DWunaligned) +- std r27,-40(r1) - cfi_offset(r27,-40) -/* Adjust the logical start of rSTR2 ro compensate for the extra bits + std rWORD8_SHIFT, -40(r1) @@ -4554,14 +4554,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sub rWORD8_SHIFT, rSTR2, r12 /* But do not attempt to address the DW before that DW that contains the actual start of rSTR2. */ - clrrdi rSTR2, rSTR2, 3 -- std r26,-48(r1) + clrrdi rSTR2, rSTR2, 3 +- std r26,-48(r1) - cfi_offset(r26,-48) -/* Compute the leaft/right shift counts for the unalign rSTR2, -- compensating for the logical (DW aligned) start of rSTR1. */ +- compensating for the logical (DW aligned) start of rSTR1. */ - clrldi rSHL, r27, 61 -- clrrdi rSTR1, rSTR1, 3 -- std r25,-56(r1) +- clrrdi rSTR1, rSTR1, 3 +- std r25,-56(r1) - cfi_offset(r25,-56) + std rWORD2_SHIFT, -48(r1) + cfi_offset(rWORD2_SHIFT, -48) @@ -4571,18 +4571,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + clrrdi rSTR1, rSTR1, 3 + std rWORD4_SHIFT, -56(r1) + cfi_offset(rWORD4_SHIFT, -56) - sldi rSHL, rSHL, 3 + sldi rSHL, rSHL, 3 - cmpld cr5, r27, rSTR2 - add rN, rN, rBITDIF - sldi r11, rBITDIF, 3 -- std r24,-64(r1) +- std r24,-64(r1) - cfi_offset(r24,-64) + cmpld cr5, rWORD8_SHIFT, rSTR2 + add rN, rN, r12 + sldi rWORD6, r12, 3 + std rWORD6_SHIFT, -64(r1) + cfi_offset(rWORD6_SHIFT, -64) - subfic rSHR, rSHL, 64 + subfic rSHR, rSHL, 64 - srdi rTMP, rN, 5 /* Divide by 32 */ - andi. rBITDIF, rN, 24 /* Get the DW remainder */ + srdi r0, rN, 5 /* Divide by 32 */ @@ -4591,18 +4591,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. this special case those bits may be discarded anyway. Also we must avoid loading a DW where none of the bits are part of rSTR2 as this may cross a page boundary and cause a page fault. */ - li rWORD8, 0 - blt cr5, L(dus0) + li rWORD8, 0 + blt cr5, L(dus0) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD8, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD8, 0(rSTR2) + ld rWORD8, 0(rSTR2) - la rSTR2, 8(rSTR2) + addi rSTR2, rSTR2, 8 +#endif - sld rWORD8, rWORD8, rSHL - + sld rWORD8, rWORD8, rSHL + L(dus0): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 @@ -4610,23 +4610,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 0(rSTR1) - ld rWORD2, 0(rSTR2) + ld rWORD1, 0(rSTR1) + ld rWORD2, 0(rSTR2) - cmpldi cr1, rBITDIF, 16 +#endif + cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 + cmpldi cr7, rN, 32 - srd rG, rWORD2, rSHR + srd r12, rWORD2, rSHR - clrldi rN, rN, 61 - beq L(duPs4) + clrldi rN, rN, 61 + beq L(duPs4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ - or rWORD8, rG, rWORD8 + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ + or rWORD8, r12, rWORD8 - bgt cr1, L(duPs3) - beq cr1, L(duPs2) - + bgt cr1, L(duPs3) + beq cr1, L(duPs2) + /* Remainder is 8 */ - .align 4 + .align 4 @@ -4637,25 +4637,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD8_SHIFT, rWORD2, rSHL + sld rWORD7, rWORD1, rWORD6 + sld rWORD8, rWORD8, rWORD6 - bge cr7, L(duP1e) + bge cr7, L(duP1e) /* At this point we exit early with the first double word compare complete and remainder of 0 to 7 bytes. See L(du14) for details on @@ -590,95 +794,133 @@ - bne cr5, L(duLcr5) - cmpld cr7, rN, rSHR - beq L(duZeroReturn) + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) - srd rA, rWORD2, rSHR +#endif + srd r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 16 */ - .align 4 + .align 4 @@ -4666,7 +4666,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD6_SHIFT, rWORD2, rSHL + sld rWORD5, rWORD1, rWORD6 + sld rWORD6, rWORD8, rWORD6 - b L(duP2e) + b L(duP2e) /* Remainder is 24 */ - .align 4 + .align 4 @@ -4677,7 +4677,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD4_SHIFT, rWORD2, rSHL + sld rWORD3, rWORD1, rWORD6 + sld rWORD4, rWORD8, rWORD6 - b L(duP3e) + b L(duP3e) /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 @@ -4692,25 +4692,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD2_SHIFT, rWORD2, rSHL + sld rWORD1, rWORD1, rWORD6 + sld rWORD2, rWORD8, rWORD6 - b L(duP4e) - + b L(duP4e) + /* At this point we know rSTR1 is double word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(DWunaligned): -- std r27,-40(r1) +- std r27,-40(r1) - cfi_offset(r27,-40) + std rWORD8_SHIFT, -40(r1) + cfi_offset(rWORD8_SHIFT, -40) - clrrdi rSTR2, rSTR2, 3 -- std r26,-48(r1) + clrrdi rSTR2, rSTR2, 3 +- std r26,-48(r1) - cfi_offset(r26,-48) - srdi rTMP, rN, 5 /* Divide by 32 */ -- std r25,-56(r1) +- std r25,-56(r1) - cfi_offset(r25,-56) - andi. rBITDIF, rN, 24 /* Get the DW remainder */ -- std r24,-64(r1) +- std r24,-64(r1) - cfi_offset(r24,-64) + std rWORD2_SHIFT, -48(r1) + cfi_offset(rWORD2_SHIFT, -48) @@ -4720,29 +4720,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + andi. r12, rN, 24 /* Get the DW remainder */ + std rWORD6_SHIFT, -64(r1) + cfi_offset(rWORD6_SHIFT, -64) - sldi rSHL, rSHL, 3 + sldi rSHL, rSHL, 3 +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD6, 0, rSTR2 + addi rSTR2, rSTR2, 8 + ldbrx rWORD8, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD6, 0(rSTR2) - ldu rWORD8, 8(rSTR2) + ld rWORD6, 0(rSTR2) + ldu rWORD8, 8(rSTR2) - cmpldi cr1, rBITDIF, 16 +#endif + cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - clrldi rN, rN, 61 - subfic rSHR, rSHL, 64 + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 + subfic rSHR, rSHL, 64 - sld rH, rWORD6, rSHL + sld rWORD6_SHIFT, rWORD6, rSHL - beq L(duP4) + beq L(duP4) - mtctr rTMP /* Power4 wants mtctr 1st in dispatch group */ + mtctr r0 /* Power4 wants mtctr 1st in dispatch group */ - bgt cr1, L(duP3) - beq cr1, L(duP2) -- + bgt cr1, L(duP3) + beq cr1, L(duP2) +- + /* Remainder is 8 */ - .align 4 @@ -4754,13 +4754,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ldbrx rWORD7, 0, rSTR1 + addi rSTR1, rSTR1, 8 +#else - ld rWORD7, 0(rSTR1) + ld rWORD7, 0(rSTR1) - sld rB, rWORD8, rSHL - or rWORD8, rG, rH +#endif + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP1x) + blt cr7, L(duP1x) L(duP1e): +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 @@ -4768,10 +4768,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) - ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) + ld rWORD2, 8(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 - srd rA, rWORD2, rSHR - sld rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -4784,8 +4784,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 16(rSTR1) - ld rWORD4, 16(rSTR2) + ld rWORD3, 16(rSTR1) + ld rWORD4, 16(rSTR2) - cmpld cr0, rWORD1, rWORD2 - srd rC, rWORD4, rSHR - sld rF, rWORD4, rSHL @@ -4793,7 +4793,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + cmpld cr7, rWORD1, rWORD2 + srd r12, rWORD4, rSHR + sld rWORD4_SHIFT, rWORD4, rSHL - bne cr5, L(duLcr5) + bne cr5, L(duLcr5) - or rWORD4, rC, rD + or rWORD4, r12, rWORD2_SHIFT +#ifdef __LITTLE_ENDIAN__ @@ -4802,10 +4802,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 24(rSTR1) - ld rWORD6, 24(rSTR2) + ld rWORD5, 24(rSTR1) + ld rWORD6, 24(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 - srd rE, rWORD6, rSHR - sld rH, rWORD6, rSHL - bne cr0, L(duLcr0) @@ -4814,8 +4814,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD6_SHIFT, rWORD6, rSHL + bne cr7, L(duLcr7) + or rWORD6, r0, rWORD4_SHIFT - cmpld cr6, rWORD5, rWORD6 -- b L(duLoop3) + cmpld cr6, rWORD5, rWORD6 +- b L(duLoop3) - .align 4 + b L(duLoop3) + .align 4 @@ -4823,21 +4823,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. complete and remainder of 0 to 7 bytes. See L(du14) for details on how we handle the remaining bytes. */ @@ -688,186 +930,321 @@ - bne cr5, L(duLcr5) - cmpld cr7, rN, rSHR - beq L(duZeroReturn) + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) - srd rA, rWORD2, rSHR +#endif + srd r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 16 */ - .align 4 + .align 4 @@ -4848,7 +4848,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ldbrx rWORD5, 0, rSTR1 + addi rSTR1, rSTR1, 8 +#else - ld rWORD5, 0(rSTR1) + ld rWORD5, 0(rSTR1) - or rWORD6, rE, rH - sld rH, rWORD8, rSHL +#endif @@ -4861,28 +4861,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD7, 8(rSTR1) - ld rWORD8, 8(rSTR2) + ld rWORD7, 8(rSTR1) + ld rWORD8, 8(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 + cmpld cr6, rWORD5, rWORD6 - srd rG, rWORD8, rSHR - sld rB, rWORD8, rSHL - or rWORD8, rG, rH + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP2x) + blt cr7, L(duP2x) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 + ldbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 16(rSTR1) - ld rWORD2, 16(rSTR2) + ld rWORD1, 16(rSTR1) + ld rWORD2, 16(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) - srd rA, rWORD2, rSHR - sld rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -4895,12 +4895,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 24(rSTR1) - ld rWORD4, 24(rSTR2) + ld rWORD3, 24(rSTR1) + ld rWORD4, 24(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 - bne cr5, L(duLcr5) + bne cr5, L(duLcr5) - srd rC, rWORD4, rSHR - sld rF, rWORD4, rSHL - or rWORD4, rC, rD @@ -4908,37 +4908,37 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD4_SHIFT, rWORD4, rSHL + or rWORD4, r12, rWORD2_SHIFT +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#endif - cmpld cr1, rWORD3, rWORD4 - b L(duLoop2) + cmpld cr1, rWORD3, rWORD4 + b L(duLoop2) - .align 4 + .align 4 L(duP2x): - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 -+#endif - bne cr6, L(duLcr6) - sldi. rN, rN, 3 - bne cr5, L(duLcr5) - cmpld cr7, rN, rSHR - beq L(duZeroReturn) + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 ++#endif + bne cr6, L(duLcr6) + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) - srd rA, rWORD2, rSHR +#endif + srd r0, rWORD2, rSHR - b L(dutrim) -- + b L(dutrim) +- + /* Remainder is 24 */ - .align 4 @@ -4950,7 +4950,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ldbrx rWORD3, 0, rSTR1 + addi rSTR1, rSTR1, 8 +#else - ld rWORD3, 0(rSTR1) + ld rWORD3, 0(rSTR1) - sld rF, rWORD8, rSHL - or rWORD4, rC, rH +#endif @@ -4963,10 +4963,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 8(rSTR1) - ld rWORD6, 8(rSTR2) + ld rWORD5, 8(rSTR1) + ld rWORD6, 8(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 - srd rE, rWORD6, rSHR - sld rH, rWORD6, rSHL - or rWORD6, rE, rF @@ -4979,29 +4979,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD7, 16(rSTR1) - ld rWORD8, 16(rSTR2) + ld rWORD7, 16(rSTR1) + ld rWORD8, 16(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) + cmpld cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) - srd rG, rWORD8, rSHR - sld rB, rWORD8, rSHL - or rWORD8, rG, rH + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP3x) + blt cr7, L(duP3x) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 + ldbrx rWORD2, 0, rSTR2 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 24(rSTR1) - ld rWORD2, 24(rSTR2) + ld rWORD1, 24(rSTR1) + ld rWORD2, 24(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) - srd rA, rWORD2, rSHR - sld rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -5009,42 +5009,42 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + sld rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 - b L(duLoop1) + b L(duLoop1) - .align 4 + .align 4 L(duP3x): +#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 +#endif +#if 0 +/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) -+#endif - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) - sldi. rN, rN, 3 - bne cr5, L(duLcr5) - cmpld cr7, rN, rSHR - beq L(duZeroReturn) + bne cr1, L(duLcr1) ++#endif + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) - srd rA, rWORD2, rSHR +#endif + srd r0, rWORD2, rSHR - b L(dutrim) -- + b L(dutrim) +- + /* Count is a multiple of 32, remainder is 0 */ - .align 4 @@ -5058,7 +5058,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + ldbrx rWORD1, 0, rSTR1 + addi rSTR1, rSTR1, 8 +#else - ld rWORD1, 0(rSTR1) + ld rWORD1, 0(rSTR1) - sld rD, rWORD8, rSHL - or rWORD2, rA, rH +#endif @@ -5071,8 +5071,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 8(rSTR1) - ld rWORD4, 8(rSTR2) + ld rWORD3, 8(rSTR1) + ld rWORD4, 8(rSTR2) - cmpld cr0, rWORD1, rWORD2 - srd rC, rWORD4, rSHR - sld rF, rWORD4, rSHL @@ -5088,10 +5088,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 16(rSTR1) - ld rWORD6, 16(rSTR2) + ld rWORD5, 16(rSTR1) + ld rWORD6, 16(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 - bne cr0, L(duLcr0) - srd rE, rWORD6, rSHR - sld rH, rWORD6, rSHL @@ -5106,19 +5106,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ldu rWORD7, 24(rSTR1) - ldu rWORD8, 24(rSTR2) + ldu rWORD7, 24(rSTR1) + ldu rWORD8, 24(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) + cmpld cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) - srd rG, rWORD8, rSHR - sld rB, rWORD8, rSHL - or rWORD8, rG, rH + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - cmpld cr5, rWORD7, rWORD8 - bdz- L(du24) /* Adjust CTR as we start with +4 */ + cmpld cr5, rWORD7, rWORD8 + bdz- L(du24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 @@ -5129,11 +5129,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD1, 8(rSTR1) - ld rWORD2, 8(rSTR2) + ld rWORD1, 8(rSTR1) + ld rWORD2, 8(rSTR2) +#endif - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) - srd rA, rWORD2, rSHR - sld rD, rWORD2, rSHL - or rWORD2, rA, rB @@ -5147,11 +5147,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD3, 16(rSTR1) - ld rWORD4, 16(rSTR2) + ld rWORD3, 16(rSTR1) + ld rWORD4, 16(rSTR2) +#endif - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(duLcr5) + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(duLcr5) - srd rC, rWORD4, rSHR - sld rF, rWORD4, rSHL - or rWORD4, rC, rD @@ -5165,10 +5165,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ld rWORD5, 24(rSTR1) - ld rWORD6, 24(rSTR2) + ld rWORD5, 24(rSTR1) + ld rWORD6, 24(rSTR2) +#endif - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 - bne cr0, L(duLcr0) - srd rE, rWORD6, rSHR - sld rH, rWORD6, rSHL @@ -5184,17 +5184,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 +#else - ldu rWORD7, 32(rSTR1) - ldu rWORD8, 32(rSTR2) + ldu rWORD7, 32(rSTR1) + ldu rWORD8, 32(rSTR2) - cmpld cr0, rWORD1, rWORD2 +#endif + cmpld cr7, rWORD1, rWORD2 - bne- cr1, L(duLcr1) + bne- cr1, L(duLcr1) - srd rG, rWORD8, rSHR - sld rB, rWORD8, rSHL - or rWORD8, rG, rH -- bdnz+ L(duLoop) -- +- bdnz+ L(duLoop) +- + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT @@ -5203,45 +5203,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. L(duL4): +#if 0 +/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) + bne cr1, L(duLcr1) +#endif - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(duLcr5) - cmpld cr5, rWORD7, rWORD8 + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(duLcr5) + cmpld cr5, rWORD7, rWORD8 L(du44): - bne cr0, L(duLcr0) + bne cr7, L(duLcr7) L(du34): - bne cr1, L(duLcr1) + bne cr1, L(duLcr1) L(du24): @@ -876,106 +1253,113 @@ - sldi. rN, rN, 3 - bne cr5, L(duLcr5) + sldi. rN, rN, 3 + bne cr5, L(duLcr5) /* At this point we have a remainder of 1 to 7 bytes to compare. We use -- shift right double to elliminate bits beyond the compare length. +- shift right double to elliminate bits beyond the compare length. - This allows the use of double word subtract to compute the final - result. + shift right double to eliminate bits beyond the compare length. - -- However it may not be safe to load rWORD2 which may be beyond the + +- However it may not be safe to load rWORD2 which may be beyond the + However it may not be safe to load rWORD2 which may be beyond the string length. So we compare the bit length of the remainder to the right shift count (rSHR). If the bit count is less than or equal we do not need to load rWORD2 (all significant bits are already in - rB). */ + rWORD8_SHIFT). */ - cmpld cr7, rN, rSHR - beq L(duZeroReturn) + cmpld cr7, rN, rSHR + beq L(duZeroReturn) - li rA, 0 + li r0, 0 - ble cr7, L(dutrim) + ble cr7, L(dutrim) +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD2, 0, rSTR2 + addi rSTR2, rSTR2, 8 +#else - ld rWORD2, 8(rSTR2) + ld rWORD2, 8(rSTR2) - srd rA, rWORD2, rSHR - .align 4 +#endif @@ -5251,11 +5251,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. +#ifdef __LITTLE_ENDIAN__ + ldbrx rWORD1, 0, rSTR1 +#else - ld rWORD1, 8(rSTR1) + ld rWORD1, 8(rSTR1) - ld rWORD8,-8(r1) -- subfic rN, rN, 64 /* Shift count is 64 - (rN * 8). */ +- subfic rN, rN, 64 /* Shift count is 64 - (rN * 8). */ - or rWORD2, rA, rB -- ld rWORD7,-16(r1) +- ld rWORD7,-16(r1) - ld r29,-24(r1) +#endif + ld rWORD8, -8(r1) @@ -5263,14 +5263,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + or rWORD2, r0, rWORD8_SHIFT + ld rWORD7, -16(r1) + ld rSHL, -24(r1) - srd rWORD1, rWORD1, rN - srd rWORD2, rWORD2, rN -- ld r28,-32(r1) + srd rWORD1, rWORD1, rN + srd rWORD2, rWORD2, rN +- ld r28,-32(r1) - ld r27,-40(r1) + ld rSHR, -32(r1) + ld rWORD8_SHIFT, -40(r1) - li rRTN, 0 -- cmpld cr0, rWORD1, rWORD2 + li rRTN, 0 +- cmpld cr0, rWORD1, rWORD2 - ld r26,-48(r1) - ld r25,-56(r1) - beq cr0, L(dureturn24) @@ -5284,7 +5284,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) - li rRTN, 1 -- bgt cr0, L(dureturn29) +- bgt cr0, L(dureturn29) - ld r29,-24(r1) - ld r28,-32(r1) + cmpld cr7, rWORD1, rWORD2 @@ -5304,8 +5304,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. + bgt cr7, L(dureturn29) + ld rSHL, -24(r1) + ld rSHR, -32(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr1): @@ -5313,15 +5313,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - ld rWORD7,-16(r1) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) - li rRTN, 1 -- bgt cr1, L(dureturn29) + li rRTN, 1 +- bgt cr1, L(dureturn29) - ld r29,-24(r1) - ld r28,-32(r1) + bgt cr1, L(dureturn29) + ld rSHL, -24(r1) + ld rSHR, -32(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr6): @@ -5329,15 +5329,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - ld rWORD7,-16(r1) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) - li rRTN, 1 -- bgt cr6, L(dureturn29) + li rRTN, 1 +- bgt cr6, L(dureturn29) - ld r29,-24(r1) - ld r28,-32(r1) + bgt cr6, L(dureturn29) + ld rSHL, -24(r1) + ld rSHR, -32(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) - .align 4 + .align 4 L(duLcr5): @@ -5345,31 +5345,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. - ld rWORD7,-16(r1) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) - li rRTN, 1 -- bgt cr5, L(dureturn29) + li rRTN, 1 +- bgt cr5, L(dureturn29) - ld r29,-24(r1) - ld r28,-32(r1) + bgt cr5, L(dureturn29) + ld rSHL, -24(r1) + ld rSHR, -32(r1) - li rRTN, -1 - b L(dureturn27) - .align 3 + li rRTN, -1 + b L(dureturn27) + .align 3 L(duZeroReturn): - li rRTN,0 + li rRTN, 0 - .align 4 + .align 4 L(dureturn): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) --L(dureturn29): +-L(dureturn29): - ld r29,-24(r1) - ld r28,-32(r1) --L(dureturn27): +-L(dureturn27): - ld r27,-40(r1) --L(dureturn26): +-L(dureturn26): - ld r26,-48(r1) --L(dureturn25): +-L(dureturn25): - ld r25,-56(r1) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) @@ -5385,12 +5385,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcmp.S glibc-2. L(dureturn24): - ld r24,-64(r1) + ld rWORD6_SHIFT, -64(r1) - blr + blr L(duzeroLength): - li rRTN,0 + li rRTN, 0 - blr - + blr + -END (BP_SYM (memcmp)) +END (memcmp) libc_hidden_builtin_def (memcmp) @@ -5403,24 +5403,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - Copyright (C) 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2010-2014 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 @@ -17,379 +17,576 @@ . */ - + #include -#include -#include - + /* int [r3] memcmp (const char *s1 [r3], - const char *s2 [r4], - size_t size [r5]) */ - - .machine power7 + const char *s2 [r4], + size_t size [r5]) */ + + .machine power7 -EALIGN (BP_SYM(memcmp),4,0) +EALIGN (memcmp, 4, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rTMP r0 #define rRTN r3 #define rSTR1 r3 /* first string arg */ @@ -5438,7 +5438,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. -#define rBITDIF r12 /* bits that differ in s1 & s2 words */ #define rWORD7 r30 /* next word in s1 */ #define rWORD8 r31 /* next word in s2 */ - + - xor rTMP,rSTR2,rSTR1 - cmpldi cr6,rN,0 - cmpldi cr1,rN,12 @@ -5470,7 +5470,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cfi_offset(rWORD8, -8) + std rWORD7, -16(r1) + cfi_offset(rWORD7, -16) - bne L(unaligned) + bne L(unaligned) /* At this point we know both strings have the same alignment and the - compare length is at least 8 bytes. rBITDIF containes the low order + compare length is at least 8 bytes. r12 contains the low order @@ -5479,7 +5479,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - aligned and can perform the DWaligned loop. + of r12 to 0. If r12 == 0 then we are already double word + aligned and can perform the DW aligned loop. - + Otherwise we know the two strings have the same alignment (but not - yet DW). So we can force the string addresses to the next lower DW - boundary and special case this first DW word using shift left to @@ -5494,7 +5494,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - correct and the first DW (shifted) is in the expected resister pair. */ + versioning for the first DW. This ensures that the loop count is + correct and the first DW (shifted) is in the expected register pair. */ - .align 4 + .align 4 L(samealignment): - clrrdi rSTR1,rSTR1,3 - clrrdi rSTR2,rSTR2,3 @@ -5527,16 +5527,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cmpldi cr1, r12, 16 + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 - beq L(dPs4) + beq L(dPs4) - mtctr rTMP - bgt cr1,L(dPs3) - beq cr1,L(dPs2) + mtctr r0 + bgt cr1, L(dPs3) + beq cr1, L(dPs2) - + /* Remainder is 8 */ - .align 3 + .align 3 L(dsP1): - sld rWORD5,rWORD1,r11 - sld rWORD6,rWORD2,r11 @@ -5560,9 +5560,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + cmpld cr7, rWORD1, rWORD2 - b L(dP1e) + b L(dP1e) /* Remainder is 16 */ - .align 4 + .align 4 L(dPs2): - sld rWORD5,rWORD1,r11 - sld rWORD6,rWORD2,r11 @@ -5586,9 +5586,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD8, 8(rSTR2) +#endif + cmpld cr5, rWORD7, rWORD8 - b L(dP2e) + b L(dP2e) /* Remainder is 24 */ - .align 4 + .align 4 L(dPs3): - sld rWORD3,rWORD1,r11 - sld rWORD4,rWORD2,r11 @@ -5596,9 +5596,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD3, rWORD1, rWORD6 + sld rWORD4, rWORD2, rWORD6 + cmpld cr1, rWORD3, rWORD4 - b L(dP3e) + b L(dP3e) /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 L(dPs4): - mtctr rTMP - sld rWORD1,rWORD1,r11 @@ -5608,11 +5608,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD1, rWORD1, rWORD6 + sld rWORD2, rWORD2, rWORD6 + cmpld cr7, rWORD1, rWORD2 - b L(dP4e) - + b L(dP4e) + /* At this point we know both strings are double word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(DWaligned): - andi. rBITDIF,rN,24 /* Get the DW remainder */ - srdi rTMP,rN,5 /* Divide by 32 */ @@ -5624,14 +5624,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cmpldi cr1, r12, 16 + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 - beq L(dP4) + beq L(dP4) - bgt cr1,L(dP3) - beq cr1,L(dP2) + bgt cr1, L(dP3) + beq cr1, L(dP2) - + /* Remainder is 8 */ - .align 4 + .align 4 L(dP1): - mtctr rTMP + mtctr r0 @@ -5719,14 +5719,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + cmpld cr5, rWORD7, rWORD8 - bdnz L(dLoop) + bdnz L(dLoop) - bne cr6,L(dLcr6) - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) + bne cr6, L(dLcr6) + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) - .align 3 + .align 3 L(dP1x): - sldi. r12,rN,3 - bne cr5,L(dLcr5) @@ -5734,13 +5734,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sldi. r12, rN, 3 + bne cr5, L(dLcr5x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Remainder is 16 */ - .align 4 + .align 4 L(dP2): - mtctr rTMP - ld rWORD5,0(rSTR1) @@ -5809,12 +5809,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. +#endif + bne cr6, L(dLcr6) + bne cr5, L(dLcr5) - b L(dLoop2) + b L(dLoop2) /* Again we are on a early exit path (16-23 byte compare), we want to - only use volitile registers and avoid restoring non-volitile + only use volatile registers and avoid restoring non-volatile registers. */ - .align 4 + .align 4 L(dP2x): - ld rWORD3,8(rSTR1) - ld rWORD4,8(rSTR2) @@ -5843,13 +5843,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Remainder is 24 */ - .align 4 + .align 4 L(dP3): - mtctr rTMP - ld rWORD3,0(rSTR1) @@ -5918,12 +5918,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + bne cr6, L(dLcr6) - b L(dLoop1) + b L(dLoop1) /* Again we are on a early exit path (24-31 byte compare), we want to - only use volitile registers and avoid restoring non-volitile + only use volatile registers and avoid restoring non-volatile registers. */ - .align 4 + .align 4 L(dP3x): - ld rWORD1,16(rSTR1) - ld rWORD2,16(rSTR2) @@ -5954,13 +5954,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + bne cr6, L(dLcr6x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne cr7, L(dLcr7x) - bne L(d00) + bne L(d00) - li rRTN,0 + li rRTN, 0 - blr - + blr + /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 L(dP4): - mtctr rTMP - ld rWORD1,0(rSTR1) @@ -6021,9 +6021,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cmpld cr5, rWORD7, rWORD8 + bne cr7, L(dLcr7) + bne cr1, L(dLcr1) - bdz- L(d24) /* Adjust CTR as we start with +4 */ + bdz- L(d24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 L(dLoop): - ld rWORD1,8(rSTR1) - ld rWORD2,8(rSTR2) @@ -6088,8 +6088,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. +#endif + bne cr1, L(dLcr1) + cmpld cr7, rWORD1, rWORD2 - bdnz L(dLoop) - + bdnz L(dLoop) + L(dL4): - cmpld cr1,rWORD3,rWORD4 - bne cr6,L(dLcr6) @@ -6122,7 +6122,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD8, -8(r1) + ld rWORD7, -16(r1) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - beq L(zeroLength) + beq L(zeroLength) /* At this point we have a remainder of 1 to 7 bytes to compare. Since we are aligned it is safe to load the whole double word, and use - shift right double to elliminate bits beyond the compare length. */ @@ -6149,9 +6149,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cmpld cr7, rWORD1, rWORD2 + bne cr7, L(dLcr7x) + li rRTN, 0 - blr + blr + - .align 4 + .align 4 -L(dLcr0): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -6165,8 +6165,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + li rRTN, 1 + bgtlr cr7 + li rRTN, -1 - blr - .align 4 + blr + .align 4 L(dLcr1): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -6175,11 +6175,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD7, -16(r1) +L(dLcr1x): + li rRTN, 1 - bgtlr cr1 + bgtlr cr1 - li rRTN,-1 + li rRTN, -1 - blr - .align 4 + blr + .align 4 L(dLcr6): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -6188,11 +6188,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD7, -16(r1) +L(dLcr6x): + li rRTN, 1 - bgtlr cr6 + bgtlr cr6 - li rRTN,-1 + li rRTN, -1 - blr - .align 4 + blr + .align 4 L(dLcr5): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -6201,46 +6201,46 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. L(dLcr5x): - li rRTN,1 + li rRTN, 1 - bgtlr cr5 + bgtlr cr5 - li rRTN,-1 + li rRTN, -1 - blr - - .align 4 + blr + + .align 4 L(bytealigned): - mtctr rN + mtctr rN - beq cr6,L(zeroLength) +#if 0 +/* Huh? We've already branched on cr6! */ + beq cr6, L(zeroLength) +#endif - + /* We need to prime this loop. This loop is swing modulo scheduled to avoid pipe delays. The dependent instruction latencies (load to @@ -401,38 +598,38 @@ So we must precondition some registers and condition codes so that we don't exit the loop early on the first iteration. */ - + - lbz rWORD1,0(rSTR1) - lbz rWORD2,0(rSTR2) + lbz rWORD1, 0(rSTR1) + lbz rWORD2, 0(rSTR2) - bdz L(b11) + bdz L(b11) - cmpld cr0,rWORD1,rWORD2 - lbz rWORD3,1(rSTR1) - lbz rWORD4,1(rSTR2) + cmpld cr7, rWORD1, rWORD2 + lbz rWORD3, 1(rSTR1) + lbz rWORD4, 1(rSTR2) - bdz L(b12) + bdz L(b12) - cmpld cr1,rWORD3,rWORD4 - lbzu rWORD5,2(rSTR1) - lbzu rWORD6,2(rSTR2) + cmpld cr1, rWORD3, rWORD4 + lbzu rWORD5, 2(rSTR1) + lbzu rWORD6, 2(rSTR2) - bdz L(b13) - .align 4 + bdz L(b13) + .align 4 L(bLoop): - lbzu rWORD1,1(rSTR1) - lbzu rWORD2,1(rSTR2) @@ -6248,33 +6248,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + lbzu rWORD1, 1(rSTR1) + lbzu rWORD2, 1(rSTR2) + bne cr7, L(bLcr7) - + - cmpld cr6,rWORD5,rWORD6 + cmpld cr6, rWORD5, rWORD6 - bdz L(b3i) - + bdz L(b3i) + - lbzu rWORD3,1(rSTR1) - lbzu rWORD4,1(rSTR2) - bne cr1,L(bLcr1) + lbzu rWORD3, 1(rSTR1) + lbzu rWORD4, 1(rSTR2) + bne cr1, L(bLcr1) - + - cmpld cr0,rWORD1,rWORD2 + cmpld cr7, rWORD1, rWORD2 - bdz L(b2i) - + bdz L(b2i) + - lbzu rWORD5,1(rSTR1) - lbzu rWORD6,1(rSTR2) - bne cr6,L(bLcr6) + lbzu rWORD5, 1(rSTR1) + lbzu rWORD6, 1(rSTR2) + bne cr6, L(bLcr6) - + - cmpld cr1,rWORD3,rWORD4 + cmpld cr1, rWORD3, rWORD4 - bdnz L(bLoop) - + bdnz L(bLoop) + /* We speculatively loading bytes before we have tested the previous @@ -442,542 +639,727 @@ tested. In this case we must complete the pending operations @@ -6284,22 +6284,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - bne cr1,L(bLcr1) + bne cr7, L(bLcr7) + bne cr1, L(bLcr1) - b L(bx56) - .align 4 + b L(bx56) + .align 4 L(b2i): - bne cr6,L(bLcr6) - bne cr0,L(bLcr0) + bne cr6, L(bLcr6) + bne cr7, L(bLcr7) - b L(bx34) - .align 4 + b L(bx34) + .align 4 L(b3i): - bne cr1,L(bLcr1) - bne cr6,L(bLcr6) + bne cr1, L(bLcr1) + bne cr6, L(bLcr6) - b L(bx12) - .align 4 + b L(bx12) + .align 4 -L(bLcr0): - li rRTN,1 - bgtlr cr0 @@ -6308,22 +6308,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + li rRTN, 1 + bgtlr cr7 + li rRTN, -1 - blr + blr L(bLcr1): - li rRTN,1 + li rRTN, 1 - bgtlr cr1 + bgtlr cr1 - li rRTN,-1 + li rRTN, -1 - blr + blr L(bLcr6): - li rRTN,1 + li rRTN, 1 - bgtlr cr6 + bgtlr cr6 - li rRTN,-1 + li rRTN, -1 - blr - + blr + L(b13): - bne cr0,L(bx12) - bne cr1,L(bx34) @@ -6332,30 +6332,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. L(bx56): - sub rRTN,rWORD5,rWORD6 + sub rRTN, rWORD5, rWORD6 - blr - nop + blr + nop L(b12): - bne cr0,L(bx12) + bne cr7, L(bx12) L(bx34): - sub rRTN,rWORD3,rWORD4 + sub rRTN, rWORD3, rWORD4 - blr + blr L(b11): L(bx12): - sub rRTN,rWORD1,rWORD2 + sub rRTN, rWORD1, rWORD2 - blr - .align 4 + blr + .align 4 -L(zeroLengthReturn): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) L(zeroLength): - li rRTN,0 + li rRTN, 0 - blr - - .align 4 + blr + + .align 4 /* At this point we know the strings have different alignment and the - compare length is at least 8 bytes. rBITDIF containes the low order + compare length is at least 8 bytes. r12 contains the low order @@ -6363,7 +6363,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - of rBITDIF to 0. If rBITDIF == 0 then rStr1 is double word + of r12 to 0. If r12 == 0 then rStr1 is double word aligned and can perform the DWunaligned loop. - + - Otherwise we know that rSTR1 is not aready DW aligned yet. + Otherwise we know that rSTR1 is not already DW aligned yet. So we can force the string addresses to the next lower DW @@ -6472,7 +6472,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 8 +#endif + sld rWORD8, rWORD8, rSHL - + L(dus0): - ld rWORD1,0(rSTR1) - ld rWORD2,0(rSTR2) @@ -6493,7 +6493,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + cmpldi cr7, rN, 32 + srd r12, rWORD2, rSHR + clrldi rN, rN, 61 - beq L(duPs4) + beq L(duPs4) - mtctr rTMP - or rWORD8,rG,rWORD8 - bgt cr1,L(duPs3) @@ -6502,9 +6502,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + or rWORD8, r12, rWORD8 + bgt cr1, L(duPs3) + beq cr1, L(duPs2) - + /* Remainder is 8 */ - .align 4 + .align 4 L(dusP1): - sld rB,rWORD2,rSHL - sld rWORD7,rWORD1,r11 @@ -6525,7 +6525,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -6539,9 +6539,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + srd r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 16 */ - .align 4 + .align 4 L(duPs2): - sld rH,rWORD2,rSHL - sld rWORD5,rWORD1,r11 @@ -6549,9 +6549,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD6_SHIFT, rWORD2, rSHL + sld rWORD5, rWORD1, rWORD6 + sld rWORD6, rWORD8, rWORD6 - b L(duP2e) + b L(duP2e) /* Remainder is 24 */ - .align 4 + .align 4 L(duPs3): - sld rF,rWORD2,rSHL - sld rWORD3,rWORD1,r11 @@ -6559,9 +6559,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD4_SHIFT, rWORD2, rSHL + sld rWORD3, rWORD1, rWORD6 + sld rWORD4, rWORD8, rWORD6 - b L(duP3e) + b L(duP3e) /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 L(duPs4): - mtctr rTMP - or rWORD8,rG,rWORD8 @@ -6573,11 +6573,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD2_SHIFT, rWORD2, rSHL + sld rWORD1, rWORD1, rWORD6 + sld rWORD2, rWORD8, rWORD6 - b L(duP4e) - + b L(duP4e) + /* At this point we know rSTR1 is double word aligned and the compare length is at least 8 bytes. */ - .align 4 + .align 4 L(DWunaligned): - std r27,-40(r1) - cfi_offset(r27,-40) @@ -6624,16 +6624,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + clrldi rN, rN, 61 + subfic rSHR, rSHL, 64 + sld rWORD6_SHIFT, rWORD6, rSHL - beq L(duP4) + beq L(duP4) - mtctr rTMP - bgt cr1,L(duP3) - beq cr1,L(duP2) + mtctr r0 + bgt cr1, L(duP3) + beq cr1, L(duP2) - + /* Remainder is 8 */ - .align 4 + .align 4 L(duP1): - srd rG,rWORD8,rSHR - ld rWORD7,0(rSTR1) @@ -6714,8 +6714,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + bne cr7, L(duLcr7) + or rWORD6, r0, rWORD4_SHIFT + cmpld cr6, rWORD5, rWORD6 - b L(duLoop3) - .align 4 + b L(duLoop3) + .align 4 /* At this point we exit early with the first double word compare complete and remainder of 0 to 7 bytes. See L(du14) for details on how we handle the remaining bytes. */ @@ -6728,7 +6728,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -6742,9 +6742,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + srd r0, rWORD2, rSHR - b L(dutrim) + b L(dutrim) /* Remainder is 16 */ - .align 4 + .align 4 L(duP2): - srd rE,rWORD8,rSHR - ld rWORD5,0(rSTR1) @@ -6831,8 +6831,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 8 +#endif + cmpld cr1, rWORD3, rWORD4 - b L(duLoop2) - .align 4 + b L(duLoop2) + .align 4 L(duP2x): - cmpld cr5,rWORD7,rWORD8 - addi rSTR1,rSTR1,8 @@ -6850,7 +6850,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -6864,10 +6864,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + srd r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Remainder is 24 */ - .align 4 + .align 4 L(duP3): - srd rC,rWORD8,rSHR - ld rWORD3,0(rSTR1) @@ -6954,8 +6954,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + addi rSTR2, rSTR2, 16 +#endif + cmpld cr7, rWORD1, rWORD2 - b L(duLoop1) - .align 4 + b L(duLoop1) + .align 4 L(duP3x): - addi rSTR1,rSTR1,16 - addi rSTR2,rSTR2,16 @@ -6978,7 +6978,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sldi. rN, rN, 3 + bne cr5, L(duLcr5) + cmpld cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -6992,10 +6992,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + srd r0, rWORD2, rSHR - b L(dutrim) - + b L(dutrim) + /* Count is a multiple of 32, remainder is 0 */ - .align 4 + .align 4 L(duP4): - mtctr rTMP - srd rA,rWORD8,rSHR @@ -7076,9 +7076,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT + cmpld cr5, rWORD7, rWORD8 - bdz L(du24) /* Adjust CTR as we start with +4 */ + bdz L(du24) /* Adjust CTR as we start with +4 */ /* This is the primary loop */ - .align 4 + .align 4 L(duLoop): - ld rWORD1,8(rSTR1) - ld rWORD2,8(rSTR2) @@ -7167,8 +7167,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT - bdnz L(duLoop) - + bdnz L(duLoop) + L(duL4): - bne cr1,L(duLcr1) - cmpld cr1,rWORD3,rWORD4 @@ -7204,7 +7204,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - This allows the use of double word subtract to compute the final - result. + shift right double to eliminate bits beyond the compare length. - + However it may not be safe to load rWORD2 which may be beyond the string length. So we compare the bit length of the remainder to the right shift count (rSHR). If the bit count is less than or equal @@ -7213,7 +7213,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. - cmpld cr7,rN,rSHR + rWORD8_SHIFT). */ + cmpld cr7, rN, rSHR - beq L(duZeroReturn) + beq L(duZeroReturn) - li rA,0 - ble cr7,L(dutrim) - ld rWORD2,8(rSTR2) @@ -7227,7 +7227,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rWORD2, 8(rSTR2) +#endif + srd r0, rWORD2, rSHR - .align 4 + .align 4 L(dutrim): - ld rWORD1,8(rSTR1) - ld rWORD8,-8(r1) @@ -7291,8 +7291,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rSHL, -24(r1) + ld rSHR, -32(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr1): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -7308,8 +7308,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rSHL, -24(r1) + ld rSHR, -32(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr6): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -7325,8 +7325,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rSHL, -24(r1) + ld rSHR, -32(r1) + li rRTN, -1 - b L(dureturn27) - .align 4 + b L(dureturn27) + .align 4 L(duLcr5): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -7342,12 +7342,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. + ld rSHL, -24(r1) + ld rSHR, -32(r1) + li rRTN, -1 - b L(dureturn27) - .align 3 + b L(dureturn27) + .align 3 L(duZeroReturn): - li rRTN,0 + li rRTN, 0 - .align 4 + .align 4 L(dureturn): - ld rWORD8,-8(r1) - ld rWORD7,-16(r1) @@ -7370,12 +7370,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcmp.S glibc-2. L(dureturn24): - ld r24,-64(r1) + ld rWORD6_SHIFT, -64(r1) - blr + blr L(duzeroLength): - li rRTN,0 + li rRTN, 0 - blr - + blr + -END (BP_SYM (memcmp)) +END (memcmp) libc_hidden_builtin_def (memcmp) diff --git a/SOURCES/glibc-ppc64le-31.patch b/SOURCES/glibc-ppc64le-31.patch index dfde2989..de90661a 100644 --- a/SOURCES/glibc-ppc64le-31.patch +++ b/SOURCES/glibc-ppc64le-31.patch @@ -1,15 +1,15 @@ # commit 759cfef3ac4c07dba1ece0bbc1207e099348816d # Author: Alan Modra # Date: Sat Aug 17 18:47:22 2013 +0930 -# +# # PowerPC LE memcpy # http://sourceware.org/ml/libc-alpha/2013-08/msg00103.html -# +# # LIttle-endian support for memcpy. I spent some time cleaning up the # 64-bit power7 memcpy, in order to avoid the extra alignment traps # power7 takes for little-endian. It probably would have been better # to copy the linux kernel version of memcpy. -# +# # * sysdeps/powerpc/powerpc32/power4/memcpy.S: Add little endian support. # * sysdeps/powerpc/powerpc32/power6/memcpy.S: Likewise. # * sysdeps/powerpc/powerpc32/power7/memcpy.S: Likewise. @@ -20,7 +20,7 @@ # * sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise. # * sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise. Make better # use of regs. Use power7 mtocrf. Tidy function tails. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcpy.S 2014-05-29 13:04:56.000000000 -0500 @@ -55,7 +55,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memcpy.S glibc-2. cmplwi cr1,10,16 @@ -341,13 +354,23 @@ bf 30,1f - + /* there are at least two words to copy, so copy them */ +#ifdef __LITTLE_ENDIAN__ + srw 0,6,10 @@ -208,7 +208,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memcpy.S glibc-2. blt cr5,L(wdu1_32tail) mtctr 8 @@ -587,8 +604,12 @@ - + lwz 8,3(4) lwz 7,4(4) +#ifdef __LITTLE_ENDIAN__ @@ -257,7 +257,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memcpy.S glibc-2. rlwimi 6,8,8,(32-8),31 +#endif b L(wdu_32tailx) - + L(wdu2_32): @@ -635,7 +668,11 @@ lwz 6,-2(4) @@ -272,7 +272,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memcpy.S glibc-2. blt cr5,L(wdu2_32tail) mtctr 8 @@ -643,8 +680,11 @@ - + lwz 8,2(4) lwz 7,4(4) -/* Equivalent to: srwi 8,8,32-8; or 6,6,8 */ @@ -320,7 +320,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memcpy.S glibc-2. rlwimi 6,8,16,(32-16),31 +#endif b L(wdu_32tailx) - + L(wdu3_32): @@ -692,7 +742,11 @@ lwz 6,-3(4) @@ -335,7 +335,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memcpy.S glibc-2. blt cr5,L(wdu3_32tail) mtctr 8 @@ -700,8 +754,11 @@ - + lwz 8,1(4) lwz 7,4(4) -/* Equivalent to: srwi 8,8,32-8; or 6,6,8 */ @@ -389,40 +389,40 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2. --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S 2014-05-29 13:04:56.000000000 -0500 @@ -385,7 +385,7 @@ - - beq L(copy_GE_32_unaligned_cont) - + + beq L(copy_GE_32_unaligned_cont) + - /* SRC is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */ - - mtcrf 0x01,0 - subf 31,0,5 + + mtcrf 0x01,0 + subf 31,0,5 @@ -437,13 +437,21 @@ - mr 11,12 - mtcrf 0x01,9 - cmplwi cr6,9,1 + mr 11,12 + mtcrf 0x01,9 + cmplwi cr6,9,1 +#ifdef __LITTLE_ENDIAN__ + lvsr 5,0,12 +#else - lvsl 5,0,12 + lvsl 5,0,12 +#endif - lvx 3,0,12 - bf 31,L(setup_unaligned_loop) - - /* Copy another 16 bytes to align to 32-bytes due to the loop . */ - lvx 4,12,6 + lvx 3,0,12 + bf 31,L(setup_unaligned_loop) + + /* Copy another 16 bytes to align to 32-bytes due to the loop . */ + lvx 4,12,6 +#ifdef __LITTLE_ENDIAN__ + vperm 6,4,3,5 +#else - vperm 6,3,4,5 + vperm 6,3,4,5 +#endif - addi 11,12,16 - addi 10,3,16 - stvx 6,0,3 + addi 11,12,16 + addi 10,3,16 + stvx 6,0,3 @@ -463,11 +471,17 @@ - vector instructions though. */ - - lvx 4,11,6 /* vr4 = r11+16. */ + vector instructions though. */ + + lvx 4,11,6 /* vr4 = r11+16. */ - vperm 6,3,4,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr6. */ +#ifdef __LITTLE_ENDIAN__ @@ -430,7 +430,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2. +#else + vperm 6,3,4,5 +#endif - lvx 3,11,7 /* vr3 = r11+32. */ + lvx 3,11,7 /* vr3 = r11+32. */ - vperm 10,4,3,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr10. */ +#ifdef __LITTLE_ENDIAN__ @@ -438,49 +438,49 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2. +#else + vperm 10,4,3,5 +#endif - addi 11,11,32 - stvx 6,0,10 - stvx 10,10,6 + addi 11,11,32 + stvx 6,0,10 + stvx 10,10,6 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 @@ -327,7 +327,7 @@ - - beq L(copy_GE_32_unaligned_cont) - + + beq L(copy_GE_32_unaligned_cont) + - /* SRC is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */ - - mtcrf 0x01,0 - subf 31,0,5 + + mtcrf 0x01,0 + subf 31,0,5 @@ -379,13 +379,21 @@ - mr 11,12 - mtcrf 0x01,9 - cmplwi cr6,9,1 + mr 11,12 + mtcrf 0x01,9 + cmplwi cr6,9,1 - lvsl 5,0,12 +#ifdef __LITTLE_ENDIAN__ + lvsr 5,0,12 +#else + lvsl 5,0,12 +#endif - lvx 3,0,12 - bf 31,L(setup_unaligned_loop) - - /* Copy another 16 bytes to align to 32-bytes due to the loop . */ - lvx 4,12,6 + lvx 3,0,12 + bf 31,L(setup_unaligned_loop) + + /* Copy another 16 bytes to align to 32-bytes due to the loop . */ + lvx 4,12,6 - vperm 6,3,4,5 +#ifdef __LITTLE_ENDIAN__ + vperm 6,4,3,5 +#else + vperm 6,3,4,5 +#endif - addi 11,12,16 - addi 10,3,16 - stvx 6,0,3 + addi 11,12,16 + addi 10,3,16 + stvx 6,0,3 @@ -405,11 +413,17 @@ - vector instructions though. */ - - lvx 4,11,6 /* vr4 = r11+16. */ + vector instructions though. */ + + lvx 4,11,6 /* vr4 = r11+16. */ - vperm 6,3,4,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr6. */ +#ifdef __LITTLE_ENDIAN__ @@ -488,7 +488,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2 +#else + vperm 6,3,4,5 +#endif - lvx 3,11,7 /* vr3 = r11+32. */ + lvx 3,11,7 /* vr3 = r11+32. */ - vperm 10,4,3,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr10. */ +#ifdef __LITTLE_ENDIAN__ @@ -496,9 +496,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2 +#else + vperm 10,4,3,5 +#endif - addi 11,11,32 - stvx 6,0,10 - stvx 10,10,6 + addi 11,11,32 + stvx 6,0,10 + stvx 10,10,6 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500 @@ -577,22 +577,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. - Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc. + Copyright (C) 2003-2014 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 @@ -17,26 +17,24 @@ . */ - + #include -#include -#include - + /* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); Returns 'dst'. - -- Memcpy handles short copies (< 32-bytes) using a binary move blocks -- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled -- with the appropriate combination of byte and halfword load/stores. -- There is minimal effort to optimize the alignment of short moves. + +- Memcpy handles short copies (< 32-bytes) using a binary move blocks +- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled +- with the appropriate combination of byte and halfword load/stores. +- There is minimal effort to optimize the alignment of short moves. + Memcpy handles short copies (< 32-bytes) using a binary move blocks + (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled + with the appropriate combination of byte and halfword load/stores. @@ -600,18 +600,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. The 64-bit implementations of POWER3 and POWER4 do a reasonable job - of handling unligned load/stores that do not cross 32-byte boundries. + of handling unaligned load/stores that do not cross 32-byte boundaries. - + Longer moves (>= 32-bytes) justify the effort to get at least the destination doubleword (8-byte) aligned. Further optimization is - posible when both source and destination are doubleword aligned. + possible when both source and destination are doubleword aligned. Each case has a optimized unrolled loop. */ - - .machine power4 + + .machine power4 -EALIGN (BP_SYM (memcpy), 5, 0) +EALIGN (memcpy, 5, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + cmpldi cr1,5,31 @@ -44,20 +42,20 @@ std 3,-16(1) @@ -624,14 +624,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. + clrldi 10,4,61 /* check alignment of src. */ cmpldi cr6,5,8 ble- cr1,.L2 /* If move < 32 bytes use short move code. */ -- cmpld cr6,10,11 +- cmpld cr6,10,11 + cmpld cr6,10,11 mr 12,4 srdi 9,5,3 /* Number of full double words remaining. */ mtcrf 0x01,0 mr 31,5 beq .L0 -- +- + subf 31,0,5 - /* Move 0-7 bytes as needed to get the destination doubleword alligned. */ @@ -643,21 +643,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. stw 6,0(3) addi 3,3,4 0: -- clrldi 10,12,61 /* check alignement of src again. */ +- clrldi 10,12,61 /* check alignement of src again. */ + clrldi 10,12,61 /* check alignment of src again. */ srdi 9,31,3 /* Number of full double words remaining. */ -- +- - /* Copy doublewords from source to destination, assumpting the + + /* Copy doublewords from source to destination, assuming the destination is aligned on a doubleword boundary. - + At this point we know there are at least 25 bytes left (32-7) to copy. -- The next step is to determine if the source is also doubleword aligned. +- The next step is to determine if the source is also doubleword aligned. + The next step is to determine if the source is also doubleword aligned. If not branch to the unaligned move code at .L6. which uses a load, shift, store strategy. -- +- + Otherwise source and destination are doubleword aligned, and we can the optimized doubleword copy loop. */ @@ -666,15 +666,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. Use a unrolled loop to copy 4 doubleword (32-bytes) per iteration. If the copy is not an exact multiple of 32 bytes, 1-3 doublewords are copied as needed to set up the main loop. After -- the main loop exits there may be a tail of 1-7 bytes. These byte are +- the main loop exits there may be a tail of 1-7 bytes. These byte are + the main loop exits there may be a tail of 1-7 bytes. These byte are copied a word/halfword/byte at a time as needed to preserve alignment. */ - + srdi 8,31,5 cmpldi cr1,9,4 cmpldi cr6,11,0 mr 11,12 -- +- + bf 30,1f ld 6,0(12) @@ -683,7 +683,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. addi 10,3,16 bf 31,4f ld 0,16(12) -- std 0,16(3) +- std 0,16(3) + std 0,16(3) blt cr1,3f addi 11,12,24 @@ -692,7 +692,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. addi 11,12,8 std 6,0(3) addi 10,3,8 -- +- + .align 4 4: @@ -701,16 +701,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. std 0,24(10) addi 10,10,32 bdnz 4b --3: +-3: +3: - + rldicr 0,31,0,60 mtcrf 0x01,31 @@ -152,9 +150,9 @@ .L9: add 3,3,0 add 12,12,0 -- +- + /* At this point we have a tail of 0-7 bytes and we know that the - destiniation is double word aligned. */ @@ -722,41 +722,41 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. ld 31,-8(1) ld 3,-16(1) blr -- --/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 -- bytes. Each case is handled without loops, using binary (1,2,4,8) -- tests. -- +- +-/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 +- bytes. Each case is handled without loops, using binary (1,2,4,8) +- tests. +- + +/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 + bytes. Each case is handled without loops, using binary (1,2,4,8) + tests. + In the short (0-8 byte) case no attempt is made to force alignment -- of either source or destination. The hardware will handle the -- unaligned load/stores with small delays for crossing 32- 64-byte, and +- of either source or destination. The hardware will handle the +- unaligned load/stores with small delays for crossing 32- 64-byte, and + of either source or destination. The hardware will handle the + unaligned load/stores with small delays for crossing 32- 64-byte, and 4096-byte boundaries. Since these short moves are unlikely to be -- unaligned or cross these boundaries, the overhead to force +- unaligned or cross these boundaries, the overhead to force + unaligned or cross these boundaries, the overhead to force alignment is not justified. -- +- + The longer (9-31 byte) move is more likely to cross 32- or 64-byte boundaries. Since only loads are sensitive to the 32-/64-byte -- boundaries it is more important to align the source then the +- boundaries it is more important to align the source then the + boundaries it is more important to align the source then the destination. If the source is not already word aligned, we first -- move 1-3 bytes as needed. Since we are only word aligned we don't -- use double word load/stores to insure that all loads are aligned. +- move 1-3 bytes as needed. Since we are only word aligned we don't +- use double word load/stores to insure that all loads are aligned. + move 1-3 bytes as needed. Since we are only word aligned we don't + use double word load/stores to insure that all loads are aligned. While the destination and stores may still be unaligned, this is only an issue for page (4096 byte boundary) crossing, which should be rare for these short moves. The hardware handles this -- case automatically with a small delay. */ -- +- case automatically with a small delay. */ +- + case automatically with a small delay. */ + .align 4 @@ -795,12 +795,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. lwz 6,0(12) addi 12,12,4 stw 6,0(3) -- addi 3,3,4 +- addi 3,3,4 + addi 3,3,4 2: /* Move 2-3 bytes. */ bf 30,1f lhz 6,0(12) -- sth 6,0(3) +- sth 6,0(3) + sth 6,0(3) bf 31,0f lbz 7,2(12) @@ -809,7 +809,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. mr 12,4 bne cr6,4f /* Would have liked to use use ld/std here but the 630 processors are -- slow for load/store doubles that are not at least word aligned. +- slow for load/store doubles that are not at least word aligned. - Unaligned Load/Store word execute with only a 1 cycle penaltity. */ + slow for load/store doubles that are not at least word aligned. + Unaligned Load/Store word execute with only a 1 cycle penalty. */ @@ -820,7 +820,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. 6: bf 30,5f lhz 7,4(4) -- sth 7,4(3) +- sth 7,4(3) + sth 7,4(3) bf 31,0f lbz 8,6(4) @@ -828,14 +828,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. ld 3,-16(1) blr .align 4 --5: +-5: +5: bf 31,0f lbz 6,4(4) stb 6,4(3) @@ -336,13 +347,23 @@ bf 30,1f - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srd 0,6,10 @@ -941,7 +941,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2. +#else sld 0,6,10 srd 8,7,9 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) @@ -962,22 +962,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. - Copyright (C) 2003, 2006, 2007, 2011 Free Software Foundation, Inc. + Copyright (C) 2003-2014 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 @@ -17,52 +17,50 @@ . */ - + #include -#include -#include - + /* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); Returns 'dst'. - -- Memcpy handles short copies (< 32-bytes) using a binary move blocks -- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled -- with the appropriate combination of byte and halfword load/stores. -- There is minimal effort to optimize the alignment of short moves. + +- Memcpy handles short copies (< 32-bytes) using a binary move blocks +- (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled +- with the appropriate combination of byte and halfword load/stores. +- There is minimal effort to optimize the alignment of short moves. + Memcpy handles short copies (< 32-bytes) using a binary move blocks + (no loops) of lwz/stw. The tail (remaining 1-3) bytes is handled + with the appropriate combination of byte and halfword load/stores. @@ -985,30 +985,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. The 64-bit implementations of POWER3 and POWER4 do a reasonable job - of handling unligned load/stores that do not cross 32-byte boundries. + of handling unaligned load/stores that do not cross 32-byte boundaries. - + Longer moves (>= 32-bytes) justify the effort to get at least the destination doubleword (8-byte) aligned. Further optimization is - posible when both source and destination are doubleword aligned. -- Each case has a optimized unrolled loop. -- +- Each case has a optimized unrolled loop. +- - For POWER6 unaligned loads will take a 20+ cycle hicup for any + possible when both source and destination are doubleword aligned. + Each case has a optimized unrolled loop. + + For POWER6 unaligned loads will take a 20+ cycle hiccup for any L1 cache miss that crosses a 32- or 128-byte boundary. Store -- is more forgiving and does not take a hicup until page or -- segment boundaries. So we require doubleword alignment for +- is more forgiving and does not take a hicup until page or +- segment boundaries. So we require doubleword alignment for + is more forgiving and does not take a hiccup until page or + segment boundaries. So we require doubleword alignment for the source but may take a risk and only require word alignment for the destination. */ - - .machine "power6" + + .machine "power6" -EALIGN (BP_SYM (memcpy), 7, 0) +EALIGN (memcpy, 7, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + cmpldi cr1,5,31 neg 0,3 std 3,-16(1) @@ -1021,11 +1021,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. cmpldi cr6,5,8 ble- cr1,.L2 /* If move < 32 bytes use short move code. */ mtcrf 0x01,0 -- cmpld cr6,10,11 +- cmpld cr6,10,11 + cmpld cr6,10,11 srdi 9,5,3 /* Number of full double words remaining. */ beq .L0 -- +- + subf 5,0,5 - /* Move 0-7 bytes as needed to get the destination doubleword alligned. @@ -1039,7 +1039,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. lwz 6,1(4) stw 6,1(3) b 0f -- +- + 2: bf 30,4f lhz 6,0(4) @@ -1048,33 +1048,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. lwz 6,2(4) stw 6,2(3) b 0f -- +- + 4: bf 29,0f lwz 6,0(4) stw 6,0(3) --0: +-0: +0: /* Add the number of bytes until the 1st doubleword of dst to src and dst. */ add 4,4,0 add 3,3,0 -- -- clrldi 10,4,61 /* check alignement of src again. */ +- +- clrldi 10,4,61 /* check alignement of src again. */ + + clrldi 10,4,61 /* check alignment of src again. */ srdi 9,5,3 /* Number of full double words remaining. */ -- +- - /* Copy doublewords from source to destination, assumpting the + + /* Copy doublewords from source to destination, assuming the destination is aligned on a doubleword boundary. - + At this point we know there are at least 25 bytes left (32-7) to copy. -- The next step is to determine if the source is also doubleword aligned. +- The next step is to determine if the source is also doubleword aligned. + The next step is to determine if the source is also doubleword aligned. If not branch to the unaligned move code at .L6. which uses a load, shift, store strategy. -- +- + Otherwise source and destination are doubleword aligned, and we can the optimized doubleword copy loop. */ @@ -1083,26 +1083,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. the main loop exits there may be a tail of 1-7 bytes. These byte are copied a word/halfword/byte at a time as needed to preserve alignment. -- +- + For POWER6 the L1 is store-through and the L2 is store-in. The L2 is clocked at half CPU clock so we can store 16 bytes every other cycle. POWER6 also has a load/store bypass so we can do -- load, load, store, store every 2 cycles. -- +- load, load, store, store every 2 cycles. +- + load, load, store, store every 2 cycles. + The following code is sensitive to cache line alignment. Do not - make any change with out first making sure thay don't result in + make any change with out first making sure they don't result in splitting ld/std pairs across a cache line. */ - + mtcrf 0x02,5 @@ -273,7 +271,7 @@ std 8,16+96(10) std 0,24+96(10) ble cr5,L(das_loop_e) -- +- + mtctr 12 .align 4 @@ -1111,7 +1111,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. .align 4 L(das_tail): beq cr1,0f -- +- + L(das_tail2): /* At this point we have a tail of 0-7 bytes and we know that the @@ -1124,7 +1124,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. lbz 6,4(4) stb 6,4(3) b 0f -- +- + 2: bf 30,1f lhz 6,0(4) @@ -1133,7 +1133,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. lbz 6,2(4) stb 6,2(3) b 0f -- +- + 1: bf 31,0f lbz 6,0(4) @@ -1141,12 +1141,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. @@ -361,7 +359,7 @@ ld 3,-16(1) blr - --/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 + +-/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 +/* Copy up to 31 bytes. This divided into two cases 0-8 bytes and 9-31 bytes. Each case is handled without loops, using binary (1,2,4,8) tests. - + @@ -402,15 +400,28 @@ blt cr6,5f srdi 7,6,16 @@ -1180,7 +1180,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. /* At least 6 bytes left and the source is word aligned. This allows some speculative loads up front. */ /* We need to special case the fall-through because the biggest delays -- are due to address computation not being ready in time for the +- are due to address computation not being ready in time for the + are due to address computation not being ready in time for the AGEN. */ lwz 6,0(12) @@ -1233,7 +1233,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. L(dus_tail2): /* Move 2-3 bytes. */ bf 30,L(dus_tail1) lhz 6,0(12) -- sth 6,0(3) +- sth 6,0(3) + sth 6,0(3) bf 31,L(dus_tailX) lbz 7,2(12) @@ -1251,7 +1251,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. stw 6,0(3) bf 30,L(dus_5) lhz 7,4(4) -- sth 7,4(3) +- sth 7,4(3) + sth 7,4(3) bf 31,L(dus_0) lbz 8,6(4) @@ -1260,14 +1260,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. bge cr0, L(du4_do) blt cr5, L(du1_do) beq cr5, L(du2_do) -- b L(du3_do) -- +- b L(du3_do) +- + b L(du3_do) + .align 4 L(du1_do): bf 30,L(du1_1dw) - + /* there are at least two DWs to copy */ + /* FIXME: can combine last shift and "or" into "rldimi" */ +#ifdef __LITTLE_ENDIAN__ @@ -1372,15 +1372,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 8 srdi 8,7, 64-8 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -674,13 +731,23 @@ bf 30,L(du2_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 16 @@ -1484,15 +1484,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 16 srdi 8,7, 64-16 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -751,13 +853,23 @@ bf 30,L(du3_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 24 @@ -1596,15 +1596,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 24 srdi 8,7, 64-24 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -834,13 +981,23 @@ bf 30,L(du4_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 32 @@ -1708,15 +1708,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 32 srdi 8,7, 64-32 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -911,13 +1103,23 @@ bf 30,L(du5_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 40 @@ -1820,15 +1820,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 40 srdi 8,7, 64-40 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -988,13 +1225,23 @@ bf 30,L(du6_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 48 @@ -1932,15 +1932,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 48 srdi 8,7, 64-48 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) - + @@ -1065,13 +1347,23 @@ bf 30,L(du7_1dw) - + /* there are at least two DWs to copy */ +#ifdef __LITTLE_ENDIAN__ + srdi 0,6, 56 @@ -2044,21 +2044,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2. +#else sldi 0,6, 56 srdi 8,7, 64-56 -- or 0,0,8 +- or 0,0,8 +#endif + or 0,0,8 std 0,0(4) b L(du_done) -- +- + .align 4 L(du_done): rldicr 0,31,0,60 @@ -1144,9 +1471,9 @@ beq cr1,0f /* If the tail is 0 bytes we are done! */ - + add 3,3,0 -- add 12,12,0 +- add 12,12,0 + add 12,12,0 /* At this point we have a tail of 0-7 bytes and we know that the - destiniation is double word aligned. */ @@ -2082,36 +2082,36 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + Copyright (C) 2010-2014 Free Software Foundation, Inc. Contributed by Luis Machado . This file is part of the GNU C Library. - + @@ -18,425 +18,366 @@ . */ - + #include -#include -#include - - + + /* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); Returns 'dst'. */ - + +#define dst 11 /* Use r11 so r3 kept unchanged. */ +#define src 4 +#define cnt 5 + - .machine power7 + .machine power7 -EALIGN (BP_SYM (memcpy), 5, 0) +EALIGN (memcpy, 5, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + - cmpldi cr1,5,31 + cmpldi cr1,cnt,31 - neg 0,3 + neg 0,3 - std 3,-16(1) - std 31,-8(1) - cfi_offset(31,-8) - ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move - code. */ - + ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move + code. */ + - andi. 11,3,7 /* Check alignment of DST. */ - +#ifdef __LITTLE_ENDIAN__ @@ -2125,15 +2125,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + clrldi 11,4,61 /* Check alignment of SRC. */ +#endif + cmpld cr6,10,11 /* SRC and DST alignments match? */ - + - clrldi 10,4,61 /* Check alignment of SRC. */ - cmpld cr6,10,11 /* SRC and DST alignments match? */ - mr 12,4 - mr 31,5 + mr dst,3 - bne cr6,L(copy_GE_32_unaligned) + bne cr6,L(copy_GE_32_unaligned) + beq L(aligned_copy) - + - srdi 9,5,3 /* Number of full quadwords remaining. */ - - beq L(copy_GE_32_aligned_cont) @@ -2178,7 +2178,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. +#else + clrldi 0,0,61 +#endif - + - /* Copy 1~3 doublewords so the main loop starts - at a multiple of 32 bytes. */ - @@ -2236,7 +2236,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. +16: +#endif + subf cnt,0,cnt - + +/* Main aligned copy loop. Copies 128 bytes at a time. */ L(aligned_copy): - /* Main aligned copy loop. Copies up to 128-bytes at a time. */ @@ -2295,11 +2295,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lxvd2x 6,0,src + lxvd2x 7,src,6 + mtctr 12 - b L(aligned_128loop) - + b L(aligned_128loop) + + .align 4 L(aligned_128head): - /* for the 2nd + iteration of this loop. */ + /* for the 2nd + iteration of this loop. */ - lxvd2x 6,0,11 - lxvd2x 7,11,6 + lxvd2x 6,0,src @@ -2341,8 +2341,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + stxvd2x 8,dst,7 + stxvd2x 9,dst,8 + addi dst,dst,64 - bdnz L(aligned_128head) - + bdnz L(aligned_128head) + -3: - /* Check for tail bytes. */ - rldicr 0,31,0,60 @@ -2421,8 +2421,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lbz 8,6(src) + stb 8,6(dst) + /* Return original DST pointer. */ - blr - + blr + - /* Handle copies of 0~31 bytes. */ - .align 4 + @@ -2435,18 +2435,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + mr dst,3 + cmpldi cr6,cnt,8 + mtocrf 0x01,cnt - ble cr6,L(copy_LE_8) - - /* At least 9 bytes to go. */ - neg 8,4 + ble cr6,L(copy_LE_8) + + /* At least 9 bytes to go. */ + neg 8,4 - clrrdi 11,4,2 - andi. 0,8,3 - cmpldi cr1,5,16 - mr 10,5 + andi. 0,8,3 + cmpldi cr1,cnt,16 - beq L(copy_LT_32_aligned) - + beq L(copy_LT_32_aligned) + - /* Force 4-bytes alignment for SRC. */ - mtocrf 0x01,0 - subf 10,0,5 @@ -2477,7 +2477,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + addi src,src,1 + stb 6,0(dst) + addi dst,dst,1 - + - .align 4 + .align 4 L(end_4bytes_alignment): @@ -2485,12 +2485,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. - mtcrf 0x01,10 + cmpldi cr1,cnt,16 + mtocrf 0x01,cnt - + L(copy_LT_32_aligned): - /* At least 6 bytes to go, and SRC is word-aligned. */ - blt cr1,8f - - /* Copy 16 bytes. */ + /* At least 6 bytes to go, and SRC is word-aligned. */ + blt cr1,8f + + /* Copy 16 bytes. */ - lwz 6,0(12) - lwz 7,4(12) - stw 6,0(3) @@ -2535,7 +2535,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + stb 8,6(dst) + /* Return original DST pointer. */ + blr - + - lwz 6,0(12) - lwz 7,4(12) - addi 12,12,8 @@ -2553,7 +2553,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + .align 4 +/* Copies 2~3 bytes. */ +L(tail2): - bf 30,1f + bf 30,1f - - lhz 6,0(12) - sth 6,0(3) @@ -2566,8 +2566,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + bflr 31 + lbz 7,2(src) + stb 7,2(dst) - blr - + blr + - .align 4 -1: /* Copy 1 byte. */ - bf 31,0f @@ -2577,7 +2577,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lbz 6,4(src) + stb 6,4(dst) + blr - + - lbz 6,0(12) - stb 6,0(3) -0: /* Return original DST pointer. */ @@ -2588,8 +2588,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lbz 6,0(src) + stb 6,0(dst) + /* Return original DST pointer. */ - blr - + blr + - /* Handles copies of 0~8 bytes. */ - .align 4 + @@ -2598,10 +2598,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. L(copy_LE_8): - bne cr6,4f + bne cr6,L(tail4) - - /* Though we could've used ld/std here, they are still - slow for unaligned cases. */ - + + /* Though we could've used ld/std here, they are still + slow for unaligned cases. */ + - lwz 6,0(4) - lwz 7,4(4) - stw 6,0(3) @@ -2611,12 +2611,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lwz 7,4(src) + stw 6,0(dst) + stw 7,4(dst) - blr - + blr + - .align 4 -4: /* Copies 4~7 bytes. */ - bf 29,2b - + - lwz 6,0(4) - stw 6,0(3) - bf 30,5f @@ -2658,22 +2658,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + andi. 10,3,15 /* Check alignment of DST (against quadwords). */ +#endif + srdi 9,cnt,4 /* Number of full quadwords remaining. */ - - beq L(copy_GE_32_unaligned_cont) - + + beq L(copy_GE_32_unaligned_cont) + - /* SRC is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */ - + - mtcrf 0x01,0 - subf 31,0,5 + mtocrf 0x01,0 + subf cnt,0,cnt - - /* Vector instructions work best when proper alignment (16-bytes) - is present. Move 0~15 bytes as needed to get DST quadword-aligned. */ + + /* Vector instructions work best when proper alignment (16-bytes) + is present. Move 0~15 bytes as needed to get DST quadword-aligned. */ -1: /* Copy 1 byte. */ +1: - bf 31,2f + bf 31,2f - - lbz 6,0(12) - addi 12,12,1 @@ -2685,7 +2685,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + stb 6,0(dst) + addi dst,dst,1 +2: - bf 30,4f + bf 30,4f - - lhz 6,0(12) - addi 12,12,2 @@ -2697,7 +2697,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + sth 6,0(dst) + addi dst,dst,2 +4: - bf 29,8f + bf 29,8f - - lwz 6,0(12) - addi 12,12,4 @@ -2709,7 +2709,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + stw 6,0(dst) + addi dst,dst,4 +8: - bf 28,0f + bf 28,0f - - ld 6,0(12) - addi 12,12,8 @@ -2723,16 +2723,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. - clrldi 10,12,60 /* Check alignment of SRC. */ - srdi 9,31,4 /* Number of full quadwords remaining. */ + srdi 9,cnt,4 /* Number of full quadwords remaining. */ - - /* The proper alignment is present, it is OK to copy the bytes now. */ + + /* The proper alignment is present, it is OK to copy the bytes now. */ L(copy_GE_32_unaligned_cont): - - /* Setup two indexes to speed up the indexed vector operations. */ + + /* Setup two indexes to speed up the indexed vector operations. */ - clrldi 11,31,60 - li 6,16 /* Index for 16-bytes offsets. */ + clrldi 10,cnt,60 + li 6,16 /* Index for 16-bytes offsets. */ - li 7,32 /* Index for 32-bytes offsets. */ + li 7,32 /* Index for 32-bytes offsets. */ - cmpldi cr1,11,0 - srdi 8,31,5 /* Setup the loop counter. */ - mr 10,3 @@ -2772,25 +2772,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + addi src,src,16 + stvx 6,0,dst + addi dst,dst,16 - vor 3,4,4 + vor 3,4,4 + clrrdi 0,src,60 - + L(setup_unaligned_loop): - mtctr 8 - ble cr6,L(end_unaligned_loop) + mtctr 8 + ble cr6,L(end_unaligned_loop) - - /* Copy 32 bytes at a time using vector instructions. */ + + /* Copy 32 bytes at a time using vector instructions. */ - .align 4 + .align 4 L(unaligned_loop): - - /* Note: vr6/vr10 may contain data that was already copied, + + /* Note: vr6/vr10 may contain data that was already copied, @@ -444,63 +385,56 @@ - some portions again. This is faster than having unaligned - vector instructions though. */ - + some portions again. This is faster than having unaligned + vector instructions though. */ + - lvx 4,11,6 /* vr4 = r11+16. */ - vperm 6,3,4,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr6. */ @@ -2818,29 +2818,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + stvx 6,0,dst + stvx 10,dst,6 + addi dst,dst,32 - bdnz L(unaligned_loop) - + bdnz L(unaligned_loop) + - .align 4 + clrrdi 0,src,60 + + .align 4 L(end_unaligned_loop): - - /* Check for tail bytes. */ + + /* Check for tail bytes. */ - rldicr 0,31,0,59 - mtcrf 0x01,31 - beq cr1,0f + mtocrf 0x01,cnt + beqlr cr1 - + - add 3,3,0 - add 12,12,0 + add src,src,0 - - /* We have 1~15 tail bytes to copy, and DST is quadword aligned. */ + + /* We have 1~15 tail bytes to copy, and DST is quadword aligned. */ -8: /* Copy 8 bytes. */ + /* Copy 8 bytes. */ - bf 28,4f + bf 28,4f - - lwz 6,0(12) - lwz 7,4(12) @@ -2887,8 +2887,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2. + lbz 8,6(src) + stb 8,6(dst) + /* Return original DST pointer. */ - blr - + blr + -END_GEN_TB (BP_SYM (memcpy),TB_TOCLESS) +END_GEN_TB (memcpy,TB_TOCLESS) libc_hidden_builtin_def (memcpy) @@ -2896,33 +2896,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 @@ -367,13 +367,21 @@ - mr 11,12 - mtcrf 0x01,9 - cmpldi cr6,9,1 + mr 11,12 + mtcrf 0x01,9 + cmpldi cr6,9,1 - lvsl 5,0,12 +#ifdef __LITTLE_ENDIAN__ + lvsr 5,0,12 +#else + lvsl 5,0,12 +#endif - lvx 3,0,12 - bf 31,L(setup_unaligned_loop) - - /* Copy another 16 bytes to align to 32-bytes due to the loop . */ - lvx 4,12,6 + lvx 3,0,12 + bf 31,L(setup_unaligned_loop) + + /* Copy another 16 bytes to align to 32-bytes due to the loop . */ + lvx 4,12,6 - vperm 6,3,4,5 +#ifdef __LITTLE_ENDIAN__ + vperm 6,4,3,5 +#else + vperm 6,3,4,5 +#endif - addi 11,12,16 - addi 10,3,16 - stvx 6,0,3 + addi 11,12,16 + addi 10,3,16 + stvx 6,0,3 @@ -393,11 +401,17 @@ - vector instructions though. */ - - lvx 4,11,6 /* vr4 = r11+16. */ + vector instructions though. */ + + lvx 4,11,6 /* vr4 = r11+16. */ - vperm 6,3,4,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr6. */ +#ifdef __LITTLE_ENDIAN__ @@ -2930,7 +2930,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2 +#else + vperm 6,3,4,5 +#endif - lvx 3,11,7 /* vr3 = r11+32. */ + lvx 3,11,7 /* vr3 = r11+32. */ - vperm 10,4,3,5 /* Merge the correctly-aligned portions - of vr3/vr4 into vr10. */ +#ifdef __LITTLE_ENDIAN__ @@ -2938,6 +2938,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2 +#else + vperm 10,4,3,5 +#endif - addi 11,11,32 - stvx 6,0,10 - stvx 10,10,6 + addi 11,11,32 + stvx 6,0,10 + stvx 10,10,6 diff --git a/SOURCES/glibc-ppc64le-32.patch b/SOURCES/glibc-ppc64le-32.patch index 2553a5d0..058d53a9 100644 --- a/SOURCES/glibc-ppc64le-32.patch +++ b/SOURCES/glibc-ppc64le-32.patch @@ -1,14 +1,14 @@ # commit 3be87c77d24c4456ccca4034363b6d1814cd0c84 # Author: Alan Modra # Date: Sat Aug 17 18:47:59 2013 +0930 -# +# # PowerPC LE memset # http://sourceware.org/ml/libc-alpha/2013-08/msg00104.html -# +# # One of the things I noticed when looking at power7 timing is that rlwimi # is cracked and the two resulting insns have a register dependency. # That makes it a little slower than the equivalent rldimi. -# +# # * sysdeps/powerpc/powerpc64/memset.S: Replace rlwimi with # insrdi. Formatting. # * sysdeps/powerpc/powerpc64/power4/memset.S: Likewise. @@ -17,156 +17,156 @@ # * sysdeps/powerpc/powerpc32/power4/memset.S: Likewise. # * sysdeps/powerpc/powerpc32/power6/memset.S: Likewise. # * sysdeps/powerpc/powerpc32/power7/memset.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -52,7 +52,7 @@ - + /* Align to word boundary. */ - cmplwi cr5, rLEN, 31 + cmplwi cr5, rLEN, 31 - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ - beq+ L(aligned) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 4 + beq+ L(aligned) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 4 @@ -67,7 +67,7 @@ /* Handle the case of size < 31. */ L(aligned): - mtcrf 0x01, rLEN + mtcrf 0x01, rLEN - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ - ble cr5, L(medium) + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x1C + andi. rALIGN, rMEMP, 0x1C diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -50,7 +50,7 @@ - ble- cr1, L(small) + ble- cr1, L(small) /* Align to word boundary. */ - cmplwi cr5, rLEN, 31 + cmplwi cr5, rLEN, 31 - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ - beq+ L(aligned) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 4 + beq+ L(aligned) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 4 @@ -66,7 +66,7 @@ /* Handle the case of size < 31. */ L(aligned): - mtcrf 0x01, rLEN + mtcrf 0x01, rLEN - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ - ble cr5, L(medium) + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x1C + andi. rALIGN, rMEMP, 0x1C diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -37,8 +37,8 @@ - cfi_offset(31,-8) - - /* Replicate byte to word. */ + cfi_offset(31,-8) + + /* Replicate byte to word. */ - rlwimi 4,4,8,16,23 - rlwimi 4,4,16,0,15 + insrdi 4,4,8,48 + insrdi 4,4,16,32 - - ble cr6,L(small) /* If length <= 8, use short copy code. */ - + + ble cr6,L(small) /* If length <= 8, use short copy code. */ + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -73,14 +73,14 @@ - + /* Align to doubleword boundary. */ - cmpldi cr5, rLEN, 31 + cmpldi cr5, rLEN, 31 - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ - beq+ L(aligned2) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 8 - cror 28,30,31 /* Detect odd word aligned. */ - add rMEMP, rMEMP, rALIGN - sub rLEN, rLEN, rALIGN + beq+ L(aligned2) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 8 + cror 28,30,31 /* Detect odd word aligned. */ + add rMEMP, rMEMP, rALIGN + sub rLEN, rLEN, rALIGN - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ - bt 29, L(g4) + bt 29, L(g4) /* Process the even word of doubleword. */ - bf+ 31, L(g2) + bf+ 31, L(g2) @@ -102,14 +102,14 @@ - + /* Handle the case of size < 31. */ L(aligned2): - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ L(aligned): - mtcrf 0x01, rLEN - ble cr5, L(medium) + mtcrf 0x01, rLEN + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x18 - subfic rALIGN, rALIGN, 0x20 + andi. rALIGN, rMEMP, 0x18 + subfic rALIGN, rALIGN, 0x20 - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - beq L(caligned) - mtcrf 0x01, rALIGN - add rMEMP, rMEMP, rALIGN + beq L(caligned) + mtcrf 0x01, rALIGN + add rMEMP, rMEMP, rALIGN @@ -230,7 +230,7 @@ /* Memset of 0-31 bytes. */ - .align 5 + .align 5 L(medium): - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - cmpldi cr1, rLEN, 16 + cmpldi cr1, rLEN, 16 L(medium_tail2): - add rMEMP, rMEMP, rLEN + add rMEMP, rMEMP, rLEN diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -68,14 +68,14 @@ - + /* Align to doubleword boundary. */ - cmpldi cr5, rLEN, 31 + cmpldi cr5, rLEN, 31 - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ - beq+ L(aligned2) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 8 - cror 28,30,31 /* Detect odd word aligned. */ - add rMEMP, rMEMP, rALIGN - sub rLEN, rLEN, rALIGN + beq+ L(aligned2) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 8 + cror 28,30,31 /* Detect odd word aligned. */ + add rMEMP, rMEMP, rALIGN + sub rLEN, rLEN, rALIGN - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ - bt 29, L(g4) + bt 29, L(g4) /* Process the even word of doubleword. */ - bf+ 31, L(g2) + bf+ 31, L(g2) @@ -97,14 +97,14 @@ - + /* Handle the case of size < 31. */ L(aligned2): - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ L(aligned): - mtcrf 0x01, rLEN - ble cr5, L(medium) + mtcrf 0x01, rLEN + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x18 - subfic rALIGN, rALIGN, 0x20 + andi. rALIGN, rMEMP, 0x18 + subfic rALIGN, rALIGN, 0x20 - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - beq L(caligned) - mtcrf 0x01, rALIGN - add rMEMP, rMEMP, rALIGN + beq L(caligned) + mtcrf 0x01, rALIGN + add rMEMP, rMEMP, rALIGN @@ -164,24 +164,24 @@ L(getCacheAligned): - cmpldi cr1,rLEN,32 - andi. rTMP,rMEMP,127 + cmpldi cr1,rLEN,32 + andi. rTMP,rMEMP,127 - blt cr1,L(handletail32) - beq L(cacheAligned) + blt cr1,L(handletail32) + beq L(cacheAligned) - addi rMEMP,rMEMP,32 - addi rLEN,rLEN,-32 + addi rMEMP,rMEMP,32 + addi rLEN,rLEN,-32 - std rCHR,-32(rMEMP) - std rCHR,-24(rMEMP) - std rCHR,-16(rMEMP) @@ -177,96 +177,96 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2. + std rCHR,-16(rMEMP) + std rCHR,-8(rMEMP) + b L(getCacheAligned) - + /* Now we are aligned to the cache line and can use dcbz. */ L(cacheAligned): - cmpld cr1,rLEN,rCLS + cmpld cr1,rLEN,rCLS - blt cr1,L(handletail32) + blt cr1,L(handletail32) - dcbz 0,rMEMP - subf rLEN,rCLS,rLEN + dcbz 0,rMEMP + subf rLEN,rCLS,rLEN - add rMEMP,rMEMP,rCLS - b L(cacheAligned) + add rMEMP,rMEMP,rCLS + b L(cacheAligned) - + /* We are here because the cache line size was set and was not 32-bytes and the remainder (rLEN) is less than the actual cache line size. @@ -218,7 +218,7 @@ /* Memset of 0-31 bytes. */ - .align 5 + .align 5 L(medium): - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - cmpldi cr1, rLEN, 16 + cmpldi cr1, rLEN, 16 L(medium_tail2): - add rMEMP, rMEMP, rLEN + add rMEMP, rMEMP, rLEN diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -65,14 +65,14 @@ - + /* Align to doubleword boundary. */ - cmpldi cr5, rLEN, 31 + cmpldi cr5, rLEN, 31 - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ - beq+ L(aligned2) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 8 - cror 28,30,31 /* Detect odd word aligned. */ - add rMEMP, rMEMP, rALIGN - sub rLEN, rLEN, rALIGN + beq+ L(aligned2) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 8 + cror 28,30,31 /* Detect odd word aligned. */ + add rMEMP, rMEMP, rALIGN + sub rLEN, rLEN, rALIGN - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ - bt 29, L(g4) + bt 29, L(g4) /* Process the even word of doubleword. */ - bf+ 31, L(g2) + bf+ 31, L(g2) @@ -94,14 +94,14 @@ - + /* Handle the case of size < 31. */ L(aligned2): - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ L(aligned): - mtcrf 0x01, rLEN - ble cr5, L(medium) + mtcrf 0x01, rLEN + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x18 - subfic rALIGN, rALIGN, 0x20 + andi. rALIGN, rMEMP, 0x18 + subfic rALIGN, rALIGN, 0x20 - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - beq L(caligned) - mtcrf 0x01, rALIGN - add rMEMP, rMEMP, rALIGN + beq L(caligned) + mtcrf 0x01, rALIGN + add rMEMP, rMEMP, rALIGN @@ -362,7 +362,7 @@ /* Memset of 0-31 bytes. */ - .align 5 + .align 5 L(medium): - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ - cmpldi cr1, rLEN, 16 + cmpldi cr1, rLEN, 16 L(medium_tail2): - add rMEMP, rMEMP, rLEN + add rMEMP, rMEMP, rLEN diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:46.000000000 -0500 @@ -34,8 +34,8 @@ - mr 10,3 - - /* Replicate byte to word. */ + mr 10,3 + + /* Replicate byte to word. */ - rlwimi 4,4,8,16,23 - rlwimi 4,4,16,0,15 + insrdi 4,4,8,48 + insrdi 4,4,16,32 - ble cr6,L(small) /* If length <= 8, use short copy code. */ - - neg 0,3 + ble cr6,L(small) /* If length <= 8, use short copy code. */ + + neg 0,3 @@ -323,7 +323,7 @@ - clrldi 0,0,62 - beq L(medium_aligned) - + clrldi 0,0,62 + beq L(medium_aligned) + - /* Force 4-bytes alignment for SRC. */ + /* Force 4-bytes alignment for DST. */ - mtocrf 0x01,0 - subf 5,0,5 + mtocrf 0x01,0 + subf 5,0,5 1: /* Copy 1 byte. */ diff --git a/SOURCES/glibc-ppc64le-33.patch b/SOURCES/glibc-ppc64le-33.patch index cce1c397..9da11df4 100644 --- a/SOURCES/glibc-ppc64le-33.patch +++ b/SOURCES/glibc-ppc64le-33.patch @@ -1,10 +1,10 @@ # commit 466b03933234017473c12dd1d92bda5e7fe49df7 # Author: Alan Modra # Date: Sat Aug 17 18:48:36 2013 +0930 -# +# # PowerPC LE memchr and memrchr # http://sourceware.org/ml/libc-alpha/2013-08/msg00105.html -# +# # Like strnlen, memchr and memrchr had a number of defects fixed by this # patch as well as adding little-endian support. The first one I # noticed was that the entry to the main loop needlessly checked for @@ -15,23 +15,23 @@ # wrap around zero, except of course that we'd normally hit a segfault # on trying to read from address zero. Fixing that simplified a number # of places: -# +# # - /* Are we done already? */ # - addi r9,r8,8 # - cmpld r9,r7 # - bge L(null) -# +# # becomes -# +# # + cmpld r8,r7 # + beqlr -# +# # However, the exit gets an extra test because I test for being on the # last word then if so whether the byte offset is less than the end. # Overall, the change is a win. -# +# # Lastly, memrchr used the wrong cache hint. -# +# # * sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with # insrdi. Make better use of reg selection to speed exit slightly. # Schedule entry path a little better. Remove useless "are we done" @@ -47,7 +47,7 @@ # * sysdeps/powerpc/powerpc64/power7/rawmemchr.S: Add little-endian # support. Avoid rlwimi. # * sysdeps/powerpc/powerpc32/power7/rawmemchr.S: Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S 2014-05-29 13:09:17.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S 2014-05-29 13:13:37.000000000 -0500 @@ -57,27 +57,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + Copyright (C) 2010-2014 Free Software Foundation, Inc. Contributed by Luis Machado . This file is part of the GNU C Library. - + @@ -18,116 +18,118 @@ . */ - + #include -#include -#include - + /* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */ - .machine power7 + .machine power7 -ENTRY (BP_SYM (__memchr)) +ENTRY (__memchr) - CALL_MCOUNT - dcbt 0,r3 - clrrwi r8,r3,2 + CALL_MCOUNT + dcbt 0,r3 + clrrwi r8,r3,2 - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrwi r4,r4,8,16 /* Replicate byte to word. */ - add r7,r3,r5 /* Calculate the last acceptable address. */ + add r7,r3,r5 /* Calculate the last acceptable address. */ + insrwi r4,r4,16,0 - cmplwi r5,16 + cmplwi r5,16 + li r9, -1 + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + addi r7,r7,-1 @@ -86,8 +86,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. +#else + srw r9,r9,r6 +#endif - ble L(small_range) - + ble L(small_range) + - cmplw cr7,r3,r7 /* Compare the starting address (r3) with the - ending address (r7). If (r3 >= r7), the size - passed in is zero or negative. */ @@ -98,7 +98,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. -L(proceed): - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - cmpli cr6,r6,0 /* cr6 == Do we have padding? */ - lwz r12,0(r8) /* Load word from memory. */ + lwz r12,0(r8) /* Load word from memory. */ - cmpb r10,r12,r4 /* Check for BYTE's in WORD1. */ - beq cr6,L(proceed_no_padding) - slw r10,r10,r6 @@ -110,27 +110,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + clrlwi r5,r7,30 /* Byte count - 1 in last word. */ + clrrwi r7,r7,2 /* Address of last word. */ + cmplwi cr7,r3,0 /* If r3 == 0, no BYTEs have been found. */ - bne cr7,L(done) - + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,4 - cmplw cr6,r9,r7 - bge cr6,L(null) - - mtcrf 0x01,r8 - /* Are we now aligned to a doubleword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ + mtcrf 0x01,r8 + /* Are we now aligned to a doubleword boundary? If so, skip to + the main loop. Otherwise, go through the alignment code. */ - - bt 29,L(loop_setup) - - /* Handle WORD2 of pair. */ - lwzu r12,4(r8) + bt 29,L(loop_setup) + + /* Handle WORD2 of pair. */ + lwzu r12,4(r8) - cmpb r10,r12,r4 - cmplwi cr7,r10,0 + cmpb r3,r12,r4 + cmplwi cr7,r3,0 - bne cr7,L(done) - + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,4 - cmplw cr6,r9,r7 @@ -147,7 +147,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + cnt = (r7 - r8) / 8 */ + sub r6,r7,r8 + srwi r6,r6,3 /* Number of loop iterations. */ - mtctr r6 /* Setup the counter. */ + mtctr r6 /* Setup the counter. */ - b L(loop) - /* Main loop to look for BYTE backwards in the string. Since - it's a small loop (< 8 instructions), align it to 32-bytes. */ @@ -157,21 +157,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + it's a small loop (8 instructions), align it to 32-bytes. */ + .align 5 L(loop): - /* Load two words, compare and merge in a - single register for speed. This is an attempt - to speed up the byte-checking process for bigger strings. */ - lwz r12,4(r8) - lwzu r11,8(r8) + /* Load two words, compare and merge in a + single register for speed. This is an attempt + to speed up the byte-checking process for bigger strings. */ + lwz r12,4(r8) + lwzu r11,8(r8) - cmpb r10,r12,r4 + cmpb r3,r12,r4 - cmpb r9,r11,r4 + cmpb r9,r11,r4 - or r5,r9,r10 /* Merge everything in one word. */ - cmplwi cr7,r5,0 + or r6,r9,r3 /* Merge everything in one word. */ + cmplwi cr7,r6,0 - bne cr7,L(found) - bdnz L(loop) - + bne cr7,L(found) + bdnz L(loop) + - /* We're here because the counter reached 0, and that means we - didn't have any matches for BYTE in the whole range. */ - subi r11,r7,4 @@ -181,7 +181,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + /* We may have one more dword to read. */ + cmplw r8,r7 + beqlr - + + lwzu r12,4(r8) + cmpb r3,r12,r4 + cmplwi cr6,r3,0 @@ -190,30 +190,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + + .align 4 +L(found): - /* OK, one (or both) of the words contains BYTE. Check - the first word and decrement the address in case the first - word really contains BYTE. */ + /* OK, one (or both) of the words contains BYTE. Check + the first word and decrement the address in case the first + word really contains BYTE. */ - .align 4 -L(found): - cmplwi cr6,r10,0 + cmplwi cr6,r3,0 - addi r8,r8,-4 - bne cr6,L(done) - - /* BYTE must be in the second word. Adjust the address + addi r8,r8,-4 + bne cr6,L(done) + + /* BYTE must be in the second word. Adjust the address - again and move the result of cmpb to r10 so we can calculate the + again and move the result of cmpb to r3 so we can calculate the - pointer. */ - + pointer. */ + - mr r10,r9 + mr r3,r9 - addi r8,r8,4 - + addi r8,r8,4 + - /* r10 has the output of the cmpb instruction, that is, it contains + /* r3 has the output of the cmpb instruction, that is, it contains - 0xff in the same position as BYTE in the original - word from the string. Use that to calculate the pointer. - We need to make sure BYTE is *before* the end of the range. */ + 0xff in the same position as BYTE in the original + word from the string. Use that to calculate the pointer. + We need to make sure BYTE is *before* the end of the range. */ L(done): - cntlzw r0,r10 /* Count leading zeroes before the match. */ - srwi r0,r0,3 /* Convert leading zeroes to bytes. */ @@ -226,24 +226,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. +#endif + cmplw r8,r7 /* Are we on the last word? */ + srwi r0,r0,3 /* Convert leading/trailing zeros to bytes. */ - add r3,r8,r0 + add r3,r8,r0 - cmplw r3,r7 - bge L(null) + cmplw cr7,r0,r5 /* If on the last dword, check byte offset. */ + bnelr + blelr cr7 + li r3,0 - blr - - .align 4 + blr + + .align 4 @@ -139,69 +141,44 @@ - .align 4 + .align 4 L(small_range): - cmplwi r5,0 + cmplwi r5,0 - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - beq L(null) /* This branch is for the cmplwi r5,0 above */ + beq L(null) - lwz r12,0(r8) /* Load word from memory. */ + lwz r12,0(r8) /* Load word from memory. */ - cmplwi cr6,r6,0 /* cr6 == Do we have padding? */ - cmpb r10,r12,r4 /* Check for BYTE in DWORD1. */ - beq cr6,L(small_no_padding) @@ -257,16 +257,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + clrlwi r5,r7,30 /* Byte count - 1 in last word. */ + clrrwi r7,r7,2 /* Address of last word. */ + cmplw r8,r7 /* Are we done already? */ - bne cr7,L(done) + bne cr7,L(done) + beqlr - + - /* Are we done already? */ - addi r9,r8,4 - cmplw r9,r7 - bge L(null) - -L(loop_small): /* loop_small has been unrolled. */ - lwzu r12,4(r8) + lwzu r12,4(r8) - cmpb r10,r12,r4 - addi r9,r8,4 - cmplwi cr6,r10,0 @@ -274,11 +274,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + cmpb r3,r12,r4 + cmplwi cr6,r3,0 + cmplw r8,r7 - bne cr6,L(done) + bne cr6,L(done) - bge L(null) + beqlr - - lwzu r12,4(r8) + + lwzu r12,4(r8) - cmpb r10,r12,r4 - addi r9,r8,4 - cmplwi cr6,r10,0 @@ -286,11 +286,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + cmpb r3,r12,r4 + cmplwi cr6,r3,0 + cmplw r8,r7 - bne cr6,L(done) + bne cr6,L(done) - bge L(null) + beqlr - - lwzu r12,4(r8) + + lwzu r12,4(r8) - cmpb r10,r12,r4 - addi r9,r8,4 - cmplwi cr6,r10,0 @@ -298,18 +298,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. + cmpb r3,r12,r4 + cmplwi cr6,r3,0 + cmplw r8,r7 - bne cr6,L(done) + bne cr6,L(done) - bge L(null) + beqlr - - lwzu r12,4(r8) + + lwzu r12,4(r8) - cmpb r10,r12,r4 - addi r9,r8,4 - cmplwi cr6,r10,0 - cmplw r9,r7 + cmpb r3,r12,r4 + cmplwi cr6,r3,0 - bne cr6,L(done) + bne cr6,L(done) - bge L(null) - - /* For most cases we will never get here. Under some combinations of @@ -323,8 +323,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memchr.S glibc-2. - - /* save a branch and exit directly */ - li r3,0 - blr - + blr + -END (BP_SYM (__memchr)) -weak_alias (BP_SYM (__memchr), BP_SYM(memchr)) +END (__memchr) @@ -339,19 +339,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + Copyright (C) 2010-2014 Free Software Foundation, Inc. Contributed by Luis Machado . This file is part of the GNU C Library. - + @@ -18,124 +18,136 @@ . */ - + #include -#include -#include - + /* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */ - .machine power7 + .machine power7 -ENTRY (BP_SYM (__memrchr)) +ENTRY (__memrchr) - CALL_MCOUNT + CALL_MCOUNT - dcbt 0,r3 - mr r7,r3 - add r3,r7,r5 /* Calculate the last acceptable address. */ @@ -363,8 +363,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + clrrwi r6,r7,7 + li r9,3<<5 + dcbt r9,r6,16 /* Stream hint, decreasing addresses. */ - - /* Replicate BYTE to word. */ + + /* Replicate BYTE to word. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 - bge cr7,L(proceed) @@ -373,20 +373,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 -L(proceed): + insrwi r4,r4,8,16 + insrwi r4,r4,16,0 - li r6,-4 + li r6,-4 - addi r9,r3,-1 - clrrwi r8,r9,2 - addi r8,r8,4 - neg r0,r3 + li r9,-1 - rlwinm r0,r0,3,27,28 /* Calculate padding. */ + rlwinm r0,r0,3,27,28 /* Calculate padding. */ - + clrrwi r8,r7,2 + srw r9,r9,r0 - cmplwi r5,16 + cmplwi r5,16 + clrrwi r0,r10,2 - ble L(small_range) - + ble L(small_range) + - lwbrx r12,r8,r6 /* Load reversed word from memory. */ - cmpb r10,r12,r4 /* Check for BYTE in WORD1. */ - slw r10,r10,r0 @@ -400,38 +400,38 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + cmpb r3,r12,r4 /* Check for BYTE in WORD1. */ + and r3,r3,r9 + cmplwi cr7,r3,0 /* If r3 == 0, no BYTEs have been found. */ - bne cr7,L(done) - + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,-4 - cmplw cr6,r9,r7 - ble cr6,L(null) - - mtcrf 0x01,r8 - /* Are we now aligned to a doubleword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ + mtcrf 0x01,r8 + /* Are we now aligned to a doubleword boundary? If so, skip to + the main loop. Otherwise, go through the alignment code. */ - mr r8,r9 - bt 29,L(loop_setup) + bf 29,L(loop_setup) - - /* Handle WORD2 of pair. */ + + /* Handle WORD2 of pair. */ +#ifdef __LITTLE_ENDIAN__ + lwzx r12,r8,r6 +#else - lwbrx r12,r8,r6 + lwbrx r12,r8,r6 - cmpb r10,r12,r4 - cmplwi cr7,r10,0 - bne cr7,L(done) - - /* Are we done already? */ +#endif - addi r8,r8,-4 + addi r8,r8,-4 - cmplw cr6,r8,r7 - ble cr6,L(null) + cmpb r3,r12,r4 + cmplwi cr7,r3,0 + bne cr7,L(done) - + L(loop_setup): - li r0,-8 - sub r5,r8,r7 @@ -445,7 +445,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + sub r5,r8,r0 + addi r8,r8,-4 + srwi r9,r5,3 /* Number of loop iterations. */ - mtctr r9 /* Setup the counter. */ + mtctr r9 /* Setup the counter. */ - b L(loop) - /* Main loop to look for BYTE backwards in the string. Since it's a - small loop (< 8 instructions), align it to 32-bytes. */ @@ -456,10 +456,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + 9 instruction loop. */ + .align 5 L(loop): - /* Load two words, compare and merge in a - single register for speed. This is an attempt - to speed up the byte-checking process for bigger strings. */ - + /* Load two words, compare and merge in a + single register for speed. This is an attempt + to speed up the byte-checking process for bigger strings. */ + - lwbrx r12,r8,r6 - lwbrx r11,r8,r0 - addi r8,r8,-4 @@ -472,14 +472,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + lwbrx r11,r8,r6 +#endif + cmpb r3,r12,r4 - cmpb r9,r11,r4 + cmpb r9,r11,r4 - or r5,r9,r10 /* Merge everything in one word. */ + or r5,r9,r3 /* Merge everything in one word. */ - cmplwi cr7,r5,0 - bne cr7,L(found) + cmplwi cr7,r5,0 + bne cr7,L(found) - addi r8,r8,-4 + addi r8,r8,-8 - bdnz L(loop) + bdnz L(loop) - /* We're here because the counter reached 0, and that means we - didn't have any matches for BYTE in the whole range. Just return - the original range. */ @@ -487,7 +487,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 - cmplw cr6,r9,r7 - bgt cr6,L(loop_small) - b L(null) - + - /* OK, one (or both) of the words contains BYTE. Check - the first word and decrement the address in case the first - word really contains BYTE. */ @@ -505,30 +505,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + bne cr7,L(done) + blr + - .align 4 + .align 4 L(found): - cmplwi cr6,r10,0 - addi r8,r8,4 + /* OK, one (or both) of the words contains BYTE. Check + the first word. */ + cmplwi cr6,r3,0 - bne cr6,L(done) - - /* BYTE must be in the second word. Adjust the address + bne cr6,L(done) + + /* BYTE must be in the second word. Adjust the address - again and move the result of cmpb to r10 so we can calculate the + again and move the result of cmpb to r3 so we can calculate the - pointer. */ - + pointer. */ + - mr r10,r9 + mr r3,r9 - addi r8,r8,-4 - + addi r8,r8,-4 + - /* r10 has the output of the cmpb instruction, that is, it contains + /* r3 has the output of the cmpb instruction, that is, it contains - 0xff in the same position as BYTE in the original - word from the string. Use that to calculate the pointer. - We need to make sure BYTE is *before* the end of the - range. */ + 0xff in the same position as BYTE in the original + word from the string. Use that to calculate the pointer. + We need to make sure BYTE is *before* the end of the + range. */ L(done): - cntlzw r0,r10 /* Count leading zeroes before the match. */ - srwi r6,r0,3 /* Convert leading zeroes to bytes. */ @@ -537,20 +537,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + cmplw r8,r0 /* Are we on the last word? */ + srwi r6,r9,3 /* Convert leading zeros to bytes. */ + addi r0,r6,-3 - sub r3,r8,r0 + sub r3,r8,r0 - cmplw r3,r7 - blt L(null) + cmplw cr7,r3,r10 + bnelr + bgelr cr7 + li r3,0 - blr - - .align 4 + blr + + .align 4 @@ -149,29 +161,36 @@ - cmplwi r5,0 - beq L(null) - + cmplwi r5,0 + beq L(null) + - lwbrx r12,r8,r6 /* Load reversed word from memory. */ - cmpb r10,r12,r4 /* Check for null bytes in WORD1. */ - slw r10,r10,r0 @@ -564,16 +564,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + cmpb r3,r12,r4 /* Check for BYTE in WORD1. */ + and r3,r3,r9 + cmplwi cr7,r3,0 - bne cr7,L(done) - + bne cr7,L(done) + + /* Are we done already? */ + cmplw r8,r0 - addi r8,r8,-4 + addi r8,r8,-4 - cmplw r8,r7 - ble L(null) - b L(loop_small) + beqlr - + - .p2align 5 + .align 5 L(loop_small): @@ -590,13 +590,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memrchr.S glibc-2 + cmplw r8,r0 + cmplwi cr7,r3,0 + bne cr7,L(done) - addi r8,r8,-4 + addi r8,r8,-4 - cmplw r8,r7 - ble L(null) - b L(loop_small) + bne L(loop_small) + blr - + -END (BP_SYM (__memrchr)) -weak_alias (BP_SYM (__memrchr), BP_SYM(memrchr)) +END (__memrchr) @@ -606,44 +606,44 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S glibc --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S 2014-05-29 13:09:17.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S 2014-05-29 13:09:19.000000000 -0500 @@ -29,16 +29,21 @@ - clrrwi r8,r3,2 /* Align the address to word boundary. */ - - /* Replicate byte to word. */ + clrrwi r8,r3,2 /* Align the address to word boundary. */ + + /* Replicate byte to word. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + rldimi r4,r4,8,48 + rldimi r4,r4,16,32 - - /* Now r4 has a word of c bytes. */ - - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - lwz r12,0(r8) /* Load word from memory. */ - cmpb r5,r12,r4 /* Compare each byte against c byte. */ + + /* Now r4 has a word of c bytes. */ + + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + lwz r12,0(r8) /* Load word from memory. */ + cmpb r5,r12,r4 /* Compare each byte against c byte. */ +#ifdef __LITTLE_ENDIAN__ + srw r5,r5,r6 + slw r5,r5,r6 +#else - slw r5,r5,r6 /* Move left to discard ignored bits. */ - srw r5,r5,r6 /* Bring the bits back as zeros. */ + slw r5,r5,r6 /* Move left to discard ignored bits. */ + srw r5,r5,r6 /* Bring the bits back as zeros. */ +#endif - cmpwi cr7,r5,0 /* If r5 == 0, no c bytes have been found. */ - bne cr7,L(done) - + cmpwi cr7,r5,0 /* If r5 == 0, no c bytes have been found. */ + bne cr7,L(done) + @@ -92,8 +97,14 @@ - word from the string. Use that fact to find out what is - the position of the byte inside the string. */ + word from the string. Use that fact to find out what is + the position of the byte inside the string. */ L(done): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntw r0,r0 +#else - cntlzw r0,r5 /* Count leading zeros before the match. */ + cntlzw r0,r5 /* Count leading zeros before the match. */ - srwi r0,r0,3 /* Convert leading zeroes to bytes. */ +#endif + srwi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching char. */ - blr + add r3,r8,r0 /* Return address of the matching char. */ + blr END (BP_SYM (__rawmemchr)) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S 2014-05-29 13:09:17.000000000 -0500 @@ -654,39 +654,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + Copyright (C) 2010-2014 Free Software Foundation, Inc. Contributed by Luis Machado . This file is part of the GNU C Library. - + @@ -18,118 +18,119 @@ . */ - + #include -#include -#include - + /* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */ - .machine power7 + .machine power7 -ENTRY (BP_SYM (__memchr)) - CALL_MCOUNT 2 +ENTRY (__memchr) + CALL_MCOUNT 3 - dcbt 0,r3 - clrrdi r8,r3,3 + dcbt 0,r3 + clrrdi r8,r3,3 - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 - add r7,r3,r5 /* Calculate the last acceptable address. */ + add r7,r3,r5 /* Calculate the last acceptable address. */ + insrdi r4,r4,16,32 - cmpldi r5,32 + cmpldi r5,32 + li r9, -1 + rlwinm r6,r3,3,26,28 /* Calculate padding. */ - insrdi r4,r4,32,0 + insrdi r4,r4,32,0 + addi r7,r7,-1 +#ifdef __LITTLE_ENDIAN__ + sld r9,r9,r6 +#else + srd r9,r9,r6 +#endif - ble L(small_range) - + ble L(small_range) + - cmpld cr7,r3,r7 /* Compare the starting address (r3) with the - ending address (r7). If (r3 >= r7), - the size passed in was zero or negative. */ @@ -698,7 +698,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. -L(proceed): - rlwinm r6,r3,3,26,28 /* Calculate padding. */ - cmpldi cr6,r6,0 /* cr6 == Do we have padding? */ - ld r12,0(r8) /* Load doubleword from memory. */ + ld r12,0(r8) /* Load doubleword from memory. */ - cmpb r10,r12,r4 /* Check for BYTEs in DWORD1. */ - beq cr6,L(proceed_no_padding) - sld r10,r10,r6 @@ -710,27 +710,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + clrldi r5,r7,61 /* Byte count - 1 in last dword. */ + clrrdi r7,r7,3 /* Address of last doubleword. */ + cmpldi cr7,r3,0 /* Does r3 indicate we got a hit? */ - bne cr7,L(done) - + bne cr7,L(done) + - /* See if we are at the last acceptable address yet. */ - addi r9,r8,8 - cmpld cr6,r9,r7 - bge cr6,L(null) - - mtcrf 0x01,r8 - /* Are we now aligned to a quadword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ + mtcrf 0x01,r8 + /* Are we now aligned to a quadword boundary? If so, skip to + the main loop. Otherwise, go through the alignment code. */ - - bt 28,L(loop_setup) - - /* Handle DWORD2 of pair. */ - ldu r12,8(r8) + bt 28,L(loop_setup) + + /* Handle DWORD2 of pair. */ + ldu r12,8(r8) - cmpb r10,r12,r4 - cmpldi cr7,r10,0 + cmpb r3,r12,r4 + cmpldi cr7,r3,0 - bne cr7,L(done) - + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,8 - cmpld cr6,r9,r7 @@ -747,7 +747,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + cnt = (r7 - r8) / 16 */ + sub r6,r7,r8 + srdi r6,r6,4 /* Number of loop iterations. */ - mtctr r6 /* Setup the counter. */ + mtctr r6 /* Setup the counter. */ - b L(loop) - /* Main loop to look for BYTE backwards in the string. Since - it's a small loop (< 8 instructions), align it to 32-bytes. */ @@ -757,21 +757,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + it's a small loop (8 instructions), align it to 32-bytes. */ + .align 5 L(loop): - /* Load two doublewords, compare and merge in a - single register for speed. This is an attempt - to speed up the byte-checking process for bigger strings. */ - ld r12,8(r8) - ldu r11,16(r8) + /* Load two doublewords, compare and merge in a + single register for speed. This is an attempt + to speed up the byte-checking process for bigger strings. */ + ld r12,8(r8) + ldu r11,16(r8) - cmpb r10,r12,r4 + cmpb r3,r12,r4 - cmpb r9,r11,r4 + cmpb r9,r11,r4 - or r5,r9,r10 /* Merge everything in one doubleword. */ - cmpldi cr7,r5,0 + or r6,r9,r3 /* Merge everything in one doubleword. */ + cmpldi cr7,r6,0 - bne cr7,L(found) - bdnz L(loop) - + bne cr7,L(found) + bdnz L(loop) + - /* We're here because the counter reached 0, and that means we - didn't have any matches for BYTE in the whole range. */ - subi r11,r7,8 @@ -781,7 +781,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + /* We may have one more dword to read. */ + cmpld r8,r7 + beqlr - + + ldu r12,8(r8) + cmpb r3,r12,r4 + cmpldi cr6,r3,0 @@ -790,30 +790,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + + .align 4 +L(found): - /* OK, one (or both) of the doublewords contains BYTE. Check - the first doubleword and decrement the address in case the first - doubleword really contains BYTE. */ + /* OK, one (or both) of the doublewords contains BYTE. Check + the first doubleword and decrement the address in case the first + doubleword really contains BYTE. */ - .align 4 -L(found): - cmpldi cr6,r10,0 + cmpldi cr6,r3,0 - addi r8,r8,-8 - bne cr6,L(done) - - /* BYTE must be in the second doubleword. Adjust the address + addi r8,r8,-8 + bne cr6,L(done) + + /* BYTE must be in the second doubleword. Adjust the address - again and move the result of cmpb to r10 so we can calculate the + again and move the result of cmpb to r3 so we can calculate the - pointer. */ - + pointer. */ + - mr r10,r9 + mr r3,r9 - addi r8,r8,8 - + addi r8,r8,8 + - /* r10 has the output of the cmpb instruction, that is, it contains + /* r3 has the output of the cmpb instruction, that is, it contains - 0xff in the same position as BYTE in the original - doubleword from the string. Use that to calculate the pointer. - We need to make sure BYTE is *before* the end of the range. */ + 0xff in the same position as BYTE in the original + doubleword from the string. Use that to calculate the pointer. + We need to make sure BYTE is *before* the end of the range. */ L(done): - cntlzd r0,r10 /* Count leading zeroes before the match. */ - srdi r0,r0,3 /* Convert leading zeroes to bytes. */ @@ -826,24 +826,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. +#endif + cmpld r8,r7 /* Are we on the last dword? */ + srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */ - add r3,r8,r0 + add r3,r8,r0 - cmpld r3,r7 - bge L(null) + cmpld cr7,r0,r5 /* If on the last dword, check byte offset. */ + bnelr + blelr cr7 + li r3,0 - blr - - .align 4 + blr + + .align 4 @@ -141,67 +142,44 @@ - .align 4 + .align 4 L(small_range): - cmpldi r5,0 + cmpldi r5,0 - rlwinm r6,r3,3,26,28 /* Calculate padding. */ - beq L(null) /* This branch is for the cmpldi r5,0 above. */ + beq L(null) - ld r12,0(r8) /* Load word from memory. */ + ld r12,0(r8) /* Load word from memory. */ - cmpldi cr6,r6,0 /* cr6 == Do we have padding? */ - cmpb r10,r12,r4 /* Check for BYTE in DWORD1. */ - /* If no padding, skip the shifts. */ @@ -858,7 +858,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + clrldi r5,r7,61 /* Byte count - 1 in last dword. */ + clrrdi r7,r7,3 /* Address of last doubleword. */ + cmpld r8,r7 /* Are we done already? */ - bne cr7,L(done) + bne cr7,L(done) - - /* Are we done already? */ - addi r9,r8,8 @@ -875,8 +875,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. - bne cr6,L(done) /* Found something. */ - bge L(null) /* Hit end of string (length). */ + beqlr - - ldu r12,8(r8) + + ldu r12,8(r8) - cmpb r10,r12,r4 - addi r9,r8,8 - cmpldi cr6,r10,0 @@ -884,11 +884,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + cmpb r3,r12,r4 + cmpldi cr6,r3,0 + cmpld r8,r7 - bne cr6,L(done) /* Found something. */ + bne cr6,L(done) /* Found something. */ - bge L(null) + beqlr /* Hit end of string (length). */ - - ldu r12,8(r8) + + ldu r12,8(r8) - subi r11,r7,8 - cmpb r10,r12,r4 - cmpldi cr6,r10,0 @@ -896,9 +896,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + cmpb r3,r12,r4 + cmpldi cr6,r3,0 + cmpld r8,r7 - bne cr6,L(done) + bne cr6,L(done) + beqlr - + - cmpld r8,r11 /* At end of range? */ - bge L(null) - @@ -917,15 +917,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memchr.S glibc-2. + cmpld r8,r7 + bne cr6,L(done) + beqlr - + - /* Save a branch and exit directly. */ - li r3,0 + ldu r12,8(r8) + cmpb r3,r12,r4 + cmpldi cr6,r3,0 + bne cr6,L(done) - blr - + blr + - -END (BP_SYM (__memchr)) -weak_alias (BP_SYM (__memchr), BP_SYM(memchr)) @@ -941,16 +941,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + Copyright (C) 2010-2014 Free Software Foundation, Inc. Contributed by Luis Machado . This file is part of the GNU C Library. - + @@ -18,125 +18,137 @@ . */ - + #include -#include -#include - + /* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */ - .machine power7 + .machine power7 -ENTRY (BP_SYM (__memrchr)) - CALL_MCOUNT - dcbt 0,r3 @@ -966,31 +966,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + clrrdi r6,r7,7 + li r9,3<<5 + dcbt r9,r6,8 /* Stream hint, decreasing addresses. */ - - /* Replicate BYTE to doubleword. */ + + /* Replicate BYTE to doubleword. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - insrdi r4,r4,32,0 + insrdi r4,r4,32,0 - bge cr7,L(proceed) - - li r3,-1 /* Make r11 the biggest if r4 <= 0. */ -L(proceed): - li r6,-8 + li r6,-8 - addi r9,r3,-1 - clrrdi r8,r9,3 - addi r8,r8,8 - neg r0,r3 + li r9,-1 - rlwinm r0,r0,3,26,28 /* Calculate padding. */ + rlwinm r0,r0,3,26,28 /* Calculate padding. */ - + clrrdi r8,r7,3 + srd r9,r9,r0 - cmpldi r5,32 + cmpldi r5,32 + clrrdi r0,r10,3 - ble L(small_range) - + ble L(small_range) + - ldbrx r12,r8,r6 /* Load reversed doubleword from memory. */ - cmpb r10,r12,r4 /* Check for BYTE in DWORD1. */ - sld r10,r10,r0 @@ -1004,39 +1004,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + cmpb r3,r12,r4 /* Check for BYTE in DWORD1. */ + and r3,r3,r9 + cmpldi cr7,r3,0 /* If r3 == 0, no BYTEs have been found. */ - bne cr7,L(done) - + bne cr7,L(done) + - /* Are we done already? */ - addi r9,r8,-8 - cmpld cr6,r9,r7 - ble cr6,L(null) - - mtcrf 0x01,r8 + mtcrf 0x01,r8 - /* Are we now aligned to a doubleword boundary? If so, skip to + /* Are we now aligned to a quadword boundary? If so, skip to - the main loop. Otherwise, go through the alignment code. */ + the main loop. Otherwise, go through the alignment code. */ - mr r8,r9 - bt 28,L(loop_setup) + bf 28,L(loop_setup) - - /* Handle DWORD2 of pair. */ + + /* Handle DWORD2 of pair. */ +#ifdef __LITTLE_ENDIAN__ + ldx r12,r8,r6 +#else - ldbrx r12,r8,r6 + ldbrx r12,r8,r6 - cmpb r10,r12,r4 - cmpldi cr7,r10,0 - bne cr7,L(done) - - /* Are we done already. */ +#endif - addi r8,r8,-8 + addi r8,r8,-8 - cmpld cr6,r8,r7 - ble cr6,L(null) + cmpb r3,r12,r4 + cmpldi cr7,r3,0 + bne cr7,L(done) - + L(loop_setup): - li r0,-16 - sub r5,r8,r7 @@ -1050,7 +1050,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + sub r5,r8,r0 + addi r8,r8,-8 + srdi r9,r5,4 /* Number of loop iterations. */ - mtctr r9 /* Setup the counter. */ + mtctr r9 /* Setup the counter. */ - b L(loop) - /* Main loop to look for BYTE backwards in the string. Since it's a - small loop (< 8 instructions), align it to 32-bytes. */ @@ -1061,10 +1061,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + 9 instruction loop. */ + .align 5 L(loop): - /* Load two doublewords, compare and merge in a - single register for speed. This is an attempt - to speed up the byte-checking process for bigger strings. */ - + /* Load two doublewords, compare and merge in a + single register for speed. This is an attempt + to speed up the byte-checking process for bigger strings. */ + - ldbrx r12,r8,r6 - ldbrx r11,r8,r0 - addi r8,r8,-8 @@ -1077,14 +1077,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + ldbrx r11,r8,r6 +#endif + cmpb r3,r12,r4 - cmpb r9,r11,r4 + cmpb r9,r11,r4 - or r5,r9,r10 /* Merge everything in one doubleword. */ + or r5,r9,r3 /* Merge everything in one doubleword. */ - cmpldi cr7,r5,0 - bne cr7,L(found) + cmpldi cr7,r5,0 + bne cr7,L(found) - addi r8,r8,-8 + addi r8,r8,-16 - bdnz L(loop) + bdnz L(loop) - /* We're here because the counter reached 0, and that means we - didn't have any matches for BYTE in the whole range. Just return - the original range. */ @@ -1111,31 +1111,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + bne cr7,L(done) + blr + - .align 4 + .align 4 L(found): - cmpldi cr6,r10,0 - addi r8,r8,8 + /* OK, one (or both) of the dwords contains BYTE. Check + the first dword. */ + cmpldi cr6,r3,0 - bne cr6,L(done) - - /* BYTE must be in the second word. Adjust the address + bne cr6,L(done) + + /* BYTE must be in the second word. Adjust the address - again and move the result of cmpb to r10 so we can calculate the + again and move the result of cmpb to r3 so we can calculate the - pointer. */ - + pointer. */ + - mr r10,r9 + mr r3,r9 - addi r8,r8,-8 - + addi r8,r8,-8 + - /* r10 has the output of the cmpb instruction, that is, it contains - 0xff in the same position as the BYTE in the original + /* r3 has the output of the cmpb instruction, that is, it contains + 0xff in the same position as BYTE in the original - word from the string. Use that to calculate the pointer. - We need to make sure BYTE is *before* the end of the - range. */ + word from the string. Use that to calculate the pointer. + We need to make sure BYTE is *before* the end of the + range. */ L(done): - cntlzd r0,r10 /* Count leading zeroes before the match. */ - srdi r6,r0,3 /* Convert leading zeroes to bytes. */ @@ -1144,20 +1144,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + cmpld r8,r0 /* Are we on the last word? */ + srdi r6,r9,3 /* Convert leading zeros to bytes. */ + addi r0,r6,-7 - sub r3,r8,r0 + sub r3,r8,r0 - cmpld r3,r7 - blt L(null) + cmpld cr7,r3,r10 + bnelr + bgelr cr7 + li r3,0 - blr - - .align 4 + blr + + .align 4 @@ -150,30 +162,36 @@ - cmpldi r5,0 - beq L(null) - + cmpldi r5,0 + beq L(null) + - ldbrx r12,r8,r6 /* Load reversed doubleword from memory. */ - cmpb r10,r12,r4 /* Check for BYTE in DWORD1. */ - sld r10,r10,r0 @@ -1171,16 +1171,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + cmpb r3,r12,r4 /* Check for BYTE in DWORD1. */ + and r3,r3,r9 + cmpldi cr7,r3,0 - bne cr7,L(done) - - /* Are we done already? */ + bne cr7,L(done) + + /* Are we done already? */ + cmpld r8,r0 - addi r8,r8,-8 + addi r8,r8,-8 - cmpld r8,r7 - ble L(null) - b L(loop_small) + beqlr - + - .p2align 5 + .align 5 L(loop_small): @@ -1197,13 +1197,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memrchr.S glibc-2 + cmpld r8,r0 + cmpldi cr7,r3,0 + bne cr7,L(done) - addi r8,r8,-8 + addi r8,r8,-8 - cmpld r8,r7 - ble L(null) - b L(loop_small) + bne L(loop_small) + blr - + -END (BP_SYM (__memrchr)) -weak_alias (BP_SYM (__memrchr), BP_SYM(memrchr)) +END (__memrchr) @@ -1213,43 +1213,43 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/rawmemchr.S glibc --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/rawmemchr.S 2014-05-29 13:09:17.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/rawmemchr.S 2014-05-29 13:09:19.000000000 -0500 @@ -29,8 +29,8 @@ - clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ - - /* Replicate byte to doubleword. */ + clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ + + /* Replicate byte to doubleword. */ - rlwimi r4,r4,8,16,23 - rlwimi r4,r4,16,0,15 + insrdi r4,r4,8,48 + insrdi r4,r4,16,32 - insrdi r4,r4,32,0 - - /* Now r4 has a doubleword of c bytes. */ + insrdi r4,r4,32,0 + + /* Now r4 has a doubleword of c bytes. */ @@ -38,8 +38,13 @@ - rlwinm r6,r3,3,26,28 /* Calculate padding. */ - ld r12,0(r8) /* Load doubleword from memory. */ - cmpb r5,r12,r4 /* Compare each byte against c byte. */ + rlwinm r6,r3,3,26,28 /* Calculate padding. */ + ld r12,0(r8) /* Load doubleword from memory. */ + cmpb r5,r12,r4 /* Compare each byte against c byte. */ +#ifdef __LITTLE_ENDIAN__ + srd r5,r5,r6 + sld r5,r5,r6 +#else - sld r5,r5,r6 /* Move left to discard ignored bits. */ - srd r5,r5,r6 /* Bring the bits back as zeros. */ + sld r5,r5,r6 /* Move left to discard ignored bits. */ + srd r5,r5,r6 /* Bring the bits back as zeros. */ +#endif - cmpdi cr7,r5,0 /* If r5 == 0, no c bytes have been found. */ - bne cr7,L(done) - + cmpdi cr7,r5,0 /* If r5 == 0, no c bytes have been found. */ + bne cr7,L(done) + @@ -93,8 +98,14 @@ - doubleword from the string. Use that fact to find out what is - the position of the byte inside the string. */ + doubleword from the string. Use that fact to find out what is + the position of the byte inside the string. */ L(done): +#ifdef __LITTLE_ENDIAN__ + addi r0,r5,-1 + andc r0,r0,r5 + popcntd r0,r0 /* Count trailing zeros. */ +#else - cntlzd r0,r5 /* Count leading zeros before the match. */ + cntlzd r0,r5 /* Count leading zeros before the match. */ - srdi r0,r0,3 /* Convert leading zeroes to bytes. */ +#endif + srdi r0,r0,3 /* Convert leading zeros to bytes. */ - add r3,r8,r0 /* Return address of the matching char. */ - blr + add r3,r8,r0 /* Return address of the matching char. */ + blr END (BP_SYM (__rawmemchr)) diff --git a/SOURCES/glibc-ppc64le-34.patch b/SOURCES/glibc-ppc64le-34.patch index 9b1bd5ff..ef6362d5 100644 --- a/SOURCES/glibc-ppc64le-34.patch +++ b/SOURCES/glibc-ppc64le-34.patch @@ -1,23 +1,23 @@ # commit 8f9ebb08af1368962d9f24c4cfacb55cf8eee560 # Author: Alan Modra # Date: Thu Oct 3 14:03:03 2013 +0930 -# +# # PowerPC LE configury # http://sourceware.org/ml/libc-alpha/2013-08/msg00096.html -# +# # This adds the basic configury bits for powerpc64le and powerpcle. -# +# # * configure.in: Map powerpc64le and powerpcle to base_machine/machine. # * configure: Regenerate. # * nptl/shlib-versions: Powerpc*le starts at 2.18. # * shlib-versions: Likewise. -# +# # commit 0ff8246327401ae8779e2697d5c7348611cdbf8a # Author: Adhemerval Zanella # Date: Tue Feb 4 09:49:08 2014 -0200 -# +# # PowerPC: Change powerpc64le start ABI to 2.17. -# +# diff -urN glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure --- glibc-2.17-c758a686/configure 2014-05-26 19:52:31.000000000 -0500 +++ glibc-2.17-c758a686/configure 2014-05-26 19:54:13.000000000 -0500 @@ -59,10 +59,10 @@ diff -urN glibc-2.17-c758a686/shlib-versions glibc-2.17-c758a686/shlib-versions --- glibc-2.17-c758a686/shlib-versions 2014-05-26 19:52:31.000000000 -0500 +++ glibc-2.17-c758a686/shlib-versions 2014-05-26 19:53:31.000000000 -0500 @@ -23,6 +23,7 @@ - + s390x-.*-linux.* DEFAULT GLIBC_2.2 powerpc64-.*-linux.* DEFAULT GLIBC_2.3 +powerpc.*le-.*-linux.* DEFAULT GLIBC_2.17 .*-.*-gnu-gnu.* DEFAULT GLIBC_2.2.6 - + # Configuration ABI Identifier for ABI data files diff --git a/SOURCES/glibc-ppc64le-35.patch b/SOURCES/glibc-ppc64le-35.patch index 05e4316b..17434b90 100644 --- a/SOURCES/glibc-ppc64le-35.patch +++ b/SOURCES/glibc-ppc64le-35.patch @@ -1,9 +1,9 @@ # commit 5162e7dd96efcd9b45c1dc1471a964d45278b1e1 # Author: Ulrich Weigand # Date: Wed Dec 4 06:41:52 2013 -0600 -# +# # PowerPC64: Fix incorrect CFI in *context routines -# +# # The context established by "makecontext" has a link register pointing # back to an error path within the makecontext routine. This is currently # covered by the CFI FDE for makecontext itself, which is simply wrong @@ -11,42 +11,42 @@ # doing a backtrace) in a routine inside a context created by makecontext, # this can lead to uninitialized stack slots being accessed, causing the # unwinder to crash in the worst case. -# +# # Similarly, during parts of the "setcontext" routine, when the stack # pointer has already been switched to point to the new context, the # address range is still covered by the CFI FDE for setcontext. When # trying to unwind in that situation (e.g. backtrace from an async # signal handler for profiling), it is again possible that the unwinder # crashes. -# +# # Theses are all problems in existing code, but the changes in stack # frame layout appear to make the "worst case" much more likely in # the ELFv2 ABI context. This causes regressions e.g. in the libgo # testsuite on ELFv2. -# +# # This patch fixes this by ending the makecontext/setcontext FDEs # before those problematic parts of the assembler, similar to what # is already done on other platforms. This fixes the libgo # regression on ELFv2. -# +# diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-29 13:16:16.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-29 13:16:17.000000000 -0500 @@ -129,6 +129,10 @@ the cpu link stack used to predict blr return addresses. */ bcl 20,31,L(gotexitcodeaddr); - + + /* End FDE now, because while executing on the context's stack + the unwind info would be wrong otherwise. */ + cfi_endproc + - /* This is the helper code which gets called if a function which - is registered with 'makecontext' returns. In this case we - have to install the context listed in the uc_link element of + /* This is the helper code which gets called if a function which + is registered with 'makecontext' returns. In this case we + have to install the context listed in the uc_link element of @@ -157,6 +161,11 @@ #endif - b L(do_exit) - + b L(do_exit) + + /* Re-establish FDE for the rest of the actual makecontext routine. */ + cfi_startproc + cfi_offset (lr, FRAME_LR_SAVE) @@ -61,7 +61,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/setconte @@ -129,6 +129,10 @@ lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31) lfd fp0,(SIGCONTEXT_FP_REGS+(PT_R0*8))(r31) - + + /* End FDE now, because the unwind info would be wrong while + we're reloading registers to switch to the new context. */ + cfi_endproc @@ -72,7 +72,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/setconte @@ -177,6 +181,11 @@ ld r31,(SIGCONTEXT_GP_REGS+(PT_R31*8))(r31) bctr - + + /* Re-establish FDE for the rest of the actual setcontext routine. */ + cfi_startproc + cfi_offset (lr, FRAME_LR_SAVE) @@ -84,7 +84,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/setconte @@ -403,6 +412,10 @@ lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31) lfd fp0,(SIGCONTEXT_FP_REGS+(PT_R0*8))(r31) - + + /* End FDE now, because the unwind info would be wrong while + we're reloading registers to switch to the new context. */ + cfi_endproc @@ -95,7 +95,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/setconte @@ -451,6 +464,11 @@ ld r31,(SIGCONTEXT_GP_REGS+(PT_R31*8))(r31) bctr - + + /* Re-establish FDE for the rest of the actual setcontext routine. */ + cfi_startproc + cfi_offset (lr, FRAME_LR_SAVE) diff --git a/SOURCES/glibc-ppc64le-36.patch b/SOURCES/glibc-ppc64le-36.patch index ddd41a2e..fbe351c1 100644 --- a/SOURCES/glibc-ppc64le-36.patch +++ b/SOURCES/glibc-ppc64le-36.patch @@ -1,24 +1,24 @@ # commit 7ec07d9a7b501f1b7d740fda02ba5f39d6d684e5 # Author: Alan Modra # Date: Wed Dec 4 06:44:06 2013 -0600 -# +# # PowerPC64: Report overflow on @h and @ha relocations -# +# # This patch updates glibc in accordance with the binutils patch checked in here: # https://sourceware.org/ml/binutils/2013-10/msg00372.html -# +# # This changes the various R_PPC64_..._HI and _HA relocations to report # 32-bit overflows. The motivation is that existing uses of @h / @ha # are to build up 32-bit offsets (for the "medium model" TOC access # that GCC now defaults to), and we'd really like to see failures at # link / load time rather than silent truncations. -# +# # For those rare cases where a modifier is needed to build up a 64-bit # constant, new relocations _HIGH / _HIGHA are supported. -# +# # The patch also fixes a bug in overflow checking for the R_PPC64_ADDR30 # and R_PPC64_ADDR32 relocations. -# +# diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h --- glibc-2.17-c758a686/elf/elf.h 2014-05-29 13:17:35.000000000 -0500 +++ glibc-2.17-c758a686/elf/elf.h 2014-05-29 13:17:35.000000000 -0500 @@ -37,14 +37,14 @@ diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h +#define R_PPC64_TPREL16_HIGHA 113 +#define R_PPC64_DTPREL16_HIGH 114 +#define R_PPC64_DTPREL16_HIGHA 115 - + /* GNU extension to support local ifunc. */ #define R_PPC64_JMP_IREL 247 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:17:34.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:17:35.000000000 -0500 @@ -663,11 +663,25 @@ - + case R_PPC64_TPREL16_HI: value = elf_machine_tprel (map, sym_map, sym, reloc); + if (dont_expect (value + 0x80000000 >= 0x100000000LL)) @@ -56,7 +56,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + value = elf_machine_tprel (map, sym_map, sym, reloc); *(Elf64_Half *) reloc_addr = PPC_HI (value); break; - + case R_PPC64_TPREL16_HA: value = elf_machine_tprel (map, sym_map, sym, reloc); + if (dont_expect (value + 0x80008000 >= 0x100000000LL)) @@ -68,38 +68,38 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + value = elf_machine_tprel (map, sym_map, sym, reloc); *(Elf64_Half *) reloc_addr = PPC_HA (value); break; - + @@ -703,17 +717,23 @@ break; - + case R_PPC64_ADDR16_HI: + if (dont_expect (value + 0x80000000 >= 0x100000000LL)) + _dl_reloc_overflow (map, "R_PPC64_ADDR16_HI", reloc_addr, refsym); + case R_PPC64_ADDR16_HIGH: *(Elf64_Half *) reloc_addr = PPC_HI (value); break; - + case R_PPC64_ADDR16_HA: + if (dont_expect (value + 0x80008000 >= 0x100000000LL)) + _dl_reloc_overflow (map, "R_PPC64_ADDR16_HA", reloc_addr, refsym); + case R_PPC64_ADDR16_HIGHA: *(Elf64_Half *) reloc_addr = PPC_HA (value); break; - + case R_PPC64_ADDR30: { - Elf64_Addr delta = value - (Elf64_Xword) reloc_addr; + Elf64_Addr delta = value - (Elf64_Xword) reloc_addr; - if (dont_expect ((delta + 0x80000000) >= 0x10000000 + if (dont_expect ((delta + 0x80000000) >= 0x100000000LL - || (delta & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym); - BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc); + || (delta & 3) != 0)) + _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym); + BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc); @@ -762,7 +782,7 @@ return; - + case R_PPC64_ADDR32: - if (dont_expect ((value + 0x80000000) >= 0x10000000)) + if (dont_expect ((value + 0x80000000) >= 0x100000000LL)) - _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym); *(Elf64_Word *) reloc_addr = value; return; diff --git a/SOURCES/glibc-ppc64le-37.patch b/SOURCES/glibc-ppc64le-37.patch index 0e953631..dad59a69 100644 --- a/SOURCES/glibc-ppc64le-37.patch +++ b/SOURCES/glibc-ppc64le-37.patch @@ -1,22 +1,22 @@ # commit b525166bb93b060e1146f0263b76a9c1e7455b06 # Author: Ulrich Weigand # Date: Wed Dec 4 06:45:56 2013 -0600 -# +# # PowerPC64: Add __private_ss field to TCB header -# +# # The TCB header on Intel contains a field __private_ss that is used # to efficiently implement the -fsplit-stack GCC feature. -# +# # In order to prepare for a possible future implementation of that # feature on powerpc64, we'd like to reserve a similar field in # the TCB header as well. (It would be good if this went in with # or before the ELFv2 patches to ensure that this field will be # available always in the ELFv2 environment.) -# +# # The field needs to be added at the front of tcbhead_t structure # to avoid changing the ABI; see the recent discussion when adding # the EBB fields. -# +# diff -urN glibc-2.17-c758a686/nptl/sysdeps/powerpc/tls.h glibc-2.17-c758a686/nptl/sysdeps/powerpc/tls.h --- glibc-2.17-c758a686/nptl/sysdeps/powerpc/tls.h 2014-05-29 13:19:25.000000000 -0500 +++ glibc-2.17-c758a686/nptl/sysdeps/powerpc/tls.h 2014-05-29 13:19:25.000000000 -0500 diff --git a/SOURCES/glibc-ppc64le-38.patch b/SOURCES/glibc-ppc64le-38.patch index ef1aabe4..196f0adf 100644 --- a/SOURCES/glibc-ppc64le-38.patch +++ b/SOURCES/glibc-ppc64le-38.patch @@ -1,27 +1,27 @@ # commit d31beafa8e4ca69faa4cf362784796ef17299341 # Author: Ulrich Weigand # Date: Wed Dec 4 06:49:15 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 1/6: Code refactoring -# +# # This is the first patch to support the new ELFv2 ABI in glibc. -# +# # As preparation, this patch simply refactors some of the powerpc64 assembler # code to move all code related to creating function descriptors (.opd section) # or using function descriptors (function pointer call) into a central place # in sysdep.h. -# +# # Note that most locations creating .opd entries were already using macros # in sysdep.h, this patch simply extends this to the remaining places. -# +# # No relevant change in generated code expected. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:56:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:56:37.000000000 -0500 @@ -60,18 +60,8 @@ .LC0: - .tc PREINIT_FUNCTION[TC], PREINIT_FUNCTION + .tc PREINIT_FUNCTION[TC], PREINIT_FUNCTION #endif - .type BODY_LABEL (_init), @function - .globl _init @@ -34,15 +34,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6 -#else - .type _init, @function -#endif - .section ".init", "ax", @progbits + .section ".init", "ax", @progbits + ENTRY_2(_init) - .align ALIGNARG (2) + .align ALIGNARG (2) BODY_LABEL (_init): - mflr 0 + mflr 0 @@ -87,18 +77,8 @@ - nop + nop 1: - + - .type BODY_LABEL (_fini), @function - .globl _fini - .section ".opd", "aw" @@ -54,11 +54,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6 -#else - .type _fini, @function -#endif - .section ".fini", "ax", @progbits + .section ".fini", "ax", @progbits + ENTRY_2(_fini) - .align ALIGNARG (2) + .align ALIGNARG (2) BODY_LABEL (_fini): - mflr 0 + mflr 0 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:37.000000000 -0500 @@ -113,9 +113,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:37.000000000 -0500 @@ -71,12 +71,8 @@ - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) + mtcrf 0xFF,r0 -/* Load the target address, toc and static chain reg from the function - descriptor returned by fixup. */ - ld r0,0(r3) @@ -124,13 +124,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. - ld r11,16(r3) +/* Prepare for calling the function returned by fixup. */ + PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + ld r3,INT_PARMS+0(r1) /* Unwind the stack frame, and jump. */ - addi r1,r1,FRAME_SIZE + addi r1,r1,FRAME_SIZE @@ -322,13 +318,9 @@ - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) + mtcrf 0xFF,r0 -/* Load the target address, toc and static chain reg from the function - descriptor returned by fixup. */ - ld r0,0(r3) @@ -138,35 +138,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. - ld r11,16(r3) +/* Prepare for calling the function returned by fixup. */ + PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + ld r3,INT_PARMS+0(r1) - mtctr r0 /* Load the floating point registers. */ - lfd fp1,FPR_PARMS+0(r1) - lfd fp2,FPR_PARMS+8(r1) + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) @@ -386,14 +378,10 @@ - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) + mtcrf 0xFF,r0 -/* Load the target address, toc and static chain reg from the function - descriptor returned by fixup. */ - ld r0,0(r3) +/* Prepare for calling the function returned by fixup. */ - std r2,40(r1) + std r2,40(r1) - ld r2,8(r3) - ld r11,16(r3) + PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + ld r3,INT_PARMS+0(r1) - mtctr r0 /* Load the floating point registers. */ - lfd fp1,FPR_PARMS+0(r1) - lfd fp2,FPR_PARMS+8(r1) + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:37.000000000 -0500 @@ -74,6 +74,14 @@ #endif - .endm - + .endm + +/* Macro to prepare for calling via a function pointer. */ + .macro PPC64_LOAD_FUNCPTR PTR + ld r12,0(\PTR) @@ -180,32 +180,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 #else @@ -81,7 +89,6 @@ #endif - + #define ENTRY_1(name) \ - .section ".text"; \ - .type BODY_LABEL(name),@function; \ - .globl name; \ - .section ".opd","aw"; \ + .type BODY_LABEL(name),@function; \ + .globl name; \ + .section ".opd","aw"; \ @@ -110,6 +117,7 @@ #endif - + #define ENTRY(name) \ + .section ".text"; \ - ENTRY_2(name) \ - .align ALIGNARG(2); \ + ENTRY_2(name) \ + .align ALIGNARG(2); \ BODY_LABEL(name): \ @@ -127,6 +135,7 @@ /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes past a 2^alignt boundary. */ #define EALIGN(name, alignt, words) \ + .section ".text"; \ - ENTRY_2(name) \ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ + ENTRY_2(name) \ + .align ALIGNARG(alignt); \ + EALIGN_W_##words; \ @@ -286,24 +295,42 @@ - + #else /* !__ASSEMBLER__ */ - + +#define PPC64_LOAD_FUNCPTR(ptr) \ + "ld 12,0(" #ptr ");\n" \ + "ld 2,8(" #ptr ");\n" \ @@ -217,7 +217,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 #else # define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0;" #endif - + +#define ENTRY_1(name) \ + ".type " BODY_PREFIX #name ",@function;\n" \ + ".globl " #name ";\n" \ @@ -231,11 +231,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 # define DOT_PREFIX "." # define BODY_PREFIX "." # define ENTRY_2(name) \ - ".globl " BODY_PREFIX #name ";\n" \ + ".globl " BODY_PREFIX #name ";\n" \ + ENTRY_1(name) "\n" \ - ".size " #name ", 24;" + ".size " #name ", 24;" # define END_2(name) \ - ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" + ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" #else # define DOT_PREFIX "" # define BODY_PREFIX ".LY" @@ -244,19 +244,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 + ".type " #name ",@function;\n" \ + ENTRY_1(name) # define END_2(name) \ - ".size " #name ",.-" BODY_PREFIX #name ";\n" \ - ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" + ".size " #name ",.-" BODY_PREFIX #name ";\n" \ + ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:35.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:37.000000000 -0500 @@ -104,9 +104,7 @@ - - std r2,40(r1) - /* Call procedure. */ + + std r2,40(r1) + /* Call procedure. */ - ld r0,0(r30) - ld r2,8(r30) - mtctr r0 + PPC64_LOAD_FUNCPTR r30 - mr r3,r31 - bctrl - ld r2,40(r1) + mr r3,r31 + bctrl + ld r2,40(r1) diff --git a/SOURCES/glibc-ppc64le-39.patch b/SOURCES/glibc-ppc64le-39.patch index b8f4b436..f837d99e 100644 --- a/SOURCES/glibc-ppc64le-39.patch +++ b/SOURCES/glibc-ppc64le-39.patch @@ -1,16 +1,16 @@ # commit 696caf1d002ff059ddd20fd5eaccd76229c14850 # Author: Ulrich Weigand # Date: Wed Dec 4 06:51:11 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 2/6: Remove function descriptors -# +# # This patch adds support for the ELFv2 ABI feature to remove function # descriptors. See this GCC patch for in-depth discussion: # http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01141.html -# +# # This mostly involves two types of changes: updating assembler source # files to the new logic, and updating the dynamic loader. -# +# # After the refactoring in the previous patch, most of the assembler source # changes can be handled simply by providing ELFv2 versions of the # macros in sysdep.h. One somewhat non-obvious change is in __GI__setjmp: @@ -18,28 +18,28 @@ # point. This is no longer safe in the ELFv2 since ENTRY defines both # a global and a local entry point, and you cannot simply fall through # to a global entry point as it requires r12 to be set up. -# +# # Also, makecontext needs to be updated to set up registers according to # the new ABI for calling into the context's start routine. -# +# # The dynamic linker changes mostly consist of removing special code # to handle function descriptors. We also need to support the new PLT # and glink format used by the the ELFv2 linker, see: # https://sourceware.org/ml/binutils/2013-10/msg00376.html -# +# # In addition, the dynamic linker now verifies that the dynamic libraries # it loads match its own ABI. -# +# # The hack in VDSO_IFUNC_RET to "synthesize" a function descriptor # for vDSO routines is also no longer necessary for ELFv2. -# +# diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h --- glibc-2.17-c758a686/elf/elf.h 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/elf/elf.h 2014-05-29 13:58:25.000000000 -0500 @@ -2263,6 +2263,12 @@ #define R_PPC64_REL16_HI 251 /* half16 (sym+add-.)@h */ #define R_PPC64_REL16_HA 252 /* half16 (sym+add-.)@ha */ - + +/* e_flags bits specifying ABI. + 1 for original function descriptor using ABI, + 2 for revised ABI without function descriptors, @@ -53,21 +53,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500 @@ -64,6 +64,7 @@ - ENTRY_2(_init) - .align ALIGNARG (2) + ENTRY_2(_init) + .align ALIGNARG (2) BODY_LABEL (_init): + LOCALENTRY(_init) - mflr 0 - std 0, 16(r1) - stdu r1, -112(r1) + mflr 0 + std 0, 16(r1) + stdu r1, -112(r1) @@ -81,6 +82,7 @@ - ENTRY_2(_fini) - .align ALIGNARG (2) + ENTRY_2(_fini) + .align ALIGNARG (2) BODY_LABEL (_fini): + LOCALENTRY(_fini) - mflr 0 - std 0, 16(r1) - stdu r1, -112(r1) + mflr 0 + std 0, 16(r1) + stdu r1, -112(r1) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500 @@ -89,7 +89,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- @@ -31,6 +31,7 @@ in l_info array. */ #define DT_PPC64(x) (DT_PPC64_##x - DT_LOPROC + DT_NUM) - + +#if _CALL_ELF != 2 /* A PowerPC64 function descriptor. The .plt (procedure linkage table) and .opd (official procedure descriptor) sections are @@ -99,9 +99,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- Elf64_Addr fd_aux; } Elf64_FuncDesc; +#endif - + #define ELF_MULT_MACHINES_SUPPORTED - + @@ -47,6 +49,18 @@ static inline int elf_machine_matches_host (const Elf64_Ehdr *ehdr) @@ -120,7 +120,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + return ehdr->e_machine == EM_PPC64; } - + @@ -124,6 +138,7 @@ " .align 2\n" \ " " ENTRY_2(_start) "\n" \ @@ -140,7 +140,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- @@ -256,8 +272,22 @@ relocations behave "normally", ie. always use the real address like PLT relocations. So always set ELF_RTYPE_CLASS_PLT. */ - + +#if _CALL_ELF != 2 #define elf_machine_type_class(type) \ (ELF_RTYPE_CLASS_PLT | (((type) == R_PPC64_COPY) * ELF_RTYPE_CLASS_COPY)) @@ -157,12 +157,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + || IS_PPC64_TLS_RELOC (type)) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_PPC64_COPY) * ELF_RTYPE_CLASS_COPY)) +#endif - + /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_PPC64_JMP_SLOT @@ -266,8 +296,19 @@ #define ELF_MACHINE_NO_REL 1 - + /* Stuff for the PLT. */ +#if _CALL_ELF != 2 #define PLT_INITIAL_ENTRY_WORDS 3 @@ -177,41 +177,41 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- +#define GLINK_INITIAL_ENTRY_WORDS 8 +#define GLINK_ENTRY_WORDS(I) 1 +#endif - + #define PPC_DCBST(where) asm volatile ("dcbst 0,%0" : : "r"(where) : "memory") #define PPC_DCBT(where) asm volatile ("dcbt 0,%0" : : "r"(where) : "memory") @@ -312,17 +353,12 @@ - + if (lazy) - { + { - /* The function descriptor of the appropriate trampline - routine is used to set the 1st and 2nd doubleword of the - plt_reserve. */ - Elf64_FuncDesc *resolve_fd; - Elf64_Word glink_offset; + Elf64_Word glink_offset; - /* the plt_reserve area is the 1st 3 doublewords of the PLT */ - Elf64_FuncDesc *plt_reserve = (Elf64_FuncDesc *) plt; - Elf64_Word offset; + Elf64_Word offset; + Elf64_Addr dlrr; - + - resolve_fd = (Elf64_FuncDesc *) (profile ? _dl_profile_resolve - : _dl_runtime_resolve); + dlrr = (Elf64_Addr) (profile ? _dl_profile_resolve + : _dl_runtime_resolve); - if (profile && GLRO(dl_profile) != NULL - && _dl_name_match_p (GLRO(dl_profile), map)) - /* This is the object we are looking for. Say that we really + if (profile && GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), map)) + /* This is the object we are looking for. Say that we really @@ -330,20 +366,33 @@ - GL(dl_profile_map) = map; - - + GL(dl_profile_map) = map; + + +#if _CALL_ELF != 2 - /* We need to stuff the address/TOC of _dl_runtime_resolve - into doublewords 0 and 1 of plt_reserve. Then we need to - stuff the map address into doubleword 2 of plt_reserve. - This allows the GLINK0 code to transfer control to the - correct trampoline which will transfer control to fixup - in dl-machine.c. */ + /* We need to stuff the address/TOC of _dl_runtime_resolve + into doublewords 0 and 1 of plt_reserve. Then we need to + stuff the map address into doubleword 2 of plt_reserve. + This allows the GLINK0 code to transfer control to the + correct trampoline which will transfer control to fixup + in dl-machine.c. */ - plt_reserve->fd_func = resolve_fd->fd_func; - plt_reserve->fd_toc = resolve_fd->fd_toc; - plt_reserve->fd_aux = (Elf64_Addr) map; @@ -240,12 +240,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + plt[0] = dlrr; + plt[1] = (Elf64_Addr) map; #endif - - /* Set up the lazy PLT entries. */ + + /* Set up the lazy PLT entries. */ @@ -354,14 +403,8 @@ - { - - plt[offset] = (Elf64_Xword) &glink[glink_offset]; + { + + plt[offset] = (Elf64_Xword) &glink[glink_offset]; - offset += 3; - /* The first 32k entries of glink can set an index and - branch using two instructions; Past that point, @@ -256,12 +256,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- - glink_offset += 3; + offset += PLT_ENTRY_WORDS; + glink_offset += GLINK_ENTRY_WORDS (i); - } - - /* Now, we've modified data. We need to write the changes from + } + + /* Now, we've modified data. We need to write the changes from @@ -389,6 +432,7 @@ - const Elf64_Rela *reloc, - Elf64_Addr *reloc_addr, Elf64_Addr finaladdr) + const Elf64_Rela *reloc, + Elf64_Addr *reloc_addr, Elf64_Addr finaladdr) { +#if _CALL_ELF != 2 Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr; @@ -274,7 +274,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- +#else + *reloc_addr = finaladdr; +#endif - + return finaladdr; } @@ -433,6 +480,7 @@ @@ -284,7 +284,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- +#if _CALL_ELF != 2 Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr; Elf64_FuncDesc *rel = (Elf64_FuncDesc *) finaladdr; - + @@ -443,6 +491,9 @@ PPC_DCBST (&plt->fd_aux); PPC_DCBST (&plt->fd_toc); @@ -293,11 +293,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + *reloc_addr = finaladdr; +#endif } - + /* Return the final value of a plt relocation. */ @@ -512,6 +563,7 @@ resolve_ifunc (Elf64_Addr value, - const struct link_map *map, const struct link_map *sym_map) + const struct link_map *map, const struct link_map *sym_map) { +#if _CALL_ELF != 2 #ifndef RESOLVE_CONFLICT_FIND_MAP @@ -310,7 +310,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- +#endif return ((Elf64_Addr (*) (unsigned long int)) value) (GLRO(dl_hwcap)); } - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 14:00:27.000000000 -0500 @@ -320,7 +320,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2. HAVE_CLEANUP_JMP_BUF is defined. */ -ENTRY (BP_SYM (__GI__setjmp)) +ENTRY (__GI__setjmp) - std r2,40(r1) /* Save the callers TOC in the save area. */ + std r2,40(r1) /* Save the callers TOC in the save area. */ - cfi_endproc -END_2 (BP_SYM (__GI__setjmp)) -/* Fall thru. */ @@ -329,40 +329,40 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2. + b JUMPTARGET (GLUE(__sigsetjmp,_ent)) +END (__GI__setjmp) #endif - + -ENTRY (BP_SYM (_setjmp)) +ENTRY (_setjmp) - CALL_MCOUNT 1 - li r4,0 /* Set second argument to 0. */ - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) + CALL_MCOUNT 1 + li r4,0 /* Set second argument to 0. */ + b JUMPTARGET (GLUE(__sigsetjmp,_ent)) -END (BP_SYM (_setjmp)) +END (_setjmp) libc_hidden_def (_setjmp) - + -ENTRY (BP_SYM (__sigsetjmp)) +ENTRY (__sigsetjmp) - CALL_MCOUNT 2 + CALL_MCOUNT 2 JUMPTARGET(GLUE(__sigsetjmp,_ent)): - CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE) + CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE) @@ -215,18 +216,18 @@ - li r3,0 - blr + li r3,0 + blr #elif defined SHARED - b JUMPTARGET (BP_SYM (__sigjmp_save)) + b JUMPTARGET (__sigjmp_save) #else - mflr r0 - std r0,16(r1) - stdu r1,-112(r1) - cfi_adjust_cfa_offset(112) - cfi_offset(lr,16) + mflr r0 + std r0,16(r1) + stdu r1,-112(r1) + cfi_adjust_cfa_offset(112) + cfi_offset(lr,16) - bl JUMPTARGET (BP_SYM (__sigjmp_save)) + bl JUMPTARGET (__sigjmp_save) - nop - ld r0,112+16(r1) - addi r1,r1,112 - mtlr r0 - blr + nop + ld r0,112+16(r1) + addi r1,r1,112 + mtlr r0 + blr #endif -END (BP_SYM (__sigsetjmp)) +END (__sigsetjmp) @@ -371,16 +371,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:58:25.000000000 -0500 @@ -74,6 +74,8 @@ #endif - .endm - + .endm + +#if _CALL_ELF != 2 + /* Macro to prepare for calling via a function pointer. */ - .macro PPC64_LOAD_FUNCPTR PTR - ld r12,0(\PTR) + .macro PPC64_LOAD_FUNCPTR PTR + ld r12,0(\PTR) @@ -115,13 +117,37 @@ - .size name,.-BODY_LABEL(name); \ - .size BODY_LABEL(name),.-BODY_LABEL(name); + .size name,.-BODY_LABEL(name); \ + .size BODY_LABEL(name),.-BODY_LABEL(name); #endif +#define LOCALENTRY(name) + @@ -405,40 +405,40 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 + .localentry name,.-name; + +#endif /* _CALL_ELF */ - + #define ENTRY(name) \ - .section ".text"; \ - ENTRY_2(name) \ - .align ALIGNARG(2); \ + .section ".text"; \ + ENTRY_2(name) \ + .align ALIGNARG(2); \ BODY_LABEL(name): \ - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(name) - + #define EALIGN_W_0 /* No words to insert. */ #define EALIGN_W_1 nop @@ -140,7 +166,8 @@ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ + .align ALIGNARG(alignt); \ + EALIGN_W_##words; \ BODY_LABEL(name): \ - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(name) - + /* Local labels stripped out by the linker. */ #undef L @@ -295,6 +322,8 @@ - + #else /* !__ASSEMBLER__ */ - + +#if _CALL_ELF != 2 + #define PPC64_LOAD_FUNCPTR(ptr) \ - "ld 12,0(" #ptr ");\n" \ - "ld 2,8(" #ptr ");\n" \ + "ld 12,0(" #ptr ");\n" \ + "ld 2,8(" #ptr ");\n" \ @@ -335,5 +364,26 @@ - ".size " #name ",.-" BODY_PREFIX #name ";\n" \ - ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" + ".size " #name ",.-" BODY_PREFIX #name ";\n" \ + ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" #endif +#define LOCALENTRY(name) + @@ -461,15 +461,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 + ".localentry " #name ",.-" #name ";" + +#endif /* _CALL_ELF */ - + #endif /* __ASSEMBLER__ */ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h 2014-05-29 13:58:24.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h 2014-05-29 13:58:25.000000000 -0500 @@ -23,6 +23,8 @@ - + /* Now define our stuff. */ - + +#if _CALL_ELF != 2 + static __always_inline bool @@ -478,7 +478,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs @@ -73,4 +75,6 @@ #define DL_ADDR_SYM_MATCH(L, SYM, MATCHSYM, ADDR) \ _dl_ppc64_addr_sym_match (L, SYM, MATCHSYM, ADDR) - + +#endif + #endif /* ldsodefs.h */ @@ -486,9 +486,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecont --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-29 13:58:24.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-29 13:58:25.000000000 -0500 @@ -111,6 +111,7 @@ - + L(noparms): - + +#if _CALL_ELF != 2 /* Load the function address and TOC from the function descriptor and store them in the ucontext as NIP and r2. Store the 3rd @@ -503,6 +503,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecont + std r4,(SIGCONTEXT_GP_REGS+(PT_NIP*8))(r3) + std r4,(SIGCONTEXT_GP_REGS+(PT_R12*8))(r3) +#endif - + /* If the target function returns we need to do some cleanup. We use a code trick to get the address of our cleanup function into the link diff --git a/SOURCES/glibc-ppc64le-40.patch b/SOURCES/glibc-ppc64le-40.patch index 30acfb5d..663d2f3e 100644 --- a/SOURCES/glibc-ppc64le-40.patch +++ b/SOURCES/glibc-ppc64le-40.patch @@ -1,19 +1,19 @@ # commit 122b66defdb9e4ded3ccc5c2b290f0520c6fa3cd # Author: Ulrich Weigand # Date: Wed Dec 4 06:52:40 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 3/6: PLT local entry point optimization -# +# # This is a follow-on to the previous patch to support the ELFv2 ABI in the # dynamic loader, split off into its own patch since it is just an optional # optimization. -# +# # In the ELFv2 ABI, most functions define both a global and a local entry # point; the local entry requires r2 to be already set up by the caller # to point to the callee's TOC; while the global entry does not require # the caller to know about the callee's TOC, but it needs to set up r12 # to the callee's entry point address. -# +# # Now, when setting up a PLT slot, the dynamic linker will usually need # to enter the target function's global entry point. However, if the # linker can prove that the target function is in the same DSO as the @@ -21,12 +21,12 @@ # linker will let ld.so know via a DT_PPC64_OPT entry), then it is # possible to actually enter the local entry point address into the # PLT slot, for a slight improvement in performance. -# +# # Note that this uncovered a problem on the first call via _dl_runtime_resolve, # because that routine neglected to restore the caller's TOC before calling # the target function for the first time, since it assumed that function # would always reload its own TOC anyway ... -# +# diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h --- glibc-2.17-c758a686/elf/elf.h 2014-05-29 14:08:44.000000000 -0500 +++ glibc-2.17-c758a686/elf/elf.h 2014-05-29 14:08:44.000000000 -0500 @@ -36,7 +36,7 @@ diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h #define DT_PPC64_OPDSZ (DT_LOPROC + 2) +#define DT_PPC64_OPT (DT_LOPROC + 3) #define DT_PPC64_NUM 3 - + +/* PowerPC64 specific values for the DT_PPC64_OPT Dyn entry. */ +#define PPC64_OPT_TLS 1 +#define PPC64_OPT_MULTI_TOC 2 @@ -47,16 +47,16 @@ diff -urN glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h +#define PPC64_LOCAL_ENTRY_OFFSET(other) \ + (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2) + - + /* ARM specific declarations */ - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 14:08:40.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 14:08:44.000000000 -0500 @@ -425,6 +425,42 @@ return lazy; } - + +#if _CALL_ELF == 2 +/* If the PLT entry whose reloc is 'reloc' resolves to a function in + the same object, return the target function's local entry point @@ -103,10 +103,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + finaladdr += ppc64_local_entry_offset (map, sym_map, reloc); *reloc_addr = finaladdr; #endif - + @@ -478,7 +515,9 @@ } - + static inline void __attribute__ ((always_inline)) -elf_machine_plt_conflict (Elf64_Addr *reloc_addr, Elf64_Addr finaladdr) +elf_machine_plt_conflict (struct link_map *map, lookup_t sym_map, @@ -137,23 +137,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:08:44.000000000 -0500 @@ -74,6 +74,10 @@ /* Prepare for calling the function returned by fixup. */ - PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + PPC64_LOAD_FUNCPTR r3 + ld r3,INT_PARMS+0(r1) +#if _CALL_ELF == 2 +/* Restore the caller's TOC in case we jump to a local entry point. */ + ld r2,FRAME_SIZE+40(r1) +#endif /* Unwind the stack frame, and jump. */ - addi r1,r1,FRAME_SIZE - bctr + addi r1,r1,FRAME_SIZE + bctr @@ -321,6 +325,10 @@ /* Prepare for calling the function returned by fixup. */ - PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + PPC64_LOAD_FUNCPTR r3 + ld r3,INT_PARMS+0(r1) +#if _CALL_ELF == 2 +/* Restore the caller's TOC in case we jump to a local entry point. */ + ld r2,FRAME_SIZE+40(r1) +#endif /* Load the floating point registers. */ - lfd fp1,FPR_PARMS+0(r1) - lfd fp2,FPR_PARMS+8(r1) + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) diff --git a/SOURCES/glibc-ppc64le-41.patch b/SOURCES/glibc-ppc64le-41.patch index 800894c8..506d761c 100644 --- a/SOURCES/glibc-ppc64le-41.patch +++ b/SOURCES/glibc-ppc64le-41.patch @@ -1,31 +1,31 @@ # commit 8b8a692cfd7d80f1ee7c8b9ab356a259367dd187 # Author: Ulrich Weigand # Date: Wed Dec 4 06:55:03 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes -# +# # This updates glibc for the changes in the ELFv2 relating to the # stack frame layout. These are described in more detail here: # http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html # http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html -# +# # Specifically, the "compiler and linker doublewords" were removed, # which has the effect that the save slot for the TOC register is # now at offset 24 rather than 40 to the stack pointer. -# +# # In addition, a function may now no longer necessarily assume that # its caller has set up a 64-byte register save area its use. -# +# # To address the first change, the patch goes through all assembler # files and replaces immediate offsets in instructions accessing the # ABI-defined stack slots by symbolic offsets. Those already were # defined in ucontext_i.sym and used in some of the context routines, # but that doesn't really seem like the right place for those defines. -# +# # The patch instead defines those symbolic offsets in sysdeps.h, # in two variants for the old and new ABI, and uses them systematically # in all assembler files, not just the context routines. -# +# # The second change only affected a few assembler files that used # the save area to temporarily store some registers. In those # cases where this happens within a leaf function, this patch @@ -33,14 +33,14 @@ # below the stack pointer. Otherwise, the functions already allocate # a stack frame, and the patch changes them to add extra space in # these frames as temporary space for the ELFv2 ABI. -# +# diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h --- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2014-05-29 14:10:00.000000000 -0500 @@ -31,6 +31,14 @@ # define DASHDASHPFX(str) __##str # endif - + +#if _CALL_ELF == 2 +#define CANCEL_FRAMESIZE (FRAME_MIN_SIZE+16+48) +#define CANCEL_PARM_SAVE (FRAME_MIN_SIZE+16) @@ -95,81 +95,81 @@ diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sys + cfi_adjust_cfa_offset (-CANCEL_FRAMESIZE); \ cfi_restore (lr); \ cfi_restore (cr) - + # define DOCARGS_0 # define UNDOCARGS_0 - + -# define DOCARGS_1 std 3,128+48(1); DOCARGS_0 -# define UNDOCARGS_1 ld 3,128+48(1); UNDOCARGS_0 +# define DOCARGS_1 std 3,CANCEL_PARM_SAVE(1); DOCARGS_0 +# define UNDOCARGS_1 ld 3,CANCEL_PARM_SAVE(1); UNDOCARGS_0 - + -# define DOCARGS_2 std 4,128+56(1); DOCARGS_1 -# define UNDOCARGS_2 ld 4,128+56(1); UNDOCARGS_1 +# define DOCARGS_2 std 4,CANCEL_PARM_SAVE+8(1); DOCARGS_1 +# define UNDOCARGS_2 ld 4,CANCEL_PARM_SAVE+8(1); UNDOCARGS_1 - + -# define DOCARGS_3 std 5,128+64(1); DOCARGS_2 -# define UNDOCARGS_3 ld 5,128+64(1); UNDOCARGS_2 +# define DOCARGS_3 std 5,CANCEL_PARM_SAVE+16(1); DOCARGS_2 +# define UNDOCARGS_3 ld 5,CANCEL_PARM_SAVE+16(1); UNDOCARGS_2 - + -# define DOCARGS_4 std 6,128+72(1); DOCARGS_3 -# define UNDOCARGS_4 ld 6,128+72(1); UNDOCARGS_3 +# define DOCARGS_4 std 6,CANCEL_PARM_SAVE+24(1); DOCARGS_3 +# define UNDOCARGS_4 ld 6,CANCEL_PARM_SAVE+24(1); UNDOCARGS_3 - + -# define DOCARGS_5 std 7,128+80(1); DOCARGS_4 -# define UNDOCARGS_5 ld 7,128+80(1); UNDOCARGS_4 +# define DOCARGS_5 std 7,CANCEL_PARM_SAVE+32(1); DOCARGS_4 +# define UNDOCARGS_5 ld 7,CANCEL_PARM_SAVE+32(1); UNDOCARGS_4 - + -# define DOCARGS_6 std 8,128+88(1); DOCARGS_5 -# define UNDOCARGS_6 ld 8,128+88(1); UNDOCARGS_5 +# define DOCARGS_6 std 8,CANCEL_PARM_SAVE+40(1); DOCARGS_5 +# define UNDOCARGS_6 ld 8,CANCEL_PARM_SAVE+40(1); UNDOCARGS_5 - + # ifdef IS_IN_libpthread # ifdef SHARED diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:10:00.000000000 -0500 @@ -133,7 +133,7 @@ - ld r14,((JB_GPRS+0)*8)(r3) - lfd fp14,((JB_FPRS+0)*8)(r3) + ld r14,((JB_GPRS+0)*8)(r3) + lfd fp14,((JB_FPRS+0)*8)(r3) #if defined SHARED && !defined IS_IN_rtld - std r2,40(r1) /* Restore the callers TOC save area. */ + std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */ #endif - ld r15,((JB_GPRS+1)*8)(r3) - lfd fp15,((JB_FPRS+1)*8)(r3) + ld r15,((JB_GPRS+1)*8)(r3) + lfd fp15,((JB_FPRS+1)*8)(r3) @@ -151,7 +151,7 @@ - PTR_DEMANGLE2 (r0, r25) + PTR_DEMANGLE2 (r0, r25) #endif - mtlr r0 + mtlr r0 -/* std r2,40(r1) Restore the TOC save area. */ +/* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */ - ld r21,((JB_GPRS+7)*8)(r3) - lfd fp21,((JB_FPRS+7)*8)(r3) - ld r22,((JB_GPRS+8)*8)(r3) + ld r21,((JB_GPRS+7)*8)(r3) + lfd fp21,((JB_FPRS+7)*8)(r3) + ld r22,((JB_GPRS+8)*8)(r3) diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:10:00.000000000 -0500 @@ -66,8 +66,8 @@ BODY_LABEL (_init): - LOCALENTRY(_init) - mflr 0 + LOCALENTRY(_init) + mflr 0 - std 0, 16(r1) - stdu r1, -112(r1) + std 0, FRAME_LR_SAVE(r1) + stdu r1, -FRAME_MIN_SIZE_PARM(r1) #if PREINIT_FUNCTION_WEAK - addis r9, r2, .LC0@toc@ha - ld r0, .LC0@toc@l(r9) + addis r9, r2, .LC0@toc@ha + ld r0, .LC0@toc@l(r9) @@ -84,5 +84,5 @@ BODY_LABEL (_fini): - LOCALENTRY(_fini) - mflr 0 + LOCALENTRY(_fini) + mflr 0 - std 0, 16(r1) - stdu r1, -112(r1) + std 0, FRAME_LR_SAVE(r1) @@ -179,29 +179,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S glibc-2.17-c758a6 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S 2014-05-29 14:10:00.000000000 -0500 @@ -39,13 +39,13 @@ #include - - .section .init,"ax",@progbits + + .section .init,"ax",@progbits - addi r1, r1, 112 - ld r0, 16(r1) + addi r1, r1, FRAME_MIN_SIZE_PARM + ld r0, FRAME_LR_SAVE(r1) - mtlr r0 - blr - - .section .fini,"ax",@progbits + mtlr r0 + blr + + .section .fini,"ax",@progbits - addi r1, r1, 112 - ld r0, 16(r1) + addi r1, r1, FRAME_MIN_SIZE_PARM + ld r0, FRAME_LR_SAVE(r1) - mtlr r0 - blr + mtlr r0 + blr diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:10:00.000000000 -0500 @@ -26,13 +26,13 @@ parm1 (r3) and the index (r0) need to be converted to an offset (index * 24) in parm2 (r4). */ - + -#define FRAME_SIZE 176 +#define FRAME_SIZE (FRAME_MIN_SIZE+64) /* We need to save the registers used to pass parameters, ie. r3 thru @@ -212,60 +212,60 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. -#define INT_PARMS 112 +#define INT_PARMS FRAME_MIN_SIZE EALIGN(_dl_runtime_resolve, 4, 0) - stdu r1,-FRAME_SIZE(r1) - cfi_adjust_cfa_offset (FRAME_SIZE) + stdu r1,-FRAME_SIZE(r1) + cfi_adjust_cfa_offset (FRAME_SIZE) @@ -48,25 +48,25 @@ - mflr r0 - std r8,INT_PARMS+40(r1) + mflr r0 + std r8,INT_PARMS+40(r1) /* Store the LR in the LR Save area. */ - std r0,FRAME_SIZE+16(r1) - cfi_offset (lr, 16) + std r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) - mfcr r0 - std r9,INT_PARMS+48(r1) - std r10,INT_PARMS+56(r1) + mfcr r0 + std r9,INT_PARMS+48(r1) + std r10,INT_PARMS+56(r1) /* I'm almost certain we don't have to save cr... be safe. */ - std r0,FRAME_SIZE+8(r1) + std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - bl JUMPTARGET(_dl_fixup) + bl JUMPTARGET(_dl_fixup) #ifndef SHARED - nop + nop #endif /* Put the registers back. */ - ld r0,FRAME_SIZE+16(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - ld r10,INT_PARMS+56(r1) - ld r9,INT_PARMS+48(r1) - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r10,INT_PARMS+56(r1) + ld r9,INT_PARMS+48(r1) + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+8(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) @@ -76,7 +76,7 @@ - ld r3,INT_PARMS+0(r1) + ld r3,INT_PARMS+0(r1) #if _CALL_ELF == 2 /* Restore the caller's TOC in case we jump to a local entry point. */ - ld r2,FRAME_SIZE+40(r1) + ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1) #endif /* Unwind the stack frame, and jump. */ - addi r1,r1,FRAME_SIZE + addi r1,r1,FRAME_SIZE @@ -86,6 +86,7 @@ #undef INT_PARMS - - /* Stack layout: + + /* Stack layout: + (Note: some of these are not required for the ELFv2 ABI.) - +592 previous backchain - +584 spill_r31 - +576 spill_r30 + +592 previous backchain + +584 spill_r31 + +576 spill_r30 @@ -147,10 +148,11 @@ - +64 parm3 - +56 parm2 - +48 parm1 + +64 parm3 + +56 parm2 + +48 parm1 - * Parameter save area, Allocated by the call, at least 8 double words - +40 TOC save area - +32 Reserved for linker @@ -275,101 +275,101 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + +40 v1 ABI: TOC save area + +32 v1 ABI: Reserved for linker + +24 v1 ABI: Reserved for compiler / v2 ABI: TOC save area - +16 LR save area - +8 CR save area - r1+0 stack back chain + +16 LR save area + +8 CR save area + r1+0 stack back chain @@ -206,15 +208,15 @@ /* Store the LR in the LR Save area of the previous frame. */ /* XXX Do we have to do this? */ - la r8,FRAME_SIZE(r1) + la r8,FRAME_SIZE(r1) - std r5,FRAME_SIZE+16(r1) - cfi_offset (lr, 16) + std r5,FRAME_SIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) - std r5,CALLING_LR(r1) - mfcr r0 - std r9,INT_PARMS+48(r1) - std r10,INT_PARMS+56(r1) - std r8,CALLING_SP(r1) + std r5,CALLING_LR(r1) + mfcr r0 + std r9,INT_PARMS+48(r1) + std r10,INT_PARMS+56(r1) + std r8,CALLING_SP(r1) /* I'm almost certain we don't have to save cr... be safe. */ - std r0,FRAME_SIZE+8(r1) + std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r12,.LC__dl_hwcap@toc(r2) + ld r12,.LC__dl_hwcap@toc(r2) #ifdef SHARED - /* Load _rtld_local_ro._dl_hwcap. */ + /* Load _rtld_local_ro._dl_hwcap. */ @@ -311,13 +313,13 @@ - lvx v12,r11,r10 - lvx v13,r11,r9 + lvx v12,r11,r10 + lvx v13,r11,r9 L(restoreFXR): - ld r0,FRAME_SIZE+16(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - ld r10,INT_PARMS+56(r1) - ld r9,INT_PARMS+48(r1) - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r10,INT_PARMS+56(r1) + ld r9,INT_PARMS+48(r1) + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+8(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) @@ -327,7 +329,7 @@ - ld r3,INT_PARMS+0(r1) + ld r3,INT_PARMS+0(r1) #if _CALL_ELF == 2 /* Restore the caller's TOC in case we jump to a local entry point. */ - ld r2,FRAME_SIZE+40(r1) + ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1) #endif /* Load the floating point registers. */ - lfd fp1,FPR_PARMS+0(r1) + lfd fp1,FPR_PARMS+0(r1) @@ -375,19 +377,19 @@ - lvx v12,r11,r10 - lvx v13,r11,r9 + lvx v12,r11,r10 + lvx v13,r11,r9 L(restoreFXR2): - ld r0,FRAME_SIZE+16(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - ld r10,INT_PARMS+56(r1) - ld r9,INT_PARMS+48(r1) - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r10,INT_PARMS+56(r1) + ld r9,INT_PARMS+48(r1) + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+8(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) + mtcrf 0xFF,r0 /* Prepare for calling the function returned by fixup. */ - std r2,40(r1) + std r2,FRAME_TOC_SAVE(r1) - PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + PPC64_LOAD_FUNCPTR r3 + ld r3,INT_PARMS+0(r1) /* Load the floating point registers. */ @@ -406,7 +408,7 @@ - lfd fp13,FPR_PARMS+96(r1) + lfd fp13,FPR_PARMS+96(r1) /* Call the target function. */ - bctrl + bctrl - ld r2,40(r1) + ld r2,FRAME_TOC_SAVE(r1) - lwz r12,VR_VRSAVE(r1) + lwz r12,VR_VRSAVE(r1) /* But return here and store the return values. */ - std r3,INT_RTN(r1) + std r3,INT_RTN(r1) @@ -441,7 +443,7 @@ - beq L(pltexitreturn) - lvx v2,0,r10 + beq L(pltexitreturn) + lvx v2,0,r10 L(pltexitreturn): - ld r0,FRAME_SIZE+16(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - ld r31,584(r1) - ld r30,576(r1) - mtlr r0 + ld r31,584(r1) + ld r30,576(r1) + mtlr r0 diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:10:00.000000000 -0500 @@ -24,16 +24,16 @@ ENTRY(_mcount) - mflr r4 - ld r11, 0(r1) + mflr r4 + ld r11, 0(r1) - stdu r1,-112(r1) - cfi_adjust_cfa_offset (112) - std r4, 128(r1) @@ -380,16 +380,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17- + std r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) + ld r3, FRAME_LR_SAVE(r11) - bl JUMPTARGET(__mcount_internal) - nop + bl JUMPTARGET(__mcount_internal) + nop - ld r0, 128(r1) + ld r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) - mtlr r0 + mtlr r0 - addi r1,r1,112 + addi r1,r1,FRAME_MIN_SIZE - blr + blr END(_mcount) - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 14:10:00.000000000 -0500 @@ -399,22 +399,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2. ENTRY (__GI__setjmp) - std r2,40(r1) /* Save the callers TOC in the save area. */ + std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */ - CALL_MCOUNT 1 - li r4,0 /* Set second argument to 0. */ - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) + CALL_MCOUNT 1 + li r4,0 /* Set second argument to 0. */ + b JUMPTARGET (GLUE(__sigsetjmp,_ent)) @@ -83,7 +83,7 @@ #endif - mflr r0 + mflr r0 #if defined SHARED && !defined IS_IN_rtld - ld r5,40(r1) /* Retrieve the callers TOC. */ + ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */ - std r5,(JB_GPR2*8)(3) + std r5,(JB_GPR2*8)(3) #else - std r2,(JB_GPR2*8)(3) + std r2,(JB_GPR2*8)(3) @@ -219,14 +219,14 @@ - b JUMPTARGET (__sigjmp_save) + b JUMPTARGET (__sigjmp_save) #else - mflr r0 + mflr r0 - std r0,16(r1) - stdu r1,-112(r1) - cfi_adjust_cfa_offset(112) @@ -423,22 +423,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2. + stdu r1,-FRAME_MIN_SIZE(r1) + cfi_adjust_cfa_offset(FRAME_MIN_SIZE) + cfi_offset(lr,FRAME_LR_SAVE) - bl JUMPTARGET (__sigjmp_save) - nop + bl JUMPTARGET (__sigjmp_save) + nop - ld r0,112+16(r1) - addi r1,r1,112 + ld r0,FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) + addi r1,r1,FRAME_MIN_SIZE - mtlr r0 - blr + mtlr r0 + blr #endif diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:10:00.000000000 -0500 @@ -20,25 +20,67 @@ - + #ifdef __ASSEMBLER__ - + +/* Stack frame offsets. */ +#if _CALL_ELF != 2 +#define FRAME_MIN_SIZE 112 @@ -482,34 +482,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 +#else +#define call_mcount_parm_offset FRAME_PARM_SAVE +#endif - .macro SAVE_ARG NARG - .if \NARG - SAVE_ARG \NARG-1 + .macro SAVE_ARG NARG + .if \NARG + SAVE_ARG \NARG-1 - std 2+\NARG,40+8*(\NARG)(1) + std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1) - .endif - .endm - - .macro REST_ARG NARG - .if \NARG - REST_ARG \NARG-1 + .endif + .endm + + .macro REST_ARG NARG + .if \NARG + REST_ARG \NARG-1 - ld 2+\NARG,112+40+8*(\NARG)(1) + ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1) - .endif - .endm - - .macro CFI_SAVE_ARG NARG - .if \NARG - CFI_SAVE_ARG \NARG-1 + .endif + .endm + + .macro CFI_SAVE_ARG NARG + .if \NARG + CFI_SAVE_ARG \NARG-1 - cfi_offset(2+\NARG,40+8*(\NARG)) + cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG)) - .endif - .endm - + .endif + .endm + @@ -55,20 +97,20 @@ #ifdef PROF - mflr r0 - SAVE_ARG \NARG + mflr r0 + SAVE_ARG \NARG - std r0,16(r1) - stdu r1,-112(r1) - cfi_adjust_cfa_offset(112) @@ -518,21 +518,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758 + stdu r1,-FRAME_MIN_SIZE_PARM(r1) + cfi_adjust_cfa_offset(FRAME_MIN_SIZE_PARM) + cfi_offset(lr,FRAME_LR_SAVE) - CFI_SAVE_ARG \NARG - bl JUMPTARGET (_mcount) + CFI_SAVE_ARG \NARG + bl JUMPTARGET (_mcount) #ifndef SHARED - nop + nop #endif - ld r0,128(r1) + ld r0,FRAME_MIN_SIZE_PARM+FRAME_LR_SAVE(r1) - REST_ARG \NARG - mtlr r0 + REST_ARG \NARG + mtlr r0 - addi r1,r1,112 - cfi_adjust_cfa_offset(-112) + addi r1,r1,FRAME_MIN_SIZE_PARM + cfi_adjust_cfa_offset(-FRAME_MIN_SIZE_PARM) - cfi_restore(lr) - CFI_REST_ARG \NARG + cfi_restore(lr) + CFI_REST_ARG \NARG #endif @@ -267,15 +309,15 @@ .else; \ @@ -561,60 +561,60 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____long --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:10:00.000000000 -0500 @@ -33,24 +33,24 @@ - cmpld reg, r1; \ - bge+ .Lok; \ - mflr r0; \ + cmpld reg, r1; \ + bge+ .Lok; \ + mflr r0; \ - std r0,16(r1); \ + std r0,FRAME_LR_SAVE(r1); \ - mr r31,r3; \ - mr r30,r4; \ + mr r31,r3; \ + mr r30,r4; \ - stdu r1,-144(r1); \ + stdu r1,-FRAME_MIN_SIZE-32(r1); \ - cfi_remember_state; \ + cfi_remember_state; \ - cfi_adjust_cfa_offset (144); \ - cfi_offset (lr, 16); \ + cfi_adjust_cfa_offset (FRAME_MIN_SIZE+32); \ + cfi_offset (lr, FRAME_LR_SAVE); \ - li r3,0; \ + li r3,0; \ - addi r4,r1,112; \ + addi r4,r1,FRAME_MIN_SIZE; \ - li r0,__NR_sigaltstack; \ - sc; \ - /* Without working sigaltstack we cannot perform the test. */ \ - bso .Lok2; \ + li r0,__NR_sigaltstack; \ + sc; \ + /* Without working sigaltstack we cannot perform the test. */ \ + bso .Lok2; \ - lwz r0,112+8(r1); \ + lwz r0,FRAME_MIN_SIZE+8(r1); \ - andi. r4,r0,1; \ - beq .Lfail; \ + andi. r4,r0,1; \ + beq .Lfail; \ - ld r0,112+16(r1); \ - ld r4,112(r1); \ + ld r0,FRAME_MIN_SIZE+16(r1); \ + ld r4,FRAME_MIN_SIZE(r1); \ - add r4,r4,r0; \ - sub r3,r3,reg; \ - cmpld r3,r0; \ + add r4,r4,r0; \ + sub r3,r3,reg; \ + cmpld r3,r0; \ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:10:00.000000000 -0500 @@ -31,9 +31,9 @@ - CALL_MCOUNT 1 - DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */ - + CALL_MCOUNT 1 + DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */ + - std r3,48(r1) + std r3,-8(r1) - DO_CALL(SYS_ify(brk)) + DO_CALL(SYS_ify(brk)) - ld r6,48(r1) + ld r6,-8(r1) - ld r5,.LC__curbrk@toc(r2) - std r3,0(r5) - cmpld r6,r3 + ld r5,.LC__curbrk@toc(r2) + std r3,0(r5) + cmpld r6,r3 diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:10:00.000000000 -0500 @@ -45,22 +45,22 @@ - cror cr0*4+eq,cr1*4+eq,cr0*4+eq - beq- cr0,L(badargs) - + cror cr0*4+eq,cr1*4+eq,cr0*4+eq + beq- cr0,L(badargs) + - /* Save some regs in parm save area. */ + /* Save some regs in the "red zone". */ #ifdef RESET_PID @@ -633,33 +633,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S - cfi_offset(r31,64) + cfi_offset(r30,-16) + cfi_offset(r31,-8) - - /* Set up stack frame for child. */ - clrrdi r4,r4,4 - li r0,0 + + /* Set up stack frame for child. */ + clrrdi r4,r4,4 + li r0,0 - stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */ + stdu r0,-FRAME_MIN_SIZE_PARM(r4) - - /* Save fn, args, stack across syscall. */ - mr r30,r3 /* Function in r30. */ + + /* Save fn, args, stack across syscall. */ + mr r30,r3 /* Function in r30. */ @@ -102,12 +102,12 @@ L(oldpid): #endif - + - std r2,40(r1) + std r2,FRAME_TOC_SAVE(r1) - /* Call procedure. */ - PPC64_LOAD_FUNCPTR r30 - mr r3,r31 - bctrl + /* Call procedure. */ + PPC64_LOAD_FUNCPTR r30 + mr r3,r31 + bctrl - ld r2,40(r1) + ld r2,FRAME_TOC_SAVE(r1) - /* Call _exit with result from procedure. */ + /* Call _exit with result from procedure. */ #ifdef SHARED - b JUMPTARGET(__GI__exit) + b JUMPTARGET(__GI__exit) @@ -126,15 +126,15 @@ L(parent): - /* Parent. Restore registers & return. */ + /* Parent. Restore registers & return. */ #ifdef RESET_PID - cfi_offset(r29,48) + cfi_offset(r29,-24) @@ -677,7 +677,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S + ld r30,-16(r1) + ld r31,-8(r1) #ifdef RESET_PID - cfi_restore(r29) + cfi_restore(r29) #endif diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2014-05-29 14:09:56.000000000 -0500 @@ -685,7 +685,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S @@ -46,8 +46,13 @@ # endif #endif - + -#define FRAMESIZE 128 -#define stackblock FRAMESIZE+48 /* offset to parm save area. */ +#if _CALL_ELF == 2 @@ -695,24 +695,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S +#define FRAMESIZE (FRAME_MIN_SIZE+16) +#define stackblock (FRAMESIZE+FRAME_PARM_SAVE) /* offset to parm save area. */ +#endif - - .text + + .text ENTRY(__socket) @@ -98,22 +103,22 @@ .Lsocket_cancel: - cfi_adjust_cfa_offset(FRAMESIZE) - mflr r9 + cfi_adjust_cfa_offset(FRAMESIZE) + mflr r9 - std r9,FRAMESIZE+16(r1) - cfi_offset (lr, 16) + std r9,FRAMESIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) - CENABLE + CENABLE - std r3,120(r1) + std r3,FRAME_MIN_SIZE+8(r1) - li r3,P(SOCKOP_,socket) - addi r4,r1,stackblock - DO_CALL(SYS_ify(socketcall)) - mfcr r0 + li r3,P(SOCKOP_,socket) + addi r4,r1,stackblock + DO_CALL(SYS_ify(socketcall)) + mfcr r0 - std r3,112(r1) - std r0,FRAMESIZE+8(r1) - cfi_offset (cr, 8) @@ -721,23 +721,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S + std r0,FRAMESIZE+FRAME_CR_SAVE(r1) + cfi_offset (cr, FRAME_CR_SAVE) + ld r3,FRAME_MIN_SIZE+8(r1) - CDISABLE + CDISABLE - ld r4,FRAMESIZE+16(r1) - ld r0,FRAMESIZE+8(r1) - ld r3,112(r1) + ld r4,FRAMESIZE+FRAME_LR_SAVE(r1) + ld r0,FRAMESIZE+FRAME_CR_SAVE(r1) + ld r3,FRAME_MIN_SIZE(r1) - mtlr r4 - mtcr r0 - addi r1,r1,FRAMESIZE + mtlr r4 + mtcr r0 + addi r1,r1,FRAMESIZE diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:09:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:10:00.000000000 -0500 @@ -8,27 +8,6 @@ SIG_SETMASK - - + + --- Offsets of the fields in the powerpc64 ABI stack frame. --- XXX Do these correspond to some struct? - diff --git a/SOURCES/glibc-ppc64le-42.patch b/SOURCES/glibc-ppc64le-42.patch index 06d5db1d..f5fa53ee 100644 --- a/SOURCES/glibc-ppc64le-42.patch +++ b/SOURCES/glibc-ppc64le-42.patch @@ -1,47 +1,47 @@ # commit 61cd8fe4017c251617dd300818917e61a12ab48e # Author: Ulrich Weigand # Date: Wed Dec 4 06:59:37 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 5/6: LD_AUDIT interface changes -# +# # The ELFv2 ABI changes the calling convention by passing and returning # structures in registers in more cases than the old ABI: # http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01145.html # http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01147.html -# +# # For the most part, this does not affect glibc, since glibc assembler # files do not use structure parameters / return values. However, one # place is affected: the LD_AUDIT interface provides a structure to # the audit routine that contains all registers holding function # argument and return values for the intercepted PLT call. -# +# # Since the new ABI now sometimes uses registers to return values # that were never used for this purpose in the old ABI, this structure # has to be extended. To force audit routines to be modified for the # new ABI if necessary, the patch defines v2 variants of the la_ppc64 # types and routines. -# +# # In addition, the patch contains two unrelated changes to the # PLT trampoline routines: it fixes a bug where FPR return values # were stored in the wrong place, and it removes the unnecessary # save/restore of CR. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/bits/link.h glibc-2.17-c758a686/sysdeps/powerpc/bits/link.h --- glibc-2.17-c758a686/sysdeps/powerpc/bits/link.h 2014-05-29 14:11:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/bits/link.h 2014-05-29 14:11:20.000000000 -0500 @@ -63,7 +63,7 @@ - + __END_DECLS - + -#else +#elif _CALL_ELF != 2 - + /* Registers for entry into PLT on PPC64. */ typedef struct La_ppc64_regs @@ -107,4 +107,48 @@ - + __END_DECLS - + +#else + +/* Registers for entry into PLT on PPC64 in the ELFv2 ABI. */ @@ -96,13 +96,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/ldsodefs.h glibc-2.17-c758a686/sys struct La_ppc64_retval; +struct La_ppc64v2_regs; +struct La_ppc64v2_retval; - + #define ARCH_PLTENTER_MEMBERS \ Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \ @@ -34,7 +36,12 @@ Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *, \ - uintptr_t *, struct La_ppc64_regs *, \ - unsigned int *, const char *name, \ + uintptr_t *, struct La_ppc64_regs *, \ + unsigned int *, const char *name, \ - long int *framesizep) + long int *framesizep); \ + Elf64_Addr (*ppc64v2_gnu_pltenter) (Elf64_Sym *, unsigned int, \ @@ -110,13 +110,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/ldsodefs.h glibc-2.17-c758a686/sys + struct La_ppc64v2_regs *, \ + unsigned int *, const char *name, \ + long int *framesizep) - + #define ARCH_PLTEXIT_MEMBERS \ unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, \ @@ -47,7 +54,14 @@ - uintptr_t *, \ - uintptr_t *, \ - const struct La_ppc64_regs *, \ + uintptr_t *, \ + uintptr_t *, \ + const struct La_ppc64_regs *, \ - struct La_ppc64_retval *, const char *) + struct La_ppc64_retval *, \ + const char *); \ @@ -126,15 +126,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/ldsodefs.h glibc-2.17-c758a686/sys + const struct La_ppc64v2_regs *,\ + struct La_ppc64v2_retval *, \ + const char *) - + #include_next - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 14:11:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 14:11:20.000000000 -0500 @@ -546,8 +546,13 @@ - - + + /* Names of the architecture-specific auditing callback functions. */ +#if _CALL_ELF != 2 #define ARCH_LA_PLTENTER ppc64_gnu_pltenter @@ -143,40 +143,40 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- +#define ARCH_LA_PLTENTER ppc64v2_gnu_pltenter +#define ARCH_LA_PLTEXIT ppc64v2_gnu_pltexit +#endif - + #endif /* dl_machine_h */ - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:11:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:11:20.000000000 -0500 @@ -50,11 +50,8 @@ /* Store the LR in the LR Save area. */ - std r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - cfi_offset (lr, FRAME_LR_SAVE) + std r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) - mfcr r0 - std r9,INT_PARMS+48(r1) - std r10,INT_PARMS+56(r1) + std r9,INT_PARMS+48(r1) + std r10,INT_PARMS+56(r1) -/* I'm almost certain we don't have to save cr... be safe. */ - std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - bl JUMPTARGET(_dl_fixup) + bl JUMPTARGET(_dl_fixup) #ifndef SHARED - nop + nop @@ -66,11 +63,9 @@ - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 /* Prepare for calling the function returned by fixup. */ - PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + PPC64_LOAD_FUNCPTR r3 + ld r3,INT_PARMS+0(r1) @@ -85,18 +80,30 @@ #undef FRAME_SIZE #undef INT_PARMS - + - /* Stack layout: - (Note: some of these are not required for the ELFv2 ABI.) - +592 previous backchain @@ -213,13 +213,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + +528 fp1 +528 fp1 + +520 r4 +520 r4 + +512 r3 +512 r3 - return values + return values +504 free - +496 stackframe + +496 stackframe @@ -157,10 +164,15 @@ - +8 CR save area - r1+0 stack back chain - */ + +8 CR save area + r1+0 stack back chain + */ -#define FRAME_SIZE 592 +#if _CALL_ELF == 2 +# define FRAME_SIZE 752 @@ -235,73 +235,73 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. #define CALLING_LR 488 #define CALLING_SP 480 @@ -205,18 +217,14 @@ - mflr r5 - std r7,INT_PARMS+32(r1) - std r8,INT_PARMS+40(r1) + mflr r5 + std r7,INT_PARMS+32(r1) + std r8,INT_PARMS+40(r1) -/* Store the LR in the LR Save area of the previous frame. */ -/* XXX Do we have to do this? */ +/* Store the LR in the LR Save area. */ - la r8,FRAME_SIZE(r1) - std r5,FRAME_SIZE+FRAME_LR_SAVE(r1) - cfi_offset (lr, FRAME_LR_SAVE) - std r5,CALLING_LR(r1) + la r8,FRAME_SIZE(r1) + std r5,FRAME_SIZE+FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) + std r5,CALLING_LR(r1) - mfcr r0 - std r9,INT_PARMS+48(r1) - std r10,INT_PARMS+56(r1) - std r8,CALLING_SP(r1) + std r9,INT_PARMS+48(r1) + std r10,INT_PARMS+56(r1) + std r8,CALLING_SP(r1) -/* I'm almost certain we don't have to save cr... be safe. */ - std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r12,.LC__dl_hwcap@toc(r2) + ld r12,.LC__dl_hwcap@toc(r2) #ifdef SHARED - /* Load _rtld_local_ro._dl_hwcap. */ + /* Load _rtld_local_ro._dl_hwcap. */ @@ -319,11 +327,9 @@ - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 /* Prepare for calling the function returned by fixup. */ - PPC64_LOAD_FUNCPTR r3 - ld r3,INT_PARMS+0(r1) + PPC64_LOAD_FUNCPTR r3 + ld r3,INT_PARMS+0(r1) @@ -346,10 +352,11 @@ - lfd fp12,FPR_PARMS+88(r1) - lfd fp13,FPR_PARMS+96(r1) + lfd fp12,FPR_PARMS+88(r1) + lfd fp13,FPR_PARMS+96(r1) /* Unwind the stack frame, and jump. */ - ld r31,584(r1) - ld r30,576(r1) + ld r31,FRAME_SIZE-8(r1) + ld r30,FRAME_SIZE-16(r1) - addi r1,r1,FRAME_SIZE - bctr + addi r1,r1,FRAME_SIZE + bctr + L(do_pltexit): - la r10,(VR_PARMS+0)(r1) - la r9,(VR_PARMS+16)(r1) + la r10,(VR_PARMS+0)(r1) + la r9,(VR_PARMS+16)(r1) @@ -383,11 +390,9 @@ - ld r8,INT_PARMS+40(r1) - ld r7,INT_PARMS+32(r1) - mtlr r0 + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r6,INT_PARMS+24(r1) - ld r5,INT_PARMS+16(r1) - ld r4,INT_PARMS+8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) - mtcrf 0xFF,r0 /* Prepare for calling the function returned by fixup. */ - std r2,FRAME_TOC_SAVE(r1) - PPC64_LOAD_FUNCPTR r3 + std r2,FRAME_TOC_SAVE(r1) + PPC64_LOAD_FUNCPTR r3 @@ -413,16 +418,37 @@ /* But return here and store the return values. */ - std r3,INT_RTN(r1) - std r4,INT_RTN+8(r1) + std r3,INT_RTN(r1) + std r4,INT_RTN+8(r1) - stfd fp1,FPR_PARMS+0(r1) - stfd fp2,FPR_PARMS+8(r1) + stfd fp1,FPR_RTN+0(r1) + stfd fp2,FPR_RTN+8(r1) - cmpdi cr0,r12,0 - la r10,VR_RTN(r1) + cmpdi cr0,r12,0 + la r10,VR_RTN(r1) - stfd fp3,FPR_PARMS+16(r1) - stfd fp4,FPR_PARMS+24(r1) + stfd fp3,FPR_RTN+16(r1) @@ -317,10 +317,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + stfd fp9,FPR_RTN+64(r1) + stfd fp10,FPR_RTN+72(r1) +#endif - mr r3,r31 - mr r4,r30 - beq L(callpltexit) - stvx v2,0,r10 + mr r3,r31 + mr r4,r30 + beq L(callpltexit) + stvx v2,0,r10 +#if _CALL_ELF == 2 + stvx v3,0,r12 + stvx v4,r5,r10 @@ -332,17 +332,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + stvx v9,r5,r12 +#endif L(callpltexit): - addi r5,r1,INT_PARMS - addi r6,r1,INT_RTN + addi r5,r1,INT_PARMS + addi r6,r1,INT_RTN @@ -434,18 +460,39 @@ - lwz r12,VR_VRSAVE(r1) - ld r3,INT_RTN(r1) - ld r4,INT_RTN+8(r1) + lwz r12,VR_VRSAVE(r1) + ld r3,INT_RTN(r1) + ld r4,INT_RTN+8(r1) - lfd fp1,FPR_PARMS+0(r1) - lfd fp2,FPR_PARMS+8(r1) + lfd fp1,FPR_RTN+0(r1) + lfd fp2,FPR_RTN+8(r1) - cmpdi cr0,r12,0 + cmpdi cr0,r12,0 - la r10,VR_RTN(r1) - lfd fp3,FPR_PARMS+16(r1) - lfd fp4,FPR_PARMS+24(r1) @@ -360,7 +360,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + lfd fp9,FPR_RTN+64(r1) + lfd fp10,FPR_RTN+72(r1) +#endif - beq L(pltexitreturn) + beq L(pltexitreturn) - lvx v2,0,r10 + lvx v2,0,r11 +#if _CALL_ELF == 2 @@ -374,21 +374,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2. + lvx v9,r30,r12 +#endif L(pltexitreturn): - ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) - ld r31,584(r1) - ld r30,576(r1) + ld r31,FRAME_SIZE-8(r1) + ld r30,FRAME_SIZE-16(r1) - mtlr r0 - ld r1,0(r1) - blr + mtlr r0 + ld r1,0(r1) + blr diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:20.000000000 -0500 @@ -18,8 +18,16 @@ License along with the GNU C Library. If not, see . */ - + +#if _CALL_ELF != 2 #define pltenter la_ppc64_gnu_pltenter #define pltexit la_ppc64_gnu_pltexit diff --git a/SOURCES/glibc-ppc64le-43.patch b/SOURCES/glibc-ppc64le-43.patch index a480c02f..8c43abb5 100644 --- a/SOURCES/glibc-ppc64le-43.patch +++ b/SOURCES/glibc-ppc64le-43.patch @@ -1,23 +1,23 @@ # commit 5b118558f9fb0620508d51c34c2cb5ba4f1f01c2 # Author: Ulrich Weigand # Date: Wed Dec 4 07:08:48 2013 -0600 -# +# # PowerPC64 ELFv2 ABI 6/6: Bump ld.so soname version number -# +# # To avoid having a ELFv2 binary accidentally picking up an old ABI ld.so, # this patch bumps the soname to ld64.so.2. -# +# # In theory (or for testing purposes) this will also allow co-installing # ld.so versions for both ABIs on the same system. Note that the kernel # will already be able to load executables of both ABIs. However, there # is currently no plan to use that theoretical possibility in a any # supported distribution environment ... -# +# # Note that in order to check which ABI to use, we need to invoke the # compiler to check the _CALL_ELF macro; this is done in a new configure # check in sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac, # replacing the hard-coded value of default-abi in the Makefile. -# +# diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile 2014-05-29 14:12:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile 2014-05-29 14:12:30.000000000 -0500 @@ -35,14 +35,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile glibc-2.1 +abi-64-v2-options := -D__powerpc64__ -U_CALL_ELF -D_CALL_ELF=2 +abi-64-v2-condition := __WORDSIZE == 64 && _CALL_ELF == 2 +abi-64-v2-ld-soname := ld64.so.2 - + ifeq ($(subdir),rt) librt-routines += rt-sysdep diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/ldconfig.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/ldconfig.h --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/ldconfig.h 2014-05-29 14:12:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/ldconfig.h 2014-05-29 14:12:30.000000000 -0500 @@ -20,7 +20,8 @@ - + #define SYSDEP_KNOWN_INTERPRETER_NAMES \ { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, \ - { "/lib64/ld64.so.1", FLAG_ELF_LIBC6 }, diff --git a/SOURCES/glibc-ppc64le-44.patch b/SOURCES/glibc-ppc64le-44.patch index a3468a8a..e074cb91 100644 --- a/SOURCES/glibc-ppc64le-44.patch +++ b/SOURCES/glibc-ppc64le-44.patch @@ -1,12 +1,12 @@ # commit c859b32e9d76afe8a3f20bb9528961a573c06937 # Author: Alan Modra # Date: Tue Apr 1 14:07:42 2014 +1030 -# +# # Fix s_copysign stack temp for PowerPC64 ELFv2 -# +# # [BZ #16786] # * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S 2014-05-29 14:13:47.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S 2014-05-29 14:13:50.000000000 -0500 @@ -16,11 +16,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S glibc-2 with the sign bit of y. */ - stfd fp2,56(r1) + stfd fp2,-8(r1) - nop - nop - nop + nop + nop + nop - ld r3,56(r1) + ld r3,-8(r1) - cmpdi r3,0 - blt L(0) - fabs fp1,fp1 + cmpdi r3,0 + blt L(0) + fabs fp1,fp1 diff --git a/SOURCES/glibc-rh1000923.patch b/SOURCES/glibc-rh1000923.patch index 2745a201..afc6f634 100644 --- a/SOURCES/glibc-rh1000923.patch +++ b/SOURCES/glibc-rh1000923.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Mon Aug 26 15:42:29 2013 +0530 Initialize res_hconf in nscd - + Fixes BZ #15890. diff -pruN glibc-2.17-c758a686/nscd/aicache.c glibc-2.17-c758a686/nscd/aicache.c @@ -14,19 +14,19 @@ diff -pruN glibc-2.17-c758a686/nscd/aicache.c glibc-2.17-c758a686/nscd/aicache.c #include #include +#include - + #include "dbg_log.h" #include "nscd.h" @@ -100,8 +101,11 @@ addhstaiX (struct database_dyn *db, int no_more = __nss_database_lookup ("hosts", NULL, - "dns [!UNAVAIL=return] files", &nip); - + "dns [!UNAVAIL=return] files", &nip); + + /* Initialize configurations. */ + if (__builtin_expect (!_res_hconf.initialized, 0)) + _res_hconf_init (); if (__res_maybe_init (&_res, 0) == -1) - no_more = 1; + no_more = 1; - + /* If we are looking for both IPv4 and IPv6 address we don't want the lookup functions to automatically promote IPv4 addresses to diff --git a/SOURCES/glibc-rh1008298.patch b/SOURCES/glibc-rh1008298.patch index 024957dd..9d7b35ce 100644 --- a/SOURCES/glibc-rh1008298.patch +++ b/SOURCES/glibc-rh1008298.patch @@ -5,7 +5,7 @@ index 3148c5f..f7718a9 100644 @@ -3015,6 +3015,13 @@ __libc_memalign(size_t alignment, size_t bytes) /* Otherwise, ensure that it is at least a minimum chunk size */ if (alignment < MINSIZE) alignment = MINSIZE; - + + /* Check for overflow. */ + if (bytes > SIZE_MAX - alignment - MINSIZE) + { @@ -17,9 +17,9 @@ index 3148c5f..f7718a9 100644 if(!ar_ptr) return 0; @@ -3046,6 +3046,13 @@ __libc_valloc(size_t bytes) - + size_t pagesz = GLRO(dl_pagesize); - + + /* Check for overflow. */ + if (bytes > SIZE_MAX - pagesz - MINSIZE) + { @@ -28,12 +28,12 @@ index 3148c5f..f7718a9 100644 + } + __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t, - const __malloc_ptr_t)) = + const __malloc_ptr_t)) = force_reg (__memalign_hook); @@ -3082,6 +3082,13 @@ __libc_pvalloc(size_t bytes) size_t page_mask = GLRO(dl_pagesize) - 1; size_t rounded_bytes = (bytes + page_mask) & ~(page_mask); - + + /* Check for overflow. */ + if (bytes > SIZE_MAX - 2*pagesz - MINSIZE) + { @@ -42,5 +42,5 @@ index 3148c5f..f7718a9 100644 + } + __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t, - const __malloc_ptr_t)) = + const __malloc_ptr_t)) = force_reg (__memalign_hook); diff --git a/SOURCES/glibc-rh1020637.patch b/SOURCES/glibc-rh1020637.patch index 5493a038..9d4561a3 100644 --- a/SOURCES/glibc-rh1020637.patch +++ b/SOURCES/glibc-rh1020637.patch @@ -22,14 +22,14 @@ index 68a5af4..52192a2 100644 --- glibc-2.17-c758a686/sysdeps/s390/dl-tls.h +++ glibc-2.17-c758a686/sysdeps/s390/dl-tls.h @@ -26,11 +26,26 @@ typedef struct - - + + #ifdef SHARED -/* This is the prototype for the GNU version. */ -extern void *__tls_get_addr (tls_index *ti) attribute_hidden; + extern unsigned long __tls_get_offset (unsigned long got_offset); - + # ifdef IS_IN_rtld + +# include @@ -58,10 +58,10 @@ index 68a5af4..52192a2 100644 +# else /* IS_IN_rtld */ +extern void *__tls_get_addr_internal (tls_index *ti); +# endif /* !IS_IN_rtld */ - + # define GET_ADDR_OFFSET \ (ti->ti_offset - (unsigned long) __builtin_thread_pointer ()) - + -# define __TLS_GET_ADDR(__ti) \ - ({ extern char _GLOBAL_OFFSET_TABLE_[] attribute_hidden; \ - (void *) __tls_get_offset ((char *) (__ti) - _GLOBAL_OFFSET_TABLE_) \ @@ -74,15 +74,15 @@ index 68a5af4..52192a2 100644 +# define __TLS_GET_ADDR(__ti) \ + ({ (void *) __tls_get_addr_internal ((char *) (__ti)) \ + + (unsigned long) __builtin_thread_pointer (); }) - + #endif - + diff --git glibc-2.17-c758a686/sysdeps/s390/s390-32/tls-macros.h glibc-2.17-c758a686/sysdeps/s390/s390-32/tls-macros.h index 8a0ad58..a592d81 100644 --- glibc-2.17-c758a686/sysdeps/s390/s390-32/tls-macros.h +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/tls-macros.h @@ -8,12 +8,15 @@ - + #ifdef PIC # define TLS_IE(x) \ - ({ unsigned long __offset; \ @@ -107,7 +107,7 @@ index be8aa6c..3c59436 100644 --- glibc-2.17-c758a686/sysdeps/s390/s390-64/tls-macros.h +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/tls-macros.h @@ -8,12 +8,13 @@ - + #ifdef PIC # define TLS_IE(x) \ - ({ unsigned long __offset; \ diff --git a/SOURCES/glibc-rh1025612.patch b/SOURCES/glibc-rh1025612.patch index 3e2f6e68..93ab27df 100644 --- a/SOURCES/glibc-rh1025612.patch +++ b/SOURCES/glibc-rh1025612.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Fri Oct 25 10:22:12 2013 +0530 Fix stack overflow due to large AF_INET6 requests - + Resolves #16072 (CVE-2013-4458). - + This patch fixes another stack overflow in getaddrinfo when it is called with AF_INET6. The AF_UNSPEC case was fixed as CVE-2013-1914, but the AF_INET6 case went undetected back then. @@ -15,7 +15,7 @@ index e6ce4cf..8ff74b4 100644 --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, - &rc, &herrno, NULL, &localcanon)); \ + &rc, &herrno, NULL, &localcanon)); \ if (rc != ERANGE || herrno != NETDB_INTERNAL) \ break; \ - tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \ @@ -39,12 +39,12 @@ index e6ce4cf..8ff74b4 100644 if (status == NSS_STATUS_SUCCESS && rc == 0) \ h = &th; \ @@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, - { \ - __set_h_errno (herrno); \ - _res.options |= old_res_options & RES_USE_INET6; \ + { \ + __set_h_errno (herrno); \ + _res.options |= old_res_options & RES_USE_INET6; \ - return -EAI_SYSTEM; \ + result = -EAI_SYSTEM; \ + goto free_and_return; \ - } \ + } \ if (herrno == TRY_AGAIN) \ - no_data = EAI_AGAIN; \ + no_data = EAI_AGAIN; \ diff --git a/SOURCES/glibc-rh1025934.patch b/SOURCES/glibc-rh1025934.patch index 47302ad2..37758d9b 100644 --- a/SOURCES/glibc-rh1025934.patch +++ b/SOURCES/glibc-rh1025934.patch @@ -13,7 +13,7 @@ index 0866c44..ba55b04 100644 @@ -44,35 +44,31 @@ /* Global variable to tell if the kernel has SELinux support. */ int selinux_enabled; - + -/* Define mappings of access vector permissions to request types. */ -static const access_vector_t perms[LASTREQ] = +/* Define mappings of request type to AVC permission name. */ @@ -68,11 +68,11 @@ index 0866c44..ba55b04 100644 + [INNETGR] = "getnetgrp", + [GETFDNETGR] = "shmemnetgrp", }; - + /* Store an entry ref to speed AVC decisions. */ @@ -344,7 +340,18 @@ nscd_avc_init (void) - - + + /* Check the permission from the caller (via getpeercon) to nscd. - Returns 0 if access is allowed, 1 if denied, and -1 on error. */ + Returns 0 if access is allowed, 1 if denied, and -1 on error. @@ -121,13 +121,13 @@ index 0866c44..ba55b04 100644 + found and AVC does not deny unknown values then allow it. */ + if ((sc_nscd == 0 || perm == 0) && avc_deny_unknown == 0) + return 0; - + if (getpeercon (fd, &scon) < 0) { @@ -372,15 +406,7 @@ nscd_request_avc_has_perm (int fd, request_type req) goto out; } - + -#ifndef NSCD__GETSERV - if (perms[req] == 0) - { @@ -138,6 +138,6 @@ index 0866c44..ba55b04 100644 - - rc = avc_has_perm (ssid, tsid, SECCLASS_NSCD, perms[req], &aeref, NULL) < 0; + rc = avc_has_perm (ssid, tsid, sc_nscd, perm, &aeref, NULL) < 0; - + out: if (scon) diff --git a/SOURCES/glibc-rh1027101.patch b/SOURCES/glibc-rh1027101.patch index ffee8427..2b419c98 100644 --- a/SOURCES/glibc-rh1027101.patch +++ b/SOURCES/glibc-rh1027101.patch @@ -3,16 +3,16 @@ Author: Maxim Kuvyrkov Date: Tue Dec 24 09:44:50 2013 +1300 Fix race in free() of fastbin chunk: BZ #15073 - + Perform sanity check only if we have_lock. Due to lockless nature of fastbins we need to be careful derefencing pointers to fastbin entries (chunksize(old) in this case) in multithreaded environments. - + The fix is to add have_lock to the if-condition checks. The rest of the patch only makes code more readable. - - * malloc/malloc.c (_int_free): Perform sanity check only if we - have_lock. + + * malloc/malloc.c (_int_free): Perform sanity check only if we + have_lock. Index: b/malloc/malloc.c =================================================================== @@ -21,7 +21,7 @@ Index: b/malloc/malloc.c @@ -3909,25 +3909,29 @@ _int_free(mstate av, mchunkptr p, int ha unsigned int idx = fastbin_index(size); fb = &fastbin (av, idx); - + - mchunkptr fd; - mchunkptr old = *fb; + /* Atomically link P to its fastbin: P->FD = *FB; *FB = P; */ @@ -33,26 +33,26 @@ Index: b/malloc/malloc.c - record we are going to add (i.e., double free). */ + /* Check that the top of the bin is not the record we are going to add + (i.e., double free). */ - if (__builtin_expect (old == p, 0)) - { - errstr = "double free or corruption (fasttop)"; - goto errout; - } + if (__builtin_expect (old == p, 0)) + { + errstr = "double free or corruption (fasttop)"; + goto errout; + } - if (old != NULL) + /* Check that size of fastbin chunk at the top is the same as + size of the chunk that we are adding. We can dereference OLD + only if we have the lock, otherwise it might have already been + deallocated. See use of OLD_IDX below for the actual check. */ + if (have_lock && old != NULL) - old_idx = fastbin_index(chunksize(old)); + old_idx = fastbin_index(chunksize(old)); - p->fd = fd = old; + p->fd = old2 = old; } - while ((old = catomic_compare_and_exchange_val_rel (fb, p, fd)) != fd); + while ((old = catomic_compare_and_exchange_val_rel (fb, p, old2)) != old2); - + - if (fd != NULL && __builtin_expect (old_idx != idx, 0)) + if (have_lock && old != NULL && __builtin_expect (old_idx != idx, 0)) { - errstr = "invalid fastbin entry (free)"; - goto errout; + errstr = "invalid fastbin entry (free)"; + goto errout; diff --git a/SOURCES/glibc-rh1027348-1.patch b/SOURCES/glibc-rh1027348-1.patch index ab6335a9..363a3af3 100644 --- a/SOURCES/glibc-rh1027348-1.patch +++ b/SOURCES/glibc-rh1027348-1.patch @@ -8,7 +8,7 @@ Author: Torvald Riegel Date: Sat Oct 18 01:02:59 2014 +0200 Add arch-specific configuration for C11 atomics support. - + This sets __HAVE_64B_ATOMICS if provided. It also sets USE_ATOMIC_COMPILER_BUILTINS to true if the existing atomic ops use the __atomic* builtins (aarch64, mips partially) or if this has been @@ -22,10 +22,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/aarch64/bits/atomic.h @@ -36,6 +36,8 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 1 - + /* Compare and exchange. For all "bool" routines, we return FALSE if exchange succesful. */ Index: glibc-2.17-c758a686/ports/sysdeps/alpha/bits/atomic.h @@ -35,11 +35,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/alpha/bits/atomic.h @@ -42,6 +42,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #ifdef UP # define __MB /* nothing */ Index: glibc-2.17-c758a686/ports/sysdeps/arm/bits/atomic.h @@ -49,12 +49,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/arm/bits/atomic.h @@ -33,6 +33,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + void __arm_link_error (void); - + /* Use the atomic builtins provided by GCC in case the backend provides Index: glibc-2.17-c758a686/sysdeps/i386/i486/bits/atomic.h =================================================================== @@ -63,11 +63,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i486/bits/atomic.h @@ -54,6 +54,9 @@ typedef uintmax_t uatomic_max_t; # endif #endif - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ __sync_val_compare_and_swap (mem, oldval, newval) Index: glibc-2.17-c758a686/ports/sysdeps/ia64/bits/atomic.h @@ -77,11 +77,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/ia64/bits/atomic.h @@ -43,6 +43,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \ (abort (), 0) Index: glibc-2.17-c758a686/ports/sysdeps/m68k/coldfire/bits/atomic.h @@ -91,7 +91,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/m68k/coldfire/bits/atomic.h @@ -49,6 +49,10 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +/* If we have just non-atomic operations, we can as well make them wide. */ +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 @@ -106,7 +106,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/m68k/m680x0/m68020/bits/atomic.h @@ -44,6 +44,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + @@ -120,7 +120,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/mips/bits/atomic.h @@ -43,6 +43,12 @@ typedef uintmax_t uatomic_max_t; #define MIPS_PUSH_MIPS2 #endif - + +#if _MIPS_SIM == _ABIO32 +#define __HAVE_64B_ATOMICS 0 +#else @@ -133,16 +133,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/mips/bits/atomic.h @@ -82,6 +88,8 @@ typedef uintmax_t uatomic_max_t; /* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS support for their efficient implementation was added only in GCC 4.8. */ - + +#define USE_ATOMIC_COMPILER_BUILTINS 1 + /* Compare and exchange. For all "bool" routines, we return FALSE if exchange succesful. */ - + @@ -204,6 +212,8 @@ typedef uintmax_t uatomic_max_t; /* This implementation using inline assembly will be removed once glibc requires GCC 4.8 or later to build. */ - + +#define USE_ATOMIC_COMPILER_BUILTINS 0 + /* Compare and exchange. For all of the "xxx" routines, we expect a @@ -155,7 +155,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bits/atomic.h @@ -33,6 +33,9 @@ # define MUTEX_HINT_REL #endif - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + @@ -169,7 +169,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/bits/atomic.h @@ -33,6 +33,9 @@ # define MUTEX_HINT_REL #endif - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + @@ -183,22 +183,22 @@ Index: glibc-2.17-c758a686/sysdeps/s390/bits/atomic.h @@ -43,6 +43,8 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) @@ -59,6 +61,7 @@ typedef uintmax_t uatomic_max_t; __archold; }) - + #ifdef __s390x__ +# define __HAVE_64B_ATOMICS 1 # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ ({ __typeof (mem) __archmem = (mem); \ __typeof (*mem) __archold = (oldval); \ @@ -67,6 +70,7 @@ typedef uintmax_t uatomic_max_t; - : "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" ); \ + : "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" ); \ __archold; }) #else +# define __HAVE_64B_ATOMICS 0 @@ -212,11 +212,11 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc32/bits/atomic.h @@ -47,6 +47,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + /* We have no compare and swap, just test and set. The following implementation contends on 64 global locks Index: glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h @@ -226,11 +226,11 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h @@ -44,6 +44,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/bits/atomic.h @@ -240,11 +240,11 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/bits/atomic.h @@ -44,6 +44,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 1 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + - + #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h @@ -254,7 +254,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h @@ -44,6 +44,9 @@ typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; - + +#define __HAVE_64B_ATOMICS 0 +#define USE_ATOMIC_COMPILER_BUILTINS 0 + @@ -268,13 +268,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/bits/atomic.h @@ -55,6 +55,12 @@ typedef uintmax_t uatomic_max_t; # endif #endif - + +#define __HAVE_64B_ATOMICS 1 +#if __GNUC_PREREQ (4, 7) +#define USE_ATOMIC_COMPILER_BUILTINS 1 +#else +#define USE_ATOMIC_COMPILER_BUILTINS 0 +#endif - + #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ __sync_val_compare_and_swap (mem, oldval, newval) diff --git a/SOURCES/glibc-rh1027348-2.patch b/SOURCES/glibc-rh1027348-2.patch index 0361fd81..ca54870d 100644 --- a/SOURCES/glibc-rh1027348-2.patch +++ b/SOURCES/glibc-rh1027348-2.patch @@ -11,7 +11,7 @@ Index: glibc-2.17-c758a686/include/atomic.h @@ -542,6 +542,218 @@ ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; }) #endif - + +/* This is equal to 1 iff the architecture supports 64b atomic operations. */ +#ifndef __HAVE_64B_ATOMICS +#error Unable to determine if 64-bit atomics are present. @@ -224,6 +224,6 @@ Index: glibc-2.17-c758a686/include/atomic.h + +#endif /* !USE_ATOMIC_COMPILER_BUILTINS */ + - + #ifndef atomic_delay # define atomic_delay() do { /* nothing */ } while (0) diff --git a/SOURCES/glibc-rh1027348-3.patch b/SOURCES/glibc-rh1027348-3.patch index cc72784b..b2040fe5 100644 --- a/SOURCES/glibc-rh1027348-3.patch +++ b/SOURCES/glibc-rh1027348-3.patch @@ -9,13 +9,13 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -224,6 +224,7 @@ tests = tst-typesizes \ - tst-key1 tst-key2 tst-key3 tst-key4 \ - tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ - tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \ + tst-key1 tst-key2 tst-key3 tst-key4 \ + tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ + tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \ + tst-sem15 \ - tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ - tst-align tst-align2 tst-align3 \ - tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ + tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ + tst-align tst-align2 tst-align3 \ + tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ Index: glibc-2.17-c758a686/nptl/tst-sem15.c =================================================================== --- /dev/null @@ -130,15 +130,15 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c { - if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX) + if ((v >> SEM_VALUE_SHIFT) == SEM_VALUE_MAX) - { - __set_errno (EOVERFLOW); - return -1; - } + { + __set_errno (EOVERFLOW); + return -1; + } } - while (!atomic_compare_exchange_weak_release (&isem->value, - &v, v + (1 << SEM_VALUE_SHIFT))); + while (!atomic_compare_exchange_weak_release + (&isem->value, &v, v + (1 << SEM_VALUE_SHIFT))); - + /* If there is any potentially blocked waiter, wake one of them. */ if ((v & SEM_NWAITERS_MASK) != 0) diff --git a/SOURCES/glibc-rh1027348-4.patch b/SOURCES/glibc-rh1027348-4.patch index b8dffcc2..27f61157 100644 --- a/SOURCES/glibc-rh1027348-4.patch +++ b/SOURCES/glibc-rh1027348-4.patch @@ -3,11 +3,11 @@ Author: Joseph Myers Date: Wed Mar 18 17:05:38 2015 +0000 Make sem_timedwait use FUTEX_CLOCK_REALTIME (bug 18138). - + sem_timedwait converts absolute timeouts to relative to pass them to the futex syscall. (Before the recent reimplementation, on x86_64 it used FUTEX_CLOCK_REALTIME, but not on other architectures.) - + Correctly implementing POSIX requirements, however, requires use of FUTEX_CLOCK_REALTIME; passing a relative timeout to the kernel does not conform to POSIX. The POSIX specification for sem_timedwait says @@ -23,7 +23,7 @@ Date: Wed Mar 18 17:05:38 2015 +0000 timeout is passed to the kernel, it is interpreted according to the CLOCK_MONOTONIC clock, and so fails to meet that POSIX requirement in the event of clock changes. - + This patch makes sem_timedwait use lll_futex_timed_wait_bitset with FUTEX_CLOCK_REALTIME when possible, as done in some other places in NPTL. FUTEX_CLOCK_REALTIME is always available for supported Linux @@ -33,7 +33,7 @@ Date: Wed Mar 18 17:05:38 2015 +0000 unreviewed that removes the hppa lowlevellock.h completely). - + In the FUTEX_CLOCK_REALTIME case, the glibc code still needs to check for negative tv_sec and handle that as timeout, because the Linux kernel returns EINVAL not ETIMEDOUT for that case, so resulting in @@ -41,7 +41,7 @@ Date: Wed Mar 18 17:05:38 2015 +0000 check. If we're trying to distinguish between Linux-specific and generic-futex NPTL code, I suppose having this in an nptl/ file isn't ideal, but there doesn't seem to be any better place at present. - + It's not possible to add a testcase for this issue to the testsuite because of the requirement to change the system clock as part of a test (this is a case where testing would require some form of @@ -49,10 +49,10 @@ Date: Wed Mar 18 17:05:38 2015 +0000 is isolated from that of the host; I'm not sure what forms of containers, short of a full virtual machine, provide that clock isolation). - + Tested for x86_64. Also tested for powerpc with the testcase included in the bug. - + [BZ #18138] * nptl/sem_waitcommon.c: Include . (futex_abstimed_wait) @@ -67,7 +67,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_waitcommon.c @@ -17,6 +17,7 @@ License along with the GNU C Library; if not, see . */ - + +#include #include #include @@ -92,7 +92,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_waitcommon.c rt.tv_nsec = nsec; +#endif if (cancel) - oldtype = __pthread_enable_asynccancel (); + oldtype = __pthread_enable_asynccancel (); +#if (defined __ASSUME_FUTEX_CLOCK_REALTIME \ + && defined lll_futex_timed_wait_bitset) + err = lll_futex_timed_wait_bitset (futex, expected, abstime, @@ -101,5 +101,5 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_waitcommon.c err = lll_futex_timed_wait (futex, expected, &rt, private); +#endif if (cancel) - __pthread_disable_asynccancel (oldtype); + __pthread_disable_asynccancel (oldtype); } diff --git a/SOURCES/glibc-rh1027348.patch b/SOURCES/glibc-rh1027348.patch index 326f533a..4aca8a2d 100644 --- a/SOURCES/glibc-rh1027348.patch +++ b/SOURCES/glibc-rh1027348.patch @@ -5,7 +5,7 @@ Author: Carlos O'Donell Date: Wed Jan 21 00:46:16 2015 -0500 Fix semaphore destruction (bug 12674). - + This commit fixes semaphore destruction by either using 64b atomic operations (where available), or by using two separate fields when only 32b atomic operations are available. In the latter case, we keep a @@ -13,9 +13,9 @@ Date: Wed Jan 21 00:46:16 2015 -0500 bit of the field that counts the number of available tokens, thus allowing sem_post to atomically both add a token and determine whether it needs to call futex_wake. - + See: - https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html + https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html Notes: * For x86_64 and i686, rather than movign to the generic lll_futex_wake @@ -80,14 +80,14 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -95,7 +95,7 @@ libpthread-routines = nptl-init vars eve - sem_init sem_destroy \ - sem_open sem_close sem_unlink \ - sem_getvalue \ + sem_init sem_destroy \ + sem_open sem_close sem_unlink \ + sem_getvalue \ - sem_wait sem_trywait sem_timedwait sem_post \ + sem_wait sem_timedwait sem_post \ - cleanup cleanup_defer cleanup_compat \ - cleanup_defer_compat unwind \ - pt-longjmp pt-cleanup\ + cleanup cleanup_defer cleanup_compat \ + cleanup_defer_compat unwind \ + pt-longjmp pt-cleanup\ Index: glibc-2.17-c758a686/nptl/sem_getvalue.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sem_getvalue.c @@ -97,8 +97,8 @@ Index: glibc-2.17-c758a686/nptl/sem_getvalue.c #include #include "semaphoreP.h" +#include - - + + int -__new_sem_getvalue (sem, sval) - sem_t *sem; @@ -106,21 +106,21 @@ Index: glibc-2.17-c758a686/nptl/sem_getvalue.c +__new_sem_getvalue (sem_t *sem, int *sval) { struct new_sem *isem = (struct new_sem *) sem; - + /* XXX Check for valid SEM parameter. */ + /* FIXME This uses relaxed MO, even though POSIX specifies that this function + should be linearizable. However, its debatable whether linearizability + is the right requirement. We need to follow up with POSIX and, if + necessary, use a stronger MO here and elsewhere (e.g., potentially + release MO in all places where we consume a token). */ - + - *sval = isem->value; +#if __HAVE_64B_ATOMICS + *sval = atomic_load_relaxed (&isem->data) & SEM_VALUE_MASK; +#else + *sval = atomic_load_relaxed (&isem->value) >> SEM_VALUE_SHIFT; +#endif - + return 0; } versioned_symbol (libpthread, __new_sem_getvalue, sem_getvalue, GLIBC_2_1); @@ -140,14 +140,14 @@ Index: glibc-2.17-c758a686/nptl/sem_init.c --- glibc-2.17-c758a686.orig/nptl/sem_init.c +++ glibc-2.17-c758a686/nptl/sem_init.c @@ -18,17 +18,28 @@ - + #include #include -#include #include #include "semaphoreP.h" #include - + +/* Returns FUTEX_PRIVATE if pshared is zero and private futexes are supported; + returns FUTEX_SHARED otherwise. + TODO Remove when cleaning up the futex API throughout glibc. */ @@ -163,7 +163,7 @@ Index: glibc-2.17-c758a686/nptl/sem_init.c + ^ FUTEX_PRIVATE_FLAG; +#endif +} - + int -__new_sem_init (sem, pshared, value) - sem_t *sem; @@ -176,7 +176,7 @@ Index: glibc-2.17-c758a686/nptl/sem_init.c @@ -40,16 +51,15 @@ __new_sem_init (sem, pshared, value) /* Map to the internal type. */ struct new_sem *isem = (struct new_sem *) sem; - + - /* Use the values the user provided. */ - isem->value = value; -#ifdef __ASSUME_PRIVATE_FUTEX @@ -190,10 +190,10 @@ Index: glibc-2.17-c758a686/nptl/sem_init.c + isem->value = value << SEM_VALUE_SHIFT; + isem->nwaiters = 0; #endif - + - isem->nwaiters = 0; + isem->private = futex_private_if_supported (pshared); - + return 0; } Index: glibc-2.17-c758a686/nptl/sem_open.c @@ -201,9 +201,9 @@ Index: glibc-2.17-c758a686/nptl/sem_open.c --- glibc-2.17-c758a686.orig/nptl/sem_open.c +++ glibc-2.17-c758a686/nptl/sem_open.c @@ -307,9 +307,14 @@ sem_open (const char *name, int oflag, . - struct new_sem newsem; + struct new_sem newsem; } sem; - + - sem.newsem.value = value; - sem.newsem.private = 0; +#if __HAVE_64B_ATOMICS @@ -214,7 +214,7 @@ Index: glibc-2.17-c758a686/nptl/sem_open.c +#endif + /* This always is a shared semaphore. */ + sem.newsem.private = LLL_SHARED; - + /* Initialize the remaining bytes as well. */ memset ((char *) &sem.initsem + sizeof (struct new_sem), '\0', Index: glibc-2.17-c758a686/nptl/tst-sem11.c @@ -237,7 +237,7 @@ Index: glibc-2.17-c758a686/nptl/tst-sem11.c @@ -68,7 +71,11 @@ main (void) goto again; } - + +#if __HAVE_64B_ATOMICS + if ((u.ns.data >> SEM_NWAITERS_SHIFT) != 0) +#else @@ -266,7 +266,7 @@ Index: glibc-2.17-c758a686/nptl/tst-sem13.c + printf ("sem_timedwait modified nwaiters: %d\n", nwaiters); return 1; } - + @@ -52,9 +57,14 @@ do_test (void) perror ("2nd sem_timedwait did not fail with ETIMEDOUT"); return 1; @@ -283,7 +283,7 @@ Index: glibc-2.17-c758a686/nptl/tst-sem13.c + printf ("2nd sem_timedwait modified nwaiters: %d\n", nwaiters); return 1; } - + Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S @@ -1390,12 +1390,12 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/internaltypes.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/internaltypes.h @@ -20,6 +20,8 @@ #define _INTERNALTYPES_H 1 - + #include +#include +#include - - + + struct pthread_attr @@ -141,9 +143,29 @@ struct pthread_key_struct /* Semaphore variable structure. */ @@ -1426,7 +1426,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/internaltypes.h + unsigned int nwaiters; +#endif }; - + struct old_sem Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c =================================================================== @@ -1509,9 +1509,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sem_post.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c @@ -25,34 +25,78 @@ - + #include - + +/* Wrapper for lll_futex_wake, with error checking. + TODO Remove when cleaning up the futex API throughout glibc. */ +static __always_inline void @@ -1544,7 +1544,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c { struct new_sem *isem = (struct new_sem *) sem; + int private = isem->private; - + - __typeof (isem->value) cur; +#if __HAVE_64B_ATOMICS + /* Add a token to the semaphore. We use release MO to make sure that a @@ -1558,14 +1558,14 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c - cur = isem->value; - if (isem->value == SEM_VALUE_MAX) + if ((d & SEM_VALUE_MASK) == SEM_VALUE_MAX) - { - __set_errno (EOVERFLOW); - return -1; - } + { + __set_errno (EOVERFLOW); + return -1; + } } - while (atomic_compare_and_exchange_bool_rel (&isem->value, cur + 1, cur)); + while (!atomic_compare_exchange_weak_release (&isem->data, &d, d + 1)); - + - atomic_full_barrier (); - if (isem->nwaiters > 0) + /* If there is any potentially blocked waiter, wake one of them. */ @@ -1580,11 +1580,11 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c - isem->private ^ FUTEX_PRIVATE_FLAG); - if (__builtin_expect (err, 0) < 0) + if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX) - { + { - __set_errno (-err); + __set_errno (EOVERFLOW); - return -1; - } + return -1; + } } + while (!atomic_compare_exchange_weak_release (&isem->value, + &v, v + (1 << SEM_VALUE_SHIFT))); @@ -1600,7 +1600,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c @@ -65,6 +109,9 @@ __old_sem_post (sem_t *sem) { int *futex = (int *) sem; - + + /* We must need to synchronize with consumers of this token, so the atomic + increment must have release MO semantics. */ + atomic_write_barrier (); @@ -1618,11 +1618,11 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras , 2003. - + @@ -17,42 +17,13 @@ License along with the GNU C Library; if not, see . */ - + -#include -#include -#include @@ -1651,7 +1651,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c - return err; -} +#include "sem_waitcommon.c" - + +/* This is in a separate file because because sem_timedwait is only provided + if __USE_XOPEN2K is defined. */ int @@ -1662,13 +1662,13 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c - - if (atomic_decrement_if_positive (&isem->value) > 0) - return 0; - + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { @@ -60,57 +31,8 @@ sem_timedwait (sem_t *sem, const struct return -1; } - + - atomic_increment (&isem->nwaiters); - - pthread_cleanup_push (__sem_wait_cleanup, isem); @@ -1788,7 +1788,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_wait.c @@ -17,79 +17,18 @@ License along with the GNU C Library; if not, see . */ - + -#include -#include -#include @@ -1823,7 +1823,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_wait.c - return err; -} +#include "sem_waitcommon.c" - + int __new_sem_wait (sem_t *sem) { @@ -1864,13 +1864,13 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_wait.c + return __new_sem_wait_slow((struct new_sem *) sem, NULL); } versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1); - + - #if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1) int attribute_compat_text_section @@ -120,3 +59,34 @@ __old_sem_wait (sem_t *sem) - + compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0); #endif + @@ -3849,22 +3849,22 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/Makefile --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/Makefile +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/Makefile @@ -24,8 +24,7 @@ libpthread-sysdep_routines += pt-fork pt - + gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \ - lowlevelbarrier.sym unwindbuf.sym \ + lowlevelbarrier.sym unwindbuf.sym \ - lowlevelrobustlock.sym pthread-pi-defines.sym \ - structsem.sym + lowlevelrobustlock.sym pthread-pi-defines.sym endif - + ifeq ($(subdir),posix) Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -225,17 +225,18 @@ LLL_STUB_UNWIND_INFO_END - - + + #define lll_futex_wake(futex, nr, private) \ - do { \ - int __ignore; \ @@ -3875,23 +3875,23 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h __asm __volatile ("syscall" \ - : "=a" (__ignore) \ + : "=a" (__status) \ - : "0" (SYS_futex), "D" (futex), \ - "S" (__lll_private_flag (FUTEX_WAKE, private)), \ - "d" (_nr) \ - : "memory", "cc", "r10", "r11", "cx"); \ + : "0" (SYS_futex), "D" (futex), \ + "S" (__lll_private_flag (FUTEX_WAKE, private)), \ + "d" (_nr) \ + : "memory", "cc", "r10", "r11", "cx"); \ - } while (0) + __status; \ + }) - - + + /* NB: in the lll_trylock macro we simply return the value in %eax Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -224,20 +224,21 @@ LLL_STUB_UNWIND_INFO_END - - + + #define lll_futex_wake(futex, nr, private) \ - do { \ - int __ignore; \ @@ -3900,18 +3900,18 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h register __typeof (nr) _nr asm ("edx") = (nr); \ LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \ __asm __volatile (LLL_EBX_LOAD \ - LLL_ENTER_KERNEL \ - LLL_EBX_LOAD \ + LLL_ENTER_KERNEL \ + LLL_EBX_LOAD \ - : "=a" (__ignore) \ + : "=a" (__status) \ - : "0" (SYS_futex), LLL_EBX_REG (futex), \ - "c" (__lll_private_flag (FUTEX_WAKE, private)), \ - "d" (_nr), \ - "i" (0) /* phony, to align next arg's number */, \ - "i" (offsetof (tcbhead_t, sysinfo))); \ + : "0" (SYS_futex), LLL_EBX_REG (futex), \ + "c" (__lll_private_flag (FUTEX_WAKE, private)), \ + "d" (_nr), \ + "i" (0) /* phony, to align next arg's number */, \ + "i" (offsetof (tcbhead_t, sysinfo))); \ - } while (0) + __status; \ + }) - - + + /* NB: in the lll_trylock macro we simply return the value in %eax diff --git a/SOURCES/glibc-rh1028652.patch b/SOURCES/glibc-rh1028652.patch index 0d933268..0717f719 100644 --- a/SOURCES/glibc-rh1028652.patch +++ b/SOURCES/glibc-rh1028652.patch @@ -5,35 +5,35 @@ # commit f7c399cff5bd04ee9dc117fb6b0f39597dc047c6 # Author: Alan Modra # Date: Sat Aug 17 18:37:18 2013 +0930 -# +# # PowerPC SIGSTKSZ # http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html -# +# # This copies the sparc version of sigstack.h, which gives powerpc # #define MINSIGSTKSZ 4096 # #define SIGSTKSZ 16384 -# +# # Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for # __SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of # 2048. -# +# # After VSX, ucontext increased by 256 bytes. Oops, we're over # MINSIGSTKSZ, so powerpc has been using the wrong value for quite a # while. Add another ucontext for TM and rt_sigframe is now at 3872, # giving actual MINSIGSTKSZ of 4000. -# +# # The glibc testcase that I was looking at was tst-cancel21, which # allocates 2*SIGSTKSZ (not because the test is trying to be # conservative, but because the test actually has nested signal stack # frames). We blew the allocation by 48 bytes when using current # mainline gcc to compile glibc (le ppc64). -# +# # The required stack depth in _dl_lookup_symbol_x from the top of the # next signal frame was 10944 bytes. I guess you'd want to add 288 to # that, implying an actual SIGSTKSZ of 11232. -# +# # * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file. -# +# diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h new file mode 100644 index 0000000..33be9e8 diff --git a/SOURCES/glibc-rh1032435.patch b/SOURCES/glibc-rh1032435.patch index cfc253df..694bec27 100644 --- a/SOURCES/glibc-rh1032435.patch +++ b/SOURCES/glibc-rh1032435.patch @@ -3,12 +3,12 @@ Author: Siddhesh Poyarekar Date: Wed Oct 30 16:13:37 2013 +0530 Fix reads for sizes larger than INT_MAX in AF_INET lookup - + Currently for AF_INET lookups from the hosts file, buffer sizes larger than INT_MAX silently overflow and may result in access beyond bounds of a buffer. This happens when the number of results in an AF_INET lookup in /etc/hosts are very large. - + There are two aspects to the problem. One problem is that the size computed from the buffer size is stored into an int, which results in overflow for large sizes. Additionally, even if this size was @@ -45,7 +45,7 @@ diff -u b/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c } -/* Parsing the database file into `struct STRUCTURE' data structures. */ - + +typedef enum +{ + gcr_ok = 0, @@ -94,7 +94,7 @@ diff -u b/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c +/* Parsing the database file into `struct STRUCTURE' data structures. */ static enum nss_status internal_getent (struct STRUCTURE *result, - char *buffer, size_t buflen, int *errnop H_ERRNO_PROTO + char *buffer, size_t buflen, int *errnop H_ERRNO_PROTO @@ -188,7 +233,7 @@ { char *p; @@ -102,39 +102,39 @@ diff -u b/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c - int linebuflen = buffer + buflen - data->linebuffer; + size_t linebuflen = buffer + buflen - data->linebuffer; int parse_result; - + if (buflen < sizeof *data + 2) @@ -200,17 +245,16 @@ - + do { - /* Terminate the line so that we can test for overflow. */ - ((unsigned char *) data->linebuffer)[linebuflen - 1] = '\xff'; + get_contents_ret r = get_contents (data->linebuffer, linebuflen, stream); - + - p = fgets_unlocked (data->linebuffer, linebuflen, stream); - if (p == NULL) + if (r == gcr_error) - { - /* End of file or read error. */ - H_ERRNO_SET (HOST_NOT_FOUND); - return NSS_STATUS_NOTFOUND; - } + { + /* End of file or read error. */ + H_ERRNO_SET (HOST_NOT_FOUND); + return NSS_STATUS_NOTFOUND; + } - else if (((unsigned char *) data->linebuffer)[linebuflen - 1] != 0xff) + + if (r == gcr_overflow) - { - /* The line is too long. Give the user the opportunity to - enlarge the buffer. */ + { + /* The line is too long. Give the user the opportunity to + enlarge the buffer. */ @@ -219,7 +263,8 @@ - return NSS_STATUS_TRYAGAIN; - } - + return NSS_STATUS_TRYAGAIN; + } + - /* Skip leading blanks. */ + /* Everything OK. Now skip leading blanks. */ + p = data->linebuffer; while (isspace (*p)) - ++p; + ++p; } diff a/nss/bug17079.c b/nss/bug17079.c @@ -382,9 +382,9 @@ diff a/nss/Makefile b/nss/Makefile +++ b/nss/Makefile @@ -39,6 +39,6 @@ extra-objs += $(makedb-modules:=.o) - + -tests = test-netdb tst-nss-test1 +tests = test-netdb tst-nss-test1 bug17079 xtests = bug-erange - + include ../Makeconfig diff --git a/SOURCES/glibc-rh1039496.patch b/SOURCES/glibc-rh1039496.patch index e856f181..1243bbb6 100644 --- a/SOURCES/glibc-rh1039496.patch +++ b/SOURCES/glibc-rh1039496.patch @@ -4,10 +4,10 @@ diff -urNglibc-2.17-c758a686/libio/tst-widetext.inputglibc-2.17-c758a686/libio/t @@ -126,7 +126,7 @@ ઀◌ઁ◌ંઃ઄અઆઇઈઉઊઋઌઍ઎એઐઑ઒ઓઔકખગઘઙચછજઝઞટઠડઢણતથદધન઩પફબભમયર઱લળ઴વશષસહ઺઻◌઼ઽાિ ી◌ુ◌ૂ◌ૃ◌ૄ◌ૅ૆◌ે◌ૈૉ૊ોૌ◌્૎૏ૐ૑૒૓૔૕૖૗૘૙૚૛૜૝૞૟ૠૡૢૣ૤૥૦૧૨૩૪૫૬૭૮૯૰૱૲૳૴૵૶૷૸ૹૺૻૼ૽૾૿ - + -Oriya (U+0B00-U+0B7F): +Odia (U+0B00-U+0B7F): - + ଀◌ଁଂଃ଄ଅଆଇଈଉଊଋଌ଍଎ଏଐ଑଒ଓଔକଖଗଘଙଚଛଜଝଞଟଠଡଢଣତଥଦଧନ଩ପଫବଭମଯର଱ଲଳ଴ଵଶଷସହ଺଻◌଼ଽା◌ି ୀ◌ୁ◌ୂ◌ୃୄ୅୆େୈ୉୊ୋୌ◌୍୎୏୐୑୒୓୔୕◌ୖୗ୘୙୚୛ଡ଼ଢ଼୞ୟୠୡୢୣ୤୥୦୧୨୩୪୫୬୭୮୯୰ୱ୲୳୴୵୶୷୸୹୺୻୼୽୾୿ diff -urNglibc-2.17-c758a686/locale/iso-639.defglibc-2.17-c758a686/locale/iso-639.def @@ -67,11 +67,11 @@ diff -urNglibc-2.17-c758a686/localedata/locales/or_INglibc-2.17-c758a686/localed @@ -1,19 +1,19 @@ comment_char % escape_char / - + -% Oriya locale for India. +% Odia locale for India. % Contributed by Masahide Washizawa - + %%%%%%%%%%%%% LC_IDENTIFICATION -title "Oriya language locale for India" @@ -90,11 +90,11 @@ diff -urNglibc-2.17-c758a686/localedata/locales/or_INglibc-2.17-c758a686/localed @@ -35,10 +35,10 @@ LC_CTYPE copy "i18n" - + -% Oriya uses the alternate digits U+0B66..U+0B6F +% Odia uses the alternate digits U+0B66..U+0B6F outdigit .. - + -% This is used in the scanf family of functions to read Oriya numbers +% This is used in the scanf family of functions to read Odia numbers % using "%Id" and such. diff --git a/SOURCES/glibc-rh1039970.patch b/SOURCES/glibc-rh1039970.patch index f7986a6f..85f8b915 100644 --- a/SOURCES/glibc-rh1039970.patch +++ b/SOURCES/glibc-rh1039970.patch @@ -10,7 +10,7 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net @@ -65,6 +65,55 @@ struct dataset char strdata[0]; }; - + +/* Sends a notfound message and prepares a notfound dataset to write to the + cache. Returns true if there was enough memory to allocate the dataset and + returns the dataset in DATASETP, total bytes to write in TOTALP and the @@ -60,7 +60,7 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net + *datasetp = dataset; + return cacheable; +} - + static time_t addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, @@ -84,6 +133,7 @@ addgetnetgrentX (struct database_dyn *db @@ -68,7 +68,7 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net bool cacheable = false; ssize_t total; + bool found = false; - + char *key_copy = NULL; struct __netgrent data; @@ -103,35 +153,8 @@ addgetnetgrentX (struct database_dyn *db @@ -108,19 +108,19 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net + &key_copy); goto writeout; } - + @@ -167,6 +190,7 @@ addgetnetgrentX (struct database_dyn *db - - if (status == NSS_STATUS_SUCCESS) - { + + if (status == NSS_STATUS_SUCCESS) + { + found = true; - union - { - enum nss_status (*f) (struct __netgrent *, char *, size_t, + union + { + enum nss_status (*f) (struct __netgrent *, char *, size_t, @@ -325,6 +349,15 @@ addgetnetgrentX (struct database_dyn *db - } + } } - + + /* No results. Return a failure and write out a notfound record in the + cache. */ + if (!found) @@ -131,5 +131,5 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net + } + total = buffilled; - + /* Fill in the dataset. */ diff --git a/SOURCES/glibc-rh1046199.patch b/SOURCES/glibc-rh1046199.patch index 6909e326..b00c9858 100644 --- a/SOURCES/glibc-rh1046199.patch +++ b/SOURCES/glibc-rh1046199.patch @@ -8,9 +8,9 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net --- glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:38:40.432000000 -0500 +++ glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:37:29.945000000 -0500 @@ -204,9 +204,10 @@ addgetnetgrentX (struct database_dyn *db - int e; - status = getfct.f (&data, buffer + buffilled, - buflen - buffilled, &e); + int e; + status = getfct.f (&data, buffer + buffilled, + buflen - buffilled, &e); - if (status == NSS_STATUS_RETURN) - /* This was the last one for this group. Look - at next group if available. */ @@ -18,6 +18,6 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net + || status == NSS_STATUS_NOTFOUND) + /* This was either the last one for this group or the + group was empty. Look at next group if available. */ - break; - if (status == NSS_STATUS_SUCCESS) - { + break; + if (status == NSS_STATUS_SUCCESS) + { diff --git a/SOURCES/glibc-rh1047983.patch b/SOURCES/glibc-rh1047983.patch index 9a740f6a..a5877cd5 100644 --- a/SOURCES/glibc-rh1047983.patch +++ b/SOURCES/glibc-rh1047983.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Thu Nov 28 17:18:12 2013 +0530 Get canonical name in getaddrinfo from hosts file for AF_INET (fixes 16077) - + AF_INET lookup in hosts file uses _nss_files_gethostbyname2_r, which is not capable of returning a canonical name if it has found one. This change adds _nss_files_gethostbyname3_r, which wraps around @@ -29,7 +29,7 @@ index 6db2535..957c9aa 100644 @@ -97,262 +97,12 @@ LINE_PARSER STRING_FIELD (result->h_name, isspace, 1); }) - + - - -#define HOST_DB_LOOKUP(name, keysize, keypattern, break_if_match, proto...) \ @@ -273,7 +273,7 @@ index 6db2535..957c9aa 100644 - LOOKUP_NAME_CASE (h_name, h_aliases) - }, const char *name) #undef EXTRA_ARGS_VALUE - + - -/* XXX Is using _res to determine whether we want to convert IPv4 addresses - to IPv6 addresses really the right thing to do? */ @@ -290,9 +290,9 @@ index 6db2535..957c9aa 100644 gethostbyaddr() function is an IPv6 address. */ #define EXTRA_ARGS_VALUE \ @@ -365,6 +115,263 @@ DB_LOOKUP (hostbyaddr, ,,, - }, const void *addr, socklen_t len, int af) + }, const void *addr, socklen_t len, int af) #undef EXTRA_ARGS_VALUE - + +enum nss_status +_nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result, + char *buffer, size_t buflen, int *errnop, @@ -550,6 +550,6 @@ index 6db2535..957c9aa 100644 + return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen, + errnop, herrnop, NULL, NULL); +} - + enum nss_status _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, diff --git a/SOURCES/glibc-rh1048036.patch b/SOURCES/glibc-rh1048036.patch index 95c7ba4f..5d8836e6 100644 --- a/SOURCES/glibc-rh1048036.patch +++ b/SOURCES/glibc-rh1048036.patch @@ -3,18 +3,18 @@ index 87d3cdc..877fc1f 100644 --- glibc-2.17-c758a686/libio/wfileops.c +++ glibc-2.17-c758a686/libio/wfileops.c @@ -715,7 +715,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) - - fp->_wide_data->_IO_write_base) / clen; - else - { + - fp->_wide_data->_IO_write_base) / clen; + else + { - enum __codecvt_result status; + enum __codecvt_result status = __codecvt_ok; - delta = (fp->_wide_data->_IO_write_ptr - - fp->_wide_data->_IO_write_base); - const wchar_t *write_base = fp->_wide_data->_IO_write_base; + delta = (fp->_wide_data->_IO_write_ptr + - fp->_wide_data->_IO_write_base); + const wchar_t *write_base = fp->_wide_data->_IO_write_base; @@ -728,9 +728,12 @@ _IO_wfile_seekoff (fp, offset, dir, mode) - flush buffers for every ftell. */ - do - { + flush buffers for every ftell. */ + do + { - /* Ugh, no point trying to avoid the flush. Just do it - and go back to how it was with the read mode. */ - if (delta > 0 && new_write_ptr == fp->_IO_buf_end) @@ -24,6 +24,6 @@ index 87d3cdc..877fc1f 100644 + the read mode. */ + if (status == __codecvt_partial + || (delta > 0 && new_write_ptr == fp->_IO_buf_end)) - { - if (_IO_switch_to_wget_mode (fp)) - return WEOF; + { + if (_IO_switch_to_wget_mode (fp)) + return WEOF; diff --git a/SOURCES/glibc-rh1048123.patch b/SOURCES/glibc-rh1048123.patch index 7edc4bca..a90ffaaf 100644 --- a/SOURCES/glibc-rh1048123.patch +++ b/SOURCES/glibc-rh1048123.patch @@ -9,14 +9,14 @@ Author: Siddhesh Poyarekar Date: Mon Mar 3 22:51:39 2014 +0530 nscd: Improved support for tracking startup failure in nscd service (BZ #16639) - + Currently, the nscd parent process parses commandline options and configuration, forks on startup and immediately exits with a success. If the child process encounters some error after this, it goes undetected and any services started up after it may have to repeatedly check to make sure that the nscd service did actually start up and is serving requests. - + To make this process more reliable, I have added a pipe between the parent and child process, through which the child process sends a notification to the parent informing it of its status. The parent @@ -25,7 +25,7 @@ Date: Mon Mar 3 22:51:39 2014 +0530 status (0), the parent exits with a success status. Similarly for error conditions, the child sends the non-zero status code, which the parent passes on as the exit code. - + This, along with setting the nscd service type to forking in its systemd configuration file, allows systemd to be certain that the nscd service is ready and is accepting connections. @@ -36,26 +36,26 @@ index f463f45..180ae77 100644 --- glibc-2.17-c758a686/nscd/connections.c +++ glibc-2.17-c758a686/nscd/connections.c @@ -649,8 +649,8 @@ cannot create read-only descriptor for \"%s\"; no mmap"), - close (fd); - } - else if (errno == EACCES) + close (fd); + } + else if (errno == EACCES) - error (EXIT_FAILURE, 0, _("cannot access '%s'"), - dbs[cnt].db_filename); + do_exit (EXIT_FAILURE, 0, _("cannot access '%s'"), + dbs[cnt].db_filename); - } - - if (dbs[cnt].head == NULL) + } + + if (dbs[cnt].head == NULL) @@ -699,8 +699,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"), - { - dbg_log (_("database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"), - dbnames[cnt], dbs[cnt].db_filename); + { + dbg_log (_("database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"), + dbnames[cnt], dbs[cnt].db_filename); - // XXX Correct way to terminate? - exit (1); + do_exit (1, 0, NULL); - } - - if (dbs[cnt].persistent) + } + + if (dbs[cnt].persistent) @@ -867,7 +866,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), if (sock < 0) { @@ -72,83 +72,83 @@ index f463f45..180ae77 100644 - exit (errno == EACCES ? 4 : 1); + do_exit (errno == EACCES ? 4 : 1, 0, NULL); } - + #ifndef __ASSUME_SOCK_CLOEXEC @@ -888,7 +887,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), - { - dbg_log (_("cannot change socket to nonblocking mode: %s"), - strerror (errno)); + { + dbg_log (_("cannot change socket to nonblocking mode: %s"), + strerror (errno)); - exit (1); + do_exit (1, 0, NULL); - } - + } + /* The descriptor needs to be closed on exec. */ @@ -896,7 +895,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), - { - dbg_log (_("cannot set socket to close on exec: %s"), - strerror (errno)); + { + dbg_log (_("cannot set socket to close on exec: %s"), + strerror (errno)); - exit (1); + do_exit (1, 0, NULL); - } + } } #endif @@ -909,7 +908,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), { dbg_log (_("cannot enable socket to accept connections: %s"), - strerror (errno)); + strerror (errno)); - exit (1); + do_exit (1, 0, NULL); } - + #ifdef HAVE_NETLINK @@ -953,7 +952,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), - dbg_log (_("\ + dbg_log (_("\ cannot change socket to nonblocking mode: %s"), - strerror (errno)); + strerror (errno)); - exit (1); + do_exit (1, 0, NULL); - } - - /* The descriptor needs to be closed on exec. */ + } + + /* The descriptor needs to be closed on exec. */ @@ -962,7 +961,7 @@ cannot change socket to nonblocking mode: %s"), - { - dbg_log (_("cannot set socket to close on exec: %s"), - strerror (errno)); + { + dbg_log (_("cannot set socket to close on exec: %s"), + strerror (errno)); - exit (1); + do_exit (1, 0, NULL); - } - } + } + } # endif @@ -2392,7 +2391,7 @@ start_threads (void) if (pthread_cond_init (&dbs[i].prune_cond, &condattr) != 0) - { - dbg_log (_("could not initialize conditional variable")); + { + dbg_log (_("could not initialize conditional variable")); - exit (1); + do_exit (1, 0, NULL); - } - + } + pthread_t th; @@ -2400,7 +2399,7 @@ start_threads (void) - && pthread_create (&th, &attr, nscd_run_prune, (void *) i) != 0) - { - dbg_log (_("could not start clean-up thread; terminating")); + && pthread_create (&th, &attr, nscd_run_prune, (void *) i) != 0) + { + dbg_log (_("could not start clean-up thread; terminating")); - exit (1); + do_exit (1, 0, NULL); - } + } } - + @@ -2414,13 +2413,17 @@ start_threads (void) - if (i == 0) - { - dbg_log (_("could not start any worker thread; terminating")); + if (i == 0) + { + dbg_log (_("could not start any worker thread; terminating")); - exit (1); + do_exit (1, 0, NULL); - } - - break; - } + } + + break; + } } - + + /* Now it is safe to let the parent know that we're doing fine and it can + exit. */ + notify_parent (0); @@ -165,7 +165,7 @@ index f463f45..180ae77 100644 + do_exit (EXIT_FAILURE, 0, + _("Failed to run nscd as user '%s'"), server_user); } - + server_uid = pwd->pw_uid; @@ -2483,7 +2486,8 @@ begin_drop_privileges (void) { @@ -175,7 +175,7 @@ index f463f45..180ae77 100644 + do_exit (EXIT_FAILURE, errno, + _("initial getgrouplist failed")); } - + server_groups = (gid_t *) xmalloc (server_ngroups * sizeof (gid_t)); @@ -2492,7 +2496,7 @@ begin_drop_privileges (void) == -1) @@ -185,7 +185,7 @@ index f463f45..180ae77 100644 + do_exit (EXIT_FAILURE, errno, _("getgrouplist failed")); } } - + @@ -2510,7 +2514,7 @@ finish_drop_privileges (void) if (setgroups (server_ngroups, server_groups) == -1) { @@ -193,7 +193,7 @@ index f463f45..180ae77 100644 - error (EXIT_FAILURE, errno, _("setgroups failed")); + do_exit (EXIT_FAILURE, errno, _("setgroups failed")); } - + int res; @@ -2521,8 +2525,7 @@ finish_drop_privileges (void) if (res == -1) @@ -203,7 +203,7 @@ index f463f45..180ae77 100644 - exit (4); + do_exit (4, errno, "setgid"); } - + if (paranoia) @@ -2532,8 +2535,7 @@ finish_drop_privileges (void) if (res == -1) @@ -213,7 +213,7 @@ index f463f45..180ae77 100644 - exit (4); + do_exit (4, errno, "setuid"); } - + #if defined HAVE_LIBAUDIT && defined HAVE_LIBCAP diff --git glibc-2.17-c758a686/nscd/nscd.c glibc-2.17-c758a686/nscd/nscd.c index 63d9d83..5680378 100644 @@ -225,39 +225,39 @@ index 63d9d83..5680378 100644 #include +#include +#include - + #include "dbg_log.h" #include "nscd.h" @@ -101,6 +103,7 @@ gid_t old_gid; - + static int check_pid (const char *file); static int write_pid (const char *file); +static int monitor_child (int fd); - + /* Name and version of program. */ static void print_version (FILE *stream, struct argp_state *state); @@ -142,6 +145,7 @@ static struct argp argp = - + /* True if only statistics are requested. */ static bool get_stats; +static int parent_fd = -1; - + int main (int argc, char **argv) @@ -196,11 +200,27 @@ main (int argc, char **argv) /* Behave like a daemon. */ if (run_mode == RUN_DAEMONIZE) - { + { + int fd[2]; + + if (pipe (fd) != 0) + error (EXIT_FAILURE, errno, + _("cannot create a pipe to talk to the child")); + - pid = fork (); - if (pid == -1) - error (EXIT_FAILURE, errno, _("cannot fork")); - if (pid != 0) + pid = fork (); + if (pid == -1) + error (EXIT_FAILURE, errno, _("cannot fork")); + if (pid != 0) - exit (0); + { + /* The parent only reads from the child. */ @@ -270,27 +270,27 @@ index 63d9d83..5680378 100644 + close (fd[0]); + parent_fd = fd[1]; + } - } - + } + int nullfd = open (_PATH_DEVNULL, O_RDWR); @@ -242,7 +262,8 @@ main (int argc, char **argv) - char *endp; - long int fdn = strtol (dirent->d_name, &endp, 10); - + char *endp; + long int fdn = strtol (dirent->d_name, &endp, 10); + - if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd) + if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd + && fdn != parent_fd) - close ((int) fdn); - } - + close ((int) fdn); + } + @@ -250,22 +271,14 @@ main (int argc, char **argv) - } + } else - for (i = min_close_fd; i < getdtablesize (); i++) + for (i = min_close_fd; i < getdtablesize (); i++) - close (i); + if (i != parent_fd) + close (i); - + - if (run_mode == RUN_DAEMONIZE) - { - pid = fork (); @@ -301,17 +301,17 @@ index 63d9d83..5680378 100644 - } - setsid (); - + if (chdir ("/") != 0) - error (EXIT_FAILURE, errno, - _("cannot change current working directory to \"/\"")); + do_exit (EXIT_FAILURE, errno, + _("cannot change current working directory to \"/\"")); - + openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON); - + @@ -592,3 +614,79 @@ write_pid (const char *file) - + return result; } + @@ -400,7 +400,7 @@ index 972f462..529b3f5 100644 extern int nscd_open_socket (void); +void notify_parent (int child_ret); +void do_exit (int child_ret, int errnum, const char *format, ...); - + /* connections.c */ extern void nscd_init (void); diff --git glibc-2.17-c758a686/nscd/selinux.c glibc-2.17-c758a686/nscd/selinux.c @@ -415,15 +415,15 @@ index e477254..46b0ea9 100644 + do_exit (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed")); /* NOTREACHED */ } - + @@ -194,7 +194,7 @@ preserve_capabilities (void) - cap_free (tmp_caps); - + cap_free (tmp_caps); + dbg_log (_("Failed to initialize drop of capabilities")); - error (EXIT_FAILURE, 0, _("cap_init failed")); + do_exit (EXIT_FAILURE, 0, _("cap_init failed")); } - + /* There is no reason why these should not work. */ @@ -216,7 +216,7 @@ preserve_capabilities (void) { @@ -432,7 +432,7 @@ index e477254..46b0ea9 100644 - error (EXIT_FAILURE, 0, _("cap_set_proc failed")); + do_exit (EXIT_FAILURE, 0, _("cap_set_proc failed")); } - + return new_caps; @@ -233,7 +233,7 @@ install_real_capabilities (cap_t new_caps) { @@ -442,7 +442,7 @@ index e477254..46b0ea9 100644 + do_exit (EXIT_FAILURE, 0, _("cap_set_proc failed")); /* NOTREACHED */ } - + @@ -242,7 +242,7 @@ install_real_capabilities (cap_t new_caps) if (prctl (PR_SET_KEEPCAPS, 0) == -1) { @@ -460,28 +460,28 @@ index e477254..46b0ea9 100644 + do_exit (EXIT_FAILURE, 0, NULL); } } - + @@ -272,7 +272,7 @@ avc_create_thread (void (*run) (void)) rc = pthread_create (&avc_notify_thread, NULL, (void *(*) (void *)) run, NULL); if (rc != 0) - error (EXIT_FAILURE, rc, _("Failed to start AVC thread")); + do_exit (EXIT_FAILURE, rc, _("Failed to start AVC thread")); - + return &avc_notify_thread; } @@ -294,7 +294,7 @@ avc_alloc_lock (void) - + avc_mutex = malloc (sizeof (pthread_mutex_t)); if (avc_mutex == NULL) - error (EXIT_FAILURE, errno, _("Failed to create AVC lock")); + do_exit (EXIT_FAILURE, errno, _("Failed to create AVC lock")); pthread_mutex_init (avc_mutex, NULL); - + return avc_mutex; @@ -334,7 +334,7 @@ nscd_avc_init (void) avc_entry_ref_init (&aeref); - + if (avc_init ("avc", NULL, &log_cb, &thread_cb, &lock_cb) < 0) - error (EXIT_FAILURE, errno, _("Failed to start AVC")); + do_exit (EXIT_FAILURE, errno, _("Failed to start AVC")); @@ -496,7 +496,7 @@ index e477254..46b0ea9 100644 [Unit] Description=Name Service Cache Daemon After=syslog.target - + [Service] +Type=forking EnvironmentFile=-/etc/sysconfig/nscd @@ -510,6 +510,6 @@ index e477254..46b0ea9 100644 ExecReload=/usr/sbin/nscd -i netgroup Restart=always +PIDFile=/run/nscd/nscd.pid - + [Install] WantedBy=multi-user.target diff --git a/SOURCES/glibc-rh1063681.patch b/SOURCES/glibc-rh1063681.patch index 30269d75..c8ad2c28 100644 --- a/SOURCES/glibc-rh1063681.patch +++ b/SOURCES/glibc-rh1063681.patch @@ -3,9 +3,9 @@ index 22dbcae..488ee51 100644 --- glibc-2.17-c758a686/libio/Makefile +++ glibc-2.17-c758a686/libio/Makefile @@ -60,7 +60,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ - tst-wmemstream1 tst-wmemstream2 \ - bug-memstream1 bug-wmemstream1 \ - tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ + tst-wmemstream1 tst-wmemstream2 \ + bug-memstream1 bug-wmemstream1 \ + tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ - tst-fwrite-error + tst-fwrite-error tst-ftell-active-handler ifeq (yes,$(build-shared)) @@ -18,7 +18,7 @@ index a3499be..2e7bc8d 100644 @@ -929,6 +929,93 @@ _IO_file_sync_mmap (_IO_FILE *fp) return 0; } - + +/* Get the current file offset using a system call. This is the safest method + to get the current file offset, since we are sure that we get the current + state of the file. Before the stream handle is activated (by using fread, @@ -106,7 +106,7 @@ index a3499be..2e7bc8d 100644 + return result; +} + - + _IO_off64_t _IO_new_file_seekoff (fp, offset, dir, mode) @@ -940,6 +1027,13 @@ _IO_new_file_seekoff (fp, offset, dir, mode) @@ -125,8 +125,8 @@ index a3499be..2e7bc8d 100644 int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end @@ -948,9 +1042,6 @@ _IO_new_file_seekoff (fp, offset, dir, mode) bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base - || _IO_in_put_mode (fp)); - + || _IO_in_put_mode (fp)); + - if (mode == 0) - dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ - @@ -140,7 +140,7 @@ index a3499be..2e7bc8d 100644 - else if (was_writing && _IO_switch_to_get_mode (fp)) + if (was_writing && _IO_switch_to_get_mode (fp)) return EOF; - + if (fp->_IO_buf_base == NULL) @@ -978,30 +1069,10 @@ _IO_new_file_seekoff (fp, offset, dir, mode) { @@ -157,7 +157,7 @@ index a3499be..2e7bc8d 100644 - offset -= fp->_IO_read_end - fp->_IO_write_ptr; - } + offset -= fp->_IO_read_end - fp->_IO_read_ptr; - + if (fp->_offset == _IO_pos_BAD) - { - if (mode != 0) @@ -178,7 +178,7 @@ index a3499be..2e7bc8d 100644 @@ -1028,10 +1099,6 @@ _IO_new_file_seekoff (fp, offset, dir, mode) } /* At this point, dir==_IO_seek_set. */ - + - /* If we are only interested in the current position we've found it now. */ - if (mode == 0) - return offset; @@ -199,7 +199,7 @@ index 066ff19..3f266f7 100644 - call _IO_file_attach or else it will allocate a buffer immediately. */ _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, #ifdef _G_HAVE_MMAP - (use_mmap && (read_write & _IO_NO_WRITES)) + (use_mmap && (read_write & _IO_NO_WRITES)) @@ -159,13 +156,12 @@ _IO_new_fdopen (fd, mode) #if !_IO_UNIFIED_JUMPTABLES new_f->fp.vtable = NULL; @@ -218,14 +218,14 @@ index 066ff19..3f266f7 100644 + valid offset. */ + new_f->fp.file._fileno = fd; new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE; - + _IO_mask_flags (&new_f->fp.file, read_write, diff --git glibc-2.17-c758a686/libio/iofwide.c glibc-2.17-c758a686/libio/iofwide.c index 5cff632..64187e4 100644 --- glibc-2.17-c758a686/libio/iofwide.c +++ glibc-2.17-c758a686/libio/iofwide.c @@ -199,12 +199,6 @@ _IO_fwide (fp, mode) - + /* From now on use the wide character callback functions. */ ((struct _IO_FILE_plus *) fp)->vtable = fp->_wide_data->_wide_vtable; - @@ -235,7 +235,7 @@ index 5cff632..64187e4 100644 - which allows the functions without knowing the position. */ - fp->_offset = _IO_SYSSEEK (fp, 0, _IO_seek_cur); } - + /* Set the mode now. */ diff --git glibc-2.17-c758a686/libio/libioP.h glibc-2.17-c758a686/libio/libioP.h index 4ca723c..8a7b85b 100644 @@ -246,9 +246,9 @@ index 4ca723c..8a7b85b 100644 extern void _IO_unsave_wmarkers (_IO_FILE *) __THROW; extern unsigned _IO_adjust_wcolumn (unsigned, const wchar_t *, int) __THROW; +extern _IO_off64_t get_file_offset (_IO_FILE *fp); - + /* Marker-related function. */ - + diff --git glibc-2.17-c758a686/libio/tst-ftell-active-handler.c glibc-2.17-c758a686/libio/tst-ftell-active-handler.c new file mode 100644 index 0000000..175e904 @@ -646,7 +646,7 @@ index 9cebe77..8b2e108 100644 @@ -596,29 +596,25 @@ done: return 0; } - + -_IO_off64_t -_IO_wfile_seekoff (fp, offset, dir, mode) - _IO_FILE *fp; @@ -669,7 +669,7 @@ index 9cebe77..8b2e108 100644 - == fp->_wide_data->_IO_write_ptr)); + _IO_off64_t result, offset = 0; + bool use_cached_offset = false; - + - bool was_writing = ((fp->_wide_data->_IO_write_ptr - > fp->_wide_data->_IO_write_base) - || _IO_in_put_mode (fp)); @@ -687,12 +687,12 @@ index 9cebe77..8b2e108 100644 + || _IO_in_put_mode (fp)); + /* XXX For wide stream with backup store it is not very - reasonable to determine the offset. The pushed-back - character might require a state change and we need not be + reasonable to determine the offset. The pushed-back + character might require a state change and we need not be @@ -633,14 +629,142 @@ _IO_wfile_seekoff (fp, offset, dir, mode) - return -1; - } - + return -1; + } + - /* There is no more data in the backup buffer. We can - switch back. */ - _IO_switch_to_main_wget_area (fp); @@ -769,8 +769,8 @@ index 9cebe77..8b2e108 100644 + /* _IO_read_end coincides with fp._offset, so the actual file + position is fp._offset - (_IO_read_end - new_write_ptr). */ + offset -= fp->_IO_read_end - fp->_IO_write_ptr; - } - + } + - dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ + /* It is safe to use the cached offset when available if there is + unbuffered data (indicating that the file handle is active) and @@ -791,7 +791,7 @@ index 9cebe77..8b2e108 100644 + == (_IO_IS_APPENDING | _IO_NO_READS) + && was_writing)); } - + + if (use_cached_offset) + result = fp->_offset; + else @@ -843,20 +843,20 @@ index 9cebe77..8b2e108 100644 - else if (was_writing && _IO_switch_to_wget_mode (fp)) + if (was_writing && _IO_switch_to_wget_mode (fp)) return WEOF; - + if (fp->_wide_data->_IO_buf_base == NULL) @@ -693,7 +817,6 @@ _IO_wfile_seekoff (fp, offset, dir, mode) - { - int nread; - + { + int nread; + - flushed: - delta = (fp->_wide_data->_IO_read_ptr - - fp->_wide_data->_IO_read_base); - fp->_wide_data->_IO_state = fp->_wide_data->_IO_last_state; + delta = (fp->_wide_data->_IO_read_ptr + - fp->_wide_data->_IO_read_base); + fp->_wide_data->_IO_state = fp->_wide_data->_IO_last_state; @@ -706,80 +829,9 @@ _IO_wfile_seekoff (fp, offset, dir, mode) - offset -= fp->_IO_read_end - fp->_IO_read_base - nread; - } - } + offset -= fp->_IO_read_end - fp->_IO_read_base - nread; + } + } - else - { - char *new_write_ptr = fp->_IO_write_ptr; @@ -918,7 +918,7 @@ index 9cebe77..8b2e108 100644 - _IO_buf_base and this adjustment is for unbuffered output. */ - offset -= fp->_IO_read_end - new_write_ptr; - } - + if (fp->_offset == _IO_pos_BAD) - { - if (mode != 0) @@ -932,13 +932,13 @@ index 9cebe77..8b2e108 100644 - } - } + goto dumb; - + /* Make offset absolute, assuming current pointer is file_ptr(). */ offset += fp->_offset; @@ -802,10 +854,6 @@ _IO_wfile_seekoff (fp, offset, dir, mode) } /* At this point, dir==_IO_seek_set. */ - + - /* If we are only interested in the current position we've found it now. */ - if (mode == 0) - return offset; diff --git a/SOURCES/glibc-rh1064063.patch b/SOURCES/glibc-rh1064063.patch index c8a347ef..154ab663 100644 --- a/SOURCES/glibc-rh1064063.patch +++ b/SOURCES/glibc-rh1064063.patch @@ -3,31 +3,31 @@ Author: Paul E. Murphy Date: Mon Jan 11 17:24:04 2016 -0500 Fix race in tst-mqueue5 - + The check is done on line 117 by a thread spawned from do_child(), forked from do_test(). This test generates a signal in the forked process. - + Either thread may handle the signal, and on ppc, it happens to be done on do_child, on the thread which is not doing the check on line 117. - + This exposes a race condition whereby the test incorrectly fails as the signal is caught during or after the check. - + This is mitigated by ensuring the signal is blocked in the child thread while thread is running. 2016-01-15 Martin Sebor - - [BZ #19432] + + [BZ #19432] diff --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c index aa74fa3..25042bc 100644 --- a/rt/tst-mqueue5.c +++ b/rt/tst-mqueue5.c @@ -116,7 +116,7 @@ thr (void *arg) - + if (rtmin_cnt != 2) { - puts ("SIGRTMIN signal in child did not arrive"); @@ -38,7 +38,7 @@ index aa74fa3..25042bc 100644 @@ -403,6 +403,16 @@ do_child (const char *name, pthread_barrier_t *b2, pthread_barrier_t *b3, result = 1; } - + + /* Ensure the thr thread gets the signal, not us. */ + sigset_t set; + sigemptyset (&set); @@ -50,12 +50,12 @@ index aa74fa3..25042bc 100644 + } + (void) pthread_barrier_wait (b2); - + /* Parent calls mqsend (q), which should wake up mqrecv (q) @@ -514,7 +524,14 @@ do_child (const char *name, pthread_barrier_t *b2, pthread_barrier_t *b3, result = 1; } - + - void *thr_ret; + /* Reenable test signals before cleaning up the thread. */ + if (pthread_sigmask (SIG_UNBLOCK, &set, NULL)) diff --git a/SOURCES/glibc-rh1064066.patch b/SOURCES/glibc-rh1064066.patch index 751fd36b..bdac2bbf 100644 --- a/SOURCES/glibc-rh1064066.patch +++ b/SOURCES/glibc-rh1064066.patch @@ -2,31 +2,31 @@ +++ glibc-2.17-c758a686/math/libm-test.inc 2015-04-07 12:00:03.102360299 -0400 @@ -521,7 +521,8 @@ } - - + + -static void __attribute__ ((noinline)) +/* Attributes work around suspected gcc 4.8 bug #1209619. */ +static void __attribute__ ((noclone, noinline)) check_float_internal (const char *test_name, FLOAT computed, FLOAT expected, - FLOAT max_ulp, int xfail, int exceptions, - FLOAT *curr_max_error) + FLOAT max_ulp, int xfail, int exceptions, + FLOAT *curr_max_error) @@ -610,7 +611,8 @@ } - - + + -static void __attribute__ ((noinline)) +/* Attributes work around suspected gcc 4.8 bug #1209619. */ +static void __attribute__ ((noclone, noinline)) check_float (const char *test_name, FLOAT computed, FLOAT expected, - FLOAT max_ulp, int xfail, int exceptions) + FLOAT max_ulp, int xfail, int exceptions) { @@ -619,7 +621,8 @@ } - - + + -static void __attribute__ ((noinline)) +/* Attributes work around suspected gcc 4.8 bug #1209619. */ +static void __attribute__ ((noclone, noinline)) check_complex (const char *test_name, __complex__ FLOAT computed, - __complex__ FLOAT expected, - __complex__ FLOAT max_ulp, __complex__ int xfail, + __complex__ FLOAT expected, + __complex__ FLOAT max_ulp, __complex__ int xfail, diff --git a/SOURCES/glibc-rh1064945.patch b/SOURCES/glibc-rh1064945.patch index ee7165ee..69a5b2a3 100644 --- a/SOURCES/glibc-rh1064945.patch +++ b/SOURCES/glibc-rh1064945.patch @@ -3,7 +3,7 @@ Author: Adhemerval Zanella Date: Thu Jan 16 06:53:18 2014 -0600 PowerPC: Fix ftime gettimeofday internal call returning bogus data - + This patches fixes BZ#16430 by setting a different symbol for internal GLIBC calls that points to ifunc resolvers. For PPC32, if the symbol is defined as hidden (which is the case for gettimeofday and time) the @@ -42,9 +42,9 @@ index 29a5e08..2085b68 100644 +} +asm ("__GI___gettimeofday = __gettimeofday_vsyscall"); +#endif - + #else - + diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c index 089d0b6..023bc02 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c @@ -73,5 +73,6 @@ index 089d0b6..023bc02 100644 +} +asm ("__GI_time = __time_vsyscall"); +#endif - + #else + diff --git a/SOURCES/glibc-rh1067755.patch b/SOURCES/glibc-rh1067755.patch index 15dc1188..9aa89d9c 100644 --- a/SOURCES/glibc-rh1067755.patch +++ b/SOURCES/glibc-rh1067755.patch @@ -8,7 +8,7 @@ index 2b4fd9a..fba60bd 100644 #include +#include #include - + static const char *command; diff --git glibc-2.17-c758a686/include/errno.h glibc-2.17-c758a686/include/errno.h index 98c6080..f1b93a8 100644 @@ -17,27 +17,27 @@ index 98c6080..f1b93a8 100644 @@ -17,7 +17,7 @@ # define errno rtld_errno extern int rtld_errno attribute_hidden; - + -# else +# elif !defined NOT_IN_libc || defined IN_LIB - + # include - + @@ -29,7 +29,7 @@ extern int rtld_errno attribute_hidden; # endif extern __thread int errno attribute_tls_model_ie; - + -# endif /* RTLD_PRIVATE_ERRNO */ +# endif /* !NOT_IN_libc || IN_LIB */ - + # define __set_errno(val) (errno = (val)) - + diff --git glibc-2.17-c758a686/include/netdb.h glibc-2.17-c758a686/include/netdb.h index 3f2ae06..8a569ba 100644 --- glibc-2.17-c758a686/include/netdb.h +++ glibc-2.17-c758a686/include/netdb.h @@ -3,18 +3,20 @@ - + #ifndef _ISOMAC /* Macros for accessing h_errno from inside libc. */ -# undef h_errno @@ -65,7 +65,7 @@ index 3f2ae06..8a569ba 100644 +# endif /* _LIBC_REENTRANT */ +# endif /* !NOT_IN_libc || IN_LIB */ # define __set_h_errno(x) (h_errno = (x)) - + libc_hidden_proto (hstrerror) diff --git glibc-2.17-c758a686/nptl/tst-cancel14.c glibc-2.17-c758a686/nptl/tst-cancel14.c index fbaed49..ca9042d 100644 @@ -76,8 +76,8 @@ index fbaed49..ca9042d 100644 #include #include +#include - - + + static pthread_barrier_t bar; diff --git glibc-2.17-c758a686/nptl/tst-cancel15.c glibc-2.17-c758a686/nptl/tst-cancel15.c index 0119cc7..3f320ad 100644 @@ -88,15 +88,15 @@ index 0119cc7..3f320ad 100644 #include #include +#include - - + + static pthread_barrier_t bar; diff --git glibc-2.17-c758a686/nptl/tst-mutex9.c glibc-2.17-c758a686/nptl/tst-mutex9.c index adb3b61..1d689bd 100644 --- glibc-2.17-c758a686/nptl/tst-mutex9.c +++ glibc-2.17-c758a686/nptl/tst-mutex9.c @@ -18,10 +18,13 @@ - + #include #include +#include @@ -107,8 +107,8 @@ index adb3b61..1d689bd 100644 #include +#include #include - - + + diff --git glibc-2.17-c758a686/nptl/tst-stackguard1.c glibc-2.17-c758a686/nptl/tst-stackguard1.c index f0f707f..57a48ad 100644 --- glibc-2.17-c758a686/nptl/tst-stackguard1.c @@ -119,5 +119,5 @@ index f0f707f..57a48ad 100644 #include +#include #include - + static const char *command; diff --git a/SOURCES/glibc-rh1070458.patch b/SOURCES/glibc-rh1070458.patch index c798ded0..31b29663 100644 --- a/SOURCES/glibc-rh1070458.patch +++ b/SOURCES/glibc-rh1070458.patch @@ -22,16 +22,16 @@ diff -ruNp glibc-2.17-c758a686/ports/sysdeps/aarch64/machine-gmon.h glibc-2.17-c +/* AArch64 definitions for profiling support. + Copyright (C) 1996-2014 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 @@ -13,13 +13,22 @@ 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 + License along with the GNU C Library; if not, see . */ - + -#define _MCOUNT_DECL(from, self) \ - void __mcount_internal (u_long from, u_long self) - diff --git a/SOURCES/glibc-rh1070471.patch b/SOURCES/glibc-rh1070471.patch index fb7fe736..0e38ad6f 100644 --- a/SOURCES/glibc-rh1070471.patch +++ b/SOURCES/glibc-rh1070471.patch @@ -20,7 +20,7 @@ diff -ruNp glibc-2.17-c758a686/bits/wchar.h glibc-2.17-c758a686/bits/wchar.h @@ -19,7 +19,31 @@ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 - + -#define __WCHAR_MIN (-2147483647 - 1) -#define __WCHAR_MAX (2147483647) +/* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ @@ -49,5 +49,5 @@ diff -ruNp glibc-2.17-c758a686/bits/wchar.h glibc-2.17-c758a686/bits/wchar.h +#else +# define __WCHAR_MIN (-__WCHAR_MAX - 1) +#endif - + #endif /* bits/wchar.h */ diff --git a/SOURCES/glibc-rh1070806.patch b/SOURCES/glibc-rh1070806.patch index f2a397fa..9f5fa3de 100644 --- a/SOURCES/glibc-rh1070806.patch +++ b/SOURCES/glibc-rh1070806.patch @@ -33,8 +33,8 @@ diff -urN glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure libc_cv_output_format @@ -6758,6 +6759,27 @@ $as_echo "$libc_cv_ssp" >&6; } - - + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fstack-protector-strong" >&5 +$as_echo_n "checking for -fstack-protector-strong... " >&6; } +if ${libc_cv_ssp_strong+:} false; then : @@ -65,7 +65,7 @@ diff -urN glibc-2.17-c758a686/configure.in glibc-2.17-c758a686/configure.in @@ -1682,6 +1682,13 @@ ]) AC_SUBST(libc_cv_ssp) - + +AC_CACHE_CHECK(for -fstack-protector-strong, libc_cv_ssp_strong, [dnl +LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector-strong], + [libc_cv_ssp_strong=yes], @@ -99,7 +99,7 @@ diff -urN glibc-2.17-c758a686/nscd/Makefile glibc-2.17-c758a686/nscd/Makefile +ifeq (yes,$(have-ssp-strong)) +CFLAGS-nonlib += -fstack-protector-strong +endif - + ifeq (yesyes,$(have-fpie)$(build-shared)) LDFLAGS-nscd = -Wl,-z,now diff -urN glibc-2.17-c758a686/resolv/Makefile glibc-2.17-c758a686/resolv/Makefile @@ -114,5 +114,5 @@ diff -urN glibc-2.17-c758a686/resolv/Makefile glibc-2.17-c758a686/resolv/Makefil +endif + CFLAGS-res_hconf.c = -fexceptions - + # The BIND code elicits some harmless warnings. diff --git a/SOURCES/glibc-rh1073667.patch b/SOURCES/glibc-rh1073667.patch index 1b3933af..46657cf8 100644 --- a/SOURCES/glibc-rh1073667.patch +++ b/SOURCES/glibc-rh1073667.patch @@ -9,9 +9,9 @@ index cff81c7..10e0709 100644 --- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S @@ -44,8 +44,14 @@ ENTRY (__sigsetjmp) - stp d10, d11, [x0, #JB_D10<<3] - stp d12, d13, [x0, #JB_D12<<3] - stp d14, d15, [x0, #JB_D14<<3] + stp d10, d11, [x0, #JB_D10<<3] + stp d12, d13, [x0, #JB_D12<<3] + stp d14, d15, [x0, #JB_D14<<3] - mov x1, sp - str x1, [x0, #JB_SP<<3] + mov x2, sp @@ -21,7 +21,7 @@ index cff81c7..10e0709 100644 + mov w0, #0 + RET +#else - b C_SYMBOL_NAME(__sigjmp_save) + b C_SYMBOL_NAME(__sigjmp_save) +#endif END (__sigsetjmp) hidden_def (__sigsetjmp) @@ -31,13 +31,13 @@ index 6124333..913359c 100644 +++ glibc-2.17-c758a686/setjmp/Makefile @@ -25,7 +25,8 @@ headers := setjmp.h bits/setjmp.h bits/setjmp2.h routines := setjmp sigjmp bsd-setjmp bsd-_setjmp \ - longjmp __longjmp jmp-unwind - + longjmp __longjmp jmp-unwind + -tests := tst-setjmp jmpbug bug269-setjmp +tests := tst-setjmp jmpbug bug269-setjmp \ + tst-sigsetjmp - - + + include ../Rules diff --git glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c new file mode 100644 diff --git a/SOURCES/glibc-rh1074410-2.patch b/SOURCES/glibc-rh1074410-2.patch index 7724dbd8..21c876d4 100644 --- a/SOURCES/glibc-rh1074410-2.patch +++ b/SOURCES/glibc-rh1074410-2.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Wed Mar 19 00:42:30 2014 +0530 Fix offset computation for append+ mode on switching from read (BZ #16724) - + The offset computation in write mode uses the fact that _IO_read_end is kept in sync with the external file offset. This however is not true when O_APPEND is in effect since switching to write mode ought to send the external file offset to the end of file without making the necessary adjustment to _IO_read_end. - + Hence in append mode, offset computation when writing should only consider the effect of unflushed writes, i.e. from _IO_write_base to _IO_write_ptr. @@ -19,9 +19,9 @@ index 69c25c0..4bedfad 100644 --- glibc-2.17-c758a686/libio/Makefile +++ glibc-2.17-c758a686/libio/Makefile @@ -60,7 +60,8 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ - tst-wmemstream1 tst-wmemstream2 \ - bug-memstream1 bug-wmemstream1 \ - tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ + tst-wmemstream1 tst-wmemstream2 \ + bug-memstream1 bug-wmemstream1 \ + tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ - tst-fwrite-error tst-ftell-active-handler + tst-fwrite-error tst-ftell-active-handler \ + tst-ftell-append @@ -33,7 +33,7 @@ index cf68dbf..204cfea 100644 --- glibc-2.17-c758a686/libio/fileops.c +++ glibc-2.17-c758a686/libio/fileops.c @@ -91,7 +91,9 @@ extern struct __gconv_trans_data __libio_translit attribute_hidden; - + The position in the buffer that corresponds to the position in external file system is normally _IO_read_end, except in putback - mode, when it is _IO_save_end. @@ -42,11 +42,11 @@ index cf68dbf..204cfea 100644 + the external file system to the end of file. If the field _fb._offset is >= 0, it gives the offset in the file as a whole corresponding to eGptr(). (?) - + @@ -966,6 +968,14 @@ do_ftell (_IO_FILE *fp) /* Adjust for unflushed data. */ if (!was_writing) - offset -= fp->_IO_read_end - fp->_IO_read_ptr; + offset -= fp->_IO_read_end - fp->_IO_read_ptr; + /* We don't trust _IO_read_end to represent the current file offset when + writing in append mode because the value would have to be shifted to + the end of the file during a flush. Use the write base instead, along @@ -56,7 +56,7 @@ index cf68dbf..204cfea 100644 + offset += fp->_IO_write_ptr - fp->_IO_write_base; + /* For all other modes, _IO_read_end represents the file offset. */ else - offset += fp->_IO_write_ptr - fp->_IO_read_end; + offset += fp->_IO_write_ptr - fp->_IO_read_end; } diff --git glibc-2.17-c758a686/libio/tst-ftell-append.c glibc-2.17-c758a686/libio/tst-ftell-append.c new file mode 100644 @@ -238,9 +238,9 @@ index 3199861..f123add 100644 --- glibc-2.17-c758a686/libio/wfileops.c +++ glibc-2.17-c758a686/libio/wfileops.c @@ -713,9 +713,16 @@ do_ftell_wide (_IO_FILE *fp) - offset += outstop - out; - } - + offset += outstop - out; + } + - /* _IO_read_end coincides with fp._offset, so the actual file - position is fp._offset - (_IO_read_end - new_write_ptr). */ - offset -= fp->_IO_read_end - fp->_IO_write_ptr; @@ -254,5 +254,6 @@ index 3199861..f123add 100644 + /* For all other modes, _IO_read_end represents the file offset. */ + else + offset += fp->_IO_write_ptr - fp->_IO_read_end; - } + } } + diff --git a/SOURCES/glibc-rh1074410.patch b/SOURCES/glibc-rh1074410.patch index fb142cbf..3241ef7e 100644 --- a/SOURCES/glibc-rh1074410.patch +++ b/SOURCES/glibc-rh1074410.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Mon Mar 17 18:42:53 2014 +0530 Change offset in fdopen only if setting O_APPEND - + fdopen should only be allowed to change the offset in the file it attaches to if it is setting O_APPEND. If O_APPEND is already set, it should not change the state of the handle. @@ -13,7 +13,7 @@ Author: Siddhesh Poyarekar Date: Tue Mar 11 17:04:49 2014 +0530 Fix offset caching for streams and use it for ftell (BZ #16680) - + The ftell implementation was made conservative to ensure that incorrectly cached offsets never affect it. However, this causes problems for append mode when a file stream is rewound. Additionally, @@ -21,7 +21,7 @@ Date: Tue Mar 11 17:04:49 2014 +0530 caused more problems than it solved and broke old behavior. I have described the various problems that it caused and then finally the solution. - + For a and a+ mode files, rewinding the stream should result in ftell returning 0 as the offset, but the stat() trick caused it to (incorrectly) always return the end of file. Now I couldn't find @@ -29,7 +29,7 @@ Date: Tue Mar 11 17:04:49 2014 +0530 for a file opened in 'a' mode, but for 'a+' mode it should be set to 0. For 'a' mode too, it probably makes sense to keep it set to 0 in the interest of retaining old behavior. - + The initial file position for append mode files is implementation defined, so the implementation could either retain the current file position or move the position to the end of file. The earlier ftell @@ -39,23 +39,23 @@ Date: Tue Mar 11 17:04:49 2014 +0530 the initial position to end of file for both append modes, thus breaking old behavior. I was ignorant enough to write an incorrect test case for it too. - + The Change: - + I have now brought back the behavior of seeking to end of file for append-only streams, but with a slight difference. I don't cache the offset though, since we would want ftell to query the current file position through lseek while the stream is not active. Since the offset is moved to the end of file, we can rely on the file position reported by lseek and we don't need to resort to the stat() nonsense. - + Finally, the cache is always reliable, except when there are unflished writes in an append mode stream (i.e. both a and a+). In the latter case, it is safe to just do an lseek to SEEK_END. The value can be safely cached too, since the file handle is already active at this point. Incidentally, this is the only state change we affect in the file handle (apart from taking locks of course). - + I have also updated the test case to correct my impression of the initial file position for a+ streams to the initial behavior. I have verified that this does not break any existing tests in the testsuite @@ -66,17 +66,17 @@ Author: Siddhesh Poyarekar Date: Mon Mar 10 16:20:01 2014 +0530 Fix up return codes for tests in tst-ftell-active-handler - + The test functions used a variable ret to store failure codes for individual tests, but the variable was incorrectly used to record other failure codes too, resulting in overwriting of the tests status. This is now fixed by making sure that the ret variable is used only for recording test failures. - - * libio/tst-ftell-active-handler.c (do_ftell_test): Don't mix - up test status with function return status. - (do_write_test): Likewise. - (do_append_test): Likewise. + + * libio/tst-ftell-active-handler.c (do_ftell_test): Don't mix + up test status with function return status. + (do_write_test): Likewise. + (do_append_test): Likewise. diff --git glibc-2.17-c758a686/libio/fileops.c glibc-2.17-c758a686/libio/fileops.c index 2e7bc8d..cf68dbf 100644 --- glibc-2.17-c758a686/libio/fileops.c @@ -110,7 +110,7 @@ index 2e7bc8d..cf68dbf 100644 @@ -929,43 +934,13 @@ _IO_file_sync_mmap (_IO_FILE *fp) return 0; } - + -/* Get the current file offset using a system call. This is the safest method - to get the current file offset, since we are sure that we get the current - state of the file. Before the stream handle is activated (by using fread, @@ -152,13 +152,13 @@ index 2e7bc8d..cf68dbf 100644 - _IO_off64_t result = 0; - bool use_cached_offset = false; + _IO_off64_t result, offset = 0; - + /* No point looking at unflushed data if we haven't allocated buffers yet. */ @@ -974,39 +949,37 @@ do_ftell (_IO_FILE *fp) bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base - || _IO_in_put_mode (fp)); - + || _IO_in_put_mode (fp)); + + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; + + /* When we have unflushed writes in append mode, seek to the end of the @@ -199,7 +199,7 @@ index 2e7bc8d..cf68dbf 100644 - && was_writing)); + offset += fp->_IO_write_ptr - fp->_IO_read_end; } - + - if (use_cached_offset) - result += fp->_offset; + if (fp->_offset != _IO_pos_BAD) @@ -207,10 +207,10 @@ index 2e7bc8d..cf68dbf 100644 else - result += get_file_offset (fp); + result = _IO_SYSSEEK (fp, 0, _IO_seek_cur); - + if (result == EOF) return result; - + + result += offset; + if (result < 0) @@ -219,7 +219,7 @@ index 2e7bc8d..cf68dbf 100644 @@ -1016,7 +989,6 @@ do_ftell (_IO_FILE *fp) return result; } - + - _IO_off64_t _IO_new_file_seekoff (fp, offset, dir, mode) @@ -231,7 +231,7 @@ index 3f266f7..b36d21d 100644 @@ -59,6 +59,11 @@ _IO_new_fdopen (fd, mode) int i; int use_mmap = 0; - + + /* Decide whether we modify the offset of the file we attach to and seek to + the end of file. We only do this if the mode is 'a' and if the file + descriptor did not have O_APPEND in its flags already. */ @@ -250,8 +250,8 @@ index 3f266f7..b36d21d 100644 #endif @@ -167,6 +173,16 @@ _IO_new_fdopen (fd, mode) _IO_mask_flags (&new_f->fp.file, read_write, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); - + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + + /* For append mode, set the file offset to the end of the file if we added + O_APPEND to the file descriptor flags. Don't update the offset cache + though, since the file handle is not active. */ @@ -272,7 +272,7 @@ index 54bfe63..e9dc7b3 100644 @@ -88,6 +88,107 @@ static size_t file_len; typedef int (*fputs_func_t) (const void *data, FILE *fp); fputs_func_t fputs_func; - + +/* Test that ftell output after a rewind is correct. */ +static int +do_rewind_test (const char *filename) @@ -378,52 +378,52 @@ index 54bfe63..e9dc7b3 100644 active. */ static int @@ -107,11 +208,13 @@ do_ftell_test (const char *filename) - {"w", O_WRONLY, 0, data_len}, - {"w+", O_RDWR, 0, data_len}, - {"r+", O_RDWR, 0, data_len}, + {"w", O_WRONLY, 0, data_len}, + {"w+", O_RDWR, 0, data_len}, + {"r+", O_RDWR, 0, data_len}, - /* For 'a' and 'a+' modes, the initial file position should be the + /* For the 'a' mode, the initial file position should be the - current end of file. After the write, the offset has data_len + current end of file. After the write, the offset has data_len - added to the old value. */ + added to the old value. For a+ mode however, the initial file + position is the file position of the underlying file descriptor, + since it is initially assumed to be in read mode. */ - {"a", O_WRONLY, data_len, 2 * data_len}, + {"a", O_WRONLY, data_len, 2 * data_len}, - {"a+", O_RDWR, 2 * data_len, 3 * data_len}, + {"a+", O_RDWR, 0, 3 * data_len}, }; for (int j = 0; j < 2; j++) { @@ -119,17 +222,20 @@ do_ftell_test (const char *filename) - { - FILE *fp; - int fd; + { + FILE *fp; + int fd; + int fileret; + - printf ("\tftell: %s (file, \"%s\"): ", j == 0 ? "fdopen" : "fopen", - test_modes[i].mode); - - if (j == 0) + printf ("\tftell: %s (file, \"%s\"): ", j == 0 ? "fdopen" : "fopen", + test_modes[i].mode); + + if (j == 0) - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - test_modes[i].mode); + fileret = get_handles_fdopen (filename, fd, fp, + test_modes[i].fd_mode, + test_modes[i].mode); - else + else - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - + - if (ret != 0) - return ret; + if (fileret != 0) + return fileret; - - long off = ftell (fp); - if (off != test_modes[i].old_off) + + long off = ftell (fp); + if (off != test_modes[i].old_off) @@ -143,13 +249,18 @@ do_ftell_test (const char *filename) - - /* The effect of this write on the offset should be seen in the ftell - call that follows it. */ + + /* The effect of this write on the offset should be seen in the ftell + call that follows it. */ - int ret = write (fd, data, data_len); + int write_ret = write (fd, data, data_len); + if (write_ret != data_len) @@ -431,77 +431,77 @@ index 54bfe63..e9dc7b3 100644 + printf ("write failed (%m)\n"); + ret |= 1; + } - off = ftell (fp); - - if (off != test_modes[i].new_off) - { - printf ("Incorrect new offset. Expected %zu but got %ld\n", + off = ftell (fp); + + if (off != test_modes[i].new_off) + { + printf ("Incorrect new offset. Expected %zu but got %ld\n", - test_modes[i].old_off, off); + test_modes[i].new_off, off); - ret |= 1; - } - else + ret |= 1; + } + else @@ -184,21 +295,23 @@ do_write_test (const char *filename) { for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++) - { + { + int fileret; - printf ("\twrite: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", - test_modes[i].mode); - - if (j == 0) + printf ("\twrite: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", + test_modes[i].mode); + + if (j == 0) - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - else + else - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - test_modes[i].mode); + fileret = get_handles_fdopen (filename, fd, fp, + test_modes[i].fd_mode, + test_modes[i].mode); - + - if (ret != 0) - return ret; + if (fileret != 0) + return fileret; - - /* Move offset to just before the end of the file. */ + + /* Move offset to just before the end of the file. */ - off_t ret = lseek (fd, file_len - 1, SEEK_SET); - if (ret == -1) + off_t seek_ret = lseek (fd, file_len - 1, SEEK_SET); + if (seek_ret == -1) - { - printf ("lseek failed: %m\n"); - ret |= 1; + { + printf ("lseek failed: %m\n"); + ret |= 1; @@ -258,17 +371,20 @@ do_append_test (const char *filename) { for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++) - { + { + int fileret; + - printf ("\tappend: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", - test_modes[i].mode); - - if (j == 0) + printf ("\tappend: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", + test_modes[i].mode); + + if (j == 0) - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - else + else - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - test_modes[i].mode); + fileret = get_handles_fdopen (filename, fd, fp, + test_modes[i].fd_mode, + test_modes[i].mode); - + - if (ret != 0) - return ret; + if (fileret != 0) + return fileret; - - /* Write some data. */ - size_t written = fputs_func (data, fp); + + /* Write some data. */ + size_t written = fputs_func (data, fp); @@ -298,6 +414,61 @@ do_append_test (const char *filename) - } + } } - + + /* For fdopen in 'a' mode, the file descriptor should not change if the file + is already open with the O_APPEND flag set. */ + fd = open (filename, O_WRONLY | O_APPEND, 0); @@ -559,13 +559,13 @@ index 54bfe63..e9dc7b3 100644 + return ret; } - + @@ -309,6 +480,7 @@ do_one_test (const char *filename) ret |= do_ftell_test (filename); ret |= do_write_test (filename); ret |= do_append_test (filename); + ret |= do_rewind_test (filename); - + return ret; } diff --git glibc-2.17-c758a686/libio/wfileops.c glibc-2.17-c758a686/libio/wfileops.c @@ -574,7 +574,7 @@ index 8b2e108..3199861 100644 +++ glibc-2.17-c758a686/libio/wfileops.c @@ -597,12 +597,12 @@ done: } - + /* ftell{,o} implementation for wide mode. Don't modify any state of the file - pointer while we try to get the current state of the stream. */ + pointer while we try to get the current state of the stream except in one @@ -584,13 +584,13 @@ index 8b2e108..3199861 100644 { _IO_off64_t result, offset = 0; - bool use_cached_offset = false; - + /* No point looking for offsets in the buffer if it hasn't even been allocated. */ @@ -615,6 +615,20 @@ do_ftell_wide (_IO_FILE *fp) - > fp->_wide_data->_IO_write_base) - || _IO_in_put_mode (fp)); - + > fp->_wide_data->_IO_write_base) + || _IO_in_put_mode (fp)); + + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; + + /* When we have unflushed writes in append mode, seek to the end of the @@ -606,12 +606,12 @@ index 8b2e108..3199861 100644 + } + /* XXX For wide stream with backup store it is not very - reasonable to determine the offset. The pushed-back - character might require a state change and we need not be + reasonable to determine the offset. The pushed-back + character might require a state change and we need not be @@ -703,37 +717,24 @@ do_ftell_wide (_IO_FILE *fp) - position is fp._offset - (_IO_read_end - new_write_ptr). */ - offset -= fp->_IO_read_end - fp->_IO_write_ptr; - } + position is fp._offset - (_IO_read_end - new_write_ptr). */ + offset -= fp->_IO_read_end - fp->_IO_write_ptr; + } - - /* It is safe to use the cached offset when available if there is - unbuffered data (indicating that the file handle is active) and @@ -632,19 +632,19 @@ index 8b2e108..3199861 100644 - == (_IO_IS_APPENDING | _IO_NO_READS) - && was_writing)); } - + - if (use_cached_offset) + if (fp->_offset != _IO_pos_BAD) result = fp->_offset; else - result = get_file_offset (fp); + result = _IO_SYSSEEK (fp, 0, _IO_seek_cur); - + if (result == EOF) return result; - + result += offset; - + + if (result < 0) + { + __set_errno (EINVAL); @@ -653,3 +653,4 @@ index 8b2e108..3199861 100644 + return result; } + diff --git a/SOURCES/glibc-rh1077389-p1.patch b/SOURCES/glibc-rh1077389-p1.patch index 5ace322a..3ee31527 100644 --- a/SOURCES/glibc-rh1077389-p1.patch +++ b/SOURCES/glibc-rh1077389-p1.patch @@ -2,9 +2,9 @@ # commit 76a9b9986141b1a7d9fd290c349d27fcee780c7a # Author: Adhemerval Zanella # Date: Thu Nov 7 05:34:22 2013 -0600 -# +# # PowerPC: Fix vDSO missing ODP entries -# +# # This patch fixes the vDSO symbol used directed in IFUNC resolver where # they do not have an associated ODP entry leading to undefined behavior # in some cases. It adds an artificial OPD static entry to such cases @@ -14,9 +14,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h g --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h 2015-01-15 16:05:08.853681325 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h 2015-01-15 16:06:11.451747716 -0500 @@ -34,12 +34,32 @@ - + extern void *__vdso_time; - + -/* 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 @@ -56,22 +56,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c gli --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c 2015-01-15 16:05:08.912679502 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c 2015-01-15 16:06:11.451747716 -0500 @@ -21,6 +21,7 @@ - + # include # include +# include - + void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday"); - + diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c 2015-01-15 16:05:08.912679502 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c 2015-01-15 16:06:11.451747716 -0500 @@ -20,7 +20,9 @@ - + # include # include +# include # include +# include - + void *time_ifunc (void) asm ("time"); + diff --git a/SOURCES/glibc-rh1077389-p2.patch b/SOURCES/glibc-rh1077389-p2.patch index a454607d..a37893c8 100644 --- a/SOURCES/glibc-rh1077389-p2.patch +++ b/SOURCES/glibc-rh1077389-p2.patch @@ -2,19 +2,19 @@ # commit d98720e07f67fbeec00f9e1347840404240d3c48 # Author: Adhemerval Zanella # Date: Mon Jan 20 12:29:51 2014 -0600 -# +# # PowerPC: Fix gettimeofday ifunc selection -# +# # The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where # __vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal # version used within GLIBC) to use the system call version instead of the vDSO one. # This patch changes the check if vDSO is available to get its value directly # instead of rely on __vdso_gettimeofday. -# +# # This patch changes it by getting the vDSO value directly. -# +# # It fixes BZ#16431. -# +# diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c 2015-01-15 16:07:59.167420456 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c 2015-01-15 16:07:41.408969001 -0500 @@ -32,7 +32,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c gli + : (void*)__gettimeofday_syscall); } asm (".type __gettimeofday, %gnu_indirect_function"); - + diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c 2015-01-15 16:07:59.168420425 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c 2015-01-15 16:07:41.408969001 -0500 @@ -50,3 +50,4 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17- + : (void*)time_syscall); } asm (".type time, %gnu_indirect_function"); + diff --git a/SOURCES/glibc-rh1078225.patch b/SOURCES/glibc-rh1078225.patch index 9c434e21..9743e870 100644 --- a/SOURCES/glibc-rh1078225.patch +++ b/SOURCES/glibc-rh1078225.patch @@ -17,30 +17,30 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S @@ -63,6 +63,7 @@ ENTRY(__clone) - mov x8, #SYS_ify(clone) - /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ - svc 0x0 + mov x8, #SYS_ify(clone) + /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ + svc 0x0 + cfi_endproc - cmp x0, #0 - beq 2f - blt C_SYMBOL_NAME(__syscall_error) + cmp x0, #0 + beq 2f + blt C_SYMBOL_NAME(__syscall_error) @@ -71,6 +72,9 @@ ENTRY(__clone) - b syscall_error - + b syscall_error + 2: + cfi_startproc + cfi_undefined (x30) + mov x29, 0 #ifdef RESET_PID - tbnz x5, #CLONE_THREAD_BIT, 3f - mov x0, #-1 + tbnz x5, #CLONE_THREAD_BIT, 3f + mov x0, #-1 @@ -92,7 +96,8 @@ ENTRY(__clone) - - /* We are done, pass the return value through x0. */ - b HIDDEN_JUMPTARGET(_exit) + + /* We are done, pass the return value through x0. */ + b HIDDEN_JUMPTARGET(_exit) - + cfi_endproc + cfi_startproc PSEUDO_END (__clone) - + weak_alias (__clone, clone) diff --git a/SOURCES/glibc-rh1080766.patch b/SOURCES/glibc-rh1080766.patch index b98fac26..2fffaa82 100644 --- a/SOURCES/glibc-rh1080766.patch +++ b/SOURCES/glibc-rh1080766.patch @@ -3,55 +3,55 @@ Author: Siddhesh Poyarekar Date: Thu Mar 27 07:15:22 2014 +0530 Fix nscd lookup for innetgr when netgroup has wildcards (BZ #16758) - + nscd works correctly when the request in innetgr is a wildcard, i.e. when one or more of host, user or domain parameters is NULL. However, it does not work when the the triplet in the netgroup definition has a wildcard. This is easy to reproduce for a triplet defined as follows: - + foonet (,foo,) - + Here, an innetgr call that looks like this: - + innetgr ("foonet", "foohost", "foo", NULL); - + should succeed and so should: - + innetgr ("foonet", NULL, "foo", "foodomain"); - + It does succeed with nscd disabled, but not with nscd enabled. This fix adds this additional check for all three parts of the triplet so that it gives the correct result. - - [BZ #16758] - * nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has - blank values. + + [BZ #16758] + * nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has + blank values. diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c index 5ba1e1f..5d15aa4 100644 --- glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c @@ -560,15 +560,19 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req, - { - bool success = true; - + { + bool success = true; + - if (host != NULL) + /* For the host, user and domain in each triplet, we assume success + if the value is blank because that is how the wildcard entry to + match anything is stored in the netgroup cache. */ + if (host != NULL && *triplets != '\0') - success = strcmp (host, triplets) == 0; - triplets = (const char *) rawmemchr (triplets, '\0') + 1; - + success = strcmp (host, triplets) == 0; + triplets = (const char *) rawmemchr (triplets, '\0') + 1; + - if (success && user != NULL) + if (success && user != NULL && *triplets != '\0') - success = strcmp (user, triplets) == 0; - triplets = (const char *) rawmemchr (triplets, '\0') + 1; - + success = strcmp (user, triplets) == 0; + triplets = (const char *) rawmemchr (triplets, '\0') + 1; + - if (success && (domain == NULL || strcmp (domain, triplets) == 0)) + if (success && (domain == NULL || *triplets == '\0' + || strcmp (domain, triplets) == 0)) - { - dataset->resp.result = 1; - break; + { + dataset->resp.result = 1; + break; diff --git a/SOURCES/glibc-rh1083644.patch b/SOURCES/glibc-rh1083644.patch index bc8d441f..14c4acfc 100644 --- a/SOURCES/glibc-rh1083644.patch +++ b/SOURCES/glibc-rh1083644.patch @@ -3,12 +3,12 @@ Author: Siddhesh Poyarekar Date: Thu Mar 27 19:48:15 2014 +0530 Avoid overlapping addresses to stpcpy calls in nscd (BZ #16760) - + Calls to stpcpy from nscd netgroups code will have overlapping source and destination when all three values in the returned triplet are non-NULL and in the expected (host,user,domain) order. This is seen in valgrind as: - + ==3181== Source and destination overlap in stpcpy(0x19973b48, 0x19973b48) ==3181== at 0x4C2F30A: stpcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==3181== by 0x12567A: addgetnetgrentX (string3.h:111) @@ -17,7 +17,7 @@ Date: Thu Mar 27 19:48:15 2014 +0530 ==3181== by 0x4E3C102: start_thread (pthread_create.c:309) ==3181== by 0x59B81AC: clone (clone.S:111) ==3181== - + Fix this by using memmove instead of stpcpy. diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c @@ -25,30 +25,30 @@ index 5d15aa4..820d823 100644 --- glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c @@ -216,6 +216,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - const char *nuser = data.val.triple.user; - const char *ndomain = data.val.triple.domain; - + const char *nuser = data.val.triple.user; + const char *ndomain = data.val.triple.domain; + + size_t hostlen = strlen (nhost ?: "") + 1; + size_t userlen = strlen (nuser ?: "") + 1; + size_t domainlen = strlen (ndomain ?: "") + 1; + - if (nhost == NULL || nuser == NULL || ndomain == NULL - || nhost > nuser || nuser > ndomain) - { + if (nhost == NULL || nuser == NULL || ndomain == NULL + || nhost > nuser || nuser > ndomain) + { @@ -233,9 +237,6 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - : last + strlen (last) + 1 - buffer); - - /* We have to make temporary copies. */ + : last + strlen (last) + 1 - buffer); + + /* We have to make temporary copies. */ - size_t hostlen = strlen (nhost ?: "") + 1; - size_t userlen = strlen (nuser ?: "") + 1; - size_t domainlen = strlen (ndomain ?: "") + 1; - size_t needed = hostlen + userlen + domainlen; - - if (buflen - req->key_len - bufused < needed) + size_t needed = hostlen + userlen + domainlen; + + if (buflen - req->key_len - bufused < needed) @@ -269,9 +270,12 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - } - - char *wp = buffer + buffilled; + } + + char *wp = buffer + buffilled; - wp = stpcpy (wp, nhost) + 1; - wp = stpcpy (wp, nuser) + 1; - wp = stpcpy (wp, ndomain) + 1; @@ -58,6 +58,6 @@ index 5d15aa4..820d823 100644 + wp += userlen; + wp = memmove (wp, ndomain ?: "", domainlen); + wp += domainlen; - buffilled = wp - buffer; - ++nentries; - } + buffilled = wp - buffer; + ++nentries; + } diff --git a/SOURCES/glibc-rh1083646.patch b/SOURCES/glibc-rh1083646.patch index 99718768..dcc232c1 100644 --- a/SOURCES/glibc-rh1083646.patch +++ b/SOURCES/glibc-rh1083646.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Apr 30 12:00:39 2014 +0530 Initialize all of datahead structure in nscd (BZ #16791) - + The datahead structure has an unused padding field that remains uninitialized. Valgrind prints out a warning for it on querying a netgroups entry. This is harmless, but is a potential data leak since @@ -16,7 +16,7 @@ Author: Siddhesh Poyarekar Date: Wed Apr 30 11:57:09 2014 +0530 Consolidate code to initialize nscd dataset header - + This patch consolidates the code to initialize the header of a dataset into a single set of functions (one for positive and another for negative datasets) primarily to reduce repetition of code. The @@ -30,9 +30,9 @@ index 98d40a1..d7966bd 100644 --- glibc-2.17-c758a686/nscd/aicache.c +++ glibc-2.17-c758a686/nscd/aicache.c @@ -383,17 +383,12 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, - cp = family; - } - + cp = family; + } + - /* Fill in the rest of the dataset. */ - dataset->head.allocsize = total + req->key_len; - dataset->head.recsize = total - offsetof (struct dataset, resp); @@ -47,15 +47,15 @@ index 98d40a1..d7966bd 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + ttl == INT32_MAX ? db->postimeout : ttl); - + + /* Fill in the rest of the dataset. */ dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; dataset->resp.naddrs = naddrs; @@ -528,15 +523,9 @@ next_nip: else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) - + req->key_len), 1)) != NULL) - { + + req->key_len), 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -68,17 +68,17 @@ index 98d40a1..d7966bd 100644 + timeout = datahead_init_neg (&dataset->head, + sizeof (struct dataset) + req->key_len, + total, db->negtimeout); - - /* This is the reply. */ - memcpy (&dataset->resp, ¬found, total); + + /* This is the reply. */ + memcpy (&dataset->resp, ¬found, total); diff --git glibc-2.17-c758a686/nscd/grpcache.c glibc-2.17-c758a686/nscd/grpcache.c index b5a33eb..df59fa7 100644 --- glibc-2.17-c758a686/nscd/grpcache.c +++ glibc-2.17-c758a686/nscd/grpcache.c @@ -128,14 +128,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, - } - else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL) - { + } + else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -91,13 +91,13 @@ index b5a33eb..df59fa7 100644 + (sizeof (struct dataset) + + req->key_len), total, + db->negtimeout); - - /* This is the reply. */ - memcpy (&dataset->resp, ¬found, total); + + /* This is the reply. */ + memcpy (&dataset->resp, ¬found, total); @@ -232,14 +228,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, - dataset_temporary = true; - } - + dataset_temporary = true; + } + - dataset->head.allocsize = total + n; - dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.notfound = false; @@ -110,7 +110,7 @@ index b5a33eb..df59fa7 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + db->postimeout); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; diff --git glibc-2.17-c758a686/nscd/hstcache.c glibc-2.17-c758a686/nscd/hstcache.c @@ -118,9 +118,9 @@ index a79b67a..d4f1ad2 100644 --- glibc-2.17-c758a686/nscd/hstcache.c +++ glibc-2.17-c758a686/nscd/hstcache.c @@ -152,15 +152,11 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, - else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) - + req->key_len), 1)) != NULL) - { + else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) + + req->key_len), 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -135,13 +135,13 @@ index a79b67a..d4f1ad2 100644 + + req->key_len), total, + (ttl == INT32_MAX + ? db->negtimeout : ttl)); - - /* This is the reply. */ - memcpy (&dataset->resp, resp, total); + + /* This is the reply. */ + memcpy (&dataset->resp, resp, total); @@ -257,15 +253,10 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, - alloca_used = true; - } - + alloca_used = true; + } + - dataset->head.allocsize = total + req->key_len; - dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.notfound = false; @@ -155,7 +155,7 @@ index a79b67a..d4f1ad2 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + ttl == INT32_MAX ? db->postimeout : ttl); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; diff --git glibc-2.17-c758a686/nscd/initgrcache.c glibc-2.17-c758a686/nscd/initgrcache.c @@ -163,9 +163,9 @@ index 1bf9f0d..361319f 100644 --- glibc-2.17-c758a686/nscd/initgrcache.c +++ glibc-2.17-c758a686/nscd/initgrcache.c @@ -213,14 +213,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, - else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) - + req->key_len), 1)) != NULL) - { + else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) + + req->key_len), 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -178,13 +178,13 @@ index 1bf9f0d..361319f 100644 + (sizeof (struct dataset) + + req->key_len), total, + db->negtimeout); - - /* This is the reply. */ - memcpy (&dataset->resp, ¬found, total); + + /* This is the reply. */ + memcpy (&dataset->resp, ¬found, total); @@ -276,14 +272,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, - alloca_used = true; - } - + alloca_used = true; + } + - dataset->head.allocsize = total + req->key_len; - dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.notfound = false; @@ -197,7 +197,7 @@ index 1bf9f0d..361319f 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + db->postimeout); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c @@ -220,11 +220,11 @@ index 820d823..b3d40e9 100644 + timeout = datahead_init_neg (&dataset->head, + sizeof (struct dataset) + req->key_len, + total, db->negtimeout); - + /* This is the reply. */ memcpy (&dataset->resp, ¬found, total); @@ -359,13 +353,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - + /* Fill in the dataset. */ dataset = (struct dataset *) buffer; - dataset->head.allocsize = total + req->key_len; @@ -238,13 +238,13 @@ index 820d823..b3d40e9 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + db->postimeout); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; @@ -541,12 +532,12 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req, dataset = &dataset_mem; } - + - dataset->head.allocsize = sizeof (*dataset) + req->key_len; - dataset->head.recsize = sizeof (innetgroup_response_header); + datahead_init_pos (&dataset->head, sizeof (*dataset) + req->key_len, @@ -257,7 +257,7 @@ index 820d823..b3d40e9 100644 - dataset->head.usable = true; - dataset->head.ttl = result->head.ttl; dataset->head.timeout = timeout; - + dataset->resp.version = NSCD_VERSION; diff --git glibc-2.17-c758a686/nscd/nscd-client.h glibc-2.17-c758a686/nscd/nscd-client.h index 98f77e7..ee16df6 100644 @@ -266,7 +266,7 @@ index 98f77e7..ee16df6 100644 @@ -236,6 +236,48 @@ struct datahead } data[0]; }; - + +static inline time_t +datahead_init_common (struct datahead *head, nscd_ssize_t allocsize, + nscd_ssize_t recsize, uint32_t ttl) @@ -309,7 +309,7 @@ index 98f77e7..ee16df6 100644 + + return ret; +} - + /* Structure for one hash table entry. */ struct hashentry diff --git glibc-2.17-c758a686/nscd/pwdcache.c glibc-2.17-c758a686/nscd/pwdcache.c @@ -317,9 +317,9 @@ index fa355c3..41c245b 100644 --- glibc-2.17-c758a686/nscd/pwdcache.c +++ glibc-2.17-c758a686/nscd/pwdcache.c @@ -135,14 +135,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, - else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) - + req->key_len), 1)) != NULL) - { + else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) + + req->key_len), 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -332,13 +332,13 @@ index fa355c3..41c245b 100644 + (sizeof (struct dataset) + + req->key_len), total, + db->negtimeout); - - /* This is the reply. */ - memcpy (&dataset->resp, ¬found, total); + + /* This is the reply. */ + memcpy (&dataset->resp, ¬found, total); @@ -215,14 +211,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, - alloca_used = true; - } - + alloca_used = true; + } + - dataset->head.allocsize = total + n; - dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.notfound = false; @@ -351,7 +351,7 @@ index fa355c3..41c245b 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + db->postimeout); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; diff --git glibc-2.17-c758a686/nscd/servicescache.c glibc-2.17-c758a686/nscd/servicescache.c @@ -359,9 +359,9 @@ index 12ce9b2..95bdcfe 100644 --- glibc-2.17-c758a686/nscd/servicescache.c +++ glibc-2.17-c758a686/nscd/servicescache.c @@ -120,14 +120,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, - else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) - + req->key_len), 1)) != NULL) - { + else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) + + req->key_len), 1)) != NULL) + { - dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.recsize = total; - dataset->head.notfound = true; @@ -374,13 +374,13 @@ index 12ce9b2..95bdcfe 100644 + (sizeof (struct dataset) + + req->key_len), total, + db->negtimeout); - - /* This is the reply. */ - memcpy (&dataset->resp, ¬found, total); + + /* This is the reply. */ + memcpy (&dataset->resp, ¬found, total); @@ -207,14 +203,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, - alloca_used = true; - } - + alloca_used = true; + } + - dataset->head.allocsize = total + req->key_len; - dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.notfound = false; @@ -393,6 +393,6 @@ index 12ce9b2..95bdcfe 100644 + total - offsetof (struct dataset, resp), + he == NULL ? 0 : dh->nreloads + 1, + db->postimeout); - + dataset->resp.version = NSCD_VERSION; dataset->resp.found = 1; diff --git a/SOURCES/glibc-rh1083647.patch b/SOURCES/glibc-rh1083647.patch index 995ad043..70d8b27b 100644 --- a/SOURCES/glibc-rh1083647.patch +++ b/SOURCES/glibc-rh1083647.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Mar 12 17:27:22 2014 +0530 Provide correct buffer length to netgroup queries in nscd (BZ #16695) - + The buffer to query netgroup entries is allocated sufficient space for the netgroup entries and the key to be appended at the end, but it sends in an incorrect available length to the NSS netgroup query @@ -16,11 +16,11 @@ index 426d3c5..5ba1e1f 100644 --- glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c @@ -202,7 +202,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - { - int e; - status = getfct.f (&data, buffer + buffilled, + { + int e; + status = getfct.f (&data, buffer + buffilled, - buflen - buffilled, &e); + buflen - buffilled - req->key_len, &e); - if (status == NSS_STATUS_RETURN - || status == NSS_STATUS_NOTFOUND) - /* This was either the last one for this group or the + if (status == NSS_STATUS_RETURN + || status == NSS_STATUS_NOTFOUND) + /* This was either the last one for this group or the diff --git a/SOURCES/glibc-rh1084089.patch b/SOURCES/glibc-rh1084089.patch index 83cdcec0..6c4e2209 100644 --- a/SOURCES/glibc-rh1084089.patch +++ b/SOURCES/glibc-rh1084089.patch @@ -6,15 +6,15 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevellock.c glibc #include #include +#include - - + + void __lll_lock_wait_private (int *futex) { + LIBC_PROBE (lll_lock_wait_private, 1, futex); if (*futex == 2) lll_futex_wait (futex, 2, LLL_PRIVATE); - + @@ -39,6 +42,7 @@ __lll_lock_wait_private (int *futex) void __lll_lock_wait (int *futex, int private) @@ -22,14 +22,14 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevellock.c glibc + LIBC_PROBE (lll_lock_wait, 2, futex, FUTEX_WAIT | private); if (*futex == 2) lll_futex_wait (futex, 2, private); - + diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h --- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2014-09-05 21:51:58.722483631 +0530 @@ -19,6 +19,8 @@ #ifndef _LOWLEVELLOCK_H #define _LOWLEVELLOCK_H 1 - + +#include + #include @@ -38,18 +38,18 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock @@ -106,6 +108,7 @@ INTERNAL_SYSCALL_DECL (__err); \ long int __ret; \ - \ + \ + LIBC_PROBE (lll_futex_wake, 3, futexp, nr, private); \ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ - __lll_private_flag (FUTEX_WAKE, private), \ - (nr), 0); \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h --- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2014-09-05 21:51:58.722483631 +0530 @@ -19,6 +19,8 @@ #ifndef _LOWLEVELLOCK_H #define _LOWLEVELLOCK_H 1 - + +#include + #include @@ -58,8 +58,8 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -122,6 +124,7 @@ register unsigned long int __r4 asm ("4") = (unsigned long int) (nr); \ register unsigned long int __result asm ("2"); \ - \ + \ + LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \ __asm __volatile ("svc %b1" \ - : "=d" (__result) \ - : "i" (SYS_futex), "0" (__r2), "d" (__r3), "d" (__r4) \ + : "=d" (__result) \ + : "i" (SYS_futex), "0" (__r2), "d" (__r3), "d" (__r4) \ diff --git a/SOURCES/glibc-rh1084395.patch b/SOURCES/glibc-rh1084395.patch index 9e9c8d5d..dc7cc7e1 100644 --- a/SOURCES/glibc-rh1084395.patch +++ b/SOURCES/glibc-rh1084395.patch @@ -25683,14 +25683,14 @@ diff -urN glibc-2.17-c758a686/debug/test-strcpy_chk.c glibc-2.17-c758a686/debug/ @@ -54,6 +54,10 @@ #include #include - + +static int test_main (void); +#define TEST_FUNCTION test_main () +#include "../test-skeleton.c" + volatile int chk_fail_ok; jmp_buf chk_fail_buf; - + @@ -110,24 +114,6 @@ ret = 1; return; @@ -25714,12 +25714,12 @@ diff -urN glibc-2.17-c758a686/debug/test-strcpy_chk.c glibc-2.17-c758a686/debug/ - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -151,14 +137,8 @@ s1[i] = 32 + 23 * i % (max_char - 32); s1[len] = 0; - + - if (HP_TIMING_AVAIL && dlen > len) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -25729,18 +25729,18 @@ diff -urN glibc-2.17-c758a686/debug/test-strcpy_chk.c glibc-2.17-c758a686/debug/ - if (HP_TIMING_AVAIL && dlen > len) - putchar ('\n'); } - + static void @@ -290,28 +270,12 @@ } } - + -int +static int test_main (void) { size_t i; - + - struct sigaction sa; - sa.sa_handler = handler; - sa.sa_flags = 0; @@ -25759,9 +25759,9 @@ diff -urN glibc-2.17-c758a686/debug/test-strcpy_chk.c glibc-2.17-c758a686/debug/ - } - setenv ("LIBC_FATAL_STDERR_", "1", 1); + set_fortify_handler (handler); - + test_init (); - + @@ -389,5 +353,3 @@ do_random_tests (); return ret; @@ -25801,13 +25801,13 @@ diff -urN glibc-2.17-c758a686/debug/tst-chk1.c glibc-2.17-c758a686/debug/tst-chk - } - setenv ("LIBC_FATAL_STDERR_", "1", 1); + set_fortify_handler (handler); - + struct A { char buf1[9]; char buf2[1]; } a; struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa; @@ -1366,7 +1349,7 @@ ret = 1; } - + - fd = posix_openpt (O_RDWR); + int fd = posix_openpt (O_RDWR); if (fd != -1) @@ -25825,7 +25825,7 @@ diff -urN glibc-2.17-c758a686/debug/tst-longjmp_chk.c glibc-2.17-c758a686/debug/ @@ -8,6 +10,12 @@ #include #include - + + +static int do_test(void); +#define TEST_FUNCTION do_test () @@ -25833,12 +25833,12 @@ diff -urN glibc-2.17-c758a686/debug/tst-longjmp_chk.c glibc-2.17-c758a686/debug/ + + static jmp_buf b; - - + + @@ -43,26 +51,10 @@ } - - + + -int -main (void) +static int @@ -25862,8 +25862,8 @@ diff -urN glibc-2.17-c758a686/debug/tst-longjmp_chk.c glibc-2.17-c758a686/debug/ - } - setenv ("LIBC_FATAL_STDERR_", "1", 1); + set_fortify_handler (handler); - - + + expected_to_fail = false; diff -urN glibc-2.17-c758a686/elf/dl-support.c glibc-2.17-c758a686/elf/dl-support.c --- glibc-2.17-c758a686/elf/dl-support.c 2015-06-20 23:38:08.194095607 -0400 @@ -25871,7 +25871,7 @@ diff -urN glibc-2.17-c758a686/elf/dl-support.c glibc-2.17-c758a686/elf/dl-suppor @@ -90,12 +90,6 @@ /* Get architecture specific initializer. */ #include - + -/* We expect less than a second for relocation. */ -#ifdef HP_SMALL_TIMING_AVAIL -# undef HP_TIMING_AVAIL @@ -25888,7 +25888,7 @@ diff -urN glibc-2.17-c758a686/elf/dl-support.c glibc-2.17-c758a686/elf/dl-suppor - if (HP_TIMING_AVAIL) + if (HP_SMALL_TIMING_AVAIL) HP_TIMING_NOW (_dl_cpuclock_offset); - + if (!_dl_pagesize) diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c --- glibc-2.17-c758a686/elf/rtld.c 2015-06-20 23:38:08.170096325 -0400 @@ -25896,7 +25896,7 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c @@ -193,12 +193,6 @@ static struct libname_list _dl_rtld_libname; static struct libname_list _dl_rtld_libname2; - + -/* We expect less than a second for relocation. */ -#ifdef HP_SMALL_TIMING_AVAIL -# undef HP_TIMING_AVAIL @@ -25909,7 +25909,7 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c @@ -268,7 +262,7 @@ { ElfW(Addr) start_addr; - + - if (HP_TIMING_AVAIL) + if (HP_SMALL_TIMING_AVAIL) { @@ -25917,37 +25917,37 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c if (! HP_TIMING_INLINE) @@ -277,9 +271,6 @@ else - start_time = info->start_time; + start_time = info->start_time; #endif - - /* Initialize the timing functions. */ - HP_TIMING_DIFF_INIT (); } - + /* Transfer data about ourselves to the permanent link_map structure. */ @@ -315,9 +306,7 @@ - + #endif - + -#if HP_TIMING_AVAIL HP_TIMING_NOW (GL(dl_cpuclock_offset)); -#endif - + /* Initialize the stack end variable. */ __libc_stack_end = __builtin_frame_address (0); @@ -330,7 +319,7 @@ - + #ifndef HP_TIMING_NONAVAIL hp_timing_t rtld_total_time; - if (HP_TIMING_AVAIL) + if (HP_SMALL_TIMING_AVAIL) { hp_timing_t end_time; - + @@ -372,7 +361,7 @@ #define RESOLVE_MAP(sym, version, flags) (&bootstrap_map) #include "dynamic-link.h" - + - if (HP_TIMING_INLINE && HP_TIMING_AVAIL) + if (HP_TIMING_INLINE && HP_SMALL_TIMING_AVAIL) #ifdef DONT_USE_BOOTSTRAP_MAP @@ -25955,7 +25955,7 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c #else @@ -2720,7 +2709,7 @@ char *wp; - + /* Total time rtld used. */ - if (HP_TIMING_AVAIL) + if (HP_SMALL_TIMING_AVAIL) @@ -25963,7 +25963,7 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c HP_TIMING_PRINT (buf, sizeof (buf), *rtld_total_timep); _dl_debug_printf ("\nruntime linker statistics:\n" @@ -2788,7 +2777,7 @@ - + #ifndef HP_TIMING_NONAVAIL /* Time spend while loading the object and the dependencies. */ - if (HP_TIMING_AVAIL) @@ -25977,16 +25977,16 @@ diff -urN glibc-2.17-c758a686/Makefile.in glibc-2.17-c758a686/Makefile.in @@ -3,7 +3,7 @@ # Uncomment the line below if you want to do parallel build. # PARALLELMFLAGS = -j 4 - + -.PHONY: all install +.PHONY: all install bench - + all .DEFAULT: - $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ + $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ @@ -11,3 +11,6 @@ install: - LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \ - $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ + LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \ + $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ + +bench bench-clean: + $(MAKE) -C $(srcdir)/benchtests $(PARALLELMFLAGS) objdir=`pwd` $@ @@ -25999,11 +25999,11 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/alpha/hp-timing.h glibc-2.17-c758a68 + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson , 2001. - + @@ -20,52 +20,6 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -26056,7 +26056,7 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/alpha/hp-timing.h glibc-2.17-c758a68 @@ -77,9 +31,6 @@ /* We use 32 bit values for the times. */ typedef unsigned int hp_timing_t; - + -/* Set timestamp value to zero. */ -#define HP_TIMING_ZERO(VAR) (VAR) = (0) - @@ -26066,7 +26066,7 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/alpha/hp-timing.h glibc-2.17-c758a68 @@ -90,28 +41,6 @@ (VAR) = (int) (x_) - (int) (x_ >> 32); \ } while (0) - + -/* ??? Two rpcc instructions can be scheduled simultaneously. */ -#define HP_TIMING_DIFF_INIT() do { } while (0) - @@ -26091,7 +26091,7 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/alpha/hp-timing.h glibc-2.17-c758a68 - memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.c glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.c --- glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.c 2012-12-24 22:02:13.000000000 -0500 @@ -26129,11 +26129,11 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.h glibc-2.17-c758a686 + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2001. - + @@ -20,56 +20,9 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -26185,13 +26185,13 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.h glibc-2.17-c758a686 /* We always assume having the timestamp register. */ #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) - + /* We indeed have inlined functions. */ #define HP_TIMING_INLINE (1) @@ -77,10 +30,6 @@ /* We use 64bit values for the times. */ typedef unsigned long int hp_timing_t; - + -/* Set timestamp value to zero. */ -#define HP_TIMING_ZERO(Var) (Var) = (0) - @@ -26202,7 +26202,7 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.h glibc-2.17-c758a686 @@ -95,53 +44,6 @@ while (REPEAT_READ (__itc)); \ Var = __itc; }) - + -/* Use two 'ar.itc' instructions in a row to find out how long it takes. */ -#define HP_TIMING_DIFF_INIT() \ - do { \ @@ -26252,18 +26252,18 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/hp-timing.h glibc-2.17-c758a686 - (int) sizeof (" clock cycles"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile --- glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile 2015-06-20 22:31:17.725704221 -0400 @@ -7,8 +7,6 @@ - + ifeq ($(subdir), csu) CPPFLAGS-start.S = -D__ASSEMBLY__ -sysdep_routines += hp-timing -elide-routines.os += hp-timing - + ifeq (yes,$(build-shared)) # Compatibility diff -urN glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules @@ -26272,20 +26272,20 @@ diff -urN glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules @@ -83,7 +83,7 @@ # This makes all the auxiliary and test programs. - + -.PHONY: others tests +.PHONY: others tests bench ifeq ($(multi-arch),no) tests := $(filter-out $(tests-ifunc), $(tests)) xtests := $(filter-out $(xtests-ifunc), $(xtests)) @@ -192,6 +192,7 @@ - $(make-test-out) > $@ - + $(make-test-out) > $@ + endif # tests + .PHONY: distclean realclean subdir_distclean subdir_realclean \ - subdir_clean subdir_mostlyclean subdir_testclean + subdir_clean subdir_mostlyclean subdir_testclean diff -urN glibc-2.17-c758a686/scripts/pylint glibc-2.17-c758a686/scripts/pylint --- glibc-2.17-c758a686/scripts/pylint 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.17-c758a686/scripts/pylint 2015-06-20 21:22:16.305457862 -0400 @@ -26577,9 +26577,9 @@ diff -urN glibc-2.17-c758a686/string/strtok.c glibc-2.17-c758a686/string/strtok. --- glibc-2.17-c758a686/string/strtok.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/string/strtok.c 2015-06-20 21:22:16.305457862 -0400 @@ -23,6 +23,10 @@ - + #undef strtok - + +#ifndef STRTOK +# define STRTOK strtok +#endif @@ -26588,7 +26588,7 @@ diff -urN glibc-2.17-c758a686/string/strtok.c glibc-2.17-c758a686/string/strtok. If S is NULL, the last string strtok() was called with is used. For example: @@ -33,9 +37,7 @@ - // s = "abc\0=-def\0" + // s = "abc\0=-def\0" */ char * -strtok (s, delim) @@ -26597,7 +26597,7 @@ diff -urN glibc-2.17-c758a686/string/strtok.c glibc-2.17-c758a686/string/strtok. +STRTOK (char *s, const char *delim) { char *token; - + diff -urN glibc-2.17-c758a686/string/test-memccpy.c glibc-2.17-c758a686/string/test-memccpy.c --- glibc-2.17-c758a686/string/test-memccpy.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/string/test-memccpy.c 2015-06-20 23:36:49.734443244 -0400 @@ -26624,12 +26624,12 @@ diff -urN glibc-2.17-c758a686/string/test-memccpy.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -122,14 +104,8 @@ for (i = len; i + align1 < page_size && i < len + 64; ++i) s1[i] = 32 + 32 * i % (max_char - 32); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, n %4zd, char %d, alignment %2zd/%2zd:", len, n, c, align1, align2); - @@ -26639,7 +26639,7 @@ diff -urN glibc-2.17-c758a686/string/test-memccpy.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-memchr.c glibc-2.17-c758a686/string/test-memchr.c --- glibc-2.17-c758a686/string/test-memchr.c 2012-12-24 22:02:13.000000000 -0500 @@ -26667,12 +26667,12 @@ diff -urN glibc-2.17-c758a686/string/test-memchr.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -97,14 +79,8 @@ buf1[align + len] = seek_char; } - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", pos, align); - @@ -26682,7 +26682,7 @@ diff -urN glibc-2.17-c758a686/string/test-memchr.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-memcmp.c glibc-2.17-c758a686/string/test-memcmp.c --- glibc-2.17-c758a686/string/test-memcmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -26710,12 +26710,12 @@ diff -urN glibc-2.17-c758a686/string/test-memcmp.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -147,14 +129,8 @@ s2[len] = align2; s2[len - 1] -= exp_result; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -26725,7 +26725,7 @@ diff -urN glibc-2.17-c758a686/string/test-memcmp.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-memcpy.c glibc-2.17-c758a686/string/test-memcpy.c --- glibc-2.17-c758a686/string/test-memcpy.c 2012-12-24 22:02:13.000000000 -0500 @@ -26753,12 +26753,12 @@ diff -urN glibc-2.17-c758a686/string/test-memcpy.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -108,14 +90,8 @@ for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -26768,14 +26768,14 @@ diff -urN glibc-2.17-c758a686/string/test-memcpy.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-memmem.c glibc-2.17-c758a686/string/test-memmem.c --- glibc-2.17-c758a686/string/test-memmem.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/string/test-memmem.c 2015-06-20 23:36:49.736443184 -0400 @@ -82,24 +82,6 @@ if (check_result (impl, haystack, haystack_len, needle, needle_len, - expected) < 0) + expected) < 0) return; - - if (HP_TIMING_AVAIL) @@ -26796,36 +26796,36 @@ diff -urN glibc-2.17-c758a686/string/test-memmem.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -110,16 +92,10 @@ memcpy (tmpbuf, buf1 + idx, len); memcpy (buf1 + idx, str, len); - + - if (HP_TIMING_AVAIL) - printf ("String %s, offset %zd:", str, idx); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, buf1, BUF1PAGES * page_size, str, len, buf1 + idx); - + memcpy (buf1 + idx, tmpbuf, len); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void @@ -143,16 +119,10 @@ - buf1[idx + off] = ch; - } - + buf1[idx + off] = ch; + } + - if (HP_TIMING_AVAIL) - printf ("String %.*s, offset %zd:", (int) len, buf1 + idx, idx); - FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1, BUF1PAGES * page_size, buf1 + idx, len, - buf1 + idx); - + do_one_test (impl, buf1, BUF1PAGES * page_size, buf1 + idx, len, + buf1 + idx); + - if (HP_TIMING_AVAIL) - putchar ('\n'); - @@ -26862,12 +26862,12 @@ diff -urN glibc-2.17-c758a686/string/test-memmove.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -135,14 +113,8 @@ for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -26877,7 +26877,7 @@ diff -urN glibc-2.17-c758a686/string/test-memmove.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-memset.c glibc-2.17-c758a686/string/test-memset.c --- glibc-2.17-c758a686/string/test-memset.c 2015-06-20 23:38:08.186095846 -0400 @@ -26910,12 +26910,12 @@ diff -urN glibc-2.17-c758a686/string/test-memset.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -124,14 +101,8 @@ if (align + len > page_size) return; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c); - @@ -26925,7 +26925,7 @@ diff -urN glibc-2.17-c758a686/string/test-memset.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + #ifndef TEST_BZERO diff -urN glibc-2.17-c758a686/string/test-rawmemchr.c glibc-2.17-c758a686/string/test-rawmemchr.c --- glibc-2.17-c758a686/string/test-rawmemchr.c 2012-12-24 22:02:13.000000000 -0500 @@ -26953,12 +26953,12 @@ diff -urN glibc-2.17-c758a686/string/test-rawmemchr.c glibc-2.17-c758a686/string - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -93,14 +75,8 @@ buf1[align + len] = -seek_char; result = (char *) (buf1 + align + pos); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", pos, align); - @@ -26968,7 +26968,7 @@ diff -urN glibc-2.17-c758a686/string/test-rawmemchr.c glibc-2.17-c758a686/string - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strcasecmp.c glibc-2.17-c758a686/string/test-strcasecmp.c --- glibc-2.17-c758a686/string/test-strcasecmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -26996,12 +26996,12 @@ diff -urN glibc-2.17-c758a686/string/test-strcasecmp.c glibc-2.17-c758a686/strin - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -129,14 +111,8 @@ else s2[len - 1] -= exp_result; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -27011,7 +27011,7 @@ diff -urN glibc-2.17-c758a686/string/test-strcasecmp.c glibc-2.17-c758a686/strin - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strcasestr.c glibc-2.17-c758a686/string/test-strcasestr.c --- glibc-2.17-c758a686/string/test-strcasestr.c 2012-12-24 22:02:13.000000000 -0500 @@ -27039,12 +27039,12 @@ diff -urN glibc-2.17-c758a686/string/test-strcasestr.c glibc-2.17-c758a686/strin - printf ("\t%zd", (size_t) best_time); - } } - - + + @@ -135,15 +117,8 @@ } s1[len1] = '\0'; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%zd, alignment %2zd/%2zd, %s:", - len1, len2, align1, align2, fail ? "fail" : "found"); @@ -27055,7 +27055,7 @@ diff -urN glibc-2.17-c758a686/string/test-strcasestr.c glibc-2.17-c758a686/strin - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strcat.c glibc-2.17-c758a686/string/test-strcat.c --- glibc-2.17-c758a686/string/test-strcat.c 2012-12-24 22:02:13.000000000 -0500 @@ -27084,12 +27084,12 @@ diff -urN glibc-2.17-c758a686/string/test-strcat.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -101,17 +82,11 @@ for (i = 0; i < len2; i++) s2[i] = 32 + 23 * i % (max_char - 32); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd, alignment %2zd/%2zd:", len1, len2, align1, align2); - @@ -27102,7 +27102,7 @@ diff -urN glibc-2.17-c758a686/string/test-strcat.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strchr.c glibc-2.17-c758a686/string/test-strchr.c --- glibc-2.17-c758a686/string/test-strchr.c 2012-12-24 22:02:13.000000000 -0500 @@ -27130,12 +27130,12 @@ diff -urN glibc-2.17-c758a686/string/test-strchr.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -160,15 +142,8 @@ else result = NULLRET (buf + align + len); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment in bytes %2zd:", - pos, align * sizeof (CHAR)); @@ -27146,7 +27146,7 @@ diff -urN glibc-2.17-c758a686/string/test-strchr.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strcmp.c glibc-2.17-c758a686/string/test-strcmp.c --- glibc-2.17-c758a686/string/test-strcmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -27174,12 +27174,12 @@ diff -urN glibc-2.17-c758a686/string/test-strcmp.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -214,14 +196,8 @@ s2[len + 1] = 24 + exp_result; s2[len - 1] -= exp_result; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -27189,7 +27189,7 @@ diff -urN glibc-2.17-c758a686/string/test-strcmp.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strcpy.c glibc-2.17-c758a686/string/test-strcpy.c --- glibc-2.17-c758a686/string/test-strcpy.c 2012-12-24 22:02:13.000000000 -0500 @@ -27217,12 +27217,12 @@ diff -urN glibc-2.17-c758a686/string/test-strcpy.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -135,14 +117,8 @@ s1[i] = 32 + 23 * i % (max_char - 32); s1[len] = 0; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignments in bytes %2zd/%2zd:", len, align1 * sizeof(CHAR), align2 * sizeof(CHAR)); - @@ -27232,7 +27232,7 @@ diff -urN glibc-2.17-c758a686/string/test-strcpy.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/test-string.h --- glibc-2.17-c758a686/string/test-string.h 2012-12-24 22:02:13.000000000 -0500 @@ -27243,19 +27243,19 @@ diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/te + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek , 1999. - + @@ -53,7 +53,6 @@ #include #define GL(x) _##x #define GLRO(x) _##x -#include - - + + # define TEST_FUNCTION test_main () @@ -67,8 +66,6 @@ unsigned int seed; size_t page_size; - + -hp_timing_t _dl_hp_timing_overhead; - # ifndef ITERATIONS @@ -27264,7 +27264,7 @@ diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/te @@ -107,7 +104,7 @@ #define CALL(impl, ...) \ (* (proto_t) (impl)->fn) (__VA_ARGS__) - + -#if defined TEST_IFUNC && defined TEST_NAME +#ifdef TEST_NAME /* Increase size of FUNC_LIST if assert is triggered at run-time. */ @@ -27273,7 +27273,7 @@ diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/te @@ -159,16 +156,6 @@ if (!notall || impl->test) #endif - + -#define HP_TIMING_BEST(best_time, start, end) \ - do \ - { \ @@ -27294,8 +27294,8 @@ diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/te -#if defined TEST_IFUNC && defined TEST_NAME +#ifdef TEST_NAME func_count = __libc_ifunc_impl_list (TEST_NAME, func_list, - (sizeof func_list - / sizeof func_list[0])); + (sizeof func_list + / sizeof func_list[0])); @@ -199,7 +186,6 @@ error (EXIT_FAILURE, errno, "mmap failed"); if (mprotect (buf2 + page_size, page_size, PROT_NONE)) @@ -27330,12 +27330,12 @@ diff -urN glibc-2.17-c758a686/string/test-strlen.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -107,14 +89,8 @@ buf[align + i] = 1 + 11111 * i % MAX_CHAR; buf[align + len] = 0; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", len, align); - @@ -27345,7 +27345,7 @@ diff -urN glibc-2.17-c758a686/string/test-strlen.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strncasecmp.c glibc-2.17-c758a686/string/test-strncasecmp.c --- glibc-2.17-c758a686/string/test-strncasecmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -27373,12 +27373,12 @@ diff -urN glibc-2.17-c758a686/string/test-strncasecmp.c glibc-2.17-c758a686/stri - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -150,14 +132,8 @@ else s2[len - 1] -= exp_result; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - @@ -27388,7 +27388,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncasecmp.c glibc-2.17-c758a686/stri - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strncat.c glibc-2.17-c758a686/string/test-strncat.c --- glibc-2.17-c758a686/string/test-strncat.c 2012-12-24 22:02:13.000000000 -0500 @@ -27416,12 +27416,12 @@ diff -urN glibc-2.17-c758a686/string/test-strncat.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -114,18 +96,11 @@ for (i = 0; i < len2; i++) s2[i] = 32 + 23 * i % (max_char - 32); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd, alignment %2zd/%2zd, N %4zd:", - len1, len2, align1, align2, n); @@ -27435,7 +27435,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncat.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/test-strncmp.c --- glibc-2.17-c758a686/string/test-strncmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -27463,7 +27463,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -106,15 +88,10 @@ { @@ -27471,20 +27471,20 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t s2 = (char*)(buf2 + page_size); - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd:", len, n); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, s1, s2, n, 0); - + do_one_test (impl, s1, s2, n, 0); + - if (HP_TIMING_AVAIL) - putchar ('\n'); - return; } - + @@ -144,14 +121,8 @@ - s1[len] = 64; + s1[len] = 64; } - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd, alignment %2zd/%2zd:", len, n, align1, align2); - @@ -27494,12 +27494,12 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void @@ -189,14 +160,8 @@ if (len >= n) s2[n - 1] -= exp_result; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd, alignment %2zd/%2zd:", len, n, align1, align2); - @@ -27509,14 +27509,14 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strncpy.c glibc-2.17-c758a686/string/test-strncpy.c --- glibc-2.17-c758a686/string/test-strncpy.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/string/test-strncpy.c 2015-06-20 23:36:59.695145204 -0400 @@ -90,24 +90,6 @@ - return; - } + return; + } } - - if (HP_TIMING_AVAIL) @@ -27537,12 +27537,12 @@ diff -urN glibc-2.17-c758a686/string/test-strncpy.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -133,14 +115,8 @@ for (i = len + 1; i + align1 < page_size && i < len + 64; ++i) s1[i] = 32 + 32 * i % (max_char - 32); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, n %4zd, alignment %2zd/%2zd:", len, n, align1, align2); - @@ -27552,7 +27552,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncpy.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strnlen.c glibc-2.17-c758a686/string/test-strnlen.c --- glibc-2.17-c758a686/string/test-strnlen.c 2012-12-24 22:02:13.000000000 -0500 @@ -27580,12 +27580,12 @@ diff -urN glibc-2.17-c758a686/string/test-strnlen.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -80,14 +62,8 @@ buf1[align + i] = 1 + 7 * i % max_char; buf1[align + len] = 0; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", len, align); - @@ -27595,7 +27595,7 @@ diff -urN glibc-2.17-c758a686/string/test-strnlen.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strpbrk.c glibc-2.17-c758a686/string/test-strpbrk.c --- glibc-2.17-c758a686/string/test-strpbrk.c 2012-12-24 22:02:13.000000000 -0500 @@ -27623,12 +27623,12 @@ diff -urN glibc-2.17-c758a686/string/test-strpbrk.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -137,14 +119,8 @@ } result = STRPBRK_RESULT (s, pos); - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd, rej len %2zd:", pos, align, len); - @@ -27638,7 +27638,7 @@ diff -urN glibc-2.17-c758a686/string/test-strpbrk.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strrchr.c glibc-2.17-c758a686/string/test-strrchr.c --- glibc-2.17-c758a686/string/test-strrchr.c 2012-12-24 22:02:13.000000000 -0500 @@ -27666,12 +27666,12 @@ diff -urN glibc-2.17-c758a686/string/test-strrchr.c glibc-2.17-c758a686/string/t - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -129,14 +111,8 @@ else result = NULL; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof(CHAR)); - @@ -27681,7 +27681,7 @@ diff -urN glibc-2.17-c758a686/string/test-strrchr.c glibc-2.17-c758a686/string/t - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strspn.c glibc-2.17-c758a686/string/test-strspn.c --- glibc-2.17-c758a686/string/test-strspn.c 2012-12-24 22:02:13.000000000 -0500 @@ -27709,12 +27709,12 @@ diff -urN glibc-2.17-c758a686/string/test-strspn.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - + static void @@ -129,14 +111,8 @@ s[i] = '\0'; } - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd, acc len %2zd:", pos, align, len); - @@ -27724,7 +27724,7 @@ diff -urN glibc-2.17-c758a686/string/test-strspn.c glibc-2.17-c758a686/string/te - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/string/test-strstr.c glibc-2.17-c758a686/string/test-strstr.c --- glibc-2.17-c758a686/string/test-strstr.c 2012-12-24 22:02:13.000000000 -0500 @@ -27752,23 +27752,23 @@ diff -urN glibc-2.17-c758a686/string/test-strstr.c glibc-2.17-c758a686/string/te - printf ("\t%zd", (size_t) best_time); - } } - - + + @@ -133,15 +115,9 @@ } s1[len1] = '\0'; - + - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%zd, alignment %2zd/%2zd, %s:", - len1, len2, align1, align2, fail ? "fail" : "found"); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s1, s2, fail ? NULL : s1 + len1 - len2); - + - if (HP_TIMING_AVAIL) - putchar ('\n'); } - + static void diff -urN glibc-2.17-c758a686/sysdeps/generic/hp-timing-common.h glibc-2.17-c758a686/sysdeps/generic/hp-timing-common.h --- glibc-2.17-c758a686/sysdeps/generic/hp-timing-common.h 1969-12-31 19:00:00.000000000 -0500 @@ -27845,11 +27845,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/hp-timing.h glibc-2.17-c758a686/sy + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. - + @@ -20,59 +20,17 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + - /* There are no generic definitions for the times. We could write something using the `gettimeofday' system call where available but the overhead of @@ -27894,7 +27894,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/hp-timing.h glibc-2.17-c758a686/sy - -*/ + the system call might be too high. */ - + /* Provide dummy definitions. */ #define HP_TIMING_AVAIL (0) +#define HP_SMALL_TIMING_AVAIL (0) @@ -27907,14 +27907,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/hp-timing.h glibc-2.17-c758a686/sy -#define HP_TIMING_ACCUM(Sum, Diff) #define HP_TIMING_ACCUM_NT(Sum, Diff) #define HP_TIMING_PRINT(Buf, Len, Val) - + diff -urN glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h --- glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h 2015-06-20 23:38:08.609083190 -0400 +++ glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h 2015-06-20 22:07:15.207493957 -0400 @@ -315,7 +315,7 @@ /* The object to be initialized first. */ EXTERN struct link_map *_dl_initfirst; - + -#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL +#if HP_SMALL_TIMING_AVAIL /* Start time on CPU clock. */ @@ -27923,7 +27923,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sys @@ -538,11 +538,6 @@ /* All search directories defined at startup. */ EXTERN struct r_search_path_elem *_dl_init_all_dirs; - + -#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL - /* Overhead of a high-precision timing measurement. */ - EXTERN hp_timing_t _dl_hp_timing_overhead; @@ -27968,11 +27968,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/hp-timing.h glibc-2.17-c758a686/ + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. - + @@ -20,62 +20,9 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -28030,13 +28030,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/hp-timing.h glibc-2.17-c758a686/ /* We always assume having the timestamp register. */ #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) - + /* We indeed have inlined functions. */ #define HP_TIMING_INLINE (1) @@ -83,9 +30,6 @@ /* We use 64bit values for the times. */ typedef unsigned long long int hp_timing_t; - + -/* Set timestamp value to zero. */ -#define HP_TIMING_ZERO(Var) (Var) = (0) - @@ -28046,7 +28046,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/hp-timing.h glibc-2.17-c758a686/ @@ -93,64 +37,6 @@ in accurate clock cycles here so we don't do this. */ #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rdtsc" : "=A" (Var)) - + -/* Use two 'rdtsc' instructions in a row to find out how long it takes. */ -#define HP_TIMING_DIFF_INIT() \ - do { \ @@ -28107,7 +28107,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/hp-timing.h glibc-2.17-c758a686/ - memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/Makefile glibc-2.17-c758a686/sysdeps/i386/i686/Makefile --- glibc-2.17-c758a686/sysdeps/i386/i686/Makefile 2012-12-24 22:02:13.000000000 -0500 @@ -28120,7 +28120,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/i686/Makefile glibc-2.17-c758a686/sys - # So that we can test __m128's alignment stack-align-test-flags += -msse - + diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/hp-timing.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/hp-timing.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/hp-timing.h 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/hp-timing.h 1969-12-31 19:00:00.000000000 -0500 @@ -28210,7 +28210,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.c glibc --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,24 +0,0 @@ --/* Support for high precision, low overhead timing functions. +-/* Support for high precision, low overhead timing functions. - powerpc64 version. - Copyright (C) 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. @@ -28243,11 +28243,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. - + @@ -20,55 +20,9 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -28298,13 +28298,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc /* We always assume having the timestamp register. */ #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) - + /* We indeed have inlined functions. */ #define HP_TIMING_INLINE (1) @@ -76,13 +30,10 @@ /* We use 64bit values for the times. */ typedef unsigned long long int hp_timing_t; - + -/* Set timestamp value to zero. */ -#define HP_TIMING_ZERO(Var) (Var) = (0) - @@ -28314,12 +28314,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc - 'lwsync' right before the `mftb' instruciton. But we are not interested + 'lwsync' right before the `mftb' instruction. But we are not interested in accurate clock cycles here so we don't do this. */ - + #define HP_TIMING_NOW(Var) \ @@ -98,51 +49,6 @@ Var = ((hp_timing_t) hi << 32) | lo; \ } while (0) - + - -/* Use two 'mftb' instructions in a row to find out how long it takes. - On current POWER4, POWER5, and 970 processors mftb take ~10 cycles. */ @@ -28367,13 +28367,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc - memcpy (__dest, " ticks", MIN (__len, sizeof (" ticks"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.c --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,24 +0,0 @@ --/* Support for high precision, low overhead timing functions. +-/* Support for high precision, low overhead timing functions. - powerpc64 version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. @@ -28406,11 +28406,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.h glibc-2.17-c + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. - + @@ -20,55 +20,9 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -28461,13 +28461,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.h glibc-2.17-c /* We always assume having the timestamp register. */ #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) - + /* We indeed have inlined functions. */ #define HP_TIMING_INLINE (1) @@ -76,13 +30,10 @@ /* We use 64bit values for the times. */ typedef unsigned long long int hp_timing_t; - + -/* Set timestamp value to zero. */ -#define HP_TIMING_ZERO(Var) (Var) = (0) - @@ -28482,7 +28482,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.h glibc-2.17-c @@ -90,50 +41,6 @@ #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("mftb %0" : "=r" (Var)) #endif - + -/* Use two 'mftb' instructions in a row to find out how long it takes. - On current POWER4, POWER5, and 970 processors mftb take ~10 cycles. */ -#define HP_TIMING_DIFF_INIT() \ @@ -28529,15 +28529,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/hp-timing.h glibc-2.17-c - memcpy (__dest, " ticks", MIN (__len, sizeof (" ticks"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/Makefile --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/Makefile 2015-06-20 23:38:08.082098958 -0400 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/Makefile 2015-06-20 21:22:16.306457831 -0400 @@ -37,11 +37,6 @@ - + CFLAGS-libc-start.c += -fno-asynchronous-unwind-tables - + -ifeq ($(subdir),csu) -sysdep_routines += hp-timing -elide-routines.os += hp-timing @@ -28582,11 +28582,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/hp-timing.h glibc-2. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller , 2001. - + @@ -20,67 +20,17 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -28594,16 +28594,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/hp-timing.h glibc-2. #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) #define HP_TIMING_INLINE (1) - + typedef unsigned long long int hp_timing_t; - + -#define HP_TIMING_ZERO(Var) (Var) = (0) - #define HP_TIMING_NOW(Var) \ __asm__ __volatile__ ("rd %%tick, %L0\n\t" \ - "srlx %L0, 32, %H0" \ - : "=r" (Var)) - + "srlx %L0, 32, %H0" \ + : "=r" (Var)) + -#define HP_TIMING_DIFF_INIT() \ - do { \ - int __cnt = 5; \ @@ -28651,14 +28651,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/hp-timing.h glibc-2. - memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/Makefile --- glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/Makefile 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/Makefile 2015-06-20 21:22:16.307457801 -0400 @@ -1,10 +1,5 @@ sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a - + -ifeq ($(subdir),csu) -sysdep_routines += hp-timing -elide-routines.os += hp-timing @@ -28703,11 +28703,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc64/hp-timing.h glibc-2.17-c758a + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller , 2001. - + @@ -20,62 +20,14 @@ #ifndef _HP_TIMING_H #define _HP_TIMING_H 1 - + -#include -#include -#include <_itoa.h> @@ -28715,13 +28715,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc64/hp-timing.h glibc-2.17-c758a #define HP_TIMING_AVAIL (1) +#define HP_SMALL_TIMING_AVAIL (1) #define HP_TIMING_INLINE (1) - + typedef unsigned long int hp_timing_t; - + -#define HP_TIMING_ZERO(Var) (Var) = (0) - #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rd %%tick, %0" : "=r" (Var)) - + -#define HP_TIMING_DIFF_INIT() \ - do { \ - int __cnt = 5; \ @@ -28767,7 +28767,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc64/hp-timing.h glibc-2.17-c758a - memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles"))); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc64/Makefile glibc-2.17-c758a686/sysdeps/sparc/sparc64/Makefile --- glibc-2.17-c758a686/sysdeps/sparc/sparc64/Makefile 2012-12-24 22:02:13.000000000 -0500 @@ -28795,14 +28795,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/hp-timing.h glibc-2.17-c758a686/sys - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002-2015 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 @@ -17,24 +17,24 @@ . */ - + #ifndef _HP_TIMING_H +#define _HP_TIMING_H 1 - + -/* We can use some of the i686 implementation without changes. */ -# include +/* We always assume having the timestamp register. */ @@ -28814,7 +28814,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/hp-timing.h glibc-2.17-c758a686/sys + +/* We use 64bit values for the times. */ +typedef unsigned long long int hp_timing_t; - + /* The "=A" constraint used in 32-bit mode does not work in 64-bit mode. */ -# undef HP_TIMING_NOW -# define HP_TIMING_NOW(Var) \ @@ -28822,7 +28822,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/hp-timing.h glibc-2.17-c758a686/sys ({ unsigned int _hi, _lo; \ asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \ (Var) = ((unsigned long long int) _hi << 32) | _lo; }) - + -/* The funny business for 32-bit mode is not required here. */ -# undef HP_TIMING_ACCUM -# define HP_TIMING_ACCUM(Sum, Diff) \ @@ -28832,26 +28832,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/hp-timing.h glibc-2.17-c758a686/sys - : "=m" (Sum) : "r" (__diff), "m" (Sum)); \ - } while (0) +#include - + #endif /* hp-timing.h */ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/Makefile glibc-2.17-c758a686/sysdeps/x86_64/Makefile --- glibc-2.17-c758a686/sysdeps/x86_64/Makefile 2015-06-20 23:38:08.530085553 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/Makefile 2015-06-20 21:22:16.307457801 -0400 @@ -2,8 +2,6 @@ long-double-fcts = yes - + ifeq ($(subdir),csu) -sysdep_routines += hp-timing -elide-routines.os += hp-timing gen-as-const-headers += link-defines.sym endif - + diff -urN glibc-2.17-c758a686/test-skeleton.c glibc-2.17-c758a686/test-skeleton.c --- glibc-2.17-c758a686/test-skeleton.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/test-skeleton.c 2015-06-20 21:22:16.307457801 -0400 @@ -18,8 +18,10 @@ . */ - + #include +#include #include @@ -28863,7 +28863,7 @@ diff -urN glibc-2.17-c758a686/test-skeleton.c glibc-2.17-c758a686/test-skeleton. @@ -194,6 +196,32 @@ exit (1); } - + +/* Set fortification error handler. Used when tests want to verify that bad + code is caught by the library. */ +static void diff --git a/SOURCES/glibc-rh1085290.patch b/SOURCES/glibc-rh1085290.patch index 8b60857d..37f3c24c 100644 --- a/SOURCES/glibc-rh1085290.patch +++ b/SOURCES/glibc-rh1085290.patch @@ -3,23 +3,23 @@ Author: Siddhesh Poyarekar Date: Thu Mar 27 19:49:51 2014 +0530 Return NULL for wildcard values in getnetgrent from nscd (BZ #16759) - + getnetgrent is supposed to return NULL for values that are wildcards in the (host, user, domain) triplet. This works correctly with nscd disabled, but with it enabled, it returns a blank ("") instead of a NULL. This is easily seen with the output of `getent netgroup foonet` for a netgroup foonet defined as follows in /etc/netgroup: - + foonet (,foo,) - + The output with nscd disabled is: - + foonet ( ,foo,) - + while with nscd enabled, it is: - + foonet (,foo,) - + The extra space with nscd disabled is due to the fact that `getent netgroup` adds it if the return value from getnetgrent is NULL for either host or user. @@ -31,7 +31,7 @@ index 62cdfda..f6d064d 100644 @@ -235,6 +235,14 @@ endnetgrent (void) __libc_lock_unlock (lock); } - + +static const char * +get_nonempty_val (const char *in) +{ @@ -45,7 +45,7 @@ index 62cdfda..f6d064d 100644 nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen, @@ -243,11 +251,11 @@ nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen, return NSS_STATUS_UNAVAIL; - + datap->type = triple_val; - datap->val.triple.host = datap->cursor; + datap->val.triple.host = get_nonempty_val (datap->cursor); @@ -56,5 +56,5 @@ index 62cdfda..f6d064d 100644 - datap->val.triple.domain = datap->cursor; + datap->val.triple.domain = get_nonempty_val (datap->cursor); datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1; - + return NSS_STATUS_SUCCESS; diff --git a/SOURCES/glibc-rh1085313.patch b/SOURCES/glibc-rh1085313.patch index 26c96db4..648130ec 100644 --- a/SOURCES/glibc-rh1085313.patch +++ b/SOURCES/glibc-rh1085313.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Sep 10 21:51:50 2014 +0530 Return failure in getnetgrent only when all netgroups have been searched (#17363) - + The netgroups lookup code fails when one of the groups in the search tree is empty. In such a case it only returns the leaves of the tree after the blank netgroup. This is because the line parser returns a @@ -11,10 +11,10 @@ Date: Wed Sep 10 21:51:50 2014 +0530 __getnetgrent_internal implementation needs to be fixed to try remaining groups if the current group is entry. This patch implements this fix. Tested on x86_64. - - [BZ #17363] - * inet/getnetgrent_r.c (__internal_getnetgrent_r): Try next - group if the current group is empty. + + [BZ #17363] + * inet/getnetgrent_r.c (__internal_getnetgrent_r): Try next + group if the current group is empty. diff --git glibc-2.17-c758a686/inet/getnetgrent_r.c glibc-2.17-c758a686/inet/getnetgrent_r.c index f6d064d..e101537 100644 @@ -23,12 +23,12 @@ index f6d064d..e101537 100644 @@ -297,7 +297,10 @@ __internal_getnetgrent_r (char **hostp, char **userp, char **domainp, { status = DL_CALL_FCT (*fct, (datap, buffer, buflen, &errno)); - + - if (status == NSS_STATUS_RETURN) + if (status == NSS_STATUS_RETURN + /* The service returned a NOTFOUND, but there are more groups that we + need to resolve before we give up. */ + || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL)) - { - /* This was the last one for this group. Look at next group - if available. */ + { + /* This was the last one for this group. Look at next group + if available. */ diff --git a/SOURCES/glibc-rh1098042.patch b/SOURCES/glibc-rh1098042.patch index 6cc8fd00..efda3ac6 100644 --- a/SOURCES/glibc-rh1098042.patch +++ b/SOURCES/glibc-rh1098042.patch @@ -3,12 +3,12 @@ Author: Siddhesh Poyarekar Date: Thu May 15 12:33:11 2014 +0530 Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849) - + getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6 queries. For AF_UNSPEC however, an older change (a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to that the returned error was EAI_NONAME. - + This patch fixes the check so that a non-authoritative not-found is returned as EAI_AGAIN to the user instead of EAI_NONAME. @@ -17,12 +17,12 @@ index 6258330..8f392b9 100644 --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -867,8 +867,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - if (status != NSS_STATUS_TRYAGAIN - || rc != ERANGE || herrno != NETDB_INTERNAL) - { + if (status != NSS_STATUS_TRYAGAIN + || rc != ERANGE || herrno != NETDB_INTERNAL) + { - if (status == NSS_STATUS_TRYAGAIN - && herrno == TRY_AGAIN) + if (herrno == TRY_AGAIN) - no_data = EAI_AGAIN; - else - no_data = herrno == NO_DATA; + no_data = EAI_AGAIN; + else + no_data = herrno == NO_DATA; diff --git a/SOURCES/glibc-rh1098047.patch b/SOURCES/glibc-rh1098047.patch index bec040ca..b69deb52 100644 --- a/SOURCES/glibc-rh1098047.patch +++ b/SOURCES/glibc-rh1098047.patch @@ -3,14 +3,14 @@ Author: Siddhesh Poyarekar Date: Wed Apr 30 11:48:43 2014 +0530 Do not fail if one of the two responses to AF_UNSPEC fails (BZ #14308) - + [Fixes BZ #14308, #12994, #13651] - + AF_UNSPEC results in sending two queries in parallel, one for the A record and the other for the AAAA record. If one of these is a referral, then the query fails, which is wrong. It should return at least the one successful response. - + The fix has two parts. The first part makes the referral fall back to the SERVFAIL path, which results in using the successful response. There is a bug in that path however, due to which the second part is @@ -18,29 +18,29 @@ Date: Wed Apr 30 11:48:43 2014 +0530 and the second succeeds, __libc_res_nsearch does not detect that and assumes a failure. The case where the first response is a success and the second fails, works correctly. - + This condition is produced by buggy routers, so here's a crude interposable library that can simulate such a condition. The library overrides the recvfrom syscall and modifies the header of the packet received to reproduce this scenario. It has two key variables: mod_packet and first_error. - + The mod_packet variable when set to 0, results in odd packets being modified to be a referral. When set to 1, even packets are modified to be a referral. - + The first_error causes the first response to be a failure so that a domain-appended search is performed to test the second part of the __libc_nsearch fix. - + The driver for this fix is a simple getaddrinfo program that does an AF_UNSPEC query. I have omitted this since it should be easy to implement. - + I have tested this on x86_64. - + The interceptor library source: - + /* Override recvfrom and modify the header of the first DNS response to make it a referral and reproduce bz #845218. We have to resort to this ugly hack because we cannot make bind return the buggy response of a referral for the @@ -55,7 +55,7 @@ Date: Wed Apr 30 11:48:43 2014 +0530 #include #include #include - + /* Lifted from resolv/arpa/nameser_compat.h. */ typedef struct { unsigned id :16; /*%< query identification number */ @@ -107,25 +107,25 @@ Date: Wed Apr 30 11:48:43 2014 +0530 unsigned nscount :16; /*%< number of authority entries */ unsigned arcount :16; /*%< number of resource entries */ } HEADER; - + static int done = 0; - + /* Packets to modify. 0 for the odd packets and 1 for even packets. */ static const int mod_packet = 0; - + /* Set to true if the first request should result in an error, resulting in a search query. */ static bool first_error = true; - + static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags, - struct sockaddr *src_addr, socklen_t *addrlen); - + struct sockaddr *src_addr, socklen_t *addrlen); + void __attribute__ ((constructor)) init (void) { real_recvfrom = dlsym (RTLD_NEXT, "recvfrom"); - + if (real_recvfrom == NULL) { printf ("Failed to get reference to recvfrom: %s\n", dlerror ()); @@ -133,7 +133,7 @@ Date: Wed Apr 30 11:48:43 2014 +0530 abort (); } } - + /* Modify the second packet that we receive to set the header in a manner as to reproduce BZ #845218. */ static void @@ -142,11 +142,11 @@ Date: Wed Apr 30 11:48:43 2014 +0530 if (done % 2 == mod_packet || (first_error && done == 1)) { printf ("(Modifying header)"); - + if (first_error && done == 1) - h->rcode = 3; + h->rcode = 3; else - h->rcode = 0; /* NOERROR == 0. */ + h->rcode = 0; /* NOERROR == 0. */ h->ancount = 0; h->aa = 0; h->ra = 0; @@ -154,19 +154,19 @@ Date: Wed Apr 30 11:48:43 2014 +0530 } done++; } - + ssize_t recvfrom (int sockfd, void *buf, size_t len, int flags, - struct sockaddr *src_addr, socklen_t *addrlen) + struct sockaddr *src_addr, socklen_t *addrlen) { ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen); int port = htons (((struct sockaddr_in *) src_addr)->sin_port); struct in_addr addr = ((struct sockaddr_in *) src_addr)->sin_addr; const char *host = inet_ntoa (addr); printf ("\n*** From %s:%d: ", host, port); - + mod_buf (buf, port); - + printf ("returned %zd\n", ret); return ret; } @@ -182,7 +182,7 @@ Author: Siddhesh Poyarekar Date: Tue Jul 8 16:40:24 2014 +0530 Check value at resplen2 if it is not NULL - + There was a typo in the previous patch due to which resplen2 was checked for non-zero instead of the value at resplen2. Fix that and improve the condition by checking resplen2 for non-NULL (instead of @@ -196,52 +196,52 @@ diff -pruN glibc-2.17-c758a686/resolv/res_query.c glibc-2.17-c758a686/resolv/res --- glibc-2.17-c758a686/resolv/res_query.c 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/resolv/res_query.c 2014-09-05 14:28:06.439191017 +0530 @@ -378,7 +378,9 @@ __libc_res_nsearch(res_state statp, - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2); + ret = __libc_res_nquerydomain(statp, name, NULL, class, type, + answer, anslen, answerp, + answerp2, nanswerp2, resplen2); - if (ret > 0 || trailing_dot) + if (ret > 0 || trailing_dot + /* If the second response is valid then we use that. */ + || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) - return (ret); - saved_herrno = h_errno; - tried_as_is++; + return (ret); + saved_herrno = h_errno; + tried_as_is++; @@ -418,7 +420,8 @@ __libc_res_nsearch(res_state statp, - answer, anslen, answerp, - answerp2, nanswerp2, - resplen2); + answer, anslen, answerp, + answerp2, nanswerp2, + resplen2); - if (ret > 0) + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) - return (ret); - - if (answerp && *answerp != answer) { + return (ret); + + if (answerp && *answerp != answer) { @@ -487,7 +490,8 @@ __libc_res_nsearch(res_state statp, - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2); + ret = __libc_res_nquerydomain(statp, name, NULL, class, type, + answer, anslen, answerp, + answerp2, nanswerp2, resplen2); - if (ret > 0) + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) - return (ret); - } - + return (ret); + } + diff -pruN glibc-2.17-c758a686/resolv/res_send.c glibc-2.17-c758a686/resolv/res_send.c --- glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:30.039337246 +0530 +++ glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:06.439191017 +0530 @@ -1343,6 +1343,7 @@ send_dg(res_state statp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - + (*thisresplenp > *thisanssizp) + ? *thisanssizp : *thisresplenp); + + next_ns: - if (recvresp1 || (buf2 != NULL && recvresp2)) { - *resplen2 = 0; - return resplen; + if (recvresp1 || (buf2 != NULL && recvresp2)) { + *resplen2 = 0; + return resplen; @@ -1360,7 +1361,6 @@ send_dg(res_state statp, - goto wait; - } - + goto wait; + } + - next_ns: - __res_iclose(statp, false); - /* don't retry if called from dig */ - if (!statp->pfcode) + __res_iclose(statp, false); + /* don't retry if called from dig */ + if (!statp->pfcode) diff --git a/SOURCES/glibc-rh1103856.patch b/SOURCES/glibc-rh1103856.patch index 8f3e9d17..d7c76765 100644 --- a/SOURCES/glibc-rh1103856.patch +++ b/SOURCES/glibc-rh1103856.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Fri May 30 22:43:52 2014 +0530 Add mmap usage in malloc_info output - + The current malloc_info xml output only has information about allocations on the heap. Display information about number of mappings and total mmapped size to this to complete the picture. @@ -13,15 +13,16 @@ diff -pruN glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc +++ glibc-2.17-c758a686/malloc/malloc.c 2014-06-02 07:34:58.856257177 +0530 @@ -6553,12 +6553,14 @@ malloc_info (int options, FILE *fp) fprintf (fp, - "\n" - "\n" + "\n" + "\n" + "\n" - "\n" - "\n" - "\n" - "\n" - "\n", - total_nfastblocks, total_fastavail, total_nblocks, total_avail, + "\n" + "\n" + "\n" + "\n" + "\n", + total_nfastblocks, total_fastavail, total_nblocks, total_avail, + mp_.n_mmaps, mp_.mmapped_mem, - total_system, total_max_system, - total_aspace, total_aspace_mprotect); + total_system, total_max_system, + total_aspace, total_aspace_mprotect); + diff --git a/SOURCES/glibc-rh1103874.patch b/SOURCES/glibc-rh1103874.patch index 424d3f01..4dd79df3 100644 --- a/SOURCES/glibc-rh1103874.patch +++ b/SOURCES/glibc-rh1103874.patch @@ -2,7 +2,7 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc- --- glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c 2010-05-04 16:57:23.000000000 +0530 +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c 2014-06-02 23:00:02.901013275 +0530 @@ -45,8 +45,10 @@ pthread_cancel_init (void) - + if (__builtin_expect (libgcc_s_handle != NULL, 1)) { - /* Force gcc to reload all values. */ @@ -13,7 +13,7 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc- + atomic_read_barrier (); return; } - + @@ -72,9 +74,14 @@ pthread_cancel_init (void) libgcc_s_forcedunwind = forcedunwind; PTR_MANGLE (getcfa); @@ -35,7 +35,7 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc- @@ -91,13 +98,19 @@ __unwind_freeres (void) } } - + -void -_Unwind_Resume (struct _Unwind_Exception *exc) +static __always_inline void @@ -51,31 +51,31 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc- +_Unwind_Resume (struct _Unwind_Exception *exc) +{ + _maybe_pthread_cancel_init (); - + void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume; PTR_DEMANGLE (resume); @@ -108,10 +123,7 @@ __gcc_personality_v0 (int version, _Unwi - struct _Unwind_Exception *ue_header, - struct _Unwind_Context *context) + struct _Unwind_Exception *ue_header, + struct _Unwind_Context *context) { - if (__builtin_expect (libgcc_s_handle == NULL, 0)) - pthread_cancel_init (); - else - atomic_read_barrier (); + _maybe_pthread_cancel_init (); - + _Unwind_Reason_Code (*personality) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, @@ -122,10 +136,7 @@ _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, - void *stop_argument) + void *stop_argument) { - if (__builtin_expect (libgcc_s_handle == NULL, 0)) - pthread_cancel_init (); - else - atomic_read_barrier (); + _maybe_pthread_cancel_init (); - + _Unwind_Reason_Code (*forcedunwind) (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *) @@ -135,10 +148,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exc @@ -87,7 +87,7 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc- - else - atomic_read_barrier (); + _maybe_pthread_cancel_init (); - + _Unwind_Word (*getcfa) (struct _Unwind_Context *) = libgcc_s_getcfa; PTR_DEMANGLE (getcfa); diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c @@ -100,13 +100,13 @@ diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/s +#include +#include #include - + +static void *libgcc_s_handle; static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); static _Unwind_Reason_Code (*libgcc_s_personality) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, @@ -42,13 +45,32 @@ init (void) - + libgcc_s_resume = resume; libgcc_s_personality = personality; + atomic_write_barrier (); @@ -120,7 +120,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/s + function pointers are correct. */ + libgcc_s_handle = handle; } - + +static __always_inline void +_maybe_init (void) +{ @@ -139,7 +139,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/s + _maybe_init (); libgcc_s_resume (exc); } - + @@ -58,8 +80,7 @@ __gcc_personality_v0 (int version, _Unwi struct _Unwind_Exception *ue_header, struct _Unwind_Context *context) @@ -148,5 +148,5 @@ diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/s - init (); + _maybe_init (); return libgcc_s_personality (version, actions, exception_class, - ue_header, context); + ue_header, context); } diff --git a/SOURCES/glibc-rh1120490-int128.patch b/SOURCES/glibc-rh1120490-int128.patch index b6c7c220..2c539a24 100644 --- a/SOURCES/glibc-rh1120490-int128.patch +++ b/SOURCES/glibc-rh1120490-int128.patch @@ -5,7 +5,7 @@ Author: Marko Myllynen Date: Fri May 30 10:50:21 2014 -0700 Replace __int128 with __int128_t - + * sysdeps/x86_64/link-defines.sym (BND_SIZE): Replace __int128 with __int128_t. @@ -14,11 +14,11 @@ Author: H.J. Lu Date: Fri Apr 25 09:33:41 2014 -0700 Replace __int128 with __int128_t in bits/link.h - + __int128 was added in GCC 4.6 and __int128_t was added before x86-64 was supported. This patch replaces __int128 with __int128_t so that the installed bits/link.h can be used with older GCC. - + * sysdeps/x86/bits/link.h (La_x86_64_regs): Replace __int128 with __int128_t. (La_x86_64_retval): Likewise. @@ -34,7 +34,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdep + __int128_t lr_bnd[4]; #endif } La_x86_64_regs; - + @@ -110,8 +110,8 @@ La_x86_64_vector lrv_vector0; La_x86_64_vector lrv_vector1; @@ -45,7 +45,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdep + __int128_t lrv_bnd1; #endif } La_x86_64_retval; - + diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym --- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-11-05 13:39:09.889988363 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-11-05 13:39:52.800863646 -0500 @@ -55,6 +55,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a68 ZMM_SIZE sizeof (La_x86_64_zmm) -BND_SIZE sizeof (__int128) +BND_SIZE sizeof (__int128_t) - + LR_SIZE sizeof (struct La_x86_64_regs) LR_RDX_OFFSET offsetof (struct La_x86_64_regs, lr_rdx) diff --git a/SOURCES/glibc-rh1120490.patch b/SOURCES/glibc-rh1120490.patch index ccf6f337..c2ab741e 100644 --- a/SOURCES/glibc-rh1120490.patch +++ b/SOURCES/glibc-rh1120490.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Tue Sep 16 22:16:01 2014 +0530 Make __extern_always_inline usable on clang++ again - + The fix for BZ #17266 (884ddc5081278f488ef8cd49951f41cfdbb480ce) removed changes that had gone into cdefs.h to make __extern_always_inline usable with clang++. This patch adds back @@ -12,46 +12,46 @@ Date: Tue Sep 16 22:16:01 2014 +0530 based on the earlier patch and assertion[1] that checking if __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ is defined is sufficient to determine that clang++ suports GNU inlining semantics. - + Tested with a simple program that builds with __extern_always_inline with the patch and fails compilation without it. - + #include #include - + extern void foo_alias (void) __asm ("foo"); - + __extern_always_inline void foo (void) { puts ("hi oh world!"); return foo_alias (); } - + void foo_alias (void) { puts ("hell oh world"); } - + int main () { foo (); } - + [1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html - - [BZ #17266] - * misc/sys/cdefs.h: Define __extern_always_inline for clang - 4.2 and newer. + + [BZ #17266] + * misc/sys/cdefs.h: Define __extern_always_inline for clang + 4.2 and newer. commit 884ddc5081278f488ef8cd49951f41cfdbb480ce Author: Siddhesh Poyarekar Date: Tue Sep 16 14:08:48 2014 +0530 Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266) - + The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may not be sufficient since those flags were added during initial support for C99 inlining semantics. There is also a problem with always @@ -60,37 +60,37 @@ Date: Tue Sep 16 14:08:48 2014 +0530 guaranteed. This, along with the possibility of such wrappers using redirection (btowc for example) could result in compiler generating an infinitely recusrive call to the function. - + In fact it was such a recursion that led to this code being written the way it was; see: - + https://bugzilla.redhat.com/show_bug.cgi?id=186410 - + The initial change was to fix bugs 14530 and 13741, but they can be resolved by checking if __fortify_function and/or __extern_always_inline are defined, as it has been done in this patch. In addition, I have audited uses of __extern_always_inline to make sure that none of the uses result in compilation errors. - + There is however a regression in this patch for llvm, since it reverts the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ definition imply proper extern inline semantics. - + 2014-09-16 Siddhesh Poyarekar - Jakub Jelinek - - [BZ #17266] - * libio/stdio.h: Check definition of __fortify_function - instead of __extern_always_inline to include bits/stdio2.h. - * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also - check if __extern_always_inline is defined. - [__USE_MISC || __USE_XOPEN]: Likewise. - [__USE_ISOC99] Likewise. - * misc/sys/cdefs.h (__fortify_function): Define only if - __extern_always_inline is defined. - [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining - __extern_always_inline and __extern_inline only for g++-4.3 - and newer or a compatible gcc. + Jakub Jelinek + + [BZ #17266] + * libio/stdio.h: Check definition of __fortify_function + instead of __extern_always_inline to include bits/stdio2.h. + * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also + check if __extern_always_inline is defined. + [__USE_MISC || __USE_XOPEN]: Likewise. + [__USE_ISOC99] Likewise. + * misc/sys/cdefs.h (__fortify_function): Define only if + __extern_always_inline is defined. + [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining + __extern_always_inline and __extern_inline only for g++-4.3 + and newer or a compatible gcc. diff --git glibc-2.17-c758a686/libio/stdio.h glibc-2.17-c758a686/libio/stdio.h index d8c0bdb..1f4f837 100644 @@ -112,7 +112,7 @@ index aa755de..0656645 100644 @@ -251,7 +251,8 @@ extern long double __REDIRECT_NTH (lgammal_r, (long double, int *), # endif #endif - + -#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 +#if ((defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99) \ + && defined __extern_always_inline) @@ -122,7 +122,7 @@ index aa755de..0656645 100644 @@ -284,7 +285,8 @@ __extern_always_inline long double __NTH (lgammal (long double __d)) # endif #endif - + -#if defined __USE_MISC || defined __USE_XOPEN +#if ((defined __USE_MISC || defined __USE_XOPEN) \ + && defined __extern_always_inline) @@ -132,7 +132,7 @@ index aa755de..0656645 100644 @@ -422,7 +424,7 @@ extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite); # endif #endif - + -#ifdef __USE_ISOC99 +#if defined __USE_ISOC99 && defined __extern_always_inline /* tgamma. */ @@ -147,12 +147,12 @@ index 04db956..01e81ba 100644 #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) -#define __fortify_function __extern_always_inline __attribute_artificial__ - + #if __GNUC_PREREQ (4,3) # define __warndecl(name, msg) \ @@ -319,8 +318,17 @@ #endif - + /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 - inline semantics, unless -fgnu89-inline is used. */ -#if (!defined __cplusplus || __GNUC_PREREQ (4,3)) && defined __GNUC__ @@ -186,5 +186,5 @@ index 04db956..01e81ba 100644 +#ifdef __extern_always_inline +# define __fortify_function __extern_always_inline __attribute_artificial__ #endif - + /* GCC 4.3 and above allow passing all anonymous arguments of an diff --git a/SOURCES/glibc-rh1125306.patch b/SOURCES/glibc-rh1125306.patch index 835a3eba..6b19f7fc 100644 --- a/SOURCES/glibc-rh1125306.patch +++ b/SOURCES/glibc-rh1125306.patch @@ -16,5 +16,5 @@ index 9a8a5a8..eaed6dd 100644 + sc_nscd = string_to_security_class ("nscd"); + if (sc_nscd == 0 && avc_deny_unknown == 1) dbg_log (_("Error getting security class for nscd.")); - + /* Convert permission to AVC bits. */ diff --git a/SOURCES/glibc-rh1132518-mpx.patch b/SOURCES/glibc-rh1132518-mpx.patch index ec4495dd..43997d02 100644 --- a/SOURCES/glibc-rh1132518-mpx.patch +++ b/SOURCES/glibc-rh1132518-mpx.patch @@ -5,12 +5,12 @@ # commit ea8ba7cd14d0f479bae8365ae5c4ef177bdd0aad # Author: Igor Zamyatin # Date: Wed Apr 16 14:43:16 2014 -0700 -# +# # Save/restore bound registers for _dl_runtime_profile -# +# # This patch saves and restores bound registers in x86-64 PLT for # ld.so profile and LD_AUDIT: -# +# # * sysdeps/x86_64/bits/link.h (La_x86_64_regs): Add lr_bnd. # (La_x86_64_retval): Add lrv_bnd0 and lrv_bnd1. # * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Save @@ -22,25 +22,25 @@ # (LR_BND_OFFSET): Likewise. # (LRV_BND0_OFFSET): Likewise. # (LRV_BND1_OFFSET): Likewise. -# +# # commit a4c75cfd56e536c2b18556e8a482d88dffa0fffc # Author: Igor Zamyatin # Date: Tue Apr 1 10:16:04 2014 -0700 -# +# # Save/restore bound registers in _dl_runtime_resolve -# +# # This patch saves and restores bound registers in symbol lookup for x86-64: -# +# # 1. Branches without BND prefix clear bound registers. # 2. x86-64 pass bounds in bound registers as specified in MPX psABI # extension on hjl/mpx/master branch at -# +# # https://github.com/hjl-tools/x86-64-psABI # https://groups.google.com/forum/#!topic/x86-64-abi/KFsB0XTgWYc -# +# # Binutils has been updated to create an alternate PLT to add BND prefix # when branching to ld.so. -# +# # * config.h.in (HAVE_MPX_SUPPORT): New #undef. # * sysdeps/x86_64/configure.ac: Set HAVE_MPX_SUPPORT. # * sysdeps/x86_64/configure: Regenerated. @@ -58,20 +58,20 @@ # (REGISTER_SAVE_BND2): Likewise. # (_dl_runtime_resolve): Use them. Save and restore Intel MPX # bound registers when calling _dl_fixup. -# +# diff -urN glibc-2.17-c758a686/config.h.in glibc-2.17-c758a686/config.h.in --- glibc-2.17-c758a686/config.h.in 2014-09-10 23:26:03.467045808 -0400 +++ glibc-2.17-c758a686/config.h.in 2014-09-10 23:27:41.532851928 -0400 @@ -107,6 +107,9 @@ /* Define if assembler supports AVX512. */ #undef HAVE_AVX512_ASM_SUPPORT - + +/* Define if assembler supports Intel MPX. */ +#undef HAVE_MPX_SUPPORT + /* Define if gcc supports FMA4. */ #undef HAVE_FMA4_SUPPORT - + diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdeps/x86/bits/link.h --- glibc-2.17-c758a686/sysdeps/x86/bits/link.h 2014-09-10 23:26:03.467045808 -0400 +++ glibc-2.17-c758a686/sysdeps/x86/bits/link.h 2014-09-10 23:27:41.533851926 -0400 @@ -83,7 +83,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdep + __int128 lr_bnd[4]; +#endif } La_x86_64_regs; - + /* Return values for calls from PLT on x86-64. */ @@ -106,6 +109,10 @@ long double lrv_st1; @@ -94,7 +94,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdep + __int128 lrv_bnd1; +#endif } La_x86_64_retval; - + #define La_x32_regs La_x86_64_regs diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure glibc-2.17-c758a686/sysdeps/x86_64/configure --- glibc-2.17-c758a686/sysdeps/x86_64/configure 2014-09-10 23:26:03.573045598 -0400 @@ -102,7 +102,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure glibc-2.17-c758a686/sysde @@ -212,6 +212,33 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5 $as_echo "$libc_cv_cc_novzeroupper" >&6; } - + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel MPX support" >&5 +$as_echo_n "checking for Intel MPX support... " >&6; } +if ${libc_cv_asm_mpx+:} false; then : @@ -131,15 +131,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure glibc-2.17-c758a686/sysde +fi + $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - + # work around problem with autoconf and empty lines at the end of files diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure.in glibc-2.17-c758a686/sysdeps/x86_64/configure.in --- glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:26:03.468045806 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:27:41.532851928 -0400 @@ -70,6 +70,21 @@ - [libc_cv_cc_novzeroupper=no]) + [libc_cv_cc_novzeroupper=no]) ]) - + +dnl Check whether asm supports Intel MPX +AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl +cat > conftest.s <<\EOF @@ -162,9 +162,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:26:03.468045806 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:27:41.535851922 -0400 @@ -63,6 +63,20 @@ - movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6 - movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7 - + movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6 + movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7 + +#ifndef __ILP32__ +# ifdef HAVE_MPX_SUPPORT + bndmov (LR_BND_OFFSET)(%rsp), %bnd0 # Restore bound @@ -180,12 +180,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 +#endif + #ifdef RESTORE_AVX - /* Check if any xmm0-xmm7 registers are changed by audit - module. */ + /* Check if any xmm0-xmm7 registers are changed by audit + module. */ @@ -222,6 +236,16 @@ - vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx) + vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx) #endif - + +#ifndef __ILP32__ +# ifdef HAVE_MPX_SUPPORT + bndmov %bnd0, LRV_BND0_OFFSET(%rcx) # Preserve returned bounds. @@ -196,13 +196,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 +# endif +#endif + - fstpt LRV_ST0_OFFSET(%rcx) - fstpt LRV_ST1_OFFSET(%rcx) - + fstpt LRV_ST0_OFFSET(%rcx) + fstpt LRV_ST1_OFFSET(%rcx) + @@ -254,6 +278,16 @@ 1: #endif - + +#ifndef __ILP32__ +# ifdef HAVE_MPX_SUPPORT + bndmov LRV_BND0_OFFSET(%rcx), %bnd0 # Restore bound registers. @@ -213,16 +213,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 +# endif +#endif + - fldt LRV_ST1_OFFSET(%rsp) - fldt LRV_ST0_OFFSET(%rsp) - + fldt LRV_ST1_OFFSET(%rsp) + fldt LRV_ST0_OFFSET(%rsp) + diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:26:03.468045806 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:27:41.534851924 -0400 @@ -24,6 +24,30 @@ # error RTLD_SAVESPACE_SSE must be aligned to 32 bytes #endif - + +/* Area on stack to save and restore registers used for parameter + passing when calling _dl_fixup. */ +#ifdef __ILP32__ @@ -247,13 +247,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 +#define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8) +#define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8) + - .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, @function + .text + .globl _dl_runtime_resolve + .type _dl_runtime_resolve, @function @@ -31,28 +55,63 @@ - cfi_startproc + cfi_startproc _dl_runtime_resolve: - cfi_adjust_cfa_offset(16) # Incorporate PLT + cfi_adjust_cfa_offset(16) # Incorporate PLT - subq $56,%rsp - cfi_adjust_cfa_offset(56) - movq %rax,(%rsp) # Preserve registers otherwise clobbered. @@ -294,8 +294,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + # %rdi: link_map, %rsi: reloc_index + movq (REGISTER_SAVE_AREA + 8)(%rsp), %rsi + movq REGISTER_SAVE_AREA(%rsp), %rdi - call _dl_fixup # Call resolver. - movq %rax, %r11 # Save return value + call _dl_fixup # Call resolver. + movq %rax, %r11 # Save return value - movq 48(%rsp), %r9 # Get register content back. - movq 40(%rsp), %r8 - movq 32(%rsp), %rdi @@ -331,13 +331,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + # Adjust stack(PLT did 2 pushes) + addq $(REGISTER_SAVE_AREA + 16), %rsp + cfi_adjust_cfa_offset(-(REGISTER_SAVE_AREA + 16)) - jmp *%r11 # Jump to function address. - cfi_endproc - .size _dl_runtime_resolve, .-_dl_runtime_resolve + jmp *%r11 # Jump to function address. + cfi_endproc + .size _dl_runtime_resolve, .-_dl_runtime_resolve @@ -130,6 +189,20 @@ - movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) - movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) - + movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) + movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) + +# ifndef __ILP32__ +# ifdef HAVE_MPX_SUPPORT + bndmov %bnd0, (LR_BND_OFFSET)(%rsp) # Preserve bound @@ -353,7 +353,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 +# endif + # if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT - .data + .data L(have_avx): diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym --- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:26:03.468045806 -0400 @@ -363,7 +363,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a68 YMM_SIZE sizeof (La_x86_64_ymm) ZMM_SIZE sizeof (La_x86_64_zmm) +BND_SIZE sizeof (__int128) - + LR_SIZE sizeof (struct La_x86_64_regs) LR_RDX_OFFSET offsetof (struct La_x86_64_regs, lr_rdx) @@ -18,6 +19,9 @@ @@ -373,7 +373,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a68 +#ifndef __ILP32__ +LR_BND_OFFSET offsetof (struct La_x86_64_regs, lr_bnd) +#endif - + LRV_SIZE sizeof (struct La_x86_64_retval) LRV_RAX_OFFSET offsetof (struct La_x86_64_retval, lrv_rax) @@ -28,3 +32,7 @@ diff --git a/SOURCES/glibc-rh1133812-1.patch b/SOURCES/glibc-rh1133812-1.patch index 0ca6f221..963e6a42 100644 --- a/SOURCES/glibc-rh1133812-1.patch +++ b/SOURCES/glibc-rh1133812-1.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Tue Aug 26 19:38:59 2014 +0200 __gconv_translit_find: Disable function [BZ #17187] - + This functionality has never worked correctly, and the implementation contained a security vulnerability (CVE-2014-5119). @@ -21,7 +21,7 @@ index 1e25854..d71c029 100644 @@ -238,181 +238,11 @@ __gconv_transliterate (struct __gconv_step *step, return __GCONV_ILLEGAL_INPUT; } - + - -/* Structure to represent results of found (or not) transliteration - modules. */ @@ -203,5 +203,6 @@ index 1e25854..d71c029 100644 + not implemented. */ + return 1; } --- +-- 1.9.3 + diff --git a/SOURCES/glibc-rh1133812-2.patch b/SOURCES/glibc-rh1133812-2.patch index ba61a116..63e35571 100644 --- a/SOURCES/glibc-rh1133812-2.patch +++ b/SOURCES/glibc-rh1133812-2.patch @@ -9,7 +9,7 @@ Author: Florian Weimer Date: Mon May 12 15:24:12 2014 +0200 _nl_find_locale: Improve handling of crafted locale names [BZ #17137] - + Prevent directory traversal in locale-related environment variables (CVE-2014-0475). @@ -18,7 +18,7 @@ Author: Florian Weimer Date: Wed May 28 14:41:52 2014 +0200 setlocale: Use the heap for the copy of the locale argument - + This avoids alloca calls with potentially large arguments. diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/findlocale.c @@ -26,16 +26,16 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi +++ glibc-2.17-c758a686/locale/findlocale.c 2014-08-26 16:14:50.403253778 +0530 @@ -17,6 +17,7 @@ . */ - + #include +#include #include #include #include @@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_ - + const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR; - + +/* Checks if the name is actually present, that is, not NULL and not + empty. */ +static inline int @@ -75,7 +75,7 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi + return 0; + return 1; +} - + struct __locale_data * internal_function @@ -65,7 +105,7 @@ _nl_find_locale (const char *locale_path @@ -90,19 +90,19 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi @@ -73,31 +113,39 @@ _nl_find_locale (const char *locale_path const char *normalized_codeset; struct loaded_l10nfile *locale_file; - + - if ((*name)[0] == '\0') + if (loc_name[0] == '\0') { /* The user decides which locale to use by setting environment - variables. */ + variables. */ - *name = getenv ("LC_ALL"); - if (*name == NULL || (*name)[0] == '\0') - *name = getenv (_nl_category_names.str + loc_name = getenv ("LC_ALL"); + if (!name_present (loc_name)) + loc_name = getenv (_nl_category_names.str - + _nl_category_name_idxs[category]); + + _nl_category_name_idxs[category]); - if (*name == NULL || (*name)[0] == '\0') - *name = getenv ("LANG"); + if (!name_present (loc_name)) @@ -110,7 +110,7 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi + if (!name_present (loc_name)) + loc_name = (char *) _nl_C_name; } - + - if (*name == NULL || (*name)[0] == '\0' - || (__builtin_expect (__libc_enable_secure, 0) - && strchr (*name, '/') != NULL)) @@ -118,14 +118,14 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi + /* We used to fall back to the C locale if the name contains a slash + character '/', but we now check for directory traversal in + valid_locale_name, so this is no longer necessary. */ - + - if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0 - || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0) + if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0 + || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0) { /* We need not load anything. The needed data is contained in - the library itself. */ + the library itself. */ *name = (char *) _nl_C_name; return _nl_C[category]; } @@ -136,25 +136,25 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi + } + + *name = loc_name; - + /* We really have to load some data. First we try the archive, but only if there was no LOCPATH environment variable specified. */ diff -pruN glibc-2.17-c758a686/locale/setlocale.c glibc-2.17-c758a686/locale/setlocale.c --- glibc-2.17-c758a686/locale/setlocale.c 2013-08-11 04:22:55.000000000 +0530 +++ glibc-2.17-c758a686/locale/setlocale.c 2014-08-26 16:14:50.401253764 +0530 @@ -272,6 +272,8 @@ setlocale (int category, const char *loc - of entries of the form `CATEGORY=VALUE'. */ + of entries of the form `CATEGORY=VALUE'. */ const char *newnames[__LC_LAST]; struct __locale_data *newdata[__LC_LAST]; + /* Copy of the locale argument, for in-place splitting. */ + char *locale_copy = NULL; - + /* Set all name pointers to the argument name. */ for (category = 0; category < __LC_LAST; ++category) @@ -281,7 +283,13 @@ setlocale (int category, const char *loc if (__builtin_expect (strchr (locale, ';') != NULL, 0)) - { - /* This is a composite name. Make a copy and split it up. */ + { + /* This is a composite name. Make a copy and split it up. */ - char *np = strdupa (locale); + locale_copy = strdup (locale); + if (__glibc_unlikely (locale_copy == NULL)) @@ -163,35 +163,35 @@ diff -pruN glibc-2.17-c758a686/locale/setlocale.c glibc-2.17-c758a686/locale/set + return NULL; + } + char *np = locale_copy; - char *cp; - int cnt; - + char *cp; + int cnt; + @@ -299,6 +307,7 @@ setlocale (int category, const char *loc - { - error_return: - __libc_rwlock_unlock (__libc_setlocale_lock); + { + error_return: + __libc_rwlock_unlock (__libc_setlocale_lock); + free (locale_copy); - - /* Bogus category name. */ - ERROR_RETURN; + + /* Bogus category name. */ + ERROR_RETURN; @@ -391,8 +400,9 @@ setlocale (int category, const char *loc /* Critical section left. */ __libc_rwlock_unlock (__libc_setlocale_lock); - + - /* Free the resources (the locale path variable). */ + /* Free the resources. */ free (locale_path); + free (locale_copy); - + return composite; } diff -pruN glibc-2.17-c758a686/localedata/Makefile glibc-2.17-c758a686/localedata/Makefile --- glibc-2.17-c758a686/localedata/Makefile 2014-08-26 16:15:22.656474571 +0530 +++ glibc-2.17-c758a686/localedata/Makefile 2014-08-26 16:14:50.403253778 +0530 @@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is - + tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ - tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ + tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ - tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 + tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 ifeq (yes,$(build-shared)) @@ -417,7 +417,7 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc * Yes-or-No Questions:: Check a Response against the locale. @@ -99,14 +100,16 @@ locale named @samp{espana-castellano} to most of Spain. - + The set of locales supported depends on the operating system you are -using, and so do their names. We can't make any promises about what -locales will exist, except for one standard locale called @samp{C} or @@ -428,25 +428,25 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc + +In order to force the system to always use the default locale, the +user can set the @code{LC_ALL} environment variable to @samp{C}. - + @cindex combining locales -A user also has the option of specifying different locales for different -purposes---in effect, choosing a mixture of multiple locales. +A user also has the option of specifying different locales for +different purposes---in effect, choosing a mixture of multiple +locales. @xref{Locale Categories}. - + For example, the user might specify the locale @samp{espana-castellano} for most purposes, but specify the locale @samp{usa-english} for @@ -120,7 +123,7 @@ which locales apply. However, the user for a particular subset of those purposes. - + @node Locale Categories, Setting the Locale, Choosing Locale, Locales -@section Categories of Activities that Locales Affect +@section Locale Categories @cindex categories for locales @cindex locale categories - + @@ -128,7 +131,11 @@ The purposes that locales serve are grou that a user or a program can choose the locale for each category independently. Here is a table of categories; each name is both an @@ -457,7 +457,7 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc +The contents of the environment variable (or the string in the second +argument to @code{setlocale}) has to be a valid locale name. +@xref{Locale Names}. - + @vtable @code @comment locale.h @@ -172,7 +179,7 @@ for affirmative and negative responses. @@ -481,11 +481,11 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc - locale -a -@end smallexample +@var{category} to @var{locale}. - + If @var{category} is @code{LC_ALL}, this specifies the locale for all purposes. The other possible values of @var{category} specify an @@ -256,10 +257,9 @@ is passed in as @var{locale} parameter. - + When you read the current locale for category @code{LC_ALL}, the value encodes the entire combination of selected locales for all categories. -In this case, the value is not just a single locale name. In fact, we @@ -495,13 +495,13 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc +If you specify the same ``locale name'' with @code{LC_ALL} in a +subsequent call to @code{setlocale}, it restores the same combination +of locale selections. - + To be sure you can use the returned string encoding the currently selected locale at a later time, you must make a copy of the string. It is not @@ -275,20 +275,15 @@ for @var{category}. If a nonempty string is given for @var{locale}, then the locale of that name is used if possible. - + +The effective locale name (either the second argument to +@code{setlocale}, or if the argument is an empty string, the name +obtained from the process environment) must be valid locale name. @@ -510,7 +510,7 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc If you specify an invalid locale name, @code{setlocale} returns a null pointer and leaves the current locale unchanged. @end deftypefun - + -The path used for finding locale data can be set using the -@code{LOCPATH} environment variable. The default path for finding -locale data is system specific. It is computed from the value given @@ -523,20 +523,20 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc - Here is an example showing how you might use @code{setlocale} to temporarily switch to a new locale. - + @@ -328,7 +323,7 @@ locale categories, and future versions o portability, assume that any symbol beginning with @samp{LC_} might be defined in @file{locale.h}. - + -@node Standard Locales, Locale Information, Setting the Locale, Locales +@node Standard Locales, Locale Names, Setting the Locale, Locales @section Standard Locales - + The only locale names you can count on finding on all operating systems @@ -362,7 +357,94 @@ with the environment, rather than trying locale explicitly by name. Remember, different machines might have different sets of locales installed. - + -@node Locale Information, Formatting Numbers, Standard Locales, Locales +@node Locale Names, Locale Information, Standard Locales, Locales +@section Locale Names @@ -627,5 +627,5 @@ diff -pruN glibc-2.17-c758a686/manual/locale.texi glibc-2.17-c758a686/manual/loc + +@node Locale Information, Formatting Numbers, Locale Names, Locales @section Accessing Locale Information - + There are several ways to access locale information. The simplest diff --git a/SOURCES/glibc-rh1133812-3.patch b/SOURCES/glibc-rh1133812-3.patch index 985a0087..c94a5ffb 100644 --- a/SOURCES/glibc-rh1133812-3.patch +++ b/SOURCES/glibc-rh1133812-3.patch @@ -3,18 +3,18 @@ Author: Joseph Myers Date: Wed Jun 4 23:37:25 2014 +0000 Include LOCPATH in default test environment. - + Tests run using the default $(make-test-out) automatically get GCONV_PATH and LC_ALL set, whether or not those environment variables are actually needed for the individual test. However, they do not get LOCPATH set, meaning that a large number of tests have -ENV settings just to set LOCPATH. - + This patch moves LOCPATH into the default environment used for all tests, on the principle that like GCONV_PATH any settings needed to use files associated with the newly built library, rather than any old installed files, are appropriate to use by default. - + A further motivation is that various tests using .sh files also set some combination of LC_ALL, GCONV_PATH and LOCPATH. Preferably .sh files should also use the default environment with any additions @@ -25,7 +25,7 @@ Date: Wed Jun 4 23:37:25 2014 +0000 environment settings are required. With such a change, it's also natural for those variables to include the default settings (via some intermediate makefile variable also used in make-test-out). - + Because some .sh files only set variables that correspond to the default settings, or a subset thereof, and this applies to more of the .sh files once LOCPATH is in the default settings, doing so reduces @@ -35,156 +35,156 @@ Date: Wed Jun 4 23:37:25 2014 +0000 the separate -before-env and -after-env variables, only the single variable they do at present. So moving LOCPATH into the default settings can reduce churn caused by subsequent patches. - + Tested x86_64 and x86. - - * Rules (make-test-out): Include - LOCPATH=$(common-objpfx)localedata in default environment. - * debug/Makefile (tst-chk1-ENV): Remove variable. - (tst-chk2-ENV): Likewise. - (tst-chk3-ENV): Likewise. - (tst-chk4-ENV): Likewise. - (tst-chk5-ENV): Likewise. - (tst-chk6-ENV): Likewise. - (tst-lfschk1-ENV): Likewise. - (tst-lfschk2-ENV): Likewise. - (tst-lfschk3-ENV): Likewise. - (tst-lfschk4-ENV): Likewise. - (tst-lfschk5-ENV): Likewise. - (tst-lfschk6-ENV): Likewise. - * iconvdata/Makefile (bug-iconv6-ENV): Likewise. - (tst-iconv7-ENV): Likewise. - * intl/Makefile (LOCPATH-ENV): Likewise. - (tst-codeset-ENV): Likewise. - (tst-gettext3-ENV): Likewise. - (tst-gettext5-ENV): Likewise. - * libio/Makefile (tst-widetext-ENV): Don't set LOCPATH. - (tst-fopenloc-ENV): Likewise. - (tst-fgetws-ENV): Remove variable. - (tst-ungetwc1-ENV): Likewise. - (tst-ungetwc2-ENV): Likewise. - (bug-ungetwc2-ENV): Likewise. - (tst-swscanf-ENV): Likewise. - (bug-ftell-ENV): Likewise. - (tst-fgetwc-ENV): Likewise. - (tst-fseek-ENV): Likewise. - (tst-ftell-partial-wide-ENV): Likewise. - (tst-ftell-active-handler-ENV): Likewise. - (tst-ftell-append-ENV): Likewise. - * posix/Makefile (tst-fnmatch-ENV): Likewise. - (tst-regexloc-ENV): Likewise. - (bug-regex1-ENV): Likewise. - (tst-regex-ENV): Likewise. - (tst-regex2-ENV): Likewise. - (bug-regex5-ENV): Likewise. - (bug-regex6-ENV): Likewise. - (bug-regex17-ENV): Likewise. - (bug-regex18-ENV): Likewise. - (bug-regex19-ENV): Likewise. - (bug-regex20-ENV): Likewise. - (bug-regex22-ENV): Likewise. - (bug-regex23-ENV): Likewise. - (bug-regex25-ENV): Likewise. - (bug-regex26-ENV): Likewise. - (bug-regex30-ENV): Likewise. - (bug-regex32-ENV): Likewise. - (bug-regex33-ENV): Likewise. - (bug-regex34-ENV): Likewise. - (bug-regex35-ENV): Likewise. - (tst-rxspencer-ENV): Likewise. - (tst-rxspencer-no-utf8-ENV): Likewise. - * stdio-common/Makefile (tst-sprintf-ENV): Likewise. - (tst-sscanf-ENV): Likewise. - (tst-swprintf-ENV): Likewise. - (tst-swscanf-ENV): Likewise. - (test-vfprintf-ENV): Likewise. - (scanf13-ENV): Likewise. - (bug14-ENV): Likewise. - (tst-grouping-ENV): Likewise. - * stdlib/Makefile (tst-strtod-ENV): Likewise. - (tst-strtod3-ENV): Likewise. - (tst-strtod4-ENV): Likewise. - (tst-strtod5-ENV): Likewise. - (testmb2-ENV): Likewise./ - * string/Makefile (tst-strxfrm-ENV): Likewise. - (tst-strxfrm2-ENV): Likewise. - (bug-strcoll1-ENV): Likewise. - (test-strcasecmp-ENV): Likewise. - (test-strncasecmp-ENV): Likewise. - * time/Makefile (tst-strptime-ENV): Likewise. - (tst-ftime_l-ENV): Likewise. - * wcsmbs/Makefile (tst-btowc-ENV): Likewise. - (tst-mbrtowc-ENV): Likewise. - (tst-wcrtomb-ENV): Likewise. - (tst-mbrtowc2-ENV): Likewise. - (tst-c16c32-1-ENV): Likewise. - (tst-mbsnrtowcs-ENV): Likewise. - + + * Rules (make-test-out): Include + LOCPATH=$(common-objpfx)localedata in default environment. + * debug/Makefile (tst-chk1-ENV): Remove variable. + (tst-chk2-ENV): Likewise. + (tst-chk3-ENV): Likewise. + (tst-chk4-ENV): Likewise. + (tst-chk5-ENV): Likewise. + (tst-chk6-ENV): Likewise. + (tst-lfschk1-ENV): Likewise. + (tst-lfschk2-ENV): Likewise. + (tst-lfschk3-ENV): Likewise. + (tst-lfschk4-ENV): Likewise. + (tst-lfschk5-ENV): Likewise. + (tst-lfschk6-ENV): Likewise. + * iconvdata/Makefile (bug-iconv6-ENV): Likewise. + (tst-iconv7-ENV): Likewise. + * intl/Makefile (LOCPATH-ENV): Likewise. + (tst-codeset-ENV): Likewise. + (tst-gettext3-ENV): Likewise. + (tst-gettext5-ENV): Likewise. + * libio/Makefile (tst-widetext-ENV): Don't set LOCPATH. + (tst-fopenloc-ENV): Likewise. + (tst-fgetws-ENV): Remove variable. + (tst-ungetwc1-ENV): Likewise. + (tst-ungetwc2-ENV): Likewise. + (bug-ungetwc2-ENV): Likewise. + (tst-swscanf-ENV): Likewise. + (bug-ftell-ENV): Likewise. + (tst-fgetwc-ENV): Likewise. + (tst-fseek-ENV): Likewise. + (tst-ftell-partial-wide-ENV): Likewise. + (tst-ftell-active-handler-ENV): Likewise. + (tst-ftell-append-ENV): Likewise. + * posix/Makefile (tst-fnmatch-ENV): Likewise. + (tst-regexloc-ENV): Likewise. + (bug-regex1-ENV): Likewise. + (tst-regex-ENV): Likewise. + (tst-regex2-ENV): Likewise. + (bug-regex5-ENV): Likewise. + (bug-regex6-ENV): Likewise. + (bug-regex17-ENV): Likewise. + (bug-regex18-ENV): Likewise. + (bug-regex19-ENV): Likewise. + (bug-regex20-ENV): Likewise. + (bug-regex22-ENV): Likewise. + (bug-regex23-ENV): Likewise. + (bug-regex25-ENV): Likewise. + (bug-regex26-ENV): Likewise. + (bug-regex30-ENV): Likewise. + (bug-regex32-ENV): Likewise. + (bug-regex33-ENV): Likewise. + (bug-regex34-ENV): Likewise. + (bug-regex35-ENV): Likewise. + (tst-rxspencer-ENV): Likewise. + (tst-rxspencer-no-utf8-ENV): Likewise. + * stdio-common/Makefile (tst-sprintf-ENV): Likewise. + (tst-sscanf-ENV): Likewise. + (tst-swprintf-ENV): Likewise. + (tst-swscanf-ENV): Likewise. + (test-vfprintf-ENV): Likewise. + (scanf13-ENV): Likewise. + (bug14-ENV): Likewise. + (tst-grouping-ENV): Likewise. + * stdlib/Makefile (tst-strtod-ENV): Likewise. + (tst-strtod3-ENV): Likewise. + (tst-strtod4-ENV): Likewise. + (tst-strtod5-ENV): Likewise. + (testmb2-ENV): Likewise./ + * string/Makefile (tst-strxfrm-ENV): Likewise. + (tst-strxfrm2-ENV): Likewise. + (bug-strcoll1-ENV): Likewise. + (test-strcasecmp-ENV): Likewise. + (test-strncasecmp-ENV): Likewise. + * time/Makefile (tst-strptime-ENV): Likewise. + (tst-ftime_l-ENV): Likewise. + * wcsmbs/Makefile (tst-btowc-ENV): Likewise. + (tst-mbrtowc-ENV): Likewise. + (tst-wcrtomb-ENV): Likewise. + (tst-mbrtowc2-ENV): Likewise. + (tst-c16c32-1-ENV): Likewise. + (tst-mbsnrtowcs-ENV): Likewise. + localedata/ChangeLog: - * Makefile (TEST_MBWC_ENV): Remove variable. - (tst_iswalnum-ENV): Likewise. - (tst_iswalpha-ENV): Likewise. - (tst_iswcntrl-ENV): Likewise. - (tst_iswctype-ENV): Likewise. - (tst_iswdigit-ENV): Likewise. - (tst_iswgraph-ENV): Likewise. - (tst_iswlower-ENV): Likewise. - (tst_iswprint-ENV): Likewise. - (tst_iswpunct-ENV): Likewise. - (tst_iswspace-ENV): Likewise. - (tst_iswupper-ENV): Likewise. - (tst_iswxdigit-ENV): Likewise. - (tst_mblen-ENV): Likewise. - (tst_mbrlen-ENV): Likewise. - (tst_mbrtowc-ENV): Likewise. - (tst_mbsrtowcs-ENV): Likewise. - (tst_mbstowcs-ENV): Likewise. - (tst_mbtowc-ENV): Likewise. - (tst_strcoll-ENV): Likewise. - (tst_strfmon-ENV): Likewise. - (tst_strxfrm-ENV): Likewise. - (tst_swscanf-ENV): Likewise. - (tst_towctrans-ENV): Likewise. - (tst_towlower-ENV): Likewise. - (tst_towupper-ENV): Likewise. - (tst_wcrtomb-ENV): Likewise. - (tst_wcscat-ENV): Likewise. - (tst_wcschr-ENV): Likewise. - (tst_wcscmp-ENV): Likewise. - (tst_wcscoll-ENV): Likewise. - (tst_wcscpy-ENV): Likewise. - (tst_wcscspn-ENV): Likewise. - (tst_wcslen-ENV): Likewise. - (tst_wcsncat-ENV): Likewise. - (tst_wcsncmp-ENV): Likewise. - (tst_wcsncpy-ENV): Likewise. - (tst_wcspbrk-ENV): Likewise. - (tst_wcsrtombs-ENV): Likewise. - (tst_wcsspn-ENV): Likewise. - (tst_wcsstr-ENV): Likewise. - (tst_wcstod-ENV): Likewise. - (tst_wcstok-ENV): Likewise. - (tst_wcstombs-ENV): Likewise. - (tst_wcswidth-ENV): Likewise. - (tst_wcsxfrm-ENV): Likewise. - (tst_wctob-ENV): Likewise. - (tst_wctomb-ENV): Likewise. - (tst_wctrans-ENV): Likewise. - (tst_wctype-ENV): Likewise. - (tst_wcwidth-ENV): Likewise. - (tst-digits-ENV): Likewise. - (tst-mbswcs6-ENV): Likewise. - (tst-xlocale1-ENV): Likewise. - (tst-xlocale2-ENV): Likewise. - (tst-strfmon1-ENV): Likewise. - (tst-strptime-ENV): Likewise. - (tst-setlocale-ENV): Don't set LOCPATH. - (bug-iconv-trans-ENV): Remove variable. - (tst-sscanf-ENV): Likewise. - (tst-leaks-ENV): Don't set LOCPATH. - (bug-setlocale1-ENV): Remove variable. - (bug-setlocale1-static-ENV): Likewise. - (tst-setlocale2-ENV): Likewise. + * Makefile (TEST_MBWC_ENV): Remove variable. + (tst_iswalnum-ENV): Likewise. + (tst_iswalpha-ENV): Likewise. + (tst_iswcntrl-ENV): Likewise. + (tst_iswctype-ENV): Likewise. + (tst_iswdigit-ENV): Likewise. + (tst_iswgraph-ENV): Likewise. + (tst_iswlower-ENV): Likewise. + (tst_iswprint-ENV): Likewise. + (tst_iswpunct-ENV): Likewise. + (tst_iswspace-ENV): Likewise. + (tst_iswupper-ENV): Likewise. + (tst_iswxdigit-ENV): Likewise. + (tst_mblen-ENV): Likewise. + (tst_mbrlen-ENV): Likewise. + (tst_mbrtowc-ENV): Likewise. + (tst_mbsrtowcs-ENV): Likewise. + (tst_mbstowcs-ENV): Likewise. + (tst_mbtowc-ENV): Likewise. + (tst_strcoll-ENV): Likewise. + (tst_strfmon-ENV): Likewise. + (tst_strxfrm-ENV): Likewise. + (tst_swscanf-ENV): Likewise. + (tst_towctrans-ENV): Likewise. + (tst_towlower-ENV): Likewise. + (tst_towupper-ENV): Likewise. + (tst_wcrtomb-ENV): Likewise. + (tst_wcscat-ENV): Likewise. + (tst_wcschr-ENV): Likewise. + (tst_wcscmp-ENV): Likewise. + (tst_wcscoll-ENV): Likewise. + (tst_wcscpy-ENV): Likewise. + (tst_wcscspn-ENV): Likewise. + (tst_wcslen-ENV): Likewise. + (tst_wcsncat-ENV): Likewise. + (tst_wcsncmp-ENV): Likewise. + (tst_wcsncpy-ENV): Likewise. + (tst_wcspbrk-ENV): Likewise. + (tst_wcsrtombs-ENV): Likewise. + (tst_wcsspn-ENV): Likewise. + (tst_wcsstr-ENV): Likewise. + (tst_wcstod-ENV): Likewise. + (tst_wcstok-ENV): Likewise. + (tst_wcstombs-ENV): Likewise. + (tst_wcswidth-ENV): Likewise. + (tst_wcsxfrm-ENV): Likewise. + (tst_wctob-ENV): Likewise. + (tst_wctomb-ENV): Likewise. + (tst_wctrans-ENV): Likewise. + (tst_wctype-ENV): Likewise. + (tst_wcwidth-ENV): Likewise. + (tst-digits-ENV): Likewise. + (tst-mbswcs6-ENV): Likewise. + (tst-xlocale1-ENV): Likewise. + (tst-xlocale2-ENV): Likewise. + (tst-strfmon1-ENV): Likewise. + (tst-strptime-ENV): Likewise. + (tst-setlocale-ENV): Don't set LOCPATH. + (bug-iconv-trans-ENV): Remove variable. + (tst-sscanf-ENV): Likewise. + (tst-leaks-ENV): Don't set LOCPATH. + (bug-setlocale1-ENV): Remove variable. + (bug-setlocale1-static-ENV): Likewise. + (tst-setlocale2-ENV): Likewise. diff --git glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules index feb304d..9f1a445 100644 @@ -192,14 +192,14 @@ index feb304d..9f1a445 100644 +++ glibc-2.17-c758a686/Rules @@ -191,7 +191,8 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" "" # from the test programs and whatever input files are present. - + make-test-out = $(test-wrapper-env) \ - GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ + GCONV_PATH=$(common-objpfx)iconvdata \ + LOCPATH=$(common-objpfx)localedata LC_ALL=C \ - $($*-ENV) $(host-built-program-cmd) $($*-ARGS) + $($*-ENV) $(host-built-program-cmd) $($*-ARGS) $(objpfx)%-bp.out: %.input $(objpfx)%-bp - $(make-test-out) > $@ < $(word 1,$^) + $(make-test-out) > $@ < $(word 1,$^) diff --git glibc-2.17-c758a686/debug/Makefile glibc-2.17-c758a686/debug/Makefile index b599a22..c284c51 100644 --- glibc-2.17-c758a686/debug/Makefile @@ -229,13 +229,13 @@ index 074d330..d98b6bd 100644 +++ glibc-2.17-c758a686/iconvdata/Makefile @@ -73,9 +73,6 @@ tests += bug-iconv3 endif - + test-srcs := tst-table-from tst-table-to - -bug-iconv6-ENV = LOCPATH=$(common-objpfx)localedata -tst-iconv7-ENV = LOCPATH=$(common-objpfx)localedata endif - + # No code here is in libc.so. diff --git glibc-2.17-c758a686/intl/Makefile glibc-2.17-c758a686/intl/Makefile index f11449d..10051f6 100644 @@ -244,7 +244,7 @@ index f11449d..10051f6 100644 @@ -118,11 +118,6 @@ CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(objpfx)\" CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\" CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\" - + -LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata -tst-codeset-ENV = $(LOCPATH-ENV) -tst-gettext3-ENV = $(LOCPATH-ENV) @@ -258,9 +258,9 @@ index b324ccc..4552360 100644 --- glibc-2.17-c758a686/libio/Makefile +++ glibc-2.17-c758a686/libio/Makefile @@ -148,17 +148,8 @@ CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\" - + tst_wprintf2-ARGS = "Some Text" - + -tst-widetext-ENV = LOCPATH=$(common-objpfx)localedata LANGUAGE=C -tst-fopenloc-ENV = LOCPATH=$(common-objpfx)localedata \ - MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace @@ -274,17 +274,17 @@ index b324ccc..4552360 100644 -tst-fseek-ENV = LOCPATH=$(common-objpfx)localedata +tst-widetext-ENV = LANGUAGE=C +tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace - + generated = tst-fopenloc.mtrace tst-fopenloc.check - + diff --git glibc-2.17-c758a686/localedata/Makefile glibc-2.17-c758a686/localedata/Makefile index d7ab445..20da00c 100644 --- glibc-2.17-c758a686/localedata/Makefile +++ glibc-2.17-c758a686/localedata/Makefile @@ -215,79 +215,13 @@ - $(addprefix --prefix=,$(install_root)) $$locale; \ - echo ' done'; \ - + $(addprefix --prefix=,$(install_root)) $$locale; \ + echo ' done'; \ + -# The mbwc-tests need some environment setup to find the locale data files -TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata -tst_iswalnum-ENV = $(TEST_MBWC_ENV) @@ -344,7 +344,7 @@ index d7ab445..20da00c 100644 -tst-strfmon1-ENV = $(TEST_MBWC_ENV) -tst-strptime-ENV = $(TEST_MBWC_ENV) +tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP - + -tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP - -bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata @@ -355,14 +355,14 @@ index d7ab445..20da00c 100644 - LOCPATH=$(common-objpfx)localedata +tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out - $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ - + $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ + -bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata bug-setlocale1-ARGS = $(common-objpfx) -tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata - + $(objdir)/iconvdata/gconv-modules: - $(MAKE) -C ../iconvdata subdir=iconvdata $@ + $(MAKE) -C ../iconvdata subdir=iconvdata $@ diff --git glibc-2.17-c758a686/posix/Makefile glibc-2.17-c758a686/posix/Makefile index 328c2c5..3d75971 100644 --- glibc-2.17-c758a686/posix/Makefile @@ -370,7 +370,7 @@ index 328c2c5..3d75971 100644 @@ -203,27 +203,7 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); tst-chmod-ARGS = $(objdir) tst-vfork3-ARGS = --test-dir=$(objpfx) - + -tst-fnmatch-ENV = LOCPATH=$(common-objpfx)localedata -tst-regexloc-ENV = LOCPATH=$(common-objpfx)localedata -bug-regex1-ENV = LOCPATH=$(common-objpfx)localedata @@ -400,7 +400,7 @@ index f179eab..5f8e534 100644 --- glibc-2.17-c758a686/stdio-common/Makefile +++ glibc-2.17-c758a686/stdio-common/Makefile @@ -118,13 +118,6 @@ CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ - + # We know the test has a format string problem. CFLAGS-tst-sprintf.c = -Wno-format -tst-sprintf-ENV = LOCPATH=$(common-objpfx)localedata @@ -410,9 +410,9 @@ index f179eab..5f8e534 100644 -scanf13-ENV = LOCPATH=$(common-objpfx)localedata -bug14-ENV = LOCPATH=$(common-objpfx)localedata -tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata - + CPPFLAGS += $(libio-mtsafe) - + diff --git glibc-2.17-c758a686/stdlib/Makefile glibc-2.17-c758a686/stdlib/Makefile index d7a562f..0fdf7cc 100644 --- glibc-2.17-c758a686/stdlib/Makefile @@ -420,14 +420,14 @@ index d7a562f..0fdf7cc 100644 @@ -123,11 +123,6 @@ include ../Rules # Testdir has to be named stdlib and needs to be writable test-canon-ARGS = --test-dir=${common-objpfx}stdlib - + -tst-strtod-ENV = LOCPATH=$(common-objpfx)localedata -tst-strtod3-ENV = LOCPATH=$(common-objpfx)localedata -tst-strtod4-ENV = LOCPATH=$(common-objpfx)localedata -tst-strtod5-ENV = LOCPATH=$(common-objpfx)localedata -testmb2-ENV = LOCPATH=$(common-objpfx)localedata bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev - + # Run a test on the header files we use. diff --git glibc-2.17-c758a686/string/Makefile glibc-2.17-c758a686/string/Makefile index 5a76872..70b9c19 100644 @@ -450,7 +450,7 @@ index b7f3dba..a07c041 100644 @@ -55,7 +55,4 @@ CFLAGS-test_time.c = -Wno-format tst-getdate-ENV= DATEMSK=datemsk TZDIR=${common-objpfx}timezone/testdata test_time-ARGS= EST5EDT CST - + -tst-strptime-ENV = LOCPATH=${common-objpfx}localedata -tst-ftime_l-ENV = LOCPATH=${common-objpfx}localedata - @@ -460,7 +460,7 @@ index 197ca7d..42843a6 100644 --- glibc-2.17-c758a686/wcsmbs/Makefile +++ glibc-2.17-c758a686/wcsmbs/Makefile @@ -80,10 +80,3 @@ CPPFLAGS += $(libio-mtsafe) - + # We need to find the default version of strtold_l in stdlib. CPPFLAGS-wcstold_l.c = -I../stdlib - diff --git a/SOURCES/glibc-rh1138520.patch b/SOURCES/glibc-rh1138520.patch index 8437bb02..1ddb0514 100644 --- a/SOURCES/glibc-rh1138520.patch +++ b/SOURCES/glibc-rh1138520.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Mon Jan 27 11:32:44 2014 +0530 Avoid undefined behaviour in netgroupcache - + Using a buffer after it has been reallocated is undefined behaviour, so get offsets of the triplets in the old buffer before reallocating it. @@ -13,7 +13,7 @@ Author: Siddhesh Poyarekar Date: Fri Jan 24 13:51:15 2014 +0530 Adjust pointers to triplets in netgroup query data (BZ #16474) - + The _nss_*_getnetgrent_r query populates the netgroup results in the allocated buffer and then sets the result triplet to point to strings in the buffer. This is a problem when the buffer is reallocated since @@ -48,7 +48,7 @@ Date: Thu Jan 16 10:20:22 2014 +0530 called when there is a cache miss, so factors like network lookup or file reads will dominate over memory allocation/reallocation), so this premature optimization is unnecessary. - + Thanks Brad Hubbard for his help with debugging the problem. @@ -65,7 +65,7 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net { @@ -138,7 +137,7 @@ addgetnetgrentX (struct database_dyn *db } - + memset (&data, '\0', sizeof (data)); - buffer = alloca (buflen); + buffer = xmalloc (buflen); @@ -73,9 +73,9 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net memcpy (first_needed.elem.name, key, group_len); data.needed_groups = &first_needed.elem; @@ -218,21 +217,24 @@ addgetnetgrentX (struct database_dyn *db - - if (buflen - req->key_len - bufused < needed) - { + + if (buflen - req->key_len - bufused < needed) + { - size_t newsize = MAX (2 * buflen, - buflen + 2 * needed); - if (use_malloc || newsize > 1024 * 1024) @@ -109,13 +109,13 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net + ndomain = (ndomain ? newbuf + ndomaindiff + : NULL); + buffer = newbuf; - } - - nhost = memcpy (buffer + bufused, + } + + nhost = memcpy (buffer + bufused, @@ -299,18 +301,8 @@ addgetnetgrentX (struct database_dyn *db - } - else if (status == NSS_STATUS_UNAVAIL && e == ERANGE) - { + } + else if (status == NSS_STATUS_UNAVAIL && e == ERANGE) + { - size_t newsize = 2 * buflen; - if (use_malloc || newsize > 1024 * 1024) - { @@ -130,15 +130,16 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net - extend_alloca (buffer, buflen, newsize); + buflen *= 2; + buffer = xrealloc (buffer, buflen); - } - } - + } + } + @@ -446,8 +438,7 @@ addgetnetgrentX (struct database_dyn *db } - + out: - if (use_malloc) - free (buffer); + free (buffer); - + *resultp = dataset; + diff --git a/SOURCES/glibc-rh1140250.patch b/SOURCES/glibc-rh1140250.patch index e820ed58..570adbe6 100644 --- a/SOURCES/glibc-rh1140250.patch +++ b/SOURCES/glibc-rh1140250.patch @@ -3,10 +3,10 @@ Author: Florian Weimer Date: Fri Jun 5 10:50:38 2015 +0200 posix_fallocate: Emulation fixes and documentation [BZ #15661] - + Handle signed integer overflow correctly. Detect and reject O_APPEND. Document drawbacks of emulation. - + This does not completely address bug 15661, but improves the situation somewhat. @@ -15,7 +15,7 @@ Author: Paul Eggert Date: Tue Aug 25 23:42:01 2015 -0700 Fix broken overflow check in posix_fallocate [BZ 18873] - + * sysdeps/posix/posix_fallocate.c (posix_fallocate): * sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64): Fix parenthesization typo. @@ -30,12 +30,12 @@ Index: b/manual/filesys.texi * File Size:: Manually changing the size of a file. +* Storage Allocation:: Allocate backing storage for files. @end menu - + @node Attribute Meanings @@ -3232,6 +3233,99 @@ is a requirement of @code{mmap}. The pr real size, and when it has finished a final @code{ftruncate} call should set the real size of the file. - + +@node Storage Allocation +@subsection Storage Allocation +@cindex allocating file storage @@ -144,18 +144,18 @@ Index: b/sysdeps/posix/posix_fallocate.c +#include #include #include - + -/* Reserve storage for the data of the file associated with FD. */ +/* Reserve storage for the data of the file associated with FD. This + emulation is far from perfect, but the kernel cannot do not much + better for network file systems, either. */ - + int posix_fallocate (int fd, __off_t offset, __off_t len) { struct stat64 st; - struct statfs f; - + - /* `off_t' is a signed type. Therefore we can determine whether - OFFSET + LEN is too large if it is a negative value. */ if (offset < 0 || len < 0) @@ -166,7 +166,7 @@ Index: b/sysdeps/posix/posix_fallocate.c + extension. */ + if ((__off_t) ((uint64_t) offset + (uint64_t) len) < 0) return EFBIG; - + - /* First thing we have to make sure is that this is really a regular - file. */ + /* pwrite below will not do the right thing in O_APPEND mode. */ @@ -181,18 +181,18 @@ Index: b/sysdeps/posix/posix_fallocate.c return EBADF; if (S_ISFIFO (st.st_mode)) @@ -47,6 +57,8 @@ posix_fallocate (int fd, __off_t offset, - + if (len == 0) { + /* This is racy, but there is no good way to satisfy a + zero-length allocation request. */ if (st.st_size < offset) - { - int ret = __ftruncate (fd, offset); + { + int ret = __ftruncate (fd, offset); @@ -58,19 +70,36 @@ posix_fallocate (int fd, __off_t offset, return 0; } - + - /* We have to know the block size of the filesystem to get at least some - sort of performance. */ - if (__fstatfs (fd, &f) != 0) @@ -235,9 +235,9 @@ Index: b/sysdeps/posix/posix_fallocate.c { - len -= f.f_bsize; + len -= increment; - + if (offset < st.st_size) - { + { Index: b/sysdeps/posix/posix_fallocate64.c =================================================================== --- a/sysdeps/posix/posix_fallocate64.c @@ -250,18 +250,18 @@ Index: b/sysdeps/posix/posix_fallocate64.c +#include #include #include - + -/* Reserve storage for the data of the file associated with FD. */ +/* Reserve storage for the data of the file associated with FD. This + emulation is far from perfect, but the kernel cannot do not much + better for network file systems, either. */ - + int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len) { struct stat64 st; - struct statfs64 f; - + - /* `off64_t' is a signed type. Therefore we can determine whether - OFFSET + LEN is too large if it is a negative value. */ if (offset < 0 || len < 0) @@ -272,7 +272,7 @@ Index: b/sysdeps/posix/posix_fallocate64.c + extension. */ + if ((__off64_t) ((uint64_t) offset + (uint64_t) len) < 0) return EFBIG; - + - /* First thing we have to make sure is that this is really a regular - file. */ + /* pwrite64 below will not do the right thing in O_APPEND mode. */ @@ -287,18 +287,18 @@ Index: b/sysdeps/posix/posix_fallocate64.c return EBADF; if (S_ISFIFO (st.st_mode)) @@ -47,6 +57,8 @@ __posix_fallocate64_l64 (int fd, __off64 - + if (len == 0) { + /* This is racy, but there is no good way to satisfy a + zero-length allocation request. */ if (st.st_size < offset) - { - int ret = __ftruncate64 (fd, offset); + { + int ret = __ftruncate64 (fd, offset); @@ -58,19 +70,36 @@ __posix_fallocate64_l64 (int fd, __off64 return 0; } - + - /* We have to know the block size of the filesystem to get at least some - sort of performance. */ - if (__fstatfs64 (fd, &f) != 0) @@ -341,6 +341,6 @@ Index: b/sysdeps/posix/posix_fallocate64.c { - len -= f.f_bsize; + len -= increment; - + if (offset < st.st_size) - { + { diff --git a/SOURCES/glibc-rh1140272-avx512.patch b/SOURCES/glibc-rh1140272-avx512.patch index f1029691..5905e7b0 100644 --- a/SOURCES/glibc-rh1140272-avx512.patch +++ b/SOURCES/glibc-rh1140272-avx512.patch @@ -6,30 +6,30 @@ # commit aa4de9cea5c07d43caeaca9722c2d417e9a2919c # Author: H.J. Lu # Date: Fri Mar 14 08:51:25 2014 -0700 -# +# # Check AVX-512 assembler support first -# +# # It checks AVX-512 assembler support first and sets libc_cv_cc_avx512 to # $libc_cv_asm_avx512, instead of yes. GCC won't support AVX-512 if # assembler doesn't support it. -# +# # * sysdeps/x86_64/configure.ac: Check AVX-512 assembler support # first. Disable AVX-512 GCC support if assembler doesn't support # it. # * sysdeps/x86_64/configure: Regenerated. -# +# # commit 2d63a517e4084ec80403cd9f278690fa8b676cc4 # Author: Igor Zamyatin # Date: Thu Mar 13 11:10:22 2014 -0700 -# +# # Save and restore AVX-512 zmm registers to x86-64 ld.so -# +# # AVX-512 ISA adds 512-bit zmm registers. This patch updates # _dl_runtime_profile to pass zmm registers to run-time audit. It also # changes _dl_x86_64_save_sse and _dl_x86_64_restore_sse to upport zmm # registers, which are called when only when RTLD_PREPARE_FOREIGN_CALL # is used. Its performance impact is minimum. -# +# # * config.h.in (HAVE_AVX512_SUPPORT): New #undef. # (HAVE_AVX512_ASM_SUPPORT): Likewise. # * sysdeps/x86_64/bits/link.h (La_x86_64_zmm): New. @@ -53,11 +53,11 @@ # * sysdeps/x86_64/dl-trampoline.h: Updated to support different # size vector registers. # * sysdeps/x86_64/link-defines.sym (YMM_SIZE): New. -# (ZMM_SIZE): Likewise. +# (ZMM_SIZE): Likewise. # * sysdeps/x86_64/tst-audit10.c: New file. # * sysdeps/x86_64/tst-auditmod10a.c: Likewise. # * sysdeps/x86_64/tst-auditmod10b.c: Likewise. -# +# # In addition adds: # https://sourceware.org/ml/libc-alpha/2014-09/msg00228.html # To extend zmm register checking. @@ -68,7 +68,7 @@ diff -urN glibc-2.17-c758a686/config.h.in glibc-2.17-c758a686/config.h.in @@ -101,6 +101,12 @@ /* Define if gcc supports VEX encoding. */ #undef HAVE_SSE2AVX_SUPPORT - + +/* Define if compiler supports AVX512. */ +#undef HAVE_AVX512_SUPPORT + @@ -77,7 +77,7 @@ diff -urN glibc-2.17-c758a686/config.h.in glibc-2.17-c758a686/config.h.in + /* Define if gcc supports FMA4. */ #undef HAVE_FMA4_SUPPORT - + diff -urN glibc-2.17-c758a686/sysdeps/x86/bits/link.h glibc-2.17-c758a686/sysdeps/x86/bits/link.h --- glibc-2.17-c758a686/sysdeps/x86/bits/link.h 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86/bits/link.h 2014-09-10 23:16:36.331167056 -0400 @@ -102,9 +102,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure glibc-2.17-c758a686/sysde --- glibc-2.17-c758a686/sysdeps/x86_64/configure 2014-09-10 23:11:15.000787061 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/configure 2014-09-10 23:16:36.338167042 -0400 @@ -91,6 +91,59 @@ - + fi - + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support in assembler" >&5 +$as_echo_n "checking for AVX512 support in assembler... " >&6; } +if ${libc_cv_asm_avx512+:} false; then : @@ -167,7 +167,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure.in glibc-2.17-c758a686/sy @@ -21,6 +21,30 @@ AC_DEFINE(HAVE_AVX_SUPPORT) fi - + +dnl Check if asm supports AVX512. +AC_CACHE_CHECK(for AVX512 support in assembler, libc_cv_asm_avx512, [dnl +cat > conftest.s <<\EOF @@ -199,9 +199,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:16:36.334167050 -0400 @@ -19,14 +19,14 @@ - + #ifdef RESTORE_AVX - /* This is to support AVX audit modules. */ + /* This is to support AVX audit modules. */ - vmovdqu %ymm0, (LR_VECTOR_OFFSET)(%rsp) - vmovdqu %ymm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) - vmovdqu %ymm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) @@ -218,142 +218,142 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686 + VMOV %VEC(5), (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) + VMOV %VEC(6), (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) + VMOV %VEC(7), (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) - - /* Save xmm0-xmm7 registers to detect if any of them are - changed by audit module. */ + + /* Save xmm0-xmm7 registers to detect if any of them are + changed by audit module. */ @@ -72,7 +72,7 @@ - je 2f - vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET)(%rsp), %ymm0 +2: VMOV (LR_VECTOR_OFFSET)(%rsp), %VEC(0) - vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp) - + vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm8 @@ -81,7 +81,7 @@ - je 2f - vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %ymm1 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %VEC(1) - vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp) - + vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*2)(%rsp), %xmm2, %xmm8 @@ -90,7 +90,7 @@ - je 2f - vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %ymm2 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %VEC(2) - vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp) - + vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*3)(%rsp), %xmm3, %xmm8 @@ -99,7 +99,7 @@ - je 2f - vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %ymm3 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %VEC(3) - vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp) - + vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*4)(%rsp), %xmm4, %xmm8 @@ -108,7 +108,7 @@ - je 2f - vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %ymm4 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %VEC(4) - vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp) - + vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*5)(%rsp), %xmm5, %xmm8 @@ -117,7 +117,7 @@ - je 2f - vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %ymm5 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %VEC(5) - vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp) - + vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*6)(%rsp), %xmm6, %xmm8 @@ -126,7 +126,7 @@ - je 2f - vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %ymm6 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %VEC(6) - vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) - + vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*7)(%rsp), %xmm7, %xmm8 @@ -135,7 +135,7 @@ - je 2f - vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) + jmp 1f -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %ymm7 +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %VEC(7) - vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) - + vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) + 1: @@ -213,8 +213,8 @@ - + #ifdef RESTORE_AVX - /* This is to support AVX audit modules. */ + /* This is to support AVX audit modules. */ - vmovdqu %ymm0, LRV_VECTOR0_OFFSET(%rcx) - vmovdqu %ymm1, LRV_VECTOR1_OFFSET(%rcx) + VMOV %VEC(0), LRV_VECTOR0_OFFSET(%rcx) + VMOV %VEC(1), LRV_VECTOR1_OFFSET(%rcx) - - /* Save xmm0/xmm1 registers to detect if they are changed - by audit module. */ + + /* Save xmm0/xmm1 registers to detect if they are changed + by audit module. */ @@ -243,13 +243,13 @@ - vpmovmskb %xmm2, %esi - cmpl $0xffff, %esi - jne 1f + vpmovmskb %xmm2, %esi + cmpl $0xffff, %esi + jne 1f - vmovdqu LRV_VECTOR0_OFFSET(%rsp), %ymm0 + VMOV LRV_VECTOR0_OFFSET(%rsp), %VEC(0) - + 1: vpcmpeqq (LRV_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm2 - vpmovmskb %xmm2, %esi - cmpl $0xffff, %esi - jne 1f + vpmovmskb %xmm2, %esi + cmpl $0xffff, %esi + jne 1f - vmovdqu LRV_VECTOR1_OFFSET(%rsp), %ymm1 + VMOV LRV_VECTOR1_OFFSET(%rsp), %VEC(1) - + 1: #endif diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:16:36.334167050 -0400 @@ -96,7 +96,7 @@ - - /* Actively align the La_x86_64_regs structure. */ - andq $0xfffffffffffffff0, %rsp + + /* Actively align the La_x86_64_regs structure. */ + andq $0xfffffffffffffff0, %rsp -# ifdef HAVE_AVX_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT - /* sizeof(La_x86_64_regs). Need extra space for 8 SSE registers - to detect if any xmm0-xmm7 registers are changed by audit - module. */ + /* sizeof(La_x86_64_regs). Need extra space for 8 SSE registers + to detect if any xmm0-xmm7 registers are changed by audit + module. */ @@ -130,7 +130,7 @@ - movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) - movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) - + movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) + movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) + -# ifdef HAVE_AVX_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT - .data + .data L(have_avx): - .zero 4 + .zero 4 @@ -138,7 +138,7 @@ - .previous - - cmpl $0, L(have_avx)(%rip) + .previous + + cmpl $0, L(have_avx)(%rip) - jne 1f + jne L(defined) - movq %rbx, %r11 # Save rbx - movl $1, %eax - cpuid + movq %rbx, %r11 # Save rbx + movl $1, %eax + cpuid @@ -147,18 +147,54 @@ - // AVX and XSAVE supported? - andl $((1 << 28) | (1 << 27)), %ecx - cmpl $((1 << 28) | (1 << 27)), %ecx + // AVX and XSAVE supported? + andl $((1 << 28) | (1 << 27)), %ecx + cmpl $((1 << 28) | (1 << 27)), %ecx - jne 2f + jne 10f +# ifdef HAVE_AVX512_ASM_SUPPORT @@ -364,9 +364,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + cpuid + andl $(1 << 16), %ebx +# endif - xorl %ecx, %ecx - // Get XFEATURE_ENABLED_MASK - xgetbv + xorl %ecx, %ecx + // Get XFEATURE_ENABLED_MASK + xgetbv - andl $0x6, %eax -2: subl $0x5, %eax +# ifdef HAVE_AVX512_ASM_SUPPORT @@ -392,9 +392,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 +# endif +20: andl $0x6, %eax +10: subl $0x5, %eax - movl %eax, L(have_avx)(%rip) - cmpl $0, %eax - + movl %eax, L(have_avx)(%rip) + cmpl $0, %eax + -1: js L(no_avx) +L(defined): + js L(no_avx) @@ -402,29 +402,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + cmpl $0xe6, L(have_avx)(%rip) + je L(avx512) +# endif - + # define RESTORE_AVX +# define VMOV vmovdqu +# define VEC(i) ymm##i # define MORE_CODE # include "dl-trampoline.h" - + @@ -180,9 +216,9 @@ - .align 16 - cfi_startproc + .align 16 + cfi_startproc _dl_x86_64_save_sse: -# ifdef HAVE_AVX_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT - cmpl $0, L(have_avx)(%rip) + cmpl $0, L(have_avx)(%rip) - jne 1f + jne L(defined_5) - movq %rbx, %r11 # Save rbx - movl $1, %eax - cpuid + movq %rbx, %r11 # Save rbx + movl $1, %eax + cpuid @@ -191,21 +227,43 @@ - // AVX and XSAVE supported? - andl $((1 << 28) | (1 << 27)), %ecx - cmpl $((1 << 28) | (1 << 27)), %ecx + // AVX and XSAVE supported? + andl $((1 << 28) | (1 << 27)), %ecx + cmpl $((1 << 28) | (1 << 27)), %ecx - jne 2f + jne 1f +# ifdef HAVE_AVX512_ASM_SUPPORT @@ -435,9 +435,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + cpuid + andl $(1 << 16), %ebx +# endif - xorl %ecx, %ecx - // Get XFEATURE_ENABLED_MASK - xgetbv + xorl %ecx, %ecx + // Get XFEATURE_ENABLED_MASK + xgetbv - andl $0x6, %eax - cmpl $0x6, %eax - // Nonzero if SSE and AVX state saving is enabled. @@ -458,9 +458,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + +2: andl $0x6, %eax +1: subl $0x5, %eax - movl %eax, L(have_avx)(%rip) - cmpl $0, %eax - + movl %eax, L(have_avx)(%rip) + cmpl $0, %eax + -1: js L(no_avx5) +L(defined_5): + js L(no_avx5) @@ -468,15 +468,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 + cmpl $0xe6, L(have_avx)(%rip) + je L(avx512_5) +# endif - + -# define YMM_SIZE 32 - vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE - vmovdqa %ymm1, %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE - vmovdqa %ymm2, %fs:RTLD_SAVESPACE_SSE+2*YMM_SIZE + vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE + vmovdqa %ymm1, %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE + vmovdqa %ymm2, %fs:RTLD_SAVESPACE_SSE+2*YMM_SIZE @@ -215,6 +273,18 @@ - vmovdqa %ymm6, %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE - vmovdqa %ymm7, %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE - ret + vmovdqa %ymm6, %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE + vmovdqa %ymm7, %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE + ret +# ifdef HAVE_AVX512_ASM_SUPPORT +L(avx512_5): + vmovdqu64 %zmm0, %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE @@ -491,26 +491,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 +# endif L(no_avx5): # endif - movdqa %xmm0, %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE + movdqa %xmm0, %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE @@ -235,9 +305,13 @@ - .align 16 - cfi_startproc + .align 16 + cfi_startproc _dl_x86_64_restore_sse: -# ifdef HAVE_AVX_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT - cmpl $0, L(have_avx)(%rip) - js L(no_avx6) + cmpl $0, L(have_avx)(%rip) + js L(no_avx6) +# ifdef HAVE_AVX512_ASM_SUPPORT + cmpl $0xe6, L(have_avx)(%rip) + je L(avx512_6) +# endif - - vmovdqa %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE, %ymm0 - vmovdqa %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE, %ymm1 + + vmovdqa %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE, %ymm0 + vmovdqa %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE, %ymm1 @@ -248,6 +322,18 @@ - vmovdqa %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE, %ymm6 - vmovdqa %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE, %ymm7 - ret + vmovdqa %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE, %ymm6 + vmovdqa %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE, %ymm7 + ret +# ifdef HAVE_AVX512_ASM_SUPPORT +L(avx512_6): + vmovdqu64 %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE, %zmm0 @@ -525,7 +525,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686 +# endif L(no_avx6): # endif - movdqa %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE, %xmm0 + movdqa %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE, %xmm0 diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym --- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:16:36.335167048 -0400 @@ -535,14 +535,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a68 XMM_SIZE sizeof (La_x86_64_xmm) +YMM_SIZE sizeof (La_x86_64_ymm) +ZMM_SIZE sizeof (La_x86_64_zmm) - + LR_SIZE sizeof (struct La_x86_64_regs) LR_RDX_OFFSET offsetof (struct La_x86_64_regs, lr_rdx) diff -urN glibc-2.17-c758a686/sysdeps/x86_64/Makefile glibc-2.17-c758a686/sysdeps/x86_64/Makefile --- glibc-2.17-c758a686/sysdeps/x86_64/Makefile 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/Makefile 2014-09-10 23:22:04.269518711 -0400 @@ -37,6 +37,20 @@ - + $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o + @@ -560,7 +560,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/Makefile glibc-2.17-c758a686/sysdep +CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS) +endif endif - + ifeq ($(subdir),csu) diff -urN glibc-2.17-c758a686/sysdeps/x86_64/tst-audit10.c glibc-2.17-c758a686/sysdeps/x86_64/tst-audit10.c --- glibc-2.17-c758a686/sysdeps/x86_64/tst-audit10.c 1969-12-31 19:00:00.000000000 -0500 @@ -933,14 +933,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/Makefile glibc-2.17-c758a686/sysdeps/x +++ glibc-2.17-c758a686/sysdeps/x86/Makefile 2014-09-11 16:06:03.121319867 -0400 @@ -2,8 +2,8 @@ CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ - -mno-sse -mno-mmx) - + -mno-sse -mno-mmx) + -tests: $(objpfx)tst-xmmymm.out -$(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so +tests: $(objpfx)tst-xmmymmzmm.out +$(objpfx)tst-xmmymmzmm.out: ../sysdeps/x86/tst-xmmymmzmm.sh $(objpfx)ld.so - @echo "Checking ld.so for SSE register use. This will take a few seconds..." - $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@ + @echo "Checking ld.so for SSE register use. This will take a few seconds..." + $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@ endif diff -urN glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh --- glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh 2012-12-24 22:02:13.000000000 -0500 diff --git a/SOURCES/glibc-rh1140474.patch b/SOURCES/glibc-rh1140474.patch index 2382b84d..c3ce5cd2 100644 --- a/SOURCES/glibc-rh1140474.patch +++ b/SOURCES/glibc-rh1140474.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Wed Sep 3 19:45:43 2014 +0200 CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325] - + These changes are based on the fix for BZ #14134 in commit 6e230d11837f3ae7b375ea69d7905f0d18eb79e5. @@ -13,124 +13,124 @@ index 0a410a1..b6327d6 100644 +++ glibc-2.17-c758a686/iconvdata/Makefile @@ -297,6 +297,7 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) \ - $(common-objdir)/iconv/iconv_prog TESTS + $(addprefix $(objpfx),$(modules.so)) \ + $(common-objdir)/iconv/iconv_prog TESTS + iconv_modules="$(modules)" \ - $(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@ - + $(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@ + $(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \ diff --git glibc-2.17-c758a686/iconvdata/ibm1364.c glibc-2.17-c758a686/iconvdata/ibm1364.c index 0b5484f..cf80993 100644 --- glibc-2.17-c758a686/iconvdata/ibm1364.c +++ glibc-2.17-c758a686/iconvdata/ibm1364.c @@ -221,7 +221,8 @@ enum - ++rp2; \ - \ - uint32_t res; \ + ++rp2; \ + \ + uint32_t res; \ - if (__builtin_expect (ch < rp2->start, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \ + || __builtin_expect (ch < rp2->start, 0) \ - || (res = DB_TO_UCS4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ - { \ + || (res = DB_TO_UCS4[ch + rp2->idx], \ + __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ + { \ diff --git glibc-2.17-c758a686/iconvdata/ibm932.c glibc-2.17-c758a686/iconvdata/ibm932.c index f5dca59..aa69d65 100644 --- glibc-2.17-c758a686/iconvdata/ibm932.c +++ glibc-2.17-c758a686/iconvdata/ibm932.c @@ -74,11 +74,12 @@ - } \ - \ - ch = (ch * 0x100) + inptr[1]; \ + } \ + \ + ch = (ch * 0x100) + inptr[1]; \ + /* ch was less than 0xfd. */ \ + assert (ch < 0xfd00); \ - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ + if (__builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm932db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, '\1') == 0 && ch !=0)) \ - { \ + || (res = __ibm932db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, '\1') == 0 && ch !=0)) \ + { \ diff --git glibc-2.17-c758a686/iconvdata/ibm933.c glibc-2.17-c758a686/iconvdata/ibm933.c index f46dfb5..461fb5e 100644 --- glibc-2.17-c758a686/iconvdata/ibm933.c +++ glibc-2.17-c758a686/iconvdata/ibm933.c @@ -162,7 +162,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm933db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ + || __builtin_expect (ch < rp2->start, 0) \ + || (res = __ibm933db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ diff --git glibc-2.17-c758a686/iconvdata/ibm935.c glibc-2.17-c758a686/iconvdata/ibm935.c index a8e4e6c..132d816 100644 --- glibc-2.17-c758a686/iconvdata/ibm935.c +++ glibc-2.17-c758a686/iconvdata/ibm935.c @@ -162,7 +162,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm935db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ + || __builtin_expect (ch < rp2->start, 0) \ + || (res = __ibm935db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ diff --git glibc-2.17-c758a686/iconvdata/ibm937.c glibc-2.17-c758a686/iconvdata/ibm937.c index 239be61..69b154d 100644 --- glibc-2.17-c758a686/iconvdata/ibm937.c +++ glibc-2.17-c758a686/iconvdata/ibm937.c @@ -162,7 +162,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm937db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ + || __builtin_expect (ch < rp2->start, 0) \ + || (res = __ibm937db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ diff --git glibc-2.17-c758a686/iconvdata/ibm939.c glibc-2.17-c758a686/iconvdata/ibm939.c index 5d0db36..9936e2c 100644 --- glibc-2.17-c758a686/iconvdata/ibm939.c +++ glibc-2.17-c758a686/iconvdata/ibm939.c @@ -162,7 +162,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm939db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ + || __builtin_expect (ch < rp2->start, 0) \ + || (res = __ibm939db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ diff --git glibc-2.17-c758a686/iconvdata/ibm943.c glibc-2.17-c758a686/iconvdata/ibm943.c index be0c14f..c5d5742 100644 --- glibc-2.17-c758a686/iconvdata/ibm943.c +++ glibc-2.17-c758a686/iconvdata/ibm943.c @@ -75,11 +75,12 @@ - } \ - \ - ch = (ch * 0x100) + inptr[1]; \ + } \ + \ + ch = (ch * 0x100) + inptr[1]; \ + /* ch was less than 0xfd. */ \ + assert (ch < 0xfd00); \ - while (ch > rp2->end) \ - ++rp2; \ - \ + while (ch > rp2->end) \ + ++rp2; \ + \ - if (__builtin_expect (rp2 == NULL, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ + if (__builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm943db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, '\1') == 0 && ch !=0)) \ - { \ + || (res = __ibm943db_to_ucs4[ch + rp2->idx], \ + __builtin_expect (res, '\1') == 0 && ch !=0)) \ + { \ diff --git glibc-2.17-c758a686/iconvdata/run-iconv-test.sh glibc-2.17-c758a686/iconvdata/run-iconv-test.sh index c98c929..5dfb69f 100755 --- glibc-2.17-c758a686/iconvdata/run-iconv-test.sh +++ glibc-2.17-c758a686/iconvdata/run-iconv-test.sh @@ -184,6 +184,24 @@ while read utf8 from filename; do - + done < TESTS2 - + +# Check for crashes in decoders. +printf '\016\377\377\377\377\377\377\377' > $temp1 +for from in $iconv_modules ; do diff --git a/SOURCES/glibc-rh1144133.patch b/SOURCES/glibc-rh1144133.patch index 360cbae0..abefdf73 100644 --- a/SOURCES/glibc-rh1144133.patch +++ b/SOURCES/glibc-rh1144133.patch @@ -3,14 +3,14 @@ Author: Carlos O'Donell Date: Mon Sep 29 13:14:21 2014 -0400 Correctly size profiling reloc table (bug 17411) - + During auditing or profiling modes the dynamic loader builds a cache of the relocated PLT entries in order to reuse them when called again through the same PLT entry. This way the PLT entry is never completed and the call into the resolver always results in profiling or auditing code running. - + The problem is that the PLT relocation cache size is not computed correctly. The size of the cache should be "Size of a relocation result structure" @@ -23,25 +23,25 @@ Date: Mon Sep 29 13:14:21 2014 -0400 We do have a DT_RELACOUNT entry, which is a count for dynamic relative relocs, but we have no DT_PLTRELCOUNT and thus we need to compute it. - + This patch corrects the computation of the size of the relocation table used by the glibc profiling code. - + For more details see: https://sourceware.org/ml/libc-alpha/2014-09/msg00513.html - - [BZ #17411] - * elf/dl-reloc.c (_dl_relocate_object): Allocate correct amount for - l_reloc_result. + + [BZ #17411] + * elf/dl-reloc.c (_dl_relocate_object): Allocate correct amount for + l_reloc_result. diff --git glibc-2.17-c758a686/elf/dl-reloc.c glibc-2.17-c758a686/elf/dl-reloc.c index d2c6dac..97a7119 100644 --- glibc-2.17-c758a686/elf/dl-reloc.c +++ glibc-2.17-c758a686/elf/dl-reloc.c @@ -279,8 +279,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], - l->l_name); - } - + l->l_name); + } + - l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), - l->l_info[DT_PLTRELSZ]->d_un.d_val); + size_t sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA @@ -50,6 +50,6 @@ index d2c6dac..97a7119 100644 + size_t relcount = l->l_info[DT_PLTRELSZ]->d_un.d_val / sizeofrel; + l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), relcount); + - if (l->l_reloc_result == NULL) - { - errstring = N_("\ + if (l->l_reloc_result == NULL) + { + errstring = N_("\ diff --git a/SOURCES/glibc-rh1150282.patch b/SOURCES/glibc-rh1150282.patch index 1db72327..59de1df9 100644 --- a/SOURCES/glibc-rh1150282.patch +++ b/SOURCES/glibc-rh1150282.patch @@ -17,19 +17,19 @@ Further discussion is on this internal bug: --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c 2012-12-24 20:02:13.000000000 -0700 +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c 2015-04-20 09:04:11.826569951 -0600 @@ -212,6 +212,8 @@ - + /* Support sysdeps/x86_64/multiarch/strstr-c.c. */ IFUNC_IMPL (i, name, strstr, + IFUNC_IMPL_ADD (array, i, strstr, use_unaligned_strstr (), + __strstr_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42) - IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2)) - + IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42) + IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2)) + --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/init-arch.h 2012-12-24 20:02:13.000000000 -0700 +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/init-arch.h 2015-04-20 12:15:17.984742925 -0600 @@ -63,6 +63,34 @@ #else /* __ASSEMBLER__ */ - + # include +# include +# include @@ -59,15 +59,15 @@ Further discussion is on this internal bug: + ENABLE_STRSTR_UNALIGNED_PATHNAME, + &unaligned_strstr_etc_sysconfig_file) == 0; +} - + enum { --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile 2012-12-24 20:02:13.000000000 -0700 +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile 2015-04-20 09:04:11.854569626 -0600 @@ -17,7 +17,7 @@ - strcat-sse2-unaligned strncat-sse2-unaligned \ - strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ - strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ + strcat-sse2-unaligned strncat-sse2-unaligned \ + strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ + strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ - memcmp-ssse3 + memcmp-ssse3 strstr-sse2-unaligned ifeq (yes,$(config-cflags-sse4)) @@ -76,7 +76,7 @@ Further discussion is on this internal bug: --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c 2012-12-24 20:02:13.000000000 -0700 +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c 2015-04-20 09:04:11.861569545 -0600 @@ -12,7 +12,8 @@ - + #if 1 libc_ifunc (__strcasestr, - HAS_SSE4_2 ? __strcasestr_sse42 : __strcasestr_sse2); @@ -84,16 +84,16 @@ Further discussion is on this internal bug: + __strcasestr_sse2); #else libc_ifunc (__strcasestr, - 0 ? __strcasestr_sse42 : __strcasestr_sse2); + 0 ? __strcasestr_sse42 : __strcasestr_sse2); --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c 2012-12-24 20:02:13.000000000 -0700 +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c 2015-04-20 09:04:11.866569487 -0600 @@ -34,6 +34,7 @@ #include "string/strstr.c" - + extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden; +extern __typeof (__redirect_strstr) __strstr_sse2_unaligned attribute_hidden; extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden; - + #include "init-arch.h" @@ -41,7 +42,9 @@ /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle @@ -103,7 +103,7 @@ Further discussion is on this internal bug: +libc_ifunc (__libc_strstr, HAS_SSE4_2 ? (use_unaligned_strstr () ? + __strstr_sse2_unaligned : + __strstr_sse42) : __strstr_sse2) - + #undef strstr strong_alias (__libc_strstr, strstr) --- glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S 1969-12-31 17:00:00.000000000 -0700 @@ -488,21 +488,21 @@ Further discussion is on this internal bug: @@ -1,8 +1,6 @@ /* Multiple versions of strstr All versions must be listed in ifunc-impl-list.c. */ - + -#include "init-arch.h" - #define STRSTR __strstr_ia32 #if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN #undef libc_hidden_builtin_def @@ -17,13 +15,17 @@ - + #include "string/strstr.c" - + +#include "init-arch.h" + extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden; extern __typeof (__redirect_strstr) __strstr_ia32 attribute_hidden; - + /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ extern __typeof (__redirect_strstr) __libc_strstr; @@ -510,6 +510,6 @@ Further discussion is on this internal bug: +libc_ifunc (__libc_strstr, + HAS_SSE4_2 && !use_unaligned_strstr () ? + __strstr_sse42 : __strstr_ia32) - + #undef strstr strong_alias (__libc_strstr, strstr) diff --git a/SOURCES/glibc-rh1156331.patch b/SOURCES/glibc-rh1156331.patch index bc669bb2..39ea4692 100644 --- a/SOURCES/glibc-rh1156331.patch +++ b/SOURCES/glibc-rh1156331.patch @@ -3,23 +3,23 @@ Author: Siddhesh Poyarekar Date: Thu Dec 4 08:08:37 2014 +0530 ftell: seek to end only when there are unflushed bytes (BZ #17647) - + Currently we seek to end of file if there are unflushed writes or the stream is in write mode, to get the current offset for writing in append mode, which is the end of file. The latter case (i.e. stream is in write mode, but no unflushed writes) is unnecessary since it will only happen when the stream has just been flushed, in which case the recorded offset ought to be reliable. - + Removing that case lets ftell give the correct offset when it follows an ftruncate. The latter truncates the file, but does not change the file position, due to which it is permissible to call ftell without an intervening fseek call. - + Tested on x86_64 to verify that the added test case fails without the patch and succeeds with it, and that there are no additional regressions due to it. - + [BZ #17647] * libio/fileops.c (do_ftell): Seek only when there are unflushed writes. @@ -39,26 +39,26 @@ index e0d7b76..1fc5719 100644 - bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base - || _IO_in_put_mode (fp)); + bool unflushed_writes = (fp->_IO_write_ptr > fp->_IO_write_base); - + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; - + /* When we have unflushed writes in append mode, seek to the end of the - file and record that offset. This is the only time we change the file - stream state and it is safe since the file handle is active. */ + file and record that offset. This is the only time we change the file + stream state and it is safe since the file handle is active. */ - if (was_writing && append_mode) + if (unflushed_writes && append_mode) - { - result = _IO_SYSSEEK (fp, 0, _IO_seek_end); - if (result == _IO_pos_BAD) + { + result = _IO_SYSSEEK (fp, 0, _IO_seek_end); + if (result == _IO_pos_BAD) @@ -961,7 +960,7 @@ do_ftell (_IO_FILE *fp) - } - + } + /* Adjust for unflushed data. */ - if (!was_writing) + if (!unflushed_writes) - offset -= fp->_IO_read_end - fp->_IO_read_ptr; + offset -= fp->_IO_read_end - fp->_IO_read_ptr; /* We don't trust _IO_read_end to represent the current file offset when - writing in append mode because the value would have to be shifted to + writing in append mode because the value would have to be shifted to diff --git glibc-2.17-c758a686/libio/tst-ftell-active-handler.c glibc-2.17-c758a686/libio/tst-ftell-active-handler.c index e9dc7b3..9f23c55 100644 --- glibc-2.17-c758a686/libio/tst-ftell-active-handler.c @@ -66,7 +66,7 @@ index e9dc7b3..9f23c55 100644 @@ -88,6 +88,95 @@ static size_t file_len; typedef int (*fputs_func_t) (const void *data, FILE *fp); fputs_func_t fputs_func; - + +/* This test verifies that the offset reported by ftell is correct after the + file is truncated using ftruncate. ftruncate does not change the file + offset on truncation and hence, SEEK_CUR should continue to point to the @@ -164,7 +164,7 @@ index e9dc7b3..9f23c55 100644 ret |= do_append_test (filename); ret |= do_rewind_test (filename); + ret |= do_ftruncate_test (filename); - + return ret; } diff --git glibc-2.17-c758a686/libio/wfileops.c glibc-2.17-c758a686/libio/wfileops.c @@ -180,23 +180,23 @@ index 6a088b1..71281c1 100644 - || _IO_in_put_mode (fp)); + bool unflushed_writes = (fp->_wide_data->_IO_write_ptr + > fp->_wide_data->_IO_write_base); - + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; - + /* When we have unflushed writes in append mode, seek to the end of the - file and record that offset. This is the only time we change the file - stream state and it is safe since the file handle is active. */ + file and record that offset. This is the only time we change the file + stream state and it is safe since the file handle is active. */ - if (was_writing && append_mode) + if (unflushed_writes && append_mode) - { - result = _IO_SYSSEEK (fp, 0, _IO_seek_end); - if (result == _IO_pos_BAD) + { + result = _IO_SYSSEEK (fp, 0, _IO_seek_end); + if (result == _IO_pos_BAD) @@ -674,7 +673,7 @@ do_ftell_wide (_IO_FILE *fp) struct _IO_codecvt *cv = fp->_codecvt; int clen = (*cv->__codecvt_do_encoding) (cv); - + - if (!was_writing) + if (!unflushed_writes) - { - if (clen > 0) - { + { + if (clen > 0) + { diff --git a/SOURCES/glibc-rh1159169.patch b/SOURCES/glibc-rh1159169.patch index b03006c3..7c1453d4 100644 --- a/SOURCES/glibc-rh1159169.patch +++ b/SOURCES/glibc-rh1159169.patch @@ -3,16 +3,16 @@ Author: Brad Hubbard Date: Wed Mar 18 14:51:26 2015 +0530 Use calloc to allocate xports (BZ #17542) - + If xports is NULL in xprt_register we malloc it but if sock > _rpc_dtablesize() that memory does not get initialised and may in theory contain any value. Later we make a conditional jump in svc_getreq_common based on the uninitialised memory and this caused a general protection fault in rpc.statd on an older version of glibc but this code has not changed since that version. - + Following is the valgrind warning. - + ==26802== Conditional jump or move depends on uninitialised value(s) ==26802== at 0x5343A25: svc_getreq_common (in /lib64/libc-2.5.so) ==26802== by 0x534357B: svc_getreqset (in /lib64/libc-2.5.so) @@ -30,12 +30,13 @@ index 8c4e8a5..c6ccf10 100644 --- glibc-2.17-c758a686/sunrpc/svc.c +++ glibc-2.17-c758a686/sunrpc/svc.c @@ -97,8 +97,8 @@ xprt_register (SVCXPRT *xprt) - + if (xports == NULL) { - xports = (SVCXPRT **) malloc (_rpc_dtablesize () * sizeof (SVCXPRT *)); - if (xports == NULL) /* Dont add handle */ + xports = (SVCXPRT **) calloc (_rpc_dtablesize (), sizeof (SVCXPRT *)); + if (xports == NULL) /* Don't add handle */ - return; + return; } + diff --git a/SOURCES/glibc-rh1161666.patch b/SOURCES/glibc-rh1161666.patch index 96a75411..5285181d 100644 --- a/SOURCES/glibc-rh1161666.patch +++ b/SOURCES/glibc-rh1161666.patch @@ -3,14 +3,14 @@ Author: Siddhesh Poyarekar Date: Wed Nov 12 19:30:24 2014 +0530 Fix stack alignment when loader is invoked directly - + The s390 ABI requires the stack pointer to be aligned at 8-bytes. When a program is invoked as an argument to the dynamic linker, _dl_start_user adjusts the stack to remove the dynamic linker arguments so that the program sees only its name and arguments. This may result in the stack being misaligned since each argument shift is only a word and not a double-word. - + This is now fixed shifting argv and envp down instead of shifting argc up and reclaiming the stack. This requires _dl_argv to be adjusted and hence, is no longer relro. @@ -20,24 +20,24 @@ index c56185c..79f8ef9 100644 --- glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-machine.h +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-machine.h @@ -166,18 +166,49 @@ _dl_start_user:\n\ - # See if we were run as a command with the executable file\n\ - # name as an extra leading argument.\n\ - l %r1,_dl_skip_args@GOT12(0,%r12)\n\ + # See if we were run as a command with the executable file\n\ + # name as an extra leading argument.\n\ + l %r1,_dl_skip_args@GOT12(0,%r12)\n\ - l %r1,0(%r1) # load _dl_skip_args\n\ + l %r1,0(%r1) # load _dl_skip_args\n\ + ltr %r1,%r1\n\ + je .L4 # Skip the arg adjustment if there were none.\n\ - # Get the original argument count.\n\ - l %r0,96(%r15)\n\ - # Subtract _dl_skip_args from it.\n\ - sr %r0,%r1\n\ + # Get the original argument count.\n\ + l %r0,96(%r15)\n\ + # Subtract _dl_skip_args from it.\n\ + sr %r0,%r1\n\ - # Adjust the stack pointer to skip _dl_skip_args words.\n\ - sll %r1,2\n\ - ar %r15,%r1\n\ - # Set the back chain to zero again\n\ - xc 0(4,%r15),0(%r15)\n\ - # Store back the modified argument count.\n\ - st %r0,96(%r15)\n\ + # Store back the modified argument count.\n\ + st %r0,96(%r15)\n\ + # Copy argv and envp forward to account for skipped argv entries.\n\ + # We skipped at least one argument or we would not get here.\n\ + la %r6,100(%r15) # Destination pointer i.e. &argv[0]\n\ @@ -72,27 +72,27 @@ index c56185c..79f8ef9 100644 + la %r6,100(%r15)\n\ + l %r1,_dl_argv@GOT12(0,%r12)\n\ + st %r6,0(%r1)\n\ - # The special initializer gets called with the stack just\n\ - # as the application's entry point will see it; it can\n\ - # switch stacks if it moves these contents over.\n\ + # The special initializer gets called with the stack just\n\ + # as the application's entry point will see it; it can\n\ + # switch stacks if it moves these contents over.\n\ @@ -185,7 +216,7 @@ _dl_start_user:\n\ - # Call the function to run the initializers.\n\ - # Load the parameters:\n\ - # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ + # Call the function to run the initializers.\n\ + # Load the parameters:\n\ + # (%r2, %r3, %r4, %r5) = (_dl_loaded, argc, argv, envp)\n\ - l %r2,_rtld_local@GOT(%r12)\n\ +.L4: l %r2,_rtld_local@GOT(%r12)\n\ - l %r2,0(%r2)\n\ - l %r3,96(%r15)\n\ - la %r4,100(%r15)\n\ + l %r2,0(%r2)\n\ + l %r3,96(%r15)\n\ + la %r4,100(%r15)\n\ @@ -198,6 +229,9 @@ _dl_start_user:\n\ - l %r14,_dl_fini@GOT(%r12)\n\ - # Free stack frame\n\ - ahi %r15,96\n\ + l %r14,_dl_fini@GOT(%r12)\n\ + # Free stack frame\n\ + ahi %r15,96\n\ + # Reload argc and argv for the user's entry point.\n\ + # l %r2,0(%r15)\n\ + # la %r3,4(%r15)\n\ - # Jump to the user's entry point (saved in %r8).\n\ - br %r8\n\ + # Jump to the user's entry point (saved in %r8).\n\ + br %r8\n\ .Llit:\n\ diff --git glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-sysdep.h glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-sysdep.h new file mode 100644 diff --git a/SOURCES/glibc-rh1162847-p1.patch b/SOURCES/glibc-rh1162847-p1.patch index 2b417a99..eab2afef 100644 --- a/SOURCES/glibc-rh1162847-p1.patch +++ b/SOURCES/glibc-rh1162847-p1.patch @@ -2,19 +2,19 @@ # commit f8e3e9f31bfd71641418897228fa1732170b69cc # Author: Alan Modra # Date: Thu Oct 3 13:51:52 2013 +0930 -# +# # Correct little-endian relocation of UADDR64,32,16. -# +# # * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): # Correct handling of unaligned relocs for little-endian. # * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. -# +# diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c 2014-11-11 18:51:36.140570654 -0500 @@ -423,6 +423,12 @@ - Elf32_Addr const finaladdr, - int rinfo) + Elf32_Addr const finaladdr, + int rinfo) { + union unaligned + { @@ -27,7 +27,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c glibc-2.17- case R_PPC_NONE: @@ -439,10 +445,7 @@ return; - + case R_PPC_UADDR32: - ((char *) reloc_addr)[0] = finaladdr >> 24; - ((char *) reloc_addr)[1] = finaladdr >> 16; @@ -35,17 +35,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c glibc-2.17- - ((char *) reloc_addr)[3] = finaladdr; + ((union unaligned *) reloc_addr)->u4 = finaladdr; break; - + case R_PPC_ADDR24: @@ -460,8 +463,7 @@ case R_PPC_UADDR16: if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0)) - _dl_reloc_overflow (map, "R_PPC_UADDR16", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC_UADDR16", reloc_addr, refsym); - ((char *) reloc_addr)[0] = finaladdr >> 8; - ((char *) reloc_addr)[1] = finaladdr; + ((union unaligned *) reloc_addr)->u2 = finaladdr; break; - + case R_PPC_ADDR16_LO: diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2012-12-24 22:02:13.000000000 -0500 @@ -60,12 +60,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- + unsigned u4 __attribute__ ((mode (SI))); + unsigned u8 __attribute__ ((mode (DI))); + } __attribute__((__packed__)); - + if (r_type == R_PPC64_RELATIVE) { @@ -742,23 +748,11 @@ return; - + case R_PPC64_UADDR64: - /* We are big-endian. */ - ((char *) reloc_addr_arg)[0] = (value >> 56) & 0xff; @@ -78,7 +78,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- - ((char *) reloc_addr_arg)[7] = (value >> 0) & 0xff; + ((union unaligned *) reloc_addr)->u8 = value; return; - + case R_PPC64_UADDR32: - /* We are big-endian. */ - ((char *) reloc_addr_arg)[0] = (value >> 24) & 0xff; @@ -87,18 +87,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17- - ((char *) reloc_addr_arg)[3] = (value >> 0) & 0xff; + ((union unaligned *) reloc_addr)->u4 = value; return; - + case R_PPC64_ADDR32: @@ -782,10 +776,8 @@ case R_PPC64_UADDR16: if (dont_expect ((value + 0x8000) >= 0x10000)) - _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym); - /* We are big-endian. */ - ((char *) reloc_addr_arg)[0] = (value >> 8) & 0xff; - ((char *) reloc_addr_arg)[1] = (value >> 0) & 0xff; - break; + ((union unaligned *) reloc_addr)->u2 = value; + return; - + case R_PPC64_ADDR16_DS: if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) diff --git a/SOURCES/glibc-rh1162847-p2.patch b/SOURCES/glibc-rh1162847-p2.patch index 895aca5a..9c67ab62 100644 --- a/SOURCES/glibc-rh1162847-p2.patch +++ b/SOURCES/glibc-rh1162847-p2.patch @@ -2,13 +2,13 @@ # commit 4cb81307b3771672864fa3a7498bd39c13267a00 # Author: Alan Modra # Date: Fri Oct 4 12:48:51 2013 +0930 -# +# # Use stdint.h types in union unaligned. -# +# # * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): # Use stdint types in rather than __attribute__((mode())). # * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. -# +# diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c index f81899a..aba3618 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/dl-machine.c @@ -22,7 +22,7 @@ index f81899a..aba3618 100644 + uint16_t u2; + uint32_t u4; } __attribute__((__packed__)); - + switch (rinfo) diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h index b69a1ce..18cf157 100644 @@ -40,6 +40,6 @@ index b69a1ce..18cf157 100644 + uint32_t u4; + uint64_t u8; + } __attribute__ ((__packed__)); - + if (r_type == R_PPC64_RELATIVE) { diff --git a/SOURCES/glibc-rh1162895-1.patch b/SOURCES/glibc-rh1162895-1.patch index baf93e92..12594d7c 100644 --- a/SOURCES/glibc-rh1162895-1.patch +++ b/SOURCES/glibc-rh1162895-1.patch @@ -3,10 +3,10 @@ Author: Alan Modra Date: Mon Jul 14 21:14:50 2014 +0930 Correct DT_PPC64_NUM - - [BZ #17153] - * elf/elf.h (DT_PPC64_NUM): Correct value. - * NEWS: Add to fixed bug list. + + [BZ #17153] + * elf/elf.h (DT_PPC64_NUM): Correct value. + * NEWS: Add to fixed bug list. diff --git glibc-2.17-c758a686/elf/elf.h glibc-2.17-c758a686/elf/elf.h index 40e87b2..78815e8 100644 @@ -18,6 +18,6 @@ index 40e87b2..78815e8 100644 #define DT_PPC64_OPT (DT_LOPROC + 3) -#define DT_PPC64_NUM 3 +#define DT_PPC64_NUM 4 - + /* PowerPC64 specific values for the DT_PPC64_OPT Dyn entry. */ #define PPC64_OPT_TLS 1 diff --git a/SOURCES/glibc-rh1162895-2.patch b/SOURCES/glibc-rh1162895-2.patch index e80750f6..0844319d 100644 --- a/SOURCES/glibc-rh1162895-2.patch +++ b/SOURCES/glibc-rh1162895-2.patch @@ -3,15 +3,15 @@ Author: Alan Modra Date: Wed Apr 16 19:33:32 2014 +0930 Correct IBM long double frexpl. - + Besides fixing the bugzilla, this also fixes corner-cases where the high and low double differ greatly in magnitude, and handles a denormal input without resorting to a fp rescale. - - [BZ #16740] - [BZ #16619] - * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite. - * math/libm-test.inc (frexp_test_data): Add tests. + + [BZ #16740] + [BZ #16619] + * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite. + * math/libm-test.inc (frexp_test_data): Add tests. diff --git glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-test.inc index 5e6789f..a4bf0b8 100644 @@ -20,7 +20,7 @@ index 5e6789f..a4bf0b8 100644 @@ -5691,6 +5691,15 @@ frexp_test (void) TEST_fI_f1 (frexp, 12.8L, 0.8L, 4); TEST_fI_f1 (frexp, -27.34L, -0.854375L, 5); - + +#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106 + TEST_fI_f1 (frexp, 1.0L-0x1p-106L, 1.0L-0x1p-106L, 0), + TEST_fI_f1 (frexp, 1.0L, 0.5L, 1), @@ -32,13 +32,13 @@ index 5e6789f..a4bf0b8 100644 + END (frexp); } - + --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c 2015-06-16 15:37:44.293960271 -0400 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c 2015-06-16 13:53:25.578700428 -0400 @@ -31,57 +31,115 @@ #include #include - + -static const long double -two107 = 162259276829213363391578010288128.0; /* 0x4670000000000000, 0 */ - @@ -159,11 +159,11 @@ index 5e6789f..a4bf0b8 100644 + } + } + explo = 0; - } + } - *eptr += (ix>>52)-1022; + lx |= (explo << 52) | ixl; + } - + - if (ixl != 0ULL) { - explo = (ixl>>52) - (ix>>52) + 0x3fe; - if ((ixl&0x7ff0000000000000ULL) == 0LL) { diff --git a/SOURCES/glibc-rh1162895-3.patch b/SOURCES/glibc-rh1162895-3.patch index c6e24f1c..e9bfbfa4 100644 --- a/SOURCES/glibc-rh1162895-3.patch +++ b/SOURCES/glibc-rh1162895-3.patch @@ -3,16 +3,16 @@ Author: Alan Modra Date: Wed Apr 2 13:46:19 2014 +1030 Correct IBM long double nextafterl. - + Fix for values near a power of two, and some tidies. - - [BZ #16739] - * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct - output when value is near a power of two. Use int64_t for lx and - remove casts. Use decimal rather than hex exponent constants. - Don't use long double multiplication when double will suffice. - * math/libm-test.inc (nextafter_test_data): Add tests. - * NEWS: Add 16739 and 16786 to bug list. + + [BZ #16739] + * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct + output when value is near a power of two. Use int64_t for lx and + remove casts. Use decimal rather than hex exponent constants. + Don't use long double multiplication when double will suffice. + * math/libm-test.inc (nextafter_test_data): Add tests. + * NEWS: Add 16739 and 16786 to bug list. diff --git glibc-2.17-c758a686/math/libm-test.inc glibc-2.17-c758a686/math/libm-test.inc index 19194f6..967b679 100644 @@ -30,7 +30,7 @@ index 19194f6..967b679 100644 + TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L+0x1p-106L, NO_EXCEPTION), + TEST_ff_f (nextafter, -1.0L+0x1p-106L, -10.0L, -1.0L, NO_EXCEPTION), +#endif - + TEST_ff_f (pow, -1.0, -0xffffff, -1.0); TEST_ff_f (pow, -1.0, -0x1fffffe, 1.0); diff --git glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c @@ -38,28 +38,28 @@ index 30b1540..bf57cb8 100644 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c @@ -30,8 +30,7 @@ static char rcsid[] = "$NetBSD: $"; - + long double __nextafterl(long double x, long double y) { - int64_t hx,hy,ihx,ihy; - uint64_t lx; + int64_t hx, hy, ihx, ihy, lx; - double xhi, xlo, yhi; - - ldbl_unpack (x, &xhi, &xlo); + double xhi, xlo, yhi; + + ldbl_unpack (x, &xhi, &xlo); @@ -79,19 +78,28 @@ long double __nextafterl(long double x, long double y) - u = math_opt_barrier (x); - x -= __LDBL_DENORM_MIN__; - if (ihx < 0x0360000000000000LL + u = math_opt_barrier (x); + x -= __LDBL_DENORM_MIN__; + if (ihx < 0x0360000000000000LL - || (hx > 0 && (int64_t) lx <= 0) - || (hx < 0 && (int64_t) lx > 1)) { + || (hx > 0 && lx <= 0) + || (hx < 0 && lx > 1)) { - u = u * u; - math_force_eval (u); /* raise underflow flag */ - } - return x; - } + u = u * u; + math_force_eval (u); /* raise underflow flag */ + } + return x; + } - if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ - INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); - u = yhi; @@ -77,27 +77,27 @@ index 30b1540..bf57cb8 100644 + if (ihx < (106LL << 52)) { /* ulp will denormal */ + INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52)); + u = yhi * 0x1p-105; - } else { + } else { - INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52)); - u = yhi; - } - return x - u; + u = yhi; + } + return x - u; @@ -109,8 +117,8 @@ long double __nextafterl(long double x, long double y) - u = math_opt_barrier (x); - x += __LDBL_DENORM_MIN__; - if (ihx < 0x0360000000000000LL + u = math_opt_barrier (x); + x += __LDBL_DENORM_MIN__; + if (ihx < 0x0360000000000000LL - || (hx > 0 && (int64_t) lx < 0 && lx != 0x8000000000000001LL) - || (hx < 0 && (int64_t) lx >= 0)) { + || (hx > 0 && lx < 0 && lx != 0x8000000000000001LL) + || (hx < 0 && lx >= 0)) { - u = u * u; - math_force_eval (u); /* raise underflow flag */ - } + u = u * u; + math_force_eval (u); /* raise underflow flag */ + } @@ -118,12 +126,21 @@ long double __nextafterl(long double x, long double y) - x = -0.0L; - return x; - } + x = -0.0L; + return x; + } - if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ - INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); - u = yhi; @@ -115,9 +115,9 @@ index 30b1540..bf57cb8 100644 + if (ihx < (106LL << 52)) { /* ulp will denormal */ + INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52)); + u = yhi * 0x1p-105; - } else { + } else { - INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52)); - u = yhi; - } - return x + u; + u = yhi; + } + return x + u; diff --git a/SOURCES/glibc-rh1165192.patch b/SOURCES/glibc-rh1165192.patch index 60656944..2ae1a665 100644 --- a/SOURCES/glibc-rh1165192.patch +++ b/SOURCES/glibc-rh1165192.patch @@ -10,22 +10,22 @@ diff -up glibc-2.17-c758a686/nss/Makefile.rh1165192 glibc-2.17-c758a686/nss/Make @@ -38,7 +38,7 @@ install-bin := getent makedb makedb-modules = xmalloc hash-string extra-objs += $(makedb-modules:=.o) - + -tests = test-netdb tst-nss-test1 bug17079 +tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent xtests = bug-erange - + include ../Makeconfig diff -up glibc-2.17-c758a686/nss/nss_files/files-XXX.c.rh1165192 glibc-2.17-c758a686/nss/nss_files/files-XXX.c --- glibc-2.17-c758a686/nss/nss_files/files-XXX.c.rh1165192 2015-01-14 21:22:14.630721754 +0100 +++ glibc-2.17-c758a686/nss/nss_files/files-XXX.c 2015-01-14 21:22:15.072725814 +0100 @@ -135,7 +135,7 @@ CONCAT(_nss_files_set,ENTNAME) (int stay - + __libc_lock_lock (lock); - + - status = internal_setent (stayopen); + status = internal_setent (1); - + if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0) { diff -up glibc-2.17-c758a686/nss/tst-nss-getpwent.c.rh1165192 glibc-2.17-c758a686/nss/tst-nss-getpwent.c @@ -79,7 +79,7 @@ diff -up glibc-2.17-c758a686/nss/tst-nss-getpwent.c.rh1165192 glibc-2.17-c758a68 + } + first_uid = pw->pw_uid; + } -+ ++ + free (last_name); + last_name = strdup (pw->pw_name); + if (last_name == NULL) @@ -142,7 +142,7 @@ diff -up glibc-2.17-c758a686/nss/tst-nss-getpwent.c.rh1165192 glibc-2.17-c758a68 + printf ("Missing entry in the password database.\n"); + return 1; + } -+ ++ + return 0; +} + diff --git a/SOURCES/glibc-rh1165212.patch b/SOURCES/glibc-rh1165212.patch index 7835fbff..359a7d2a 100644 --- a/SOURCES/glibc-rh1165212.patch +++ b/SOURCES/glibc-rh1165212.patch @@ -36,37 +36,37 @@ Date: Wed Jan 21 01:51:10 2015 -0500 @@ -35,12 +35,12 @@ endif ifeq (yes,$(build-shared)) tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ - bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ + bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ - bug-atexit3 tstatexit + bug-atexit3 tstatexit tst-rec-dlopen endif modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \ - defaultmod2 errmsg1mod modatexit modcxaatexit \ - bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \ + defaultmod2 errmsg1mod modatexit modcxaatexit \ + bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \ - bug-atexit2-lib bug-atexit3-lib + bug-atexit2-lib bug-atexit3-lib moddummy1 moddummy2 - + failtestmod.so-no-z-defs = yes glreflib2.so-no-z-defs = yes @@ -122,6 +122,8 @@ LDLIBS-bug-atexit3-lib.so = -lstdc++ -lg $(objpfx)bug-atexit3: $(libdl) $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so - + +$(objpfx)tst-rec-dlopen: $(libdl) +$(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so - + # Depend on libc.so so a DT_NEEDED is generated in the shared objects. # This ensures they will load libc.so for needed symbols if loaded by --- glibc-2.17-c758a686/elf/dl-cache.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/elf/dl-cache.c 2015-06-22 12:44:39.000000000 -0400 @@ -174,9 +174,12 @@ _dl_cache_libcmp (const char *p1, const - - + + /* Look up NAME in ld.so.cache and return the file name stored there, - or null if none is found. */ - -const char * -+ or null if none is found. ++ or null if none is found. + The caller is responsible for freeing the returned string. The ld.so.cache + may be unmapped at any time by a completing recursive dlopen and + this function must take care that it does not return references to @@ -78,7 +78,7 @@ Date: Wed Jan 21 01:51:10 2015 -0500 @@ -289,7 +292,17 @@ _dl_load_cache_lookup (const char *name) && best != NULL) _dl_debug_printf (" trying file=%s\n", best); - + - return best; + if (best == NULL) + return NULL; @@ -92,31 +92,31 @@ Date: Wed Jan 21 01:51:10 2015 -0500 + strcpy (temp, best); + return strdup (temp); } - + #ifndef MAP_COPY --- glibc-2.17-c758a686/elf/dl-load.c 2015-06-22 12:41:10.748836414 -0400 +++ glibc-2.17-c758a686/elf/dl-load.c 2015-06-22 12:44:39.000000000 -0400 @@ -2232,7 +2232,7 @@ _dl_map_object (struct link_map *loader, - { - /* Check the list of libraries in the file /etc/ld.so.cache, - for compatibility with Linux's ldconfig program. */ + { + /* Check the list of libraries in the file /etc/ld.so.cache, + for compatibility with Linux's ldconfig program. */ - const char *cached = _dl_load_cache_lookup (name); + char *cached = _dl_load_cache_lookup (name); - - if (cached != NULL) - { + + if (cached != NULL) + { @@ -2262,6 +2262,7 @@ _dl_map_object (struct link_map *loader, - if (memcmp (cached, dirp, system_dirs_len[cnt]) == 0) - { - /* The prefix matches. Don't use the entry. */ + if (memcmp (cached, dirp, system_dirs_len[cnt]) == 0) + { + /* The prefix matches. Don't use the entry. */ + free (cached); - cached = NULL; - break; - } + cached = NULL; + break; + } @@ -2278,14 +2279,9 @@ _dl_map_object (struct link_map *loader, - &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded, - LA_SER_CONFIG, &found_other_class, false); - if (__builtin_expect (fd != -1, 1)) + &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded, + LA_SER_CONFIG, &found_other_class, false); + if (__builtin_expect (fd != -1, 1)) - { - realname = local_strdup (cached); - if (realname == NULL) @@ -128,36 +128,36 @@ Date: Wed Jan 21 01:51:10 2015 -0500 + realname = cached; + else + free (cached); - } - } - } + } + } + } --- glibc-2.17-c758a686/elf/dl-open.c 2015-06-22 12:41:16.348913620 -0400 +++ glibc-2.17-c758a686/elf/dl-open.c 2015-06-22 12:44:40.000000000 -0400 @@ -221,7 +221,11 @@ dl_open_worker (void *a) - } + } } - + - assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT); + /* One might be tempted to assert that we are RT_CONSISTENT at this point, but that + may not be true if this is a recursive call to dlopen. + TODO: Fix all of the debug state so we end up at RT_CONSISTENT only when the last + recursive dlopen completes. */ + _dl_debug_initialize (0, args->nsid); - + /* Load the named object. */ struct link_map *new; --- glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h 2015-06-22 12:41:16.328913344 -0400 +++ glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h 2015-06-22 12:44:41.000000000 -0400 @@ -895,8 +895,8 @@ internal_function; - + /* Look up NAME in ld.so.cache and return the file name stored there, - or null if none is found. */ -extern const char *_dl_load_cache_lookup (const char *name) + or null if none is found. Caller must free returned string. */ +extern char *_dl_load_cache_lookup (const char *name) internal_function; - + /* If the system does not support MAP_COPY we cannot leave the file open --- glibc-2.17-c758a686/dlfcn/tst-rec-dlopen.c 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.17-c758a686/dlfcn/tst-rec-dlopen.c 2015-06-22 12:44:41.000000000 -0400 diff --git a/SOURCES/glibc-rh1170118-CVE-2014-7817.patch b/SOURCES/glibc-rh1170118-CVE-2014-7817.patch index 574eaf7e..8515473b 100644 --- a/SOURCES/glibc-rh1170118-CVE-2014-7817.patch +++ b/SOURCES/glibc-rh1170118-CVE-2014-7817.patch @@ -2,9 +2,9 @@ # commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c # Author: Carlos O'Donell # Date: Wed Nov 19 11:44:12 2014 -0500 -# +# # CVE-2014-7817: wordexp fails to honour WRDE_NOCMD. -# +# # The function wordexp() fails to properly handle the WRDE_NOCMD # flag when processing arithmetic inputs in the form of "$((... ``))" # where "..." can be anything valid. The backticks in the arithmetic @@ -14,10 +14,10 @@ # the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD # in exec_comm(), the only place that can execute a shell. All other # checks for WRDE_NOCMD are superfluous and removed. -# +# # We expand the testsuite and add 3 new regression tests of roughly # the same form but with a couple of nested levels. -# +# # On top of the 3 new tests we add fork validation to the WRDE_NOCMD # testing. If any forks are detected during the execution of a wordexp() # call with WRDE_NOCMD, the test is marked as failed. This is slightly @@ -27,17 +27,17 @@ # require libpthread or libdl, instead we use the public implementation # namespace function __register_atfork (already part of the public ABI # for libpthread). -# +# # Tested on x86_64 with no regressions. -# +# diff --git glibc-2.17-c758a686/posix/wordexp-test.c glibc-2.17-c758a686/posix/wordexp-test.c index 4957006..bdd65e4 100644 --- glibc-2.17-c758a686/posix/wordexp-test.c +++ glibc-2.17-c758a686/posix/wordexp-test.c @@ -27,6 +27,25 @@ - + #define IFS " \n\t" - + +extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden"))); +extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *); + @@ -70,13 +70,13 @@ index 4957006..bdd65e4 100644 + { WRDE_CMDSUB, NULL, "$((`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS }, + { WRDE_CMDSUB, NULL, "$((1+`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS }, + { WRDE_CMDSUB, NULL, "$((1+$((`echo 1`))))", WRDE_NOCMD, 0, { NULL, }, IFS }, - + { -1, NULL, NULL, 0, 0, { NULL, }, IFS }, }; @@ -258,6 +283,15 @@ main (int argc, char *argv[]) - return -1; + return -1; } - + + /* If we are not allowed to do command substitution, we install + fork handlers to verify that no forks happened. No forks should + happen at all if command substitution is disabled. */ @@ -90,9 +90,9 @@ index 4957006..bdd65e4 100644 if (testit (&test_case[test])) ++fail; @@ -367,6 +401,9 @@ testit (struct test_case_struct *tc) - + printf ("Test %d (%s): ", ++tests, tc->words); - + + if (tc->flags & WRDE_NOCMD) + registered_forks = 0; + @@ -102,7 +102,7 @@ index 4957006..bdd65e4 100644 @@ -378,6 +415,13 @@ testit (struct test_case_struct *tc) } retval = wordexp (tc->words, &we, tc->flags); - + + if ((tc->flags & WRDE_NOCMD) + && (registered_forks > 0)) + { @@ -112,7 +112,7 @@ index 4957006..bdd65e4 100644 + if (tc->flags & WRDE_DOOFFS) start_offs = sav_we.we_offs; - + diff --git glibc-2.17-c758a686/posix/wordexp.c glibc-2.17-c758a686/posix/wordexp.c index b6b65dd..26f3a26 100644 --- glibc-2.17-c758a686/posix/wordexp.c @@ -120,7 +120,7 @@ index b6b65dd..26f3a26 100644 @@ -893,6 +893,10 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length, pid_t pid; int noexec = 0; - + + /* Do nothing if command substitution should not succeed. */ + if (flags & WRDE_NOCMD) + return WRDE_CMDSUB; @@ -129,28 +129,28 @@ index b6b65dd..26f3a26 100644 if (!comm || !*comm) return 0; @@ -2082,9 +2086,6 @@ parse_dollars (char **word, size_t *word_length, size_t *max_length, - } - } - + } + } + - if (flags & WRDE_NOCMD) - return WRDE_CMDSUB; - (*offset) += 2; return parse_comm (word, word_length, max_length, words, offset, flags, - quoted? NULL : pwordexp, ifs, ifs_white); + quoted? NULL : pwordexp, ifs, ifs_white); @@ -2196,9 +2197,6 @@ parse_dquote (char **word, size_t *word_length, size_t *max_length, - break; - - case '`': + break; + + case '`': - if (flags & WRDE_NOCMD) - return WRDE_CMDSUB; - - ++(*offset); - error = parse_backtick (word, word_length, max_length, words, - offset, flags, NULL, NULL, NULL); + ++(*offset); + error = parse_backtick (word, word_length, max_length, words, + offset, flags, NULL, NULL, NULL); @@ -2357,12 +2355,6 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags) - break; - + break; + case '`': - if (flags & WRDE_NOCMD) - { @@ -158,6 +158,6 @@ index b6b65dd..26f3a26 100644 - goto do_error; - } - - ++words_offset; - error = parse_backtick (&word, &word_length, &max_length, words, - &words_offset, flags, pwordexp, ifs, + ++words_offset; + error = parse_backtick (&word, &word_length, &max_length, words, + &words_offset, flags, pwordexp, ifs, diff --git a/SOURCES/glibc-rh1173537.patch b/SOURCES/glibc-rh1173537.patch index 963252a6..bedde382 100644 --- a/SOURCES/glibc-rh1173537.patch +++ b/SOURCES/glibc-rh1173537.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Mon May 26 11:40:08 2014 +0530 Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878) - + The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL (with errno as ERANGE) when the supplied buffer does not have sufficient space for the result. This is wrong, because the canonical way to indicate insufficient buffer is to set the errno to ERANGE and the status to NSS_STATUS_TRYAGAIN, as is used by all other modules. - + This fixes nscd behaviour when the nss_ldap module returns NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to fit into the supplied buffer. @@ -19,27 +19,27 @@ index b3d40e9..edab174 100644 --- glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c @@ -197,11 +197,6 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - int e; - status = getfct.f (&data, buffer + buffilled, - buflen - buffilled - req->key_len, &e); + int e; + status = getfct.f (&data, buffer + buffilled, + buflen - buffilled - req->key_len, &e); - if (status == NSS_STATUS_RETURN - || status == NSS_STATUS_NOTFOUND) - /* This was either the last one for this group or the - group was empty. Look at next group if available. */ - break; - if (status == NSS_STATUS_SUCCESS) - { - if (data.type == triple_val) + if (status == NSS_STATUS_SUCCESS) + { + if (data.type == triple_val) @@ -320,11 +315,18 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - } - } - } + } + } + } - else if (status == NSS_STATUS_UNAVAIL && e == ERANGE) + else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE) - { - buflen *= 2; - buffer = xrealloc (buffer, buflen); - } + { + buflen *= 2; + buffer = xrealloc (buffer, buflen); + } + else if (status == NSS_STATUS_RETURN + || status == NSS_STATUS_NOTFOUND + || status == NSS_STATUS_UNAVAIL) @@ -47,9 +47,9 @@ index b3d40e9..edab174 100644 + group was empty or the NSS module had an internal + failure. Look at next group if available. */ + break; - } - - enum nss_status (*endfct) (struct __netgrent *); + } + + enum nss_status (*endfct) (struct __netgrent *); diff --git glibc-2.17-c758a686/nss/nss_files/files-netgrp.c glibc-2.17-c758a686/nss/nss_files/files-netgrp.c index 34eae4c..bc0b367 100644 --- glibc-2.17-c758a686/nss/nss_files/files-netgrp.c diff --git a/SOURCES/glibc-rh1176906.patch b/SOURCES/glibc-rh1176906.patch index 448bb7e9..e6afde18 100644 --- a/SOURCES/glibc-rh1176906.patch +++ b/SOURCES/glibc-rh1176906.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Tue Dec 23 16:16:32 2014 +0100 iconvdata/run-iconv-test.sh: Actually test iconv modules - + Arjun Shankar noticed that this test case was not testing anything because iconv was invoked without the required arguments. @@ -17,6 +17,6 @@ index 5dfb69f..1d0bf52 100755 PROG=`eval echo $ICONV` - if $PROG < $temp1 >/dev/null 2>&1 ; then + if $PROG -f $from -t UTF8 < $temp1 >/dev/null 2>&1 ; then - : # fall through + : # fall through else - status=$? + status=$? diff --git a/SOURCES/glibc-rh1183456.patch b/SOURCES/glibc-rh1183456.patch index 3982973c..021ec3bf 100644 --- a/SOURCES/glibc-rh1183456.patch +++ b/SOURCES/glibc-rh1183456.patch @@ -3,10 +3,10 @@ Author: Siddhesh Poyarekar Date: Thu Jan 29 10:30:09 2015 +0530 Initialize nscd stats data [BZ #17892] - + The padding bytes in the statsdata struct are not initialized, due to which valgrind throws a warning: - + ==11384== Memcheck, a memory error detector ==11384== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==11384== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info @@ -22,7 +22,7 @@ Date: Thu Jan 29 10:30:09 2015 +0530 ==11384== by 0x4E439D0: start_thread (in /lib64/libpthread-2.12.so) ==11384== by 0x599AB6C: clone (in /lib64/libc-2.12.so) ==11384== Address 0x15708395 is on thread 6's stack - + Fix the warning by initializing the structure. diff --git glibc-2.17-c758a686/nscd/nscd_stat.c glibc-2.17-c758a686/nscd/nscd_stat.c @@ -32,7 +32,7 @@ index 0f1f3c0..7aaa21b 100644 @@ -94,6 +94,8 @@ send_stats (int fd, struct database_dyn dbs[lastdb]) struct statdata data; int cnt; - + + memset (&data, 0, sizeof (data)); + memcpy (data.version, compilation, sizeof (compilation)); diff --git a/SOURCES/glibc-rh1183545.patch b/SOURCES/glibc-rh1183545.patch index 2db1019f..a9ec106a 100644 --- a/SOURCES/glibc-rh1183545.patch +++ b/SOURCES/glibc-rh1183545.patch @@ -11,12 +11,12 @@ index 449a258..553eafa 100644 @@ -37,7 +37,8 @@ install-bin := getent makedb makedb-modules = xmalloc hash-string extra-objs += $(makedb-modules:=.o) - + -tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent +tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent \ + test-digits-dots xtests = bug-erange - + include ../Makeconfig diff --git glibc-2.17-c758a686/nss/digits_dots.c glibc-2.17-c758a686/nss/digits_dots.c index 2b86295..e007ef4 100644 @@ -25,7 +25,7 @@ index 2b86295..e007ef4 100644 @@ -46,7 +46,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, { if (h_errnop) - *h_errnop = NETDB_INTERNAL; + *h_errnop = NETDB_INTERNAL; - *result = NULL; + if (buffer_size == NULL) + *status = NSS_STATUS_TRYAGAIN; @@ -33,59 +33,59 @@ index 2b86295..e007ef4 100644 + *result = NULL; return -1; } - + @@ -83,14 +86,16 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - } - + } + size_needed = (sizeof (*host_addr) - + sizeof (*h_addr_ptrs) + strlen (name) + 1); + + sizeof (*h_addr_ptrs) + + sizeof (*h_alias_ptr) + strlen (name) + 1); - + if (buffer_size == NULL) { - if (buflen < size_needed) - { + if (buflen < size_needed) + { + *status = NSS_STATUS_TRYAGAIN; - if (h_errnop != NULL) + if (h_errnop != NULL) - *h_errnop = TRY_AGAIN; + *h_errnop = NETDB_INTERNAL; - __set_errno (ERANGE); - goto done; - } + __set_errno (ERANGE); + goto done; + } @@ -109,7 +114,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - *buffer_size = 0; - __set_errno (save); - if (h_errnop != NULL) + *buffer_size = 0; + __set_errno (save); + if (h_errnop != NULL) - *h_errnop = TRY_AGAIN; + *h_errnop = NETDB_INTERNAL; - *result = NULL; - goto done; - } + *result = NULL; + goto done; + } @@ -149,7 +154,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - if (! ok) - { - *h_errnop = HOST_NOT_FOUND; + if (! ok) + { + *h_errnop = HOST_NOT_FOUND; - if (buffer_size) + if (buffer_size == NULL) + *status = NSS_STATUS_NOTFOUND; + else - *result = NULL; - goto done; - } + *result = NULL; + goto done; + } @@ -190,7 +197,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - if (buffer_size == NULL) - *status = NSS_STATUS_SUCCESS; - else + if (buffer_size == NULL) + *status = NSS_STATUS_SUCCESS; + else - *result = resbuf; + *result = resbuf; - goto done; - } - + goto done; + } + @@ -201,15 +208,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - + if ((isxdigit (name[0]) && strchr (name, ':') != NULL) || name[0] == ':') - { + { - const char *cp; - char *hostname; - typedef unsigned char host_addr_t[16]; @@ -95,25 +95,25 @@ index 2b86295..e007ef4 100644 - size_t size_needed; - int addr_size; - - switch (af) - { - default: + switch (af) + { + default: @@ -225,7 +223,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - /* This is not possible. We cannot represent an IPv6 address - in an `struct in_addr' variable. */ - *h_errnop = HOST_NOT_FOUND; + /* This is not possible. We cannot represent an IPv6 address + in an `struct in_addr' variable. */ + *h_errnop = HOST_NOT_FOUND; - *result = NULL; + if (buffer_size == NULL) + *status = NSS_STATUS_NOTFOUND; + else + *result = NULL; - goto done; - - case AF_INET6: + goto done; + + case AF_INET6: @@ -233,42 +234,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - break; - } - + break; + } + - size_needed = (sizeof (*host_addr) - + sizeof (*h_addr_ptrs) + strlen (name) + 1); - @@ -150,20 +150,20 @@ index 2b86295..e007ef4 100644 - ((char *) host_addr + sizeof (*host_addr)); - hostname = (char *) h_addr_ptrs + sizeof (*h_addr_ptrs); - - for (cp = name;; ++cp) - { - if (!*cp) + for (cp = name;; ++cp) + { + if (!*cp) @@ -281,7 +246,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - if (inet_pton (AF_INET6, name, host_addr) <= 0) - { - *h_errnop = HOST_NOT_FOUND; + if (inet_pton (AF_INET6, name, host_addr) <= 0) + { + *h_errnop = HOST_NOT_FOUND; - if (buffer_size) + if (buffer_size == NULL) + *status = NSS_STATUS_NOTFOUND; + else - *result = NULL; - goto done; - } + *result = NULL; + goto done; + } diff --git glibc-2.17-c758a686/nss/getXXbyYY_r.c glibc-2.17-c758a686/nss/getXXbyYY_r.c index 1067744..44d00f4 100644 --- glibc-2.17-c758a686/nss/getXXbyYY_r.c diff --git a/SOURCES/glibc-rh1186491.patch b/SOURCES/glibc-rh1186491.patch index 7db4eaa7..31dc1b59 100644 --- a/SOURCES/glibc-rh1186491.patch +++ b/SOURCES/glibc-rh1186491.patch @@ -5,28 +5,28 @@ there anymore. (The math tests have been reorganized.) +++ glibc-2.17-c758a686/math/libm-test.inc 2015-01-26 16:46:24.631769811 -0500 @@ -521,7 +521,7 @@ } - - + + -static void +static void __attribute__ ((noinline)) check_float_internal (const char *test_name, FLOAT computed, FLOAT expected, - FLOAT max_ulp, int xfail, int exceptions, - FLOAT *curr_max_error) + FLOAT max_ulp, int xfail, int exceptions, + FLOAT *curr_max_error) @@ -610,7 +610,7 @@ } - - + + -static void +static void __attribute__ ((noinline)) check_float (const char *test_name, FLOAT computed, FLOAT expected, - FLOAT max_ulp, int xfail, int exceptions) + FLOAT max_ulp, int xfail, int exceptions) { @@ -619,7 +619,7 @@ } - - + + -static void +static void __attribute__ ((noinline)) check_complex (const char *test_name, __complex__ FLOAT computed, - __complex__ FLOAT expected, - __complex__ FLOAT max_ulp, __complex__ int xfail, + __complex__ FLOAT expected, + __complex__ FLOAT max_ulp, __complex__ int xfail, diff --git a/SOURCES/glibc-rh1186620.patch b/SOURCES/glibc-rh1186620.patch index c2e307eb..ef8f5805 100644 --- a/SOURCES/glibc-rh1186620.patch +++ b/SOURCES/glibc-rh1186620.patch @@ -3,27 +3,27 @@ Author: Siddhesh Poyarekar Date: Tue Feb 24 12:57:26 2015 +0530 Skip logging for DNSSEC responses [BZ 14841] - + DNSSEC defines a number of response types that one me expect when the DO bit is set. We don't process any of them, but since we do allow setting the DO bit, skip them without logging an error since it is only a nuisance. - + Tested on x86_64. - - [BZ #14841] - * resolv/gethnamaddr.c (getanswer): Skip logging if - RES_USE_DNSSEC is set. - * resolv/nss_dns/dns-host.c (getanswer_r): Likewise. + + [BZ #14841] + * resolv/gethnamaddr.c (getanswer): Skip logging if + RES_USE_DNSSEC is set. + * resolv/nss_dns/dns-host.c (getanswer_r): Likewise. diff --git glibc-2.17-c758a686/resolv/gethnamaddr.c glibc-2.17-c758a686/resolv/gethnamaddr.c index a861a84..7fd0e49 100644 --- glibc-2.17-c758a686/resolv/gethnamaddr.c +++ glibc-2.17-c758a686/resolv/gethnamaddr.c @@ -331,23 +331,18 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - buflen -= n; - continue; - } + buflen -= n; + continue; + } - if ((type == T_SIG) || (type == T_KEY) || (type == T_NXT)) { - /* We don't support DNSSEC yet. For now, ignore - * the record and send a low priority message @@ -36,7 +36,7 @@ index a861a84..7fd0e49 100644 - cp += n; - continue; - } - if (type != qtype) { + if (type != qtype) { - syslog(LOG_NOTICE|LOG_AUTH, + /* Log a low priority message if we get an unexpected + * record, but skip it if we are using DNSSEC since it @@ -45,23 +45,23 @@ index a861a84..7fd0e49 100644 + */ + if ((_res.options & RES_USE_DNSSEC) == 0) { + syslog(LOG_NOTICE|LOG_AUTH, - "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", + "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", - qname, p_class(C_IN), p_type(qtype), - p_type(type)); + qname, p_class(C_IN), p_type(qtype), + p_type(type)); + } - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } diff --git glibc-2.17-c758a686/resolv/nss_dns/dns-host.c glibc-2.17-c758a686/resolv/nss_dns/dns-host.c index f715ab0..b16b0dd 100644 --- glibc-2.17-c758a686/resolv/nss_dns/dns-host.c +++ glibc-2.17-c758a686/resolv/nss_dns/dns-host.c @@ -820,26 +820,19 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - linebuflen -= n; - continue; - } + linebuflen -= n; + continue; + } - if (__builtin_expect (type == T_SIG, 0) - || __builtin_expect (type == T_KEY, 0) - || __builtin_expect (type == T_NXT, 0)) @@ -74,11 +74,11 @@ index f715ab0..b16b0dd 100644 - cp += n; - continue; - } - + if (type == T_A && qtype == T_AAAA && map) - have_to_map = 1; + have_to_map = 1; else if (__builtin_expect (type != qtype, 0)) - { + { - syslog (LOG_NOTICE | LOG_AUTH, - "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", - qname, p_class (C_IN), p_type (qtype), p_type (type)); @@ -90,6 +90,6 @@ index f715ab0..b16b0dd 100644 + "gethostby*.getanswer: asked for \"%s %s %s\", " + "got type \"%s\"", + qname, p_class (C_IN), p_type (qtype), p_type (type)); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } diff --git a/SOURCES/glibc-rh1188235.patch b/SOURCES/glibc-rh1188235.patch index 8510391f..9435bc80 100644 --- a/SOURCES/glibc-rh1188235.patch +++ b/SOURCES/glibc-rh1188235.patch @@ -3,22 +3,22 @@ Author: Paul Pluzhnikov Date: Fri Feb 6 00:30:42 2015 -0500 CVE-2015-1472: wscanf allocates too little memory - + BZ #16618 - + Under certain conditions wscanf can allocate too little memory for the to-be-scanned arguments and overflow the allocated buffer. The implementation now correctly computes the required buffer size when using malloc. - + A regression test was added to tst-sscanf. --- glibc-2.17-c758a686/stdio-common/vfscanf.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/vfscanf.c 2015-05-28 14:01:58.512816390 -0400 @@ -272,9 +272,10 @@ if (__builtin_expect (wpsize == wpmax, 0)) \ - { \ - CHAR_T *old = wp; \ + { \ + CHAR_T *old = wp; \ - size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax \ - ? UCHAR_MAX + 1 : 2 * wpmax); \ - if (use_malloc || !__libc_use_alloca (newsize)) \ @@ -26,32 +26,32 @@ Date: Fri Feb 6 00:30:42 2015 -0500 + size_t wpneed = MAX (UCHAR_MAX + 1, 2 * wpmax); \ + size_t newsize = fits ? wpneed * sizeof (CHAR_T) : SIZE_MAX; \ + if (!__libc_use_alloca (newsize)) \ - { \ - wp = realloc (use_malloc ? wp : NULL, newsize); \ - if (wp == NULL) \ + { \ + wp = realloc (use_malloc ? wp : NULL, newsize); \ + if (wp == NULL) \ @@ -286,14 +287,13 @@ - } \ - if (! use_malloc) \ - MEMCPY (wp, old, wpsize); \ + } \ + if (! use_malloc) \ + MEMCPY (wp, old, wpsize); \ - wpmax = newsize; \ + wpmax = wpneed; \ - use_malloc = true; \ - } \ - else \ - { \ - size_t s = wpmax * sizeof (CHAR_T); \ + use_malloc = true; \ + } \ + else \ + { \ + size_t s = wpmax * sizeof (CHAR_T); \ - wp = (CHAR_T *) extend_alloca (wp, s, \ - newsize * sizeof (CHAR_T)); \ + wp = (CHAR_T *) extend_alloca (wp, s, newsize); \ - wpmax = s / sizeof (CHAR_T); \ - if (old != NULL) \ - MEMCPY (wp, old, wpsize); \ + wpmax = s / sizeof (CHAR_T); \ + if (old != NULL) \ + MEMCPY (wp, old, wpsize); \ --- glibc-2.17-c758a686/stdio-common/tst-sscanf.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/tst-sscanf.c 2015-06-03 13:56:10.883924259 -0400 @@ -196,5 +196,38 @@ - } + } } - + + /* BZ #16618 + The test will segfault during SSCANF if the buffer overflow + is not fixed. The size of `s` is such that it forces the use diff --git a/SOURCES/glibc-rh1189278-1.patch b/SOURCES/glibc-rh1189278-1.patch index 7783c4c0..012e0055 100644 --- a/SOURCES/glibc-rh1189278-1.patch +++ b/SOURCES/glibc-rh1189278-1.patch @@ -26,7 +26,7 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules @@ -437,6 +437,25 @@ load-map-file = $(map-file:%=-Wl,--version-script=%) endif - + +# Compiler arguments to use to link a shared object with libc and +# ld.so. This is intended to be as similar as possible to a default +# link with an installed libc. @@ -58,10 +58,10 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules endef define build-module-asneeded $(build-module-helper) -o $@ $(shlib-lds-flags) \ - $(csu-objpfx)abi-note.o \ + $(csu-objpfx)abi-note.o \ - -Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed + -Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed \ + $(link-libc-args) endef - + build-module-helper-objlist = \ diff --git a/SOURCES/glibc-rh1189278.patch b/SOURCES/glibc-rh1189278.patch index 01e2ffcb..86c7f4d5 100644 --- a/SOURCES/glibc-rh1189278.patch +++ b/SOURCES/glibc-rh1189278.patch @@ -4,12 +4,12 @@ # commit d8dd00805b8f3a011735d7a407097fb1c408d867 # Author: H.J. Lu # Date: Fri Nov 28 07:54:07 2014 -0800 -# +# # Resize DTV if the current DTV isn't big enough -# +# # This patch changes _dl_allocate_tls_init to resize DTV if the current DTV # isn't big enough. Tested on X86-64, x32 and ia32. -# +# # [BZ #13862] # * elf/dl-tls.c: Include . # (oom): Remove #ifdef SHARED/#endif. @@ -27,7 +27,7 @@ # (clean): Likewise. # * nptl/tst-stack4.c: New file. # * nptl/tst-stack4mod.c: Likewise. -# +# diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c --- glibc-2.17-c758a686/elf/dl-tls.c 2015-02-18 14:15:28.078461873 -0500 +++ glibc-2.17-c758a686/elf/dl-tls.c 2015-02-18 14:38:37.630374771 -0500 @@ -36,12 +36,12 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c #include #include +#include - + #include #include @@ -35,14 +36,12 @@ - - + + /* Out-of-memory handler. */ -#ifdef SHARED static void @@ -51,13 +51,13 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c _dl_fatal_printf ("cannot allocate memory for thread-local data: ABORT\n"); } -#endif - - + + size_t @@ -392,6 +391,52 @@ return result; } - + +static dtv_t * +_dl_resize_dtv (dtv_t *dtv) +{ @@ -104,13 +104,13 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c + return &newp[1]; +} + - + void * internal_function @@ -406,6 +451,16 @@ size_t total = 0; size_t maxgen = 0; - + + /* Check if the current dtv is big enough. */ + if (dtv[-1].counter < GL(dl_tls_max_dtv_idx)) + { @@ -125,9 +125,9 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c TLS. For those which are dynamically loaded we add the values indicating deferred allocation. */ @@ -637,41 +692,10 @@ - assert (total + cnt == modid); - if (dtv[-1].counter < modid) - { + assert (total + cnt == modid); + if (dtv[-1].counter < modid) + { - /* Reallocate the dtv. */ - dtv_t *newp; - size_t newsize = GL(dl_tls_max_dtv_idx) + DTV_SURPLUS; @@ -162,38 +162,38 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c - (newsize - oldsize) * sizeof (dtv_t)); + /* Resize the dtv. */ + dtv = _dl_resize_dtv (dtv); - + - /* Point dtv to the generation counter. */ - dtv = &newp[1]; + assert (modid <= dtv[-1].counter); - - /* Install this new dtv in the thread data - structures. */ + + /* Install this new dtv in the thread data + structures. */ diff -urN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686/nptl/Makefile 2015-02-18 14:15:28.073462028 -0500 +++ glibc-2.17-c758a686/nptl/Makefile 2015-02-18 14:15:49.817786667 -0500 @@ -251,7 +251,7 @@ - tst-exec1 tst-exec2 tst-exec3 tst-exec4 \ - tst-exit1 tst-exit2 tst-exit3 \ - tst-stdio1 tst-stdio2 \ + tst-exec1 tst-exec2 tst-exec3 tst-exec4 \ + tst-exit1 tst-exit2 tst-exit3 \ + tst-stdio1 tst-stdio2 \ - tst-stack1 tst-stack2 tst-stack3 tst-pthread-getattr \ + tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \ - tst-unload \ - tst-dlsym1 \ - tst-sysconf \ + tst-unload \ + tst-dlsym1 \ + tst-sysconf \ @@ -297,7 +297,7 @@ - + modules-names = tst-atfork2mod tst-tls3mod tst-tls4moda tst-tls4modb \ - tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \ + tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \ - tst-tls5modd tst-tls5mode tst-tls5modf \ + tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \ - tst-_res1mod1 tst-_res1mod2 tst-execstack-mod tst-fini1mod + tst-_res1mod1 tst-_res1mod2 tst-execstack-mod tst-fini1mod extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) tst-cleanup4aux.o test-extras += $(modules-names) tst-cleanup4aux @@ -459,6 +459,19 @@ - $(common-objpfx)malloc/mtrace $(objpfx)tst-stack3.mtrace > $@ + $(common-objpfx)malloc/mtrace $(objpfx)tst-stack3.mtrace > $@ generated += tst-stack3-mem tst-stack3.mtrace - + +$(objpfx)tst-stack4: $(libdl) $(shared-thread-library) +tst-stack4mod.sos=$(shell for i in 0 1 2 3 4 5 6 7 8 9 10 \ + 11 12 13 14 15 16 17 18 19; do \ @@ -209,7 +209,7 @@ diff -urN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile + $(objpfx)tst-cleanup4: $(objpfx)tst-cleanup4aux.o $(shared-thread-library) $(objpfx)tst-cleanupx4: $(objpfx)tst-cleanup4aux.o $(shared-thread-library) - + diff -urN glibc-2.17-c758a686/nptl/tst-stack4.c glibc-2.17-c758a686/nptl/tst-stack4.c --- glibc-2.17-c758a686/nptl/tst-stack4.c 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.17-c758a686/nptl/tst-stack4.c 2015-02-18 14:15:49.817786667 -0500 diff --git a/SOURCES/glibc-rh1193797.patch b/SOURCES/glibc-rh1193797.patch index d52d5252..52b1251c 100644 --- a/SOURCES/glibc-rh1193797.patch +++ b/SOURCES/glibc-rh1193797.patch @@ -8,58 +8,58 @@ Date: Fri Mar 13 09:49:24 2015 -0400 +++ glibc-2.17-c758a686/nscd/cache.c 2015-05-13 13:45:57.259958374 -0400 @@ -272,28 +272,38 @@ while (runp != NULL) - { + { #ifdef HAVE_INOTIFY - if (runp->inotify_descr == -1) + if (runp->inotify_descr[TRACED_FILE] == -1) #endif - { - struct stat64 st; - - if (stat64 (runp->fname, &st) < 0) - { + { + struct stat64 st; + + if (stat64 (runp->fname, &st) < 0) + { + /* Print a diagnostic that the traced file was missing. + We must not disable tracing since the file might return + shortly and we want to reload it at the next pruning. + Disabling tracing here would go against the configuration + as specified by the user via check-files. */ - char buf[128]; + char buf[128]; - /* We cannot stat() the file, disable file checking if the - file does not exist. */ - dbg_log (_("cannot stat() file `%s': %s"), + dbg_log (_("checking for monitored file `%s': %s"), - runp->fname, strerror_r (errno, buf, sizeof (buf))); + runp->fname, strerror_r (errno, buf, sizeof (buf))); - if (errno == ENOENT) - table->check_file = 0; - } - else - { + } + else + { - if (st.st_mtime != table->file_mtime) + /* This must be `!=` to catch cases where users turn the + clocks back and we still want to detect any time difference + in mtime. */ + if (st.st_mtime != runp->mtime) - { + { - /* The file changed. Invalidate all entries. */ + dbg_log (_("monitored file `%s` changed (mtime)"), + runp->fname); + /* The file changed. Invalidate all entries. */ - now = LONG_MAX; + now = LONG_MAX; - table->file_mtime = st.st_mtime; + runp->mtime = st.st_mtime; +#ifdef HAVE_INOTIFY + /* Attempt to install a watch on the file. */ + install_watches (runp); +#endif - } - } - } + } + } + } --- glibc-2.17-c758a686/nscd/connections.c 2015-05-12 15:03:02.870274443 -0400 +++ glibc-2.17-c758a686/nscd/connections.c 2015-05-13 13:45:57.259958374 -0400 @@ -974,6 +974,44 @@ finish_drop_privileges (); } - + +#ifdef HAVE_INOTIFY +#define TRACED_FILE_MASK (IN_DELETE_SELF | IN_CLOSE_WRITE | IN_MOVE_SELF) +#define TRACED_DIR_MASK (IN_DELETE_SELF | IN_CREATE | IN_MOVED_TO | IN_MOVE_SELF) @@ -98,19 +98,19 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + finfo->dname, finfo->inotify_descr[TRACED_DIR]); +} +#endif - + void register_traced_file (size_t dbidx, struct traced_file *finfo) @@ -982,30 +1020,24 @@ return; - + if (__builtin_expect (debug_level > 0, 0)) - dbg_log (_("register trace file %s for database %s"), - finfo->fname, dbnames[dbidx]); + dbg_log (_("monitoring file `%s' for database `%s' (%d)"), + finfo->fname, dbnames[dbidx], + finfo->inotify_descr[TRACED_DIR]); - + #ifdef HAVE_INOTIFY - if (inotify_fd < 0 - || (finfo->inotify_descr = inotify_add_watch (inotify_fd, finfo->fname, @@ -129,7 +129,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 - finfo->fname, strerror (errno)); - return; - } - + - finfo->inotify_descr = -1; - finfo->mtime = st.st_mtime; + struct stat64 st; @@ -142,7 +142,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 } + else + finfo->mtime = st.st_mtime; - + /* Queue up the file name. */ finfo->next = dbs[dbidx].traced_files; @@ -1030,20 +1062,27 @@ @@ -152,7 +152,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 - if (number == hstdb) + struct traced_file *runp = dbs[number].traced_files; + while (runp != NULL) - { + { - struct traced_file *runp = dbs[hstdb].traced_files; - while (runp != NULL) - if (runp->call_res_init) @@ -177,17 +177,17 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + break; + } + runp = runp->next; - } - break; + } + break; - } + } - + if (number == lastdb) { @@ -1871,6 +1910,234 @@ static time_t *starttime; - - + + +#ifdef HAVE_INOTIFY +/* Inotify event for changed file. */ +union __inev @@ -420,9 +420,9 @@ Date: Fri Mar 13 09:49:24 2015 -0400 __attribute__ ((__noreturn__)) main_loop_poll (void) @@ -1975,72 +2242,21 @@ - { - if (conns[1].revents != 0) - { + { + if (conns[1].revents != 0) + { - bool to_clear[lastdb] = { false, }; - union - { @@ -504,13 +504,13 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + inotify_fd = -1; + } + --n; - } - - first = 2; + } + + first = 2; @@ -2207,64 +2423,18 @@ # ifdef HAVE_INOTIFY - else if (revs[cnt].data.fd == inotify_fd) - { + else if (revs[cnt].data.fd == inotify_fd) + { - bool to_clear[lastdb] = { false, }; - union - { @@ -522,7 +522,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + int ret; + ret = handle_inotify_events (); + if (ret == -1) - { + { - ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev, - sizeof (inev))); - if (nb < (ssize_t) sizeof (struct inotify_event)) @@ -582,9 +582,9 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + } # endif # ifdef HAVE_NETLINK - else if (revs[cnt].data.fd == nl_status_fd) + else if (revs[cnt].data.fd == nl_status_fd) @@ -2300,7 +2470,9 @@ - no reply in too long of a time. */ + no reply in too long of a time. */ time_t laststart = now - ACCEPT_TIMEOUT; assert (starttime[sock] == 0); +# ifdef HAVE_INOTIFY @@ -592,13 +592,13 @@ Date: Fri Mar 13 09:49:24 2015 -0400 +# endif assert (nl_status_fd == -1 || starttime[nl_status_fd] == 0); for (int cnt = highest; cnt > STDERR_FILENO; --cnt) - if (starttime[cnt] != 0 && starttime[cnt] < laststart) + if (starttime[cnt] != 0 && starttime[cnt] < laststart) --- glibc-2.17-c758a686/nscd/nscd.h 2015-05-12 15:03:02.870274443 -0400 +++ glibc-2.17-c758a686/nscd/nscd.h 2015-05-13 13:45:57.259958374 -0400 @@ -61,17 +61,67 @@ 80% of the thread stack size. */ #define MAX_STACK_USE ((8 * NSCD_THREAD_STACKSIZE) / 10) - + - -/* Registered filename used to fill database. */ +/* Records the file registered per database that when changed @@ -625,7 +625,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + /* The full-path name of the registered file. */ char fname[]; }; - + +/* Initialize a `struct traced_file`. As input we need the name + of the file, and if invalidation requires calling res_init. + If CRINIT is 1 then res_init will be called after invalidation @@ -663,7 +663,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + struct traced_file file; \ + char buf[sizeof (struct traced_file) + sizeof (filename)]; \ +} id##_traced_file; - + /* Structure describing dynamic part of one database. */ struct database_dyn @@ -90,7 +140,6 @@ @@ -673,7 +673,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 - time_t file_mtime; size_t suggested_module; size_t max_db_size; - + @@ -216,6 +265,9 @@ /* connections.c */ extern void nscd_init (void); @@ -683,13 +683,13 @@ Date: Fri Mar 13 09:49:24 2015 -0400 +#endif extern void close_sockets (void); extern void start_threads (void) __attribute__ ((__noreturn__)); - + --- glibc-2.17-c758a686/nss/nss_db/db-init.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/nss/nss_db/db-init.c 2015-05-13 13:45:57.269958504 -0400 @@ -22,35 +22,25 @@ #include #include - + -static union -{ - struct traced_file file; @@ -703,7 +703,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 -} grp_traced_file; +#define PWD_FILENAME (_PATH_VARDB "passwd.db") +define_traced_file (pwd, PWD_FILENAME); - + -static union -{ - struct traced_file file; @@ -711,38 +711,38 @@ Date: Fri Mar 13 09:49:24 2015 -0400 -} serv_traced_file; +#define GRP_FILENAME (_PATH_VARDB "group.db") +define_traced_file (grp, GRP_FILENAME); - + +#define SERV_FILENAME (_PATH_VARDB "services.db") +define_traced_file (serv, SERV_FILENAME); - + void _nss_db_init (void (*cb) (size_t, struct traced_file *)) { - strcpy (pwd_traced_file.file.fname,_PATH_VARDB "passwd.db"); + init_traced_file (&pwd_traced_file.file, PWD_FILENAME, 0); cb (pwddb, &pwd_traced_file.file); - + - strcpy (grp_traced_file.file.fname, _PATH_VARDB "group.db"); + init_traced_file (&grp_traced_file.file, GRP_FILENAME, 0); cb (grpdb, &grp_traced_file.file); - + - strcpy (serv_traced_file.file.fname, _PATH_VARDB "services.db"); + init_traced_file (&serv_traced_file.file, SERV_FILENAME, 0); cb (servdb, &serv_traced_file.file); } - + --- glibc-2.17-c758a686/nss/nss_files/files-init.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/nss/nss_files/files-init.c 2015-05-13 13:45:57.269958504 -0400 @@ -18,43 +18,46 @@ - + #ifdef USE_NSCD - + +#include #include - + +#define PWD_FILENAME "/etc/passwd" +define_traced_file (pwd, PWD_FILENAME); - + -#define TF(id, filename, ...) \ -static union \ -{ \ @@ -766,7 +766,7 @@ Date: Fri Mar 13 09:49:24 2015 -0400 - +#define GRP_FILENAME "/etc/group" +define_traced_file (grp, GRP_FILENAME); -+ ++ +#define HST_FILENAME "/etc/hosts" +define_traced_file (hst, HST_FILENAME); + @@ -778,26 +778,27 @@ Date: Fri Mar 13 09:49:24 2015 -0400 + +#define NETGR_FILENAME "/etc/netgroup" +define_traced_file (netgr, NETGR_FILENAME); -+ ++ void _nss_files_init (void (*cb) (size_t, struct traced_file *)) { + init_traced_file (&pwd_traced_file.file, PWD_FILENAME, 0); cb (pwddb, &pwd_traced_file.file); - + + init_traced_file (&grp_traced_file.file, GRP_FILENAME, 0); cb (grpdb, &grp_traced_file.file); - + + init_traced_file (&hst_traced_file.file, HST_FILENAME, 0); cb (hstdb, &hst_traced_file.file); - + + init_traced_file (&resolv_traced_file.file, RESOLV_FILENAME, 1); cb (hstdb, &resolv_traced_file.file); - + + init_traced_file (&serv_traced_file.file, SERV_FILENAME, 0); cb (servdb, &serv_traced_file.file); - -+ ++ + init_traced_file (&netgr_traced_file.file, NETGR_FILENAME, 0); cb (netgrdb, &netgr_traced_file.file); } + diff --git a/SOURCES/glibc-rh1194143.patch b/SOURCES/glibc-rh1194143.patch index e1f878ba..a5f2e1d0 100644 --- a/SOURCES/glibc-rh1194143.patch +++ b/SOURCES/glibc-rh1194143.patch @@ -9,10 +9,10 @@ index 3273d55..af42b8a 100644 --- glibc-2.17-c758a686/resolv/res_send.c +++ glibc-2.17-c758a686/resolv/res_send.c @@ -1410,6 +1410,7 @@ send_dg(res_state statp, - retval = reopen (statp, terrno, ns); - if (retval <= 0) - return retval; + retval = reopen (statp, terrno, ns); + if (retval <= 0) + return retval; + pfd[0].fd = EXT(statp).nssocks[ns]; - } - } - goto wait; + } + } + goto wait; diff --git a/SOURCES/glibc-rh1195762.patch b/SOURCES/glibc-rh1195762.patch index f18d5eef..be26b8ac 100644 --- a/SOURCES/glibc-rh1195762.patch +++ b/SOURCES/glibc-rh1195762.patch @@ -9,21 +9,21 @@ index 43d847d..3993579 100644 --- a/libio/wstrops.c +++ b/libio/wstrops.c @@ -95,8 +95,11 @@ _IO_wstr_overflow (fp, c) - wchar_t *old_buf = fp->_wide_data->_IO_buf_base; - size_t old_wblen = _IO_wblen (fp); - _IO_size_t new_size = 2 * old_wblen + 100; + wchar_t *old_buf = fp->_wide_data->_IO_buf_base; + size_t old_wblen = _IO_wblen (fp); + _IO_size_t new_size = 2 * old_wblen + 100; - if (new_size < old_wblen) + + if (__glibc_unlikely (new_size < old_wblen) + || __glibc_unlikely (new_size > SIZE_MAX / sizeof (wchar_t))) - return EOF; + return EOF; + - new_buf - = (wchar_t *) (*((_IO_strfile *) fp)->_s._allocate_buffer) (new_size - * sizeof (wchar_t)); + new_buf + = (wchar_t *) (*((_IO_strfile *) fp)->_s._allocate_buffer) (new_size + * sizeof (wchar_t)); @@ -186,6 +189,9 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading) return 1; - + _IO_size_t newsize = offset + 100; + if (__glibc_unlikely (newsize > SIZE_MAX / sizeof (wchar_t))) + return 1; diff --git a/SOURCES/glibc-rh1197730-1.patch b/SOURCES/glibc-rh1197730-1.patch index 5aa0f060..1f4997d8 100644 --- a/SOURCES/glibc-rh1197730-1.patch +++ b/SOURCES/glibc-rh1197730-1.patch @@ -9,52 +9,52 @@ index f79d051..544769b 100644 --- glibc-2.17-c758a686/posix/fnmatch_loop.c +++ glibc-2.17-c758a686/posix/fnmatch_loop.c @@ -899,11 +899,8 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used) - - matched: - /* Skip the rest of the [...] that already matched. */ + + matched: + /* Skip the rest of the [...] that already matched. */ - do + while ((c = *p++) != L (']')) - { + { - ignore_next: - c = *p++; - - if (c == L('\0')) - /* [... (unterminated) loses. */ - return FNM_NOMATCH; + if (c == L('\0')) + /* [... (unterminated) loses. */ + return FNM_NOMATCH; @@ -931,12 +928,11 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used) - - if (c < L('a') || c >= L('z')) - { + + if (c < L('a') || c >= L('z')) + { - p = startp; - goto ignore_next; + p = startp - 2; + break; - } - } - p += 2; + } + } + p += 2; - c = *p++; - } - else if (c == L('[') && *p == L('=')) - { + } + else if (c == L('[') && *p == L('=')) + { @@ -947,7 +943,6 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used) - if (c != L('=') || p[1] != L(']')) - return FNM_NOMATCH; - p += 2; + if (c != L('=') || p[1] != L(']')) + return FNM_NOMATCH; + p += 2; - c = *p++; - } - else if (c == L('[') && *p == L('.')) - { + } + else if (c == L('[') && *p == L('.')) + { @@ -962,10 +957,8 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used) - break; - } - p += 2; + break; + } + p += 2; - c = *p++; - } - } + } + } - while (c != L(']')); - if (not) - return FNM_NOMATCH; - } + if (not) + return FNM_NOMATCH; + } diff --git glibc-2.17-c758a686/posix/tst-fnmatch3.c glibc-2.17-c758a686/posix/tst-fnmatch3.c new file mode 100644 index 0000000..2a83c1b @@ -94,9 +94,9 @@ index 0000000..2a83c1b --- glibc-2.17-c758a686/posix/Makefile 2015-05-15 16:00:01.000000000 -0400 +++ glibc-2.17-c758a686/posix/Makefile 2015-05-29 18:34:07.507240952 -0400 @@ -87,7 +87,7 @@ - tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ - bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ - bug-getopt5 tst-getopt_long1 bug-regex34 \ + tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ + bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ + bug-getopt5 tst-getopt_long1 bug-regex34 \ - tst-pathconf + tst-pathconf tst-fnmatch3 xtests := bug-ga2 diff --git a/SOURCES/glibc-rh1197730-2.patch b/SOURCES/glibc-rh1197730-2.patch index 3923a247..88af8cd1 100644 --- a/SOURCES/glibc-rh1197730-2.patch +++ b/SOURCES/glibc-rh1197730-2.patch @@ -9,22 +9,22 @@ index c0cb2fc..72c5d8f 100644 --- glibc-2.17-c758a686/posix/fnmatch_loop.c +++ glibc-2.17-c758a686/posix/fnmatch_loop.c @@ -945,14 +945,13 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used) - } - else if (c == L('[') && *p == L('.')) - { + } + else if (c == L('[') && *p == L('.')) + { - ++p; - while (1) - { - c = *++p; + while (1) + { + c = *++p; - if (c == '\0') + if (c == L('\0')) - return FNM_NOMATCH; - + return FNM_NOMATCH; + - if (*p == L('.') && p[1] == L(']')) + if (c == L('.') && p[1] == L(']')) - break; - } - p += 2; + break; + } + p += 2; diff --git glibc-2.17-c758a686/posix/tst-fnmatch3.c glibc-2.17-c758a686/posix/tst-fnmatch3.c index d27a557..75bc00a 100644 --- glibc-2.17-c758a686/posix/tst-fnmatch3.c @@ -42,5 +42,5 @@ index d27a557..75bc00a 100644 + return 1; + return 0; } - + #define TEST_FUNCTION do_test () diff --git a/SOURCES/glibc-rh1197730-3.patch b/SOURCES/glibc-rh1197730-3.patch index 9da1dbeb..c92d2997 100644 --- a/SOURCES/glibc-rh1197730-3.patch +++ b/SOURCES/glibc-rh1197730-3.patch @@ -9,7 +9,7 @@ Date: Mon Mar 2 13:34:22 2015 -0800 @@ -1036,7 +1036,12 @@ END (const CHAR *pattern) } else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@') - || *p == L('!')) && p[1] == L('(')) + || *p == L('!')) && p[1] == L('(')) - p = END (p + 1); + { + p = END (p + 1); @@ -19,14 +19,14 @@ Date: Mon Mar 2 13:34:22 2015 -0800 + } else if (*p == L(')')) break; - + diff --git glibc-2.17-c758a686/posix/tst-fnmatch3.c glibc-2.17-c758a686/posix/tst-fnmatch3.c index 75bc00a..fdf9934 100644 --- glibc-2.17-c758a686/posix/tst-fnmatch3.c +++ glibc-2.17-c758a686/posix/tst-fnmatch3.c @@ -17,6 +17,26 @@ . */ - + #include +#include +#include @@ -48,7 +48,7 @@ index 75bc00a..fdf9934 100644 + + return fnmatch (pattern, p, FNM_EXTMATCH); +} - + int do_test (void) @@ -25,7 +45,7 @@ do_test (void) @@ -58,5 +58,5 @@ index 75bc00a..fdf9934 100644 - return 0; + return do_bz18036 (); } - + #define TEST_FUNCTION do_test () diff --git a/SOURCES/glibc-rh1202952.patch b/SOURCES/glibc-rh1202952.patch index 2dc4c506..fc41f3bb 100644 --- a/SOURCES/glibc-rh1202952.patch +++ b/SOURCES/glibc-rh1202952.patch @@ -1,12 +1,12 @@ -# +# # commit f8aeae347377f3dfa8cbadde057adf1827fb1d44 # Author: Alexandre Oliva # Date: Tue Mar 17 01:14:11 2015 -0300 -# +# # Fix DTV race, assert, DTV_SURPLUS Static TLS limit, and nptl_db garbage -# +# # for ChangeLog -# +# # [BZ #17090] # [BZ #17620] # [BZ #17621] @@ -51,14 +51,14 @@ # (td_mod_lookup): ... this declaration. # * nptl_db/db-symbols.awk (DB_RTLD_VARIABLE): Override. # (DB_MAIN_VARIABLE): Likewise. -# +# diff -urN glibc-2.17-c758a686/elf/dl-open.c glibc-2.17-c758a686/elf/dl-open.c --- glibc-2.17-c758a686/elf/dl-open.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/elf/dl-open.c 2015-03-17 14:39:47.746505786 -0400 @@ -535,17 +535,7 @@ - && imap->l_tls_blocksize > 0) - { - /* For static TLS we have to allocate the memory here and + && imap->l_tls_blocksize > 0) + { + /* For static TLS we have to allocate the memory here and - now. This includes allocating memory in the DTV. But we - cannot change any DTV other than our own. So, if we - cannot guarantee that there is room in the DTV we don't @@ -71,16 +71,16 @@ diff -urN glibc-2.17-c758a686/elf/dl-open.c glibc-2.17-c758a686/elf/dl-open.c -cannot load any more object with static TLS")); - + now, but we can delay updating the DTV. */ - imap->l_need_tls_init = 0; + imap->l_need_tls_init = 0; #ifdef SHARED - /* Update the slot information data for at least the + /* Update the slot information data for at least the diff -urN glibc-2.17-c758a686/elf/dl-reloc.c glibc-2.17-c758a686/elf/dl-reloc.c --- glibc-2.17-c758a686/elf/dl-reloc.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/elf/dl-reloc.c 2015-03-17 14:39:47.747505754 -0400 @@ -136,12 +136,6 @@ # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" #endif - + - /* Fill in the DTV slot so that a later LD/GD access will find it. */ - dtv_t *dtv = THREAD_DTV (); - assert (map->l_tls_modid <= dtv[-1].counter); @@ -89,19 +89,19 @@ diff -urN glibc-2.17-c758a686/elf/dl-reloc.c glibc-2.17-c758a686/elf/dl-reloc.c - /* Initialize the memory. */ memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), - '\0', map->l_tls_blocksize - map->l_tls_initimage_size); + '\0', map->l_tls_blocksize - map->l_tls_initimage_size); diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c --- glibc-2.17-c758a686/elf/dl-tls.c 2015-03-17 14:39:31.335019227 -0400 +++ glibc-2.17-c758a686/elf/dl-tls.c 2015-03-17 14:42:48.443852579 -0400 @@ -432,17 +432,14 @@ - assert (listp->slotinfo[cnt].gen <= GL(dl_tls_generation)); - maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); - + assert (listp->slotinfo[cnt].gen <= GL(dl_tls_generation)); + maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); + + dtv[map->l_tls_modid].pointer.val = TLS_DTV_UNALLOCATED; + dtv[map->l_tls_modid].pointer.is_static = false; + - if (map->l_tls_offset == NO_TLS_OFFSET - || map->l_tls_offset == FORCED_DYNAMIC_TLS_OFFSET) + if (map->l_tls_offset == NO_TLS_OFFSET + || map->l_tls_offset == FORCED_DYNAMIC_TLS_OFFSET) - { - /* For dynamically loaded modules we simply store - the value indicating deferred allocation. */ @@ -110,31 +110,31 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c - continue; - } + continue; - + - assert (map->l_tls_modid == cnt); + assert (map->l_tls_modid == total + cnt); - assert (map->l_tls_blocksize >= map->l_tls_initimage_size); + assert (map->l_tls_blocksize >= map->l_tls_initimage_size); #if TLS_TCB_AT_TP - assert ((size_t) map->l_tls_offset >= map->l_tls_blocksize); + assert ((size_t) map->l_tls_offset >= map->l_tls_blocksize); @@ -454,8 +451,6 @@ #endif - - /* Copy the initialization image and clear the BSS part. */ + + /* Copy the initialization image and clear the BSS part. */ - dtv[map->l_tls_modid].pointer.val = dest; - dtv[map->l_tls_modid].pointer.is_static = true; - memset (__mempcpy (dest, map->l_tls_initimage, - map->l_tls_initimage_size), '\0', - map->l_tls_blocksize - map->l_tls_initimage_size); + memset (__mempcpy (dest, map->l_tls_initimage, + map->l_tls_initimage_size), '\0', + map->l_tls_blocksize - map->l_tls_initimage_size); @@ -623,13 +618,16 @@ - struct link_map *map = listp->slotinfo[cnt].map; - if (map == NULL) - { + struct link_map *map = listp->slotinfo[cnt].map; + if (map == NULL) + { - /* If this modid was used at some point the memory - might still be allocated. */ - if (! dtv[total + cnt].pointer.is_static - && dtv[total + cnt].pointer.val != TLS_DTV_UNALLOCATED) + if (dtv[-1].counter >= total + cnt) - { + { - free (dtv[total + cnt].pointer.val); + /* If this modid was used at some point the memory + might still be allocated. */ @@ -142,27 +142,27 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c + && (dtv[total + cnt].pointer.val + != TLS_DTV_UNALLOCATED)) + free (dtv[total + cnt].pointer.val); - dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED; + dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED; + dtv[total + cnt].pointer.is_static = false; - } - - continue; + } + + continue; @@ -693,10 +691,8 @@ - memalign and not malloc. */ - free (dtv[modid].pointer.val); - + memalign and not malloc. */ + free (dtv[modid].pointer.val); + - /* This module is loaded dynamically- We defer memory - allocation. */ - dtv[modid].pointer.is_static = false; - dtv[modid].pointer.val = TLS_DTV_UNALLOCATED; + dtv[modid].pointer.val = TLS_DTV_UNALLOCATED; + dtv[modid].pointer.is_static = false; - - if (modid == req_modid) - the_map = map; + + if (modid == req_modid) + the_map = map; @@ -734,13 +730,12 @@ the_map = listp->slotinfo[idx].map; } - + - again: /* Make sure that, if a dlopen running in parallel forces the variable into static storage, we'll wait until the address in the @@ -176,13 +176,13 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c __rtld_lock_lock_recursive (GL(dl_load_lock)); if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1)) @@ -748,22 +743,28 @@ - the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET; - __rtld_lock_unlock_recursive (GL(dl_load_lock)); - } + the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET; + __rtld_lock_unlock_recursive (GL(dl_load_lock)); + } - else + else if (__glibc_likely (the_map->l_tls_offset + != FORCED_DYNAMIC_TLS_OFFSET)) - { + { +#if TLS_TCB_AT_TP + void *p = (char *) THREAD_SELF - the_map->l_tls_offset; +#elif TLS_DTV_AT_TP @@ -190,7 +190,7 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c +#else +# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" +#endif - __rtld_lock_unlock_recursive (GL(dl_load_lock)); + __rtld_lock_unlock_recursive (GL(dl_load_lock)); - if (__builtin_expect (the_map->l_tls_offset - != FORCED_DYNAMIC_TLS_OFFSET, 1)) - { @@ -199,11 +199,11 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c - goto again; + dtv[GET_ADDR_MODULE].pointer.is_static = true; + dtv[GET_ADDR_MODULE].pointer.val = p; - + - return (char *) p + GET_ADDR_OFFSET; - } + return (char *) p + GET_ADDR_OFFSET; - } + } + else + __rtld_lock_unlock_recursive (GL(dl_load_lock)); + @@ -211,7 +211,7 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c void *p = dtv[GET_ADDR_MODULE].pointer.val = allocate_and_init (the_map); - dtv[GET_ADDR_MODULE].pointer.is_static = false; + assert (!dtv[GET_ADDR_MODULE].pointer.is_static); - + return (char *) p + GET_ADDR_OFFSET; } diff -urN glibc-2.17-c758a686/elf/tlsdeschtab.h glibc-2.17-c758a686/elf/tlsdeschtab.h @@ -220,21 +220,21 @@ diff -urN glibc-2.17-c758a686/elf/tlsdeschtab.h glibc-2.17-c758a686/elf/tlsdesch @@ -42,7 +42,7 @@ return tdp->tlsinfo.ti_offset == tdq->tlsinfo.ti_offset; } - + -inline static int +inline static size_t map_generation (struct link_map *map) { size_t idx = map->l_tls_modid; @@ -58,7 +58,7 @@ - we can assume that, if the generation count is zero, we - still haven't determined the generation count for this - module. */ + we can assume that, if the generation count is zero, we + still haven't determined the generation count for this + module. */ - if (listp->slotinfo[idx].gen) + if (listp->slotinfo[idx].map == map && listp->slotinfo[idx].gen) - return listp->slotinfo[idx].gen; - else - break; + return listp->slotinfo[idx].gen; + else + break; diff -urN glibc-2.17-c758a686/nptl/allocatestack.c glibc-2.17-c758a686/nptl/allocatestack.c --- glibc-2.17-c758a686/nptl/allocatestack.c 2015-03-17 14:39:31.342019008 -0400 +++ glibc-2.17-c758a686/nptl/allocatestack.c 2015-03-17 14:39:47.747505754 -0400 @@ -249,7 +249,7 @@ diff -urN glibc-2.17-c758a686/nptl/allocatestack.c glibc-2.17-c758a686/nptl/allo @@ -1166,11 +1165,9 @@ # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" # endif - + - /* Fill in the DTV slot so that a later LD/GD access will find it. */ - dtv[map->l_tls_modid].pointer.val = dest; - dtv[map->l_tls_modid].pointer.is_static = true; @@ -259,27 +259,27 @@ diff -urN glibc-2.17-c758a686/nptl/allocatestack.c glibc-2.17-c758a686/nptl/allo + it can be accessed with LE or IE, but since the DTV is only used + by GD and LD, we can delay its update to avoid a race. */ memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), - '\0', map->l_tls_blocksize - map->l_tls_initimage_size); + '\0', map->l_tls_blocksize - map->l_tls_initimage_size); } diff -urN glibc-2.17-c758a686/nptl_db/db_info.c glibc-2.17-c758a686/nptl_db/db_info.c --- glibc-2.17-c758a686/nptl_db/db_info.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/nptl_db/db_info.c 2015-03-17 14:39:47.747505754 -0400 @@ -20,6 +20,7 @@ - + #include "thread_dbP.h" #include +#include - + typedef struct pthread pthread; typedef struct pthread_key_struct pthread_key_struct; @@ -36,6 +37,9 @@ } dtv; - + typedef struct link_map link_map; +typedef struct rtld_global rtld_global; +typedef struct dtv_slotinfo_list dtv_slotinfo_list; +typedef struct dtv_slotinfo dtv_slotinfo; - + /* Actually static in nptl/init.c, but we only need it for typeof. */ extern bool __nptl_initial_report_events; diff -urN glibc-2.17-c758a686/nptl_db/db-symbols.awk glibc-2.17-c758a686/nptl_db/db-symbols.awk @@ -287,7 +287,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/db-symbols.awk glibc-2.17-c758a686/nptl_db +++ glibc-2.17-c758a686/nptl_db/db-symbols.awk 2015-03-17 14:39:47.747505754 -0400 @@ -2,6 +2,8 @@ # we've just built. It checks for all the symbols used in td_symbol_list. - + BEGIN { +%define DB_RTLD_VARIABLE(name) /* Nothing. */ +%define DB_MAIN_VARIABLE(name) /* Nothing. */ @@ -298,9 +298,9 @@ diff -urN glibc-2.17-c758a686/nptl_db/fetch-value.c glibc-2.17-c758a686/nptl_db/ --- glibc-2.17-c758a686/nptl_db/fetch-value.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/nptl_db/fetch-value.c 2015-03-17 14:39:47.747505754 -0400 @@ -68,7 +68,8 @@ - } + } } - + - if (idx != 0 && idx - (psaddr_t) 0 > DB_DESC_NELEM (desc)) + if (idx != 0 && DB_DESC_NELEM (desc) != 0 + && idx - (psaddr_t) 0 > DB_DESC_NELEM (desc)) @@ -313,7 +313,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/structs.def glibc-2.17-c758a686/nptl_db/st @@ -22,6 +22,28 @@ # define STRUCTS_DEF_DEFAULTS 1 #endif - + +#ifndef DB_RTLD_VARIABLE +# define DB_RTLD_VARIABLE(name) DB_VARIABLE (name) +#endif @@ -341,10 +341,10 @@ diff -urN glibc-2.17-c758a686/nptl_db/structs.def glibc-2.17-c758a686/nptl_db/st DB_STRUCT_FIELD (pthread, report_events) @@ -70,14 +92,31 @@ DB_STRUCT_ARRAY_FIELD (pthread_key_data_level2, data) - + DB_STRUCT_FIELD (link_map, l_tls_modid) +DB_STRUCT_FIELD (link_map, l_tls_offset) - + DB_STRUCT_ARRAY_FIELD (dtv, dtv) #define pointer_val pointer.val /* Field of anonymous struct in dtv_t. */ DB_STRUCT_FIELD (dtv_t, pointer_val) @@ -352,7 +352,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/structs.def glibc-2.17-c758a686/nptl_db/st #if !defined IS_IN_libpthread || TLS_TCB_AT_TP DB_STRUCT_FIELD (pthread, dtvp) #endif - + +#if !(defined IS_IN_libpthread && !defined SHARED) +DB_STRUCT (rtld_global) +DB_RTLD_VARIABLE (_rtld_global) @@ -376,15 +376,15 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_symbol_list.c glibc-2.17-c758a686/nptl_ +++ glibc-2.17-c758a686/nptl_db/td_symbol_list.c 2015-03-17 14:39:47.747505754 -0400 @@ -18,7 +18,6 @@ . */ - + #include -#include #include "thread_dbP.h" - + static const char *symbol_list_arr[] = @@ -41,12 +40,12 @@ - - + + ps_err_e -td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr) +td_mod_lookup (struct ps_prochandle *ps, const char *mod, @@ -395,7 +395,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_symbol_list.c glibc-2.17-c758a686/nptl_ - result = ps_pglobal_lookup (ps, LIBPTHREAD_SO, symbol_list_arr[idx], - sym_addr); + result = ps_pglobal_lookup (ps, mod, symbol_list_arr[idx], sym_addr); - + #ifdef HAVE_ASM_GLOBAL_DOT_NAME /* For PowerPC, 64-bit uses dot symbols but 32-bit does not. diff -urN glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c @@ -403,10 +403,10 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c glibc-2.17-c758a686/nptl_ +++ glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c 2015-03-17 14:39:47.748505723 -0400 @@ -17,14 +17,118 @@ . */ - + #include "thread_dbP.h" +#include - + +/* Get the DTV slotinfo list head entry from the dynamic loader state + into *LISTHEAD. */ +static td_err_e @@ -512,19 +512,19 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c glibc-2.17-c758a686/nptl_ + available to the user of the debugger. */ td_err_e td_thr_tlsbase (const td_thrhandle_t *th, - unsigned long int modid, - psaddr_t *base) + unsigned long int modid, + psaddr_t *base) { td_err_e err; - psaddr_t dtv, dtvslot, dtvptr; + psaddr_t dtv, dtvslot, dtvptr, temp; - + if (modid < 1) return TD_NOTLS; @@ -50,11 +154,75 @@ - return TD_TLSDEFER; + return TD_TLSDEFER; } - + + err = dtv_slotinfo (th->th_ta_p, modid, &temp); + if (err != TD_OK) + return err; @@ -553,7 +553,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c glibc-2.17-c758a686/nptl_ err = DB_GET_FIELD (dtv, th->th_ta_p, pd, pthread, dtvp, 0); if (err != TD_OK) return err; - + + psaddr_t dtvgenloc; + /* Get the DTV generation count at dtv[0].counter. */ + err = DB_GET_FIELD_ADDRESS (dtvgenloc, th->th_ta_p, dtv, dtv, dtv, 0); @@ -603,7 +603,7 @@ diff -urN glibc-2.17-c758a686/nptl_db/td_thr_tlsbase.c glibc-2.17-c758a686/nptl_ if ((uintptr_t) dtvptr & 1) - return TD_TLSDEFER; + goto try_static_tls; - + *base = dtvptr; return TD_OK; diff -urN glibc-2.17-c758a686/nptl_db/thread_dbP.h glibc-2.17-c758a686/nptl_db/thread_dbP.h @@ -614,13 +614,13 @@ diff -urN glibc-2.17-c758a686/nptl_db/thread_dbP.h glibc-2.17-c758a686/nptl_db/t #include "../nptl/pthreadP.h" /* This is for *_BITMASK only. */ #include +#include - + /* Indeces for the symbol names. */ enum @@ -139,11 +140,11 @@ } - - + + -/* Internal wrapper around ps_pglobal_lookup. */ -extern ps_err_e td_lookup (struct ps_prochandle *ps, - int idx, psaddr_t *sym_addr) attribute_hidden; @@ -631,6 +631,6 @@ diff -urN glibc-2.17-c758a686/nptl_db/thread_dbP.h glibc-2.17-c758a686/nptl_db/t + int idx, psaddr_t *sym_addr) attribute_hidden; +#define td_lookup(ps, idx, sym_addr) \ + td_mod_lookup ((ps), LIBPTHREAD_SO, (idx), (sym_addr)) - - + + /* Store in psaddr_t VAR the address of inferior's symbol NAME. */ diff --git a/SOURCES/glibc-rh1207032.patch b/SOURCES/glibc-rh1207032.patch index 765fa474..7ddfb41c 100644 --- a/SOURCES/glibc-rh1207032.patch +++ b/SOURCES/glibc-rh1207032.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Tue May 19 06:40:37 2015 +0530 Avoid deadlock in malloc on backtrace (BZ #16159) - + When the malloc subsystem detects some kind of memory corruption, depending on the configuration it prints the error, a backtrace, a memory map and then aborts the process. In this process, the backtrace() call may result in a call to malloc, resulting in various kinds of problematic behavior. - + In one case, the malloc it calls may detect a corruption and call backtrace again, and a stack overflow may result due to the infinite recursion. In another case, the malloc it calls may deadlock on an @@ -17,33 +17,33 @@ Date: Tue May 19 06:40:37 2015 +0530 corruption. In yet another case, if the program is linked with pthreads, backtrace may do a pthread_once initialization, which deadlocks on itself. - + In all these cases, the program exit is not as intended. This is avoidable by marking the arena that malloc detected a corruption on, as unusable. The following patch does that. Features of this patch are as follows: - + - A flag is added to the mstate struct of the arena to indicate if the arena is corrupt. - + - The flag is checked whenever malloc functions try to get a lock on an arena. If the arena is unusable, a NULL is returned, causing the malloc to use mmap or try the next arena. - + - malloc_printerr sets the corrupt flag on the arena when it detects a corruption - + - free does not concern itself with the flag at all. It is not important since the backtrace workflow does not need free. A free in a parallel thread may cause another corruption, but that's not new - + - The flag check and set are not atomic and may race. This is fine since we don't care about contention during the flag check. We want to make sure that the malloc call in the backtrace does not trip on itself and all that action happens in the same thread and not across threads. - + I verified that the test case does not show any regressions due to this patch. I also ran the malloc benchmarks and found an insignificant difference in timings (< 2%). @@ -69,7 +69,7 @@ Index: b/malloc/arena.c --- a/malloc/arena.c +++ b/malloc/arena.c @@ -119,7 +119,7 @@ int __malloc_initialized = -1; - + #ifdef PER_THREAD # define arena_lock(ptr, size) do { \ - if(ptr) \ @@ -83,13 +83,13 @@ Index: b/malloc/arena.c { - if (!mutex_trylock(&result->mutex)) + if (!arena_is_corrupt (result) && !mutex_trylock(&result->mutex)) - goto out; - + goto out; + result = result->next; @@ -820,7 +820,21 @@ reused_arena (mstate avoid_arena) if (result == avoid_arena) result = result->next; - + - /* No arena available. Wait for the next in line. */ + /* Make sure that the arena we get is not corrupted. */ + mstate begin = result; @@ -108,7 +108,7 @@ Index: b/malloc/arena.c + /* No arena available without contention. Wait for the next in line. */ LIBC_PROBE (memory_arena_reuse_wait, 3, &result->mutex, result, avoid_arena); (void)mutex_lock(&result->mutex); - + Index: b/malloc/hooks.c =================================================================== --- a/malloc/hooks.c @@ -125,18 +125,18 @@ Index: b/malloc/hooks.c } @@ -221,7 +222,8 @@ top_check(void) return 0; - + mutex_unlock(&main_arena); - malloc_printerr (check_action, "malloc: top chunk is corrupt", t); + malloc_printerr (check_action, "malloc: top chunk is corrupt", t, + &main_arena); mutex_lock(&main_arena); - + /* Try to set up a new top chunk. */ @@ -276,7 +278,8 @@ free_check(void* mem, const void *caller if(!p) { (void)mutex_unlock(&main_arena.mutex); - + - malloc_printerr(check_action, "free(): invalid pointer", mem); + malloc_printerr(check_action, "free(): invalid pointer", mem, + &main_arena); @@ -165,18 +165,18 @@ Index: b/malloc/Makefile + tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ + tst-malloc-usable tst-malloc-backtrace test-srcs = tst-mtrace - + routines = malloc morecore mcheck mtrace obstack @@ -40,6 +41,9 @@ extra-libs-others = $(extra-libs) libmemusage-routines = memusage libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes)) - + +$(objpfx)tst-malloc-backtrace: $(common-objpfx)nptl/libpthread.so \ + $(common-objpfx)nptl/libpthread_nonshared.a + # These should be removed by `make clean'. extra-objs = mcheck-init.o libmcheck.a - + Index: b/malloc/malloc.c =================================================================== --- a/malloc/malloc.c @@ -187,7 +187,7 @@ Index: b/malloc/malloc.c static void* _int_pvalloc(mstate, size_t); -static void malloc_printerr(int action, const char *str, void *ptr); +static void malloc_printerr(int action, const char *str, void *ptr, mstate av); - + static void* internal_function mem2mem_check(void *p, size_t sz); static int internal_function top_check(void); @@ -1430,7 +1430,8 @@ typedef struct malloc_chunk* mbinptr; @@ -203,7 +203,7 @@ Index: b/malloc/malloc.c @@ -1670,6 +1671,15 @@ typedef struct malloc_chunk* mfastbinptr #define set_noncontiguous(M) ((M)->flags |= NONCONTIGUOUS_BIT) #define set_contiguous(M) ((M)->flags &= ~NONCONTIGUOUS_BIT) - + +/* ARENA_CORRUPTION_BIT is set if a memory corruption was detected on the + arena. Such an arena is no longer used to allocate chunks. Chunks + allocated in that arena before detecting corruption are not freed. */ @@ -219,25 +219,25 @@ Index: b/malloc/malloc.c @@ -2281,8 +2291,9 @@ static void* sysmalloc(INTERNAL_SIZE_T n rather than expanding top. */ - + - if ((unsigned long)(nb) >= (unsigned long)(mp_.mmap_threshold) && - (mp_.n_mmaps < mp_.n_mmaps_max)) { + if (av == NULL + || ((unsigned long) (nb) >= (unsigned long) (mp_.mmap_threshold) + && (mp_.n_mmaps < mp_.n_mmaps_max))) { - + char* mm; /* return value from mmap call*/ - + @@ -2354,6 +2365,10 @@ static void* sysmalloc(INTERNAL_SIZE_T n } } - + + /* There are no usable arenas and mmap also failed. */ + if (av == NULL) + return 0; + /* Record incoming configuration of top */ - + old_top = av->top; @@ -2519,7 +2534,7 @@ static void* sysmalloc(INTERNAL_SIZE_T n else if (contiguous(av) && old_size && brk < old_end) { @@ -247,7 +247,7 @@ Index: b/malloc/malloc.c + malloc_printerr (3, "break adjusted to free malloc space", brk, av); mutex_lock(&av->mutex); } - + @@ -2793,7 +2808,7 @@ munmap_chunk(mchunkptr p) if (__builtin_expect (((block | total_size) & (GLRO(dl_pagesize) - 1)) != 0, 0)) { @@ -256,14 +256,14 @@ Index: b/malloc/malloc.c + chunk2mem (p), NULL); return; } - + @@ -2861,21 +2876,20 @@ __libc_malloc(size_t bytes) if (__builtin_expect (hook != NULL, 0)) return (*hook)(bytes, RETURN_ADDRESS (0)); - + - arena_lookup(ar_ptr); + arena_get(ar_ptr, bytes); - + - arena_lock(ar_ptr, bytes); - if(!ar_ptr) - return 0; @@ -286,12 +286,12 @@ Index: b/malloc/malloc.c (void)mutex_unlock(&ar_ptr->mutex); + assert(!victim || chunk_is_mmapped(mem2chunk(victim)) || - ar_ptr == arena_for_chunk(mem2chunk(victim))); + ar_ptr == arena_for_chunk(mem2chunk(victim))); return victim; @@ -2946,6 +2960,11 @@ __libc_realloc(void* oldmem, size_t byte /* its size */ const INTERNAL_SIZE_T oldsize = chunksize(oldp); - + + if (chunk_is_mmapped (oldp)) + ar_ptr = NULL; + else @@ -309,18 +309,18 @@ Index: b/malloc/malloc.c + ar_ptr); return NULL; } - + @@ -2977,7 +2997,6 @@ __libc_realloc(void* oldmem, size_t byte return newmem; } - + - ar_ptr = arena_for_chunk(oldp); #if THREAD_STATS if(!mutex_trylock(&ar_ptr->mutex)) ++(ar_ptr->stat_lock_direct); @@ -3043,18 +3062,17 @@ __libc_memalign(size_t alignment, size_t } - + arena_get(ar_ptr, bytes + alignment + MINSIZE); - if(!ar_ptr) - return 0; @@ -342,11 +342,11 @@ Index: b/malloc/malloc.c (void)mutex_unlock(&ar_ptr->mutex); + assert(!p || chunk_is_mmapped(mem2chunk(p)) || - ar_ptr == arena_for_chunk(mem2chunk(p))); + ar_ptr == arena_for_chunk(mem2chunk(p))); return p; @@ -3088,18 +3106,16 @@ __libc_valloc(size_t bytes) return (*hook)(pagesz, bytes, RETURN_ADDRESS (0)); - + arena_get(ar_ptr, bytes + pagesz + MINSIZE); - if(!ar_ptr) - return 0; @@ -367,10 +367,10 @@ Index: b/malloc/malloc.c (void)mutex_unlock (&ar_ptr->mutex); + assert(!p || chunk_is_mmapped(mem2chunk(p)) || - ar_ptr == arena_for_chunk(mem2chunk(p))); - + ar_ptr == arena_for_chunk(mem2chunk(p))); + @@ -3134,15 +3150,15 @@ __libc_pvalloc(size_t bytes) - + arena_get(ar_ptr, bytes + 2*pagesz + MINSIZE); p = _int_pvalloc(ar_ptr, bytes); - if(!p) { @@ -389,17 +389,17 @@ Index: b/malloc/malloc.c (void)mutex_unlock(&ar_ptr->mutex); + assert(!p || chunk_is_mmapped(mem2chunk(p)) || - ar_ptr == arena_for_chunk(mem2chunk(p))); - + ar_ptr == arena_for_chunk(mem2chunk(p))); + @@ -3184,43 +3200,54 @@ __libc_calloc(size_t n, size_t elem_size sz = bytes; - + arena_get(av, sz); - if(!av) - return 0; + if(av) + { - + - /* Check if we hand out the top chunk, in which case there may be no - need to clear. */ + /* Check if we hand out the top chunk, in which case there may be no @@ -442,11 +442,11 @@ Index: b/malloc/malloc.c + oldtopsize = 0; + } mem = _int_malloc(av, sz); - - + + assert(!mem || chunk_is_mmapped(mem2chunk(mem)) || - av == arena_for_chunk(mem2chunk(mem))); - + av == arena_for_chunk(mem2chunk(mem))); + - if (mem == 0) { + if (mem == 0 && av != NULL) { LIBC_PROBE (memory_calloc_retry, 1, sz); @@ -468,12 +468,12 @@ Index: b/malloc/malloc.c + return 0; + p = mem2chunk(mem); - + /* Two optional cases in which clearing not necessary */ @@ -3310,6 +3337,16 @@ _int_malloc(mstate av, size_t bytes) - + checked_request2size(bytes, nb); - + + /* There are no usable arenas. Fall back to sysmalloc to get a chunk from + mmap. */ + if (__glibc_unlikely (av == NULL)) @@ -488,34 +488,34 @@ Index: b/malloc/malloc.c If the size qualifies as a fastbin, first check corresponding bin. This code is safe to execute even if av is not yet initialized, so we @@ -3334,7 +3371,7 @@ _int_malloc(mstate av, size_t bytes) - errstr = "malloc(): memory corruption (fast)"; - errout: - mutex_unlock(&av->mutex); + errstr = "malloc(): memory corruption (fast)"; + errout: + mutex_unlock(&av->mutex); - malloc_printerr (check_action, errstr, chunk2mem (victim)); + malloc_printerr (check_action, errstr, chunk2mem (victim), av); - mutex_lock(&av->mutex); - return NULL; - } + mutex_lock(&av->mutex); + return NULL; + } @@ -3421,9 +3458,9 @@ _int_malloc(mstate av, size_t bytes) if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0) - || __builtin_expect (victim->size > av->system_mem, 0)) - { + || __builtin_expect (victim->size > av->system_mem, 0)) + { - void *p = chunk2mem(victim); - mutex_unlock(&av->mutex); + mutex_unlock(&av->mutex); - malloc_printerr (check_action, "malloc(): memory corruption", p); + malloc_printerr (check_action, "malloc(): memory corruption", + chunk2mem (victim), av); - mutex_lock(&av->mutex); - } + mutex_lock(&av->mutex); + } size = chunksize(victim); @@ -3801,7 +3838,7 @@ _int_free(mstate av, mchunkptr p, int ha errout: if (have_lock || locked) - (void)mutex_unlock(&av->mutex); + (void)mutex_unlock(&av->mutex); - malloc_printerr (check_action, errstr, chunk2mem(p)); + malloc_printerr (check_action, errstr, chunk2mem(p), av); if (have_lock) - mutex_lock(&av->mutex); + mutex_lock(&av->mutex); return; @@ -4196,7 +4233,7 @@ _int_realloc(mstate av, mchunkptr oldp, errstr = "realloc(): invalid old size"; @@ -534,10 +534,10 @@ Index: b/malloc/malloc.c + if (av && have_fastchunks(av)) malloc_consolidate(av); return _int_memalign(av, GLRO(dl_pagesize), bytes); } - + @@ -4451,7 +4488,7 @@ _int_pvalloc(mstate av, size_t bytes) size_t pagesz; - + /* Ensure initialization/consolidation */ - if (have_fastchunks(av)) malloc_consolidate(av); + if (av && have_fastchunks(av)) malloc_consolidate(av); @@ -545,7 +545,7 @@ Index: b/malloc/malloc.c return _int_memalign(av, pagesz, (bytes + pagesz - 1) & ~(pagesz - 1)); } @@ -4463,6 +4500,10 @@ _int_pvalloc(mstate av, size_t bytes) - + static int mtrim(mstate av, size_t pad) { + /* Don't touch corrupt arenas. */ @@ -554,10 +554,10 @@ Index: b/malloc/malloc.c + /* Ensure initialization/consolidation */ malloc_consolidate (av); - + @@ -4956,8 +4997,14 @@ libc_hidden_def (__libc_mallopt) extern char **__libc_argv attribute_hidden; - + static void -malloc_printerr(int action, const char *str, void *ptr) +malloc_printerr(int action, const char *str, void *ptr, mstate ar_ptr) diff --git a/SOURCES/glibc-rh1211100.patch b/SOURCES/glibc-rh1211100.patch index 70154cc5..63bb49d1 100644 --- a/SOURCES/glibc-rh1211100.patch +++ b/SOURCES/glibc-rh1211100.patch @@ -10,18 +10,18 @@ Index: b/elf/Makefile +++ b/elf/Makefile @@ -119,7 +119,8 @@ $(inst_auditdir)/sotruss-lib.so: $(objpf endif - + tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \ - tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 + tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \ + tst-audit11 tst-audit12 tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static \ - tst-leaks1-static tst-array1-static tst-array5-static \ - tst-ptrguard1-static + tst-leaks1-static tst-array1-static tst-array5-static \ + tst-ptrguard1-static @@ -216,7 +217,9 @@ modules-names = testobj1 testobj2 testob - tst-initorder2a tst-initorder2b tst-initorder2c \ - tst-initorder2d \ - tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ + tst-initorder2a tst-initorder2b tst-initorder2c \ + tst-initorder2d \ + tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ - tst-array5dep + tst-array5dep \ + tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \ @@ -30,9 +30,9 @@ Index: b/elf/Makefile modules-names += tst-piemod1 tests += tst-pie1 @@ -1210,3 +1213,15 @@ $(objpfx)tst-unused-dep.out: $(objpfx)te - --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ - $< > $@ - cmp $@ /dev/null > /dev/null + --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ + $< > $@ + cmp $@ /dev/null > /dev/null + +$(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so +$(objpfx)tst-audit11: $(libdl) @@ -66,7 +66,7 @@ Index: b/elf/dl-load.c @@ -1582,6 +1583,17 @@ cannot enable executable stack as shared l->l_dev = st.st_dev; l->l_ino = st.st_ino; - + +#ifdef SHARED + /* When auditing is used the recorded names might not include the + name by which the DSO is actually known. Add that as well. */ @@ -82,7 +82,7 @@ Index: b/elf/dl-load.c loading. Add it right away. */ if (__builtin_expect (GLRO(dl_profile) != NULL, 0) @@ -2081,6 +2093,7 @@ _dl_map_object (struct link_map *loader, - int type, int trace_mode, int mode, Lmid_t nsid) + int type, int trace_mode, int mode, Lmid_t nsid) { int fd; + const char *origname = NULL; @@ -90,17 +90,17 @@ Index: b/elf/dl-load.c char *name_copy; struct link_map *l; @@ -2144,6 +2157,7 @@ _dl_map_object (struct link_map *loader, - { - if (afct->objsearch != NULL) - { + { + if (afct->objsearch != NULL) + { + const char *before = name; - name = afct->objsearch (name, &loader->l_audit[cnt].cookie, - LA_SER_ORIG); - if (name == NULL) + name = afct->objsearch (name, &loader->l_audit[cnt].cookie, + LA_SER_ORIG); + if (name == NULL) @@ -2152,6 +2166,15 @@ _dl_map_object (struct link_map *loader, - fd = -1; - goto no_file; - } + fd = -1; + goto no_file; + } + if (before != name && strcmp (before, name) != 0) + { + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) @@ -110,20 +110,20 @@ Index: b/elf/dl-load.c + if (origname == NULL) + origname = before; + } - } - - afct = afct->next; + } + + afct = afct->next; @@ -2371,8 +2394,8 @@ _dl_map_object (struct link_map *loader, } - + void *stack_end = __libc_stack_end; - return _dl_map_object_from_fd (name, fd, &fb, realname, loader, type, mode, - &stack_end, nsid); + return _dl_map_object_from_fd (name, origname, fd, &fb, realname, loader, + type, mode, &stack_end, nsid); } - - + + Index: b/elf/tst-audit11.c =================================================================== --- /dev/null @@ -512,11 +512,11 @@ Index: b/sysdeps/mach/hurd/dl-sysdep.c --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -187,7 +187,7 @@ unfmh(); /* XXX */ - assert_perror (err); - - lastslash = strrchr (p, '/'); + assert_perror (err); + + lastslash = strrchr (p, '/'); - l = _dl_map_object_from_fd (lastslash ? lastslash + 1 : p, + l = _dl_map_object_from_fd (lastslash ? lastslash + 1 : p, NULL, - memobj, strdup (p), 0); - - /* Squirrel away the memory object port where it + memobj, strdup (p), 0); + + /* Squirrel away the memory object port where it diff --git a/SOURCES/glibc-rh1211823.patch b/SOURCES/glibc-rh1211823.patch index 84f4d668..007b7d74 100644 --- a/SOURCES/glibc-rh1211823.patch +++ b/SOURCES/glibc-rh1211823.patch @@ -30,14 +30,14 @@ index 18e413d..5487323 100644 +++ b/iconvdata/big5hkscs.c @@ -29,8 +29,7 @@ /* Table for Big5 to UCS conversion. - + With HKSCS mappings 0x8140-0xA0FE and 0xFA40-0xFEFE added; more info: - http://www.digital21.gov.hk/eng/hkscs/index.html - - spacehunt 07/01/2000 + http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/hkscs/ - + Using the charmap: - + @@ -43,7 +42,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ while (<>) { @@ -9206,8 +9206,8 @@ index 18e413d..5487323 100644 + [23389] = 0x79A9, [23390] = 0x6E2A, [23391] = 0x27126, [23392] = 0x3EA8, + [23393] = 0x79C6, [23394] = 0x2910D, [23395] = 0x79D4 }; - - + + @@ -4636,7 +4711,7 @@ static const uint32_t big5hkscs_to_ucs[] = } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -9220,7 +9220,7 @@ index 18e413d..5487323 100644 @@ -4895,6 +4970,8 @@ static const char from_ucs4[][2] = /* 0x22b5 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x22ba */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\xa1\xe9", - + + /* 0x23da */ "\x88\xa9", "\x88\xaa", + /* 0x2460 */ "\xc6\xa1", "\xc6\xa2", "\xc6\xa3", "\xc6\xa4", "\xc6\xa5", @@ -9229,7 +9229,7 @@ index 18e413d..5487323 100644 @@ -5068,29 +5145,52 @@ static const char from_ucs4[][2] = /* 0x3122 */ "\xa3\xb3", "\xa3\xb4", "\xa3\xb5", "\xa3\xb6", "\xa3\xb7", /* 0x3127 */ "\xa3\xb8", "\xa3\xb9", "\xa3\xba", - + - /* 0x3231 */ "\xc8\xd1", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x3235 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x323a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -9299,7 +9299,7 @@ index 18e413d..5487323 100644 + /* 0x3296 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x329b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x32a0 */ "\x00\x00", "\x00\x00", "\xa1\xc0", - + /* 0x338e */ "\xa2\x55", "\xa2\x56", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x3392 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -5129,7 +5229,7 @@ static const char from_ucs4[][2] = @@ -11498,7 +11498,7 @@ index 18e413d..5487323 100644 + /* 0x9fbc */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x9fc1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x9fc7 */ "\x87\xc2", "\x87\xd2", "\x87\xd6", "\x87\xda", "\x87\xdf", - + - /* 0xf303 */ "\x88\x40", "\x88\x41", "\x88\x42", "\x88\x43", "\x88\x44", - /* 0xf308 */ "\x88\x45", "\x88\x46", "\x88\x47", "\x88\x48", "\x88\x49", - /* 0xf30d */ "\x88\x4a", "\x88\x4b", "\x88\x4c", "\x88\x4d", "\x88\x4e", @@ -11630,13 +11630,13 @@ index 18e413d..5487323 100644 - /* 0xf7e5 */ "\xc8\x79", "\xc8\x7a", "\x00\x00", "\xc8\x7c", "\x00\x00", - /* 0xf7ea */ "\xc8\x7e", "\xc8\xa1", "\x00\x00", "\xc8\xa3", "\xc8\xa4", + /* 0xf907 */ "\x8b\xf8", - + /* 0xfa0c */ "\xc9\x4a", "\xdd\xfc", - + @@ -11534,258 +10801,304 @@ static const char from_ucs4[][2] = /* 0xffe6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0xffeb */ "\x00\x00", "\xf9\xfe", - + - /* 0x2003e */ "\x93\x75", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x20042 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x93\x76", "\x00\x00", - /* 0x20047 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -11698,7 +11698,7 @@ index 18e413d..5487323 100644 + /* 0x2010c */ "\x88\x45", "\x00\x00", "\x88\x53", "\x00\x00", "\x00\x00", /* 0x20110 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x20115 */ "\x00\x00", "\x00\x00", "\xfc\xad", - + - /* 0x201ab */ "\x92\x72", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x201af */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x201b4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -12178,7 +12178,7 @@ index 18e413d..5487323 100644 + /* 0x20667 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2066c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x20671 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x9a\xc0", - + /* 0x2070e */ "\x92\xc3", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x20712 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -11794,7 +11107,7 @@ static const char from_ucs4[][2] = @@ -12343,7 +12343,7 @@ index 18e413d..5487323 100644 + /* 0x20b00 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x20b05 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x20b0a */ "\x00\x00", "\x00\x00", "\x8e\xef", - + /* 0x20b8f */ "\xfa\xe9", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x20b93 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x20b98 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -13015,7 +13015,7 @@ index 18e413d..5487323 100644 + /* 0x21a57 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x21a5c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x21a61 */ "\x00\x00", "\x87\x61", - + - /* 0x21596 */ "\xfa\xd6", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2159a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2159f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -13335,7 +13335,7 @@ index 18e413d..5487323 100644 + /* 0x21ca2 */ "\x9e\x79", "\x00\x00", "\x00\x00", "\xfb\xd9", "\x00\x00", + /* 0x21ca6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x21cac */ "\x9b\x44", - + /* 0x21d46 */ "\xa0\xa7", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x21d4a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x21d4f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -13678,9 +13678,9 @@ index 18e413d..5487323 100644 + /* 0x2226d */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x22272 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x22277 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x9b\x4e", - + /* 0x22321 */ "\x95\xd0", "\x00\x00", "\x00\x00", "\x00\x00", "\x90\x5f", - + @@ -12791,257 +12381,336 @@ static const char from_ucs4[][2] = /* 0x223c1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x223c6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -13980,7 +13980,7 @@ index 18e413d..5487323 100644 + /* 0x22984 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x22989 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2298e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x9b\x56", - + - /* 0x22465 */ "\x9e\xc6", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x22469 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2246e */ "\x00\x00", "\x00\x00", "\xfc\x50", "\x00\x00", "\x00\x00", @@ -14412,7 +14412,7 @@ index 18e413d..5487323 100644 + /* 0x22ee3 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x22ee8 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x22eed */ "\x00\x00", "\x8f\x5f", - + - /* 0x22fe3 */ "\x97\xec", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x22fe7 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x22fec */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -14763,7 +14763,7 @@ index 18e413d..5487323 100644 + /* 0x23310 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x23315 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2331a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x9b\x6e", - + /* 0x233b4 */ "\xfa\x70", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x233b8 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x233bd */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -14921,7 +14921,7 @@ index 18e413d..5487323 100644 + /* 0x2382c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x23831 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x23836 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x93\xde", - + - /* 0x23adb */ "\xfd\x69", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x23adf */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x23ae4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -15405,7 +15405,7 @@ index 18e413d..5487323 100644 - /* 0x24571 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x24576 */ "\x00\x00", "\x8e\x77", + /* 0x239c2 */ "\x8a\xcf", - + - /* 0x2462a */ "\x93\xe6", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2462e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x24633 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -15514,7 +15514,7 @@ index 18e413d..5487323 100644 + /* 0x23b4b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x23b50 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x23b55 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\xfd\x6e", - + - /* 0x24823 */ "\xfe\x54", - - /* 0x248f3 */ "\x94\xa5", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -16390,7 +16390,7 @@ index 18e413d..5487323 100644 + /* 0x24b62 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x24b67 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x24b6c */ "\x00\x00", "\x9e\xbe", - + /* 0x24bf5 */ "\xfb\x6d", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x24bf9 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -14269,7 +14158,7 @@ static const char from_ucs4[][2] = @@ -16409,7 +16409,7 @@ index 18e413d..5487323 100644 + /* 0x24d06 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x24d0b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x24d10 */ "\x00\x00", "\x00\x00", "\xfe\xb7", - + /* 0x24db8 */ "\x8a\x4b", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x24dbc */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -14309,375 +14201,529 @@ static const char from_ucs4[][2] = @@ -16626,7 +16626,7 @@ index 18e413d..5487323 100644 + /* 0x25091 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25096 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2509b */ "\x00\x00", "\xfe\xce", - + - /* 0x252c7 */ "\x8a\x6f", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x252cb */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x252d0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -16741,7 +16741,7 @@ index 18e413d..5487323 100644 + /* 0x25305 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2530a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x8e\x5f", "\x00\x00", + /* 0x2530f */ "\x00\x00", "\x9d\xcb", "\x00\x00", "\xfc\xe7", - + - /* 0x25425 */ "\x93\xc8", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x25429 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2542f */ "\x91\xf0", "\x8f\xe0", "\x00\x00", "\x00\x00", "\x00\x00", @@ -16783,7 +16783,7 @@ index 18e413d..5487323 100644 + /* 0x2548b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25490 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25495 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x8d\x53", - + - /* 0x2555b */ "\x93\xc7", "\x92\x49", "\x96\xe1", "\x00\x00", "\x00\x00", - /* 0x2555f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x25565 */ "\x8f\xe1", "\x9b\xe5", "\x00\x00", "\x00\x00", "\x00\x00", @@ -17242,7 +17242,7 @@ index 18e413d..5487323 100644 + /* 0x259bd */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x259c2 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x259c7 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\xfb\xcf", - + - /* 0x25a9c */ "\x94\xe5", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x25aa0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x25aa5 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -17289,7 +17289,7 @@ index 18e413d..5487323 100644 + /* 0x25ada */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25adf */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25ae4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x95\x51", - + /* 0x25b74 */ "\x8b\xbb", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x25b78 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x25b7d */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -17516,7 +17516,7 @@ index 18e413d..5487323 100644 + /* 0x25f3d */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25f42 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x25f47 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x91\xf8", - + /* 0x25fe1 */ "\x94\x62", "\x9b\xa4", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x25fe5 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -14844,7 +14929,7 @@ static const char from_ucs4[][2] = @@ -17682,7 +17682,7 @@ index 18e413d..5487323 100644 /* 0x2661b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x26620 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x26626 */ "\x8e\xd9", - + /* 0x266af */ "\x9d\xb4", "\x00\x00", "\x92\x5f", "\x00\x00", "\x00\x00", - /* 0x266b3 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x266b3 */ "\x00\x00", "\x9c\x4c", "\x00\x00", "\x00\x00", "\x00\x00", @@ -17928,7 +17928,7 @@ index 18e413d..5487323 100644 + /* 0x26a46 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x26a4b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x26a51 */ "\x95\x6d", "\x8e\xf0", - + + /* 0x26b05 */ "\x8f\x4d", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x26b0a */ "\x8e\xf6", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x26b0e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -18274,7 +18274,7 @@ index 18e413d..5487323 100644 + /* 0x27478 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2747d */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x27482 */ "\x00\x00", "\x97\xb6", "\x00\x00", "\xa0\xbd", - + - /* 0x2739a */ "\x8f\xae", + /* 0x27574 */ "\x8a\xdf", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x27578 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -18397,7 +18397,7 @@ index 18e413d..5487323 100644 + /* 0x277c1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x277c6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x277cc */ "\x9c\xc3", - + - /* 0x27422 */ "\x95\x7d", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x27426 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2742b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -18741,7 +18741,7 @@ index 18e413d..5487323 100644 + /* 0x27b59 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x27b5e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x27b63 */ "\x00\x00", "\x87\xca", - + + /* 0x27bef */ "\x87\x6c", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x27bf4 */ "\x97\xf3", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x27bf8 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -18830,11 +18830,11 @@ index 18e413d..5487323 100644 @@ -15853,121 +16319,191 @@ static const char from_ucs4[][2] = /* 0x27e46 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x27e4b */ "\x00\x00", "\x98\x6a", "\x00\x00", "\x97\xcf", - + - /* 0x28002 */ "\x90\x41", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28006 */ "\x00\x00", "\x00\x00", "\x9c\xdb", + /* 0x27f2e */ "\x9e\xe5", - + - /* 0x280bd */ "\x8b\x62", "\x8a\x4e", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x280c1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x280c6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19130,7 +19130,7 @@ index 18e413d..5487323 100644 + /* 0x2837d */ "\x9f\xf5", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28381 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28386 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9d\x45", - + /* 0x28412 */ "\x90\x4f", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x28416 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -15986,73 +16522,143 @@ static const char from_ucs4[][2] = @@ -19339,13 +19339,13 @@ index 18e413d..5487323 100644 + /* 0x28704 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28709 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2870f */ "\x8c\x5c", "\x00\x00", "\x00\x00", "\x00\x00", "\x90\x69", - + /* 0x28804 */ "\xfe\x57", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x28808 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -16063,574 +16669,941 @@ static const char from_ucs4[][2] = /* 0x28821 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x28826 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\xfe\x55", - + - /* 0x28933 */ "\x90\x73", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28937 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2893c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19664,7 +19664,7 @@ index 18e413d..5487323 100644 + /* 0x28c2c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9c\xec", "\x00\x00", + /* 0x28c31 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28c36 */ "\x00\x00", "\x00\x00", "\x90\xad", "\x00\x00", "\x95\xe3", - + - /* 0x28ccd */ "\x8a\xe3", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28cd1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28cd6 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19795,7 +19795,7 @@ index 18e413d..5487323 100644 + /* 0x28edb */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28ee0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x28ee5 */ "\x00\x00", "\x95\xf3", - + - /* 0x28e36 */ "\x91\xd9", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28e3a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28e3f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19830,7 +19830,7 @@ index 18e413d..5487323 100644 - /* 0x28ed0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x28ed5 */ "\x00\x00", "\x00\x00", "\x00\x00", "\xfe\xac", + /* 0x28fc5 */ "\x9d\x58", - + - /* 0x2908b */ "\x91\xc5", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2908f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x29094 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19933,7 +19933,7 @@ index 18e413d..5487323 100644 + /* 0x291e0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x291e5 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x291eb */ "\x90\xe0", - + - /* 0x2919c */ "\xfd\x60", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x291a0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x291a5 */ "\x00\x00", "\x00\x00", "\x9c\xcf", "\x00\x00", "\x00\x00", @@ -19962,14 +19962,14 @@ index 18e413d..5487323 100644 + /* 0x2943a */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x93\xbd", /* 0x2943f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x29444 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x95\xb7", - + - /* 0x294d9 */ "\x8e\x4b", "\x96\x58", + /* 0x294d0 */ "\x9f\x46", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x294d4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x8e\x4b", + /* 0x294da */ "\x96\x58", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x294de */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x294e3 */ "\x00\x00", "\x8a\x4c", "\x00\x00", "\x9d\x63", - + /* 0x2959e */ "\x9e\xcf", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x295a2 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x295a7 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -19997,7 +19997,7 @@ index 18e413d..5487323 100644 + /* 0x29724 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29729 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2972e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9d\x67", - + - /* 0x29857 */ "\x91\x50", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2985b */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x29860 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20191,12 +20191,12 @@ index 18e413d..5487323 100644 + /* 0x29a3f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29a44 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29a49 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x8a\x65", - + /* 0x29b05 */ "\x91\x5d", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x29b09 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x9d\x6d", - + /* 0x29bd5 */ "\x91\x5a", - + - /* 0x29cad */ "\x9c\xc0", + /* 0x29c73 */ "\x8c\x42", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29c77 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20210,7 +20210,7 @@ index 18e413d..5487323 100644 + /* 0x29c9f */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29ca4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29ca9 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9c\xc0", - + /* 0x29d3e */ "\x91\x6a", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x29d42 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x29d47 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20472,7 +20472,7 @@ index 18e413d..5487323 100644 + /* 0x29f23 */ "\x9d\x72", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29f27 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29f2c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9e\xcc", - + + /* 0x29fb7 */ "\x91\x74", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29fbb */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x29fc0 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20676,7 +20676,7 @@ index 18e413d..5487323 100644 + /* 0x2a39e */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a3a3 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x2a3a9 */ "\x89\x40", - + - /* 0x2a5c6 */ "\x94\x78", + /* 0x2a434 */ "\x9e\xec", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a438 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20686,7 +20686,7 @@ index 18e413d..5487323 100644 + /* 0x2a44c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a451 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a456 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x93\xaa", - + - /* 0x2a6a9 */ "\x9e\x75", + /* 0x2a5c6 */ "\x94\x78", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a5cb */ "\x9d\x7a", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20734,7 +20734,7 @@ index 18e413d..5487323 100644 + /* 0x2a69c */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a6a1 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2a6a6 */ "\x00\x00", "\x00\x00", "\x9e\x75", - + - /* 0x2f840 */ "\xa0\x47", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2f844 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", - /* 0x2f849 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -20800,7 +20800,7 @@ index 18e413d..5487323 100644 + /* 0x2f8bf */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2f8c4 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", + /* 0x2f8c9 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x9c\x52", - + /* 0x2f994 */ "\x8e\xfd", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", /* 0x2f998 */ "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", "\x00\x00", @@ -16638,9 +17611,9 @@ static const char from_ucs4[][2] = @@ -20983,7 +20983,7 @@ index 18e413d..5487323 100644 + { 0x2f825, 0x2f8cd, 63831 }, + { 0x2f994, 0x2f9d4, 64000 } }; - + /* Definitions used in the body of the `gconv' function. */ @@ -16800,57 +17738,168 @@ static struct #define TO_LOOP to_big5hkscs @@ -21054,8 +21054,8 @@ index 18e413d..5487323 100644 + status = __GCONV_FULL_OUTPUT; \ + } \ + } - - + + /* First define the conversion function from Big5 to UCS4. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -21069,7 +21069,7 @@ index 18e413d..5487323 100644 { \ - uint32_t ch = *inptr; \ + uint32_t ch; \ - \ + \ - if (ch >= 0x81 && ch <= 0xfe) \ + /* Determine whether there is a buffered character pending. */ \ + ch = *statep >> 3; \ @@ -21081,10 +21081,10 @@ index 18e413d..5487323 100644 - int idx; \ + /* No - so look at the next input byte. */ \ + ch = *inptr; \ - \ + \ - if (__builtin_expect (inptr + 1 >= inend, 0)) \ + if (ch >= 0x81 && ch <= 0xfe) \ - { \ + { \ - /* The second character is not available. */ \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ @@ -21093,7 +21093,7 @@ index 18e413d..5487323 100644 + is also available. */ \ + uint32_t ch2; \ + int idx; \ - \ + \ - ch2 = inptr[1]; \ - /* See whether the second byte is in the correct range. */ \ - if (ch < 0x88 || ch2 < 0x40 || ch2 > 0xfe \ @@ -21161,10 +21161,10 @@ index 18e413d..5487323 100644 + inptr += 2; \ + } \ + else if (__builtin_expect (ch == 0xff, 0)) \ - { \ + { \ - /* This is illegal. */ \ - STANDARD_FROM_LOOP_ERR_HANDLER (1); \ - } \ + STANDARD_FROM_LOOP_ERR_HANDLER (1); \ + } \ - \ - inptr += 2; \ - } \ @@ -21176,7 +21176,7 @@ index 18e413d..5487323 100644 } \ - else \ - ++inptr; \ - \ + \ put32 (outptr, ch); \ outptr += 4; \ } @@ -21186,8 +21186,8 @@ index 18e413d..5487323 100644 { \ if (c <= 0x80) \ @@ -16862,19 +17911,61 @@ static struct - - + + /* Next, define the other direction. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -21200,7 +21200,7 @@ index 18e413d..5487323 100644 #define BODY \ { \ uint32_t ch = get32 (inptr); \ - \ + \ + if ((*statep >> 3) != 0) \ + { \ + /* Attempt to combine the last character with this one. */ \ @@ -21248,13 +21248,13 @@ index 18e413d..5487323 100644 { \ - const char *cp = ""; \ + const unsigned char *cp = (const unsigned char *) ""; \ - size_t i; \ - \ - for (i = 0; \ + size_t i; \ + \ + for (i = 0; \ @@ -16900,6 +17991,14 @@ static struct - } \ - else \ - { \ + } \ + else \ + { \ + /* Check for possible combining character. */ \ + if (__builtin_expect (ch == 0xca || ch == 0xea, 0)) \ + { \ @@ -21263,17 +21263,17 @@ index 18e413d..5487323 100644 + continue; \ + } \ + \ - /* See whether there is enough room to write the second byte. */ \ - if (__builtin_expect (cp[1] != '\0', 1) \ - && __builtin_expect (outptr + 1 >= outend, 0)) \ + /* See whether there is enough room to write the second byte. */ \ + if (__builtin_expect (cp[1] != '\0', 1) \ + && __builtin_expect (outptr + 1 >= outend, 0)) \ @@ -16918,6 +18017,7 @@ static struct inptr += 4; \ } #define LOOP_NEED_FLAGS +#define EXTRA_LOOP_DECLS , int *statep #include - - + + diff --git a/iconvdata/testdata/BIG5HKSCS b/iconvdata/testdata/BIG5HKSCS index 827e20b..ac76f6e 100644 --- a/iconvdata/testdata/BIG5HKSCS @@ -25868,13 +25868,13 @@ index b6f55b4..0735efc 100644 +++ b/localedata/charmaps/BIG5-HKSCS @@ -7,7 +7,8 @@ % alias BIG5HKSCS - + % -% Generated from the big5hkscs.c iconv module. +% Last updated from the HKSCS-2008 standard +% http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/e_hkscs_2008.pdf % - + CHARMAP @@ -140,28 +141,153 @@ CHARMAP /x7e TILDE @@ -28985,7 +28985,7 @@ index b6f55b4..0735efc 100644 /xfe/xf1 @@ -18299,15 +18607,11 @@ CHARMAP END CHARMAP - + WIDTH -... 2 - 2 diff --git a/SOURCES/glibc-rh1213603.patch b/SOURCES/glibc-rh1213603.patch index 0ffad671..3b14dbd9 100644 --- a/SOURCES/glibc-rh1213603.patch +++ b/SOURCES/glibc-rh1213603.patch @@ -3,10 +3,10 @@ Author: Florian Weimer Date: Sat Jun 11 12:12:56 2016 +0200 nss_db: Fix initialization of iteration position [BZ #20237] - + When get*ent is called without a preceding set*ent, we need to set the initial iteration position in get*ent. - + Reproducer: Add “services: db files” to /etc/nsswitch.conf, then run “perl -e getservent”. It will segfault before this change, and exit silently after it. @@ -17,20 +17,20 @@ Index: b/nss/nss_db/db-XXX.c +++ b/nss/nss_db/db-XXX.c @@ -76,7 +76,7 @@ CONCAT(_nss_db_set,ENTNAME) (int stayope keep_db |= stayopen; - + /* Reset the sequential index. */ - entidx = (const char *) state.header + state.header->valstroffset; + entidx = NULL; } - + __libc_lock_unlock (lock); @@ -249,8 +249,14 @@ CONCAT(_nss_db_get,ENTNAME_r) (struct ST - H_ERRNO_SET (NETDB_INTERNAL); - goto out; - } + H_ERRNO_SET (NETDB_INTERNAL); + goto out; + } + entidx = NULL; } - + + /* Start from the beginning if freshly initialized or reset + requested by set*ent. */ + if (entidx == NULL) diff --git a/SOURCES/glibc-rh1216246.patch b/SOURCES/glibc-rh1216246.patch index 0df56f33..0dd0bc47 100644 --- a/SOURCES/glibc-rh1216246.patch +++ b/SOURCES/glibc-rh1216246.patch @@ -3,7 +3,7 @@ Author: Carlos O'Donell Date: Wed Jul 8 02:42:11 2015 -0400 Fix ruserok scalability with large ~/.rhosts file. - + Fixes bug 18557. diff --git glibc-2.17-c758a686/inet/rcmd.c glibc-2.17-c758a686/inet/rcmd.c @@ -11,9 +11,9 @@ index 98b3735..91623b0 100644 --- glibc-2.17-c758a686/inet/rcmd.c +++ glibc-2.17-c758a686/inet/rcmd.c @@ -809,29 +809,38 @@ __validuser2_sa(hostf, ra, ralen, luser, ruser, rhost) - *p = '\0'; /* terminate username (+host?) */ - - /* buf -> host(?) ; user -> username(?) */ + *p = '\0'; /* terminate username (+host?) */ + + /* buf -> host(?) ; user -> username(?) */ + if (*buf == '\0') + break; + if (*user == '\0') @@ -36,7 +36,7 @@ index 98b3735..91623b0 100644 + /* Negative '-host user(?)' match? */ + if (hcheck < 0) + break; - + - /* First check host part */ - hcheck = __checkhost_sa (ra, ralen, buf, rhost); - @@ -54,16 +54,16 @@ index 98b3735..91623b0 100644 - if (ucheck > 0) { + /* Positive 'host user' match? */ + if (hcheck > 0 && ucheck > 0) { - retval = 0; - break; - } - + retval = 0; + break; + } + - /* Negative 'host -user' match? */ - if (ucheck < 0) - break; + /* Negative 'host -user' match? */ + if (hcheck > 0 && ucheck < 0) + break; - - /* Neither, go on looking for match */ - } + + /* Neither, go on looking for match */ + } diff --git a/SOURCES/glibc-rh1219891.patch b/SOURCES/glibc-rh1219891.patch index 73a5bb84..8e1d9860 100644 --- a/SOURCES/glibc-rh1219891.patch +++ b/SOURCES/glibc-rh1219891.patch @@ -3,19 +3,19 @@ Author: David S. Miller Date: Wed Jan 9 23:04:32 2013 -0800 Sync netinet/tcp.h with upstream Linux kernel. - - [BZ# 15003] - * sysdeps/gnu/netinet/tcp.h (TCP_COOKIE_TRANSACTIONS, - TCP_THIN_LINEAR_TIMEOUTS, TCP_THIN_DUPACK, TCP_USER_TIMEOUT, - TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS, - TCP_FASTOPEN): Define. - (tcp_repair_opt): New structure. - (TCP_NO_QUEUE, TCP_RECV_QUEUE, TCP_SEND_QUEUE, TCP_QUEUES_NR): New - enum values. - (TCP_COOKIE_MIN, TCP_COOKIE_MAX, TCP_COOKIE_PAIR_SIZE, - TCP_COOKIE_IN_ALWAYS, TCP_COOKIE_OUT_NEVER, TCP_S_DATA_IN, - TCP_S_DATA_OUT, TCP_MSS_DEFAULT, TCP_MSS_DESIRED): Define. - (tcp_cookie_transactions): New structure. + + [BZ# 15003] + * sysdeps/gnu/netinet/tcp.h (TCP_COOKIE_TRANSACTIONS, + TCP_THIN_LINEAR_TIMEOUTS, TCP_THIN_DUPACK, TCP_USER_TIMEOUT, + TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS, + TCP_FASTOPEN): Define. + (tcp_repair_opt): New structure. + (TCP_NO_QUEUE, TCP_RECV_QUEUE, TCP_SEND_QUEUE, TCP_QUEUES_NR): New + enum values. + (TCP_COOKIE_MIN, TCP_COOKIE_MAX, TCP_COOKIE_PAIR_SIZE, + TCP_COOKIE_IN_ALWAYS, TCP_COOKIE_OUT_NEVER, TCP_S_DATA_IN, + TCP_S_DATA_OUT, TCP_MSS_DEFAULT, TCP_MSS_DESIRED): Define. + (tcp_cookie_transactions): New structure. diff --git glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h index 278fc9d..b62a696 100644 @@ -62,13 +62,13 @@ index 278fc9d..b62a696 100644 +#define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */ +#define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ +#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ - + #ifdef __USE_MISC # include @@ -243,6 +252,49 @@ struct tcp_md5sig u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ }; - + +/* For socket repair options. */ +struct tcp_repair_opt +{ @@ -113,5 +113,5 @@ index 278fc9d..b62a696 100644 +}; + #endif /* Misc. */ - + #endif /* netinet/tcp.h */ diff --git a/SOURCES/glibc-rh1227699.patch b/SOURCES/glibc-rh1227699.patch index 242cafed..1935856b 100644 --- a/SOURCES/glibc-rh1227699.patch +++ b/SOURCES/glibc-rh1227699.patch @@ -13,7 +13,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sys @@ -388,8 +388,18 @@ have to iterate beyond the first element in the slotinfo list. */ #define TLS_SLOTINFO_SURPLUS (62) - + -/* Number of additional slots in the dtv allocated. */ -#define DTV_SURPLUS (14) +/* Number of additional allocated dtv slots. This was initially @@ -28,6 +28,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sys + resource is effectively coordinating a global resource since this + surplus is allocated for each thread at startup. */ +#define DTV_SURPLUS (32) - + /* Initial dtv of the main thread, not allocated with normal malloc. */ EXTERN void *_dl_initial_dtv; diff --git a/SOURCES/glibc-rh1228114-1.patch b/SOURCES/glibc-rh1228114-1.patch index 1e3df67a..65d539df 100644 --- a/SOURCES/glibc-rh1228114-1.patch +++ b/SOURCES/glibc-rh1228114-1.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Tue Jun 11 11:11:11 2013 +0530 Fix symbol definitions for __clock_* functions - + __clock_gettime and other __clock_* functions could result in an extra PLT reference within libc.so if it actually gets used. None of the code currently uses them, which is why this probably went unnoticed. @@ -13,7 +13,7 @@ Index: b/include/time.h --- a/include/time.h +++ b/include/time.h @@ -21,6 +21,7 @@ libc_hidden_proto (strptime) - + extern __typeof (clock_getres) __clock_getres; extern __typeof (clock_gettime) __clock_gettime; +libc_hidden_proto (__clock_gettime) @@ -26,7 +26,7 @@ Index: b/rt/clock_getcpuclockid.c +++ b/rt/clock_getcpuclockid.c @@ -21,7 +21,7 @@ #include - + int -clock_getcpuclockid (pid_t pid, clockid_t *clock_id) +__clock_getcpuclockid (pid_t pid, clockid_t *clock_id) @@ -44,7 +44,7 @@ Index: b/rt/clock_getres.c --- a/rt/clock_getres.c +++ b/rt/clock_getres.c @@ -21,10 +21,10 @@ - + /* Get resolution of clock. */ int -clock_getres (clockid_t clock_id, struct timespec *res) @@ -61,7 +61,7 @@ Index: b/rt/clock_gettime.c --- a/rt/clock_gettime.c +++ b/rt/clock_gettime.c @@ -21,10 +21,11 @@ - + /* Get current value of CLOCK and store it in TP. */ int -clock_gettime (clockid_t clock_id, struct timespec *tp) @@ -80,7 +80,7 @@ Index: b/rt/clock_nanosleep.c +++ b/rt/clock_nanosleep.c @@ -20,8 +20,8 @@ #include - + int -clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, - struct timespec *rem) @@ -101,7 +101,7 @@ Index: b/rt/clock_settime.c --- a/rt/clock_settime.c +++ b/rt/clock_settime.c @@ -21,10 +21,10 @@ - + /* Set CLOCK to value TP. */ int -clock_settime (clockid_t clock_id, const struct timespec *tp) @@ -118,16 +118,16 @@ Index: b/sysdeps/posix/clock_getres.c --- a/sysdeps/posix/clock_getres.c +++ b/sysdeps/posix/clock_getres.c @@ -76,7 +76,7 @@ realtime_getres (struct timespec *res) - + /* Get resolution of clock. */ int -clock_getres (clockid_t clock_id, struct timespec *res) +__clock_getres (clockid_t clock_id, struct timespec *res) { int retval = -1; - + @@ -115,4 +115,4 @@ clock_getres (clockid_t clock_id, struct - + return retval; } -strong_alias (clock_getres, __clock_getres) @@ -137,16 +137,16 @@ Index: b/sysdeps/unix/clock_gettime.c --- a/sysdeps/unix/clock_gettime.c +++ b/sysdeps/unix/clock_gettime.c @@ -89,7 +89,7 @@ realtime_gettime (struct timespec *tp) - + /* Get current value of CLOCK and store it in TP. */ int -clock_gettime (clockid_t clock_id, struct timespec *tp) +__clock_gettime (clockid_t clock_id, struct timespec *tp) { int retval = -1; - + @@ -132,4 +132,5 @@ clock_gettime (clockid_t clock_id, struc - + return retval; } -strong_alias (clock_gettime, __clock_gettime) @@ -166,9 +166,9 @@ Index: b/sysdeps/unix/clock_nanosleep.c + struct timespec *rem) { struct timespec now; - + @@ -98,4 +98,4 @@ clock_nanosleep (clockid_t clock_id, int - + return __builtin_expect (nanosleep (req, rem), 0) ? errno : 0; } -strong_alias (clock_nanosleep, __clock_nanosleep) @@ -178,16 +178,16 @@ Index: b/sysdeps/unix/clock_settime.c --- a/sysdeps/unix/clock_settime.c +++ b/sysdeps/unix/clock_settime.c @@ -72,7 +72,7 @@ hp_timing_settime (clockid_t clock_id, c - + /* Set CLOCK to value TP. */ int -clock_settime (clockid_t clock_id, const struct timespec *tp) +__clock_settime (clockid_t clock_id, const struct timespec *tp) { int retval; - + @@ -124,4 +124,4 @@ clock_settime (clockid_t clock_id, const - + return retval; } -strong_alias (clock_settime, __clock_settime) @@ -198,7 +198,7 @@ Index: b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c +++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c @@ -23,7 +23,7 @@ #include "kernel-posix-cpu-timers.h" - + int -clock_getcpuclockid (pid_t pid, clockid_t *clock_id) +__clock_getcpuclockid (pid_t pid, clockid_t *clock_id) @@ -228,7 +228,7 @@ Index: b/sysdeps/unix/sysv/linux/clock_nanosleep.c int r; @@ -52,4 +52,4 @@ clock_nanosleep (clockid_t clock_id, int return (INTERNAL_SYSCALL_ERROR_P (r, err) - ? INTERNAL_SYSCALL_ERRNO (r, err) : 0); + ? INTERNAL_SYSCALL_ERRNO (r, err) : 0); } -strong_alias (clock_nanosleep, __clock_nanosleep) +weak_alias (__clock_nanosleep, clock_nanosleep) diff --git a/SOURCES/glibc-rh1228114-2.patch b/SOURCES/glibc-rh1228114-2.patch index af0ec9c9..f9d1876b 100644 --- a/SOURCES/glibc-rh1228114-2.patch +++ b/SOURCES/glibc-rh1228114-2.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Tue Feb 28 15:28:45 2017 +0100 sunrpc: Improvements for UDP client timeout handling [BZ #20257] - + This commit fixes various aspects in the UDP client timeout handling. Timeouts are now applied in a more consistent fashion. Discarded UDP packets no longer prevent the timeout from happening at all. @@ -333,23 +333,23 @@ Index: b/sunrpc/Makefile --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -96,11 +96,13 @@ others += rpcgen - + all: # Make this the default target; it will be defined in Rules. - + -tests = tst-xdrmem tst-xdrmem2 +tests = tst-xdrmem tst-xdrmem2 tst-udp-timeout \ + tst-udp-nonblocking xtests := tst-getmyaddr - + ifeq ($(have-thread-library),yes) xtests += thrsvc +tests += tst-udp-garbage endif - + headers += $(rpcsvc:%.x=rpcsvc/%.h) @@ -225,3 +227,8 @@ endif endif - + $(objpfx)thrsvc: $(common-objpfx)linkobj/libc.so $(shared-thread-library) + +$(objpfx)tst-udp-timeout: $(common-objpfx)linkobj/libc.so @@ -362,15 +362,15 @@ Index: b/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -54,6 +54,7 @@ #endif - + #include +#include - + extern u_long _create_xid (void); - + @@ -79,7 +80,9 @@ static const struct clnt_ops udp_ops = }; - + /* - * Private data kept per client handle + * Private data kept per client handle. This private struct is @@ -393,7 +393,7 @@ Index: b/sunrpc/clnt_udp.c int nrefreshes = 2; /* number of times to refresh cred */ - struct timeval timeout; int anyup; /* any network interface up */ - + - if (cu->cu_total.tv_usec == -1) - { - timeout = utimeout; /* use supplied timeout */ @@ -426,7 +426,7 @@ Index: b/sunrpc/clnt_udp.c + /* Guard against bad timeout specification. */ + if (!__is_timeval_valid_timeout (cu->cu_wait)) + return (cu->cu_error.re_status = RPC_TIMEDOUT); - + - time_waited.tv_sec = 0; - time_waited.tv_usec = 0; call_again: @@ -435,7 +435,7 @@ Index: b/sunrpc/clnt_udp.c @@ -356,27 +369,46 @@ send_again: return (cu->cu_error.re_status = RPC_CANTSEND); } - + - /* - * Hack to provide rpc-based message passing - */ @@ -489,12 +489,12 @@ Index: b/sunrpc/clnt_udp.c + } + switch (__poll (&fd, 1, milliseconds)) - { - + { + @@ -387,27 +419,10 @@ send_again: - if (!anyup) - return (cu->cu_error.re_status = RPC_CANTRECV); - } + if (!anyup) + return (cu->cu_error.re_status = RPC_CANTRECV); + } - - time_waited.tv_sec += cu->cu_wait.tv_sec; - time_waited.tv_usec += cu->cu_wait.tv_usec; @@ -514,22 +514,22 @@ Index: b/sunrpc/clnt_udp.c - * updated. - */ + goto next_response; - case -1: - if (errno == EINTR) + case -1: + if (errno == EINTR) - continue; + goto next_response; - cu->cu_error.re_errno = errno; - return (cu->cu_error.re_status = RPC_CANTRECV); - } + cu->cu_error.re_errno = errno; + return (cu->cu_error.re_status = RPC_CANTRECV); + } @@ -463,20 +478,22 @@ send_again: if (inlen < 0) - { - if (errno == EWOULDBLOCK) + { + if (errno == EWOULDBLOCK) - continue; + goto next_response; - cu->cu_error.re_errno = errno; - return (cu->cu_error.re_status = RPC_CANTRECV); - } + cu->cu_error.re_errno = errno; + return (cu->cu_error.re_status = RPC_CANTRECV); + } - if (inlen < 4) - continue; + /* Accept the response if the packet is sufficiently long and @@ -539,7 +539,7 @@ Index: b/sunrpc/clnt_udp.c + || memcmp (cu->cu_inbuf, cu->cu_outbuf, + sizeof (u_int32_t)) == 0)) + break; - + - /* see if reply transaction id matches sent id. - Don't do this if we only wait for a replay */ - if (xargs != NULL @@ -552,7 +552,7 @@ Index: b/sunrpc/clnt_udp.c + an unknown time. */ + current_time = __deadline_current_time (); } - + /* Index: b/sunrpc/tst-udp-garbage.c =================================================================== @@ -1530,22 +1530,23 @@ Index: b/inet/Makefile --- a/inet/Makefile +++ b/inet/Makefile @@ -44,13 +44,18 @@ routines := htonl htons \ - getaliasent_r getaliasent getaliasname getaliasname_r \ - in6_addr getnameinfo if_index ifaddrs inet6_option \ - getipv4sourcefilter setipv4sourcefilter \ + getaliasent_r getaliasent getaliasname getaliasname_r \ + in6_addr getnameinfo if_index ifaddrs inet6_option \ + getipv4sourcefilter setipv4sourcefilter \ - getsourcefilter setsourcefilter inet6_opt inet6_rth + getsourcefilter setsourcefilter inet6_opt inet6_rth \ + deadline - + aux := check_pf check_native ifreq - + tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \ - tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ + tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ - tst-getni1 tst-getni2 tst-inet6_rth tst-checks + tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-deadline + +# tst-deadline must be linked statically so that we can access +# internal functions. +tests-static += tst-deadline - + include ../Rules + diff --git a/SOURCES/glibc-rh1234449-1.patch b/SOURCES/glibc-rh1234449-1.patch index cf2348ec..4b4f9c47 100644 --- a/SOURCES/glibc-rh1234449-1.patch +++ b/SOURCES/glibc-rh1234449-1.patch @@ -13,7 +13,7 @@ index 9dd5130..3ea3051 100644 int trans_width = 4; size_t tzspec_len; + char *new = NULL; - + if (sizeof (time_t) != 4 && sizeof (time_t) != 8) abort (); @@ -145,22 +146,12 @@ __tzfile_read (const char *file, size_t extra, char **extrap) @@ -22,7 +22,7 @@ index 9dd5130..3ea3051 100644 const char *tzdir; - unsigned int len, tzdir_len; - char *new, *tmp; - + tzdir = getenv ("TZDIR"); if (tzdir == NULL || *tzdir == '\0') - { @@ -41,7 +41,7 @@ index 9dd5130..3ea3051 100644 + goto ret_free_transitions; file = new; } - + @@ -170,11 +161,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap) && stat64 (file, &st) == 0 && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev @@ -52,18 +52,18 @@ index 9dd5130..3ea3051 100644 - return; - } + goto done; /* Nothing to do. */ - + /* Note the file is opened with cancellation in the I/O functions disabled and if available FD_CLOEXEC set. */ @@ -527,12 +514,15 @@ __tzfile_read (const char *file, size_t extra, char **extrap) __daylight = rule_stdoff != rule_dstoff; __timezone = -rule_stdoff; - + + done: __use_tzfile = 1; + free (new); return; - + lose: fclose (f); ret_free_transitions: diff --git a/SOURCES/glibc-rh1234449-2.patch b/SOURCES/glibc-rh1234449-2.patch index 97415815..7939344d 100644 --- a/SOURCES/glibc-rh1234449-2.patch +++ b/SOURCES/glibc-rh1234449-2.patch @@ -35,9 +35,9 @@ Date: Wed Sep 18 13:15:12 2013 -0700 commit 3cc652e951c71785032019fec82e3b8543d85305 Author: Mike Frysinger Date: Fri Sep 18 13:49:08 2015 -0400 - + timezone: fix parallel check failures - + The XT testdata install rules expect the testdata dir to already exist in the build tree, but it doesn't actually create it. Instead, it relies on the build-testdata define happening to be executed before it (which runs @@ -59,7 +59,7 @@ diff --git a/time/tzfile.c b/time/tzfile.c @@ -213,6 +213,9 @@ num_isstd = (size_t) decode (tzhead.tzh_ttisstdcnt); num_isgmt = (size_t) decode (tzhead.tzh_ttisgmtcnt); - + + if (__glibc_unlikely (num_isstd > num_types || num_isgmt > num_types)) + goto lose; + @@ -67,8 +67,8 @@ diff --git a/time/tzfile.c b/time/tzfile.c if (sizeof (time_t) == 8 && trans_width == 4 && tzhead.tzh_version[0] != '\0') @@ -445,12 +448,20 @@ - goto lose; - + goto lose; + tzspec_len = st.st_size - off - 1; - char *tzstr = alloca (tzspec_len); + if (tzspec_len == 0) @@ -77,7 +77,7 @@ diff --git a/time/tzfile.c b/time/tzfile.c + if (tzstr == NULL) + goto lose; if (getc_unlocked (f) != '\n' - || (fread_unlocked (tzstr, 1, tzspec_len - 1, f) != tzspec_len - 1)) + || (fread_unlocked (tzstr, 1, tzspec_len - 1, f) != tzspec_len - 1)) - goto lose; + { + free (tzstr); @@ -87,7 +87,7 @@ diff --git a/time/tzfile.c b/time/tzfile.c tzspec = __tzstring (tzstr); + free (tzstr); } - + /* Don't use an empty TZ string. */ diff --git a/time/tzset.c b/time/tzset.c @@ -97,7 +97,7 @@ diff --git a/time/tzset.c b/time/tzset.c -/* Copyright (C) 1991-2012 Free Software Foundation, Inc. +/* Copyright (C) 1991-2016 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 @@ -18,6 +18,7 @@ #include @@ -113,13 +113,13 @@ diff --git a/time/tzset.c b/time/tzset.c unsigned short int m, n, d; /* Month, week, day. */ - unsigned int secs; /* Time of day. */ + int secs; /* Time of day. */ - + long int offset; /* Seconds east of GMT (west if < 0). */ - + @@ -82,15 +83,14 @@ - + static struct tzstring_l *tzstring_list; - + -/* Allocate a permanent home for S. It will never be moved or deallocated, - but may share space with other strings. - Don't modify the returned string. */ @@ -134,30 +134,30 @@ diff --git a/time/tzset.c b/time/tzset.c char *p; struct tzstring_l *t, *u, *new; - size_t len = strlen (s); - + /* Walk the list and look for a match. If this string is the same as the end of an already-allocated string, it can share space. */ @@ -98,7 +98,7 @@ if (len <= t->len) { - p = &t->data[t->len - len]; + p = &t->data[t->len - len]; - if (strcmp (s, p) == 0) + if (memcmp (s, p, len) == 0) - return p; + return p; } - + @@ -109,7 +109,8 @@ - + new->next = NULL; new->len = len; - strcpy (new->data, s); + memcpy (new->data, s, len); + new->data[len] = '\0'; - + if (u) u->next = new; @@ -118,6 +119,15 @@ - + return new->data; } + @@ -174,17 +174,17 @@ diff --git a/time/tzset.c b/time/tzset.c (never decreasing it) when ! __use_tzfile. @@ -125,7 +135,7 @@ size_t __tzname_cur_max; - + long int -__tzname_max () +__tzname_max (void) { __libc_lock_lock (tzset_lock); - + @@ -164,243 +174,227 @@ return min (ss, 59) + min (mm, 59) * 60 + min (hh, 24) * 60 * 60; } - + - -/* Parse the POSIX TZ-style string. */ -void @@ -244,14 +244,14 @@ diff --git a/time/tzset.c b/time/tzset.c - goto out; - else - tz += consumed; - + - tz_rules[0].name = __tzstring (tzbuf); + tz_rules[whichrule].name = __tzstring_len (start, len); + + *tzp = p; + return true; +} - + - /* Figure out the standard offset from UTC. */ - if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz))) - goto out; @@ -265,7 +265,7 @@ diff --git a/time/tzset.c b/time/tzset.c + if (whichrule == 0 + && (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz)))) + return false; - + + long sign; if (*tz == '-' || *tz == '+') - tz_rules[0].offset = *tz++ == '-' ? 1L : -1L; @@ -315,7 +315,7 @@ diff --git a/time/tzset.c b/time/tzset.c - tz += consumed; + sign = -1L; + *tzp = tz; - + - tz_rules[1].name = __tzstring (tzbuf); - - /* Figure out the DST offset from GMT. */ @@ -343,7 +343,7 @@ diff --git a/time/tzset.c b/time/tzset.c + *tzp = tz + consumed; + return true; +} - + - switch (sscanf (tz, "%hu%n:%hu%n:%hu%n", - &hh, &consumed, &mm, &consumed, &ss, &consumed)) +/* Parses the standard <-> DST rules at *TZP. Updates @@ -395,7 +395,7 @@ diff --git a/time/tzset.c b/time/tzset.c + since 2:00AM is the default]. */ + tzr->type = M; + if (tzr == &tz_rules[0]) - { + { - default: - /* Default to one hour later than standard time. */ - tz_rules[1].offset = tz_rules[0].offset + (60 * 60); @@ -412,10 +412,10 @@ diff --git a/time/tzset.c b/time/tzset.c + tzr->m = 3; + tzr->n = 2; + tzr->d = 0; - } + } - if (*tz == '\0' || (tz[0] == ',' && tz[1] == '\0')) + else - { + { - /* There is no rule. See if there is a default rule file. */ - __tzfile_default (tz_rules[0].name, tz_rules[1].name, - tz_rules[0].offset, tz_rules[1].offset); @@ -428,7 +428,7 @@ diff --git a/time/tzset.c b/time/tzset.c + tzr->m = 11; + tzr->n = 1; + tzr->d = 0; - } + } } else - { @@ -462,7 +462,7 @@ diff --git a/time/tzset.c b/time/tzset.c + else + /* Default to 2:00 AM. */ + tzr->secs = 2 * 60 * 60; - + - done_names: - /* Figure out the standard <-> DST rules. */ - for (unsigned int whichrule = 0; whichrule < 2; ++whichrule) @@ -472,7 +472,7 @@ diff --git a/time/tzset.c b/time/tzset.c + *tzp = tz; + return true; +} - + - /* Ignore comma to support string following the incorrect - specification in early POSIX.1 printings. */ - tz += *tz == ','; @@ -483,7 +483,7 @@ diff --git a/time/tzset.c b/time/tzset.c + /* Clear out old state and reset to unnamed UTC. */ + memset (tz_rules, '\0', sizeof tz_rules); + tz_rules[0].name = tz_rules[1].name = ""; - + - /* Get the date of the change. */ - if (*tz == 'J' || isdigit (*tz)) - { @@ -515,7 +515,7 @@ diff --git a/time/tzset.c b/time/tzset.c + { + /* Get the DST timezone name (if any). */ + if (*tz != '\0') - { + { - /* Daylight time rules in the U.S. are defined in the - U.S. Code, Title 15, Chapter 6, Subchapter IX - Standard - Time. These dates were established by Congress in the @@ -526,7 +526,7 @@ diff --git a/time/tzset.c b/time/tzset.c - tzr->type = M; - if (tzr == &tz_rules[0]) + if (parse_tzname (&tz, 1)) - { + { - tzr->m = 3; - tzr->n = 2; - tzr->d = 0; @@ -550,18 +550,18 @@ diff --git a/time/tzset.c b/time/tzset.c + return; + } + } - } + } + /* Figure out the standard <-> DST rules. */ + if (parse_rule (&tz, 0)) + parse_rule (&tz, 1); - } + } else - goto out; - - if (*tz != '\0' && *tz != '/' && *tz != ',') - goto out; - else if (*tz == '/') - { + { - /* Get the time of day of the change. */ - ++tz; - if (*tz == '\0') @@ -584,18 +584,18 @@ diff --git a/time/tzset.c b/time/tzset.c + /* There is no DST. */ + tz_rules[1].name = tz_rules[0].name; + tz_rules[1].offset = tz_rules[0].offset; - } + } - else - /* Default to 2:00 AM. */ - tzr->secs = 2 * 60 * 60; - - tzr->computed_for = -1; } - + - out: update_vars (); } - + /* Interpret the TZ envariable. */ static void internal_function @@ -607,7 +607,7 @@ diff --git a/time/tzset.c b/time/tzset.c static int is_initialized; - register const char *tz; + const char *tz; - + if (is_initialized && !always) return; @@ -467,11 +461,9 @@ @@ -621,7 +621,7 @@ diff --git a/time/tzset.c b/time/tzset.c { - register time_t t; + time_t t; - + if (year != -1 && rule->computed_for == year) /* Operations on times in 2 BC will be slower. Oh well. */ @@ -558,10 +550,7 @@ @@ -639,61 +639,61 @@ diff --git a/time/tzset.c b/time/tzset.c @@ -641,6 +630,8 @@ leap_extra_secs = 0; } - + + __libc_lock_unlock (tzset_lock); + if (tp) { if (! use_localtime) @@ -656,8 +647,6 @@ - tp = NULL; + tp = NULL; } - + - __libc_lock_unlock (tzset_lock); - return tp; } - + diff --git a/timezone/Makefile b/timezone/Makefile index 17424b8..5f18545 100644 --- a/timezone/Makefile +++ b/timezone/Makefile @@ -23,7 +23,7 @@ extra-objs := scheck.o ialloc.o - + others := zdump zic -tests := test-tz tst-timezone +tests := test-tz tst-timezone tst-tzset - + # pacificnew doesn't compile; if it is to be used, it should be included in # northamerica. @@ -87,9 +87,11 @@ - Australia/Melbourne \ - America/Sao_Paulo Asia/Tokyo \ - Europe/London) + Australia/Melbourne \ + America/Sao_Paulo Asia/Tokyo \ + Europe/London) +$(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4) - + test-tz-ENV = TZDIR=$(testdata) tst-timezone-ENV = TZDIR=$(testdata) +tst-tzset-ENV = TZDIR=$(testdata) - + # Note this must come second in the deps list for $(built-program-cmd) to work. zic-deps = $(objpfx)zic $(leapseconds) yearistype @@ -111,6 +113,8 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps) - $(build-testdata) - + $(build-testdata) + +$(testdata)/XT%: testdata/XT% + cp $< $@ - + $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make - sed -e 's|/bin/bash|$(KSH)|g' \ + sed -e 's|/bin/bash|$(KSH)|g' \ diff --git a/timezone/README b/timezone/README index 7a5e31c..2268f8e 100644 --- a/timezone/README +++ b/timezone/README @@ -15,3 +15,6 @@ version of the tzcode and tzdata packages. - + These packages may be found at ftp://ftp.iana.org/tz/releases/. Commentary should be addressed to tz@iana.org. + @@ -907,12 +907,12 @@ index 81d4a3e..bfb3463 100644 --- a/timezone/Makefile +++ b/timezone/Makefile @@ -113,6 +113,7 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps) - $(build-testdata) - + $(build-testdata) + $(testdata)/XT%: testdata/XT% + $(make-target-directory) - cp $< $@ - + cp $< $@ + $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make diff -Nrup -a a/timezone/testdata/XT1 b/timezone/testdata/XT1 --- a/timezone/testdata/XT1 1969-12-31 19:00:00.000000000 -0500 diff --git a/SOURCES/glibc-rh1234449-3.patch b/SOURCES/glibc-rh1234449-3.patch index 2a9ebd14..048c648c 100644 --- a/SOURCES/glibc-rh1234449-3.patch +++ b/SOURCES/glibc-rh1234449-3.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Mon Apr 27 15:41:03 2015 +0200 test-skeleton: Support temporary files without memory leaks [BZ#18333] - + add_temp_file now makes a copy which is freed by delete_temp_files. Callers to create_temp_file can now free the returned file name to avoid the memory leak. These changes do not affect the leak behavior @@ -23,7 +23,7 @@ index 7a8ddfa..43fc236 100644 - const char *name; + char *name; } *temp_name_list; - + /* Add temporary files in list. */ @@ -83,14 +83,17 @@ add_temp_file (const char *name) { @@ -36,14 +36,14 @@ index 7a8ddfa..43fc236 100644 - newp->name = name; + newp->name = newname; if (temp_name_list == NULL) - temp_name_list = (struct temp_name_list *) &newp->q; + temp_name_list = (struct temp_name_list *) &newp->q; else - insque (newp, temp_name_list); + insque (newp, temp_name_list); } + else + free (newp); } - + /* Delete all temporary files. */ @@ -100,11 +103,19 @@ delete_temp_files (void) while (temp_name_list != NULL) @@ -58,7 +58,7 @@ index 7a8ddfa..43fc236 100644 + temp_name_list = next; } } - + -/* Create a temporary file. */ +/* Create a temporary file. Return the opened file descriptor on + success, or -1 on failure. Write the file name to *FILENAME if @@ -73,21 +73,21 @@ index 7a8ddfa..43fc236 100644 *filename = fname; + else + free (fname); - + return fd; } diff --git a/time/tzset.c b/time/tzset.c --- a/time/tzset.c +++ b/time/tzset.c @@ -202,7 +202,10 @@ - return false; + return false; } - + - tz_rules[whichrule].name = __tzstring_len (start, len); + const char *name = __tzstring_len (start, len); + if (name == NULL) + return false; + tz_rules[whichrule].name = name; - + *tzp = p; return true; diff --git a/SOURCES/glibc-rh1234449-4.patch b/SOURCES/glibc-rh1234449-4.patch index dcdc511e..9b95a4e9 100644 --- a/SOURCES/glibc-rh1234449-4.patch +++ b/SOURCES/glibc-rh1234449-4.patch @@ -3,19 +3,19 @@ Author: H.J. Lu Date: Mon Apr 27 09:57:51 2015 -0700 Check tzspec_len == 0 in __tzfile_read - - [BZ#18333] - * time/tzset.c (__tzfile_read): Check tzspec_len == 0. + + [BZ#18333] + * time/tzset.c (__tzfile_read): Check tzspec_len == 0. --- a/time/tzfile.c +++ b/time/tzfile.c @@ -283,7 +283,8 @@ if (__builtin_expect (tzspec_len == 0 || tzspec_len - 1 < num_isgmt, 0)) - goto lose; + goto lose; tzspec_len -= num_isgmt + 1; - if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0)) + if (__builtin_expect (tzspec_len == 0 + || SIZE_MAX - total_size < tzspec_len, 0)) - goto lose; + goto lose; } if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0)) diff --git a/SOURCES/glibc-rh1240351-10.patch b/SOURCES/glibc-rh1240351-10.patch index 8003c582..8e4a54c8 100644 --- a/SOURCES/glibc-rh1240351-10.patch +++ b/SOURCES/glibc-rh1240351-10.patch @@ -2,37 +2,37 @@ commit 72607db038df1a1a7987af814aad8d2ed466c45c Author: Rajalakshmi Srinivasaraghavan Date: Fri Jan 9 11:56:35 2015 -0500 - + powerpc: Optimize POWER7 strcmp trailing checks - + This patch optimized the POWER7 trailing check by avoiding using byte read operations and instead use the doubleword already readed with bitwise operations. - + ChangeLog: - 2015-01-13 Rajalakshmi Srinivasaraghavan - Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/power7/strcmp.S (strcmp): Optimize - trailing byte check. + 2015-01-13 Rajalakshmi Srinivasaraghavan + Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/power7/strcmp.S (strcmp): Optimize + trailing byte check. diff --git a/sysdeps/powerpc/powerpc64/power7/strcmp.S b/sysdeps/powerpc/powerpc64/power7/strcmp.S index f16a9d8..ade2811 100644 --- a/sysdeps/powerpc/powerpc64/power7/strcmp.S +++ b/sysdeps/powerpc/powerpc64/power7/strcmp.S @@ -25,122 +25,96 @@ - + /* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4]) */ - + + .machine power7 EALIGN (strcmp, 4, 0) - CALL_MCOUNT 2 - - or r9, r3, r4 - rldicl. r10, r9, 0, 61 /* are s1 and s2 8 byte aligned..? */ - bne cr0, L(process_unaligned_bytes) + CALL_MCOUNT 2 + + or r9, r3, r4 + rldicl. r10, r9, 0, 61 /* are s1 and s2 8 byte aligned..? */ + bne cr0, L(process_unaligned_bytes) + li r5, 0 - + + .align 4 /* process input parameters on double word aligned boundary */ - ld r9, 0(r4) /* load s2 at offset=0 */ @@ -222,28 +222,28 @@ index f16a9d8..ade2811 100644 + + .align 4 L(process_unaligned_bytes): - lbz r9, 0(r3) /* load byte from s1 */ - lbz r10, 0(r4) /* load byte from s2 */ + lbz r9, 0(r3) /* load byte from s1 */ + lbz r10, 0(r4) /* load byte from s2 */ @@ -172,24 +146,19 @@ L(process_unaligned_bytes): - addi r4, r4, 4 /* increment s2 by unroll factor */ - beq cr6, L(process_unaligned_bytes) /* unroll byte processing */ - + addi r4, r4, 4 /* increment s2 by unroll factor */ + beq cr6, L(process_unaligned_bytes) /* unroll byte processing */ + - .p2align 4 + .align 4 L(ComputeDiff): - extsw r9, r9 - subf r10, r10, r9 /* compute s1 - s2 */ - extsw r3, r10 - blr /* return */ - + extsw r9, r9 + subf r10, r10, r9 /* compute s1 - s2 */ + extsw r3, r10 + blr /* return */ + - .p2align 4 + .align 4 L(diffOfNULL): - li r9, 0 - subf r10, r10, r9 /* compute s1 - s2 */ - extsw r3, r10 /* sign extend result */ - blr /* return */ - + li r9, 0 + subf r10, r10, r9 /* compute s1 - s2 */ + extsw r3, r10 /* sign extend result */ + blr /* return */ + - .p2align 4 -L(update2processBytes): - mr r3, r5 /* update and proceed */ diff --git a/SOURCES/glibc-rh1240351-11.patch b/SOURCES/glibc-rh1240351-11.patch index 079685cb..84042952 100644 --- a/SOURCES/glibc-rh1240351-11.patch +++ b/SOURCES/glibc-rh1240351-11.patch @@ -2,23 +2,23 @@ commit d3b00f468bec441596877a685a19f43dee88657f Author: Adhemerval Zanella Date: Fri Jan 9 16:04:26 2015 -0500 - + powerpc: Optimized strncmp for POWER8/PPC64 - + This patch adds an optimized POWER8 strncmp. The implementation focus on speeding up unaligned cases follwing the ideas of power8 strcmp. - + The algorithm first check the initial 16 bytes, then align the first function source and uses unaligned loads on second argument only. Aditional checks for page boundaries are done for unaligned cases (where sources alignment are different). - + ChangeLog: - 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: New file. - * sysdeps/powerpc/powerpc64/power8/strncmp.S: New file. - * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add + 2015-01-13 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: New file. + * sysdeps/powerpc/powerpc64/power8/strncmp.S: New file. + * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index 27c8b65..677d8ce 100644 @@ -41,7 +41,7 @@ index 2b38c71..a540abf 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -100,6 +100,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */ IFUNC_IMPL (i, name, strncmp, + IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07, @@ -104,7 +104,7 @@ index 9829d69..5e76783 100644 extern __typeof (strncmp) __strncmp_power4 attribute_hidden; extern __typeof (strncmp) __strncmp_power7 attribute_hidden; +extern __typeof (strncmp) __strncmp_power8 attribute_hidden; - + /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ libc_ifunc (strncmp, @@ -116,7 +116,7 @@ index 9829d69..5e76783 100644 + (hwcap & PPC_FEATURE_HAS_VSX) + ? __strncmp_power7 : + (hwcap & PPC_FEATURE_POWER4) - ? __strncmp_power4 + ? __strncmp_power4 : __strncmp_ppc); #endif diff --git a/sysdeps/powerpc/powerpc64/power8/strncmp.S b/sysdeps/powerpc/powerpc64/power8/strncmp.S diff --git a/SOURCES/glibc-rh1240351-12.patch b/SOURCES/glibc-rh1240351-12.patch index 76df8711..de55a650 100644 --- a/SOURCES/glibc-rh1240351-12.patch +++ b/SOURCES/glibc-rh1240351-12.patch @@ -2,29 +2,29 @@ commit ce6615c9c686acd34672a9f4eba9bcf5553496f6 Author: Adhemerval Zanella Date: Sun Jan 11 19:33:17 2015 -0600 - + powerpc: Fix POWER7/PPC64 performance regression on LE - + This patch fixes a performance regression on the POWER7/PPC64 memcmp porting for Little Endian. The LE code uses 'ldbrx' instruction to read the memory on byte reversed form, however ISA 2.06 just provide the indexed form which uses a register value as additional index, instead of a fixed value enconded in the instruction. - + And the port strategy for LE uses r0 index value and update the address value on each compare loop interation. For large compare size values, it adds 8 more instructions plus some more depending of trailing size. This patch fixes it by adding pre-calculate indexes to remove the address update on loops and tailing sizes. - + For large sizes it shows a considerable gain, with double performance pairing with BE. - + ChangeLog: - 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/power7/memcmp.S (memcmp): Fix performance - regression on LE. + 2015-01-13 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/power7/memcmp.S (memcmp): Fix performance + regression on LE. diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S index 09bff69..98b9e54 100644 @@ -32,8 +32,8 @@ index 09bff69..98b9e54 100644 +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S @@ -26,18 +26,48 @@ EALIGN (memcmp, 4, 0) - CALL_MCOUNT 3 - + CALL_MCOUNT 3 + -#define rRTN r3 -#define rSTR1 r3 /* first string arg */ -#define rSTR2 r4 /* second string arg */ @@ -88,13 +88,13 @@ index 09bff69..98b9e54 100644 +#else +# define LD ldx +#endif - - xor r0, rSTR2, rSTR1 - cmpldi cr6, rN, 0 + + xor r0, rSTR2, rSTR1 + cmpldi cr6, rN, 0 @@ -51,10 +81,24 @@ EALIGN (memcmp, 4, 0) /* If less than 8 bytes or not aligned, use the unaligned byte loop. */ - blt cr1, L(bytealigned) + blt cr1, L(bytealigned) - std rWORD8, -8(r1) - cfi_offset(rWORD8, -8) - std rWORD7, -16(r1) @@ -117,13 +117,13 @@ index 09bff69..98b9e54 100644 + li rOFF24,24 + li rOFF32,32 + - bne L(unaligned) + bne L(unaligned) /* At this point we know both strings have the same alignment and the compare length is at least 8 bytes. r12 contains the low order @@ -79,15 +123,8 @@ L(samealignment): - sldi rWORD6, r12, 3 - srdi r0, rN, 5 /* Divide by 32 */ - andi. r12, rN, 24 /* Get the DW remainder */ + sldi rWORD6, r12, 3 + srdi r0, rN, 5 /* Divide by 32 */ + andi. r12, rN, 24 /* Get the DW remainder */ -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -135,12 +135,12 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, 0, rSTR1 + LD rWORD2, 0, rSTR2 - cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - clrldi rN, rN, 61 + cmpldi cr1, r12, 16 + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 @@ -104,15 +141,8 @@ L(dsP1): - cmpld cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmpld cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) /* Do something useful in this cycle since we have to branch anyway. */ -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -153,12 +153,12 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - cmpld cr7, rWORD1, rWORD2 - b L(dP1e) + cmpld cr7, rWORD1, rWORD2 + b L(dP1e) /* Remainder is 16 */ @@ -123,15 +153,8 @@ L(dPs2): - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) /* Do something useful in this cycle since we have to branch anyway. */ -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 @@ -171,8 +171,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD7, rOFF8, rSTR1 + LD rWORD8, rOFF8, rSTR2 - cmpld cr5, rWORD7, rWORD8 - b L(dP2e) + cmpld cr5, rWORD7, rWORD8 + b L(dP2e) /* Remainder is 24 */ @@ -173,72 +196,43 @@ L(dP1): change any on the early exit path. The key here is the non-early @@ -189,8 +189,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, 0, rSTR1 + LD rWORD6, 0, rSTR2 - cmpld cr5, rWORD5, rWORD6 - blt cr7, L(dP1x) + cmpld cr5, rWORD5, rWORD6 + blt cr7, L(dP1x) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -202,7 +202,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - cmpld cr7, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 L(dP1e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -215,7 +215,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF16, rSTR1 + LD rWORD4, rOFF16, rSTR2 - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - ldbrx rWORD6, 0, rSTR2 @@ -227,10 +227,10 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF24, rSTR1 + LD rWORD6, rOFF24, rSTR2 - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5x) - bne cr7, L(dLcr7x) - + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(dLcr5x) + bne cr7, L(dLcr7x) + -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -244,31 +244,31 @@ index 09bff69..98b9e54 100644 + LD rWORD8, rOFF32, rSTR2 + addi rSTR1, rSTR1, 32 + addi rSTR2, rSTR2, 32 - bne cr1, L(dLcr1) - cmpld cr5, rWORD7, rWORD8 - bdnz L(dLoop) - bne cr6, L(dLcr6) + bne cr1, L(dLcr1) + cmpld cr5, rWORD7, rWORD8 + bdnz L(dLoop) + bne cr6, L(dLcr6) - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - .align 3 + .align 3 L(dP1x): - sldi. r12, rN, 3 - bne cr5, L(dLcr5x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) + sldi. r12, rN, 3 + bne cr5, L(dLcr5x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne L(d00) + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 0 - blr - + li rRTN, 0 + blr + @@ -246,79 +240,41 @@ L(dP1x): - .align 4 + .align 4 L(dP2): - mtctr r0 + mtctr r0 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - ldbrx rWORD6, 0, rSTR2 @@ -280,8 +280,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, 0, rSTR1 + LD rWORD6, 0, rSTR2 - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP2x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP2x) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -293,7 +293,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD7, rOFF8, rSTR1 + LD rWORD8, rOFF8, rSTR2 - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 L(dP2e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -306,7 +306,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF16, rSTR1 + LD rWORD2, rOFF16, rSTR2 - cmpld cr7, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 - ldbrx rWORD4, 0, rSTR2 @@ -318,18 +318,18 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF24, rSTR1 + LD rWORD4, rOFF24, rSTR2 - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 -#endif - bne cr6, L(dLcr6) - bne cr5, L(dLcr5) - b L(dLoop2) + bne cr6, L(dLcr6) + bne cr5, L(dLcr5) + b L(dLoop2) -/* Again we are on a early exit path (16-23 byte compare), we want to - only use volatile registers and avoid restoring non-volatile - registers. */ - .align 4 + .align 4 L(dP2x): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -342,27 +342,27 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF8, rSTR1 + LD rWORD4, rOFF8, rSTR2 - cmpld cr1, rWORD3, rWORD4 - sldi. r12, rN, 3 - bne cr6, L(dLcr6x) + cmpld cr1, rWORD3, rWORD4 + sldi. r12, rN, 3 + bne cr6, L(dLcr6x) -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 -#endif - bne cr1, L(dLcr1x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne L(d00) + bne cr1, L(dLcr1x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne L(d00) + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 0 - blr - + li rRTN, 0 + blr + @@ -326,52 +282,22 @@ L(dP2x): - .align 4 + .align 4 L(dP3): - mtctr r0 + mtctr r0 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 - ldbrx rWORD4, 0, rSTR2 @@ -374,7 +374,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, 0, rSTR1 + LD rWORD4, 0, rSTR2 - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 L(dP3e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 @@ -387,8 +387,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF8, rSTR1 + LD rWORD6, rOFF8, rSTR2 - cmpld cr6, rWORD5, rWORD6 - blt cr7, L(dP3x) + cmpld cr6, rWORD5, rWORD6 + blt cr7, L(dP3x) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -400,7 +400,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD7, rOFF16, rSTR1 + LD rWORD8, rOFF16, rSTR2 - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -412,17 +412,17 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF24, rSTR1 + LD rWORD2, rOFF24, rSTR2 - cmpld cr7, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 -#endif - bne cr1, L(dLcr1) - bne cr6, L(dLcr6) - b L(dLoop1) + bne cr1, L(dLcr1) + bne cr6, L(dLcr6) + b L(dLoop1) @@ -380,26 +306,21 @@ L(dP3e): registers. */ - .align 4 + .align 4 L(dP3x): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -435,28 +435,28 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF16, rSTR1 + LD rWORD2, rOFF16, rSTR2 - cmpld cr7, rWORD1, rWORD2 - sldi. r12, rN, 3 - bne cr1, L(dLcr1x) + cmpld cr7, rWORD1, rWORD2 + sldi. r12, rN, 3 + bne cr1, L(dLcr1x) -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 -#endif - bne cr6, L(dLcr6x) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - bne cr7, L(dLcr7x) - bne L(d00) + bne cr6, L(dLcr6x) + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + bne cr7, L(dLcr7x) + bne L(d00) + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 0 - blr - + li rRTN, 0 + blr + @@ -407,46 +328,20 @@ L(dP3x): - .align 4 + .align 4 L(dP4): - mtctr r0 + mtctr r0 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -468,7 +468,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, 0, rSTR1 + LD rWORD2, 0, rSTR2 - cmpld cr7, rWORD1, rWORD2 + cmpld cr7, rWORD1, rWORD2 L(dP4e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -481,7 +481,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF8, rSTR1 + LD rWORD4, rOFF8, rSTR2 - cmpld cr1, rWORD3, rWORD4 + cmpld cr1, rWORD3, rWORD4 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - ldbrx rWORD6, 0, rSTR2 @@ -493,7 +493,7 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF16, rSTR1 + LD rWORD6, rOFF16, rSTR2 - cmpld cr6, rWORD5, rWORD6 + cmpld cr6, rWORD5, rWORD6 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -507,12 +507,12 @@ index 09bff69..98b9e54 100644 + LD rWORD8, rOFF24, rSTR2 + addi rSTR1, rSTR1, 24 + addi rSTR2, rSTR2, 24 - cmpld cr5, rWORD7, rWORD8 - bne cr7, L(dLcr7) - bne cr1, L(dLcr1) + cmpld cr5, rWORD7, rWORD8 + bne cr7, L(dLcr7) + bne cr1, L(dLcr1) @@ -454,51 +349,25 @@ L(dP4e): /* This is the primary loop */ - .align 4 + .align 4 L(dLoop): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -525,8 +525,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(dLcr6) + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(dLcr6) L(dLoop1): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -539,8 +539,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF16, rSTR1 + LD rWORD4, rOFF16, rSTR2 - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(dLcr5) + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(dLcr5) L(dLoop2): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 @@ -553,8 +553,8 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF24, rSTR1 + LD rWORD6, rOFF24, rSTR2 - cmpld cr5, rWORD7, rWORD8 - bne cr7, L(dLcr7) + cmpld cr5, rWORD7, rWORD8 + bne cr7, L(dLcr7) L(dLoop3): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 @@ -569,18 +569,18 @@ index 09bff69..98b9e54 100644 + LD rWORD8, rOFF32, rSTR2 + addi rSTR1, rSTR1, 32 + addi rSTR2, rSTR2, 32 - bne cr1, L(dLcr1) - cmpld cr7, rWORD1, rWORD2 - bdnz L(dLoop) + bne cr1, L(dLcr1) + cmpld cr7, rWORD1, rWORD2 + bdnz L(dLoop) @@ -519,62 +388,75 @@ L(d14): - sldi. r12, rN, 3 - bne cr5, L(dLcr5) + sldi. r12, rN, 3 + bne cr5, L(dLcr5) L(d04): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ + subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */ - beq L(zeroLength) + beq L(duzeroLength) /* At this point we have a remainder of 1 to 7 bytes to compare. Since @@ -598,18 +598,18 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - srd rWORD1, rWORD1, rN - srd rWORD2, rWORD2, rN - cmpld cr7, rWORD1, rWORD2 - bne cr7, L(dLcr7x) + srd rWORD1, rWORD1, rN + srd rWORD2, rWORD2, rN + cmpld cr7, rWORD1, rWORD2 + bne cr7, L(dLcr7x) + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 0 - blr - - .align 4 + li rRTN, 0 + blr + + .align 4 L(dLcr7): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) @@ -620,11 +620,11 @@ index 09bff69..98b9e54 100644 + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 1 - bgtlr cr7 - li rRTN, -1 - blr - .align 4 + li rRTN, 1 + bgtlr cr7 + li rRTN, -1 + blr + .align 4 L(dLcr1): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) @@ -635,11 +635,11 @@ index 09bff69..98b9e54 100644 + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 1 - bgtlr cr1 - li rRTN, -1 - blr - .align 4 + li rRTN, 1 + bgtlr cr1 + li rRTN, -1 + blr + .align 4 L(dLcr6): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) @@ -650,11 +650,11 @@ index 09bff69..98b9e54 100644 + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 1 - bgtlr cr6 - li rRTN, -1 - blr - .align 4 + li rRTN, 1 + bgtlr cr6 + li rRTN, -1 + blr + .align 4 L(dLcr5): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) @@ -665,28 +665,28 @@ index 09bff69..98b9e54 100644 + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 1 - bgtlr cr5 - li rRTN, -1 + li rRTN, 1 + bgtlr cr5 + li rRTN, -1 @@ -583,10 +465,6 @@ L(dLcr5x): - .align 4 + .align 4 L(bytealigned): - mtctr rN + mtctr rN -#if 0 -/* Huh? We've already branched on cr6! */ - beq cr6, L(zeroLength) -#endif - + /* We need to prime this loop. This loop is swing modulo scheduled to avoid pipe delays. The dependent instruction latencies (load to @@ -685,6 +563,7 @@ L(b11): L(bx12): - sub rRTN, rWORD1, rWORD2 - blr + sub rRTN, rWORD1, rWORD2 + blr + - .align 4 + .align 4 L(zeroLength): - li rRTN, 0 + li rRTN, 0 @@ -705,42 +584,36 @@ L(zeroLength): we need to adjust the length (rN) and special case the loop versioning for the first DW. This ensures that the loop count is @@ -702,60 +702,60 @@ index 09bff69..98b9e54 100644 - cfi_offset(rSHL, -24) + std rSHL, rSHLSAVE(r1) + cfi_offset(rSHL, rSHLSAVE) - clrldi rSHL, rSTR2, 61 - beq cr6, L(duzeroLength) + clrldi rSHL, rSTR2, 61 + beq cr6, L(duzeroLength) - std rSHR, -32(r1) - cfi_offset(rSHR, -32) + std rSHR, rSHRSAVE(r1) + cfi_offset(rSHR, rSHRSAVE) - beq cr5, L(DWunaligned) + beq cr5, L(DWunaligned) - std rWORD8_SHIFT, -40(r1) - cfi_offset(rWORD8_SHIFT, -40) + std rWORD8_SHIFT, rWORD8SHIFTSAVE(r1) + cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE) /* Adjust the logical start of rSTR2 to compensate for the extra bits in the 1st rSTR1 DW. */ - sub rWORD8_SHIFT, rSTR2, r12 + sub rWORD8_SHIFT, rSTR2, r12 /* But do not attempt to address the DW before that DW that contains the actual start of rSTR2. */ - clrrdi rSTR2, rSTR2, 3 + clrrdi rSTR2, rSTR2, 3 - std rWORD2_SHIFT, -48(r1) - cfi_offset(rWORD2_SHIFT, -48) + std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1) + cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE) /* Compute the left/right shift counts for the unaligned rSTR2, compensating for the logical (DW aligned) start of rSTR1. */ - clrldi rSHL, rWORD8_SHIFT, 61 - clrrdi rSTR1, rSTR1, 3 + clrldi rSHL, rWORD8_SHIFT, 61 + clrrdi rSTR1, rSTR1, 3 - std rWORD4_SHIFT, -56(r1) - cfi_offset(rWORD4_SHIFT, -56) + std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1) + cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE) - sldi rSHL, rSHL, 3 - cmpld cr5, rWORD8_SHIFT, rSTR2 - add rN, rN, r12 - sldi rWORD6, r12, 3 + sldi rSHL, rSHL, 3 + cmpld cr5, rWORD8_SHIFT, rSTR2 + add rN, rN, r12 + sldi rWORD6, r12, 3 - std rWORD6_SHIFT, -64(r1) - cfi_offset(rWORD6_SHIFT, -64) + std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1) + cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE) - subfic rSHR, rSHL, 64 - srdi r0, rN, 5 /* Divide by 32 */ - andi. r12, rN, 24 /* Get the DW remainder */ + subfic rSHR, rSHL, 64 + srdi r0, rN, 5 /* Divide by 32 */ + andi. r12, rN, 24 /* Get the DW remainder */ @@ -750,25 +623,13 @@ L(unaligned): this may cross a page boundary and cause a page fault. */ - li rWORD8, 0 - blt cr5, L(dus0) + li rWORD8, 0 + blt cr5, L(dus0) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD8, 0, rSTR2 + LD rWORD8, 0, rSTR2 - addi rSTR2, rSTR2, 8 + addi rSTR2, rSTR2, 8 -#else - ld rWORD8, 0(rSTR2) - addi rSTR2, rSTR2, 8 -#endif - sld rWORD8, rWORD8, rSHL - + sld rWORD8, rWORD8, rSHL + L(dus0): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -768,13 +768,13 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, 0, rSTR1 + LD rWORD2, 0, rSTR2 - cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - srd r12, rWORD2, rSHR + cmpldi cr1, r12, 16 + cmpldi cr7, rN, 32 + srd r12, rWORD2, rSHR @@ -796,12 +657,7 @@ L(dusP1): - beq L(duZeroReturn) - li r0, 0 - ble cr7, L(dutrim) + beq L(duZeroReturn) + li r0, 0 + ble cr7, L(dutrim) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD2, 0, rSTR2 - addi rSTR2, rSTR2, 8 @@ -782,51 +782,51 @@ index 09bff69..98b9e54 100644 - ld rWORD2, 8(rSTR2) -#endif + LD rWORD2, rOFF8, rSTR2 - srd r0, rWORD2, rSHR - b L(dutrim) + srd r0, rWORD2, rSHR + b L(dutrim) /* Remainder is 16 */ @@ -832,27 +688,21 @@ L(duPs4): compare length is at least 8 bytes. */ - .align 4 + .align 4 L(DWunaligned): - std rWORD8_SHIFT, -40(r1) - cfi_offset(rWORD8_SHIFT, -40) + std rWORD8_SHIFT, rWORD8SHIFTSAVE(r1) + cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE) - clrrdi rSTR2, rSTR2, 3 + clrrdi rSTR2, rSTR2, 3 - std rWORD2_SHIFT, -48(r1) - cfi_offset(rWORD2_SHIFT, -48) + std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1) + cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE) - srdi r0, rN, 5 /* Divide by 32 */ + srdi r0, rN, 5 /* Divide by 32 */ - std rWORD4_SHIFT, -56(r1) - cfi_offset(rWORD4_SHIFT, -56) + std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1) + cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE) - andi. r12, rN, 24 /* Get the DW remainder */ + andi. r12, rN, 24 /* Get the DW remainder */ - std rWORD6_SHIFT, -64(r1) - cfi_offset(rWORD6_SHIFT, -64) + std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1) + cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE) - sldi rSHL, rSHL, 3 + sldi rSHL, rSHL, 3 -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD6, 0, rSTR2 + LD rWORD6, 0, rSTR2 + LD rWORD8, rOFF8, rSTR2 - addi rSTR2, rSTR2, 8 + addi rSTR2, rSTR2, 8 - ldbrx rWORD8, 0, rSTR2 - addi rSTR2, rSTR2, 8 -#else - ld rWORD6, 0(rSTR2) - ldu rWORD8, 8(rSTR2) -#endif - cmpldi cr1, r12, 16 - cmpldi cr7, rN, 32 - clrldi rN, rN, 61 + cmpldi cr1, r12, 16 + cmpldi cr7, rN, 32 + clrldi rN, rN, 61 @@ -867,52 +717,26 @@ L(DWunaligned): - .align 4 + .align 4 L(duP1): - srd r12, rWORD8, rSHR + srd r12, rWORD8, rSHR -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - addi rSTR1, rSTR1, 8 @@ -834,9 +834,9 @@ index 09bff69..98b9e54 100644 - ld rWORD7, 0(rSTR1) -#endif + LD rWORD7, 0, rSTR1 - sld rWORD8_SHIFT, rWORD8, rSHL - or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP1x) + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT + blt cr7, L(duP1x) L(duP1e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -849,10 +849,10 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - cmpld cr5, rWORD7, rWORD8 - srd r0, rWORD2, rSHR - sld rWORD2_SHIFT, rWORD2, rSHL - or rWORD2, r0, rWORD8_SHIFT + cmpld cr5, rWORD7, rWORD8 + srd r0, rWORD2, rSHR + sld rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 - ldbrx rWORD4, 0, rSTR2 @@ -864,11 +864,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF16, rSTR1 + LD rWORD4, rOFF16, rSTR2 - cmpld cr7, rWORD1, rWORD2 - srd r12, rWORD4, rSHR - sld rWORD4_SHIFT, rWORD4, rSHL - bne cr5, L(duLcr5) - or rWORD4, r12, rWORD2_SHIFT + cmpld cr7, rWORD1, rWORD2 + srd r12, rWORD4, rSHR + sld rWORD4_SHIFT, rWORD4, rSHL + bne cr5, L(duLcr5) + or rWORD4, r12, rWORD2_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - ldbrx rWORD6, 0, rSTR2 @@ -880,13 +880,13 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF24, rSTR1 + LD rWORD6, rOFF24, rSTR2 - cmpld cr1, rWORD3, rWORD4 - srd r0, rWORD6, rSHR - sld rWORD6_SHIFT, rWORD6, rSHL + cmpld cr1, rWORD3, rWORD4 + srd r0, rWORD6, rSHR + sld rWORD6_SHIFT, rWORD6, rSHL @@ -932,82 +756,47 @@ L(duP1x): - beq L(duZeroReturn) - li r0, 0 - ble cr7, L(dutrim) + beq L(duZeroReturn) + li r0, 0 + ble cr7, L(dutrim) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD2, 0, rSTR2 - addi rSTR2, rSTR2, 8 @@ -894,12 +894,12 @@ index 09bff69..98b9e54 100644 - ld rWORD2, 8(rSTR2) -#endif + LD rWORD2, rOFF8, rSTR2 - srd r0, rWORD2, rSHR - b L(dutrim) + srd r0, rWORD2, rSHR + b L(dutrim) /* Remainder is 16 */ - .align 4 + .align 4 L(duP2): - srd r0, rWORD8, rSHR + srd r0, rWORD8, rSHR -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - addi rSTR1, rSTR1, 8 @@ -907,8 +907,8 @@ index 09bff69..98b9e54 100644 - ld rWORD5, 0(rSTR1) -#endif + LD rWORD5, 0, rSTR1 - or rWORD6, r0, rWORD6_SHIFT - sld rWORD6_SHIFT, rWORD8, rSHL + or rWORD6, r0, rWORD6_SHIFT + sld rWORD6_SHIFT, rWORD8, rSHL L(duP2e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 @@ -921,11 +921,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD7, rOFF8, rSTR1 + LD rWORD8, rOFF8, rSTR2 - cmpld cr6, rWORD5, rWORD6 - srd r12, rWORD8, rSHR - sld rWORD8_SHIFT, rWORD8, rSHL - or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP2x) + cmpld cr6, rWORD5, rWORD6 + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT + blt cr7, L(duP2x) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -937,11 +937,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF16, rSTR1 + LD rWORD2, rOFF16, rSTR2 - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) - srd r0, rWORD2, rSHR - sld rWORD2_SHIFT, rWORD2, rSHL - or rWORD2, r0, rWORD8_SHIFT + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) + srd r0, rWORD2, rSHR + sld rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 - ldbrx rWORD4, 0, rSTR2 @@ -953,31 +953,31 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF24, rSTR1 + LD rWORD4, rOFF24, rSTR2 - cmpld cr7, rWORD1, rWORD2 - bne cr5, L(duLcr5) - srd r12, rWORD4, rSHR - sld rWORD4_SHIFT, rWORD4, rSHL - or rWORD4, r12, rWORD2_SHIFT + cmpld cr7, rWORD1, rWORD2 + bne cr5, L(duLcr5) + srd r12, rWORD4, rSHR + sld rWORD4_SHIFT, rWORD4, rSHL + or rWORD4, r12, rWORD2_SHIFT -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 -#endif - cmpld cr1, rWORD3, rWORD4 - b L(duLoop2) - .align 4 + cmpld cr1, rWORD3, rWORD4 + b L(duLoop2) + .align 4 L(duP2x): - cmpld cr5, rWORD7, rWORD8 + cmpld cr5, rWORD7, rWORD8 -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 8 - addi rSTR2, rSTR2, 8 + addi rSTR1, rSTR1, 8 + addi rSTR2, rSTR2, 8 -#endif - bne cr6, L(duLcr6) - sldi. rN, rN, 3 - bne cr5, L(duLcr5) + bne cr6, L(duLcr6) + sldi. rN, rN, 3 + bne cr5, L(duLcr5) @@ -1015,12 +804,7 @@ L(duP2x): - beq L(duZeroReturn) - li r0, 0 - ble cr7, L(dutrim) + beq L(duZeroReturn) + li r0, 0 + ble cr7, L(dutrim) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD2, 0, rSTR2 - addi rSTR2, rSTR2, 8 @@ -985,13 +985,13 @@ index 09bff69..98b9e54 100644 - ld rWORD2, 8(rSTR2) -#endif + LD rWORD2, rOFF8, rSTR2 - srd r0, rWORD2, rSHR - b L(dutrim) - + srd r0, rWORD2, rSHR + b L(dutrim) + @@ -1028,73 +812,39 @@ L(duP2x): - .align 4 + .align 4 L(duP3): - srd r12, rWORD8, rSHR + srd r12, rWORD8, rSHR -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 - addi rSTR1, rSTR1, 8 @@ -999,8 +999,8 @@ index 09bff69..98b9e54 100644 - ld rWORD3, 0(rSTR1) -#endif + LD rWORD3, 0, rSTR1 - sld rWORD4_SHIFT, rWORD8, rSHL - or rWORD4, r12, rWORD6_SHIFT + sld rWORD4_SHIFT, rWORD8, rSHL + or rWORD4, r12, rWORD6_SHIFT L(duP3e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 @@ -1013,10 +1013,10 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF8, rSTR1 + LD rWORD6, rOFF8, rSTR2 - cmpld cr1, rWORD3, rWORD4 - srd r0, rWORD6, rSHR - sld rWORD6_SHIFT, rWORD6, rSHL - or rWORD6, r0, rWORD4_SHIFT + cmpld cr1, rWORD3, rWORD4 + srd r0, rWORD6, rSHR + sld rWORD6_SHIFT, rWORD6, rSHL + or rWORD6, r0, rWORD4_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -1028,12 +1028,12 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD7, rOFF16, rSTR1 + LD rWORD8, rOFF16, rSTR2 - cmpld cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) - srd r12, rWORD8, rSHR - sld rWORD8_SHIFT, rWORD8, rSHL - or rWORD8, r12, rWORD6_SHIFT - blt cr7, L(duP3x) + cmpld cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) + srd r12, rWORD8, rSHR + sld rWORD8_SHIFT, rWORD8, rSHL + or rWORD8, r12, rWORD6_SHIFT + blt cr7, L(duP3x) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - ldbrx rWORD2, 0, rSTR2 @@ -1045,34 +1045,34 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF24, rSTR1 + LD rWORD2, rOFF24, rSTR2 - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) - srd r0, rWORD2, rSHR - sld rWORD2_SHIFT, rWORD2, rSHL - or rWORD2, r0, rWORD8_SHIFT + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) + srd r0, rWORD2, rSHR + sld rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 -#endif - cmpld cr7, rWORD1, rWORD2 - b L(duLoop1) - .align 4 + cmpld cr7, rWORD1, rWORD2 + b L(duLoop1) + .align 4 L(duP3x): -#ifndef __LITTLE_ENDIAN__ - addi rSTR1, rSTR1, 16 - addi rSTR2, rSTR2, 16 + addi rSTR1, rSTR1, 16 + addi rSTR2, rSTR2, 16 -#endif -#if 0 -/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) -#endif - cmpld cr5, rWORD7, rWORD8 - bne cr6, L(duLcr6) - sldi. rN, rN, 3 + cmpld cr5, rWORD7, rWORD8 + bne cr6, L(duLcr6) + sldi. rN, rN, 3 @@ -1103,12 +853,7 @@ L(duP3x): - beq L(duZeroReturn) - li r0, 0 - ble cr7, L(dutrim) + beq L(duZeroReturn) + li r0, 0 + ble cr7, L(dutrim) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD2, 0, rSTR2 - addi rSTR2, rSTR2, 8 @@ -1080,13 +1080,13 @@ index 09bff69..98b9e54 100644 - ld rWORD2, 8(rSTR2) -#endif + LD rWORD2, rOFF8, rSTR2 - srd r0, rWORD2, rSHR - b L(dutrim) - + srd r0, rWORD2, rSHR + b L(dutrim) + @@ -1117,51 +862,27 @@ L(duP3x): L(duP4): - mtctr r0 - srd r0, rWORD8, rSHR + mtctr r0 + srd r0, rWORD8, rSHR -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 - addi rSTR1, rSTR1, 8 @@ -1094,8 +1094,8 @@ index 09bff69..98b9e54 100644 - ld rWORD1, 0(rSTR1) -#endif + LD rWORD1, 0, rSTR1 - sld rWORD2_SHIFT, rWORD8, rSHL - or rWORD2, r0, rWORD6_SHIFT + sld rWORD2_SHIFT, rWORD8, rSHL + or rWORD2, r0, rWORD6_SHIFT L(duP4e): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -1108,10 +1108,10 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF8, rSTR1 + LD rWORD4, rOFF8, rSTR2 - cmpld cr7, rWORD1, rWORD2 - srd r12, rWORD4, rSHR - sld rWORD4_SHIFT, rWORD4, rSHL - or rWORD4, r12, rWORD2_SHIFT + cmpld cr7, rWORD1, rWORD2 + srd r12, rWORD4, rSHR + sld rWORD4_SHIFT, rWORD4, rSHL + or rWORD4, r12, rWORD2_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 - ldbrx rWORD6, 0, rSTR2 @@ -1123,11 +1123,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF16, rSTR1 + LD rWORD6, rOFF16, rSTR2 - cmpld cr1, rWORD3, rWORD4 - bne cr7, L(duLcr7) - srd r0, rWORD6, rSHR - sld rWORD6_SHIFT, rWORD6, rSHL - or rWORD6, r0, rWORD4_SHIFT + cmpld cr1, rWORD3, rWORD4 + bne cr7, L(duLcr7) + srd r0, rWORD6, rSHR + sld rWORD6_SHIFT, rWORD6, rSHL + or rWORD6, r0, rWORD4_SHIFT -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 - ldbrx rWORD8, 0, rSTR2 @@ -1141,12 +1141,12 @@ index 09bff69..98b9e54 100644 + LD rWORD8, rOFF24, rSTR2 + addi rSTR1, rSTR1, 24 + addi rSTR2, rSTR2, 24 - cmpld cr6, rWORD5, rWORD6 - bne cr1, L(duLcr1) - srd r12, rWORD8, rSHR + cmpld cr6, rWORD5, rWORD6 + bne cr1, L(duLcr1) + srd r12, rWORD8, rSHR @@ -1172,60 +893,34 @@ L(duP4e): /* This is the primary loop */ - .align 4 + .align 4 L(duLoop): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -1159,11 +1159,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD1, rOFF8, rSTR1 + LD rWORD2, rOFF8, rSTR2 - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) - srd r0, rWORD2, rSHR - sld rWORD2_SHIFT, rWORD2, rSHL - or rWORD2, r0, rWORD8_SHIFT + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) + srd r0, rWORD2, rSHR + sld rWORD2_SHIFT, rWORD2, rSHL + or rWORD2, r0, rWORD8_SHIFT L(duLoop1): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD3, 0, rSTR1 @@ -1176,11 +1176,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD3, rOFF16, rSTR1 + LD rWORD4, rOFF16, rSTR2 - cmpld cr6, rWORD5, rWORD6 - bne cr5, L(duLcr5) - srd r12, rWORD4, rSHR - sld rWORD4_SHIFT, rWORD4, rSHL - or rWORD4, r12, rWORD2_SHIFT + cmpld cr6, rWORD5, rWORD6 + bne cr5, L(duLcr5) + srd r12, rWORD4, rSHR + sld rWORD4_SHIFT, rWORD4, rSHL + or rWORD4, r12, rWORD2_SHIFT L(duLoop2): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD5, 0, rSTR1 @@ -1193,11 +1193,11 @@ index 09bff69..98b9e54 100644 -#endif + LD rWORD5, rOFF24, rSTR1 + LD rWORD6, rOFF24, rSTR2 - cmpld cr5, rWORD7, rWORD8 - bne cr7, L(duLcr7) - srd r0, rWORD6, rSHR - sld rWORD6_SHIFT, rWORD6, rSHL - or rWORD6, r0, rWORD4_SHIFT + cmpld cr5, rWORD7, rWORD8 + bne cr7, L(duLcr7) + srd r0, rWORD6, rSHR + sld rWORD6_SHIFT, rWORD6, rSHL + or rWORD6, r0, rWORD4_SHIFT L(duLoop3): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD7, 0, rSTR1 @@ -1212,24 +1212,24 @@ index 09bff69..98b9e54 100644 + LD rWORD8, rOFF32, rSTR2 + addi rSTR1, rSTR1, 32 + addi rSTR2, rSTR2, 32 - cmpld cr7, rWORD1, rWORD2 - bne cr1, L(duLcr1) - srd r12, rWORD8, rSHR + cmpld cr7, rWORD1, rWORD2 + bne cr1, L(duLcr1) + srd r12, rWORD8, rSHR @@ -1234,10 +929,6 @@ L(duLoop3): - bdnz L(duLoop) - + bdnz L(duLoop) + L(duL4): -#if 0 -/* Huh? We've already branched on cr1! */ - bne cr1, L(duLcr1) -#endif - cmpld cr1, rWORD3, rWORD4 - bne cr6, L(duLcr6) - cmpld cr6, rWORD5, rWORD6 + cmpld cr1, rWORD3, rWORD4 + bne cr6, L(duLcr6) + cmpld cr6, rWORD5, rWORD6 @@ -1264,99 +955,102 @@ L(du14): - beq L(duZeroReturn) - li r0, 0 - ble cr7, L(dutrim) + beq L(duZeroReturn) + li r0, 0 + ble cr7, L(dutrim) -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD2, 0, rSTR2 - addi rSTR2, rSTR2, 8 @@ -1237,8 +1237,8 @@ index 09bff69..98b9e54 100644 - ld rWORD2, 8(rSTR2) -#endif + LD rWORD2, rOFF8, rSTR2 - srd r0, rWORD2, rSHR - .align 4 + srd r0, rWORD2, rSHR + .align 4 L(dutrim): -#ifdef __LITTLE_ENDIAN__ - ldbrx rWORD1, 0, rSTR1 @@ -1246,97 +1246,97 @@ index 09bff69..98b9e54 100644 - ld rWORD1, 8(rSTR1) -#endif + LD rWORD1, rOFF8, rSTR1 - ld rWORD8, -8(r1) - subfic rN, rN, 64 /* Shift count is 64 - (rN * 8). */ - or rWORD2, r0, rWORD8_SHIFT + ld rWORD8, -8(r1) + subfic rN, rN, 64 /* Shift count is 64 - (rN * 8). */ + or rWORD2, r0, rWORD8_SHIFT - ld rWORD7, -16(r1) - ld rSHL, -24(r1) + ld rWORD7, rWORD7SAVE(r1) + ld rSHL, rSHLSAVE(r1) - srd rWORD1, rWORD1, rN - srd rWORD2, rWORD2, rN + srd rWORD1, rWORD1, rN + srd rWORD2, rWORD2, rN - ld rSHR, -32(r1) - ld rWORD8_SHIFT, -40(r1) + ld rSHR, rSHRSAVE(r1) + ld rWORD8_SHIFT, rWORD8SHIFTSAVE(r1) - li rRTN, 0 - cmpld cr7, rWORD1, rWORD2 + li rRTN, 0 + cmpld cr7, rWORD1, rWORD2 - ld rWORD2_SHIFT, -48(r1) - ld rWORD4_SHIFT, -56(r1) + ld rWORD2_SHIFT, rWORD2SHIFTSAVE(r1) + ld rWORD4_SHIFT, rWORD4SHIFTSAVE(r1) - beq cr7, L(dureturn24) - li rRTN, 1 + beq cr7, L(dureturn24) + li rRTN, 1 - ld rWORD6_SHIFT, -64(r1) + ld rWORD6_SHIFT, rWORD6SHIFTSAVE(r1) + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - bgtlr cr7 - li rRTN, -1 - blr - .align 4 + bgtlr cr7 + li rRTN, -1 + blr + .align 4 L(duLcr7): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - li rRTN, 1 - bgt cr7, L(dureturn29) + li rRTN, 1 + bgt cr7, L(dureturn29) - ld rSHL, -24(r1) - ld rSHR, -32(r1) + ld rSHL, rSHLSAVE(r1) + ld rSHR, rSHRSAVE(r1) - li rRTN, -1 - b L(dureturn27) - .align 4 + li rRTN, -1 + b L(dureturn27) + .align 4 L(duLcr1): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - li rRTN, 1 - bgt cr1, L(dureturn29) + li rRTN, 1 + bgt cr1, L(dureturn29) - ld rSHL, -24(r1) - ld rSHR, -32(r1) + ld rSHL, rSHLSAVE(r1) + ld rSHR, rSHRSAVE(r1) - li rRTN, -1 - b L(dureturn27) - .align 4 + li rRTN, -1 + b L(dureturn27) + .align 4 L(duLcr6): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - li rRTN, 1 - bgt cr6, L(dureturn29) + li rRTN, 1 + bgt cr6, L(dureturn29) - ld rSHL, -24(r1) - ld rSHR, -32(r1) + ld rSHL, rSHLSAVE(r1) + ld rSHR, rSHRSAVE(r1) - li rRTN, -1 - b L(dureturn27) - .align 4 + li rRTN, -1 + b L(dureturn27) + .align 4 L(duLcr5): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) + ld rWORD8, rWORD8SAVE(r1) + ld rWORD7, rWORD7SAVE(r1) - li rRTN, 1 - bgt cr5, L(dureturn29) + li rRTN, 1 + bgt cr5, L(dureturn29) - ld rSHL, -24(r1) - ld rSHR, -32(r1) + ld rSHL, rSHLSAVE(r1) + ld rSHR, rSHRSAVE(r1) - li rRTN, -1 - b L(dureturn27) + li rRTN, -1 + b L(dureturn27) + - .align 3 + .align 3 L(duZeroReturn): - li rRTN, 0 - .align 4 + li rRTN, 0 + .align 4 L(dureturn): - ld rWORD8, -8(r1) - ld rWORD7, -16(r1) @@ -1363,12 +1363,13 @@ index 09bff69..98b9e54 100644 + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - blr + blr + L(duzeroLength): + ld rOFF8, rOFF8SAVE(r1) + ld rOFF16, rOFF16SAVE(r1) + ld rOFF24, rOFF24SAVE(r1) + ld rOFF32, rOFF32SAVE(r1) - li rRTN, 0 - blr + li rRTN, 0 + blr + diff --git a/SOURCES/glibc-rh1240351-2.patch b/SOURCES/glibc-rh1240351-2.patch index b557f23f..0d479689 100644 --- a/SOURCES/glibc-rh1240351-2.patch +++ b/SOURCES/glibc-rh1240351-2.patch @@ -2,29 +2,29 @@ commit 487972aea52004f604c2878c8c9d3e77670f2c32 Author: Adhemerval Zanella Date: Thu Feb 27 09:43:51 2014 -0600 - + PowerPC: Optimized isnan/isnanf for POWER8 - + This patch add a optimized isnan/isnanf implementation for POWER8 using the new Move From VSR Doubleword instruction to gains some cycles from FP to GRP register move. - + ChangeLog: - 2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): - Add hwcap2 initialization. - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isnan power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: New file: - POWER8 isnan ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c (__isnan): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c (__isnanf): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: New file: - POWER8 isnan implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: New file. + 2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): + Add hwcap2 initialization. + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isnan power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: New file: + POWER8 isnan ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c (__isnan): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c (__isnanf): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: New file: + POWER8 isnan implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: New file. diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h index 51a34f2..72d720d 100644 @@ -37,7 +37,7 @@ index 51a34f2..72d720d 100644 + unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \ if (hwcap & PPC_FEATURE_ARCH_2_06) \ hwcap |= PPC_FEATURE_ARCH_2_05 | \ - PPC_FEATURE_POWER5_PLUS | \ + PPC_FEATURE_POWER5_PLUS | \ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 1e04f21..4cd1c5d 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -48,7 +48,7 @@ index 1e04f21..4cd1c5d 100644 s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \ - s_modff-power5+ s_modff-ppc64 + s_modff-power5+ s_modff-ppc64 s_isnan-power8 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -21,7 +21,8 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -58,7 +58,7 @@ index 1e04f21..4cd1c5d 100644 - e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 + e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \ + s_isnan-power8 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S @@ -109,7 +109,7 @@ index 0de833e..65a5ca0 100644 extern __typeof (__isnan) __isnan_power6x attribute_hidden; extern __typeof (__isnan) __isnan_power7 attribute_hidden; +extern __typeof (__isnan) __isnan_power8 attribute_hidden; - + libc_ifunc (__isnan, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 : @@ -119,7 +119,7 @@ index 0de833e..65a5ca0 100644 + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __isnan_power7 : + (hwcap & PPC_FEATURE_POWER6_EXT) - ? __isnan_power6x : + ? __isnan_power6x : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __isnan_power6 : - (hwcap & PPC_FEATURE_POWER5) @@ -129,7 +129,7 @@ index 0de833e..65a5ca0 100644 + (hwcap & PPC_FEATURE_POWER5) + ? __isnan_power5 : __isnan_ppc64); - + weak_alias (__isnan, isnan) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c index b237455..eb68a50 100644 @@ -140,7 +140,7 @@ index b237455..eb68a50 100644 extern __typeof (__isnanf) __isnan_power6x attribute_hidden; extern __typeof (__isnanf) __isnan_power7 attribute_hidden; +extern __typeof (__isnanf) __isnan_power8 attribute_hidden; - + libc_ifunc (__isnanf, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 : @@ -161,7 +161,7 @@ index b237455..eb68a50 100644 + (hwcap & PPC_FEATURE_POWER5) + ? __isnan_power5 : __isnan_ppc64); - + weak_alias (__isnanf, isnanf) diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S new file mode 100644 diff --git a/SOURCES/glibc-rh1240351-3.patch b/SOURCES/glibc-rh1240351-3.patch index 0fb35148..2a095027 100644 --- a/SOURCES/glibc-rh1240351-3.patch +++ b/SOURCES/glibc-rh1240351-3.patch @@ -1,105 +1,105 @@ Backport of the following patches: - + commit 4393fc119c34e97519b9b7a4fc94066b283be452 Author: Adhemerval Zanella Date: Thu Feb 27 09:45:41 2014 -0600 - + PowerPC: Optimized isinf/isinff for POWER8 - + This patch add a optimized isinf/isinff implementation for POWER8 using the new Move From VSR Doubleword instruction to gains some cycles from FP to GRP register move. - + ChangeLog: - 2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isinf power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: New file: - POWER8 isinf ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinf): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c (__isinff): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: New file: - POWER8 isinf implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: New file. - + 2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isinf power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: New file: + POWER8 isinf ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinf): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c (__isinff): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: New file: + POWER8 isinf implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: New file. + commit cac626d60a863e48ab75417064984769e58c5719 Author: Adhemerval Zanella Date: Thu Feb 27 09:46:46 2014 -0600 - + PowerPC: Optimized finite/finitef for POWER8 - + This patch add a optimized finite/finitef implementation for POWER8 using the new Move From VSR Doubleword instruction to gains some cycles from FP to GRP register move. - + ChangeLog: - 2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add finite power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: New file: - POWER8 finite ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finite): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c (__finitef): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: New file: - POWER8 finite implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: New file. - + 2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add finite power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: New file: + POWER8 finite ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finite): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c (__finitef): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: New file: + POWER8 finite implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: New file. + commit 1ad8950a3ea4056ed343d681b5146f4b4aa27e10 Author: Adhemerval Zanella Date: Tue Feb 18 09:29:29 2014 -0500 - + PowerPC: llrint/llrintf POWER8 optimization - + This patch add a optimized llrint/llrintf implementation for POWER8 using the new Move From VSR Doubleword instruction to gains some cycles from FP to GRP register move. - + ChangeLog: - 2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llrint power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: New file: - POWER8 llrint ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c (__lllrint): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: New file: - POWER8 llrint implementation. - + 2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llrint power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: New file: + POWER8 llrint ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c (__lllrint): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: New file: + POWER8 llrint implementation. + commit fe13a20c37578f08ce393ccaeb45caeb48815ca5 Author: Adhemerval Zanella Date: Mon Feb 17 10:44:08 2014 -0600 - + PowerPC: llround/llroundf POWER8 optimization - + This patch add a optimized llround/llroundf implementation for POWER8 using the new Move From VSR Doubleword instruction to gains some cycles from FP to GRP register move. - + ChangeLog: - 2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llround power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: New file: - POWER8 llround ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c (__lllround): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: New file: - POWER8 llround implementation. - + 2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llround power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: New file: + POWER8 llround ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c (__lllround): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: New file: + POWER8 llround implementation. + commit 757d9dd5c3efa56fac75965abc014faaae7b7895 Author: Adhemerval Zanella Date: Mon Mar 31 08:00:38 2014 -0500 - + PowerPC: Fix little endian enconding for mfvsrd - + This patch fixes the MFVSRD_R3_V1 macro that encodes 'mfvsrd r3,vs1' (to support old binutils) for little endian. @@ -114,7 +114,7 @@ index 4cd1c5d..3e2127b 100644 - s_modff-power5+ s_modff-ppc64 s_isnan-power8 + s_modff-power5+ s_modff-ppc64 s_isnan-power8 \ + s_isinf-power8 s_finite-power8 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -22,7 +23,8 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -124,7 +124,7 @@ index 4cd1c5d..3e2127b 100644 - s_isnan-power8 + s_isnan-power8 s_isinf-power8 s_finite-power8 \ + s_llrint-power8 s_llround-power8 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S @@ -171,11 +171,11 @@ index f79a93e..b9e908d 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c @@ -23,10 +23,13 @@ - + extern __typeof (__finite) __finite_ppc64 attribute_hidden; extern __typeof (__finite) __finite_power7 attribute_hidden; +extern __typeof (__finite) __finite_power8 attribute_hidden; - + libc_ifunc (__finite, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 @@ -184,7 +184,7 @@ index f79a93e..b9e908d 100644 + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __finite_power7 : __finite_ppc64); - + weak_alias (__finite, finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c index a7243b5..30b34bc 100644 @@ -195,7 +195,7 @@ index a7243b5..30b34bc 100644 /* The double-precision version also works for single-precision. */ extern __typeof (__finitef) __finite_power7 attribute_hidden; +extern __typeof (__finitef) __finite_power8 attribute_hidden; - + libc_ifunc (__finitef, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 @@ -204,7 +204,7 @@ index a7243b5..30b34bc 100644 + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __finite_power7 : __finitef_ppc64); - + weak_alias (__finitef, finitef) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S new file mode 100644 @@ -250,11 +250,11 @@ index 1ee230b..e349a06 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c @@ -23,10 +23,13 @@ - + extern __typeof (__isinf) __isinf_ppc64 attribute_hidden; extern __typeof (__isinf) __isinf_power7 attribute_hidden; +extern __typeof (__isinf) __isinf_power8 attribute_hidden; - + libc_ifunc (__isinf, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 @@ -263,7 +263,7 @@ index 1ee230b..e349a06 100644 + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __isinf_power7 : __isinf_ppc64); - + weak_alias (__isinf, isinf) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c index 1336feb..71da7a3 100644 @@ -274,7 +274,7 @@ index 1336feb..71da7a3 100644 /* The double-precision version also works for single-precision. */ extern __typeof (__isinff) __isinf_power7 attribute_hidden; +extern __typeof (__isinff) __isinf_power8 attribute_hidden; - + libc_ifunc (__isinff, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 @@ -283,7 +283,7 @@ index 1336feb..71da7a3 100644 + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __isinf_power7 : __isinff_ppc64); - + weak_alias (__isinff, isinff) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S new file mode 100644 @@ -327,11 +327,11 @@ index 5818b53..cf1b2e4 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c @@ -30,10 +30,13 @@ - + extern __typeof (__llrint) __llrint_ppc64 attribute_hidden; extern __typeof (__llrint) __llrint_power6x attribute_hidden; +extern __typeof (__llrint) __llrint_power8 attribute_hidden; - + libc_ifunc (__llrint, - (hwcap & PPC_FEATURE_POWER6_EXT) - ? __llrint_power6x @@ -340,7 +340,7 @@ index 5818b53..cf1b2e4 100644 + (hwcap & PPC_FEATURE_POWER6_EXT) + ? __llrint_power6x : __llrint_ppc64); - + weak_alias (__llrint, llrint) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S new file mode 100644 @@ -388,7 +388,7 @@ index a4d1bf3..7dba17e 100644 extern __typeof (__llround) __llround_power5plus attribute_hidden; extern __typeof (__llround) __llround_power6x attribute_hidden; +extern __typeof (__llround) __llround_power8 attribute_hidden; - + libc_ifunc (__llround, - (hwcap & PPC_FEATURE_POWER6_EXT) - ? __llround_power6x : @@ -401,7 +401,7 @@ index a4d1bf3..7dba17e 100644 + (hwcap & PPC_FEATURE_POWER5_PLUS) + ? __llround_power5plus : __llround_ppc64); - + weak_alias (__llround, llround) diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S new file mode 100644 @@ -553,13 +553,13 @@ index c1ca9a5..cb96d03 100644 @@ -19,8 +19,8 @@ #include #include - + -#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ - +#define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */ -+ ++ /* int [r3] __isnan([f1] x) */ - + EALIGN (__isnan, 4, 0) diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S new file mode 100644 diff --git a/SOURCES/glibc-rh1240351-4.patch b/SOURCES/glibc-rh1240351-4.patch index e49b53ed..7b570d40 100644 --- a/SOURCES/glibc-rh1240351-4.patch +++ b/SOURCES/glibc-rh1240351-4.patch @@ -3,21 +3,21 @@ commit 69f13dbf06c6195de0ada8632271d58ca3cf55da Author: Adhemerval Zanella Date: Thu Sep 26 09:29:19 2013 -0500 - + PowerPC: strcpy/stpcpy optimization for PPC64/POWER7 - + This patch intends to unify both strcpy and stpcpy implementationsi for PPC64 and PPC64/POWER7. The idead default powerpc64 implementation is to provide both doubleword and word aligned memory access. - + For PPC64/POWER7 is also provide doubleword and word memory access, remove the branch hints, use the cmpb instruction for compare doubleword/words, and add an optimization for inputs of same alignment. - + ChangeLog: - + 2013-10-04 Adhemerval Zanella - + * sysdeps/powerpc/powerpc64/strcpy.S (strcpy): Add word load/store to provide a boost for large inputs with word alignment. * sysdeps/powerpc/powerpc64/stpcpy.S (__stpcpy): Rewrite @@ -346,18 +346,18 @@ index d795b61..09aa3be 100644 - Copyright (C) 1997, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1997-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 @@ -16,123 +16,9 @@ License along with the GNU C Library; if not, see . */ - + -#include -#include -#include +#define USE_AS_STPCPY +#include - + -/* See strlen.s for comments on how the end-of-string testing works. */ - -/* char * [r3] stpcpy (char *dest [r3], const char *src [r4]) */ @@ -484,19 +484,19 @@ index 9434c27..793325d 100644 - Copyright (C) 1997, 1999, 2000, 2002, 2003, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-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 @@ -17,52 +17,43 @@ . */ - + #include -#include -#include - + /* See strlen.s for comments on how the end-of-string testing works. */ - + /* char * [r3] strcpy (char *dest [r3], const char *src [r4]) */ - + -EALIGN (BP_SYM (strcpy), 4, 0) +#ifdef USE_AS_STPCPY +# define FUNC_NAME __stpcpy @@ -505,8 +505,8 @@ index 9434c27..793325d 100644 +#endif + +EALIGN (FUNC_NAME, 4, 0) - CALL_MCOUNT 2 - + CALL_MCOUNT 2 + #define rTMP r0 -#define rRTN r3 /* incoming DEST arg preserved as result */ -/* Note. The Bounded pointer support in this code is broken. This code @@ -535,7 +535,7 @@ index 9434c27..793325d 100644 +#define r7F7F r8 /* constant 0x7f7f7f7f | 0x7f7f7f7f7f7f7f7f */ +#define rNEG r9 /* ~(word in s1 | r7F7F) */ #define rALT r10 /* alternate word from src */ - + - CHECK_BOUNDS_LOW (rSRC, rLOW, rHIGH) - CHECK_BOUNDS_LOW (rDEST, rLOW, rHIGH) - STORE_RETURN_BOUNDS (rLOW, rHIGH) @@ -545,8 +545,8 @@ index 9434c27..793325d 100644 +/* Save the dst pointer to use as return value. */ + mr rRTN, r3 +#endif - or rTMP, rSRC, rRTN - clrldi. rTMP, rTMP, 61 + or rTMP, rSRC, rRTN + clrldi. rTMP, rTMP, 61 -#if __BOUNDED_POINTERS__ - addi rDEST, rDEST, -8 -#else @@ -558,95 +558,95 @@ index 9434c27..793325d 100644 + +/* For doubleword aligned memory, operate using doubleword load and stores. */ + addi rRTN, rRTN, -8 - - lis rFEFE, -0x101 - lis r7F7F, 0x7f7f + + lis rFEFE, -0x101 + lis r7F7F, 0x7f7f @@ -75,13 +66,13 @@ EALIGN (BP_SYM (strcpy), 4, 0) - b L(g2) - + b L(g2) + L(g0): ldu rALT, 8(rSRC) - stdu rWORD, 8(rDEST) + stdu rWORD, 8(rRTN) - add rTMP, rFEFE, rALT - nor rNEG, r7F7F, rALT - and. rTMP, rTMP, rNEG - bne- L(g1) - ldu rWORD, 8(rSRC) + add rTMP, rFEFE, rALT + nor rNEG, r7F7F, rALT + and. rTMP, rTMP, rNEG + bne- L(g1) + ldu rWORD, 8(rSRC) - stdu rALT, 8(rDEST) + stdu rALT, 8(rRTN) L(g2): add rTMP, rFEFE, rWORD - nor rNEG, r7F7F, rWORD - and. rTMP, rTMP, rNEG + nor rNEG, r7F7F, rWORD + and. rTMP, rTMP, rNEG @@ -92,80 +83,134 @@ L(g2): add rTMP, rFEFE, rWORD L(g1): #ifdef __LITTLE_ENDIAN__ - extrdi. rTMP, rALT, 8, 56 + extrdi. rTMP, rALT, 8, 56 - stb rALT, 8(rDEST) + stbu rALT, 8(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 48 + beqlr- + extrdi. rTMP, rALT, 8, 48 - stb rTMP, 9(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 40 + beqlr- + extrdi. rTMP, rALT, 8, 40 - stb rTMP, 10(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 32 + beqlr- + extrdi. rTMP, rALT, 8, 32 - stb rTMP, 11(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 24 + beqlr- + extrdi. rTMP, rALT, 8, 24 - stb rTMP, 12(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 16 + beqlr- + extrdi. rTMP, rALT, 8, 16 - stb rTMP, 13(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 8 + beqlr- + extrdi. rTMP, rALT, 8, 8 - stb rTMP, 14(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi rTMP, rALT, 8, 0 + beqlr- + extrdi rTMP, rALT, 8, 0 - stb rTMP, 15(rDEST) - blr + stbu rTMP, 1(rRTN) #else - extrdi. rTMP, rALT, 8, 0 + extrdi. rTMP, rALT, 8, 0 - stb rTMP, 8(rDEST) + stbu rTMP, 8(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 8 + beqlr- + extrdi. rTMP, rALT, 8, 8 - stb rTMP, 9(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 16 + beqlr- + extrdi. rTMP, rALT, 8, 16 - stb rTMP, 10(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 24 + beqlr- + extrdi. rTMP, rALT, 8, 24 - stb rTMP, 11(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 32 + beqlr- + extrdi. rTMP, rALT, 8, 32 - stb rTMP, 12(rDEST) - beqlr- + stbu rTMP, 1(rRTN) + beqlr - extrdi. rTMP, rALT, 8, 40 + extrdi. rTMP, rALT, 8, 40 - stb rTMP, 13(rDEST) + stbu rTMP, 1(rRTN) - beqlr- - extrdi. rTMP, rALT, 8, 48 + beqlr- + extrdi. rTMP, rALT, 8, 48 - stb rTMP, 14(rDEST) + stbu rTMP, 1(rRTN) - beqlr- + beqlr- - stb rALT, 15(rDEST) - /* GKM FIXME: check high bound. */ + stbu rALT, 1(rRTN) +#endif - blr + blr + +L(check_word_alignment): + clrldi. rTMP, rTMP, 62 @@ -703,38 +703,38 @@ index 9434c27..793325d 100644 + stbu rALT, 1(rRTN) #endif + blr - + /* Oh well. In this case, we just do a byte-by-byte copy. */ - .align 4 - nop + .align 4 + nop L(unaligned): - lbz rWORD, 0(rSRC) + lbz rWORD, 0(rSRC) - addi rDEST, rRTN, -1 + addi rRTN, rRTN, -1 - cmpwi rWORD, 0 - beq- L(u2) - + cmpwi rWORD, 0 + beq- L(u2) + L(u0): lbzu rALT, 1(rSRC) - stbu rWORD, 1(rDEST) + stbu rWORD, 1(rRTN) - cmpwi rALT, 0 - beq- L(u1) - nop /* Let 601 load start of loop. */ - lbzu rWORD, 1(rSRC) + cmpwi rALT, 0 + beq- L(u1) + nop /* Let 601 load start of loop. */ + lbzu rWORD, 1(rSRC) - stbu rALT, 1(rDEST) + stbu rALT, 1(rRTN) - cmpwi rWORD, 0 - bne+ L(u0) + cmpwi rWORD, 0 + bne+ L(u0) -L(u2): stb rWORD, 1(rDEST) - /* GKM FIXME: check high bound. */ +L(u2): stbu rWORD, 1(rRTN) - blr + blr -L(u1): stb rALT, 1(rDEST) - /* GKM FIXME: check high bound. */ +L(u1): stbu rALT, 1(rRTN) - blr + blr +END (FUNC_NAME) - + -END (BP_SYM (strcpy)) +#ifndef USE_AS_STPCPY libc_hidden_builtin_def (strcpy) diff --git a/SOURCES/glibc-rh1240351-5.patch b/SOURCES/glibc-rh1240351-5.patch index 6d8d9f69..3665fc60 100644 --- a/SOURCES/glibc-rh1240351-5.patch +++ b/SOURCES/glibc-rh1240351-5.patch @@ -1,52 +1,52 @@ Backport of the following commit: - + commit 96d6fd6c4060d739abb1822e7ad633af749532b2 Author: Adhemerval Zanella Date: Tue Dec 23 05:59:44 2014 -0600 - + powerpc: Optimized st{r,p}cpy for POWER8/PPC64 - + This patch adds an optimized POWER8 strcpy using unaligned accesses. For strings up to 16 bytes the implementation first calculate the string size, like strlen, and issues a memcpy. For larger strings, source is first aligned to 16 bytes and then tested over a loop that reads 16 bytes am combine the cmpb results for speedup. Special case is added for page cross reads. - + It shows 30%-60% improvement over the optimized POWER7 one that uses only aligned accesses. - + ChangeLog: - 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add - strcpy-power8 and stpcpy-power8 objects. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add __strcpy_power8 and __stpcpy_power8 - implementations. - * sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S: New file: - multiarch stpcpy implementation for POWER8. - * sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S: New file; - multiarch strcpy implementation for POWER8. - * sysdeps/powerpc/powerpc64/multiarch/strcpy.c (strcpy): Add - __strcpy_power8 function. - * sysdeps/powerpc/powerpc64/power8/stpcpy.S: New file: optimized - stpcpy for POWER8. - * sysdeps/powerpc/powerpc64/power8/strcpy.S: New file: optimized - strcpy for POWER8. - * NEWS: Update. - + 2015-01-13 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add + strcpy-power8 and stpcpy-power8 objects. + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c + (__libc_ifunc_impl_list): Add __strcpy_power8 and __stpcpy_power8 + implementations. + * sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S: New file: + multiarch stpcpy implementation for POWER8. + * sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S: New file; + multiarch strcpy implementation for POWER8. + * sysdeps/powerpc/powerpc64/multiarch/strcpy.c (strcpy): Add + __strcpy_power8 function. + * sysdeps/powerpc/powerpc64/power8/stpcpy.S: New file: optimized + stpcpy for POWER8. + * sysdeps/powerpc/powerpc64/power8/strcpy.S: New file: optimized + strcpy for POWER8. + * NEWS: Update. + and the commits it depends on: - + commit a52374e82b90a6039c720f7b9b7dfa9db24ff4f0 Author: Adhemerval Zanella Date: Fri Dec 13 14:55:22 2013 -0500 - + PowerPC: multiarch stpcpy for PowerPC64 - + ChangeLog: 2013-12-13 Adhemerval Zanella - + * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add stpcpy multiarch implementations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -55,16 +55,16 @@ * sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c: New file. * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c : New file: multiarch stpcpy for PPC64. - + commit 7f5ec11336e46d0449a6b5a8e5a0604c3c78ecbf Author: Adhemerval Zanella Date: Fri Dec 13 14:54:41 2013 -0500 - + PowerPC: multiarch strcpy for PowerPC64 - + ChangeLog: 2013-12-13 Adhemerval Zanella - + * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strcpy multiarch implementations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -93,7 +93,7 @@ index 2d21ce1..e89fd3e 100644 +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -34,6 +34,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, size_t i = 0; - + unsigned long int hwcap = GLRO(dl_hwcap); + unsigned long int hwcap2 = GLRO(dl_hwcap2); + @@ -103,7 +103,7 @@ index 2d21ce1..e89fd3e 100644 @@ -71,6 +73,24 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memset_power4) IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strcpy.c. */ + IFUNC_IMPL (i, name, strcpy, + IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07, diff --git a/SOURCES/glibc-rh1240351-6.patch b/SOURCES/glibc-rh1240351-6.patch index f5c8dd6f..bc39f545 100644 --- a/SOURCES/glibc-rh1240351-6.patch +++ b/SOURCES/glibc-rh1240351-6.patch @@ -2,41 +2,41 @@ commit 94c9680945369d63ef9ed266a29f28ebaaaeb5ce Author: Adhemerval Zanella Date: Tue Dec 23 13:36:34 2014 -0500 - + powerpc: Optimized strcat for POWER8/PPC64 - + With new optimized strcpy for POWER8, this patch adds an optimized strcat which uses it along with default implementation at strings/. - + ChangeLog: 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add - strncat-power8 object. - * sysdeps/powerpc/powerpc64/multiarch/strcat.c (strcat): Add - __strcat_power8 implementation. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add __strcat_power8 implementation. - * sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c: New file: - optimized strcat for power8. - + + * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add + strncat-power8 object. + * sysdeps/powerpc/powerpc64/multiarch/strcat.c (strcat): Add + __strcat_power8 implementation. + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c + (__libc_ifunc_impl_list): Add __strcat_power8 implementation. + * sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c: New file: + optimized strcat for power8. + and its dependency: - + commit bc8ea38590070604006399e42469087e943fc8ec Author: Vidya Ranganathan Date: Wed Jun 11 22:21:20 2014 -0500 - + PowerPC: strcat optimization for PPC64/POWER7 - + This patch adds an ifunc power7 strcat symbol that uses the logic on sysdeps/powerpc/strcat.c but call power7 strlen/strcpy symbols instead of default ones. - + ChangeLog: - + 2014-07-02 Vidya Ranganathan Adhemerval Zanella - + * sysdeps/powerpc/strcat.c: Using macro to redefine symbol name. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strcat multiarch optimizations. @@ -66,7 +66,7 @@ index e89fd3e..4e5bb17 100644 @@ -211,6 +211,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, __strncasecmp_l_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */ + IFUNC_IMPL (i, name, strcat, + IFUNC_IMPL_ADD (array, i, strcat, @@ -231,15 +231,15 @@ index 28575d0..393bee6 100644 --- a/sysdeps/powerpc/strcat.c +++ b/sysdeps/powerpc/strcat.c @@ -18,13 +18,16 @@ - + #include - + -#undef strcat +#ifndef STRCAT +# undef strcat +# define STRCAT strcat +#endif - + /* Append SRC on the end of DEST. */ char * -strcat (char *dest, const char *src) diff --git a/SOURCES/glibc-rh1240351-7.patch b/SOURCES/glibc-rh1240351-7.patch index 9d3e288d..87feb4a0 100644 --- a/SOURCES/glibc-rh1240351-7.patch +++ b/SOURCES/glibc-rh1240351-7.patch @@ -1,29 +1,29 @@ Backport of the addition of sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c from the following: - + commit 9f2f36e5a91c2ce6edba5415e176155eb1008ae1 Author: Adhemerval Zanella Date: Tue Dec 23 13:39:23 2014 -0500 - + powerpc: Optimized strncat for POWER7/PPC64 - + With 3eb38795dbbbd816 (Simplify strncat) the generic algorithms uses strlen, strnlen, and memcpy. This is faster than POWER7 current implementation, especially for unaligned strings (where POWER7 code uses byte-byte operations). - + This patch removes the assembly implementation and uses a multiarch specialization based on default algorithm calling optimized POWER7 symbols. - + ChangeLog: 2015-01-13 Adhemerval Zanella - + * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c: New file. * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S: Remove file. * sysdeps/powerpc/powerpc64/power7/strncat.S: Likewise. - + plus the addition of strncat-power7 to sysdeps/powerpc/powerpc64/multiarch/Makefile diff --git a/SOURCES/glibc-rh1240351-8.patch b/SOURCES/glibc-rh1240351-8.patch index d0826eda..c0207ee0 100644 --- a/SOURCES/glibc-rh1240351-8.patch +++ b/SOURCES/glibc-rh1240351-8.patch @@ -1,48 +1,48 @@ Backport of: - + commit f06a4faf8a2b4d046eb40e94b47948cc47d79902 Author: Adhemerval Zanella Date: Wed Dec 31 11:47:41 2014 -0500 - + powerpc: Optimized st{r,p}ncpy for POWER8/PPC64 - + This patch adds an optimized POWER8 st{r,p}ncpy using unaligned accesses. It shows 10%-80% improvement over the optimized POWER7 one that uses only aligned accesses, specially on unaligned inputs. - + The algorithm first read and check 16 bytes (if inputs do not cross a 4K page size). The it realign source to 16-bytes and issue a 16 bytes read and compare loop to speedup null byte checks for large strings. Also, different from POWER7 optimization, the null pad is done inline in the implementation using possible unaligned accesses, instead of realying on a memset call. Special case is added for page cross reads. - + ChangeLog: - 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: - Add strncpy-power8 and stpncpy-power8 objects. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add __strncpy_power8 and stpncpy_power8 - implementations. - * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: New file. - * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c (__stpncpy): Add - __stpncpy_power8 implementation. - * sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S: New file. - * sysdeps/powerpc/powerpc64/multiarch/strncpy.c (strncpy): Add - __strncpy_power8 implementation. - * sysdeps/powerpc/powerpc64/power8/stpncpy.S: New file. - * sysdeps/powerpc/powerpc64/power8/strncpy.S: New file. - * NEWS: Update. - + 2015-01-13 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: + Add strncpy-power8 and stpncpy-power8 objects. + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c + (__libc_ifunc_impl_list): Add __strncpy_power8 and stpncpy_power8 + implementations. + * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: New file. + * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c (__stpncpy): Add + __stpncpy_power8 implementation. + * sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S: New file. + * sysdeps/powerpc/powerpc64/multiarch/strncpy.c (strncpy): Add + __strncpy_power8 implementation. + * sysdeps/powerpc/powerpc64/power8/stpncpy.S: New file. + * sysdeps/powerpc/powerpc64/power8/strncpy.S: New file. + * NEWS: Update. + and its dependency: - + commit f360f94a05570045be615649e9a411cefba2e210 Author: Vidya Ranganathan Date: Mon May 5 19:10:45 2014 -0500 - + PowerPC: strncpy/stpncpy optimization for PPC64/POWER7 - + The optimization is achieved by following techniques: > data alignment [gain from aligned memory access on read/write] > POWER7 gains performance with loop unrolling/unwinding @@ -58,7 +58,7 @@ index 74ae710..ef39917 100644 strcat-power8 strcat-power7 strcat-ppc64 \ strcpy-power8 strcpy-power7 strcpy-ppc64 \ + stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \ -+ strncpy-power8 strncpy-power7 strncpy-ppc64 ++ strncpy-power8 strncpy-power7 strncpy-ppc64 strncat-power7 \ rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \ strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \ @@ -69,7 +69,7 @@ index 4e5bb17..23bf5dc 100644 @@ -255,5 +255,27 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strncpy.c. */ + IFUNC_IMPL (i, name, strncpy, + IFUNC_IMPL_ADD (array, i, strncpy, diff --git a/SOURCES/glibc-rh1240351-9.patch b/SOURCES/glibc-rh1240351-9.patch index 99ece3e9..4bd05154 100644 --- a/SOURCES/glibc-rh1240351-9.patch +++ b/SOURCES/glibc-rh1240351-9.patch @@ -2,41 +2,41 @@ commit 8bedcb5f03c62bf6001396dafdd82fbd4da7c2db Author: Adhemerval Zanella Date: Wed Jan 7 07:18:30 2015 -0500 - + powerpc: Optimized strcmp for POWER8/PPC64 - + This patch adds an optimized POWER8 strcmp using unaligned accesses. The algorithm first check the initial 16 bytes, then align the first function source and uses unaligned loads on second argument only. Aditional checks for page boundaries are done for unaligned cases - + ChangeLog: - 2015-01-13 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: - Add strcmp-power8 object. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add __strcmp_power8 implementation. - * sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: New file. - * sysdeps/powerpc/powerpc64/multiarch/strcmp.c (strcmp): Add - __strcmp_power8 implementation. - * sysdeps/powerpc/powerpc64/power8/strcmp.S: New file. - * NEWS: Update. - + 2015-01-13 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: + Add strcmp-power8 object. + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c + (__libc_ifunc_impl_list): Add __strcmp_power8 implementation. + * sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: New file. + * sysdeps/powerpc/powerpc64/multiarch/strcmp.c (strcmp): Add + __strcmp_power8 implementation. + * sysdeps/powerpc/powerpc64/power8/strcmp.S: New file. + * NEWS: Update. + and its dependency: commit e23d3d2690bf63207b1a47e83a94693daebbbfe5 Author: Vidya Ranganathan Date: Fri Jun 6 07:56:07 2014 -0500 - + PowerPC: Optimized strcmp for PPC64/POWER7 - + Optimization is achieved on 8 byte aligned strings with double word comparison using cmpb instruction. On unaligned strings loop unrolling is applied for Power7 gain. - + ChangeLog: 2014-06-11 Vidya Ranganathan - + * sysdeps/powerpc/powerpc64/power7/strcmp.S: New file: Optimization. * sysdeps/powerpc/powerpc64/multiarch/strcmp.c: New file: multiarch strcmp for PPC64. @@ -58,7 +58,7 @@ index ef39917..27c8b65 100644 + strcmp-power8 strcmp-power7 strcmp-ppc64 \ strcpy-power8 strcpy-power7 strcpy-ppc64 \ stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \ -- strncpy-power8 strncpy-power7 strncpy-ppc64 +- strncpy-power8 strncpy-power7 strncpy-ppc64 + strncpy-power8 strncpy-power7 strncpy-ppc64 \ strncat-power7 \ rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \ @@ -68,9 +68,9 @@ index 23bf5dc..2b38c71 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -277,5 +277,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL_ADD (array, i, stpncpy, 1, - __stpncpy_ppc)) - + IFUNC_IMPL_ADD (array, i, stpncpy, 1, + __stpncpy_ppc)) + + /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */ + IFUNC_IMPL (i, name, strcmp, + IFUNC_IMPL_ADD (array, i, strcmp, diff --git a/SOURCES/glibc-rh1240796.patch b/SOURCES/glibc-rh1240796.patch index 0ee4fca1..17b1d36f 100644 --- a/SOURCES/glibc-rh1240796.patch +++ b/SOURCES/glibc-rh1240796.patch @@ -3,7 +3,7 @@ Author: Adhemerval Zanella Date: Thu May 22 14:48:38 2014 -0500 PowerPC: Remove 64 bits instructions in PPC32 code - + This patch replaces the insrdi by insrwi in powerpc32 assembly. Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S @@ -11,102 +11,102 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/memset.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S @@ -52,7 +52,7 @@ L(_memset): - + /* Align to word boundary. */ - cmplwi cr5, rLEN, 31 + cmplwi cr5, rLEN, 31 - insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrwi rCHR, rCHR, 8, 16 /* Replicate byte to halfword. */ - beq+ L(aligned) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 4 + beq+ L(aligned) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 4 @@ -67,7 +67,7 @@ L(g0): /* Handle the case of size < 31. */ L(aligned): - mtcrf 0x01, rLEN + mtcrf 0x01, rLEN - insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrwi rCHR, rCHR, 16, 0 /* Replicate halfword to word. */ - ble cr5, L(medium) + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x1C + andi. rALIGN, rMEMP, 0x1C Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power6/memset.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S @@ -50,7 +50,7 @@ L(_memset): - ble- cr1, L(small) + ble- cr1, L(small) /* Align to word boundary. */ - cmplwi cr5, rLEN, 31 + cmplwi cr5, rLEN, 31 - insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrwi rCHR, rCHR, 8, 16 /* Replicate byte to halfword. */ - beq+ L(aligned) - mtcrf 0x01, rMEMP0 - subfic rALIGN, rALIGN, 4 + beq+ L(aligned) + mtcrf 0x01, rMEMP0 + subfic rALIGN, rALIGN, 4 @@ -66,7 +66,7 @@ L(g0): /* Handle the case of size < 31. */ L(aligned): - mtcrf 0x01, rLEN + mtcrf 0x01, rLEN - insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrwi rCHR, rCHR, 16, 0 /* Replicate halfword to word. */ - ble cr5, L(medium) + ble cr5, L(medium) /* Align to 32-byte boundary. */ - andi. rALIGN, rMEMP, 0x1C + andi. rALIGN, rMEMP, 0x1C Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/memset.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S @@ -37,8 +37,8 @@ L(_memset): - cfi_offset(31,-8) - - /* Replicate byte to word. */ + cfi_offset(31,-8) + + /* Replicate byte to word. */ - insrdi 4,4,8,48 - insrdi 4,4,16,32 + insrwi 4,4,8,16 + insrwi 4,4,16,0 - - ble cr6,L(small) /* If length <= 8, use short copy code. */ - + + ble cr6,L(small) /* If length <= 8, use short copy code. */ + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/rawmemchr.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__rawmemchr)) - clrrwi r8,r3,2 /* Align the address to word boundary. */ - - /* Replicate byte to word. */ + clrrwi r8,r3,2 /* Align the address to word boundary. */ + + /* Replicate byte to word. */ - rldimi r4,r4,8,48 - rldimi r4,r4,16,32 + insrwi r4,r4,8,16 + insrwi r4,r4,16,0 - - /* Now r4 has a word of c bytes. */ - + + /* Now r4 has a word of c bytes. */ + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/strchr.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S @@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr)) - beq cr7,L(null_match) - - /* Replicate byte to word. */ + beq cr7,L(null_match) + + /* Replicate byte to word. */ - insrdi r4,r4,8,48 - insrdi r4,r4,16,32 + insrwi r4,r4,8,16 + insrwi r4,r4,16,0 - - /* Now r4 has a word of c bytes and r0 has - a word of null bytes. */ + + /* Now r4 has a word of c bytes and r0 has + a word of null bytes. */ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/strchrnul.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul)) - clrrwi r8,r3,2 /* Align the address to word boundary. */ - - /* Replicate byte to word. */ + clrrwi r8,r3,2 /* Align the address to word boundary. */ + + /* Replicate byte to word. */ - insrdi r4,r4,8,48 - insrdi r4,r4,16,32 + insrwi r4,r4,8,16 + insrwi r4,r4,16,0 - - rlwinm r6,r3,3,27,28 /* Calculate padding. */ - lwz r12,0(r8) /* Load word from memory. */ + + rlwinm r6,r3,3,27,28 /* Calculate padding. */ + lwz r12,0(r8) /* Load word from memory. */ diff --git a/SOURCES/glibc-rh1248208-2.patch b/SOURCES/glibc-rh1248208-2.patch index da621da0..ad9f26b9 100644 --- a/SOURCES/glibc-rh1248208-2.patch +++ b/SOURCES/glibc-rh1248208-2.patch @@ -3,12 +3,12 @@ diff -pruN glibc-2.17-c758a686/nptl/tst-join7mod.c glibc-2.17-c758a686.new/nptl/ +++ glibc-2.17-c758a686.new/nptl/tst-join7mod.c 2015-08-14 12:42:10.446315345 +0530 @@ -18,6 +18,7 @@ . */ - + #include +#include #include #include - + @@ -27,7 +28,14 @@ static int running = 1; static void * test_run (void *p) @@ -32,5 +32,5 @@ diff -pruN glibc-2.17-c758a686/nptl/tst-join7mod.c glibc-2.17-c758a686.new/nptl/ - atomic_store_relaxed (&running, 0); + atomic_exchange_rel (&running, 0); int ret = pthread_join (th, NULL); - + if (ret != 0) diff --git a/SOURCES/glibc-rh1248208.patch b/SOURCES/glibc-rh1248208.patch index 756323fe..03e4e175 100644 --- a/SOURCES/glibc-rh1248208.patch +++ b/SOURCES/glibc-rh1248208.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Fri Jul 24 19:13:38 2015 +0530 Use IE model for static variables in libc.so, libpthread.so and rtld - + The recently introduced TLS variables in the thread-local destructor implementation (__cxa_thread_atexit_impl) used the default GD access model, resulting in a call to __tls_get_addr. This causes a deadlock @@ -11,16 +11,16 @@ Date: Fri Jul 24 19:13:38 2015 +0530 allocations are delayed and hence despite knowing the offset to the variable inside its TLS block, the thread has to take the global rtld lock to safely update the TLS offset. - + This causes deadlocks when a thread is instantiated and joined inside a destructor of a dlopen'd DSO. The correct long term fix is to somehow not take the lock, but that will need a lot deeper change set to alter the way in which the big rtld lock is used. - + Instead, this patch just eliminates the call to __tls_get_addr for the thread-local variables inside libc.so, libpthread.so and rtld by building all of their units with -mtls-model=initial-exec. - + There were concerns that the static storage for TLS is limited and hence we should not be using it. Additionally, dynamically loaded modules may result in libc.so looking for this static storage pretty @@ -31,48 +31,48 @@ Date: Fri Jul 24 19:13:38 2015 +0530 assumes that the static storage would be used sparingly and definitely not by default. Hence, for now this would only theoretically affect ARM architectures. - + The impact is hence limited to statically linked binaries that dlopen modules that in turn load libc.so, all that on arm hardware. It seems like a small enough impact to justify fixing the larger problem that currently affects everything everywhere. - + This still does not solve the original problem completely. That is, it is still possible to deadlock on the big rtld lock with a small tweak to the test case attached to this patch. That problem is however not a regression in 2.22 and hence could be tackled as a separate project. The test case is picked up as is from Alex's patch. - + This change has been tested to verify that it does not cause any issues on x86_64. - + ChangeLog: - - [BZ #18457] - * nptl/Makefile (tests): New test case tst-join7. - (modules-names): New test case module tst-join7mod. - * nptl/tst-join7.c: New file. - * nptl/tst-join7mod.c: New file. - * Makeconfig (tls-model): Pass -ftls-model=initial-exec for - all translation units in libc.so, libpthread.so and rtld. + + [BZ #18457] + * nptl/Makefile (tests): New test case tst-join7. + (modules-names): New test case module tst-join7mod. + * nptl/tst-join7.c: New file. + * nptl/tst-join7mod.c: New file. + * Makeconfig (tls-model): Pass -ftls-model=initial-exec for + all translation units in libc.so, libpthread.so and rtld. diff --git a/nptl/Makefile b/nptl/Makefile index 140f063..aaca0a4 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -245,7 +245,7 @@ tests = tst-typesizes \ - tst-basic7 \ - tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \ - tst-raise1 \ + tst-basic7 \ + tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \ + tst-raise1 \ - tst-join1 tst-join2 tst-join3 tst-join4 tst-join5 tst-join6 \ + tst-join1 tst-join2 tst-join3 tst-join4 tst-join5 tst-join6 tst-join7 \ - tst-detach1 \ - tst-eintr1 tst-eintr2 tst-eintr3 tst-eintr4 tst-eintr5 \ - tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 tst-tsd6 \ + tst-detach1 \ + tst-eintr1 tst-eintr2 tst-eintr3 tst-eintr4 tst-eintr5 \ + tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 tst-tsd6 \ @@ -327,7 +327,8 @@ endif modules-names = tst-atfork2mod tst-tls3mod tst-tls4moda tst-tls4modb \ - tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \ - tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \ + tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \ + tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \ - tst-_res1mod1 tst-_res1mod2 tst-execstack-mod tst-fini1mod + tst-_res1mod1 tst-_res1mod2 tst-execstack-mod tst-fini1mod \ + tst-join7mod @@ -80,16 +80,16 @@ index 140f063..aaca0a4 100644 test-extras += $(modules-names) tst-cleanup4aux test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) @@ -532,6 +533,11 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \ - $(rtld-installed-name) '$(test-wrapper-env)' + $(rtld-installed-name) '$(test-wrapper-env)' endif - + +$(objpfx)tst-join7: $(libdl) $(shared-thread-library) +$(objpfx)tst-join7.out: $(objpfx)tst-join7mod.so +$(objpfx)tst-join7mod.so: $(shared-thread-library) +LDFLAGS-tst-join7mod.so = -Wl,-soname,tst-join7mod.so + $(objpfx)tst-dlsym1: $(libdl) $(shared-thread-library) - + $(objpfx)tst-fini1: $(shared-thread-library) $(objpfx)tst-fini1mod.so diff --git a/nptl/tst-join7.c b/nptl/tst-join7.c new file mode 100644 @@ -215,10 +215,10 @@ diff -pruN a/string/strerror_l.c b/string/strerror_l.c +++ b/string/strerror_l.c @@ -23,7 +23,7 @@ #include - - + + -static __thread char *last_value; +static __thread char *last_value attribute_tls_model_ie; - - + + static const char * diff --git a/SOURCES/glibc-rh1249102.patch b/SOURCES/glibc-rh1249102.patch index f26a6a18..eb83b2ea 100644 --- a/SOURCES/glibc-rh1249102.patch +++ b/SOURCES/glibc-rh1249102.patch @@ -3,7 +3,7 @@ Author: Adhemerval Zanella Date: Tue Jul 29 13:56:44 2014 -0500 PowerPC: Fix gprof entry point for LE - + This patch fixes the ELFv2 gprof entry point since the ABI does not define function descriptors. It fixes BZ#17213. diff --git a/sysdeps/powerpc/powerpc64/entry.h b/sysdeps/powerpc/powerpc64/entry.h @@ -11,15 +11,16 @@ index 76ead1d..30553c1 100644 --- a/sysdeps/powerpc/powerpc64/entry.h +++ b/sysdeps/powerpc/powerpc64/entry.h @@ -23,6 +23,7 @@ extern void _start (void); - + #define ENTRY_POINT _start - + +#if _CALL_ELF != 2 /* We have to provide a special declaration. */ #define ENTRY_POINT_DECL(class) class void _start (void); - + @@ -33,3 +34,4 @@ extern void _start (void); #define TEXT_START \ ({ extern unsigned long int _start_as_data[] asm ("_start"); \ _start_as_data[0]; }) +#endif + diff --git a/SOURCES/glibc-rh1249114.patch b/SOURCES/glibc-rh1249114.patch index d9b7e9ac..463140fc 100644 --- a/SOURCES/glibc-rh1249114.patch +++ b/SOURCES/glibc-rh1249114.patch @@ -11,9 +11,9 @@ index 5e99d7f..8f22c8d 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -64,10 +64,10 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \ - test-canon test-canon2 tst-strtoll tst-environ \ - tst-xpg-basename tst-random tst-random2 tst-bsearch \ - tst-limits tst-rand48 bug-strtod tst-setcontext \ + test-canon test-canon2 tst-strtoll tst-environ \ + tst-xpg-basename tst-random tst-random2 tst-bsearch \ + tst-limits tst-rand48 bug-strtod tst-setcontext \ - test-a64l tst-qsort tst-system testmb2 bug-strtod2 \ - tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \ - tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \ @@ -22,9 +22,9 @@ index 5e99d7f..8f22c8d 100644 + bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 \ + tst-rand48-2 tst-makecontext tst-strtod4 tst-strtod5 \ + tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \ - tst-makecontext3 bug-getcontext bug-fmtmsg1 \ - tst-secure-getenv tst-strtod-overflow tst-strtod-round \ - tst-tininess tst-strtod-underflow + tst-makecontext3 bug-getcontext bug-fmtmsg1 \ + tst-secure-getenv tst-strtod-overflow tst-strtod-round \ + tst-tininess tst-strtod-underflow diff --git a/stdlib/tst-setcontext2.c b/stdlib/tst-setcontext2.c new file mode 100644 index 0000000..8582cc0 @@ -266,31 +266,31 @@ index b19fd8d..5f60f49 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S @@ -34,7 +34,7 @@ ENTRY(__setcontext) - lr %r1,%r2 - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + lr %r1,%r2 + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + la %r2,SIG_SETMASK - la %r3,SC_MASK(%r1) - slr %r4,%r4 - lhi %r5,_NSIG8 + la %r3,SC_MASK(%r1) + slr %r4,%r4 + lhi %r5,_NSIG8 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S index 092f2bc..dc21b44 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S @@ -24,7 +24,7 @@ /* __swapcontext (ucontext_t *oucp, const ucontext_t *ucp) - + Saves the machine context in oucp such that when it is activated, - it appears as if __swapcontextt() returned again, restores the + it appears as if __swapcontext() returned again, restores the machine context in ucp and thereby resumes execution in that context. - + @@ -36,13 +36,6 @@ ENTRY(__swapcontext) - lr %r1,%r2 - lr %r0,%r3 - + lr %r1,%r2 + lr %r0,%r3 + - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slr %r3,%r3 @@ -298,55 +298,55 @@ index 092f2bc..dc21b44 100644 - lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ - stfpc SC_FPC(%r1) - std %f0,SC_FPRS(%r1) + /* Store fpu context. */ + stfpc SC_FPC(%r1) + std %f0,SC_FPRS(%r1) @@ -71,11 +64,12 @@ ENTRY(__swapcontext) - /* Store general purpose registers. */ - stm %r0,%r15,SC_GPRS(%r1) - + /* Store general purpose registers. */ + stm %r0,%r15,SC_GPRS(%r1) + - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, + sigsetsize). */ + la %r2,SIG_SETMASK - lr %r5,%r0 - la %r3,SC_MASK(%r5) + lr %r5,%r0 + la %r3,SC_MASK(%r5) - slr %r4,%r4 + la %r4,SC_MASK(%r1) - lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - + lhi %r5,_NSIG8 + svc SYS_ify(rt_sigprocmask) + diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S index b9a55ed..004eafc 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S @@ -34,7 +34,7 @@ ENTRY(__setcontext) - lgr %r1,%r2 - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + lgr %r1,%r2 + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + la %r2,SIG_SETMASK - la %r3,SC_MASK(%r1) - slgr %r4,%r4 - lghi %r5,_NSIG8 + la %r3,SC_MASK(%r1) + slgr %r4,%r4 + lghi %r5,_NSIG8 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S index 6e2630c..2688762 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S @@ -24,7 +24,7 @@ /* __swapcontext (ucontext_t *oucp, const ucontext_t *ucp) - + Saves the machine context in oucp such that when it is activated, - it appears as if __swapcontextt() returned again, restores the + it appears as if __swapcontext() returned again, restores the machine context in ucp and thereby resumes execution in that context. - + @@ -36,13 +36,6 @@ ENTRY(__swapcontext) - lgr %r1,%r2 - lgr %r0,%r3 - + lgr %r1,%r2 + lgr %r0,%r3 + - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slgr %r3,%r3 @@ -354,23 +354,23 @@ index 6e2630c..2688762 100644 - lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ - stfpc SC_FPC(%r1) - std %f0,SC_FPRS(%r1) + /* Store fpu context. */ + stfpc SC_FPC(%r1) + std %f0,SC_FPRS(%r1) @@ -71,12 +64,13 @@ ENTRY(__swapcontext) - /* Store general purpose registers. */ - stmg %r0,%r15,SC_GPRS(%r1) - + /* Store general purpose registers. */ + stmg %r0,%r15,SC_GPRS(%r1) + - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, + sigsetsize). */ + la %r2,SIG_SETMASK - lgr %r5,%r0 - la %r3,SC_MASK(%r5) + lgr %r5,%r0 + la %r3,SC_MASK(%r5) + la %r4,SC_MASK(%r1) - lghi %r5,_NSIG8 + lghi %r5,_NSIG8 - slgr %r4,%r4 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Load fpu context. */ diff --git a/SOURCES/glibc-rh1249115.patch b/SOURCES/glibc-rh1249115.patch index ef2c83bb..44e70be1 100644 --- a/SOURCES/glibc-rh1249115.patch +++ b/SOURCES/glibc-rh1249115.patch @@ -25,15 +25,15 @@ index eb6e89b..1420857 100644 +#include +#include +#include - + ucontext_t ucp; -char st1[8192]; +char st1[16384]; __thread int thr; - + int somevar = -76; long othervar = -78L; - + +struct trace_arg +{ + int cnt, size; @@ -60,7 +60,7 @@ index eb6e89b..1420857 100644 printf ("i %d thr %d\n", i, thr); exit (1); } - + + /* Test if callback function of _Unwind_Backtrace is not called infinitely + times. See Bug 18508 or gcc bug "Bug 66303 - runtime.Caller() returns + infinitely deep stack frames on s390x.". @@ -86,9 +86,9 @@ index ab172bb..365c2b0 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S @@ -17,6 +17,14 @@ - + #include - + +/* We do not want .eh_frame info so that __makecontext_ret stops unwinding + if backtrace was called within a context created by makecontext. (There + is also no .eh_frame info for _start or thread_start.) */ @@ -98,16 +98,16 @@ index ab172bb..365c2b0 100644 +#define cfi_endproc + ENTRY(__makecontext_ret) - basr %r14,%r7 - ltr %r8,%r8 /* Check whether uc_link is 0. */ + basr %r14,%r7 + ltr %r8,%r8 /* Check whether uc_link is 0. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S b/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S index cbd88e1..c4a43bd 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S @@ -17,6 +17,14 @@ - + #include - + +/* We do not want .eh_frame info so that __makecontext_ret stops unwinding + if backtrace was called within a context created by makecontext. (There + is also no .eh_frame info for _start or thread_start.) */ @@ -117,5 +117,5 @@ index cbd88e1..c4a43bd 100644 +#define cfi_endproc + ENTRY(__makecontext_ret) - basr %r14,%r7 - ltgr %r8,%r8 /* Check whether uc_link is 0. */ + basr %r14,%r7 + ltgr %r8,%r8 /* Check whether uc_link is 0. */ diff --git a/SOURCES/glibc-rh1255822.patch b/SOURCES/glibc-rh1255822.patch index 59541c76..d14f700a 100644 --- a/SOURCES/glibc-rh1255822.patch +++ b/SOURCES/glibc-rh1255822.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Tue Jun 21 21:29:21 2016 +0200 malloc: Avoid premature fallback to mmap [BZ #20284] - + Before this change, the while loop in reused_arena which avoids returning a corrupt arena would never execute its body if the selected arena were not corrupt. As a result, result == begin after the loop, @@ -23,7 +23,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c + wanted to avoid. */ + return NULL; } - + - /* We could not find any arena that was either not corrupted or not the one - we wanted to avoid. */ - if (result == begin || result == avoid_arena) diff --git a/SOURCES/glibc-rh1256317-0.patch b/SOURCES/glibc-rh1256317-0.patch index 04f2d691..232d76b6 100644 --- a/SOURCES/glibc-rh1256317-0.patch +++ b/SOURCES/glibc-rh1256317-0.patch @@ -3,13 +3,13 @@ Author: Dmitry V. Levin Date: Fri Jun 5 22:20:13 2015 +0000 Prepare for restoration of .interp section in libpthread.so - + Make runtime-linker.h available outside $(elf-objpfx) by moving the file to $(common-objpfx) and the rules for it to Makerules. - + Tested for x86_64 and x86 (testsuite, and that no compiled code changed by the patch). - + * Makeconfig (+interp): Remove unused variable. * elf/Makefile ($(objpfx)interp.os): Define for [$(build-shared) = yes] only. Depend on $(common-objpfx)runtime-linker.h instead of @@ -25,10 +25,10 @@ Author: Gleb Fotengauer-Malinovskiy Date: Tue Jun 2 21:04:06 2015 +0300 nptl: restore .interp section in libpthread.so - + In commit 02657da2cf4457804ed938ee08b8316249126444, .interp section was removed from libpthread.so. This led to an error: - + $ /lib64/libpthread.so.0 Native POSIX Threads Library by Ulrich Drepper et al Copyright (C) 2015 Free Software Foundation, Inc. @@ -37,14 +37,14 @@ Date: Tue Jun 2 21:04:06 2015 +0300 PARTICULAR PURPOSE. Forced unwind support included. Segmentation fault - + (gdb) bt #0 0x00000000000055a6 in _exit@plt () - + Unfortunately, there is no way to add a regression test for the bug because .interp specifies the path to dynamic linker of the target system. - + [BZ #18479] * nptl/pt-interp.c: New file. * nptl/Makefile (libpthread-routines, libpthread-shared-only-routines): @@ -57,23 +57,23 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -30,7 +30,7 @@ routines = alloca_cutoff forward libc-lo - libc-cleanup + libc-cleanup shared-only-routines = forward - + -libpthread-routines = nptl-init vars events version \ +libpthread-routines = nptl-init vars events version pt-interp \ - pthread_create pthread_exit pthread_detach \ - pthread_join pthread_tryjoin pthread_timedjoin \ - pthread_self pthread_equal pthread_yield \ + pthread_create pthread_exit pthread_detach \ + pthread_join pthread_tryjoin pthread_timedjoin \ + pthread_self pthread_equal pthread_yield \ @@ -131,7 +131,8 @@ libpthread-routines = nptl-init vars eve # pthread_setgid pthread_setegid pthread_setregid \ # pthread_setresgid - + -libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind +libpthread-shared-only-routines = version pt-interp pt-allocrtsig \ + unwind-forcedunwind libpthread-static-only-routines = pthread_atfork - + # Since cancellation handling is in large parts handled using exceptions @@ -591,6 +592,8 @@ $(objpfx)banner.h: Banner generated += banner.h @@ -82,7 +82,7 @@ Index: glibc-2.17-c758a686/nptl/Makefile +# pt-interp.c exists just to get the runtime linker path into libpthread.so. +$(objpfx)pt-interp.os: $(common-objpfx)runtime-linker.h endif - + ifeq ($(run-built-tests),yes) Index: glibc-2.17-c758a686/nptl/pt-interp.c =================================================================== @@ -101,15 +101,15 @@ Index: glibc-2.17-c758a686/Makeconfig -+interp = $(addprefix $(elf-objpfx),interp.os) csu-objpfx = $(common-objpfx)csu/ elf-objpfx = $(common-objpfx)elf/ - + Index: glibc-2.17-c758a686/elf/Makefile =================================================================== --- glibc-2.17-c758a686.orig/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -344,16 +344,10 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld - $(READELF) -s $@ \ - | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' - + $(READELF) -s $@ \ + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' + +ifeq (yes,$(build-shared)) # interp.c exists just to get the runtime linker path into libc.so. -$(objpfx)interp.os: $(elf-objpfx)runtime-linker.h @@ -123,7 +123,7 @@ Index: glibc-2.17-c758a686/elf/Makefile - touch $@ +$(objpfx)interp.os: $(common-objpfx)runtime-linker.h +endif - + ifneq (ld.so,$(rtld-installed-name)) # Make sure ld.so.1 exists in the build directory so we can link Index: glibc-2.17-c758a686/elf/interp.c @@ -133,10 +133,10 @@ Index: glibc-2.17-c758a686/elf/interp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#include +#include - + const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) = RUNTIME_LINKER; Index: glibc-2.17-c758a686/Makerules @@ -146,7 +146,7 @@ Index: glibc-2.17-c758a686/Makerules @@ -123,6 +123,16 @@ $(common-objpfx)libc-abis.stamp: $(..)sc common-generated += $(common-objpfx)libc-abis.h endif # avoid-generated - + +ifeq (yes,$(build-shared)) +$(common-objpfx)runtime-linker.h: $(common-objpfx)runtime-linker.stamp; @: +$(common-objpfx)runtime-linker.stamp: $(common-objpfx)config.make diff --git a/SOURCES/glibc-rh1256317-1.patch b/SOURCES/glibc-rh1256317-1.patch index 4de81e4f..a12d571a 100644 --- a/SOURCES/glibc-rh1256317-1.patch +++ b/SOURCES/glibc-rh1256317-1.patch @@ -3,16 +3,16 @@ Author: Siddhesh Poyarekar Date: Mon Nov 24 15:24:34 2014 +0530 Use IS_IN internally only - + This change is only useful for the conformance tests since the headers changed are not installed. The conformance tests fail due to IS_IN not being defined, so wrap it with a check to make sure that _ISOMAC is defined. - - * include/bits/stdlib-float.h: Use IS_IN only if _ISOMAC is - defined. - * include/mqueue.h: Likewise. - * include/stdlib.h: Likewise. + + * include/bits/stdlib-float.h: Use IS_IN only if _ISOMAC is + defined. + * include/mqueue.h: Likewise. + * include/stdlib.h: Likewise. Index: glibc-2.17-c758a686/include/bits/stdlib-float.h =================================================================== @@ -35,7 +35,7 @@ Index: glibc-2.17-c758a686/include/mqueue.h +++ glibc-2.17-c758a686/include/mqueue.h @@ -1,7 +1,9 @@ #include - + -#if IS_IN (librt) +#ifndef _ISOMAC +# if IS_IN (librt) diff --git a/SOURCES/glibc-rh1256317-10.patch b/SOURCES/glibc-rh1256317-10.patch index 5e414b86..44f609d9 100644 --- a/SOURCES/glibc-rh1256317-10.patch +++ b/SOURCES/glibc-rh1256317-10.patch @@ -3,20 +3,20 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 12:33:44 2014 +0530 Remove IS_IN_ldconfig - + Replace with IS_IN (ldconfig). No change in generated code. - - * elf/Makefile (CFLAGS-ldconfig.c): Remove definition of - IS_IN_ldconfig. - * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Use IS_IN. - * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: Likewise. + + * elf/Makefile (CFLAGS-ldconfig.c): Remove definition of + IS_IN_ldconfig. + * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Use IS_IN. + * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: Likewise. Index: glibc-2.17-c758a686/elf/Makefile =================================================================== --- glibc-2.17-c758a686.orig/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -437,7 +437,7 @@ $(objpfx)pldd: $(pldd-modules:%=$(objpfx - + SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ - -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1 diff --git a/SOURCES/glibc-rh1256317-11.patch b/SOURCES/glibc-rh1256317-11.patch index 5d258267..26430d8e 100644 --- a/SOURCES/glibc-rh1256317-11.patch +++ b/SOURCES/glibc-rh1256317-11.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 12:21:01 2014 +0530 Remove IS_IN_libc - + Replace it with IS_IN (libc) and remove the one place that it is defined in. The generated code remains unchanged on x86_64. - - * include/shlib-compat.h [!NOT_IN_libc]: Remove. - * nss/nss_files/files-parse.c (IS_IN_libc): Replace with - IS_IN (libc). + + * include/shlib-compat.h [!NOT_IN_libc]: Remove. + * nss/nss_files/files-parse.c (IS_IN_libc): Replace with + IS_IN (libc). Index: glibc-2.17-c758a686/include/shlib-compat.h =================================================================== @@ -18,7 +18,7 @@ Index: glibc-2.17-c758a686/include/shlib-compat.h @@ -49,10 +49,6 @@ && (!(ABI_##lib##_##obsoleted - 0) \ || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))) - + -# ifndef NOT_IN_libc -# define IS_IN_libc 1 -# endif diff --git a/SOURCES/glibc-rh1256317-12.patch b/SOURCES/glibc-rh1256317-12.patch index 393d48c9..c16d6897 100644 --- a/SOURCES/glibc-rh1256317-12.patch +++ b/SOURCES/glibc-rh1256317-12.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 12:04:26 2014 +0530 Define IN_MODULE for translation units that define NOT_IN_libc - + Make sure that all instances where NOT_IN_libc is defined also defines IN_MODULE to facilitate removal NOT_IN_libc in future passes. - + Verified that the generated code is unchanged on x86_64. - - * elf/Makefile (libof-sotruss-lib): Set as extramodules. + + * elf/Makefile (libof-sotruss-lib): Set as extramodules. Index: glibc-2.17-c758a686/elf/Makefile =================================================================== @@ -22,4 +22,4 @@ Index: glibc-2.17-c758a686/elf/Makefile +libof-sotruss-lib = extramodules CPPFLAGS-sotruss-lib = -DNOT_IN_libc $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os - $(build-module-asneeded) + $(build-module-asneeded) diff --git a/SOURCES/glibc-rh1256317-13.patch b/SOURCES/glibc-rh1256317-13.patch index e4a1fc83..427e8a36 100644 --- a/SOURCES/glibc-rh1256317-13.patch +++ b/SOURCES/glibc-rh1256317-13.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 12:03:11 2014 +0530 Remove IN_LIB - + Replace with IS_IN and IS_IN_LIB macros instead. This change results in a change in generated code, because it fixes a subtle bug. The bug was introduced when systemtap probes were added to lowlevellock.h, @@ -11,9 +11,9 @@ Date: Thu Nov 20 12:03:11 2014 +0530 stap-probe.h always defines IN_LIB, which breaks a check in errno.h and netdb.h since they rely on that macro to decide whether to implement an internal version of a declaration or an external one. - + The components that see a code change due to this are: - + iconv_prog libmemusage.so libpcprofile.so @@ -22,17 +22,17 @@ Date: Thu Nov 20 12:03:11 2014 +0530 locale localedef nscd - + All other built components (i.e. libc, libpthread, etc.) remain unchanged by this on x86_64. - - * elf/Makefile (CPPFLAGS-.os): Remove IN_LIB. - * elf/rtld-Rules (rtld-CPPFLAGS): Likewise. - * extra-lib.mk (CPPFLAGS-$(lib)): Likewise. - * include/libc-symbols.h (IS_IN_LIB): New macro. - * include/errno.h: Use IS_IN_LIB instead of IN_LIB. - * include/netdb.h: Likewise. - * include/stap-probe.h: Remove all uses of IN_LIB. + + * elf/Makefile (CPPFLAGS-.os): Remove IN_LIB. + * elf/rtld-Rules (rtld-CPPFLAGS): Likewise. + * extra-lib.mk (CPPFLAGS-$(lib)): Likewise. + * include/libc-symbols.h (IS_IN_LIB): New macro. + * include/errno.h: Use IS_IN_LIB instead of IN_LIB. + * include/netdb.h: Likewise. + * include/stap-probe.h: Remove all uses of IN_LIB. Index: glibc-2.17-c758a686/elf/Makefile =================================================================== @@ -40,11 +40,11 @@ Index: glibc-2.17-c758a686/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -443,7 +443,7 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS) CFLAGS-rtld.c = $(SYSCONF-FLAGS) - + CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ - -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld) + -DNOT_IN_libc=1 -DIS_IN_rtld=1) - + # Disable any optimization which might result in function calls during early # dynamic loader startup. We disable -ftree-loop-distribute-patterns which Index: glibc-2.17-c758a686/elf/rtld-Rules @@ -53,11 +53,11 @@ Index: glibc-2.17-c758a686/elf/rtld-Rules +++ glibc-2.17-c758a686/elf/rtld-Rules @@ -134,6 +134,6 @@ lib := rtld include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + # This here is the whole point of all the shenanigans. -rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld +rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 - + endif Index: glibc-2.17-c758a686/extra-lib.mk =================================================================== @@ -66,7 +66,7 @@ Index: glibc-2.17-c758a686/extra-lib.mk @@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left)) include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) endif - + -CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib) +CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 Index: glibc-2.17-c758a686/include/errno.h @@ -76,21 +76,21 @@ Index: glibc-2.17-c758a686/include/errno.h @@ -17,7 +17,7 @@ # define errno rtld_errno extern int rtld_errno attribute_hidden; - + -# elif !defined NOT_IN_libc || defined IN_LIB +# elif !defined NOT_IN_libc || IS_IN_LIB - + # include - + @@ -29,7 +29,7 @@ extern int rtld_errno attribute_hidden; # endif extern __thread int errno attribute_tls_model_ie; - + -# endif /* !NOT_IN_libc || IN_LIB */ +# endif /* !NOT_IN_libc || IS_IN_LIB */ - + # define __set_errno(val) (errno = (val)) - + Index: glibc-2.17-c758a686/include/libc-symbols.h =================================================================== --- glibc-2.17-c758a686.orig/include/libc-symbols.h @@ -98,7 +98,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -23,6 +23,11 @@ #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME) #define IS_IN(lib) (IN_MODULE == MODULE_##lib) - + +/* Returns true if the current module is a versioned library. Versioned + library names culled from shlib-versions files are assigned a MODULE_* + value lower than MODULE_LIBS_BEGIN. */ @@ -106,13 +106,13 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h + #define PASTE_NAME(a,b) PASTE_NAME1 (a,b) #define PASTE_NAME1(a,b) a##b - + Index: glibc-2.17-c758a686/include/netdb.h =================================================================== --- glibc-2.17-c758a686.orig/include/netdb.h +++ glibc-2.17-c758a686/include/netdb.h @@ -3,7 +3,7 @@ - + #ifndef _ISOMAC /* Macros for accessing h_errno from inside libc. */ -# if !defined NOT_IN_libc || defined IN_LIB @@ -127,7 +127,7 @@ Index: glibc-2.17-c758a686/include/netdb.h -# endif /* !NOT_IN_libc || IN_LIB */ +# endif /* !NOT_IN_libc || IS_IN_LIB */ # define __set_h_errno(x) (h_errno = (x)) - + libc_hidden_proto (hstrerror) Index: glibc-2.17-c758a686/include/stap-probe.h =================================================================== @@ -136,7 +136,7 @@ Index: glibc-2.17-c758a686/include/stap-probe.h @@ -32,18 +32,6 @@ STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste in MODULE_NAME (libc, libpthread, etc.) automagically. */ - + -# ifndef NOT_IN_libc -# define IN_LIB libc -# elif !defined IN_LIB @@ -151,3 +151,4 @@ Index: glibc-2.17-c758a686/include/stap-probe.h - # define LIBC_PROBE(name, n, ...) \ LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__) + diff --git a/SOURCES/glibc-rh1256317-14.patch b/SOURCES/glibc-rh1256317-14.patch index b9d038f6..8baf8fb1 100644 --- a/SOURCES/glibc-rh1256317-14.patch +++ b/SOURCES/glibc-rh1256317-14.patch @@ -6,30 +6,30 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 11:42:00 2014 +0530 Use MODULE_NAME in stap-probe instead of IN_LIB - + Define MODULE_NAME in the build command and define IN_MODULE using MODULE_NAME. Verified that the generated code is unchanged on x86_64. - - * Makeconfig (module-cppflags-real): Define MODULE_NAME - instead of IN_MODULE. - * include/libc-symbols.h (IN_MODULE): Define using - MODULE_NAME. - (PASTE_NAME, PASTE_NAME1): New macros. - * include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead - of IN_LIB. - (STAP_PROBE_ASM): Likewise. + + * Makeconfig (module-cppflags-real): Define MODULE_NAME + instead of IN_MODULE. + * include/libc-symbols.h (IN_MODULE): Define using + MODULE_NAME. + (PASTE_NAME, PASTE_NAME1): New macros. + * include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead + of IN_LIB. + (STAP_PROBE_ASM): Likewise. Index: glibc-2.17-c758a686/Makeconfig =================================================================== --- glibc-2.17-c758a686.orig/Makeconfig +++ glibc-2.17-c758a686/Makeconfig @@ -741,7 +741,7 @@ in-module = $(subst -,_,$(firstword $(li - libc)) - + libc)) + module-cppflags-real = -include $(common-objpfx)libc-modules.h \ - -DIN_MODULE=MODULE_$(in-module) + -DMODULE_NAME=$(in-module) - + # We don't need libc-modules.h and the MODULE_NAME definition for .v.i # files. These targets don't (and will likely never need to) use the IS_IN @@ -940,7 +940,7 @@ postclean-generated += soversions.mk sov @@ -48,58 +48,59 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -20,8 +20,12 @@ #ifndef _LIBC_SYMBOLS_H #define _LIBC_SYMBOLS_H 1 - + +#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME) #define IS_IN(lib) (IN_MODULE == MODULE_##lib) - + +#define PASTE_NAME(a,b) PASTE_NAME1 (a,b) +#define PASTE_NAME1(a,b) a##b + /* This file's macros are included implicitly in the compilation of every file in the C library by -imacros. - + Index: glibc-2.17-c758a686/include/stap-probe.h =================================================================== --- glibc-2.17-c758a686.orig/include/stap-probe.h +++ glibc-2.17-c758a686/include/stap-probe.h @@ -30,7 +30,7 @@ - + Systemtap's header defines the macros STAP_PROBE (provider, name) and STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste - in the IN_LIB name (libc, libpthread, etc.) automagically. */ + in MODULE_NAME (libc, libpthread, etc.) automagically. */ - + # ifndef NOT_IN_libc # define IN_LIB libc @@ -45,7 +45,7 @@ # endif - + # define LIBC_PROBE(name, n, ...) \ - LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__) + LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__) - + # define LIBC_PROBE_1(lib, name, n, ...) \ STAP_PROBE##n (lib, name, ## __VA_ARGS__) @@ -53,7 +53,7 @@ # define STAP_PROBE0 STAP_PROBE - + # define LIBC_PROBE_ASM(name, template) \ - STAP_PROBE_ASM (IN_LIB, name, template) + STAP_PROBE_ASM (MODULE_NAME, name, template) - + # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS - + Index: glibc-2.17-c758a686/rtkaio/Makefile =================================================================== --- glibc-2.17-c758a686.orig/rtkaio/Makefile +++ glibc-2.17-c758a686/rtkaio/Makefile @@ -70,7 +70,9 @@ CFLAGS-kaio_librt-cancellation.c = -fasy LDFLAGS-rtkaio.so = -Wl,-soname=lib$(libprefix)rt.so$(librt.so-version) \ - -Wl,--enable-new-dtags,-z,nodelete + -Wl,--enable-new-dtags,-z,nodelete CPPFLAGS-librtkaio += -UIN_MODULE -DIN_MODULE=MODULE_librt \ - -UIS_IN_librt -DIS_IN_librt=1 -I$(..)rt + -UMODULE_NAME -DMODULE_NAME=librt \ + -UIS_IN_librt -DIS_IN_librt=1 \ + -I$(..)rt - + rpath-dirs := $(patsubst rt,rtkaio,$(rpath-dirs)) + diff --git a/SOURCES/glibc-rh1256317-15.patch b/SOURCES/glibc-rh1256317-15.patch index 4379bd5b..a481ce0a 100644 --- a/SOURCES/glibc-rh1256317-15.patch +++ b/SOURCES/glibc-rh1256317-15.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Nov 19 12:16:00 2014 +0530 Auto-generate libc-modules.h - + Remove libc-modules.h from the tree and auto-generate it from soversions.i and the list of modules in the built-modules variable defined in Makeconfig. Macros generated have increasing numbered @@ -14,25 +14,25 @@ Date: Wed Nov 19 12:16:00 2014 +0530 libraries and other built modules, which is needed in errno.h and netdb.h to decide whether to use an internal symbol or an external one. - + Verified that generated code remains unchanged on x86_64. - - * Makeconfig (built-modules): List non-library modules to be - built. - (module-cppflags): Include libc-modules.h for - everything except shlib-versions.v.i. - (CPPFLAGS): Use it. - (before-compile): Add libc-modules.h. - ($(common-objpfx)libc-modules.h, - $(common-objpfx)libc-modules.stmp): New targets. - (common-generated): Add libc-modules.h and libc-modules.stmp. - ($(common-objpfx)Versions.v.i): Depend on libc-modules.h. - * include/libc-symbols.h: Don't include libc-modules.h. - * include/libc-modules.h: Remove file. - * scripts/gen-libc-modules.awk: New script to generate - libc-modules.h. - * sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): - Depend on libc-modules.stmp. + + * Makeconfig (built-modules): List non-library modules to be + built. + (module-cppflags): Include libc-modules.h for + everything except shlib-versions.v.i. + (CPPFLAGS): Use it. + (before-compile): Add libc-modules.h. + ($(common-objpfx)libc-modules.h, + $(common-objpfx)libc-modules.stmp): New targets. + (common-generated): Add libc-modules.h and libc-modules.stmp. + ($(common-objpfx)Versions.v.i): Depend on libc-modules.h. + * include/libc-symbols.h: Don't include libc-modules.h. + * include/libc-modules.h: Remove file. + * scripts/gen-libc-modules.awk: New script to generate + libc-modules.h. + * sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): + Depend on libc-modules.stmp. commit 8a257e2cb50cd8e8e3e2368d80bf325ea4086cf9 Author: Roland McGrath @@ -47,17 +47,17 @@ Index: glibc-2.17-c758a686/Makeconfig @@ -730,19 +730,34 @@ endif # $(+cflags) == "" # of many little headers in the include directory. libio-include = -I$(..)libio - + +# List of non-library modules that we build. +built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \ + libSegFault libpcprofile librpcsvc locale-programs \ + memusagestat nonlib nscd extramodules libnldbl + in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \ - $(libof-$( - #define IS_IN(lib) (IN_MODULE == MODULE_##lib) - + /* This file's macros are included implicitly in the compilation of every Index: glibc-2.17-c758a686/scripts/gen-libc-modules.awk =================================================================== @@ -209,12 +209,12 @@ Index: glibc-2.17-c758a686/sysdeps/unix/Makefile --- glibc-2.17-c758a686.orig/sysdeps/unix/Makefile +++ glibc-2.17-c758a686/sysdeps/unix/Makefile @@ -77,7 +77,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x - + ifndef avoid-generated $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \ - $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) + $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \ + $(common-objpfx)libc-modules.stmp - for dir in $(+sysdep_dirs); do \ - test -f $$dir/syscalls.list && \ - { sysdirs='$(sysdirs)' \ + for dir in $(+sysdep_dirs); do \ + test -f $$dir/syscalls.list && \ + { sysdirs='$(sysdirs)' \ diff --git a/SOURCES/glibc-rh1256317-16.patch b/SOURCES/glibc-rh1256317-16.patch index c376344c..28a5cfa9 100644 --- a/SOURCES/glibc-rh1256317-16.patch +++ b/SOURCES/glibc-rh1256317-16.patch @@ -9,11 +9,11 @@ Author: Siddhesh Poyarekar Date: Wed Nov 19 12:15:01 2014 +0530 Fix -Wundef warning in SHLIB_COMPAT - + Replace the IS_IN_##lib with IS_IN(lib). Verified that the generated code remains the same. - - * include/shlib-compat.h (_SHLIB_COMPAT): Use IS_IN. + + * include/shlib-compat.h (_SHLIB_COMPAT): Use IS_IN. Index: glibc-2.17-c758a686/include/shlib-compat.h =================================================================== --- glibc-2.17-c758a686.orig/include/shlib-compat.h @@ -26,17 +26,18 @@ Index: glibc-2.17-c758a686/include/shlib-compat.h + (IS_IN (lib) \ && (!(ABI_##lib##_##obsoleted - 0) \ || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))) - + Index: glibc-2.17-c758a686/rtkaio/Makefile =================================================================== --- glibc-2.17-c758a686.orig/rtkaio/Makefile +++ glibc-2.17-c758a686/rtkaio/Makefile @@ -69,7 +69,8 @@ CFLAGS-kaio_librt-cancellation.c = -fasy - + LDFLAGS-rtkaio.so = -Wl,-soname=lib$(libprefix)rt.so$(librt.so-version) \ - -Wl,--enable-new-dtags,-z,nodelete + -Wl,--enable-new-dtags,-z,nodelete -CPPFLAGS-librtkaio += -DIS_IN_librt=1 -I$(..)rt +CPPFLAGS-librtkaio += -UIN_MODULE -DIN_MODULE=MODULE_librt \ + -UIS_IN_librt -DIS_IN_librt=1 -I$(..)rt - + rpath-dirs := $(patsubst rt,rtkaio,$(rpath-dirs)) + diff --git a/SOURCES/glibc-rh1256317-17.patch b/SOURCES/glibc-rh1256317-17.patch index 162ddc86..7e2c51a3 100644 --- a/SOURCES/glibc-rh1256317-17.patch +++ b/SOURCES/glibc-rh1256317-17.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Nov 19 12:13:54 2014 +0530 Add new macro IN_MODULE to identify module in which source is built - + The current scheme to identify which module a translation unit is built in depends on defining multiple macros IS_IN_* and also defining NOT_IN_libc if we're building a non-libc module. In addition, there @@ -12,36 +12,36 @@ Date: Wed Nov 19 12:13:54 2014 +0530 unifies both ideas to use just one macro IN_MODULE and assign it a value depending on the module it is being built into. If the module is not defined, it defaults to MODULE_libc. - + Patches that follow will replace uses of IS_IN_* variables with the IS_IN() macro. libc-symbols.h has been converted already to give an example of how such a transition will look. - + Verified that there are no relevant binary changes. One source change that will crop up repeatedly is that of nscd_stat, since it uses the build timestamp as a constant in its logic. - - * Makeconfig (in-module): Get value of libof set for the - translation unit. - (CPPFLAGS): Use $(in-module). - * Makerules: Don't suffix routine names for nonlib. - * include/libc-modules.h: New file. - * include/libc-symbols.h: Include libc-modules.h - (IS_IN): New macro to replace IS_IN_* macros. - * elf/Makefile: Set libof-* for each routine. - * elf/rtld-Rules: Likewise. - * extra-modules.mk: Likewise. - * iconv/Makefile: Likewise. - * iconvdata/Makefile: Likewise. - * locale/Makefile: Likewise. - * malloc/Makefile: Likewise. - * nss/Makefile: Likewise. - * sysdeps/gnu/Makefile: Likewise. - * sysdeps/ieee754/ldbl-opt/Makefile: Likewise. - * sysdeps/unix/sysv/linux/Makefile: Likewise. - * sysdeps/s390/s390-64/Makefile: Likewise. - * nscd/Makefile: Set libof-* for each routine. Set CFLAGS and - CPPFLAGS for nscd instead of nonlib. + + * Makeconfig (in-module): Get value of libof set for the + translation unit. + (CPPFLAGS): Use $(in-module). + * Makerules: Don't suffix routine names for nonlib. + * include/libc-modules.h: New file. + * include/libc-symbols.h: Include libc-modules.h + (IS_IN): New macro to replace IS_IN_* macros. + * elf/Makefile: Set libof-* for each routine. + * elf/rtld-Rules: Likewise. + * extra-modules.mk: Likewise. + * iconv/Makefile: Likewise. + * iconvdata/Makefile: Likewise. + * locale/Makefile: Likewise. + * malloc/Makefile: Likewise. + * nss/Makefile: Likewise. + * sysdeps/gnu/Makefile: Likewise. + * sysdeps/ieee754/ldbl-opt/Makefile: Likewise. + * sysdeps/unix/sysv/linux/Makefile: Likewise. + * sysdeps/s390/s390-64/Makefile: Likewise. + * nscd/Makefile: Set libof-* for each routine. Set CFLAGS and + CPPFLAGS for nscd instead of nonlib. Index: glibc-2.17-c758a686/Makeconfig =================================================================== @@ -50,7 +50,7 @@ Index: glibc-2.17-c758a686/Makeconfig @@ -730,6 +730,11 @@ endif # $(+cflags) == "" # of many little headers in the include directory. libio-include = -I$(..)libio - + +in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \ + $(libof-$( + @@ -239,20 +239,20 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h + /* This file's macros are included implicitly in the compilation of every file in the C library by -imacros. - + @@ -450,7 +455,7 @@ for linking") If the function should be internal to multiple objects, say ld.so and libc.so, the best way is to use: - + - #if !defined NOT_IN_libc || defined IS_IN_rtld + #if IS_IN (libc) || IS_IN (rtld) hidden_proto (foo) #endif - + @@ -561,7 +566,7 @@ for linking") # define libc_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -261,7 +261,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -579,7 +584,7 @@ for linking") # define rtld_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libm +#if IS_IN (libm) # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -270,7 +270,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -597,7 +602,7 @@ for linking") # define libm_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libresolv +#if IS_IN (libresolv) # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -279,7 +279,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -615,7 +620,7 @@ for linking") # define libresolv_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_librt +#if IS_IN (librt) # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -288,7 +288,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -633,7 +638,7 @@ for linking") # define librt_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libdl +#if IS_IN (libdl) # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -297,7 +297,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -651,7 +656,7 @@ for linking") # define libdl_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libnss_files +#if IS_IN (libnss_files) # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -306,7 +306,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -669,7 +674,7 @@ for linking") # define libnss_files_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libnsl +#if IS_IN (libnsl) # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -315,7 +315,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -687,7 +692,7 @@ for linking") # define libnsl_hidden_data_ver(local, name) #endif - + -#ifdef IS_IN_libnss_nisplus +#if IS_IN (libnss_nisplus) # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -324,7 +324,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -713,7 +718,7 @@ for linking") # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) #endif - + -#ifdef IS_IN_libutil +#if IS_IN (libutil) # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -336,7 +336,7 @@ Index: glibc-2.17-c758a686/locale/Makefile +++ glibc-2.17-c758a686/locale/Makefile @@ -95,8 +95,8 @@ CFLAGS-locfile.c = -Wno-write-strings -W CFLAGS-charmap-dir.c = -Wno-write-strings - + # This makes sure -DNOT_IN_libc et al are passed for all these modules. -cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \ - $(locale-modules) $(lib-modules)) @@ -344,14 +344,14 @@ Index: glibc-2.17-c758a686/locale/Makefile + $(lib-modules) lib := locale-programs include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + Index: glibc-2.17-c758a686/malloc/Makefile =================================================================== --- glibc-2.17-c758a686.orig/malloc/Makefile +++ glibc-2.17-c758a686/malloc/Makefile @@ -97,6 +97,11 @@ endif do-memusagestat: $(objpfx)memusagestat - + memusagestat-modules = memusagestat + +cpp-srcs-left := $(memusagestat-modules) @@ -359,8 +359,8 @@ Index: glibc-2.17-c758a686/malloc/Makefile +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) + $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o) - $(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm - + $(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm + Index: glibc-2.17-c758a686/nscd/Makefile =================================================================== --- glibc-2.17-c758a686.orig/nscd/Makefile @@ -368,10 +368,10 @@ Index: glibc-2.17-c758a686/nscd/Makefile @@ -79,26 +79,25 @@ CFLAGS-nscd_gethst_r.c = -fexceptions CFLAGS-nscd_getai.c = -fexceptions CFLAGS-nscd_initgroups.c = -fexceptions - + -CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 +CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1 - + ifeq (yesyes,$(have-fpie)$(build-shared)) -CFLAGS-nonlib += $(pie-ccflag) +CFLAGS-nscd += $(pie-ccflag) @@ -384,11 +384,11 @@ Index: glibc-2.17-c758a686/nscd/Makefile -CFLAGS-nonlib += -fstack-protector-strong +CFLAGS-nscd += -fstack-protector-strong endif - + ifeq (yesyes,$(have-fpie)$(build-shared)) LDFLAGS-nscd = -Wl,-z,now endif - + -# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed -# for all these modules. -cpp-srcs-left := $(nscd-modules:=.c) @@ -397,7 +397,7 @@ Index: glibc-2.17-c758a686/nscd/Makefile +cpp-srcs-left := $(nscd-modules) +lib := nscd include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o) Index: glibc-2.17-c758a686/nss/Makefile =================================================================== @@ -405,39 +405,39 @@ Index: glibc-2.17-c758a686/nss/Makefile +++ glibc-2.17-c758a686/nss/Makefile @@ -108,7 +108,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(ob $(inst_vardbdir)/Makefile: db-Makefile $(+force) - $(do-install) - + $(do-install) + -CFLAGS-nss_test1.c = -DNOT_IN_libc=1 +libof-nss_test1 = extramodules +CPPFLAGS-nss_test1 = -DNOT_IN_libc=1 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(common-objpfx)libc.so \ - $(common-objpfx)libc_nonshared.a - $(build-module) + $(common-objpfx)libc_nonshared.a + $(build-module) Index: glibc-2.17-c758a686/stdlib/Makefile =================================================================== --- glibc-2.17-c758a686.orig/stdlib/Makefile +++ glibc-2.17-c758a686/stdlib/Makefile @@ -138,6 +138,7 @@ LDFLAGS-tst-putenv = $(no-as-needed) - + $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os - $(build-module) + $(build-module) +libof-tst-putenvmod = extramodules CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1 - + ifeq ($(build-shared),yes) Index: glibc-2.17-c758a686/sysdeps/gnu/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/gnu/Makefile +++ glibc-2.17-c758a686/sysdeps/gnu/Makefile @@ -30,6 +30,8 @@ ifeq ($(subdir),stdio-common) - + errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .))) - + +libof-errlist-compat = extramodules + ifeq ($(versioning),yes) $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \ - $(common-objpfx)Versions.v.i $(before-compile) + $(common-objpfx)Versions.v.i $(before-compile) Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/Makefile @@ -445,22 +445,23 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/Makefile @@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z extra-modules-left += $(s390x-iconv-modules) include extra-module.mk - + +cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines)) +lib := iconvdata +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) + extra-objs += $(addsuffix .so, $(s390x-iconv-modules)) install-others += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) - + Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/Makefile +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/Makefile @@ -159,6 +159,7 @@ ifeq ($(subdir),elf) sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \ - dl-fxstatat64 - + dl-fxstatat64 + +libof-lddlibc4 = lddlibc4 CPPFLAGS-lddlibc4 += -DNOT_IN_libc endif + diff --git a/SOURCES/glibc-rh1256317-18.patch b/SOURCES/glibc-rh1256317-18.patch index 2cf0a89a..f7cd4c6e 100644 --- a/SOURCES/glibc-rh1256317-18.patch +++ b/SOURCES/glibc-rh1256317-18.patch @@ -3,24 +3,24 @@ Author: Siddhesh Poyarekar Date: Tue Sep 16 22:20:45 2014 +0530 Remove CFLAGS for interp.c - + Replace it with including an auto-generated linker-runtime.h. Build-tested on x86_64 and found that there was no change in the generated code. - - * elf/Makefile (CFLAGS-interp.c): Remove. - ($(elf-objpfx)runtime-linker.h): Generate header with linker - path string. - * elf/interp.c: Include generated runtime-linker.h + + * elf/Makefile (CFLAGS-interp.c): Remove. + ($(elf-objpfx)runtime-linker.h): Generate header with linker + path string. + * elf/interp.c: Include generated runtime-linker.h Index: glibc-2.17-c758a686/elf/Makefile =================================================================== --- glibc-2.17-c758a686.orig/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -344,9 +344,16 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld - $(READELF) -s $@ \ - | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' - + $(READELF) -s $@ \ + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' + -# interp.c exists just to get this string into the libraries. -CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' -$(objpfx)interp.os: $(common-objpfx)config.make @@ -34,7 +34,7 @@ Index: glibc-2.17-c758a686/elf/Makefile + > ${@:st=T} + $(move-if-change) ${@:st=T} ${@:st=h} + touch $@ - + ifneq (ld.so,$(rtld-installed-name)) # Make sure ld.so.1 exists in the build directory so we can link Index: glibc-2.17-c758a686/elf/interp.c @@ -44,7 +44,7 @@ Index: glibc-2.17-c758a686/elf/interp.c @@ -16,5 +16,7 @@ License along with the GNU C Library; if not, see . */ - + +#include + const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) diff --git a/SOURCES/glibc-rh1256317-19.patch b/SOURCES/glibc-rh1256317-19.patch index cecedd96..c23c58ef 100644 --- a/SOURCES/glibc-rh1256317-19.patch +++ b/SOURCES/glibc-rh1256317-19.patch @@ -3,22 +3,22 @@ Author: Siddhesh Poyarekar Date: Tue Sep 16 22:19:22 2014 +0530 Include .interp section only for libc.so - + Barring libc.so and libdl.so, none of the libraries have any entry points, so it is pointless to add a .interp section for them. The libdl.so entry point (in dlfcn/eval.c) is also defunct, so remove that file as well. - + Build tested for x86_64, ppc64 and s390x. I have not moved CFLAGS-interp.c to CPPFLAGS-interp.c isnce I'll be removing it completely in a follow-up patch. - + Siddhesh - - * Makerules (lib%.so): Don't include $(+interp) in - prerequisites. - * elf/Makefile (CFLAGS-interp.c): Don't define NOT_IN_libc. - * dlfcn/eval.c: Remove file. + + * Makerules (lib%.so): Don't include $(+interp) in + prerequisites. + * elf/Makefile (CFLAGS-interp.c): Don't define NOT_IN_libc. + * dlfcn/eval.c: Remove file. Index: glibc-2.17-c758a686/Makerules =================================================================== @@ -30,8 +30,8 @@ Index: glibc-2.17-c758a686/Makerules # on other shared objects. -lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) +lib%.so: lib%_pic.a $(+preinit) $(+postinit) - $(build-shlib) - + $(build-shlib) + define build-shlib-helper Index: glibc-2.17-c758a686/dlfcn/eval.c =================================================================== @@ -243,12 +243,12 @@ Index: glibc-2.17-c758a686/elf/Makefile --- glibc-2.17-c758a686.orig/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -345,8 +345,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld - | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' - + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' + # interp.c exists just to get this string into the libraries. -CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \ - -DNOT_IN_libc=1 +CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' $(objpfx)interp.os: $(common-objpfx)config.make - + ifneq (ld.so,$(rtld-installed-name)) diff --git a/SOURCES/glibc-rh1256317-2.patch b/SOURCES/glibc-rh1256317-2.patch index cb2a9b85..dc9445e9 100644 --- a/SOURCES/glibc-rh1256317-2.patch +++ b/SOURCES/glibc-rh1256317-2.patch @@ -3,335 +3,335 @@ Author: Siddhesh Poyarekar Date: Mon Nov 24 15:03:45 2014 +0530 Remove NOT_IN_libc - + Replace with !IS_IN (libc). This completes the transition from the IS_IN/NOT_IN macros to the IN_MODULE macro set. - + The generated code is unchanged on x86_64. - - * stdlib/isomac.c (fmt): Replace NOT_IN_libc with IN_MODULE. - (get_null_defines): Adjust. - * sunrpc/Makefile: Adjust comment. - * Makerules (CPPFLAGS-nonlib): Remove NOT_IN_libc. - * elf/Makefile (CPPFLAGS-sotruss-lib): Likewise. - (CFLAGS-interp.c): Likewise. - (CFLAGS-ldconfig.c): Likewise. - (CPPFLAGS-.os): Likewise. - * elf/rtld-Rules (rtld-CPPFLAGS): Likewise. - * extra-lib.mk (CPPFLAGS-$(lib)): Likewise. - * extra-modules.mk (extra-modules.mk): Likewise. - * iconv/Makefile (CPPFLAGS-iconvprogs): Likewise. - * locale/Makefile (CPPFLAGS-locale_programs): Likewise. - * malloc/Makefile (CPPFLAGS-memusagestat): Likewise. - * nscd/Makefile (CPPFLAGS-nscd): Likewise. - * nss/Makefile (CPPFLAGS-nss_test1): Likewise. - * stdlib/Makefile (CFLAGS-tst-putenvmod.c): Likewise. - * sysdeps/gnu/Makefile ($(objpfx)errlist-compat.c): Likewise. - * sysdeps/unix/sysv/linux/Makefile (CPPFLAGS-lddlibc4): Likewise. - * iconvdata/Makefile (CPPFLAGS): Likewise. - (cpp-srcs-left): Add libof for all iconvdata routines. - * bits/stdio-lock.h: Replace NOT_IN_libc with IS_IN. - * include/assert.h: Likewise. - * include/ctype.h: Likewise. - * include/errno.h: Likewise. - * include/libc-symbols.h: Likewise. - * include/math.h: Likewise. - * include/netdb.h: Likewise. - * include/resolv.h: Likewise. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/string.h: Likewise. - * include/sys/stat.h: Likewise. - * include/wctype.h: Likewise. - * intl/l10nflist.c: Likewise. - * libidn/idn-stub.c: Likewise. - * libio/libioP.h: Likewise. - * nptl/libc_multiple_threads.c: Likewise. - * nptl/pthreadP.h: Likewise. - * posix/regex_internal.h: Likewise. - * resolv/res_hconf.c: Likewise. - * sysdeps/arm/armv7/multiarch/memcpy.S: Likewise. - * sysdeps/arm/memmove.S: Likewise. - * sysdeps/arm/sysdep.h: Likewise. - * sysdeps/generic/_itoa.h: Likewise. - * sysdeps/generic/symbol-hacks.h: Likewise. - * sysdeps/gnu/errlist.awk: Likewise. - * sysdeps/gnu/errlist.c: Likewise. - * sysdeps/i386/i586/memcpy.S: Likewise. - * sysdeps/i386/i586/memset.S: Likewise. - * sysdeps/i386/i686/memcpy.S: Likewise. - * sysdeps/i386/i686/memmove.S: Likewise. - * sysdeps/i386/i686/mempcpy.S: Likewise. - * sysdeps/i386/i686/memset.S: Likewise. - * sysdeps/i386/i686/multiarch/bcopy.S: Likewise. - * sysdeps/i386/i686/multiarch/bzero.S: Likewise. - * sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S: Likewise. - * sysdeps/i386/i686/multiarch/memchr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/memchr.S: Likewise. - * sysdeps/i386/i686/multiarch/memcmp-sse4.S: Likewise. - * sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/memcmp.S: Likewise. - * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise. - * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/memcpy.S: Likewise. - * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise. - * sysdeps/i386/i686/multiarch/memmove.S: Likewise. - * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise. - * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise. - * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise. - * sysdeps/i386/i686/multiarch/memrchr-c.c: Likewise. - * sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S: Likewise. - * sysdeps/i386/i686/multiarch/memrchr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/memrchr.S: Likewise. - * sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise. - * sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/memset.S: Likewise. - * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise. - * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise. - * sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/strcat-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/strcat.S: Likewise. - * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Likewise. - * sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/strchr.S: Likewise. - * sysdeps/i386/i686/multiarch/strcmp-sse4.S: Likewise. - * sysdeps/i386/i686/multiarch/strcmp-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/strcmp.S: Likewise. - * sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/strcpy-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/strcpy.S: Likewise. - * sysdeps/i386/i686/multiarch/strcspn.S: Likewise. - * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise. - * sysdeps/i386/i686/multiarch/strlen-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/strlen.S: Likewise. - * sysdeps/i386/i686/multiarch/strnlen.S: Likewise. - * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise. - * sysdeps/i386/i686/multiarch/strrchr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/strrchr.S: Likewise. - * sysdeps/i386/i686/multiarch/strspn.S: Likewise. - * sysdeps/i386/i686/multiarch/wcschr-c.c: Likewise. - * sysdeps/i386/i686/multiarch/wcschr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/wcschr.S: Likewise. - * sysdeps/i386/i686/multiarch/wcscmp-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise. - * sysdeps/i386/i686/multiarch/wcscpy-c.c: Likewise. - * sysdeps/i386/i686/multiarch/wcscpy-ssse3.S: Likewise. - * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise. - * sysdeps/i386/i686/multiarch/wcslen-c.c: Likewise. - * sysdeps/i386/i686/multiarch/wcslen-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/wcslen.S: Likewise. - * sysdeps/i386/i686/multiarch/wcsrchr-c.c: Likewise. - * sysdeps/i386/i686/multiarch/wcsrchr-sse2.S: Likewise. - * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise. - * sysdeps/i386/i686/multiarch/wmemcmp-c.c: Likewise. - * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise. - * sysdeps/ia64/fpu/libm-symbols.h: Likewise. - * sysdeps/nptl/bits/libc-lock.h: Likewise. - * sysdeps/nptl/bits/libc-lockP.h: Likewise. - * sysdeps/nptl/bits/stdio-lock.h: Likewise. - * sysdeps/posix/closedir.c: Likewise. - * sysdeps/posix/opendir.c: Likewise. - * sysdeps/posix/readdir.c: Likewise. - * sysdeps/posix/rewinddir.c: Likewise. - * sysdeps/powerpc/novmx-sigjmp.c: Likewise. - * sysdeps/powerpc/powerpc32/__longjmp.S: Likewise. - * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise. - * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise. - * sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise. - * sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c: Likewise. - * sysdeps/powerpc/powerpc32/power6/memset.S: Likewise. - * sysdeps/powerpc/powerpc32/setjmp.S: Likewise. - * sysdeps/powerpc/powerpc64/__longjmp.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/bzero.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memmove.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memrchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/memset.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strchrnul.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strcspn.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strlen.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncase.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncase_l.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncat.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strpbrk.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strspn.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise. - * sysdeps/powerpc/powerpc64/multiarch/wordcopy.c: Likewise. - * sysdeps/powerpc/powerpc64/setjmp.S: Likewise. - * sysdeps/s390/s390-32/multiarch/ifunc-resolve.c: Likewise. - * sysdeps/s390/s390-32/multiarch/memcmp.S: Likewise. - * sysdeps/s390/s390-32/multiarch/memcpy.S: Likewise. - * sysdeps/s390/s390-32/multiarch/memset.S: Likewise. - * sysdeps/s390/s390-64/multiarch/ifunc-resolve.c: Likewise. - * sysdeps/s390/s390-64/multiarch/memcmp.S: Likewise. - * sysdeps/s390/s390-64/multiarch/memcpy.S: Likewise. - * sysdeps/s390/s390-64/multiarch/memset.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memset-niagara1.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: Likewise. - * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise. - * sysdeps/unix/alpha/sysdep.S: Likewise. - * sysdeps/unix/alpha/sysdep.h: Likewise. - * sysdeps/unix/make-syscalls.sh: Likewise. - * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/alpha/vfork.S: Likewise. - * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/getpid.c: Likewise. - * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise. - * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise. - * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise. - * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/longjmp_chk.c: Likewise. - * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise. - * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise. - * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/sh/vfork.S: Likewise. - * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise. - * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. - * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. - * sysdeps/wordsize-32/symbol-hacks.h: Likewise. - * sysdeps/x86_64/memcpy.S: Likewise. - * sysdeps/x86_64/memmove.c: Likewise. - * sysdeps/x86_64/memset.S: Likewise. - * sysdeps/x86_64/multiarch/init-arch.h: Likewise. - * sysdeps/x86_64/multiarch/memcmp-sse4.S: Likewise. - * sysdeps/x86_64/multiarch/memcmp-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/memcmp.S: Likewise. - * sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: Likewise. - * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise. - * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/memcpy.S: Likewise. - * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise. - * sysdeps/x86_64/multiarch/memmove.c: Likewise. - * sysdeps/x86_64/multiarch/mempcpy.S: Likewise. - * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise. - * sysdeps/x86_64/multiarch/memset-avx2.S: Likewise. - * sysdeps/x86_64/multiarch/memset.S: Likewise. - * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. - * sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: Likewise. - * sysdeps/x86_64/multiarch/strcat-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/strcat.S: Likewise. - * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise. - * sysdeps/x86_64/multiarch/strchr.S: Likewise. - * sysdeps/x86_64/multiarch/strcmp-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/strcmp.S: Likewise. - * sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: Likewise. - * sysdeps/x86_64/multiarch/strcpy-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/strcpy.S: Likewise. - * sysdeps/x86_64/multiarch/strcspn.S: Likewise. - * sysdeps/x86_64/multiarch/strspn.S: Likewise. - * sysdeps/x86_64/multiarch/wcscpy-c.c: Likewise. - * sysdeps/x86_64/multiarch/wcscpy-ssse3.S: Likewise. - * sysdeps/x86_64/multiarch/wcscpy.S: Likewise. - * sysdeps/x86_64/multiarch/wmemcmp-c.c: Likewise. - * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise. - * sysdeps/x86_64/strcmp.S: Likewise. + + * stdlib/isomac.c (fmt): Replace NOT_IN_libc with IN_MODULE. + (get_null_defines): Adjust. + * sunrpc/Makefile: Adjust comment. + * Makerules (CPPFLAGS-nonlib): Remove NOT_IN_libc. + * elf/Makefile (CPPFLAGS-sotruss-lib): Likewise. + (CFLAGS-interp.c): Likewise. + (CFLAGS-ldconfig.c): Likewise. + (CPPFLAGS-.os): Likewise. + * elf/rtld-Rules (rtld-CPPFLAGS): Likewise. + * extra-lib.mk (CPPFLAGS-$(lib)): Likewise. + * extra-modules.mk (extra-modules.mk): Likewise. + * iconv/Makefile (CPPFLAGS-iconvprogs): Likewise. + * locale/Makefile (CPPFLAGS-locale_programs): Likewise. + * malloc/Makefile (CPPFLAGS-memusagestat): Likewise. + * nscd/Makefile (CPPFLAGS-nscd): Likewise. + * nss/Makefile (CPPFLAGS-nss_test1): Likewise. + * stdlib/Makefile (CFLAGS-tst-putenvmod.c): Likewise. + * sysdeps/gnu/Makefile ($(objpfx)errlist-compat.c): Likewise. + * sysdeps/unix/sysv/linux/Makefile (CPPFLAGS-lddlibc4): Likewise. + * iconvdata/Makefile (CPPFLAGS): Likewise. + (cpp-srcs-left): Add libof for all iconvdata routines. + * bits/stdio-lock.h: Replace NOT_IN_libc with IS_IN. + * include/assert.h: Likewise. + * include/ctype.h: Likewise. + * include/errno.h: Likewise. + * include/libc-symbols.h: Likewise. + * include/math.h: Likewise. + * include/netdb.h: Likewise. + * include/resolv.h: Likewise. + * include/stdio.h: Likewise. + * include/stdlib.h: Likewise. + * include/string.h: Likewise. + * include/sys/stat.h: Likewise. + * include/wctype.h: Likewise. + * intl/l10nflist.c: Likewise. + * libidn/idn-stub.c: Likewise. + * libio/libioP.h: Likewise. + * nptl/libc_multiple_threads.c: Likewise. + * nptl/pthreadP.h: Likewise. + * posix/regex_internal.h: Likewise. + * resolv/res_hconf.c: Likewise. + * sysdeps/arm/armv7/multiarch/memcpy.S: Likewise. + * sysdeps/arm/memmove.S: Likewise. + * sysdeps/arm/sysdep.h: Likewise. + * sysdeps/generic/_itoa.h: Likewise. + * sysdeps/generic/symbol-hacks.h: Likewise. + * sysdeps/gnu/errlist.awk: Likewise. + * sysdeps/gnu/errlist.c: Likewise. + * sysdeps/i386/i586/memcpy.S: Likewise. + * sysdeps/i386/i586/memset.S: Likewise. + * sysdeps/i386/i686/memcpy.S: Likewise. + * sysdeps/i386/i686/memmove.S: Likewise. + * sysdeps/i386/i686/mempcpy.S: Likewise. + * sysdeps/i386/i686/memset.S: Likewise. + * sysdeps/i386/i686/multiarch/bcopy.S: Likewise. + * sysdeps/i386/i686/multiarch/bzero.S: Likewise. + * sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S: Likewise. + * sysdeps/i386/i686/multiarch/memchr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/memchr.S: Likewise. + * sysdeps/i386/i686/multiarch/memcmp-sse4.S: Likewise. + * sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/memcmp.S: Likewise. + * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise. + * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/memcpy.S: Likewise. + * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise. + * sysdeps/i386/i686/multiarch/memmove.S: Likewise. + * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise. + * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise. + * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise. + * sysdeps/i386/i686/multiarch/memrchr-c.c: Likewise. + * sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S: Likewise. + * sysdeps/i386/i686/multiarch/memrchr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/memrchr.S: Likewise. + * sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise. + * sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/memset.S: Likewise. + * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise. + * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise. + * sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/strcat-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/strcat.S: Likewise. + * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Likewise. + * sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/strchr.S: Likewise. + * sysdeps/i386/i686/multiarch/strcmp-sse4.S: Likewise. + * sysdeps/i386/i686/multiarch/strcmp-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/strcmp.S: Likewise. + * sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/strcpy-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/strcpy.S: Likewise. + * sysdeps/i386/i686/multiarch/strcspn.S: Likewise. + * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise. + * sysdeps/i386/i686/multiarch/strlen-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/strlen.S: Likewise. + * sysdeps/i386/i686/multiarch/strnlen.S: Likewise. + * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise. + * sysdeps/i386/i686/multiarch/strrchr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/strrchr.S: Likewise. + * sysdeps/i386/i686/multiarch/strspn.S: Likewise. + * sysdeps/i386/i686/multiarch/wcschr-c.c: Likewise. + * sysdeps/i386/i686/multiarch/wcschr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/wcschr.S: Likewise. + * sysdeps/i386/i686/multiarch/wcscmp-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise. + * sysdeps/i386/i686/multiarch/wcscpy-c.c: Likewise. + * sysdeps/i386/i686/multiarch/wcscpy-ssse3.S: Likewise. + * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise. + * sysdeps/i386/i686/multiarch/wcslen-c.c: Likewise. + * sysdeps/i386/i686/multiarch/wcslen-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/wcslen.S: Likewise. + * sysdeps/i386/i686/multiarch/wcsrchr-c.c: Likewise. + * sysdeps/i386/i686/multiarch/wcsrchr-sse2.S: Likewise. + * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise. + * sysdeps/i386/i686/multiarch/wmemcmp-c.c: Likewise. + * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise. + * sysdeps/ia64/fpu/libm-symbols.h: Likewise. + * sysdeps/nptl/bits/libc-lock.h: Likewise. + * sysdeps/nptl/bits/libc-lockP.h: Likewise. + * sysdeps/nptl/bits/stdio-lock.h: Likewise. + * sysdeps/posix/closedir.c: Likewise. + * sysdeps/posix/opendir.c: Likewise. + * sysdeps/posix/readdir.c: Likewise. + * sysdeps/posix/rewinddir.c: Likewise. + * sysdeps/powerpc/novmx-sigjmp.c: Likewise. + * sysdeps/powerpc/powerpc32/__longjmp.S: Likewise. + * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise. + * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise. + * sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c: Likewise. + * sysdeps/powerpc/powerpc32/power6/memset.S: Likewise. + * sysdeps/powerpc/powerpc32/setjmp.S: Likewise. + * sysdeps/powerpc/powerpc64/__longjmp.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/bzero.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memmove.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memrchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/memset.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strchrnul.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strcspn.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strlen.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncase.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncase_l.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncat.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strpbrk.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strspn.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise. + * sysdeps/powerpc/powerpc64/multiarch/wordcopy.c: Likewise. + * sysdeps/powerpc/powerpc64/setjmp.S: Likewise. + * sysdeps/s390/s390-32/multiarch/ifunc-resolve.c: Likewise. + * sysdeps/s390/s390-32/multiarch/memcmp.S: Likewise. + * sysdeps/s390/s390-32/multiarch/memcpy.S: Likewise. + * sysdeps/s390/s390-32/multiarch/memset.S: Likewise. + * sysdeps/s390/s390-64/multiarch/ifunc-resolve.c: Likewise. + * sysdeps/s390/s390-64/multiarch/memcmp.S: Likewise. + * sysdeps/s390/s390-64/multiarch/memcpy.S: Likewise. + * sysdeps/s390/s390-64/multiarch/memset.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memset-niagara1.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: Likewise. + * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise. + * sysdeps/unix/alpha/sysdep.S: Likewise. + * sysdeps/unix/alpha/sysdep.h: Likewise. + * sysdeps/unix/make-syscalls.sh: Likewise. + * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/vfork.S: Likewise. + * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/getpid.c: Likewise. + * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise. + * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/s390/longjmp_chk.c: Likewise. + * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise. + * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise. + * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/sh/vfork.S: Likewise. + * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. + * sysdeps/wordsize-32/symbol-hacks.h: Likewise. + * sysdeps/x86_64/memcpy.S: Likewise. + * sysdeps/x86_64/memmove.c: Likewise. + * sysdeps/x86_64/memset.S: Likewise. + * sysdeps/x86_64/multiarch/init-arch.h: Likewise. + * sysdeps/x86_64/multiarch/memcmp-sse4.S: Likewise. + * sysdeps/x86_64/multiarch/memcmp-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/memcmp.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise. + * sysdeps/x86_64/multiarch/memmove.c: Likewise. + * sysdeps/x86_64/multiarch/mempcpy.S: Likewise. + * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise. + * sysdeps/x86_64/multiarch/memset-avx2.S: Likewise. + * sysdeps/x86_64/multiarch/memset.S: Likewise. + * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. + * sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: Likewise. + * sysdeps/x86_64/multiarch/strcat-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/strcat.S: Likewise. + * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise. + * sysdeps/x86_64/multiarch/strchr.S: Likewise. + * sysdeps/x86_64/multiarch/strcmp-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/strcmp.S: Likewise. + * sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: Likewise. + * sysdeps/x86_64/multiarch/strcpy-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/strcpy.S: Likewise. + * sysdeps/x86_64/multiarch/strcspn.S: Likewise. + * sysdeps/x86_64/multiarch/strspn.S: Likewise. + * sysdeps/x86_64/multiarch/wcscpy-c.c: Likewise. + * sysdeps/x86_64/multiarch/wcscpy-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/wcscpy.S: Likewise. + * sysdeps/x86_64/multiarch/wmemcmp-c.c: Likewise. + * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise. + * sysdeps/x86_64/strcmp.S: Likewise. Index: glibc-2.17-c758a686/bits/stdio-lock.h =================================================================== @@ -340,7 +340,7 @@ Index: glibc-2.17-c758a686/bits/stdio-lock.h @@ -44,7 +44,7 @@ __libc_lock_define_recursive (typedef, _ #define _IO_cleanup_region_end(_doit) \ __libc_cleanup_region_end (_doit) - + -#if defined _LIBC && !defined NOT_IN_libc +#if defined _LIBC && IS_IN (libc) # define _IO_acquire_lock(_fp) \ @@ -356,10 +356,10 @@ Index: glibc-2.17-c758a686/elf/Makefile libof-sotruss-lib = extramodules -CPPFLAGS-sotruss-lib = -DNOT_IN_libc $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os - $(build-module-asneeded) + $(build-module-asneeded) $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ @@ -437,15 +436,12 @@ $(objpfx)pldd: $(pldd-modules:%=$(objpfx - + SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ - -D'SLIBDIR="$(slibdir)"' -DNOT_IN_libc @@ -368,7 +368,7 @@ Index: glibc-2.17-c758a686/elf/Makefile CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) CFLAGS-rtld.c = $(SYSCONF-FLAGS) - + -CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ - -DNOT_IN_libc=1) - @@ -382,13 +382,13 @@ Index: glibc-2.17-c758a686/elf/rtld-Rules @@ -128,12 +128,10 @@ ifdef rtld-depfiles -include $(rtld-depfiles) endif - + +# This here is the whole point of all the shenanigans. # Set libof-* for each routine. cpp-srcs-left := $(rtld-modules:%.os=%) lib := rtld include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + -# This here is the whole point of all the shenanigans. -rtld-CPPFLAGS := -DNOT_IN_libc=1 - @@ -409,7 +409,7 @@ Index: glibc-2.17-c758a686/extra-modules.mk +++ glibc-2.17-c758a686/extra-modules.mk @@ -7,4 +7,3 @@ module := $(firstword $(extra-modules-le extra-modules-left := $(filter-out $(module),$(extra-modules-left)) - + libof-$(notdir $(module)) := extramodules -CPPFLAGS-$(module).c += -DNOT_IN_libc Index: glibc-2.17-c758a686/iconv/Makefile @@ -419,7 +419,7 @@ Index: glibc-2.17-c758a686/iconv/Makefile @@ -53,8 +53,6 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$( CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"' CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"' - + -CPPFLAGS-iconvprogs = -DNOT_IN_libc - # Set libof-* for each routine. @@ -432,7 +432,7 @@ Index: glibc-2.17-c758a686/iconvdata/Makefile @@ -76,9 +76,6 @@ endif test-srcs := tst-table-from tst-table-to endif - + -# No code here is in libc.so. -CPPFLAGS += -DNOT_IN_libc - @@ -441,7 +441,7 @@ Index: glibc-2.17-c758a686/iconvdata/Makefile libGB-routines := gb2312 @@ -267,7 +264,9 @@ endif # build-shared = yes include ../Rules - + # Set libof-* for each routine. -cpp-srcs-left := $(modules) $(generated-modules) +cpp-srcs-left := $(modules) $(generated-modules) $(libJIS-routines) \ @@ -449,15 +449,15 @@ Index: glibc-2.17-c758a686/iconvdata/Makefile + $(libISOIR165-routines) $(libJISX0213-routines) lib := iconvdata include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + Index: glibc-2.17-c758a686/include/assert.h =================================================================== --- glibc-2.17-c758a686.orig/include/assert.h +++ glibc-2.17-c758a686/include/assert.h @@ -20,7 +20,7 @@ extern void __assert_fail_base (const ch - const char *function) + const char *function) __THROW __attribute__ ((__noreturn__)); - + -# if !defined NOT_IN_libc || IS_IN (rtld) +# if IS_IN (libc) || IS_IN (rtld) hidden_proto (__assert_fail) @@ -470,12 +470,12 @@ Index: glibc-2.17-c758a686/include/errno.h @@ -17,19 +17,19 @@ # define errno rtld_errno extern int rtld_errno attribute_hidden; - + -# elif !defined NOT_IN_libc || IS_IN_LIB +# elif IS_IN_LIB - + # include - + # undef errno -# ifndef NOT_IN_libc +# if IS_IN (libc) @@ -484,12 +484,12 @@ Index: glibc-2.17-c758a686/include/errno.h # define errno errno /* For #ifndef errno tests. */ # endif extern __thread int errno attribute_tls_model_ie; - + -# endif /* !NOT_IN_libc || IS_IN_LIB */ +# endif /* IS_IN_LIB */ - + # define __set_errno(val) (errno = (val)) - + Index: glibc-2.17-c758a686/include/math.h =================================================================== --- glibc-2.17-c758a686.orig/include/math.h @@ -497,7 +497,7 @@ Index: glibc-2.17-c758a686/include/math.h @@ -6,7 +6,7 @@ /* Now define the internal interfaces. */ extern int __matherr (struct exception *__exc); - + -# if !defined NOT_IN_libc || IS_IN (libm) +# if IS_IN (libc) || IS_IN (libm) hidden_proto (__finite) @@ -509,7 +509,7 @@ Index: glibc-2.17-c758a686/include/stdio.h +++ glibc-2.17-c758a686/include/stdio.h @@ -117,7 +117,7 @@ extern const char *const _sys_errlist_in extern int _sys_nerr_internal attribute_hidden; - + libc_hidden_proto (__asprintf) -# if !defined NOT_IN_libc +# if IS_IN (libc) @@ -522,7 +522,7 @@ Index: glibc-2.17-c758a686/include/string.h +++ glibc-2.17-c758a686/include/string.h @@ -57,7 +57,7 @@ extern __typeof (strcasecmp_l) __strcase extern __typeof (strncasecmp_l) __strncasecmp_l; - + /* Alternative version which doesn't pollute glibc's namespace. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) @@ -536,7 +536,7 @@ Index: glibc-2.17-c758a686/include/sys/stat.h @@ -12,7 +12,7 @@ extern __mode_t __umask (__mode_t __mask extern int __mkdir (const char *__path, __mode_t __mode); extern int __mknod (const char *__path, - __mode_t __mode, __dev_t __dev); + __mode_t __mode, __dev_t __dev); -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) hidden_proto (__fxstat) @@ -547,7 +547,7 @@ Index: glibc-2.17-c758a686/include/wctype.h --- glibc-2.17-c758a686.orig/include/wctype.h +++ glibc-2.17-c758a686/include/wctype.h @@ -89,7 +89,7 @@ libc_hidden_proto (__towupper_l) - + /* The spec says that isdigit must only match the decimal digits. We can check this without a memory access. */ -# ifndef NOT_IN_libc @@ -574,8 +574,8 @@ Index: glibc-2.17-c758a686/libidn/idn-stub.c +++ glibc-2.17-c758a686/libidn/idn-stub.c @@ -130,7 +130,7 @@ __idna_to_ascii_lz (const char *input, c } - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) libc_freeres_fn (unload_libidn) @@ -588,7 +588,7 @@ Index: glibc-2.17-c758a686/libio/libioP.h @@ -900,7 +900,7 @@ _IO_acquire_lock_clear_flags2_fct (_IO_F _IO_funlockfile (fp); } - + -#if !defined _IO_MTSAFE_IO && !defined NOT_IN_libc +#if !defined _IO_MTSAFE_IO && IS_IN (libc) # define _IO_acquire_lock(_fp) \ @@ -601,7 +601,7 @@ Index: glibc-2.17-c758a686/malloc/Makefile @@ -56,8 +56,6 @@ extra-objs = mcheck-init.o libmcheck.a # Include the cleanup handler. aux := set-freeres thread-freeres - + -CPPFLAGS-memusagestat = -DNOT_IN_libc - # The Perl script to analyze the output of the mtrace functions. @@ -612,9 +612,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c @@ -18,7 +18,7 @@ - + #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifndef TLS_MULTIPLE_THREADS_IN_TCB @@ -627,7 +627,7 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h @@ -273,7 +273,7 @@ __do_cancel (void) #define CANCEL_RESET(oldtype) \ __pthread_disable_asynccancel (oldtype) - + -#if !defined NOT_IN_libc +#if IS_IN (libc) /* Same as CANCEL_ASYNC, but for use in libc.so. */ @@ -640,10 +640,10 @@ Index: glibc-2.17-c758a686/nscd/Makefile @@ -79,7 +79,7 @@ CFLAGS-nscd_gethst_r.c = -fexceptions CFLAGS-nscd_getai.c = -fexceptions CFLAGS-nscd_initgroups.c = -fexceptions - + -CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 -DNOT_IN_libc +CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 - + ifeq (yesyes,$(have-fpie)$(build-shared)) CFLAGS-nscd += $(pie-ccflag) Index: glibc-2.17-c758a686/posix/regex_internal.h @@ -653,16 +653,16 @@ Index: glibc-2.17-c758a686/posix/regex_internal.h @@ -385,7 +385,7 @@ typedef struct re_dfa_t re_dfa_t; # endif #endif - + -#ifndef NOT_IN_libc +#if IS_IN (libc) static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, - int new_buf_len) + int new_buf_len) internal_function; @@ -735,7 +735,7 @@ re_string_wchar_at (const re_string_t *p return (wint_t) pstr->wcs[idx]; } - + -# ifndef NOT_IN_libc +# if IS_IN (libc) static int @@ -680,25 +680,25 @@ Index: glibc-2.17-c758a686/stdlib/isomac.c +%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC \ +-DIN_MODULE=MODULE_extramodules -I. \ -isystem `%s --print-prog-name=include` - 2> /dev/null > %s"; - - + + @@ -304,7 +305,7 @@ get_null_defines (void) - ; + ; result[result_len] = xstrndup (start, end - start); - + - if (strcmp (result[result_len], "NOT_IN_libc") != 0) + if (strcmp (result[result_len], "IN_MODULE") != 0) - { - if (first) - { + { + if (first) + { Index: glibc-2.17-c758a686/sunrpc/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sunrpc/Makefile +++ glibc-2.17-c758a686/sunrpc/Makefile @@ -168,7 +168,7 @@ $(cross-rpcgen-objs): $(objpfx)cross-%.o $(objpfx)cross-rpcgen: $(cross-rpcgen-objs) - $(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@ - + $(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@ + -# This makes sure -DNOT_IN_libc is passed for all these modules. +# This makes sure -DIN_MODULE is passed for all these modules. cpp-srcs-left := $(rpcgen-objs:.o=.c) @@ -709,20 +709,20 @@ Index: glibc-2.17-c758a686/ports/sysdeps/arm/memmove.S --- glibc-2.17-c758a686.orig/ports/sysdeps/arm/memmove.S +++ glibc-2.17-c758a686/ports/sysdeps/arm/memmove.S @@ -65,7 +65,7 @@ ENTRY(memmove) - - subs ip, r0, r1 - cmphi r2, ip + + subs ip, r0, r1 + cmphi r2, ip -#ifdef NOT_IN_libc +#if !IS_IN (libc) - bls memcpy + bls memcpy #else - bls HIDDEN_JUMPTARGET(memcpy) + bls HIDDEN_JUMPTARGET(memcpy) Index: glibc-2.17-c758a686/sysdeps/generic/_itoa.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/generic/_itoa.h +++ glibc-2.17-c758a686/sysdeps/generic/_itoa.h @@ -46,12 +46,12 @@ extern char *_itoa (unsigned long long i - + extern const char _itoa_upper_digits[]; extern const char _itoa_lower_digits[]; -#if !defined NOT_IN_libc || IS_IN (rtld) @@ -730,11 +730,11 @@ Index: glibc-2.17-c758a686/sysdeps/generic/_itoa.h hidden_proto (_itoa_upper_digits) hidden_proto (_itoa_lower_digits) #endif - + -#ifndef NOT_IN_libc +#if IS_IN (libc) extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim, - unsigned int base, int upper_case); + unsigned int base, int upper_case); #else Index: glibc-2.17-c758a686/sysdeps/generic/symbol-hacks.h =================================================================== @@ -754,60 +754,60 @@ Index: glibc-2.17-c758a686/sysdeps/gnu/Makefile +++ glibc-2.17-c758a686/sysdeps/gnu/Makefile @@ -41,7 +41,7 @@ $(objpfx)errlist-compat.c: $(errlist-c) endif - $(make-target-directory) - $(AWK) -v maxerr=`\ + $(make-target-directory) + $(AWK) -v maxerr=`\ - $(CC) -S $(CPPFLAGS) $(CFLAGS) -DNOT_IN_libc -DEMIT_ERR_MAX $< -o - \ + $(CC) -S $(CPPFLAGS) $(CFLAGS) -DEMIT_ERR_MAX $< -o - \ - | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \ - -f $(..)sysdeps/gnu/errlist-compat.awk \ - $(wildcard $(sysdirs:=/Versions)) > $@T + | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \ + -f $(..)sysdeps/gnu/errlist-compat.awk \ + $(wildcard $(sysdirs:=/Versions)) > $@T Index: glibc-2.17-c758a686/sysdeps/i386/i586/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i586/memset.S +++ glibc-2.17-c758a686/sysdeps/i386/i586/memset.S @@ -37,7 +37,7 @@ #endif - + .text -#if defined PIC && !defined NOT_IN_libc && !BZERO_P +#if defined PIC && IS_IN (libc) && !BZERO_P ENTRY (__memset_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/memset.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/memset.S @@ -38,7 +38,7 @@ #endif - + .text -#if defined PIC && !defined NOT_IN_libc && !BZERO_P +#if defined PIC && IS_IN (libc) && !BZERO_P ENTRY_CHK (__memset_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) @@ -105,7 +105,7 @@ ENTRY (BP_SYM (memset)) END (BP_SYM (memset)) libc_hidden_builtin_def (memset) - + -#if defined PIC && !defined NOT_IN_libc && !BZERO_P +#if defined PIC && IS_IN (libc) && !BZERO_P strong_alias (__memset_chk, __memset_zero_constant_len_parameter) - .section .gnu.warning.__memset_zero_constant_len_parameter - .string "memset used with constant zero length parameter; this could be due to transposed parameters" + .section .gnu.warning.__memset_zero_constant_len_parameter + .string "memset used with constant zero length parameter; this could be due to transposed parameters" Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/bcopy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(bcopy) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S =================================================================== @@ -815,12 +815,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__bzero) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S =================================================================== @@ -829,12 +829,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memchr-sse2.S @@ -842,12 +842,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memchr.S @@ -855,12 +855,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ - cfi_restore (REG) + cfi_adjust_cfa_offset (-4); \ + cfi_restore (REG) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp-sse4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcmp-sse4.S @@ -868,12 +868,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp-sse4.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcmp-ssse3.S @@ -881,38 +881,38 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcmp.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(memcmp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc \ +#if IS_IN (libc) \ && (defined SHARED \ - || defined USE_AS_MEMMOVE \ - || !defined USE_MULTIARCH) + || defined USE_AS_MEMMOVE \ + || !defined USE_MULTIARCH) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy-ssse3.S @@ -920,12 +920,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#if !defined NOT_IN_libc \ +#if IS_IN (libc) \ && (defined SHARED \ - || defined USE_AS_MEMMOVE \ - || !defined USE_MULTIARCH) + || defined USE_AS_MEMMOVE \ + || !defined USE_MULTIARCH) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy.S @@ -936,9 +936,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(memcpy) - .type memcpy, @gnu_indirect_function + .type memcpy, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy_chk.S @@ -950,7 +950,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy_chk.S -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__memcpy_chk) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S =================================================================== @@ -958,12 +958,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(memmove) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S =================================================================== @@ -971,12 +971,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__memmove_chk) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S =================================================================== @@ -988,9 +988,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function + .type __mempcpy, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/mempcpy_chk.S @@ -1002,7 +1002,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy_chk.S -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__mempcpy_chk) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr-c.c =================================================================== @@ -1021,12 +1021,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memrchr-sse2.S @@ -1034,10 +1034,10 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include # define CFI_PUSH(REG) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S @@ -1047,12 +1047,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ - cfi_restore (REG) + cfi_adjust_cfa_offset (-4); \ + cfi_restore (REG) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset-sse2-rep.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memset-sse2-rep.S @@ -1060,21 +1060,21 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset-sse2-rep.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + #include #include "asm-syntax.h" @@ -79,7 +79,7 @@ #endif - - .section .text.sse2,"ax",@progbits + + .section .text.sse2,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO ENTRY (__memset_chk_sse2_rep) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memset-sse2.S @@ -1082,33 +1082,33 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + #include #include "asm-syntax.h" @@ -79,7 +79,7 @@ #endif - - .section .text.sse2,"ax",@progbits + + .section .text.sse2,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO ENTRY (__memset_chk_sse2) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memset.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(memset) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S =================================================================== @@ -1116,12 +1116,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__memset_chk) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S =================================================================== @@ -1130,38 +1130,38 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ - cfi_restore (REG) + cfi_adjust_cfa_offset (-4); \ + cfi_restore (REG) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcat-sse2.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat-sse2.S @@ -18,7 +18,7 @@ . */ - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcat-ssse3.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat-ssse3.S @@ -18,7 +18,7 @@ . */ - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcat.S @@ -1172,9 +1172,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S need strncat before the initialization happened. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # ifdef SHARED - .text + .text Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S @@ -1182,12 +1182,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strchr-sse2.S @@ -1195,12 +1195,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strchr.S @@ -1208,12 +1208,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(strchr) - .type strchr, @gnu_indirect_function + .type strchr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp-sse4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcmp-sse4.S @@ -1221,10 +1221,10 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp-sse4.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + #include #include "asm-syntax.h" Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp-ssse3.S @@ -1234,10 +1234,10 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + #include #include "asm-syntax.h" Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S @@ -1251,7 +1251,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S -#if (defined SHARED || !defined USE_AS_STRNCMP) && !defined NOT_IN_libc +#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(STRCMP) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy-sse2.S =================================================================== @@ -1259,24 +1259,24 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy-sse2.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy-sse2.S @@ -18,7 +18,7 @@ . */ - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcpy-ssse3.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy-ssse3.S @@ -18,7 +18,7 @@ . */ - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # ifndef USE_AS_STRCAT # include Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S @@ -1289,9 +1289,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S need strncpy before the initialization happened. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # ifdef SHARED - .text + .text Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcspn.S @@ -1303,7 +1303,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S -#if (defined SHARED || !defined USE_AS_STRPBRK) && !defined NOT_IN_libc +#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(STRCSPN) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S =================================================================== @@ -1312,25 +1312,25 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - + #include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strlen-sse2.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen-sse2.S @@ -19,7 +19,7 @@ - + /* for strlen only SHARED version is optimized, for strcat, strncat, strnlen both STATIC and SHARED are optimized */ - + -#if (defined USE_AS_STRNLEN || defined USE_AS_STRCAT || defined SHARED) && !defined NOT_IN_libc +#if (defined USE_AS_STRNLEN || defined USE_AS_STRCAT || defined SHARED) && IS_IN (libc) - + # ifndef USE_AS_STRCAT - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strlen.S @@ -1341,9 +1341,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(strlen) - .type strlen, @gnu_indirect_function + .type strlen, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strnlen.S @@ -1351,12 +1351,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(__strnlen) - .type __strnlen, @gnu_indirect_function + .type __strnlen, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S @@ -1364,12 +1364,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strrchr-sse2.S @@ -1377,12 +1377,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strrchr.S @@ -1390,24 +1390,24 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(strrchr) - .type strrchr, @gnu_indirect_function + .type strrchr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strspn.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S @@ -26,7 +26,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(strspn) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr-c.c =================================================================== @@ -1415,7 +1415,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr-c.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr-c.c @@ -1,6 +1,6 @@ #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED @@ -1428,11 +1428,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + # define CFI_PUSH(REG) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S =================================================================== @@ -1441,12 +1441,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wcschr) - .type wcschr, @gnu_indirect_function + .type wcschr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscmp-sse2.S @@ -1454,12 +1454,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscmp.S @@ -1470,9 +1470,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp.S happened. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wcscmp) - .type wcscmp, @gnu_indirect_function + .type wcscmp, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscpy-c.c @@ -1482,7 +1482,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy-c.c +#if IS_IN (libc) # define wcscpy __wcscpy_ia32 #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S @@ -1490,11 +1490,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + # define CFI_PUSH(REG) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S =================================================================== @@ -1502,25 +1502,25 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wcscpy) - .type wcscpy, @gnu_indirect_function + .type wcscpy, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcslen-c.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen-c.c @@ -1,6 +1,6 @@ #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define WCSLEN __wcslen_ia32 #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcslen-sse2.S @@ -1528,12 +1528,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # define STR 4 - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcslen.S @@ -1541,12 +1541,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(__wcslen) - .type __wcslen, @gnu_indirect_function + .type __wcslen, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcsrchr-c.c @@ -1556,7 +1556,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr-c.c +#if IS_IN (libc) # define wcsrchr __wcsrchr_ia32 #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S @@ -1564,12 +1564,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # define CFI_PUSH(REG) \ - cfi_adjust_cfa_offset (4); \ + cfi_adjust_cfa_offset (4); \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcsrchr.S @@ -1577,37 +1577,37 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr.S @@ -21,7 +21,7 @@ #include #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wcsrchr) - .type wcsrchr, @gnu_indirect_function + .type wcsrchr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wmemcmp-c.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp-c.c @@ -1,6 +1,6 @@ #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define WMEMCMP __wmemcmp_ia32 #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wmemcmp.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp.S @@ -23,7 +23,7 @@ - + /* Define multiple versions only for the definition in libc. */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wmemcmp) - .type wmemcmp, @gnu_indirect_function + .type wmemcmp, @gnu_indirect_function Index: glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/libm-symbols.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/ia64/fpu/libm-symbols.h @@ -1615,7 +1615,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/libm-symbols.h @@ -53,6 +53,6 @@ ASM_SIZE_DIRECTIVE(__ieee754_##name); \ .type __ieee754_##name, @function - + -#if defined ASSEMBLER && !defined NOT_IN_libc +#if defined ASSEMBLER && IS_IN (libc) # define __libm_error_support HIDDEN_JUMPTARGET(__libm_error_support) @@ -1625,7 +1625,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/pthread/bits/libc-lock.h +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h @@ -26,7 +26,7 @@ - + /* Mutex type. */ #if defined _LIBC || defined _IO_MTSAFE_IO -# if (defined NOT_IN_libc && !IS_IN (libpthread)) || !defined _LIBC @@ -1634,7 +1634,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h # else typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t; @@ -47,7 +47,7 @@ typedef struct __libc_lock_recursive_opa - + /* Define an initialized recursive lock variable NAME with storage class CLASS. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -1644,7 +1644,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h CLASS __libc_lock_recursive_t NAME; @@ -65,7 +65,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Initialize a recursive mutex. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) +#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread)) @@ -1653,7 +1653,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h #else @@ -83,7 +83,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Finalize recursive named lock. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) +#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread)) @@ -1662,7 +1662,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h # define __libc_lock_fini_recursive(NAME) \ @@ -91,7 +91,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Lock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) +#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread)) @@ -1671,7 +1671,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h void *self = THREAD_SELF; \ @@ -108,7 +108,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Try to lock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) +#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread)) @@ -1680,7 +1680,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h int result = 0; \ @@ -133,7 +133,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Unlock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) +#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread)) @@ -1693,7 +1693,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h @@ -35,7 +35,7 @@ #include - + /* Mutex type. */ -#if defined NOT_IN_libc && !IS_IN (libpthread) +#if !IS_IN (libc) && !IS_IN (libpthread) @@ -1703,7 +1703,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h @@ -69,7 +69,7 @@ typedef pthread_key_t __libc_key_t; initialized locks must be set to one due to the lack of normal atomic operations.) */ - + -#if !defined NOT_IN_libc || IS_IN (libpthread) +#if IS_IN (libc) || IS_IN (libpthread) # if LLL_LOCK_INITIALIZER == 0 @@ -1711,7 +1711,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h CLASS __libc_lock_t NAME; @@ -113,7 +113,7 @@ typedef pthread_key_t __libc_key_t; #endif - + /* Call thread functions through the function pointer table. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) @@ -1719,7 +1719,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h # define __libc_ptf_call(FUNC, ARGS, ELSE) \ (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE) @@ -130,13 +130,13 @@ typedef pthread_key_t __libc_key_t; - + /* Initialize the named lock variable, leaving it in a consistent, unlocked state. */ -#if !defined NOT_IN_libc || IS_IN (libpthread) @@ -1752,7 +1752,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h # define __libc_rwlock_fini(NAME) \ @@ -163,7 +163,7 @@ typedef pthread_key_t __libc_key_t; #endif - + /* Lock the named lock variable. */ -#if !defined NOT_IN_libc || IS_IN (libpthread) +#if IS_IN (libc) || IS_IN (libpthread) @@ -1761,7 +1761,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h ({ lll_lock (NAME, LLL_PRIVATE); 0; }) @@ -179,7 +179,7 @@ typedef pthread_key_t __libc_key_t; __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0) - + /* Try to lock the named lock variable. */ -#if !defined NOT_IN_libc || IS_IN (libpthread) +#if IS_IN (libc) || IS_IN (libpthread) @@ -1770,7 +1770,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h lll_trylock (NAME) @@ -198,7 +198,7 @@ typedef pthread_key_t __libc_key_t; __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0) - + /* Unlock the named lock variable. */ -#if !defined NOT_IN_libc || IS_IN (libpthread) +#if IS_IN (libc) || IS_IN (libpthread) @@ -1784,10 +1784,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/stdio-lock.h @@ -84,7 +84,7 @@ typedef struct { int lock; int cnt; void #define _IO_cleanup_region_end(_doit) \ __libc_cleanup_region_end (_doit) - + -#if defined _LIBC && !defined NOT_IN_libc +#if defined _LIBC && IS_IN (libc) - + # ifdef __EXCEPTIONS # define _IO_acquire_lock(_fp) \ Index: glibc-2.17-c758a686/sysdeps/posix/closedir.c @@ -1795,21 +1795,21 @@ Index: glibc-2.17-c758a686/sysdeps/posix/closedir.c --- glibc-2.17-c758a686.orig/sysdeps/posix/closedir.c +++ glibc-2.17-c758a686/sysdeps/posix/closedir.c @@ -44,7 +44,7 @@ __closedir (DIR *dirp) - + fd = dirp->fd; - + -#ifndef NOT_IN_libc +#if IS_IN (libc) __libc_lock_fini (dirp->lock); #endif - + Index: glibc-2.17-c758a686/sysdeps/posix/opendir.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/posix/opendir.c +++ glibc-2.17-c758a686/sysdeps/posix/opendir.c @@ -223,7 +223,7 @@ __alloc_dir (int fd, bool close_fd, int } - + dirp->fd = fd; -#ifndef NOT_IN_libc +#if IS_IN (libc) @@ -1823,21 +1823,21 @@ Index: glibc-2.17-c758a686/sysdeps/posix/readdir.c @@ -40,7 +40,7 @@ __READDIR (DIR *dirp) DIRENT_TYPE *dp; int saved_errno = errno; - + -#ifndef NOT_IN_libc +#if IS_IN (libc) __libc_lock_lock (dirp->lock); #endif - + @@ -110,7 +110,7 @@ __READDIR (DIR *dirp) /* Skip deleted files. */ } while (dp->d_ino == 0); - + -#ifndef NOT_IN_libc +#if IS_IN (libc) __libc_lock_unlock (dirp->lock); #endif - + Index: glibc-2.17-c758a686/sysdeps/posix/rewinddir.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/posix/rewinddir.c @@ -1865,7 +1865,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/novmx-sigjmp.c --- glibc-2.17-c758a686.orig/sysdeps/powerpc/novmx-sigjmp.c +++ glibc-2.17-c758a686/sysdeps/powerpc/novmx-sigjmp.c @@ -20,7 +20,7 @@ - + #include #include -#if !defined NOT_IN_libc && defined SHARED @@ -1875,7 +1875,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/novmx-sigjmp.c # include @@ -41,4 +41,4 @@ __novmx__sigjmp_save (__novmx__sigjmp_bu } - + # endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */ -#endif /* !NOT_IN_libc && SHARED */ +#endif /* IS_IN (libc) && SHARED */ @@ -1886,12 +1886,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/__longjmp.S @@ -19,11 +19,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "__longjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* !IS_IN (libc) */ strong_alias (__vmx__longjmp, __longjmp); @@ -1910,14 +1910,14 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S @@ -21,7 +21,7 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ ENTRY (BP_SYM (_setjmp)) - li r4,0 /* Set second argument to 0. */ + li r4,0 /* Set second argument to 0. */ @@ -55,4 +55,4 @@ ENTRY (BP_SYM (__vmx_setjmp)) - b BP_SYM (__vmx__sigsetjmp@local) + b BP_SYM (__vmx__sigsetjmp@local) END (BP_SYM (__vmx_setjmp)) libc_hidden_def (__vmx_setjmp) -#endif /* !NOT_IN_libc */ @@ -1929,12 +1929,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S @@ -20,11 +20,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "__longjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* !IS_IN (libc) */ /* Build a versioned object for libc. */ @@ -1953,12 +1953,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S @@ -20,11 +20,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "setjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* !IS_IN (libc) */ /* Build a versioned object for libc. */ @@ -1975,23 +1975,23 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power6/memset.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S @@ -230,7 +230,7 @@ L(nzCacheAligned128): - ori r1,r1,0 + ori r1,r1,0 stw rCHR,60(rMEMP3) - blt cr6,L(cacheAligned1) + blt cr6,L(cacheAligned1) -#ifndef NOT_IN_libc +#if IS_IN (libc) - lfd 0,-128(rMEMP) + lfd 0,-128(rMEMP) #endif - b L(nzCacheAligned256) + b L(nzCacheAligned256) @@ -238,7 +238,7 @@ L(nzCacheAligned128): L(nzCacheAligned256): - cmplwi cr1,rLEN,256 - addi rMEMP3,rMEMP,64 + cmplwi cr1,rLEN,256 + addi rMEMP3,rMEMP,64 -#ifdef NOT_IN_libc +#if !IS_IN (libc) /* When we are not in libc we should use only GPRs to avoid the FPU lock interrupt. */ - stw rCHR,0(rMEMP) + stw rCHR,0(rMEMP) Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/setjmp.S @@ -1999,12 +1999,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S @@ -19,11 +19,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "setjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* !IS_IN (libc) */ /* Build a versioned object for libc. */ @@ -2023,12 +2023,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp.S @@ -20,11 +20,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "__longjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* IS_IN (libc) */ strong_alias (__vmx__longjmp, __longjmp) @@ -2046,7 +2046,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/bzero.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) @@ -2060,7 +2060,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2085,7 +2085,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) @@ -2097,9 +2097,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S @@ -18,7 +18,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef EALIGN @@ -2125,7 +2125,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2138,7 +2138,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memrchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2150,8 +2150,8 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S @@ -29,7 +29,7 @@ ENTRY (__bzero_ppc) END_GEN_TB (__bzero_ppc,TB_TOCLESS) - - + + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef EALIGN @@ -2163,7 +2163,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) @@ -2177,7 +2177,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2188,9 +2188,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S @@ -18,7 +18,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef EALIGN @@ -2203,7 +2203,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # define NO_MEMPCPY_STPCPY_REDIRECT @@ -2216,7 +2216,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2229,7 +2229,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2238,12 +2238,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c @@ -26,7 +26,7 @@ extern __typeof (__strcasecmp) __strcase #include #undef strcasecmp - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # include "init-arch.h" - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c @@ -2251,7 +2251,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2260,12 +2260,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c @@ -26,7 +26,7 @@ extern __typeof (__strcasecmp_l) __strca #include #undef strcasecmp_l - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # include "init-arch.h" - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcat.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strcat.c @@ -2273,7 +2273,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcat.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2285,7 +2285,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) @@ -2299,7 +2299,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2310,9 +2310,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S @@ -18,7 +18,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef EALIGN @@ -2325,7 +2325,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # include @@ -2336,9 +2336,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S @@ -18,7 +18,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef EALIGN @@ -2351,7 +2351,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # include @@ -2362,9 +2362,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S @@ -18,7 +18,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # undef ENTRY @@ -2377,7 +2377,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) /* Redefine strlen so that the compiler won't complain about the type @@ -2390,7 +2390,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2399,12 +2399,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase.c @@ -26,7 +26,7 @@ extern __typeof (__strncasecmp) __strnca #include #undef strncasecmp - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # include "init-arch.h" - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c @@ -2412,7 +2412,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2421,20 +2421,20 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c @@ -26,7 +26,7 @@ extern __typeof (__strncasecmp_l) __strn #include #undef strncasecmp_l - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # include "init-arch.h" - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S @@ -17,7 +17,7 @@ - + #include - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) #undef EALIGN @@ -2446,7 +2446,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) @@ -2472,7 +2472,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncpy.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncpy.c @@ -17,7 +17,7 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) @@ -2486,7 +2486,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strnlen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2499,7 +2499,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wcschr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2512,7 +2512,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2525,7 +2525,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2538,7 +2538,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include @@ -2551,12 +2551,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S @@ -20,11 +20,11 @@ #include #include - + -#if defined NOT_IN_libc +#if !IS_IN (libc) /* Build a non-versioned object for rtld-*. */ # include "setjmp-common.S" - + -#else /* !NOT_IN_libc */ +#else /* !IS_IN (libc) */ /* Build a versioned object for libc. */ @@ -2575,25 +2575,25 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S @@ -35,7 +35,7 @@ #define XCC xcc #endif - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2,#scratch - .register %g3,#scratch + + .register %g2,#scratch + .register %g3,#scratch Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S +++ glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S @@ -137,7 +137,7 @@ - LOAD(ldd, base + 0x28, %x5); \ - LOAD(ldd, base + 0x30, %x6); - + LOAD(ldd, base + 0x28, %x5); \ + LOAD(ldd, base + 0x30, %x6); + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2,#scratch - .register %g3,#scratch + + .register %g2,#scratch + .register %g3,#scratch Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S @@ -2601,12 +2601,12 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S @@ -46,7 +46,7 @@ #define STORE(type,src,addr) type src, [addr] #define STORE_INIT(src,addr) stxa src, [addr] STORE_ASI - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2,#scratch - .register %g3,#scratch + + .register %g2,#scratch + .register %g3,#scratch Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S @@ -2614,25 +2614,25 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S @@ -30,7 +30,7 @@ #define XCC xcc #endif - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2,#scratch - .register %g3,#scratch + + .register %g2,#scratch + .register %g3,#scratch Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memcpy.S +++ glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memcpy.S @@ -20,7 +20,7 @@ - + #include - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(memcpy) - .type memcpy, @gnu_indirect_function + .type memcpy, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S @@ -2640,46 +2640,46 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S @@ -28,7 +28,7 @@ #define XCC xcc #endif - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2,#scratch - + + .register %g2,#scratch + Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S +++ glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S @@ -21,7 +21,7 @@ - + #define ASI_BLK_INIT_QUAD_LDD_P 0xe2 - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - - .register %g2, #scratch - .register %g3, #scratch + + .register %g2, #scratch + .register %g3, #scratch Index: glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc64/multiarch/memset.S +++ glibc-2.17-c758a686/sysdeps/sparc/sparc64/multiarch/memset.S @@ -20,7 +20,7 @@ - + #include - + -#if !defined NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(memset) - .type memset, @gnu_indirect_function + .type memset, @gnu_indirect_function Index: glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/alpha/sysdep.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.S @@ -29,7 +29,7 @@ - .text + .text #endif - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define SYSCALL_ERROR_ERRNO __libc_errno @@ -2691,33 +2691,33 @@ Index: glibc-2.17-c758a686/sysdeps/unix/make-syscalls.sh +++ glibc-2.17-c758a686/sysdeps/unix/make-syscalls.sh @@ -100,7 +100,7 @@ emit_weak_aliases() *@@*) - base=`echo $name | sed 's/@@.*//'` - ver=`echo $name | sed 's/.*@@//;s/\./_/g'` + base=`echo $name | sed 's/@@.*//'` + ver=`echo $name | sed 's/.*@@//;s/\./_/g'` - echo " echo '#ifndef NOT_IN_libc'; \\" + echo " echo '#if IS_IN (libc)'; \\" - if test -z "$vcount" ; then - source=$strong - vcount=1 + if test -z "$vcount" ; then + source=$strong + vcount=1 @@ -117,7 +117,7 @@ emit_weak_aliases() *@*) - base=`echo $name | sed 's/@.*//'` - ver=`echo $name | sed 's/.*@//;s/\./_/g'` + base=`echo $name | sed 's/@.*//'` + ver=`echo $name | sed 's/.*@//;s/\./_/g'` - echo " echo '#ifndef NOT_IN_libc'; \\" + echo " echo '#if IS_IN (libc)'; \\" - if test -z "$vcount" ; then - source=$strong - vcount=1 + if test -z "$vcount" ; then + source=$strong + vcount=1 Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/Makefile +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/Makefile @@ -160,7 +160,6 @@ sysdep-rtld-routines += dl-brk dl-sbrk d - dl-fxstatat64 - + dl-fxstatat64 + libof-lddlibc4 = lddlibc4 -CPPFLAGS-lddlibc4 += -DNOT_IN_libc endif - + ifeq ($(subdir),rt) Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h =================================================================== @@ -2726,10 +2726,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -85,7 +85,7 @@ ENTRY (name); \ @@ -2744,7 +2744,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-can @@ -96,7 +96,7 @@ ENTRY (name); \ # error Unsupported library # endif - + -# if IS_IN (libpthread) || !defined NOT_IN_libc +# if IS_IN (libpthread) || IS_IN (libc) # ifndef __ASSEMBLER__ @@ -2756,7 +2756,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -93,7 +93,7 @@ # define ret_ERRVAL ret - + # define SYSCALL_ERROR .Lsyscall_error -# if NOT_IN_libc +# if !IS_IN (libc) @@ -2764,12 +2764,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h # define SYSCALL_ERROR_HANDLER \ .Lsyscall_error: \ @@ -325,7 +325,7 @@ - + /* Pointer mangling is supported for AArch64. */ #if (IS_IN (rtld)) || \ - (!defined SHARED && (!defined NOT_IN_libc \ + (!defined SHARED && (IS_IN (libc) \ - || IS_IN (libpthread))) + || IS_IN (libpthread))) # ifdef __ASSEMBLER__ # define PTR_MANGLE(dst, src, guard, tmp) \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h @@ -2779,10 +2779,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cance @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END besides "ret". */ @@ -109,7 +109,7 @@ __LABEL($multi_error) \ @@ -2797,7 +2797,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cance @@ -128,7 +128,7 @@ __LABEL($multi_error) \ # define CDISABLE jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp) # endif - + -# if IS_IN (libpthread) || !defined NOT_IN_libc +# if IS_IN (libpthread) || IS_IN (libc) # ifndef __ASSEMBLER__ @@ -2810,10 +2810,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel. @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + /* NOTE: We do mark syscalls with unwind annotations, for the benefit of cancellation; but they're really only accurate at the point of the @@ -190,7 +190,7 @@ @@ -2828,7 +2828,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel. @@ -201,7 +201,7 @@ # error Unsupported library # endif - + -# if IS_IN (libpthread) || !defined NOT_IN_libc +# if IS_IN (libpthread) || IS_IN (libc) # ifndef __ASSEMBLER__ @@ -2839,9 +2839,9 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/sysdep.h --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -104,7 +104,7 @@ - + #define ret_ERRVAL PSEUDO_RET_NOERRNO - + -#if NOT_IN_libc +#if !IS_IN (libc) # define SYSCALL_ERROR __local_syscall_error @@ -2853,12 +2853,12 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/getpid.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/getpid.c @@ -21,7 +21,7 @@ #include - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) static inline __attribute__((always_inline)) pid_t really_getpid (pid_t oldval); - + static inline __attribute__((always_inline)) pid_t @@ -48,7 +48,7 @@ really_getpid (pid_t oldval) pid_t @@ -2876,7 +2876,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock. @@ -56,7 +56,7 @@ /* Initialize locks to zero. */ #define LLL_MUTEX_LOCK_INITIALIZER (0) - + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -2889,23 +2889,23 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # ifndef NO_ERROR # define NO_ERROR -0x1000 @@ -216,7 +216,7 @@ L(pre_end): ASM_LINE_SEP \ # define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP + bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP # endif -# elif !defined NOT_IN_libc +# elif IS_IN (libc) # ifdef PIC # define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ - bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP + bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP @@ -246,7 +246,7 @@ L(pre_end): ASM_LINE_SEP \ - + # if IS_IN (libpthread) # define __local_multiple_threads __pthread_multiple_threads -# elif !defined NOT_IN_libc @@ -2915,11 +2915,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel # define __local_multiple_threads __librt_multiple_threads @@ -271,7 +271,7 @@ L(pre_end): ASM_LINE_SEP \ # define NO_CANCELLATION 1 - + #endif -/* !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) */ +/* IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) */ - + #ifndef __ASSEMBLER__ # define RTLD_SINGLE_THREAD_P \ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S @@ -2927,31 +2927,31 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S @@ -115,7 +115,7 @@ __lll_lock_wait_private: - cfi_endproc - .size __lll_lock_wait_private,.-__lll_lock_wait_private - + cfi_endproc + .size __lll_lock_wait_private,.-__lll_lock_wait_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_lock_wait - .type __lll_lock_wait,@function - .hidden __lll_lock_wait + .globl __lll_lock_wait + .type __lll_lock_wait,@function + .hidden __lll_lock_wait @@ -361,7 +361,7 @@ __lll_unlock_wake_private: - cfi_endproc - .size __lll_unlock_wake_private,.-__lll_unlock_wake_private - + cfi_endproc + .size __lll_unlock_wake_private,.-__lll_unlock_wake_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_unlock_wake - .type __lll_unlock_wake,@function - .hidden __lll_unlock_wake + .globl __lll_unlock_wake + .type __lll_unlock_wake,@function + .hidden __lll_unlock_wake Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -71,7 +71,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -2967,18 +2967,18 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h #else # define __lll_trylock_asm "cmpl $0, %%gs:%P5\n\t" \ @@ -283,7 +283,7 @@ LLL_STUB_UNWIND_INFO_END - : "memory"); \ + : "memory"); \ ret; }) - + -#if defined NOT_IN_libc || defined UP +#if !IS_IN (libc) || defined UP # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %1, %2\n\t" #else # define __lll_lock_asm_start "cmpl $0, %%gs:%P6\n\t" \ @@ -452,7 +452,7 @@ LLL_STUB_UNWIND_INFO_END - : "memory"); \ + : "memory"); \ result; }) - + -#if defined NOT_IN_libc || defined UP +#if !IS_IN (libc) || defined UP # define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t" @@ -2991,10 +2991,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -111,7 +111,7 @@ @@ -3012,7 +3012,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -36,7 +36,7 @@ #define SYS_ify(syscall_name) __NR_##syscall_name - + #if defined USE_DL_SYSINFO \ - && (!defined NOT_IN_libc || IS_IN (libpthread)) + && (IS_IN (libc) || IS_IN (libpthread)) @@ -3020,9 +3020,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h #else # undef I386_USE_SYSENTER @@ -117,7 +117,7 @@ - + # elif defined _LIBC_REENTRANT - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define SYSCALL_ERROR_ERRNO __libc_errno @@ -3034,8 +3034,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -3048,12 +3048,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel @@ -22,11 +22,11 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define SYSDEP_CANCEL_ERRNO __libc_errno @@ -3073,8 +3073,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S @@ -34,7 +34,7 @@ ENTRY(__syscall_error) - st4 [r2]=r8 - mov r8=-1 + st4 [r2]=r8 + mov r8=-1 #else -# ifndef NOT_IN_libc +# if IS_IN (libc) @@ -3087,11 +3087,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -61,7 +61,7 @@ #endif - + #if defined USE_DL_SYSINFO \ - && (!defined NOT_IN_libc \ + && (IS_IN (libc) \ - || IS_IN (libpthread) || IS_IN (librt)) + || IS_IN (libpthread) || IS_IN (librt)) # define IA64_USE_NEW_STUB #else Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h @@ -3099,7 +3099,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h @@ -35,7 +35,7 @@ - + /* We define __rtld_* copies for rtld. We need them visible in libc to initialize. */ -# if IS_IN (rtld) || !defined NOT_IN_libc @@ -3113,7 +3113,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h extern void __vdso_atomic_barrier_stub (void); -# endif /* IS_IN (rtld) || !NOT_IN_libc */ +# endif /* IS_IN (rtld) || IS_IN (libc) */ - + /* RTLD should only use its own copies. */ # if !IS_IN (rtld) Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h @@ -3123,10 +3123,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -103,7 +103,7 @@ @@ -3158,10 +3158,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep @@ -27,7 +27,7 @@ happen before any instructions. So we use cfi_same_value instead of cfi_restore. */ - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + #ifdef __PIC__ # undef PSEUDO Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h @@ -3171,10 +3171,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # ifdef __PIC__ # define PSEUDO_CPLOAD .cpload t9; Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h @@ -3183,12 +3183,12 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h @@ -27,7 +27,7 @@ INLINE_SYSCALL (open, 2, (const char *) (name), (flags)) - + /* Uncancelable openat. */ -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) extern int __openat_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; + mode_t mode) attribute_hidden; extern int __openat64_nocancel (int fd, const char *fname, int oflag, Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h =================================================================== @@ -3197,10 +3197,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -84,7 +84,7 @@ @@ -3219,10 +3219,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # ifdef HAVE_ASM_GLOBAL_DOT_NAME # define DASHDASHPFX(str) .__##str @@ -107,7 +107,7 @@ @@ -3240,8 +3240,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -51,7 +51,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -3254,10 +3254,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -78,7 +78,7 @@ L(pseudo_end): @@ -3274,7 +3274,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S @@ -31,7 +31,7 @@ - .text + .text ENTRY(__syscall_error) #ifndef PIC -# ifndef NOT_IN_libc @@ -3283,7 +3283,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S # else # define SYSCALL_ERROR_ERRNO errno @@ -54,7 +54,7 @@ ENTRY(__syscall_error) - br %r14 + br %r14 1: .long rtld_errno - 0b # else -# ifndef NOT_IN_libc @@ -3311,10 +3311,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -73,7 +73,7 @@ L(pseudo_end): @@ -3328,8 +3328,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-canc # define __local_multiple_threads __libc_multiple_threads @@ -111,7 +111,7 @@ L(pseudo_end): #define LR7_6 lg %r7,56+160(%r15); \ - cfi_restore (%r7); - + cfi_restore (%r7); + -# if IS_IN (libpthread) || !defined NOT_IN_libc +# if IS_IN (libpthread) || IS_IN (libc) # ifndef __ASSEMBLER__ @@ -3349,8 +3349,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S # else # define SYSCALL_ERROR_ERRNO errno @@ -55,7 +55,7 @@ ENTRY(__syscall_error) - lghi %r2,-1 - br %r14 + lghi %r2,-1 + br %r14 # else -# ifndef NOT_IN_libc +# if IS_IN (libc) @@ -3375,31 +3375,31 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S @@ -172,7 +172,7 @@ __lll_lock_wait_private: - cfi_endproc - .size __lll_lock_wait_private,.-__lll_lock_wait_private - + cfi_endproc + .size __lll_lock_wait_private,.-__lll_lock_wait_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_lock_wait - .type __lll_lock_wait,@function - .hidden __lll_lock_wait + .globl __lll_lock_wait + .type __lll_lock_wait,@function + .hidden __lll_lock_wait @@ -454,7 +454,7 @@ __lll_unlock_wake_private: - cfi_endproc - .size __lll_unlock_wake_private,.-__lll_unlock_wake_private - + cfi_endproc + .size __lll_unlock_wake_private,.-__lll_unlock_wake_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_unlock_wake - .type __lll_unlock_wake,@function - .hidden __lll_unlock_wake + .globl __lll_unlock_wake + .type __lll_unlock_wake,@function + .hidden __lll_unlock_wake Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -3412,10 +3412,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # define _IMM12 #-12 # define _IMM16 #-16 @@ -108,7 +108,7 @@ @@ -3432,9 +3432,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/sh/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -116,7 +116,7 @@ - + # elif defined _LIBC_REENTRANT - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define SYSCALL_ERROR_ERRNO __libc_errno @@ -3447,7 +3447,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h @@ -56,7 +56,7 @@ extern void __cpu_relax (void); #define BUSY_WAIT_NOP __cpu_relax () #endif - + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -3460,10 +3460,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -71,7 +71,7 @@ __##syscall_name##_nocancel: \ @@ -3480,9 +3480,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -80,7 +80,7 @@ ENTRY(name); \ - mov -1, %o0; + mov -1, %o0; # elif defined _LIBC_REENTRANT - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define SYSCALL_ERROR_ERRNO __libc_errno @@ -3494,13 +3494,13 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S @@ -89,7 +89,7 @@ ENTRY (__brk) #endif - st %o0, [%g1] + st %o0, [%g1] #else -#ifndef NOT_IN_libc +#if IS_IN (libc) - call HIDDEN_JUMPTARGET(__errno_location) + call HIDDEN_JUMPTARGET(__errno_location) #else - call __errno_location + call __errno_location Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h @@ -3508,10 +3508,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -69,7 +69,7 @@ __##syscall_name##_nocancel: \ @@ -3528,9 +3528,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -90,7 +90,7 @@ ENTRY(name); \ - mov -1, %o0; + mov -1, %o0; # elif defined _LIBC_REENTRANT - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define SYSCALL_ERROR_ERRNO __libc_errno @@ -3543,10 +3543,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + /* Allow hacking in some extra code if desired. */ #ifndef PSEUDO_EXTRA Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/sysdep.h @@ -3564,7 +3564,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/sysdep.h #else @@ -205,7 +205,7 @@ #endif /* not __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && IS_IN (rtld) +#if !IS_IN (libc) && IS_IN (rtld) @@ -3581,7 +3581,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S */ -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */ #define PSEUDO_EXTRA move r3, zero; Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S @@ -3589,31 +3589,31 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S @@ -108,7 +108,7 @@ __lll_lock_wait_private: - cfi_endproc - .size __lll_lock_wait_private,.-__lll_lock_wait_private - + cfi_endproc + .size __lll_lock_wait_private,.-__lll_lock_wait_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_lock_wait - .type __lll_lock_wait,@function - .hidden __lll_lock_wait + .globl __lll_lock_wait + .type __lll_lock_wait,@function + .hidden __lll_lock_wait @@ -348,7 +348,7 @@ __lll_unlock_wake_private: - cfi_endproc - .size __lll_unlock_wake_private,.-__lll_unlock_wake_private - + cfi_endproc + .size __lll_unlock_wake_private,.-__lll_unlock_wake_private + -#ifdef NOT_IN_libc +#if !IS_IN (libc) - .globl __lll_unlock_wake - .type __lll_unlock_wake,@function - .hidden __lll_unlock_wake + .globl __lll_unlock_wake + .type __lll_unlock_wake,@function + .hidden __lll_unlock_wake Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -72,7 +72,7 @@ - + #ifndef __ASSEMBLER__ - + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -3629,22 +3629,22 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h #else # define __lll_trylock_asm "cmpl $0, __libc_multiple_threads(%%rip)\n\t" \ @@ -280,7 +280,7 @@ LLL_STUB_UNWIND_INFO_END - : "memory"); \ + : "memory"); \ ret; }) - + -#if defined NOT_IN_libc || defined UP +#if !IS_IN (libc) || defined UP # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %4, %2\n\t" \ - "jnz 1f\n\t" + "jnz 1f\n\t" #else @@ -450,7 +450,7 @@ LLL_STUB_UNWIND_INFO_END - : "memory", "cx", "cc", "r10", "r11"); \ + : "memory", "cx", "cc", "r10", "r11"); \ result; }) - + -#if defined NOT_IN_libc || defined UP +#if !IS_IN (libc) || defined UP # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t" \ - "jne 1f\n\t" + "jne 1f\n\t" #else Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h =================================================================== @@ -3653,10 +3653,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + /* The code to disable cancellation depends on the fact that the called functions are special. They don't modify registers other than %rax @@ -63,7 +63,7 @@ @@ -3671,7 +3671,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -74,7 +74,7 @@ # error Unsupported library # endif - + -# if IS_IN (libpthread) || !defined NOT_IN_libc +# if IS_IN (libpthread) || IS_IN (libc) # ifndef __ASSEMBLER__ @@ -3717,58 +3717,58 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memcpy.S # undef libc_hidden_builtin_def # define libc_hidden_builtin_def(name) \ @@ -44,7 +44,7 @@ - + .text - + -#if defined PIC && !defined NOT_IN_libc +#if defined PIC && IS_IN (libc) ENTRY_CHK (__memcpy_chk) - - cmpq %rdx, %rcx + + cmpq %rdx, %rcx @@ -253,14 +253,14 @@ L(32after): /* Handle blocks smaller than 1/2 L1. */ - + L(fasttry): /* first 1/2 L1 */ -#ifndef NOT_IN_libc /* only up to this algorithm outside of libc.so */ +#if IS_IN (libc) /* only up to this algorithm outside of libc.so */ - mov __x86_64_data_cache_size_half(%rip), %R11_LP - cmpq %rdx, %r11 /* calculate the smaller of */ - cmovaq %rdx, %r11 /* remaining bytes and 1/2 L1 */ + mov __x86_64_data_cache_size_half(%rip), %R11_LP + cmpq %rdx, %r11 /* calculate the smaller of */ + cmovaq %rdx, %r11 /* remaining bytes and 1/2 L1 */ #endif - + L(fast): /* good ol' MOVS */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - movq %r11, %rcx - andq $-8, %r11 + movq %r11, %rcx + andq $-8, %r11 #else @@ -275,7 +275,7 @@ L(fast): /* good ol' MOVS */ - .p2align 4,, 4 - + .p2align 4,, 4 + L(fastskip): -#ifndef NOT_IN_libc +#if IS_IN (libc) - subq %r11, %rdx /* check for more */ - testq $-8, %rdx - jnz L(fastafter) + subq %r11, %rdx /* check for more */ + testq $-8, %rdx + jnz L(fastafter) @@ -294,7 +294,7 @@ L(fastskip): #endif - retq /* exit */ - + retq /* exit */ + -#ifndef NOT_IN_libc /* none of the algorithms below for RTLD */ +#if IS_IN (libc) /* none of the algorithms below for RTLD */ - - .p2align 4 - + + .p2align 4 + @@ -570,13 +570,13 @@ L(NTskip): #endif - retq /* exit */ - + retq /* exit */ + -#endif /* !NOT_IN_libc */ +#endif /* IS_IN (libc) */ - + END(memcpy) - + #ifndef USE_AS_MEMPCPY libc_hidden_builtin_def (memcpy) -# if defined SHARED && !defined USE_MULTIARCH && !defined NOT_IN_libc @@ -3781,13 +3781,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memmove.c --- glibc-2.17-c758a686.orig/sysdeps/x86_64/memmove.c +++ glibc-2.17-c758a686/sysdeps/x86_64/memmove.c @@ -17,7 +17,7 @@ - + #include "string/memmove.c" - + -#if !defined memmove && !defined NOT_IN_libc +#if !defined memmove && IS_IN (libc) #include - + #if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14) Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S =================================================================== @@ -3795,31 +3795,31 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S +++ glibc-2.17-c758a686/sysdeps/x86_64/memset.S @@ -23,7 +23,7 @@ #define __STOS_UPPER_BOUNDARY $65536 - - .text + + .text -#if !defined NOT_IN_libc && !defined USE_MULTIARCH +#if IS_IN (libc) && !defined USE_MULTIARCH ENTRY(__bzero) - mov %rsi,%rdx /* Adjust parameter. */ - xorl %esi,%esi /* Fill with 0s. */ + mov %rsi,%rdx /* Adjust parameter. */ + xorl %esi,%esi /* Fill with 0s. */ @@ -32,7 +32,7 @@ END(__bzero) weak_alias (__bzero, bzero) #endif - + -#if defined PIC && !defined NOT_IN_libc +#if defined PIC && IS_IN (libc) ENTRY_CHK (__memset_chk) - cmpq %rdx, %rcx - jb HIDDEN_JUMPTARGET (__chk_fail) + cmpq %rdx, %rcx + jb HIDDEN_JUMPTARGET (__chk_fail) @@ -1354,7 +1354,7 @@ L(8byte_nt_move_skip): END (memset) libc_hidden_builtin_def (memset) - + -#if defined PIC && !defined NOT_IN_libc && !defined USE_MULTIARCH +#if defined PIC && IS_IN (libc) && !defined USE_MULTIARCH strong_alias (__memset_chk, __memset_zero_constant_len_parameter) - .section .gnu.warning.__memset_zero_constant_len_parameter - .string "memset used with constant zero length parameter; this could be due to transposed parameters" + .section .gnu.warning.__memset_zero_constant_len_parameter + .string "memset used with constant zero length parameter; this could be due to transposed parameters" Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/init-arch.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/init-arch.h @@ -3827,12 +3827,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/init-arch.h @@ -141,7 +141,7 @@ extern void __init_cpu_features (void) a extern const struct cpu_features *__get_cpu_features (void) __attribute__ ((const)); - + -# ifndef NOT_IN_libc +# if IS_IN (libc) # define __get_cpu_features() (&__cpu_features) # endif - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp-sse4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcmp-sse4.S @@ -3840,12 +3840,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp-sse4.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcmp-ssse3.S @@ -3853,51 +3853,51 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(memcmp) - .type memcmp, @gnu_indirect_function + .type memcmp, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc \ +#if IS_IN (libc) \ && (defined SHARED \ || defined USE_AS_MEMMOVE \ - || !defined USE_MULTIARCH) + || !defined USE_MULTIARCH) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy-ssse3.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy-ssse3.S @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc \ +#if IS_IN (libc) \ && (defined SHARED \ || defined USE_AS_MEMMOVE \ - || !defined USE_MULTIARCH) + || !defined USE_MULTIARCH) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy.S @@ -3908,9 +3908,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(__new_memcpy) - .type __new_memcpy, @gnu_indirect_function + .type __new_memcpy, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy_chk.S @@ -3922,7 +3922,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__memcpy_chk) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c =================================================================== @@ -3931,21 +3931,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define MEMMOVE __memmove_sse2 # ifdef SHARED # undef libc_hidden_builtin_def @@ -39,7 +39,7 @@ extern __typeof (__redirect_memmove) __m - + #include "string/memmove.c" - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include # include "init-arch.h" - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy.S @@ -3957,8 +3957,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) + .type __mempcpy, @gnu_indirect_function + cmpl $0, KIND_OFFSET+__cpu_features(%rip) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy_chk.S @@ -3970,7 +3970,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED - .text + .text ENTRY(__mempcpy_chk) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S =================================================================== @@ -3978,26 +3978,26 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S @@ -21,7 +21,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) ENTRY(memset) - .type memset, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) + .type memset, @gnu_indirect_function + cmpl $0, __cpu_features+KIND_OFFSET(%rip) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memset_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S @@ -21,7 +21,7 @@ #include - + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED ENTRY(__memset_chk) - .type __memset_chk, @gnu_indirect_function + .type __memset_chk, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S @@ -4005,12 +4005,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcat-ssse3.S @@ -4018,25 +4018,25 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcat.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S @@ -43,7 +43,7 @@ - - + + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(STRCAT) - .type STRCAT, @gnu_indirect_function + .type STRCAT, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S @@ -4044,10 +4044,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # include # include "asm-syntax.h" Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S @@ -4055,14 +4055,14 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strchr.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S @@ -21,7 +21,7 @@ - - + + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(strchr) - .type strchr, @gnu_indirect_function + .type strchr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcmp-ssse3.S @@ -4083,9 +4083,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S need strncmp before the initialization happened. */ -#if (defined SHARED || !defined USE_AS_STRNCMP) && !defined NOT_IN_libc +#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc) - .text + .text ENTRY(STRCMP) - .type STRCMP, @gnu_indirect_function + .type STRCMP, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S @@ -4093,10 +4093,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # ifndef USE_AS_STRCAT # include Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy-ssse3.S @@ -4106,10 +4106,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + # ifndef USE_AS_STRCAT # include Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S @@ -4117,14 +4117,14 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S @@ -57,7 +57,7 @@ - - + + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(STRCPY) - .type STRCPY, @gnu_indirect_function + .type STRCPY, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcspn.S @@ -4135,22 +4135,22 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S need strpbrk before the initialization happened. */ -#if (defined SHARED || !defined USE_AS_STRPBRK) && !defined NOT_IN_libc +#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc) - .text + .text ENTRY(STRCSPN) - .type STRCSPN, @gnu_indirect_function + .type STRCSPN, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strspn.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S @@ -26,7 +26,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(strspn) - .type strspn, @gnu_indirect_function + .type strspn, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wcscpy-c.c @@ -4160,7 +4160,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy-c.c +#if IS_IN (libc) # define wcscpy __wcscpy_sse2 #endif - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy-ssse3.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wcscpy-ssse3.S @@ -4168,24 +4168,24 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy-ssse3.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - - .section .text.ssse3,"ax",@progbits + + .section .text.ssse3,"ax",@progbits Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wcscpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - - .text + + .text ENTRY(wcscpy) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp-c.c =================================================================== @@ -4195,7 +4195,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp-c.c -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + # define WMEMCMP __wmemcmp_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S =================================================================== @@ -4203,39 +4203,39 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S @@ -22,7 +22,7 @@ #include - + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(wmemcmp) - .type wmemcmp, @gnu_indirect_function + .type wmemcmp, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/strcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/strcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/strcmp.S @@ -129,7 +129,7 @@ libc_hidden_def (__strncasecmp) #endif - + ENTRY (BP_SYM (STRCMP)) -#ifdef NOT_IN_libc +#if !IS_IN (libc) /* Simple version since we can't use SSE registers in ld.so. */ L(oop): movb (%rdi), %al - cmpb (%rsi), %al + cmpb (%rsi), %al @@ -147,7 +147,7 @@ L(neq): movl $1, %eax - cmovbl %ecx, %eax - ret + cmovbl %ecx, %eax + ret END (BP_SYM (STRCMP)) -#else /* NOT_IN_libc */ +#else /* !IS_IN (libc) */ # ifdef USE_AS_STRCASECMP_L - /* We have to fall back on the C implementation for locales - with encodings not matching ASCII for single bytes. */ + /* We have to fall back on the C implementation for locales + with encodings not matching ASCII for single bytes. */ @@ -2303,5 +2303,5 @@ LABEL(unaligned_table): - .int LABEL(ashr_14) - LABEL(unaligned_table) - .int LABEL(ashr_15) - LABEL(unaligned_table) - .int LABEL(ashr_0) - LABEL(unaligned_table) + .int LABEL(ashr_14) - LABEL(unaligned_table) + .int LABEL(ashr_15) - LABEL(unaligned_table) + .int LABEL(ashr_0) - LABEL(unaligned_table) -#endif /* NOT_IN_libc */ +#endif /* !IS_IN (libc) */ libc_hidden_builtin_def (STRCMP) @@ -4244,148 +4244,148 @@ Index: glibc-2.17-c758a686/ChangeLog --- glibc-2.17-c758a686.orig/ChangeLog +++ glibc-2.17-c758a686/ChangeLog @@ -4849,7 +4849,7 @@ - - * libio/genops.c (_IO_unbuffer_write): Conditionalize locking code on - [_IO_MTSAFE_IO]. + + * libio/genops.c (_IO_unbuffer_write): Conditionalize locking code on + [_IO_MTSAFE_IO]. - * libio/libioP.h [!_IO_MTSAFE_IO && !NOT_IN_libc] + * libio/libioP.h [!_IO_MTSAFE_IO && !IS_IN (libc)] - (_IO_acquire_lock, _IO_acquire_lock_clear_flags2, _IO_release_lock): - New macros. - + (_IO_acquire_lock, _IO_acquire_lock_clear_flags2, _IO_release_lock): + New macros. + @@ -5014,7 +5014,7 @@ - including . - - * sysdeps/x86_64/multiarch/memmove.c: Don't include . + including . + + * sysdeps/x86_64/multiarch/memmove.c: Don't include . - [!NOT_IN_libc]: Move #define and #undef of memmove to just before + [!IS_IN (libc)]: Move #define and #undef of memmove to just before - and after including . Move declarations of - __memmove_sse2, __memmove_ssse3, and __memmove_ssse3_back - to before #include "string/memmove.c". + and after including . Move declarations of + __memmove_sse2, __memmove_ssse3, and __memmove_ssse3_back + to before #include "string/memmove.c". @@ -7322,7 +7322,7 @@ 2012-05-30 Richard Henderson - - * sysdeps/unix/make-syscalls.sh: Protect symbol_version output + + * sysdeps/unix/make-syscalls.sh: Protect symbol_version output - with #ifndef NOT_IN_libc. + with #if IS_IN (libc). - - * scripts/abilist.awk: Accept 8 fields. Handle Alpha functions - marked to avoid plt entry. + + * scripts/abilist.awk: Accept 8 fields. Handle Alpha functions + marked to avoid plt entry. Index: glibc-2.17-c758a686/ChangeLog.13 =================================================================== --- glibc-2.17-c758a686.orig/ChangeLog.13 +++ glibc-2.17-c758a686/ChangeLog.13 @@ -2465,7 +2465,7 @@ - ($(objpfx)errlist.d): Depend on $(..)sysdeps/gnu/errlist-compat.c. - * sysdeps/gnu/errlist.awk: Make output define _sys_errlist_internal - and _sys_nerr_internal instead of anything else. Make it include + ($(objpfx)errlist.d): Depend on $(..)sysdeps/gnu/errlist-compat.c. + * sysdeps/gnu/errlist.awk: Make output define _sys_errlist_internal + and _sys_nerr_internal instead of anything else. Make it include - "errlist-compat.c" if [!NOT_IN_libc && !ERRLIST_NO_COMPAT]. + "errlist-compat.c" if [!IS_IN (libc) && !ERRLIST_NO_COMPAT]. - Make it emit some asm magic if [EMIT_ERR_MAX]. - * sysdeps/gnu/errlist.c: Regenerated. - * sysdeps/gnu/errlist-compat.awk: New file. + Make it emit some asm magic if [EMIT_ERR_MAX]. + * sysdeps/gnu/errlist.c: Regenerated. + * sysdeps/gnu/errlist-compat.awk: New file. Index: glibc-2.17-c758a686/ChangeLog.14 =================================================================== --- glibc-2.17-c758a686.orig/ChangeLog.14 +++ glibc-2.17-c758a686/ChangeLog.14 @@ -2058,13 +2058,13 @@ - * sysdeps/powerpc/powerpc64/__longjmp-common.S: New file. - * sysdeps/powerpc/powerpc64/__longjmp.S [NOT_IN_libc](__longjmp): - Non-versioned __longjmp for rtld-__longjmp. + * sysdeps/powerpc/powerpc64/__longjmp-common.S: New file. + * sysdeps/powerpc/powerpc64/__longjmp.S [NOT_IN_libc](__longjmp): + Non-versioned __longjmp for rtld-__longjmp. - [!NOT_IN_libc](__vmx__longjmp): Add VMX reg support and define as + [!IS_IN (libc)](__vmx__longjmp): Add VMX reg support and define as - default version of __longjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] - (__novmx__longjmp): Original version of __longjmp. - * sysdeps/powerpc/powerpc64/bsd-_setjmp.S [NOT_IN_libc](_setjmp): - Non-versioned _setjmp for rtld-_setjmp. + default version of __longjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] + (__novmx__longjmp): Original version of __longjmp. + * sysdeps/powerpc/powerpc64/bsd-_setjmp.S [NOT_IN_libc](_setjmp): + Non-versioned _setjmp for rtld-_setjmp. - [!NOT_IN_libc](__vmx_setjmp): Branch to __vmx__sigsetjmp and define + [!IS_IN (libc)](__vmx_setjmp): Branch to __vmx__sigsetjmp and define - as default version of _setjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] - (__novmx_setjmp): Original version of _setjmp. + as default version of _setjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] + (__novmx_setjmp): Original version of _setjmp. @@ -2075,7 +2075,7 @@ - * sysdeps/powerpc/powerpc64/setjmp-common.S: New file. - * sysdeps/powerpc/powerpc64/setjmp.S [NOT_IN_libc](__setjmp): - Non-versioned __sigsetjmp for rtld-setjmp. + * sysdeps/powerpc/powerpc64/setjmp-common.S: New file. + * sysdeps/powerpc/powerpc64/setjmp.S [NOT_IN_libc](__setjmp): + Non-versioned __sigsetjmp for rtld-setjmp. - [!NOT_IN_libc](__vmx__sigsetjmp): Add VMX reg support and define + [!IS_IN (libc)](__vmx__sigsetjmp): Add VMX reg support and define - as default version of __sigsetjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] - (__novmx__sigsetjmp): Original version of __sigsetjmp. + as default version of __sigsetjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)] + (__novmx__sigsetjmp): Original version of __sigsetjmp. @@ -2083,13 +2083,13 @@ - * sysdeps/powerpc/powerpc32/__longjmp-common.S: New File - * sysdeps/powerpc/powerpc32/__longjmp.S [NOT_IN_libc](__longjmp): - Non-versioned __longjmp for rtld-__longjmp. + * sysdeps/powerpc/powerpc32/__longjmp-common.S: New File + * sysdeps/powerpc/powerpc32/__longjmp.S [NOT_IN_libc](__longjmp): + Non-versioned __longjmp for rtld-__longjmp. - [!NOT_IN_libc](__vmx__longjmp): Add VMX reg support and define as + [!IS_IN (libc)](__vmx__longjmp): Add VMX reg support and define as - default version of __longjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] - (__novmx__longjmp): Original version of __longjmp. - * sysdeps/powerpc/powerpc32/bsd-_setjmp.S [NOT_IN_libc](_setjmp): - Non-versioned _setjmp for rtld-_setjmp. + default version of __longjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] + (__novmx__longjmp): Original version of __longjmp. + * sysdeps/powerpc/powerpc32/bsd-_setjmp.S [NOT_IN_libc](_setjmp): + Non-versioned _setjmp for rtld-_setjmp. - [!NOT_IN_libc](__vmx_setjmp): Branch to __vmx__sigsetjmp and define + [!IS_IN (libc)](__vmx_setjmp): Branch to __vmx__sigsetjmp and define - as default version of _setjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] - (__novmx_setjmp): Original version of _setjmp. + as default version of _setjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] + (__novmx_setjmp): Original version of _setjmp. @@ -2100,21 +2100,21 @@ - * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: New file. - * sysdeps/powerpc/powerpc32/fpu/__longjmp.S [NOT_IN_libc](__longjmp): - Non-versioned __longjmp for rtld-__longjmp. + * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: New file. + * sysdeps/powerpc/powerpc32/fpu/__longjmp.S [NOT_IN_libc](__longjmp): + Non-versioned __longjmp for rtld-__longjmp. - [!NOT_IN_libc](__vmx__longjmp): Add VMX reg support and define as + [!IS_IN (libc)](__vmx__longjmp): Add VMX reg support and define as - default version of __longjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] - (__novmx__longjmp): Original version of __longjmp. - * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: New file. - * sysdeps/powerpc/powerpc32/fpu/setjmp.S [NOT_IN_libc](__setjmp): - Non-versioned __sigsetjmp for rtld-setjmp. + default version of __longjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] + (__novmx__longjmp): Original version of __longjmp. + * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: New file. + * sysdeps/powerpc/powerpc32/fpu/setjmp.S [NOT_IN_libc](__setjmp): + Non-versioned __sigsetjmp for rtld-setjmp. - [!NOT_IN_libc](__vmx__sigsetjmp): Add VMX reg support and define + [!IS_IN (libc)](__vmx__sigsetjmp): Add VMX reg support and define - as default version of __sigsetjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] - (__novmx__sigsetjmp): Original version of __sigsetjmp. - * sysdeps/powerpc/powerpc32/setjmp-common.S: New file. - * sysdeps/powerpc/powerpc32/setjmp.S [NOT_IN_libc](__setjmp): - Non-versioned __sigsetjmp for rtld-setjmp. + as default version of __sigsetjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] + (__novmx__sigsetjmp): Original version of __sigsetjmp. + * sysdeps/powerpc/powerpc32/setjmp-common.S: New file. + * sysdeps/powerpc/powerpc32/setjmp.S [NOT_IN_libc](__setjmp): + Non-versioned __sigsetjmp for rtld-setjmp. - [!NOT_IN_libc](__vmx__sigsetjmp): Add VMX reg support and define + [!IS_IN (libc)](__vmx__sigsetjmp): Add VMX reg support and define - as default version of __sigsetjmp. - [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] - (__novmx__sigsetjmp): Original version of __sigsetjmp. + as default version of __sigsetjmp. + [SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)] + (__novmx__sigsetjmp): Original version of __sigsetjmp. Index: glibc-2.17-c758a686/csu/Makefile =================================================================== --- glibc-2.17-c758a686.orig/csu/Makefile +++ glibc-2.17-c758a686/csu/Makefile @@ -146,13 +146,13 @@ $(objpfx)version-info.h: $(common-objpfx - linux*) version=`(printf '%s\n%s\n' \ - '#include ' \ - UTS_RELEASE \ + linux*) version=`(printf '%s\n%s\n' \ + '#include ' \ + UTS_RELEASE \ - | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 | \ + | $(CC) $(CPPFLAGS) -O -E -P - | \ - sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\ - if [ -z "$$version" ]; then \ - version=`(printf '%s\n%s\n' \ - '#include ' \ - LINUX_VERSION_CODE \ + sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\ + if [ -z "$$version" ]; then \ + version=`(printf '%s\n%s\n' \ + '#include ' \ + LINUX_VERSION_CODE \ - | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 \ + | $(CC) $(CPPFLAGS) -O -E -P - \ - | sed -n -e '/^[123456789].*/p' \ - | awk '{v=$$1; \ - printf("%d.%d.%d\n", \ + | sed -n -e '/^[123456789].*/p' \ + | awk '{v=$$1; \ + printf("%d.%d.%d\n", \ Index: glibc-2.17-c758a686/nptl/ChangeLog =================================================================== --- glibc-2.17-c758a686.orig/nptl/ChangeLog +++ glibc-2.17-c758a686/nptl/ChangeLog @@ -11683,7 +11683,7 @@ 2002-12-16 Jakub Jelinek - - * libc-cancellation.c: Guard both function with + + * libc-cancellation.c: Guard both function with - #if !defined NOT_IN_libc. + #if IS_IN (libc). - * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the - automatically provided pthread wrappers. - * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to + * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the + automatically provided pthread wrappers. + * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to Index: glibc-2.17-c758a686/nptl/Makefile =================================================================== --- glibc-2.17-c758a686.orig/nptl/Makefile @@ -4393,7 +4393,7 @@ Index: glibc-2.17-c758a686/nptl/Makefile @@ -134,8 +134,6 @@ libpthread-routines = nptl-init vars eve libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind libpthread-static-only-routines = pthread_atfork - + -CFLAGS-pthread_atfork.c = -DNOT_IN_libc - # Since cancellation handling is in large parts handled using exceptions @@ -4404,9 +4404,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) extern int __open_nocancel (const char *, int, ...) attribute_hidden; @@ -4419,7 +4419,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -52,7 +52,7 @@ #define LLL_PRIVATE 0 #define LLL_SHARED FUTEX_PRIVATE_FLAG - + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4431,8 +4431,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevello +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h @@ -49,7 +49,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4444,8 +4444,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4458,23 +4458,23 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) +#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -103,7 +103,7 @@ # define CDISABLE call +__libc_disable_asynccancel,[],0; # endif - + -#if !defined NOT_IN_libc +#if IS_IN (libc) # define __local_multiple_threads __libc_multiple_threads #elif IS_IN (libpthread) # define __local_multiple_threads __pthread_multiple_threads @@ -118,7 +118,7 @@ - p_header.data.multiple_threads) == 0, 1) + p_header.data.multiple_threads) == 0, 1) # else extern int __local_multiple_threads -# if !defined NOT_IN_libc || IS_IN (libpthread) @@ -4484,12 +4484,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde ; @@ -130,7 +130,7 @@ extern int __local_multiple_threads # define SINGLE_THREAD_P \ - mov (+__local_multiple_threads),d0; \ - cmp 0,d0 + mov (+__local_multiple_threads),d0; \ + cmp 0,d0 -# elif !defined NOT_IN_libc || IS_IN (libpthread) +# elif IS_IN (libc) || IS_IN (libpthread) # define SINGLE_THREAD_P \ - movm [a2],(sp); \ + movm [a2],(sp); \ 1: mov pc,a2; \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h =================================================================== @@ -4497,8 +4497,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h @@ -48,7 +48,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4510,8 +4510,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4523,8 +4523,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h @@ -48,7 +48,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4536,8 +4536,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || IS_IN (rtld) +#if IS_IN (libc) || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -4550,7 +4550,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-pp @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define MEMRCHR __memrchr_ppc @@ -4561,9 +4561,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c @@ -17,7 +17,7 @@ - + #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # ifdef SHARED @@ -4574,27 +4574,27 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c @@ -17,7 +17,7 @@ - + #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define WCSCPY __wcscpy_ppc #endif - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c @@ -17,7 +17,7 @@ - + #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # define WCSRCHR __wcsrchr_ppc #endif - + Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memccpy-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/multiarch/memccpy-c.c @@ -4602,7 +4602,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memccpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define MEMCCPY __memccpy_c @@ -4615,15 +4615,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memccpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -153,4 +153,4 @@ ENTRY(__memccpy_vx) - lghi %r2,0 /* Return null. */ - br %r14 + lghi %r2,0 /* Return null. */ + br %r14 END(__memccpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4634,14 +4634,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memccpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__memccpy, memccpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -4653,10 +4653,10 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -154,6 +154,6 @@ END(__memchr_vx) @@ -4665,7 +4665,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memchr-vx.S # define libc_hidden_builtin_def(name) strong_alias(__memchr_c, __GI_memchr) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ - + #include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memchr.c =================================================================== @@ -4674,12 +4674,12 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memrchr-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/multiarch/memrchr-c.c @@ -4687,11 +4687,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memrchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define MEMRCHR __memrchr_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memrchr-vx.S =================================================================== @@ -4700,15 +4700,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memrchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -157,4 +157,4 @@ ENTRY(__memrchr_vx) - clgijhe %r4,64,.Lloop64 /* If n >= 64 -> loop64. */ - j .Llt64 + clgijhe %r4,64,.Lloop64 /* If n >= 64 -> loop64. */ + j .Llt64 END(__memrchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4719,14 +4719,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/memrchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__memrchr, memrchr) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -4738,15 +4738,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/rawmemchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include - + # define RAWMEMCHR __rawmemchr_c @@ -31,4 +31,4 @@ extern __typeof (rawmemchr) __rawmemchr_c attribute_hidden; - + # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)) */ @@ -4757,15 +4757,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/rawmemchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -89,4 +89,4 @@ ENTRY(__rawmemchr_vx) - la %r2,0(%r5,%r2) /* Return pointer to character. */ - br %r14 + la %r2,0(%r5,%r2) /* Return pointer to character. */ + br %r14 END(__rawmemchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4776,14 +4776,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/rawmemchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__rawmemchr, rawmemchr) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT &&!defined NOT_IN_libc ) */ @@ -4795,15 +4795,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpcpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STPCPY __stpcpy_c # undef libc_hidden_def # undef weak_alias @@ -31,4 +31,4 @@ - - + + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4814,15 +4814,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpcpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -101,4 +101,4 @@ ENTRY(__stpcpy_vx) - la %r2,0(%r5,%r2) /* Return pointer to zero. */ - br %r14 + la %r2,0(%r5,%r2) /* Return pointer to zero. */ + br %r14 END(__stpcpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4833,14 +4833,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -26,4 +26,4 @@ libc_hidden_builtin_def (stpcpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -4852,7 +4852,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpncpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STPNCPY __stpncpy_c @@ -4860,7 +4860,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpncpy-c.c # undef libc_hidden_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4871,15 +4871,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpncpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -197,4 +197,4 @@ ENTRY(__stpncpy_vx) - vl %v16,0(%r5,%r3) /* Load s. */ - j .Llt64 + vl %v16,0(%r5,%r3) /* Load s. */ + j .Llt64 END(__stpncpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4890,14 +4890,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/stpncpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__stpncpy, stpncpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -4909,7 +4909,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcat-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRCAT __strcat_c @@ -4917,7 +4917,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcat-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4928,15 +4928,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcat-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -158,4 +158,4 @@ ENTRY(__strcat_vx) - lgr %r2,%r0 /* Load saved dest-ptr. */ - br %r14 + lgr %r2,%r0 /* Load saved dest-ptr. */ + br %r14 END(__strcat_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4947,14 +4947,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcat.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strcat, strcat) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -4966,7 +4966,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRCHR __strchr_c @@ -4974,7 +4974,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchr-c.c # ifdef SHARED @@ -26,4 +26,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -4985,15 +4985,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -97,4 +97,4 @@ ENTRY(__strchr_vx) - lghi %r2,0 /* Return null if character not found. */ - br %r14 + lghi %r2,0 /* Return null if character not found. */ + br %r14 END(__strchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5004,14 +5004,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (strchr, index) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5023,7 +5023,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchrnul-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRCHRNUL __strchrnul_c @@ -5036,15 +5036,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchrnul-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -90,4 +90,4 @@ ENTRY(__strchrnul_vx) .Lend: - br %r14 + br %r14 END(__strchrnul_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5055,14 +5055,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strchrnul.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__strchrnul, strchrnul) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5074,10 +5074,10 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcmp-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -111,6 +111,6 @@ END(__strcmp_vx) @@ -5086,7 +5086,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcmp-vx.S # define libc_hidden_builtin_def(name) strong_alias(__strcmp_c, __GI_strcmp) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ - + #include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcmp.c =================================================================== @@ -5095,12 +5095,12 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcpy-vx.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/multiarch/strcpy-vx.S @@ -5108,10 +5108,10 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -103,7 +103,7 @@ END(__strcpy_vx) @@ -5120,7 +5120,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcpy-vx.S # define libc_hidden_builtin_def(name) strong_alias(__strcpy_c, __GI_strcpy) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ - + /* Include mvst-strcpy-implementation in s390-32/s390-64 subdirectory. */ #include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcpy.c @@ -5130,12 +5130,12 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcspn-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/multiarch/strcspn-c.c @@ -5143,7 +5143,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcspn-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRCSPN __strcspn_c @@ -5151,7 +5151,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcspn-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5162,15 +5162,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcspn-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -278,4 +278,4 @@ ENTRY(__strcspn_vx) - vlgvg %r9,%v31,1 - br %r14 + vlgvg %r9,%v31,1 + br %r14 END(__strcspn_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5181,14 +5181,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strcspn.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strcspn, strcspn) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5200,7 +5200,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strlen-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRLEN __strlen_c @@ -5208,7 +5208,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strlen-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5219,15 +5219,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strlen-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -81,4 +81,4 @@ ENTRY(__strlen_vx) - algr %r2,%r5 - br %r14 + algr %r2,%r5 + br %r14 END(__strlen_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5238,14 +5238,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strlen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strlen, strlen) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5257,11 +5257,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncat-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRNCAT __strncat_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncat-vx.S =================================================================== @@ -5270,15 +5270,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncat-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -236,4 +236,4 @@ ENTRY(__strncat_vx) - vl %v16,0(%r5,%r3) /* Load s. */ - j .Lcpy_lt64 + vl %v16,0(%r5,%r3) /* Load s. */ + j .Lcpy_lt64 END(__strncat_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5289,14 +5289,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncat.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strncat, strncat) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5308,7 +5308,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncmp-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRNCMP __strncmp_c @@ -5316,7 +5316,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncmp-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5327,15 +5327,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncmp-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -134,4 +134,4 @@ ENTRY(__strncmp_vx) - lghi %r2,0 - br %r14 + lghi %r2,0 + br %r14 END(__strncmp_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5346,14 +5346,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -27,4 +27,4 @@ s390_vx_libc_ifunc2 (__strncmp, strncmp) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5365,10 +5365,10 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -201,7 +201,7 @@ END(__strncpy_vx) @@ -5377,7 +5377,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncpy-vx.S # define libc_hidden_builtin_def(name) strong_alias(__strncpy_c, __GI_strncpy) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ - + /* Include strncpy-implementation in s390-32/s390-64 subdirectory. */ #include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncpy.c @@ -5387,12 +5387,12 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strncpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strnlen-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/multiarch/strnlen-c.c @@ -5400,7 +5400,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strnlen-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRNLEN __strnlen_c @@ -5408,7 +5408,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strnlen-c.c # undef libc_hidden_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5419,15 +5419,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strnlen-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -131,4 +131,4 @@ ENTRY(__strnlen_vx) - - j .Llt64 + + j .Llt64 END(__strnlen_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5438,14 +5438,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strnlen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -26,4 +26,4 @@ libc_hidden_def (strnlen) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5457,7 +5457,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strpbrk-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRPBRK __strpbrk_c @@ -5465,7 +5465,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strpbrk-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5476,15 +5476,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strpbrk-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -299,4 +299,4 @@ ENTRY(__strpbrk_vx) - lgr %r2,%r1 - br %r14 + lgr %r2,%r1 + br %r14 END(__strpbrk_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5495,14 +5495,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strpbrk.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strpbrk, strpbrk) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5514,7 +5514,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strrchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRRCHR __strrchr_c @@ -5522,7 +5522,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strrchr-c.c # ifdef SHARED @@ -26,4 +26,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5533,15 +5533,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strrchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -177,4 +177,4 @@ ENTRY(__strrchr_vx) - .byte 0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08 - .byte 0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00 + .byte 0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08 + .byte 0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00 END(__strrchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5552,14 +5552,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strrchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (strrchr, rindex) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5571,7 +5571,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strspn-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define STRSPN __strspn_c @@ -5579,7 +5579,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strspn-c.c # undef libc_hidden_builtin_def @@ -25,4 +25,4 @@ # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5590,15 +5590,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strspn-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -253,4 +253,4 @@ ENTRY(__strspn_vx) - j .Lslow_next_acc_notonbb /* ... and search for zero in - fully loaded vreg again. */ + j .Lslow_next_acc_notonbb /* ... and search for zero in + fully loaded vreg again. */ END(__strspn_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5609,14 +5609,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/strspn.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__strspn, strspn) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5628,11 +5628,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpcpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCPCPY __wcpcpy_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpcpy-vx.S =================================================================== @@ -5641,15 +5641,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpcpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -111,4 +111,4 @@ ENTRY(__wcpcpy_vx) .Lfallback: - jg __wcpcpy_c + jg __wcpcpy_c END(__wcpcpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5660,14 +5660,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpcpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcpcpy, wcpcpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5679,11 +5679,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpncpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCPNCPY __wcpncpy_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpncpy-vx.S =================================================================== @@ -5692,15 +5692,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpncpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -219,4 +219,4 @@ ENTRY(__wcpncpy_vx) .Lfallback: - jg __wcpncpy_c + jg __wcpncpy_c END(__wcpncpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5711,14 +5711,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcpncpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcpncpy, wcpncpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5730,11 +5730,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscat-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCAT __wcscat_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscat-vx.S =================================================================== @@ -5743,15 +5743,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscat-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -172,4 +172,4 @@ ENTRY(__wcscat_vx) .Lfallback: - jg __wcscat_c + jg __wcscat_c END(__wcscat_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5762,14 +5762,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscat.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcscat, wcscat) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5781,15 +5781,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCHR __wcschr_c - + # include @@ -28,4 +28,4 @@ extern __typeof (wcschr) __wcschr_c; # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5800,15 +5800,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -100,4 +100,4 @@ ENTRY(__wcschr_vx) .Lfallback: - jg __wcschr_c + jg __wcschr_c END(__wcschr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5819,14 +5819,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcschr, wcschr) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5838,11 +5838,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschrnul-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCHRNUL __wcschrnul_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschrnul-vx.S =================================================================== @@ -5851,15 +5851,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschrnul-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -94,4 +94,4 @@ ENTRY(__wcschrnul_vx) .Lfallback: - jg __wcschrnul_c + jg __wcschrnul_c END(__wcschrnul_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5870,14 +5870,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcschrnul.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcschrnul, wcschrnul) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5889,11 +5889,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscmp-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCMP __wcscmp_c - + # include @@ -27,4 +27,4 @@ extern __typeof (wcscmp) __wcscmp_c; __hidden_ver1 (__wcscmp_c, __GI_wcscmp, __wcscmp_c); @@ -5908,15 +5908,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscmp-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -128,4 +128,4 @@ ENTRY(__wcscmp_vx) - lghi %r2,0 - br %r14 + lghi %r2,0 + br %r14 END(__wcscmp_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5927,14 +5927,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcscmp, wcscmp) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5946,11 +5946,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCPY __wcscpy_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscpy-vx.S =================================================================== @@ -5959,15 +5959,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -108,4 +108,4 @@ ENTRY(__wcscpy_vx) .Lfallback: - jg __wcscpy_c + jg __wcscpy_c END(__wcscpy_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -5978,14 +5978,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcscpy, wcscpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -5997,11 +5997,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscspn-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSCSPN __wcscspn_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscspn-vx.S =================================================================== @@ -6010,15 +6010,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscspn-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -290,4 +290,4 @@ ENTRY(__wcscspn_vx) .Lfallback: - jg __wcscspn_c + jg __wcscspn_c END(__wcscspn_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6029,14 +6029,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcscspn.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcscspn, wcscspn) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6048,11 +6048,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcslen-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSLEN __wcslen_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcslen-vx.S =================================================================== @@ -6061,15 +6061,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcslen-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -88,4 +88,4 @@ ENTRY(__wcslen_vx) .Lfallback: - jg __wcslen_c + jg __wcslen_c END(__wcslen_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6080,14 +6080,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcslen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcslen, wcslen) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6099,11 +6099,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncat-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSNCAT __wcsncat_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncat-vx.S =================================================================== @@ -6112,15 +6112,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncat-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -262,4 +262,4 @@ ENTRY(__wcsncat_vx) .Lfallback: - jg __wcsncat_c + jg __wcsncat_c END(__wcsncat_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6131,14 +6131,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncat.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcsncat, wcsncat) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6150,11 +6150,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncmp-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSNCMP __wcsncmp_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncmp-vx.S =================================================================== @@ -6163,15 +6163,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncmp-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -174,4 +174,4 @@ ENTRY(__wcsncmp_vx) - locgrl %r2,%r1 - br %r14 + locgrl %r2,%r1 + br %r14 END(__wcsncmp_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6182,14 +6182,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcsncmp, wcsncmp) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6201,11 +6201,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncpy-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSNCPY __wcsncpy_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncpy-vx.S =================================================================== @@ -6214,16 +6214,16 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncpy-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -220,4 +220,4 @@ ENTRY(__wcsncpy_vx) - jg __wcsncpy_c + jg __wcsncpy_c END(__wcsncpy_vx) - + -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncpy.c @@ -6233,14 +6233,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsncpy.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcsncpy, wcsncpy) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6252,11 +6252,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsnlen-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSNLEN __wcsnlen_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsnlen-vx.S =================================================================== @@ -6265,15 +6265,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsnlen-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -148,4 +148,4 @@ ENTRY(__wcsnlen_vx) .Lfallback: - jg __wcsnlen_c + jg __wcsnlen_c END(__wcsnlen_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6284,14 +6284,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsnlen.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -25,4 +25,4 @@ weak_alias (__wcsnlen, wcsnlen) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6303,15 +6303,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcspbrk-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSPBRK __wcspbrk_c - + # include @@ -28,4 +28,4 @@ extern __typeof (wcspbrk) __wcspbrk_c; # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6322,15 +6322,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcspbrk-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -312,4 +312,4 @@ ENTRY(__wcspbrk_vx) .Lfallback: - jg __wcspbrk_c + jg __wcspbrk_c END(__wcspbrk_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6341,14 +6341,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcspbrk.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcspbrk, wcspbrk) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6360,11 +6360,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsrchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSRCHR __wcsrchr_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsrchr-vx.S =================================================================== @@ -6373,15 +6373,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsrchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -187,4 +187,4 @@ ENTRY(__wcsrchr_vx) .Lfallback: - jg __wcsrchr_c + jg __wcsrchr_c END(__wcsrchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6392,14 +6392,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsrchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcsrchr, wcsrchr) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6411,15 +6411,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsspn-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WCSSPN __wcsspn_c - + # include @@ -28,4 +28,4 @@ extern __typeof (wcsspn) __wcsspn_c; # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6430,15 +6430,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsspn-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -267,4 +267,4 @@ ENTRY(__wcsspn_vx) .Lfallback: - jg __wcsspn_c + jg __wcsspn_c END(__wcsspn_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6449,14 +6449,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wcsspn.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wcsspn, wcsspn) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6468,15 +6468,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemchr-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WMEMCHR __wmemchr_c - + # include @@ -28,4 +28,4 @@ extern __typeof (wmemchr) __wmemchr_c; # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6487,15 +6487,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemchr-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -163,4 +163,4 @@ ENTRY(__wmemchr_vx) .Lfallback: - jg __wmemchr_c + jg __wmemchr_c END(__wmemchr_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6506,14 +6506,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemchr.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wmemchr, wmemchr) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6525,11 +6525,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemcmp-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WMEMCMP __wmemcmp_c - + # include Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemcmp-vx.S =================================================================== @@ -6538,15 +6538,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemcmp-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -146,4 +146,4 @@ ENTRY(__wmemcmp_vx) - la %r3,0(%r5,%r3) - j .Lremaining + la %r3,0(%r5,%r3) + j .Lremaining END(__wmemcmp_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6557,14 +6557,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemcmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wmemcmp, wmemcmp) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6576,15 +6576,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemset-c.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # define WMEMSET __wmemset_c - + # include @@ -28,4 +28,4 @@ extern __typeof (wmemset) __wmemset_c; # endif /* SHARED */ - + # include -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6595,15 +6595,15 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemset-vx.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) - + # include "sysdep.h" # include "asm-syntax.h" @@ -139,4 +139,4 @@ ENTRY(__wmemset_vx) - srlg %r4,%r4,2 /* Convert byte-count to character-count. */ - jg __wmemset_c + srlg %r4,%r4,2 /* Convert byte-count to character-count. */ + jg __wmemset_c END(__wmemset_vx) -#endif /* HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc */ +#endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */ @@ -6614,14 +6614,14 @@ Index: glibc-2.17-c758a686/sysdeps/s390/multiarch/wmemset.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc +#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include # include - + @@ -24,4 +24,4 @@ s390_vx_libc_ifunc2 (__wmemset, wmemset) - + #else # include -#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ @@ -6631,23 +6631,23 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcmp-s390.S --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-32/multiarch/memcmp-s390.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcmp-s390.S @@ -27,7 +27,7 @@ - + .text - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + ENTRY(__memcmp_z196) - .machine "z196" + .machine "z196" @@ -92,11 +92,11 @@ ENTRY(__memcmp_z10) - clc 0(1,%r3),0(%r2) + clc 0(1,%r3),0(%r2) END(__memcmp_z10) - + -#endif /* !NOT_IN_libc */ +#endif /* !IS_IN (libc) */ - + #include "../memcmp.S" - + -#ifdef NOT_IN_libc +#if !IS_IN (libc) .globl memcmp @@ -6660,34 +6660,34 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + s390_libc_ifunc (memcmp) Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcpy-s390.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-32/multiarch/memcpy-s390.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcpy-s390.S @@ -27,7 +27,7 @@ - + .text - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - + ENTRY(__memcpy_z196) - .machine "z196" + .machine "z196" @@ -88,11 +88,11 @@ ENTRY(__memcpy_z10) - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) END(__memcpy_z10) - + -#endif /* SHARED && !defined NOT_IN_libc */ +#endif /* SHARED && IS_IN (libc) */ - + #include "../memcpy.S" - + -#if !defined SHARED || defined NOT_IN_libc +#if !defined SHARED || !IS_IN (libc) .globl memcpy @@ -6699,35 +6699,35 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcpy.c +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memcpy.c @@ -17,7 +17,7 @@ . */ - + /* In the static lib memcpy is needed before the reloc is resolved. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # include - + s390_libc_ifunc (memcpy) Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memset-s390.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-32/multiarch/memset-s390.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memset-s390.S @@ -27,7 +27,7 @@ - + .text - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + ENTRY(__memset_z196) - .machine "z196" + .machine "z196" @@ -103,11 +103,11 @@ ENTRY(__memset_mvcle) - br %r14 + br %r14 END(__memset_mvcle) - + -#endif /* !NOT_IN_libc */ +#endif /* !IS_IN (libc) */ - + #include "../memset.S" - + -#ifdef NOT_IN_libc +#if !IS_IN (libc) .globl memset @@ -6740,34 +6740,34 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/multiarch/memset.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + s390_libc_ifunc (memset) Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S @@ -27,7 +27,7 @@ - + .text - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + ENTRY(__memcmp_z196) - .machine "z196" + .machine "z196" @@ -89,11 +89,11 @@ ENTRY(__memcmp_z10) - clc 0(1,%r3),0(%r2) + clc 0(1,%r3),0(%r2) END(__memcmp_z10) - + -#endif /* !NOT_IN_libc */ +#endif /* !IS_IN (libc) */ - + #include "../memcmp.S" - + -#ifdef NOT_IN_libc +#if !IS_IN (libc) .globl memcmp @@ -6780,34 +6780,34 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcmp.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + s390_libc_ifunc (memcmp) Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S @@ -27,7 +27,7 @@ - + .text - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - + ENTRY(__memcpy_z196) - .machine "z196" + .machine "z196" @@ -84,11 +84,11 @@ ENTRY(__memcpy_z10) - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) END(__memcpy_z10) - + -#endif /* SHARED && !defined NOT_IN_libc */ +#endif /* SHARED && IS_IN (libc) */ - + #include "../memcpy.S" - + -#if !defined SHARED || defined NOT_IN_libc +#if !defined SHARED || !IS_IN (libc) .globl memcpy @@ -6819,35 +6819,35 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcpy.c +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memcpy.c @@ -17,7 +17,7 @@ . */ - + /* In the static lib memcpy is needed before the reloc is resolved. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) # include - + s390_libc_ifunc (memcpy) Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memset-s390x.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/multiarch/memset-s390x.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memset-s390x.S @@ -27,7 +27,7 @@ - + .text - + -#ifndef NOT_IN_libc +#if IS_IN (libc) - + ENTRY(__memset_z196) - .machine "z196" + .machine "z196" @@ -99,11 +99,11 @@ ENTRY(__memset_mvcle) - br %r14 + br %r14 END(__memset_mvcle) - + -#endif /* !NOT_IN_libc */ +#endif /* !IS_IN (libc) */ - + #include "../memset.S" - + -#ifdef NOT_IN_libc +#if !IS_IN (libc) .globl memset @@ -6860,11 +6860,11 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/multiarch/memset.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # include - + s390_libc_ifunc (memset) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset-x86-64.S =================================================================== @@ -6872,38 +6872,38 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset-x86-64.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset-x86-64.S @@ -1,6 +1,6 @@ #include - + -#ifndef NOT_IN_libc +#if IS_IN (libc) # undef ENTRY_CHK # define ENTRY_CHK(name) \ - .type __memset_chk_x86_64, @function; \ + .type __memset_chk_x86_64, @function; \ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/rawmemchr.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S @@ -23,7 +23,7 @@ - - + + /* Define multiple versions only for the definition in lib. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - .text + .text ENTRY(rawmemchr) - .type rawmemchr, @gnu_indirect_function + .type rawmemchr, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S @@ -19,7 +19,7 @@ - + /* only for strlen case we don't use optimized version for STATIC build just for SHARED */ - + -#if (defined SHARED || defined USE_AS_STRCAT || defined USE_AS_STRNLEN) && !defined NOT_IN_libc +#if (defined SHARED || defined USE_AS_STRCAT || defined USE_AS_STRNLEN) && IS_IN (libc) - + # ifndef USE_AS_STRCAT - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse2-pminub.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen-sse2-pminub.S @@ -6911,12 +6911,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse2-pminub.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#if !defined NOT_IN_libc && (defined SHARED || defined USE_AS_STRCAT) +#if IS_IN (libc) && (defined SHARED || defined USE_AS_STRCAT) - + # ifndef USE_AS_STRCAT - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse4.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen-sse4.S @@ -6924,12 +6924,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen-sse4.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - + #include - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen.S @@ -6940,21 +6940,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(strlen) - .type strlen, @gnu_indirect_function + .type strlen, @gnu_indirect_function Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strnlen.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S @@ -22,7 +22,7 @@ - - + + /* Define multiple versions only for the definition in libc. */ -#ifndef NOT_IN_libc +#if IS_IN (libc) - - .text + + .text ENTRY(__strnlen) Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S =================================================================== @@ -6963,10 +6963,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ - + -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - + # include # include "asm-syntax.h" Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S @@ -6979,9 +6979,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S happened. */ -#if defined SHARED && !defined NOT_IN_libc +#if defined SHARED && IS_IN (libc) - .text + .text ENTRY(strrchr) - .type strrchr, @gnu_indirect_function + .type strrchr, @gnu_indirect_function Index: glibc-2.17-c758a686/Makerules =================================================================== --- glibc-2.17-c758a686.orig/Makerules @@ -6989,11 +6989,11 @@ Index: glibc-2.17-c758a686/Makerules @@ -1156,9 +1156,6 @@ lib := nonlib include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) endif - + -# The include magic above causes those files to use this variable for flags. -CPPFLAGS-nonlib = -DNOT_IN_libc=1 - - + ifeq ($(versioning),yes) # Generate normalized lists of symbols, versions, and data sizes. Index: glibc-2.17-c758a686/include/ctype.h @@ -7001,24 +7001,24 @@ Index: glibc-2.17-c758a686/include/ctype.h --- glibc-2.17-c758a686.orig/include/ctype.h +++ glibc-2.17-c758a686/include/ctype.h @@ -7,7 +7,7 @@ libc_hidden_proto (__ctype_init) - + extern int __isctype (int __c, int __mask); - + -# ifndef NOT_IN_libc +# if IS_IN (libc) - + /* These accessors are used by the optimized macros to find the thread-local cache of ctype information from the current thread's @@ -46,13 +46,13 @@ __ctype_tolower_loc (void) return __libc_tsd_address (const int32_t *, CTYPE_TOLOWER); } - + -# endif /* Not NOT_IN_libc. */ +# endif /* IS_IN (libc) */ #endif - + #include - + #ifndef _ISOMAC -# if !defined __NO_CTYPE && !defined NOT_IN_libc +# if !defined __NO_CTYPE && IS_IN (libc) @@ -7032,7 +7032,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -548,7 +548,7 @@ for linking") # define hidden_nolink(name, lib, version) #endif - + -#if !defined NOT_IN_libc +#if IS_IN (libc) # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -7043,7 +7043,7 @@ Index: glibc-2.17-c758a686/include/netdb.h --- glibc-2.17-c758a686.orig/include/netdb.h +++ glibc-2.17-c758a686/include/netdb.h @@ -3,11 +3,11 @@ - + #ifndef _ISOMAC /* Macros for accessing h_errno from inside libc. */ -# if !defined NOT_IN_libc || IS_IN_LIB @@ -7063,7 +7063,7 @@ Index: glibc-2.17-c758a686/include/netdb.h -# endif /* !NOT_IN_libc || IS_IN_LIB */ +# endif /* IS_IN_LIB */ # define __set_h_errno(x) (h_errno = (x)) - + libc_hidden_proto (hstrerror) Index: glibc-2.17-c758a686/include/resolv.h =================================================================== @@ -7083,54 +7083,54 @@ Index: glibc-2.17-c758a686/include/stdlib.h --- glibc-2.17-c758a686.orig/include/stdlib.h +++ glibc-2.17-c758a686/include/stdlib.h @@ -216,7 +216,7 @@ extern int __qfcvt_r (long double __valu - int *__restrict __decpt, int *__restrict __sign, - char *__restrict __buf, size_t __len); - + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len); + -# ifndef NOT_IN_libc +# if IS_IN (libc) # undef MB_CUR_MAX # define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX)) - + Index: glibc-2.17-c758a686/locale/Makefile =================================================================== --- glibc-2.17-c758a686.orig/locale/Makefile +++ glibc-2.17-c758a686/locale/Makefile @@ -88,13 +88,13 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH - -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ - -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \ - -DLOCSRCDIR='"$(i18ndir)/locales"' \ + -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ + -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \ + -DLOCSRCDIR='"$(i18ndir)/locales"' \ - -DHAVE_CONFIG_H -DNOT_IN_libc + -DHAVE_CONFIG_H - + CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts CFLAGS-charmap-dir.c = -Wno-write-strings - + -# This makes sure -DNOT_IN_libc et al are passed for all these modules. +# Set libof-* for each routine. cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \ - $(lib-modules) + $(lib-modules) lib := locale-programs Index: glibc-2.17-c758a686/nss/Makefile =================================================================== --- glibc-2.17-c758a686.orig/nss/Makefile +++ glibc-2.17-c758a686/nss/Makefile @@ -109,7 +109,6 @@ $(inst_vardbdir)/Makefile: db-Makefile $ - $(do-install) - + $(do-install) + libof-nss_test1 = extramodules -CPPFLAGS-nss_test1 = -DNOT_IN_libc=1 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(common-objpfx)libc.so \ - $(common-objpfx)libc_nonshared.a - $(build-module) + $(common-objpfx)libc_nonshared.a + $(build-module) Index: glibc-2.17-c758a686/resolv/res_hconf.c =================================================================== --- glibc-2.17-c758a686.orig/resolv/res_hconf.c +++ glibc-2.17-c758a686/resolv/res_hconf.c @@ -359,7 +359,7 @@ _res_hconf_init (void) } - - + + -#ifndef NOT_IN_libc +#if IS_IN (libc) /* List of known interfaces. */ @@ -7142,10 +7142,10 @@ Index: glibc-2.17-c758a686/stdlib/Makefile +++ glibc-2.17-c758a686/stdlib/Makefile @@ -139,7 +139,6 @@ LDFLAGS-tst-putenv = $(no-as-needed) $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os - $(build-module) + $(build-module) libof-tst-putenvmod = extramodules -CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1 - + ifeq ($(build-shared),yes) link-libm = $(common-objpfx)math/libm.so Index: glibc-2.17-c758a686/sysdeps/gnu/errlist.awk @@ -7168,38 +7168,38 @@ Index: glibc-2.17-c758a686/sysdeps/gnu/errlist.c @@ -1479,7 +1479,7 @@ TRANS error; @pxref{Cancel AIO Operation (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0]) const int _sys_nerr_internal = NERR; - + -#if !defined NOT_IN_libc && !ERRLIST_NO_COMPAT +#if IS_IN (libc) && !ERRLIST_NO_COMPAT # include #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/i586/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i586/memcpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i586/memcpy.S @@ -34,7 +34,7 @@ #define LEN SRC+PTR_SIZE - + .text -#if defined PIC && !defined NOT_IN_libc +#if defined PIC && IS_IN (libc) ENTRY (__memcpy_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/memcpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/memcpy.S @@ -30,7 +30,7 @@ #define LEN SRC+PTR_SIZE - - .text + + .text -#if defined PIC && !defined NOT_IN_libc +#if defined PIC && IS_IN (libc) ENTRY_CHK (__memcpy_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/memmove.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/memmove.S @@ -7207,22 +7207,22 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/memmove.S @@ -37,7 +37,7 @@ # define SRC DEST+PTR_SIZE # define LEN SRC+PTR_SIZE - + -# if defined PIC && !defined NOT_IN_libc +# if defined PIC && IS_IN (libc) ENTRY_CHK (__memmove_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/mempcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/mempcpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/mempcpy.S @@ -30,7 +30,7 @@ #define LEN SRC+PTR_SIZE - - .text + + .text -#if defined PIC && !defined NOT_IN_libc +#if defined PIC && IS_IN (libc) ENTRY_CHK (__mempcpy_chk) - movl 12(%esp), %eax - cmpl %eax, 16(%esp) + movl 12(%esp), %eax + cmpl %eax, 16(%esp) diff --git a/SOURCES/glibc-rh1256317-20.patch b/SOURCES/glibc-rh1256317-20.patch index 2a621dcf..84266534 100644 --- a/SOURCES/glibc-rh1256317-20.patch +++ b/SOURCES/glibc-rh1256317-20.patch @@ -3,14 +3,14 @@ Author: Siddhesh Poyarekar Date: Thu Aug 21 10:27:13 2014 +0530 Remove redundant CPPFLAGS for some programs - + These programs get the NOT_IN_libc twice, once through the 'other' target and another explicitly. Remove the explicitly added CPFLAG. - - * catgets/Makefile (CPPFLAGS-gencat): Remove. - * iconv/Makefile (CPPFLAGS-iconv_prog): Likewise. - (CPPFLAGS-iconvconfig): Likewise. - * timezone/Makefile (CPPFLAGS-zic): Likewise. + + * catgets/Makefile (CPPFLAGS-gencat): Remove. + * iconv/Makefile (CPPFLAGS-iconv_prog): Likewise. + (CPPFLAGS-iconvconfig): Likewise. + * timezone/Makefile (CPPFLAGS-zic): Likewise. Index: glibc-2.17-c758a686/catgets/Makefile =================================================================== @@ -18,12 +18,12 @@ Index: glibc-2.17-c758a686/catgets/Makefile +++ glibc-2.17-c758a686/catgets/Makefile @@ -42,8 +42,6 @@ $(objpfx)gencat: $(gencat-modules:%=$(ob catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \ - -DHAVE_CONFIG_H - + -DHAVE_CONFIG_H + -CPPFLAGS-gencat = -DNOT_IN_libc - generated = de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \ - test-gencat.h + test-gencat.h generated-dirs = de Index: glibc-2.17-c758a686/iconv/Makefile =================================================================== @@ -32,7 +32,7 @@ Index: glibc-2.17-c758a686/iconv/Makefile @@ -53,9 +53,7 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$( CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"' CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"' - + -CPPFLAGS-iconv_prog = -DNOT_IN_libc CPPFLAGS-iconv_charmap = -DNOT_IN_libc -CPPFLAGS-iconvconfig = -DNOT_IN_libc @@ -44,9 +44,9 @@ Index: glibc-2.17-c758a686/timezone/Makefile --- glibc-2.17-c758a686.orig/timezone/Makefile +++ glibc-2.17-c758a686/timezone/Makefile @@ -42,8 +42,6 @@ all: # Make this the default target; it - + include ../Makeconfig # Get objpfx defined so we can use it below. - + -CPPFLAGS-zic = -DNOT_IN_libc - ifeq ($(have-ksh),yes) diff --git a/SOURCES/glibc-rh1256317-21.patch b/SOURCES/glibc-rh1256317-21.patch index 17b45fe6..a1a4a1e6 100644 --- a/SOURCES/glibc-rh1256317-21.patch +++ b/SOURCES/glibc-rh1256317-21.patch @@ -3,11 +3,11 @@ Author: Siddhesh Poyarekar Date: Thu Aug 21 10:26:46 2014 +0530 Remove unnecessary uses of NOT_IN_libc - + If a IS_IN_* macro is defined, then NOT_IN_libc is always defined, except obviously for IS_IN_libc. There's no need to check for both. Verified on x86_64 and i686 that the source is unchanged. - + * include/libc-symbols.h: Remove unnecessary check for NOT_IN_libc. * nptl/pthreadP.h: Likewise. @@ -45,7 +45,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -561,7 +561,7 @@ for linking") # define libc_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -54,7 +54,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -579,7 +579,7 @@ for linking") # define rtld_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libm +#ifdef IS_IN_libm # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -63,7 +63,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -597,7 +597,7 @@ for linking") # define libm_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libresolv +#ifdef IS_IN_libresolv # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -72,7 +72,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -615,7 +615,7 @@ for linking") # define libresolv_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_librt +#ifdef IS_IN_librt # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -81,7 +81,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -633,7 +633,7 @@ for linking") # define librt_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libdl +#ifdef IS_IN_libdl # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -90,7 +90,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -651,7 +651,7 @@ for linking") # define libdl_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libnss_files +#ifdef IS_IN_libnss_files # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -99,7 +99,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -669,7 +669,7 @@ for linking") # define libnss_files_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libnsl +#ifdef IS_IN_libnsl # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -108,7 +108,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -687,7 +687,7 @@ for linking") # define libnsl_hidden_data_ver(local, name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libnss_nisplus +#ifdef IS_IN_libnss_nisplus # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -117,7 +117,7 @@ Index: glibc-2.17-c758a686/include/libc-symbols.h @@ -713,7 +713,7 @@ for linking") # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) #endif - + -#if defined NOT_IN_libc && defined IS_IN_libutil +#ifdef IS_IN_libutil # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) @@ -153,18 +153,18 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h __librt_enable_asynccancel () # define LIBC_CANCEL_RESET(val) \ @@ -344,7 +344,7 @@ extern int __make_stacks_executable (voi - + /* longjmp handling. */ extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe); -#if defined NOT_IN_libc && defined IS_IN_libpthread +#ifdef IS_IN_libpthread hidden_proto (__pthread_cleanup_upto) #endif - + @@ -489,7 +489,7 @@ extern int __pthread_enable_asynccancel extern void __pthread_disable_asynccancel (int oldtype) internal_function attribute_hidden; - + -#if defined NOT_IN_libc && defined IS_IN_libpthread +#ifdef IS_IN_libpthread hidden_proto (__pthread_mutex_init) @@ -175,7 +175,7 @@ Index: glibc-2.17-c758a686/sysdeps/posix/getcwd.c --- glibc-2.17-c758a686.orig/sysdeps/posix/getcwd.c +++ glibc-2.17-c758a686/sysdeps/posix/getcwd.c @@ -206,7 +206,7 @@ extern char *alloca (); - + #ifdef __ASSUME_ATFCTS # define __have_atfcts 1 -#elif defined NOT_IN_libc && defined IS_IN_rtld @@ -189,12 +189,12 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -212,7 +212,7 @@ L(no_vmx): #else - li r6,0 + li r6,0 #endif -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - li r3,0 - blr + li r3,0 + blr #elif defined SHARED Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S =================================================================== @@ -202,59 +202,59 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S @@ -57,7 +57,7 @@ ENTRY(__sigsetjmp) #endif - std %f4,40(%r2) - std %f6,48(%r2) + std %f4,40(%r2) + std %f6,48(%r2) -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - lhi %r2,0 - br %r14 + /* In ld.so we never save the signal mask. */ + lhi %r2,0 + br %r14 Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/setjmp.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S @@ -63,7 +63,7 @@ ENTRY(__sigsetjmp) - std %f13,120(%r2) - std %f14,128(%r2) - std %f15,136(%r2) + std %f13,120(%r2) + std %f14,128(%r2) + std %f15,136(%r2) -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - lghi %r2,0 - br %r14 + /* In ld.so we never save the signal mask. */ + lghi %r2,0 + br %r14 Index: glibc-2.17-c758a686/sysdeps/sh/sh3/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sh/sh3/setjmp.S +++ glibc-2.17-c758a686/sysdeps/sh/sh3/setjmp.S @@ -46,7 +46,7 @@ ENTRY (__sigsetjmp) - mov.l r9, @-r4 - mov.l r8, @-r4 - + mov.l r9, @-r4 + mov.l r8, @-r4 + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - rts - mov #0, r0 + /* In ld.so we never save the signal mask. */ + rts + mov #0, r0 Index: glibc-2.17-c758a686/sysdeps/sh/sh4/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sh/sh4/setjmp.S +++ glibc-2.17-c758a686/sysdeps/sh/sh4/setjmp.S @@ -55,7 +55,7 @@ ENTRY (__sigsetjmp) - mov.l r9, @-r4 - mov.l r8, @-r4 - + mov.l r9, @-r4 + mov.l r8, @-r4 + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - rts - mov #0, r0 + /* In ld.so we never save the signal mask. */ + rts + mov #0, r0 Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/i386/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -521,7 +521,7 @@ asm (".L__X'%ebx = 1\n\t" - - + + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -266,8 +266,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -272,7 +272,7 @@ - - + + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -279,8 +279,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -282,7 +282,7 @@ - - + + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -293,7 +293,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -367,7 +367,7 @@ _ret; }) - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -306,7 +306,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -373,7 +373,7 @@ _ret; }) - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -319,7 +319,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -338,7 +338,7 @@ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -332,7 +332,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -126,7 +126,7 @@ ENTRY(name); \ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -345,7 +345,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -141,7 +141,7 @@ ENTRY(name); \ #define STACK_BIAS 2047 - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -357,8 +357,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/x86_64/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -395,7 +395,7 @@ - - + + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld @@ -371,47 +371,47 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/setjmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/setjmp.S @@ -54,7 +54,7 @@ ENTRY (__sigsetjmp) #endif - movq %rax, (JB_PC*8)(%rdi) - + movq %rax, (JB_PC*8)(%rdi) + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - xorl %eax, %eax - retq + /* In ld.so we never save the signal mask. */ + xorl %eax, %eax + retq Index: glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S @@ -58,7 +58,7 @@ ENTRY (__sigsetjmp) - mov x2, sp - str x2, [x0, #JB_SP<<3] + mov x2, sp + str x2, [x0, #JB_SP<<3] #endif -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask */ - mov w0, #0 - RET + /* In ld.so we never save the signal mask */ + mov w0, #0 + RET Index: glibc-2.17-c758a686/ports/sysdeps/alpha/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/alpha/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/alpha/setjmp.S @@ -86,7 +86,7 @@ $sigsetjmp_local: - ldq ra, 0(sp) - addq sp, 16, sp - ret + ldq ra, 0(sp) + addq sp, 16, sp + ret -#elif defined NOT_IN_libc && defined IS_IN_rtld +#elif defined IS_IN_rtld - /* In ld.so we never save the signal mask. */ - mov 0, v0 - ret + /* In ld.so we never save the signal mask. */ + mov 0, v0 + ret Index: glibc-2.17-c758a686/ports/sysdeps/m68k/setjmp.c =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/m68k/setjmp.c +++ glibc-2.17-c758a686/ports/sysdeps/m68k/setjmp.c @@ -57,7 +57,7 @@ __sigsetjmp (jmp_buf env, int savemask) - : : "m" (env[0].__jmpbuf[0].__fpregs[0])); + : : "m" (env[0].__jmpbuf[0].__fpregs[0])); #endif - + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld /* In ld.so we never save the signal mask. */ @@ -422,39 +422,39 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.h --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/alpha/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.h @@ -346,7 +346,7 @@ __LABEL(name) \ - + #include - + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld # ifdef __ASSEMBLER__ # define PTR_MANGLE(dst, src, tmp) \ - ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ + ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ Index: glibc-2.17-c758a686/sysdeps/i386/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/setjmp.S +++ glibc-2.17-c758a686/sysdeps/i386/setjmp.S @@ -51,7 +51,7 @@ ENTRY (BP_SYM (__sigsetjmp)) - LEAVE /* pop frame pointer to prepare for tail-call. */ - movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */ - + LEAVE /* pop frame pointer to prepare for tail-call. */ + movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */ + -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - xorl %eax, %eax - ret + /* In ld.so we never save the signal mask. */ + xorl %eax, %eax + ret Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp-common.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/setjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp-common.S @@ -64,7 +64,7 @@ ENTRY (BP_SYM (__sigsetjmp)) - stw r29,((JB_GPRS+15)*4)(3) - stw r30,((JB_GPRS+16)*4)(3) - stw r31,((JB_GPRS+17)*4)(3) + stw r29,((JB_GPRS+15)*4)(3) + stw r30,((JB_GPRS+16)*4)(3) + stw r31,((JB_GPRS+17)*4)(3) -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - li r3,0 - blr + li r3,0 + blr #else Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h =================================================================== @@ -462,7 +462,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -324,8 +324,9 @@ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling is supported for AArch64. */ -#if (defined NOT_IN_libc && defined IS_IN_rtld) || \ - (!defined SHARED && (!defined NOT_IN_libc || defined IS_IN_libpthread)) @@ -477,22 +477,22 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S @@ -179,7 +179,7 @@ ENTRY(__sigsetjmp) - ;; - st8.nta [r2]=r25 // ar.unat - st8.nta [r3]=in0 // &__jmp_buf + ;; + st8.nta [r2]=r25 // ar.unat + st8.nta [r3]=in0 // &__jmp_buf -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld - /* In ld.so we never save the signal mask. */ - ;; + /* In ld.so we never save the signal mask. */ + ;; #else Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -62,7 +62,7 @@ - + #if defined USE_DL_SYSINFO \ - && (!defined NOT_IN_libc \ + && (!defined NOT_IN_libc \ - || defined IS_IN_libpthread || defined IS_IN_librt) + || IS_IN (libpthread) || defined IS_IN_librt) # define IA64_USE_NEW_STUB @@ -500,7 +500,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h # undef IA64_USE_NEW_STUB @@ -361,7 +361,7 @@ #endif /* not __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#ifdef IS_IN_rtld diff --git a/SOURCES/glibc-rh1256317-3.patch b/SOURCES/glibc-rh1256317-3.patch index 640bcbbb..e314e014 100644 --- a/SOURCES/glibc-rh1256317-3.patch +++ b/SOURCES/glibc-rh1256317-3.patch @@ -3,14 +3,14 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 21:24:22 2014 +0530 Remove last place for definition of IS_IN_* macros - + Ignoring IS_IN_build, which has a different purpose altogether, this patch removes the last bit of IS_IN_* macro definitions. Now barring NOT_IN_libc, all cases use the IN_MODULE scheme. - + Generated code unchanged on x86_64. - - * extra-lib.mk (CPPFLAGS-$(lib)): Remove IS_IN_$(lib). + + * extra-lib.mk (CPPFLAGS-$(lib)): Remove IS_IN_$(lib). Index: glibc-2.17-c758a686/extra-lib.mk =================================================================== @@ -19,6 +19,6 @@ Index: glibc-2.17-c758a686/extra-lib.mk @@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left)) include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) endif - + -CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 +CPPFLAGS-$(lib) := -DNOT_IN_libc=1 diff --git a/SOURCES/glibc-rh1256317-4.patch b/SOURCES/glibc-rh1256317-4.patch index eab03528..6156feb5 100644 --- a/SOURCES/glibc-rh1256317-4.patch +++ b/SOURCES/glibc-rh1256317-4.patch @@ -3,10 +3,10 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 21:09:43 2014 +0530 Remove IS_IN_rtld - + Replace with IS_IN (rtld). Generated code is unchanged on x86_64. - + * elf/Makefile (CPPFLAGS-.os): Remove IS_IN_rtld. * elf/dl-open.c: Use IS_IN (rtld) instead if IS_IN_rtld. * elf/rtld-Rules: Likewise. @@ -84,11 +84,11 @@ Index: glibc-2.17-c758a686/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -444,7 +444,7 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS) CFLAGS-rtld.c = $(SYSCONF-FLAGS) - + CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ - -DNOT_IN_libc=1 -DIS_IN_rtld=1) + -DNOT_IN_libc=1) - + # Disable any optimization which might result in function calls during early # dynamic loader startup. We disable -ftree-loop-distribute-patterns which Index: glibc-2.17-c758a686/elf/dl-open.c @@ -98,7 +98,7 @@ Index: glibc-2.17-c758a686/elf/dl-open.c @@ -741,7 +741,7 @@ _dl_show_scope (struct link_map *l, int _dl_debug_printf ("\n"); } - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) /* Return non-zero if ADDR lies within one of L's segments. */ @@ -110,11 +110,11 @@ Index: glibc-2.17-c758a686/elf/rtld-Rules +++ glibc-2.17-c758a686/elf/rtld-Rules @@ -134,6 +134,6 @@ lib := rtld include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - + # This here is the whole point of all the shenanigans. -rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 +rtld-CPPFLAGS := -DNOT_IN_libc=1 - + endif Index: glibc-2.17-c758a686/elf/setup-vdso.h =================================================================== @@ -123,7 +123,7 @@ Index: glibc-2.17-c758a686/elf/setup-vdso.h @@ -101,7 +101,7 @@ setup_vdso (struct link_map *main_map __ /* Add the vDSO to the object list. */ _dl_add_to_namespace_list (l, LM_ID_BASE); - + -# ifdef IS_IN_rtld +# if IS_IN (rtld) /* Rearrange the list so this DSO appears after rtld_map. */ @@ -134,9 +134,9 @@ Index: glibc-2.17-c758a686/include/assert.h --- glibc-2.17-c758a686.orig/include/assert.h +++ glibc-2.17-c758a686/include/assert.h @@ -20,7 +20,7 @@ extern void __assert_fail_base (const ch - const char *function) + const char *function) __THROW __attribute__ ((__noreturn__)); - + -# if !defined NOT_IN_libc || defined IS_IN_rtld +# if !defined NOT_IN_libc || IS_IN (rtld) hidden_proto (__assert_fail) @@ -157,14 +157,14 @@ Index: glibc-2.17-c758a686/include/errno.h --- glibc-2.17-c758a686.orig/include/errno.h +++ glibc-2.17-c758a686/include/errno.h @@ -4,7 +4,7 @@ - + #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus - + -# ifdef IS_IN_rtld +# if IS_IN (rtld) # include # endif - + Index: glibc-2.17-c758a686/include/sys/stat.h =================================================================== --- glibc-2.17-c758a686.orig/include/sys/stat.h @@ -172,7 +172,7 @@ Index: glibc-2.17-c758a686/include/sys/stat.h @@ -12,7 +12,7 @@ extern __mode_t __umask (__mode_t __mask extern int __mkdir (const char *__path, __mode_t __mode); extern int __mknod (const char *__path, - __mode_t __mode, __dev_t __dev); + __mode_t __mode, __dev_t __dev); -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) hidden_proto (__fxstat) @@ -183,49 +183,49 @@ Index: glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S --- glibc-2.17-c758a686.orig/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S @@ -58,7 +58,7 @@ ENTRY (__sigsetjmp) - mov x2, sp - str x2, [x0, #JB_SP<<3] + mov x2, sp + str x2, [x0, #JB_SP<<3] #endif -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask */ - mov w0, #0 - RET + /* In ld.so we never save the signal mask */ + mov w0, #0 + RET Index: glibc-2.17-c758a686/ports/sysdeps/alpha/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/alpha/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/alpha/setjmp.S @@ -86,7 +86,7 @@ $sigsetjmp_local: - ldq ra, 0(sp) - addq sp, 16, sp - ret + ldq ra, 0(sp) + addq sp, 16, sp + ret -#elif defined IS_IN_rtld +#elif IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - mov 0, v0 - ret + /* In ld.so we never save the signal mask. */ + mov 0, v0 + ret Index: glibc-2.17-c758a686/ports/sysdeps/arm/__longjmp.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/arm/__longjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/arm/__longjmp.S @@ -52,7 +52,7 @@ ENTRY (__longjmp) #endif - + #ifdef NEED_HWCAP -# ifdef IS_IN_rtld +# if IS_IN (rtld) - ldr a2, 1f - ldr a3, .Lrtld_local_ro + ldr a2, 1f + ldr a3, .Lrtld_local_ro 0: add a2, pc, a2 @@ -104,7 +104,7 @@ ENTRY (__longjmp) - DO_RET(lr) - + DO_RET(lr) + #ifdef NEED_HWCAP -# ifdef IS_IN_rtld +# if IS_IN (rtld) 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 .Lrtld_local_ro: - .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) + .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) Index: glibc-2.17-c758a686/ports/sysdeps/arm/aeabi_unwind_cpp_pr1.c =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/arm/aeabi_unwind_cpp_pr1.c @@ -262,29 +262,29 @@ Index: glibc-2.17-c758a686/ports/sysdeps/arm/setjmp.S --- glibc-2.17-c758a686.orig/ports/sysdeps/arm/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/arm/setjmp.S @@ -35,7 +35,7 @@ ENTRY (__sigsetjmp) - + #ifdef NEED_HWCAP - /* Check if we have a VFP unit. */ + /* Check if we have a VFP unit. */ -# ifdef IS_IN_rtld +# if IS_IN (rtld) - ldr a3, 1f - ldr a4, .Lrtld_local_ro + ldr a3, 1f + ldr a4, .Lrtld_local_ro 0: add a3, pc, a3 @@ -90,7 +90,7 @@ ENTRY (__sigsetjmp) - B PLTJMP(C_SYMBOL_NAME(__sigjmp_save)) - + B PLTJMP(C_SYMBOL_NAME(__sigjmp_save)) + #ifdef NEED_HWCAP -# ifdef IS_IN_rtld +# if IS_IN (rtld) 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 .Lrtld_local_ro: - .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) + .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) Index: glibc-2.17-c758a686/sysdeps/generic/_itoa.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/generic/_itoa.h +++ glibc-2.17-c758a686/sysdeps/generic/_itoa.h @@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long i - + extern const char _itoa_upper_digits[]; extern const char _itoa_lower_digits[]; -#if !defined NOT_IN_libc || defined IS_IN_rtld @@ -299,7 +299,7 @@ Index: glibc-2.17-c758a686/sysdeps/generic/dl-sysdep.h @@ -27,7 +27,7 @@ all the libc functions that ld.so uses are called without PLT and always get the versions linked into ld.so rather than the libc ones. */ - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # define RTLD_PRIVATE_ERRNO 1 @@ -326,7 +326,7 @@ Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h +# if IS_IN (rtld) # ifdef HAVE_SDATA_SECTION # define __rtld_local_attribute__ \ - __attribute__ ((visibility ("hidden"), section (".sdata"))) + __attribute__ ((visibility ("hidden"), section (".sdata"))) @@ -434,7 +434,7 @@ extern struct rtld_global _rtld_global _ #ifndef SHARED # define GLRO(name) _##name @@ -348,7 +348,7 @@ Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h @@ -610,7 +610,7 @@ extern const struct rtld_global_ro _rtld #endif #undef EXTERN - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) /* This is the initial value of GL(dl_error_catch_tsd). @@ -371,7 +371,7 @@ Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h +#if IS_IN (rtld) extern int _dl_starting_up_internal attribute_hidden; #endif - + Index: glibc-2.17-c758a686/sysdeps/i386/dl-tls.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/dl-tls.h @@ -379,7 +379,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-tls.h @@ -32,7 +32,7 @@ extern void *___tls_get_addr (tls_index extern void *___tls_get_addr_internal (tls_index *ti) __attribute__ ((__regparm__ (1))) attribute_hidden; - + -# ifdef IS_IN_rtld +# if IS_IN (rtld) /* The special thing about the x86 TLS ABI is that we have two @@ -390,22 +390,22 @@ Index: glibc-2.17-c758a686/sysdeps/i386/setjmp.S --- glibc-2.17-c758a686.orig/sysdeps/i386/setjmp.S +++ glibc-2.17-c758a686/sysdeps/i386/setjmp.S @@ -51,7 +51,7 @@ ENTRY (BP_SYM (__sigsetjmp)) - LEAVE /* pop frame pointer to prepare for tail-call. */ - movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */ - + LEAVE /* pop frame pointer to prepare for tail-call. */ + movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */ + -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - xorl %eax, %eax - ret + /* In ld.so we never save the signal mask. */ + xorl %eax, %eax + ret Index: glibc-2.17-c758a686/ports/sysdeps/m68k/setjmp.c =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/m68k/setjmp.c +++ glibc-2.17-c758a686/ports/sysdeps/m68k/setjmp.c @@ -57,7 +57,7 @@ __sigsetjmp (jmp_buf env, int savemask) - : : "m" (env[0].__jmpbuf[0].__fpregs[0])); + : : "m" (env[0].__jmpbuf[0].__fpregs[0])); #endif - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) /* In ld.so we never save the signal mask. */ @@ -418,18 +418,18 @@ Index: glibc-2.17-c758a686/sysdeps/mach/hurd/dl-execstack.c @@ -34,7 +34,7 @@ _dl_make_stack_executable (void **stack_ return EPERM; *stack_endp = NULL; - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) if (__mprotect ((void *)_dl_hurd_data->stack_base, _dl_hurd_data->stack_size, - PROT_READ|PROT_WRITE|PROT_EXEC) != 0) + PROT_READ|PROT_WRITE|PROT_EXEC) != 0) return errno; Index: glibc-2.17-c758a686/sysdeps/mach/hurd/opendir.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/mach/hurd/opendir.c +++ glibc-2.17-c758a686/sysdeps/mach/hurd/opendir.c @@ -82,7 +82,7 @@ __opendirat (int dfd, const char *name) - + int flags = O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC; int fd; -#ifdef IS_IN_rtld @@ -442,7 +442,7 @@ Index: glibc-2.17-c758a686/sysdeps/posix/getcwd.c --- glibc-2.17-c758a686.orig/sysdeps/posix/getcwd.c +++ glibc-2.17-c758a686/sysdeps/posix/getcwd.c @@ -206,7 +206,7 @@ extern char *alloca (); - + #ifdef __ASSUME_ATFCTS # define __have_atfcts 1 -#elif defined IS_IN_rtld @@ -483,7 +483,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h @@ -166,7 +166,7 @@ _dl_string_platform (const char *str) return -1; } - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) static inline int @@ -494,27 +494,27 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S @@ -37,7 +37,7 @@ ENTRY (BP_SYM (__longjmp)) - addis r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha - addi r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l + addis r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha + addi r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l # ifdef SHARED -# ifdef IS_IN_rtld +# if IS_IN (rtld) - /* Inside ld.so we use the local alias to avoid runtime GOT - relocations. */ - lwz r5,_rtld_local_ro@got(r5) + /* Inside ld.so we use the local alias to avoid runtime GOT + relocations. */ + lwz r5,_rtld_local_ro@got(r5) Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S @@ -90,7 +90,7 @@ ENTRY (BP_SYM (__sigsetjmp)) - mtlr r6 - cfi_same_value (lr) + mtlr r6 + cfi_same_value (lr) # ifdef SHARED -# ifdef IS_IN_rtld +# if IS_IN (rtld) - /* Inside ld.so we use the local alias to avoid runtime GOT - relocations. */ - lwz r5,_rtld_local_ro@got(r5) + /* Inside ld.so we use the local alias to avoid runtime GOT + relocations. */ + lwz r5,_rtld_local_ro@got(r5) Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h @@ -533,89 +533,89 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp-common.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/setjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp-common.S @@ -64,7 +64,7 @@ ENTRY (BP_SYM (__sigsetjmp)) - stw r29,((JB_GPRS+15)*4)(3) - stw r30,((JB_GPRS+16)*4)(3) - stw r31,((JB_GPRS+17)*4)(3) + stw r29,((JB_GPRS+15)*4)(3) + stw r30,((JB_GPRS+16)*4)(3) + stw r31,((JB_GPRS+17)*4)(3) -#ifdef IS_IN_rtld +#if IS_IN (rtld) - li r3,0 - blr + li r3,0 + blr #else Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/__longjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S @@ -31,7 +31,7 @@ - .section ".toc","aw" + .section ".toc","aw" .LC__dl_hwcap: # ifdef SHARED -# ifdef IS_IN_rtld +# if IS_IN (rtld) - /* Inside ld.so we use the local alias to avoid runtime GOT - relocations. */ - .tc _rtld_local_ro[TC],_rtld_local_ro + /* Inside ld.so we use the local alias to avoid runtime GOT + relocations. */ + .tc _rtld_local_ro[TC],_rtld_local_ro @@ -132,7 +132,7 @@ L(no_vmx): - ld r0,(JB_LR*8)(r3) - ld r14,((JB_GPRS+0)*8)(r3) - lfd fp14,((JB_FPRS+0)*8)(r3) + ld r0,(JB_LR*8)(r3) + ld r14,((JB_GPRS+0)*8)(r3) + lfd fp14,((JB_FPRS+0)*8)(r3) -#if defined SHARED && !defined IS_IN_rtld +#if defined SHARED && !IS_IN (rtld) - std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */ + std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */ #endif - ld r15,((JB_GPRS+1)*8)(r3) + ld r15,((JB_GPRS+1)*8)(r3) Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/setjmp-common.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -30,7 +30,7 @@ - .section ".toc","aw" + .section ".toc","aw" .LC__dl_hwcap: # ifdef SHARED -# ifdef IS_IN_rtld +# if IS_IN (rtld) - /* Inside ld.so we use the local alias to avoid runtime GOT - relocations. */ - .tc _rtld_local_ro[TC],_rtld_local_ro + /* Inside ld.so we use the local alias to avoid runtime GOT + relocations. */ + .tc _rtld_local_ro[TC],_rtld_local_ro @@ -50,7 +50,7 @@ ENTRY (setjmp) - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) + b JUMPTARGET (GLUE(__sigsetjmp,_ent)) END (setjmp) - + -#if defined SHARED && !defined IS_IN_rtld && !defined __NO_VMX__ +#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__ /* When called from within libc we need a special version of _setjmp that saves r2 since the call won't go via a plt call stub. See bugz #269. __GI__setjmp is used in csu/libc-start.c when @@ -82,7 +82,7 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)): - std r1,(JB_GPR1*8)(3) + std r1,(JB_GPR1*8)(3) #endif - mflr r0 + mflr r0 -#if defined SHARED && !defined IS_IN_rtld +#if defined SHARED && !IS_IN (rtld) - ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */ - std r5,(JB_GPR2*8)(3) + ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */ + std r5,(JB_GPR2*8)(3) #else @@ -212,7 +212,7 @@ L(no_vmx): #else - li r6,0 + li r6,0 #endif -#ifdef IS_IN_rtld +#if IS_IN (rtld) - li r3,0 - blr + li r3,0 + blr #elif defined SHARED Index: glibc-2.17-c758a686/sysdeps/s390/dl-tls.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/dl-tls.h +++ glibc-2.17-c758a686/sysdeps/s390/dl-tls.h @@ -29,7 +29,7 @@ typedef struct - + extern unsigned long __tls_get_offset (unsigned long got_offset); - + -# ifdef IS_IN_rtld +# if IS_IN (rtld) - + # include - + @@ -78,9 +78,9 @@ __tls_get_offset:\n\ 1: .long __tls_get_addr - 0b\n\ "); @@ -625,7 +625,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/dl-tls.h extern void *__tls_get_addr_internal (tls_index *ti); -# endif /* !IS_IN_rtld */ +# endif /* !IS_IN (rtld) */ - + # define GET_ADDR_OFFSET \ (ti->ti_offset - (unsigned long) __builtin_thread_pointer ()) Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S @@ -634,52 +634,52 @@ Index: glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/setjmp.S @@ -57,7 +57,7 @@ ENTRY(__sigsetjmp) #endif - std %f4,40(%r2) - std %f6,48(%r2) + std %f4,40(%r2) + std %f6,48(%r2) -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - lhi %r2,0 - br %r14 + /* In ld.so we never save the signal mask. */ + lhi %r2,0 + br %r14 Index: glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/s390/s390-64/setjmp.S +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S @@ -63,7 +63,7 @@ ENTRY(__sigsetjmp) - std %f13,120(%r2) - std %f14,128(%r2) - std %f15,136(%r2) + std %f13,120(%r2) + std %f14,128(%r2) + std %f15,136(%r2) -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - lghi %r2,0 - br %r14 + /* In ld.so we never save the signal mask. */ + lghi %r2,0 + br %r14 Index: glibc-2.17-c758a686/sysdeps/sh/sh3/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sh/sh3/setjmp.S +++ glibc-2.17-c758a686/sysdeps/sh/sh3/setjmp.S @@ -46,7 +46,7 @@ ENTRY (__sigsetjmp) - mov.l r9, @-r4 - mov.l r8, @-r4 - + mov.l r9, @-r4 + mov.l r8, @-r4 + -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - rts - mov #0, r0 + /* In ld.so we never save the signal mask. */ + rts + mov #0, r0 Index: glibc-2.17-c758a686/sysdeps/sh/sh4/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/sh/sh4/setjmp.S +++ glibc-2.17-c758a686/sysdeps/sh/sh4/setjmp.S @@ -55,7 +55,7 @@ ENTRY (__sigsetjmp) - mov.l r9, @-r4 - mov.l r8, @-r4 - + mov.l r9, @-r4 + mov.l r8, @-r4 + -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - rts - mov #0, r0 + /* In ld.so we never save the signal mask. */ + rts + mov #0, r0 Index: glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/alpha/sysdep.h @@ -687,21 +687,21 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/alpha/sysdep.h @@ -26,7 +26,7 @@ # include #endif - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif - + @@ -346,7 +346,7 @@ __LABEL(name) \ - + #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # ifdef __ASSEMBLER__ # define PTR_MANGLE(dst, src, tmp) \ - ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ + ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/arm/sysdep.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/arm/sysdep.S @@ -709,12 +709,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/arm/sysdep.S @@ -21,7 +21,7 @@ #define _ERRNO_H #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif - + Index: glibc-2.17-c758a686/sysdeps/unix/i386/sysdep.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/i386/sysdep.S @@ -722,38 +722,38 @@ Index: glibc-2.17-c758a686/sysdeps/unix/i386/sysdep.S @@ -22,7 +22,7 @@ #include #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif - + Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -324,7 +324,7 @@ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling is supported for AArch64. */ -#if (defined IS_IN_rtld) || \ +#if (IS_IN (rtld)) || \ (!defined SHARED && (!defined NOT_IN_libc \ - || IS_IN (libpthread))) + || IS_IN (libpthread))) # ifdef __ASSEMBLER__ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/getcwd.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/getcwd.c +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/getcwd.c @@ -33,7 +33,7 @@ - + /* If we compile the file for use in ld.so we don't need the feature that getcwd() allocates the buffers itself. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) # define NO_ALLOCATION 1 #endif - + Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h @@ -761,7 +761,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock. @@ -56,7 +56,7 @@ /* Initialize locks to zero. */ #define LLL_MUTEX_LOCK_INITIALIZER (0) - + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -773,8 +773,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -71,7 +71,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -785,8 +785,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/i386/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -521,7 +521,7 @@ asm (".L__X'%ebx = 1\n\t" - - + + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -799,8 +799,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -811,13 +811,13 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S @@ -179,7 +179,7 @@ ENTRY(__sigsetjmp) - ;; - st8.nta [r2]=r25 // ar.unat - st8.nta [r3]=in0 // &__jmp_buf + ;; + st8.nta [r2]=r25 // ar.unat + st8.nta [r3]=in0 // &__jmp_buf -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - ;; + /* In ld.so we never save the signal mask. */ + ;; #else Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h =================================================================== @@ -825,7 +825,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -361,7 +361,7 @@ #endif /* not __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -837,16 +837,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h @@ -23,7 +23,7 @@ - + #ifdef SHARED - + -# ifdef IS_IN_rtld +# if IS_IN (rtld) # define M68K_VDSO_SYMBOL(name) __rtld_##name # define STR_M68K_VDSO_SYMBOL(name) "__rtld_" #name # else @@ -35,7 +35,7 @@ - + /* We define __rtld_* copies for rtld. We need them visible in libc to initialize. */ -# if defined IS_IN_rtld || !defined NOT_IN_libc @@ -860,7 +860,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h extern void __vdso_atomic_barrier_stub (void); -# endif /* IS_IN_rtld || !NOT_IN_libc */ +# endif /* IS_IN (rtld) || !NOT_IN_libc */ - + /* RTLD should only use its own copies. */ -# ifndef IS_IN_rtld +# if !IS_IN (rtld) @@ -869,9 +869,9 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h extern void *__vdso_atomic_barrier; -# endif /* !IS_IN_rtld */ +# endif /* !IS_IN (rtld) */ - + # endif /* !__ASSEMBLER__ */ - + Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S @@ -883,15 +883,15 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S -# ifdef IS_IN_rtld +# if IS_IN (rtld) /* rtld gets a hidden copy of __m68k_read_tp. */ - .hidden __m68k_read_tp + .hidden __m68k_read_tp # endif Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -272,7 +272,7 @@ - - + + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -903,8 +903,8 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -282,7 +282,7 @@ - - + + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -917,8 +917,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -51,7 +51,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -930,7 +930,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -367,7 +367,7 @@ _ret; }) - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -943,7 +943,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -373,7 +373,7 @@ _ret; }) - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -956,8 +956,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -969,7 +969,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -338,7 +338,7 @@ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -983,7 +983,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h @@ -56,7 +56,7 @@ extern void __cpu_relax (void); #define BUSY_WAIT_NOP __cpu_relax () #endif - + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -994,9 +994,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -22,7 +22,7 @@ - + #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ @@ -1004,7 +1004,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h #include @@ -126,7 +126,7 @@ ENTRY(name); \ #endif /* __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -1016,9 +1016,9 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -22,7 +22,7 @@ - + #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ @@ -1026,7 +1026,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h #include @@ -141,7 +141,7 @@ ENTRY(name); \ #define STACK_BIAS 2047 - + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -1039,7 +1039,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/sysdep.h @@ -205,7 +205,7 @@ #endif /* not __ASSEMBLER__ */ - + /* Pointer mangling support. */ -#if defined NOT_IN_libc && defined IS_IN_rtld +#if defined NOT_IN_libc && IS_IN (rtld) @@ -1051,9 +1051,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -72,7 +72,7 @@ - + #ifndef __ASSEMBLER__ - + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1066,15 +1066,15 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -24,7 +24,7 @@ #include #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif - + @@ -395,7 +395,7 @@ - - + + /* Pointer mangling support. */ -#ifdef IS_IN_rtld +#if IS_IN (rtld) @@ -1088,25 +1088,25 @@ Index: glibc-2.17-c758a686/sysdeps/unix/x86_64/sysdep.S @@ -22,7 +22,7 @@ #include #include - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif - + Index: glibc-2.17-c758a686/sysdeps/x86_64/setjmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/setjmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/setjmp.S @@ -54,7 +54,7 @@ ENTRY (__sigsetjmp) #endif - movq %rax, (JB_PC*8)(%rdi) - + movq %rax, (JB_PC*8)(%rdi) + -#ifdef IS_IN_rtld +#if IS_IN (rtld) - /* In ld.so we never save the signal mask. */ - xorl %eax, %eax - retq + /* In ld.so we never save the signal mask. */ + xorl %eax, %eax + retq Index: glibc-2.17-c758a686/include/unistd.h =================================================================== --- glibc-2.17-c758a686.orig/include/unistd.h @@ -1127,7 +1127,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h @@ -27,7 +27,7 @@ all the libc functions that ld.so uses are called without PLT and always get the versions linked into ld.so rather than the libc ones. */ - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # define RTLD_PRIVATE_ERRNO 1 @@ -1140,7 +1140,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -52,7 +52,7 @@ #define LLL_PRIVATE 0 #define LLL_SHARED FUTEX_PRIVATE_FLAG - + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1152,8 +1152,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevello +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h @@ -49,7 +49,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1165,8 +1165,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1178,8 +1178,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h @@ -48,7 +48,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1192,7 +1192,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h @@ -27,7 +27,7 @@ all the libc functions that ld.so uses are called without PLT and always get the versions linked into ld.so rather than the libc ones. */ - + -#ifdef IS_IN_rtld +#if IS_IN (rtld) # define RTLD_PRIVATE_ERRNO 1 @@ -1204,8 +1204,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1217,8 +1217,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h @@ -48,7 +48,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ @@ -1230,8 +1230,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock. +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h @@ -50,7 +50,7 @@ #define LLL_SHARED FUTEX_PRIVATE_FLAG - - + + -#if !defined NOT_IN_libc || defined IS_IN_rtld +#if !defined NOT_IN_libc || IS_IN (rtld) /* In libc.so or ld.so all futexes are private. */ diff --git a/SOURCES/glibc-rh1256317-5.patch b/SOURCES/glibc-rh1256317-5.patch index 75f27120..a5a0ddf5 100644 --- a/SOURCES/glibc-rh1256317-5.patch +++ b/SOURCES/glibc-rh1256317-5.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 21:04:47 2014 +0530 Remove IS_IN_libm - + Replace with IS_IN (libm). Generated code unchanged on x86_64. - + * include/math.h: Use IS_IN instead of IS_IN_libm. * sysdeps/alpha/fpu/s_copysign.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Likewise. @@ -80,7 +80,7 @@ Index: glibc-2.17-c758a686/include/math.h @@ -6,7 +6,7 @@ /* Now define the internal interfaces. */ extern int __matherr (struct exception *__exc); - + -# if !defined NOT_IN_libc || defined IS_IN_libm +# if !defined NOT_IN_libc || IS_IN (libm) hidden_proto (__finite) @@ -93,7 +93,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c @@ -34,7 +34,7 @@ long double __copysignl(long double x, l return x; } - + -#ifdef IS_IN_libm +#if IS_IN (libm) long_double_symbol (libm, __copysignl, copysignl); @@ -117,7 +117,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fmal.c --- glibc-2.17-c758a686.orig/sysdeps/ieee754/ldbl-128ibm/s_fmal.c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fmal.c @@ -37,7 +37,7 @@ __fmal (long double x, long double y, lo - + return (x * y) + z; } -#ifdef IS_IN_libm @@ -169,8 +169,8 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c --- glibc-2.17-c758a686.orig/sysdeps/ieee754/ldbl-128ibm/s_modfl.c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c @@ -89,7 +89,7 @@ long double __modfl(long double x, long - } - } + } + } } -#ifdef IS_IN_libm +#if IS_IN (libm) @@ -182,8 +182,8 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c --- glibc-2.17-c758a686.orig/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c @@ -102,7 +102,7 @@ long double __scalbnl (long double x, in - x = ldbl_pack (xhi, xlo); - return x*twolm54; + x = ldbl_pack (xhi, xlo); + return x*twolm54; } -#ifdef IS_IN_libm +#if IS_IN (libm) @@ -474,9 +474,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S @@ -42,7 +42,7 @@ L(0): bgelr cr6 - blr + blr END (__copysignl) - + -#ifdef IS_IN_libm +#if IS_IN (libm) long_double_symbol (libm, __copysignl, copysignl) @@ -489,7 +489,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_isnan.S @@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -502,7 +502,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S @@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -515,7 +515,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S @@ -47,7 +47,7 @@ strong_alias (__copysign, __copysignl) weak_alias (__copysign, copysignl) #endif - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -528,7 +528,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S @@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -541,7 +541,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S @@ -78,7 +78,7 @@ strong_alias (__finite, __finitel) weak_alias (__finite, finitel) #endif - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -554,7 +554,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S @@ -77,7 +77,7 @@ strong_alias (__isinf, __isinfl) weak_alias (__isinf, isinfl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -567,7 +567,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S @@ -82,7 +82,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -593,7 +593,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c @@ -39,7 +39,7 @@ strong_alias (__finite, __finitel) weak_alias (__finite, finitel) #endif - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -606,7 +606,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c @@ -39,7 +39,7 @@ strong_alias (__isinf, __isinfl) weak_alias (__isinf, isinfl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) @@ -619,7 +619,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c @@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -656,9 +656,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S @@ -43,7 +43,7 @@ L(0): - blr + blr END (__copysignl) - + -#ifdef IS_IN_libm +#if IS_IN (libm) long_double_symbol (libm, __copysignl, copysignl) @@ -671,7 +671,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_isnan.S @@ -47,7 +47,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -684,7 +684,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S @@ -51,7 +51,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -697,7 +697,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S @@ -47,7 +47,7 @@ strong_alias (__copysign, __copysignl) weak_alias (__copysign, copysignl) #endif - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -710,7 +710,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S @@ -50,7 +50,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -723,7 +723,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S @@ -49,7 +49,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -736,7 +736,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S @@ -57,7 +57,7 @@ strong_alias (__finite, __finitef) hidden_def (__finitef) weak_alias (__finitef, finitef) - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -749,7 +749,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S @@ -61,7 +61,7 @@ strong_alias (__isinf, __isinfl) weak_alias (__isinf, isinfl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -762,7 +762,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S @@ -60,7 +60,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -775,7 +775,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S @@ -43,7 +43,7 @@ strong_alias (__finite, __finitef) hidden_def (__finitef) weak_alias (__finitef, finitef) - + -#ifdef IS_IN_libm +#if IS_IN (libm) # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) @@ -788,7 +788,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S @@ -53,7 +53,7 @@ strong_alias (__isinf, __isinfl) weak_alias (__isinf, isinfl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -801,7 +801,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S @@ -45,7 +45,7 @@ strong_alias (__isnan, __isnanl) weak_alias (__isnan, isnanl) #endif - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) @@ -838,9 +838,9 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc32/fpu/s_signbitl.S --- glibc-2.17-c758a686.orig/sysdeps/sparc/sparc32/fpu/s_signbitl.S +++ glibc-2.17-c758a686/sysdeps/sparc/sparc32/fpu/s_signbitl.S @@ -25,7 +25,7 @@ ENTRY (___signbitl) - srl %o1, 31, %o0 + srl %o1, 31, %o0 END (___signbitl) - + -#ifdef IS_IN_libm +#if IS_IN (libm) long_double_symbol (libm, ___signbitl, __signbitl); @@ -853,7 +853,7 @@ Index: glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S @@ -32,7 +32,7 @@ END (__isnan) hidden_def (__isnan) weak_alias (__isnan, isnan) - + -#ifndef IS_IN_libm +#if !IS_IN (libm) # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) diff --git a/SOURCES/glibc-rh1256317-6.patch b/SOURCES/glibc-rh1256317-6.patch index e11fbc29..2a1ce72e 100644 --- a/SOURCES/glibc-rh1256317-6.patch +++ b/SOURCES/glibc-rh1256317-6.patch @@ -3,52 +3,52 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 14:22:40 2014 +0530 Remove IS_IN_libpthread - + Replace with IS_IN (libpthread). Generated code unchanged on x86_64. - - * nptl/lowlevellock.c: Use IS_IN instead of IS_IN_libpthread. - * nptl/pthreadP.h: Likewise. - * nptl_db/structs.def: Likewise. - * sysdeps/arm/sysdep.h: Likewise. - * sysdeps/nptl/bits/libc-lock.h: Likewise. - * sysdeps/nptl/bits/libc-lockP.h: Likewise. - * sysdeps/sparc/sparc32/lowlevellock.c: Likewise. - * sysdeps/unix/alpha/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise. - * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise. - * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. + + * nptl/lowlevellock.c: Use IS_IN instead of IS_IN_libpthread. + * nptl/pthreadP.h: Likewise. + * nptl_db/structs.def: Likewise. + * sysdeps/arm/sysdep.h: Likewise. + * sysdeps/nptl/bits/libc-lock.h: Likewise. + * sysdeps/nptl/bits/libc-lockP.h: Likewise. + * sysdeps/sparc/sparc32/lowlevellock.c: Likewise. + * sysdeps/unix/alpha/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevellock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/lowlevellock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevellock.c @@ -37,7 +37,7 @@ __lll_lock_wait_private (int *futex) - - + + /* These functions don't get included in libc.so */ -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) @@ -60,7 +60,7 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h --- glibc-2.17-c758a686.orig/nptl/pthreadP.h +++ glibc-2.17-c758a686/nptl/pthreadP.h @@ -225,7 +225,7 @@ extern int __pthread_debug attribute_hid - + extern void __pthread_unwind (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute ((__noreturn__)) -#if !defined SHARED && !defined IS_IN_libpthread @@ -87,18 +87,18 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h # define LIBC_CANCEL_RESET(val) CANCEL_RESET (val) # define LIBC_CANCEL_HANDLED() \ @@ -344,7 +344,7 @@ extern int __make_stacks_executable (voi - + /* longjmp handling. */ extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe); -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) hidden_proto (__pthread_cleanup_upto) #endif - + @@ -489,7 +489,7 @@ extern int __pthread_enable_asynccancel extern void __pthread_disable_asynccancel (int oldtype) internal_function attribute_hidden; - + -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) hidden_proto (__pthread_mutex_init) @@ -107,19 +107,19 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h @@ -528,7 +528,7 @@ extern int __librt_enable_asynccancel (v extern void __librt_disable_asynccancel (int oldtype) internal_function attribute_hidden; - + -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) /* Special versions which use non-exported functions. */ extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, - void (*routine) (void *), void *arg) + void (*routine) (void *), void *arg) Index: glibc-2.17-c758a686/nptl_db/structs.def =================================================================== --- glibc-2.17-c758a686.orig/nptl_db/structs.def +++ glibc-2.17-c758a686/nptl_db/structs.def @@ -31,7 +31,7 @@ #endif - + #ifndef DB_RTLD_GLOBAL_FIELD -# if !defined IS_IN_libpthread +# if !IS_IN (libpthread) @@ -134,7 +134,7 @@ Index: glibc-2.17-c758a686/nptl_db/structs.def +#if !IS_IN (libpthread) || TLS_TCB_AT_TP DB_STRUCT_FIELD (pthread, dtvp) #endif - + -#if !(defined IS_IN_libpthread && !defined SHARED) +#if !(IS_IN (libpthread) && !defined SHARED) DB_STRUCT (rtld_global) @@ -145,7 +145,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/pthread/bits/libc-lock.h +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h @@ -26,7 +26,7 @@ - + /* Mutex type. */ #if defined _LIBC || defined _IO_MTSAFE_IO -# if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC @@ -154,7 +154,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h # else typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t; @@ -47,7 +47,7 @@ typedef struct __libc_lock_recursive_opa - + /* Define an initialized recursive lock variable NAME with storage class CLASS. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) @@ -164,7 +164,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h CLASS __libc_lock_recursive_t NAME; @@ -65,7 +65,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Initialize a recursive mutex. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) +#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -173,7 +173,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h #else @@ -83,7 +83,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Finalize recursive named lock. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) +#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -182,7 +182,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h # define __libc_lock_fini_recursive(NAME) \ @@ -91,7 +91,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Lock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) +#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -191,7 +191,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h void *self = THREAD_SELF; \ @@ -108,7 +108,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Try to lock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) +#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -200,7 +200,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lock.h int result = 0; \ @@ -133,7 +133,7 @@ typedef struct __libc_lock_recursive_opa #endif - + /* Unlock the recursive named lock variable. */ -#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) +#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -213,7 +213,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h @@ -35,7 +35,7 @@ #include - + /* Mutex type. */ -#if defined NOT_IN_libc && !defined IS_IN_libpthread +#if defined NOT_IN_libc && !IS_IN (libpthread) @@ -223,14 +223,14 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h @@ -69,7 +69,7 @@ typedef pthread_key_t __libc_key_t; initialized locks must be set to one due to the lack of normal atomic operations.) */ - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread +#if !defined NOT_IN_libc || IS_IN (libpthread) # if LLL_LOCK_INITIALIZER == 0 # define __libc_lock_define_initialized(CLASS,NAME) \ CLASS __libc_lock_t NAME; @@ -130,7 +130,7 @@ typedef pthread_key_t __libc_key_t; - + /* Initialize the named lock variable, leaving it in a consistent, unlocked state. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread @@ -249,7 +249,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h # define __libc_lock_fini(NAME) \ @@ -163,7 +163,7 @@ typedef pthread_key_t __libc_key_t; #endif - + /* Lock the named lock variable. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread +#if !defined NOT_IN_libc || IS_IN (libpthread) @@ -258,7 +258,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h ({ lll_lock (NAME, LLL_PRIVATE); 0; }) @@ -179,7 +179,7 @@ typedef pthread_key_t __libc_key_t; __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0) - + /* Try to lock the named lock variable. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread +#if !defined NOT_IN_libc || IS_IN (libpthread) @@ -267,7 +267,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/bits/libc-lockP.h lll_trylock (NAME) @@ -198,7 +198,7 @@ typedef pthread_key_t __libc_key_t; __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0) - + /* Unlock the named lock variable. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread +#if !defined NOT_IN_libc || IS_IN (libpthread) @@ -281,16 +281,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -81,7 +81,7 @@ ENTRY (name); \ # define UNDOCARGS_5 UNDOCARGS_3; ldp x3, x4, [sp, 32] # define UNDOCARGS_6 UNDOCARGS_4; ldp x4, x5, [sp, 40] - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE bl __pthread_enable_asynccancel @@ -299,7 +299,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-can @@ -96,7 +96,7 @@ ENTRY (name); \ # error Unsupported library # endif - + -# if defined IS_IN_libpthread || !defined NOT_IN_libc +# if IS_IN (libpthread) || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -325,16 +325,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel. @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + /* NOTE: We do mark syscalls with unwind annotations, for the benefit of cancellation; but they're really only accurate at the point of the @@ -186,7 +186,7 @@ # define RESTORE_LR_6 \ RESTORE_LR_0 - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE bl PLTJMP(__pthread_enable_asynccancel) @@ -343,7 +343,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel. @@ -201,7 +201,7 @@ # error Unsupported library # endif - + -# if defined IS_IN_libpthread || !defined NOT_IN_libc +# if IS_IN (libpthread) || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -356,16 +356,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -108,7 +108,7 @@ # define _POPCARGS_6 _POPCARGS_5; popl %ebp; \ - cfi_adjust_cfa_offset (-4); cfi_restore (ebp); - + cfi_adjust_cfa_offset (-4); cfi_restore (ebp); + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE call __pthread_enable_asynccancel; @@ -377,7 +377,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -36,7 +36,7 @@ #define SYS_ify(syscall_name) __NR_##syscall_name - + #if defined USE_DL_SYSINFO \ - && (!defined NOT_IN_libc || defined IS_IN_libpthread) + && (!defined NOT_IN_libc || IS_IN (libpthread)) @@ -390,12 +390,12 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h @@ -27,7 +27,7 @@ INLINE_SYSCALL (open, 2, (const char *) (name), (flags)) - + /* Uncancelable openat. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) extern int __openat_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; + mode_t mode) attribute_hidden; extern int __openat64_nocancel (int fd, const char *fname, int oflag, Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h =================================================================== @@ -404,16 +404,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -81,7 +81,7 @@ # define DOCARGS_6 stw 8,40(1); DOCARGS_5 # define UNDOCARGS_6 lwz 8,40(1); UNDOCARGS_5 - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE bl __pthread_enable_asynccancel@local @@ -426,16 +426,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # ifdef HAVE_ASM_GLOBAL_DOT_NAME # define DASHDASHPFX(str) .__##str @@ -99,7 +99,7 @@ # define DOCARGS_6 std 8,CANCEL_PARM_SAVE+40(1); DOCARGS_5 # define UNDOCARGS_6 ld 8,CANCEL_PARM_SAVE+40(1); UNDOCARGS_5 - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # ifdef SHARED @@ -448,16 +448,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -75,7 +75,7 @@ L(pseudo_check): \ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ L(pseudo_end): - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE __pthread_enable_asynccancel @@ -470,16 +470,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -69,7 +69,7 @@ L(pseudo_check): \ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ L(pseudo_end): - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE __pthread_enable_asynccancel @@ -487,8 +487,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-canc # define __local_multiple_threads __pthread_multiple_threads @@ -111,7 +111,7 @@ L(pseudo_end): #define LR7_6 lg %r7,56+160(%r15); \ - cfi_restore (%r7); - + cfi_restore (%r7); + -# if defined IS_IN_libpthread || !defined NOT_IN_libc +# if IS_IN (libpthread) || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -501,7 +501,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S @@ -21,7 +21,7 @@ #include #include "lowlevellock.h" - + -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) # ifdef SHARED @@ -514,16 +514,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + /* The code to disable cancellation depends on the fact that the called functions are special. They don't modify registers other than %rax @@ -59,7 +59,7 @@ jae SYSCALL_ERROR_LABEL - - + + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE call __pthread_enable_asynccancel; @@ -532,7 +532,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -74,7 +74,7 @@ # error Unsupported library # endif - + -# if defined IS_IN_libpthread || !defined NOT_IN_libc +# if IS_IN (libpthread) || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -543,9 +543,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) extern int __open_nocancel (const char *, int, ...) attribute_hidden; @@ -556,8 +556,8 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c @@ -35,7 +35,7 @@ __lll_lock_wait_private (int *futex) - - + + /* These functions don't get included in libc.so */ -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) @@ -571,16 +571,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # define _IMM12 #-12 # define _IMM16 #-16 @@ -105,7 +105,7 @@ # define LOAD_ARGS_5 LOAD_ARGS_4 # define LOAD_ARGS_6 LOAD_ARGS_5 - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define __local_enable_asynccancel __pthread_enable_asynccancel @@ -591,8 +591,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevello --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c @@ -37,7 +37,7 @@ __lll_lock_wait_private (int *futex) - - + + /* These functions don't get included in libc.so */ -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) @@ -606,16 +606,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -68,7 +68,7 @@ __##syscall_name##_nocancel: \ - restore %g0, %l1, %o0; - - + restore %g0, %l1, %o0; + + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE call __pthread_enable_asynccancel @@ -628,16 +628,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -66,7 +66,7 @@ __##syscall_name##_nocancel: \ 2: jmpl %i7 + 8, %g0; \ - restore %g0, %l1, %o0; - + restore %g0, %l1, %o0; + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE call __pthread_enable_asynccancel @@ -650,16 +650,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cance @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END besides "ret". */ @@ -105,7 +105,7 @@ __LABEL($multi_error) \ # define LOAD_ARGS_5 LOAD_ARGS_4; ldq a4, 40(sp) # define LOAD_ARGS_6 LOAD_ARGS_5; ldq a5, 48(sp) - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define __local_enable_asynccancel __pthread_enable_asynccancel @@ -668,7 +668,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cance @@ -128,7 +128,7 @@ __LABEL($multi_error) \ # define CDISABLE jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp) # endif - + -# if defined IS_IN_libpthread || !defined NOT_IN_libc +# if IS_IN (libpthread) || !defined NOT_IN_libc # ifndef __ASSEMBLER__ @@ -681,23 +681,23 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -79,7 +79,7 @@ # define LOAD_ARGS_5 LOAD_ARGS_4 # define LOAD_ARGS_6 LOAD_ARGS_5 - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE call __pthread_enable_asynccancel,[],0; # define CDISABLE call __pthread_disable_asynccancel,[],0; # elif IS_IN (librt) @@ -105,7 +105,7 @@ - + #if !defined NOT_IN_libc # define __local_multiple_threads __libc_multiple_threads -#elif defined IS_IN_libpthread @@ -706,7 +706,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde #else # define __local_multiple_threads __librt_multiple_threads @@ -118,7 +118,7 @@ - p_header.data.multiple_threads) == 0, 1) + p_header.data.multiple_threads) == 0, 1) # else extern int __local_multiple_threads -# if !defined NOT_IN_libc || defined IS_IN_libpthread @@ -716,20 +716,20 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde ; @@ -130,7 +130,7 @@ extern int __local_multiple_threads # define SINGLE_THREAD_P \ - mov (+__local_multiple_threads),d0; \ - cmp 0,d0 + mov (+__local_multiple_threads),d0; \ + cmp 0,d0 -# elif !defined NOT_IN_libc || defined IS_IN_libpthread +# elif !defined NOT_IN_libc || IS_IN (libpthread) # define SINGLE_THREAD_P \ - movm [a2],(sp); \ + movm [a2],(sp); \ 1: mov pc,a2; \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c @@ -85,7 +85,7 @@ __lll_timedlock_wait (lll_lock_t *futex, - - + + /* These don't get included in libc.so */ -#ifdef IS_IN_libpthread +#if IS_IN (libpthread) @@ -743,25 +743,25 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # ifndef NO_ERROR # define NO_ERROR -0x1000 @@ -204,7 +204,7 @@ L(pre_end): ASM_LINE_SEP \ # define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP \ - .cfi_restore 21 ASM_LINE_SEP - + .cfi_restore 21 ASM_LINE_SEP + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # ifdef PIC # define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP + bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP @@ -244,7 +244,7 @@ L(pre_end): ASM_LINE_SEP \ # error Unsupported library # endif - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define __local_multiple_threads __pthread_multiple_threads @@ -769,11 +769,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel # define __local_multiple_threads __libc_multiple_threads @@ -271,7 +271,7 @@ L(pre_end): ASM_LINE_SEP \ # define NO_CANCELLATION 1 - + #endif -/* !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) */ +/* !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) */ - + #ifndef __ASSEMBLER__ # define RTLD_SINGLE_THREAD_P \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel.h @@ -783,16 +783,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO - + @@ -160,7 +160,7 @@ __GC_##name: \ # undef PSEUDO_END # define PSEUDO_END(name) .endp - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE br.call.sptk.many b0 = __pthread_enable_asynccancel @@ -805,16 +805,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -100,7 +100,7 @@ # define PSEUDO_JMP(sym) jbsr sym # endif - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel) @@ -827,16 +827,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep @@ -27,7 +27,7 @@ happen before any instructions. So we use cfi_same_value instead of cfi_restore. */ - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + #ifdef __PIC__ # undef PSEUDO @@ -146,7 +146,7 @@ # define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE) # define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE) - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9 @@ -849,16 +849,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + # ifdef __PIC__ # define PSEUDO_CPLOAD .cpload t9; @@ -152,7 +152,7 @@ # define PSEUDO_JMP(sym) jal sym; # endif - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel) @@ -871,16 +871,16 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + /* Allow hacking in some extra code if desired. */ #ifndef PSEUDO_EXTRA @@ -117,7 +117,7 @@ - + # define STKSPACE (13 * REGSIZE) - + -# ifdef IS_IN_libpthread +# if IS_IN (libpthread) # define CENABLE jal __pthread_enable_asynccancel @@ -896,7 +896,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) +#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) - + /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */ #define PSEUDO_EXTRA move r3, zero; Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/sysdep.h diff --git a/SOURCES/glibc-rh1256317-7.patch b/SOURCES/glibc-rh1256317-7.patch index c2896d21..ef5ceac5 100644 --- a/SOURCES/glibc-rh1256317-7.patch +++ b/SOURCES/glibc-rh1256317-7.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 13:26:25 2014 +0530 Remove IS_IN_librt - + Replace with IS_IN (librt). Generated code unchanged on x86_64 - + * include/mqueue.h: Use IS_IN instead of IS_IN_librt. * nptl/pthreadP.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. @@ -37,7 +37,7 @@ Index: glibc-2.17-c758a686/include/mqueue.h +++ glibc-2.17-c758a686/include/mqueue.h @@ -1,6 +1,6 @@ #include - + -#ifdef IS_IN_librt +#if IS_IN (librt) hidden_proto (mq_timedsend) @@ -63,10 +63,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -89,7 +89,7 @@ ENTRY (name); \ @@ -85,10 +85,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel. @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + /* NOTE: We do mark syscalls with unwind annotations, for the benefit of cancellation; but they're really only accurate at the point of the @@ -194,7 +194,7 @@ @@ -107,10 +107,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -114,7 +114,7 @@ @@ -128,12 +128,12 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/not-cancel.h @@ -27,7 +27,7 @@ INLINE_SYSCALL (open, 2, (const char *) (name), (flags)) - + /* Uncancelable openat. */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) extern int __openat_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; + mode_t mode) attribute_hidden; extern int __openat64_nocancel (int fd, const char *fname, int oflag, Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h =================================================================== @@ -142,10 +142,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -87,7 +87,7 @@ @@ -164,10 +164,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # ifdef HAVE_ASM_GLOBAL_DOT_NAME # define DASHDASHPFX(str) .__##str @@ -115,7 +115,7 @@ @@ -186,10 +186,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -81,7 +81,7 @@ L(pseudo_end): @@ -208,10 +208,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-canc @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -77,7 +77,7 @@ L(pseudo_end): @@ -230,10 +230,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + /* The code to disable cancellation depends on the fact that the called functions are special. They don't modify registers other than %rax @@ -67,7 +67,7 @@ @@ -250,9 +250,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h @@ -19,7 +19,7 @@ - + #include - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) extern int __open_nocancel (const char *, int, ...) attribute_hidden; @@ -265,10 +265,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # define _IMM12 #-12 # define _IMM16 #-16 @@ -111,7 +111,7 @@ @@ -287,10 +287,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -74,7 +74,7 @@ __##syscall_name##_nocancel: \ @@ -309,10 +309,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-can @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -72,7 +72,7 @@ __##syscall_name##_nocancel: \ @@ -331,10 +331,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cance @@ -21,7 +21,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END besides "ret". */ @@ -113,7 +113,7 @@ __LABEL($multi_error) \ @@ -353,10 +353,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde @@ -23,7 +23,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -82,7 +82,7 @@ @@ -367,7 +367,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysde +# elif IS_IN (librt) # ifdef PIC # define CENABLE movm [a2],(sp); \ - 1: mov pc,a2; \ + 1: mov pc,a2; \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h @@ -375,21 +375,21 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # ifndef NO_ERROR # define NO_ERROR -0x1000 @@ -228,7 +228,7 @@ L(pre_end): ASM_LINE_SEP \ # define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ - bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP + bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP # endif -# elif defined IS_IN_librt +# elif IS_IN (librt) # ifdef PIC # define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ - bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP + bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP @@ -248,7 +248,7 @@ L(pre_end): ASM_LINE_SEP \ # define __local_multiple_threads __pthread_multiple_threads # elif !defined NOT_IN_libc @@ -401,11 +401,11 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel # error Unsupported library @@ -271,7 +271,7 @@ L(pre_end): ASM_LINE_SEP \ # define NO_CANCELLATION 1 - + #endif -/* !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt */ +/* !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) */ - + #ifndef __ASSEMBLER__ # define RTLD_SINGLE_THREAD_P \ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel.h @@ -415,12 +415,12 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO - + @@ -166,7 +166,7 @@ __GC_##name: \ # elif !defined NOT_IN_libc # define CENABLE br.call.sptk.many b0 = __libc_enable_asynccancel @@ -435,9 +435,9 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -62,7 +62,7 @@ - + #if defined USE_DL_SYSINFO \ - && (!defined NOT_IN_libc \ + && (!defined NOT_IN_libc \ - || IS_IN (libpthread) || defined IS_IN_librt) + || IS_IN (libpthread) || IS_IN (librt)) # define IA64_USE_NEW_STUB @@ -450,10 +450,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ @@ -106,7 +106,7 @@ @@ -472,10 +472,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep @@ -27,7 +27,7 @@ happen before any instructions. So we use cfi_same_value instead of cfi_restore. */ - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + #ifdef __PIC__ # undef PSEUDO @@ -149,7 +149,7 @@ @@ -494,10 +494,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + # ifdef __PIC__ # define PSEUDO_CPLOAD .cpload t9; @@ -155,7 +155,7 @@ @@ -516,10 +516,10 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel @@ -22,7 +22,7 @@ # include #endif - + -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + /* Allow hacking in some extra code if desired. */ #ifndef PSEUDO_EXTRA @@ -120,7 +120,7 @@ @@ -541,6 +541,6 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S */ -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) - + /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */ #define PSEUDO_EXTRA move r3, zero; diff --git a/SOURCES/glibc-rh1256317-8.patch b/SOURCES/glibc-rh1256317-8.patch index f6ba1f82..ed35874e 100644 --- a/SOURCES/glibc-rh1256317-8.patch +++ b/SOURCES/glibc-rh1256317-8.patch @@ -3,30 +3,30 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 13:17:21 2014 +0530 Remove IS_IN_libdl - + Replace with IS_IN (libdl). No changes to generated code on x86_64. - - * dlfcn/dladdr.c: Use IS_IN. - * dlfcn/dladdr1.c: Likewise. - * dlfcn/dlclose.c: Likewise. - * dlfcn/dlerror.c: Likewise. - * dlfcn/dlinfo.c: Likewise. - * dlfcn/dlmopen.c: Likewise. - * dlfcn/dlopen.c: Likewise. - * dlfcn/dlsym.c: Likewise. - * dlfcn/dlvsym.c: Likewise. + + * dlfcn/dladdr.c: Use IS_IN. + * dlfcn/dladdr1.c: Likewise. + * dlfcn/dlclose.c: Likewise. + * dlfcn/dlerror.c: Likewise. + * dlfcn/dlinfo.c: Likewise. + * dlfcn/dlmopen.c: Likewise. + * dlfcn/dlopen.c: Likewise. + * dlfcn/dlsym.c: Likewise. + * dlfcn/dlvsym.c: Likewise. Index: glibc-2.17-c758a686/dlfcn/dladdr.c =================================================================== --- glibc-2.17-c758a686.orig/dlfcn/dladdr.c +++ glibc-2.17-c758a686/dlfcn/dladdr.c @@ -19,7 +19,7 @@ - + #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + int dladdr (const void *address, Dl_info *info) Index: glibc-2.17-c758a686/dlfcn/dladdr1.c @@ -34,12 +34,12 @@ Index: glibc-2.17-c758a686/dlfcn/dladdr1.c --- glibc-2.17-c758a686.orig/dlfcn/dladdr1.c +++ glibc-2.17-c758a686/dlfcn/dladdr1.c @@ -18,7 +18,7 @@ - + #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + int dladdr1 (const void *address, Dl_info *info, void **extra, int flags) Index: glibc-2.17-c758a686/dlfcn/dlclose.c @@ -49,10 +49,10 @@ Index: glibc-2.17-c758a686/dlfcn/dlclose.c @@ -20,7 +20,7 @@ #include #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + int dlclose (void *handle) Index: glibc-2.17-c758a686/dlfcn/dlerror.c @@ -62,10 +62,10 @@ Index: glibc-2.17-c758a686/dlfcn/dlerror.c @@ -25,7 +25,7 @@ #include #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + char * dlerror (void) Index: glibc-2.17-c758a686/dlfcn/dlinfo.c @@ -75,10 +75,10 @@ Index: glibc-2.17-c758a686/dlfcn/dlinfo.c @@ -21,7 +21,7 @@ #include #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + int dlinfo (void *handle, int request, void *arg) Index: glibc-2.17-c758a686/dlfcn/dlmopen.c @@ -88,10 +88,10 @@ Index: glibc-2.17-c758a686/dlfcn/dlmopen.c @@ -23,7 +23,7 @@ #include #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + void * dlmopen (Lmid_t nsid, const char *file, int mode) Index: glibc-2.17-c758a686/dlfcn/dlopen.c @@ -101,10 +101,10 @@ Index: glibc-2.17-c758a686/dlfcn/dlopen.c @@ -22,7 +22,7 @@ #include #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + void * dlopen (const char *file, int mode) Index: glibc-2.17-c758a686/dlfcn/dlsym.c @@ -112,12 +112,12 @@ Index: glibc-2.17-c758a686/dlfcn/dlsym.c --- glibc-2.17-c758a686.orig/dlfcn/dlsym.c +++ glibc-2.17-c758a686/dlfcn/dlsym.c @@ -21,7 +21,7 @@ - + #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + void * dlsym (void *handle, const char *name) Index: glibc-2.17-c758a686/dlfcn/dlvsym.c @@ -125,11 +125,11 @@ Index: glibc-2.17-c758a686/dlfcn/dlvsym.c --- glibc-2.17-c758a686.orig/dlfcn/dlvsym.c +++ glibc-2.17-c758a686/dlfcn/dlvsym.c @@ -21,7 +21,7 @@ - + #include - + -#if !defined SHARED && defined IS_IN_libdl +#if !defined SHARED && IS_IN (libdl) - + void * weak_function diff --git a/SOURCES/glibc-rh1256317-9.patch b/SOURCES/glibc-rh1256317-9.patch index 79b181c5..548191a2 100644 --- a/SOURCES/glibc-rh1256317-9.patch +++ b/SOURCES/glibc-rh1256317-9.patch @@ -3,35 +3,35 @@ Author: Siddhesh Poyarekar Date: Thu Nov 20 13:12:02 2014 +0530 Remove IS_IN_nscd - + Replace with IS_IN (nscd). Generated code unchanged on x86_64. - - * include/ifaddrs.h: Use IS_IN. - * inet/check_pf.c: Likewise. - * sysdeps/unix/sysv/linux/check_pf.c: Likewise. - * nscd/Makefile (CPPFLAGS-nscd): Remove IS_IN_nscd. + + * include/ifaddrs.h: Use IS_IN. + * inet/check_pf.c: Likewise. + * sysdeps/unix/sysv/linux/check_pf.c: Likewise. + * nscd/Makefile (CPPFLAGS-nscd): Remove IS_IN_nscd. Index: glibc-2.17-c758a686/include/ifaddrs.h =================================================================== --- glibc-2.17-c758a686.orig/include/ifaddrs.h +++ glibc-2.17-c758a686/include/ifaddrs.h @@ -26,7 +26,7 @@ extern void __check_native (uint32_t a1_ - uint32_t a2_index, int *a2_native) + uint32_t a2_index, int *a2_native) attribute_hidden; - + -#ifdef IS_IN_nscd +#if IS_IN (nscd) extern uint32_t __bump_nl_timestamp (void) attribute_hidden; #endif - + Index: glibc-2.17-c758a686/inet/check_pf.c =================================================================== --- glibc-2.17-c758a686.orig/inet/check_pf.c +++ glibc-2.17-c758a686/inet/check_pf.c @@ -62,7 +62,7 @@ __free_in6ai (struct in6addrinfo *in6ai) } - - + + -#ifdef IS_IN_nscd +#if IS_IN (nscd) uint32_t @@ -44,10 +44,10 @@ Index: glibc-2.17-c758a686/nscd/Makefile @@ -79,7 +79,7 @@ CFLAGS-nscd_gethst_r.c = -fexceptions CFLAGS-nscd_getai.c = -fexceptions CFLAGS-nscd_initgroups.c = -fexceptions - + -CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1 +CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 -DNOT_IN_libc - + ifeq (yesyes,$(have-fpie)$(build-shared)) CFLAGS-nscd += $(pie-ccflag) Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/check_pf.c @@ -56,12 +56,12 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/check_pf.c +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/check_pf.c @@ -65,7 +65,7 @@ libc_freeres_ptr (static struct cached_d __libc_lock_define_initialized (static, lock); - - + + -#ifdef IS_IN_nscd +#if IS_IN (nscd) static uint32_t nl_timestamp; - + uint32_t @@ -81,7 +81,7 @@ __bump_nl_timestamp (void) static inline uint32_t diff --git a/SOURCES/glibc-rh1268008-1.patch b/SOURCES/glibc-rh1268008-1.patch index 04023c3a..720315d9 100644 --- a/SOURCES/glibc-rh1268008-1.patch +++ b/SOURCES/glibc-rh1268008-1.patch @@ -93,5 +93,6 @@ index b5af4e1..0000000 -dnl It is always possible to access static and hidden symbols in an -dnl position independent way. -AC_DEFINE(PI_STATIC_AND_HIDDEN) --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-10.patch b/SOURCES/glibc-rh1268008-10.patch index 7f7458e2..1f65fbd4 100644 --- a/SOURCES/glibc-rh1268008-10.patch +++ b/SOURCES/glibc-rh1268008-10.patch @@ -55,15 +55,15 @@ index 9b02bc7..09ab87f 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,8 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -string-bench-all := $(string-bench) +wcsmbs-bench := wcslen +string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod - + diff --git a/benchtests/bench-wcslen.c b/benchtests/bench-wcslen.c new file mode 100644 index 0000000..4e9d085 @@ -95,9 +95,9 @@ index 5c1efda..d682693 100644 --- a/string/strlen.c +++ b/string/strlen.c @@ -23,11 +23,14 @@ - + #undef strlen - + +#ifndef STRLEN +# define STRLEN strlen +#endif @@ -129,17 +129,17 @@ index c330904..e9639ef 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -18,6 +18,7 @@ - + #include #include +#include #include #include - + @@ -70,5 +71,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + #endif /* SHARED */ - + +#ifdef HAVE_S390_VX_ASM_SUPPORT + +# define IFUNC_VX_IMPL(FUNC) \ @@ -474,5 +474,6 @@ index 0000000..a7be73e +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-11.patch b/SOURCES/glibc-rh1268008-11.patch index a07939f8..6e9fa724 100644 --- a/SOURCES/glibc-rh1268008-11.patch +++ b/SOURCES/glibc-rh1268008-11.patch @@ -61,13 +61,13 @@ index 09ab87f..7bb2eef 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen +wcsmbs-bench := wcslen wcsnlen string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strnlen.c b/benchtests/bench-strnlen.c index 793f9be..cbdce75 100644 @@ -78,11 +78,11 @@ index 793f9be..cbdce75 100644 - Copyright (C) 2013 Free Software Foundation, Inc. + Copyright (C) 2013-2015 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 @@ -17,17 +17,36 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strnlen" +#ifndef WIDE @@ -91,7 +91,7 @@ index 793f9be..cbdce75 100644 +# define TEST_NAME "wcsnlen" +#endif /* WIDE */ #include "bench-string.h" - + -typedef size_t (*proto_t) (const char *, size_t); -size_t simple_strnlen (const char *, size_t); - @@ -117,16 +117,16 @@ index 793f9be..cbdce75 100644 + +IMPL (SIMPLE_STRNLEN, 0) +IMPL (STRNLEN, 1) - + size_t -simple_strnlen (const char *s, size_t maxlen) +SIMPLE_STRNLEN (const CHAR *s, size_t maxlen) { size_t i; - + @@ -36,7 +55,7 @@ simple_strnlen (const char *s, size_t maxlen) } - + static void -do_one_test (impl_t *impl, const char *s, size_t maxlen, size_t exp_len) +do_one_test (impl_t *impl, const CHAR *s, size_t maxlen, size_t exp_len) @@ -136,13 +136,13 @@ index 793f9be..cbdce75 100644 @@ -66,18 +85,20 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char) { size_t i; - + - align &= 7; - if (align + len >= page_size) + align &= 63; + if ((align + len) * sizeof (CHAR) >= page_size) return; - + + CHAR *buf = (CHAR *) (buf1); + for (i = 0; i < len; ++i) @@ -150,17 +150,17 @@ index 793f9be..cbdce75 100644 - buf1[align + len] = 0; + buf[align + i] = 1 + 7 * i % max_char; + buf[align + len] = 0; - + printf ("Length %4zd, alignment %2zd:", len, align); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) (buf1 + align), maxlen, MIN (len, maxlen)); + do_one_test (impl, (CHAR *) (buf + align), maxlen, MIN (len, maxlen)); - + putchar ('\n'); } @@ -96,34 +117,34 @@ test_main (void) - + for (i = 1; i < 8; ++i) { - do_test (0, i, i - 1, 127); @@ -170,7 +170,7 @@ index 793f9be..cbdce75 100644 + do_test (0, i, i, MIDDLE_CHAR); + do_test (0, i, i + 1, MIDDLE_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (i, i, i - 1, 127); @@ -180,7 +180,7 @@ index 793f9be..cbdce75 100644 + do_test (i, i, i, MIDDLE_CHAR); + do_test (i, i, i + 1, MIDDLE_CHAR); } - + for (i = 2; i <= 10; ++i) { - do_test (0, 1 << i, 5000, 127); @@ -188,15 +188,15 @@ index 793f9be..cbdce75 100644 + do_test (0, 1 << i, 5000, MIDDLE_CHAR); + do_test (1, 1 << i, 5000, MIDDLE_CHAR); } - + for (i = 1; i < 8; ++i) - do_test (0, i, 5000, 255); + do_test (0, i, 5000, BIG_CHAR); - + for (i = 1; i < 8; ++i) - do_test (i, i, 5000, 255); + do_test (i, i, 5000, BIG_CHAR); - + for (i = 2; i <= 10; ++i) { - do_test (0, 1 << i, 5000, 255); @@ -204,7 +204,7 @@ index 793f9be..cbdce75 100644 + do_test (0, 1 << i, 5000, BIG_CHAR); + do_test (1, 1 << i, 5000, BIG_CHAR); } - + return ret; diff --git a/benchtests/bench-wcsnlen.c b/benchtests/bench-wcsnlen.c new file mode 100644 @@ -242,10 +242,10 @@ index ae959bf..43db896 100644 + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek , 1999. - + @@ -18,17 +18,36 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strnlen" +#ifndef WIDE @@ -254,7 +254,7 @@ index ae959bf..43db896 100644 +# define TEST_NAME "wcsnlen" +#endif /* !WIDE */ #include "test-string.h" - + -typedef size_t (*proto_t) (const char *, size_t); -size_t simple_strnlen (const char *, size_t); - @@ -280,16 +280,16 @@ index ae959bf..43db896 100644 + +IMPL (SIMPLE_STRNLEN, 0) +IMPL (STRNLEN, 1) - + size_t -simple_strnlen (const char *s, size_t maxlen) +SIMPLE_STRNLEN (const CHAR *s, size_t maxlen) { size_t i; - + @@ -37,7 +56,7 @@ simple_strnlen (const char *s, size_t maxlen) } - + static void -do_one_test (impl_t *impl, const char *s, size_t maxlen, size_t exp_len) +do_one_test (impl_t *impl, const CHAR *s, size_t maxlen, size_t exp_len) @@ -299,13 +299,13 @@ index ae959bf..43db896 100644 @@ -54,23 +73,25 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char) { size_t i; - + - align &= 7; - if (align + len >= page_size) + align &= 63; + if ((align + len) * sizeof (CHAR) >= page_size) return; - + + CHAR *buf = (CHAR *) (buf1); + for (i = 0; i < len; ++i) @@ -313,55 +313,55 @@ index ae959bf..43db896 100644 - buf1[align + len] = 0; + buf[align + i] = 1 + 7 * i % max_char; + buf[align + len] = 0; - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) (buf1 + align), maxlen, MIN (len, maxlen)); + do_one_test (impl, (CHAR *) (buf + align), maxlen, MIN (len, maxlen)); } - + static void do_random_tests (void) { size_t i, j, n, align, len; - unsigned char *p = buf1 + page_size - 512; + CHAR *p = (CHAR *) (buf1 + page_size - 512 * sizeof (CHAR)); - + for (n = 0; n < ITERATIONS; n++) { @@ -97,25 +118,25 @@ do_random_tests (void) FOR_EACH_IMPL (impl, 1) - { - if (len > 0 + { + if (len > 0 - && CALL (impl, (char *) (p + align), len - 1) != len - 1) + && CALL (impl, (CHAR *) (p + align), len - 1) != len - 1) - { - error (0, 0, "Iteration %zd (limited) - wrong result in function %s (%zd) %zd != %zd, p %p", - n, impl->name, align, + { + error (0, 0, "Iteration %zd (limited) - wrong result in function %s (%zd) %zd != %zd, p %p", + n, impl->name, align, - CALL (impl, (char *) (p + align), len - 1), len - 1, p); + CALL (impl, (CHAR *) (p + align), len - 1), len - 1, p); - ret = 1; - } + ret = 1; + } - if (CALL (impl, (char *) (p + align), len) != len) + if (CALL (impl, (CHAR *) (p + align), len) != len) - { - error (0, 0, "Iteration %zd (exact) - wrong result in function %s (%zd) %zd != %zd, p %p", - n, impl->name, align, + { + error (0, 0, "Iteration %zd (exact) - wrong result in function %s (%zd) %zd != %zd, p %p", + n, impl->name, align, - CALL (impl, (char *) (p + align), len), len, p); + CALL (impl, (CHAR *) (p + align), len), len, p); - ret = 1; - } + ret = 1; + } - if (CALL (impl, (char *) (p + align), len + 1) != len) + if (CALL (impl, (CHAR *) (p + align), len + 1) != len) - { - error (0, 0, "Iteration %zd (long) - wrong result in function %s (%zd) %zd != %zd, p %p", - n, impl->name, align, + { + error (0, 0, "Iteration %zd (long) - wrong result in function %s (%zd) %zd != %zd, p %p", + n, impl->name, align, - CALL (impl, (char *) (p + align), len + 1), len, p); + CALL (impl, (CHAR *) (p + align), len + 1), len, p); - ret = 1; - } - } + ret = 1; + } + } @@ -136,34 +157,34 @@ test_main (void) - + for (i = 1; i < 8; ++i) { - do_test (0, i, i - 1, 127); @@ -371,7 +371,7 @@ index ae959bf..43db896 100644 + do_test (0, i, i, MIDDLE_CHAR); + do_test (0, i, i + 1, MIDDLE_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (i, i, i - 1, 127); @@ -381,7 +381,7 @@ index ae959bf..43db896 100644 + do_test (i, i, i, MIDDLE_CHAR); + do_test (i, i, i + 1, MIDDLE_CHAR); } - + for (i = 2; i <= 10; ++i) { - do_test (0, 1 << i, 5000, 127); @@ -389,15 +389,15 @@ index ae959bf..43db896 100644 + do_test (0, 1 << i, 5000, MIDDLE_CHAR); + do_test (1, 1 << i, 5000, MIDDLE_CHAR); } - + for (i = 1; i < 8; ++i) - do_test (0, i, 5000, 255); + do_test (0, i, 5000, BIG_CHAR); - + for (i = 1; i < 8; ++i) - do_test (i, i, 5000, 255); + do_test (i, i, 5000, BIG_CHAR); - + for (i = 2; i <= 10; ++i) { - do_test (0, 1 << i, 5000, 255); @@ -405,7 +405,7 @@ index ae959bf..43db896 100644 + do_test (0, 1 << i, 5000, BIG_CHAR); + do_test (1, 1 << i, 5000, BIG_CHAR); } - + do_random_tests (); diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 3a98098..3397f24 100644 @@ -417,7 +417,7 @@ index 3a98098..3397f24 100644 +sysdep_routines += strlen strlen-vx strlen-c \ + strnlen strnlen-vx strnlen-c endif - + ifeq ($(subdir),wcsmbs) -sysdep_routines += wcslen wcslen-vx wcslen-c +sysdep_routines += wcslen wcslen-vx wcslen-c \ @@ -430,12 +430,12 @@ index e9639ef..bc17c59 100644 @@ -82,6 +82,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strlen); IFUNC_VX_IMPL (wcslen); - + + IFUNC_VX_IMPL (strnlen); + IFUNC_VX_IMPL (wcsnlen); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strnlen-c.c b/sysdeps/s390/multiarch/strnlen-c.c new file mode 100644 @@ -873,14 +873,14 @@ index 54994e2..ec0b050 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -41,7 +41,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - isoc99_swscanf isoc99_vswscanf \ - mbrtoc16 c16rtomb - + isoc99_swscanf isoc99_vswscanf \ + mbrtoc16 c16rtomb + -strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy +strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcsnlen-ifunc.c b/wcsmbs/test-wcsnlen-ifunc.c new file mode 100644 index 0000000..8aa528e @@ -938,24 +938,25 @@ index dff1b45..e803920 100644 --- a/wcsmbs/wcsnlen.c +++ b/wcsmbs/wcsnlen.c @@ -18,8 +18,11 @@ - + #include - + +#ifdef WCSNLEN +# define __wcsnlen WCSNLEN +#endif - + -/* Copy SRC to DEST. */ +/* Return length of string S at most maxlen. */ size_t __wcsnlen (s, maxlen) const wchar_t *s; @@ -44,4 +47,6 @@ __wcsnlen (s, maxlen) - + return len; } +#ifndef WCSNLEN weak_alias (__wcsnlen, wcsnlen) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-12.patch b/SOURCES/glibc-rh1268008-12.patch index e33973ef..893d4b7d 100644 --- a/SOURCES/glibc-rh1268008-12.patch +++ b/SOURCES/glibc-rh1268008-12.patch @@ -51,13 +51,13 @@ index 7bb2eef..1dda844 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen +wcsmbs-bench := wcslen wcsnlen wcscpy string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-wcscpy.c b/benchtests/bench-wcscpy.c new file mode 100644 @@ -96,7 +96,7 @@ index 3397f24..e2202b7 100644 + strnlen strnlen-vx strnlen-c \ + strcpy strcpy-vx endif - + ifeq ($(subdir),wcsmbs) sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsnlen wcsnlen-vx wcsnlen-c @@ -110,12 +110,12 @@ index bc17c59..c9228d6 100644 @@ -85,6 +85,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strnlen); IFUNC_VX_IMPL (wcsnlen); - + + IFUNC_VX_IMPL (strcpy); + IFUNC_VX_IMPL (wcscpy); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strcpy-vx.S b/sysdeps/s390/multiarch/strcpy-vx.S new file mode 100644 @@ -497,5 +497,6 @@ index 0000000..b02c392 +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/strcpy.S will be used. */ +#include --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-13.patch b/SOURCES/glibc-rh1268008-13.patch index 5e7b4784..34e6a6cf 100644 --- a/SOURCES/glibc-rh1268008-13.patch +++ b/SOURCES/glibc-rh1268008-13.patch @@ -63,20 +63,20 @@ index 1dda844..1b491c6 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-stpcpy.c b/benchtests/bench-stpcpy.c index 0645298..f950c92 100644 --- a/benchtests/bench-stpcpy.c +++ b/benchtests/bench-stpcpy.c @@ -18,19 +18,34 @@ - + #define STRCPY_RESULT(dst, len) ((dst) + (len)) #define TEST_MAIN -#define TEST_NAME "stpcpy" @@ -116,7 +116,7 @@ index 0645298..f950c92 100644 while ((*dst++ = *src++) != '\0'); return dst - 1; } - + +#undef CHAR #include "bench-strcpy.c" diff --git a/benchtests/bench-wcpcpy.c b/benchtests/bench-wcpcpy.c @@ -152,7 +152,7 @@ index b0a83ba..69d150f 100644 @@ -28,6 +28,12 @@ # define __stpcpy stpcpy #endif - + +#ifdef STPCPY +extern __typeof (__stpcpy) STPCPY; +# undef __stpcpy @@ -167,7 +167,7 @@ index 6a7af0c..962e5d6 100644 --- a/string/test-stpcpy.c +++ b/string/test-stpcpy.c @@ -19,19 +19,34 @@ - + #define STRCPY_RESULT(dst, len) ((dst) + (len)) #define TEST_MAIN -#define TEST_NAME "stpcpy" @@ -207,7 +207,7 @@ index 6a7af0c..962e5d6 100644 while ((*dst++ = *src++) != '\0'); return dst - 1; } - + +#undef CHAR #include "test-strcpy.c" diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile @@ -217,15 +217,15 @@ index e2202b7..5b57342 100644 @@ -1,11 +1,13 @@ ifeq ($(subdir),string) sysdep_routines += strlen strlen-vx strlen-c \ - strnlen strnlen-vx strnlen-c \ + strnlen strnlen-vx strnlen-c \ - strcpy strcpy-vx + strcpy strcpy-vx \ + stpcpy stpcpy-vx stpcpy-c endif - + ifeq ($(subdir),wcsmbs) sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsnlen wcsnlen-vx wcsnlen-c \ + wcsnlen wcsnlen-vx wcsnlen-c \ - wcscpy wcscpy-vx wcscpy-c + wcscpy wcscpy-vx wcscpy-c \ + wcpcpy wcpcpy-vx wcpcpy-c @@ -237,12 +237,12 @@ index c9228d6..a402301 100644 @@ -88,6 +88,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strcpy); IFUNC_VX_IMPL (wcscpy); - + + IFUNC_VX_IMPL (stpcpy); + IFUNC_VX_IMPL (wcpcpy); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/stpcpy-c.c b/sysdeps/s390/multiarch/stpcpy-c.c new file mode 100644 @@ -619,15 +619,15 @@ index ec0b050..3b91b6d 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -41,7 +41,8 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - isoc99_swscanf isoc99_vswscanf \ - mbrtoc16 c16rtomb - + isoc99_swscanf isoc99_vswscanf \ + mbrtoc16 c16rtomb + -strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen +strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ + wcpcpy tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcpcpy-ifunc.c b/wcsmbs/test-wcpcpy-ifunc.c new file mode 100644 index 0000000..aa39062 @@ -687,7 +687,7 @@ index eaaab2c..f67ba62 100644 @@ -21,7 +21,9 @@ #define __need_ptrdiff_t #include - + - +#ifdef WCPCPY +# define __wcpcpy WCPCPY @@ -698,9 +698,10 @@ index eaaab2c..f67ba62 100644 @@ -43,4 +45,6 @@ __wcpcpy (dest, src) return wcp; } - + +#ifndef WCPCPY weak_alias (__wcpcpy, wcpcpy) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-14.patch b/SOURCES/glibc-rh1268008-14.patch index 2bdc1995..89e9f67f 100644 --- a/SOURCES/glibc-rh1268008-14.patch +++ b/SOURCES/glibc-rh1268008-14.patch @@ -64,13 +64,13 @@ index 1b491c6..f898258 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strncpy.c b/benchtests/bench-strncpy.c index 645925b..2cfd56a 100644 @@ -81,12 +81,12 @@ index 645925b..2cfd56a 100644 - Copyright (C) 2013 Free Software Foundation, Inc. + Copyright (C) 2013-2015 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 @@ -16,23 +16,56 @@ License along with the GNU C Library; if not, see . */ - + +#ifdef WIDE +# include +# define CHAR wchar_t @@ -116,7 +116,7 @@ index 645925b..2cfd56a 100644 +# define TEST_NAME "wcsncpy" +# endif /* WIDE */ # include "bench-string.h" - + -char *simple_strncpy (char *, const char *, size_t); -char *stupid_strncpy (char *, const char *, size_t); - @@ -154,7 +154,7 @@ index 645925b..2cfd56a 100644 @@ -43,10 +76,10 @@ simple_strncpy (char *dst, const char *src, size_t n) return ret; } - + -char * -stupid_strncpy (char *dst, const char *src, size_t n) +CHAR * @@ -163,7 +163,7 @@ index 645925b..2cfd56a 100644 - size_t nc = strnlen (src, n); + size_t nc = STRNLEN (src, n); size_t i; - + for (i = 0; i < nc; ++i) @@ -55,12 +88,12 @@ stupid_strncpy (char *dst, const char *src, size_t n) dst[i] = '\0'; @@ -171,10 +171,10 @@ index 645925b..2cfd56a 100644 } -#endif +#endif /* !STRNCPY_RESULT */ - + -typedef char *(*proto_t) (char *, const char *, size_t); +typedef CHAR *(*proto_t) (CHAR *, const CHAR *, size_t); - + static void -do_one_test (impl_t *impl, char *dst, const char *src, size_t len, size_t n) +do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t len, size_t n) @@ -184,7 +184,7 @@ index 645925b..2cfd56a 100644 @@ -73,7 +106,7 @@ do_one_test (impl_t *impl, char *dst, const char *src, size_t len, size_t n) return; } - + - if (memcmp (dst, src, len > n ? n : len) != 0) + if (memcmp (dst, src, (len > n ? n : len) * sizeof (CHAR)) != 0) { @@ -196,22 +196,22 @@ index 645925b..2cfd56a 100644 size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + align1 &= 7; - if (align1 + len >= page_size) + if ((align1 + len) * sizeof (CHAR) >= page_size) return; - + align2 &= 7; - if (align2 + len >= page_size) + if ((align2 + len) * sizeof (CHAR) >= page_size) return; - + - s1 = (char *) (buf1 + align1); - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1 + align1); + s2 = (CHAR *) (buf2 + align2); - + for (i = 0; i < len; ++i) s1[i] = 32 + 23 * i % (max_char - 32); s1[len] = 0; @@ -219,10 +219,10 @@ index 645925b..2cfd56a 100644 + for (i = len + 1; (i + align1) * sizeof (CHAR) < page_size && i < len + 64; + ++i) s1[i] = 32 + 32 * i % (max_char - 32); - + printf ("Length %4zd, n %4zd, alignment %2zd/%2zd:", len, n, align1, align2); @@ -150,22 +184,22 @@ test_main (void) - + for (i = 1; i < 8; ++i) { - do_test (i, i, 16, 16, 127); @@ -242,7 +242,7 @@ index 645925b..2cfd56a 100644 + do_test (8 - i, 2 * i, 1 << i, 2 << i, BIG_CHAR); + do_test (2 * i, 8 - i, 2 << i, 1 << i, BIG_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (0, 0, 4 << i, 8 << i, 127); @@ -254,7 +254,7 @@ index 645925b..2cfd56a 100644 + do_test (8 - i, 2 * i, 4 << i, 8 << i, SMALL_CHAR); + do_test (8 - i, 2 * i, 16 << i, 8 << i, SMALL_CHAR); } - + return ret; diff --git a/benchtests/bench-wcsncpy.c b/benchtests/bench-wcsncpy.c new file mode 100644 @@ -289,7 +289,7 @@ index a623093..bdccc98 100644 @@ -17,23 +17,56 @@ License along with the GNU C Library; if not, see . */ - + +#ifdef WIDE +# include +# define CHAR wchar_t @@ -329,19 +329,19 @@ index a623093..bdccc98 100644 +# define STUPID_STRNCPY stupid_wcsncpy +# define STRNCPY wcsncpy +# endif /* WIDE */ - + -char *simple_strncpy (char *, const char *, size_t); -char *stupid_strncpy (char *, const char *, size_t); +CHAR *SIMPLE_STRNCPY (CHAR *, const CHAR *, size_t); +CHAR *STUPID_STRNCPY (CHAR *, const CHAR *, size_t); - + -IMPL (stupid_strncpy, 0) -IMPL (simple_strncpy, 0) -IMPL (strncpy, 1) +IMPL (STUPID_STRNCPY, 0) +IMPL (SIMPLE_STRNCPY, 0) +IMPL (STRNCPY, 1) - + -char * -simple_strncpy (char *dst, const char *src, size_t n) +CHAR * @@ -355,7 +355,7 @@ index a623093..bdccc98 100644 @@ -44,10 +77,10 @@ simple_strncpy (char *dst, const char *src, size_t n) return ret; } - + -char * -stupid_strncpy (char *dst, const char *src, size_t n) +CHAR * @@ -364,7 +364,7 @@ index a623093..bdccc98 100644 - size_t nc = strnlen (src, n); + size_t nc = STRNLEN (src, n); size_t i; - + for (i = 0; i < nc; ++i) @@ -56,12 +89,12 @@ stupid_strncpy (char *dst, const char *src, size_t n) dst[i] = '\0'; @@ -372,10 +372,10 @@ index a623093..bdccc98 100644 } -#endif +#endif /* !STRNCPY_RESULT */ - + -typedef char *(*proto_t) (char *, const char *, size_t); +typedef CHAR *(*proto_t) (CHAR *, const CHAR *, size_t); - + static void -do_one_test (impl_t *impl, char *dst, const char *src, size_t len, size_t n) +do_one_test (impl_t *impl, CHAR *dst, const char *src, size_t len, size_t n) @@ -385,7 +385,7 @@ index a623093..bdccc98 100644 @@ -71,7 +104,7 @@ do_one_test (impl_t *impl, char *dst, const char *src, size_t len, size_t n) return; } - + - if (memcmp (dst, src, len > n ? n : len) != 0) + if (memcmp (dst, src, (len > n ? n : len) * sizeof (CHAR)) != 0) { @@ -397,24 +397,24 @@ index a623093..bdccc98 100644 size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + +/* For wcsncpy: align1 and align2 here mean alignment not in bytes, + but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t)). */ align1 &= 7; - if (align1 + len >= page_size) + if ((align1 + len) * sizeof (CHAR) >= page_size) return; - + align2 &= 7; - if (align2 + len >= page_size) + if ((align2 + len) * sizeof (CHAR) >= page_size) return; - + - s1 = (char *) (buf1 + align1); - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1) + align1; + s2 = (CHAR *) (buf2) + align2; - + for (i = 0; i < len; ++i) s1[i] = 32 + 23 * i % (max_char - 32); s1[len] = 0; @@ -422,7 +422,7 @@ index a623093..bdccc98 100644 + for (i = len + 1; (i + align1) * sizeof (CHAR) < page_size && i < len + 64; + ++i) s1[i] = 32 + 32 * i % (max_char - 32); - + FOR_EACH_IMPL (impl, 0) @@ -123,12 +159,16 @@ static void do_random_tests (void) @@ -434,7 +434,7 @@ index a623093..bdccc98 100644 + UCHAR *p1 = (UCHAR *) (buf1 + page_size) - 512; + UCHAR *p2 = (UCHAR *) (buf2 + page_size) - 512; + UCHAR *res; - + for (n = 0; n < ITERATIONS; n++) { + /* For wcsncpy: align1 and align2 here mean align not in bytes, @@ -443,30 +443,30 @@ index a623093..bdccc98 100644 + mode = random (); if (mode & 1) - { + { @@ -166,7 +206,7 @@ do_random_tests (void) - { - size = random () & 511; - if (size + j > 512) + { + size = random () & 511; + if (size + j > 512) - size = 512 - j - (random() & 31); + size = 512 - j - (random () & 31); - } - else - size = 512 - j; + } + else + size = 512 - j; @@ -182,18 +222,17 @@ do_random_tests (void) - p1[i] = 0; - else - { + p1[i] = 0; + else + { - p1[i] = random () & 255; + p1[i] = random () & BIG_CHAR; - if (i >= align1 && i < len + align1 && !p1[i]) + if (i >= align1 && i < len + align1 && !p1[i]) - p1[i] = (random () & 127) + 3; + p1[i] = (random () & SMALL_CHAR) + 3; - } - } - + } + } + FOR_EACH_IMPL (impl, 1) - { + { - memset (p2 - 64, '\1', 512 + 64); - res = (unsigned char *) CALL (impl, - (char *) (p2 + align2), @@ -474,20 +474,20 @@ index a623093..bdccc98 100644 + MEMSET (p2 - 64, '\1', 512 + 64); + res = (UCHAR *) CALL (impl, (CHAR *) (p2 + align2), + (CHAR *) (p1 + align1), size); - if (res != STRNCPY_RESULT (p2 + align2, len, size)) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", + if (res != STRNCPY_RESULT (p2 + align2, len, size)) + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", @@ -235,7 +274,7 @@ do_random_tests (void) - j = len + 1; - if (size < j) - j = size; + j = len + 1; + if (size < j) + j = size; - if (memcmp (p1 + align1, p2 + align2, j)) + if (MEMCMP (p1 + align1, p2 + align2, j)) - { - error (0, 0, "Iteration %zd - different strings, %s (%zd, %zd, %zd)", - n, impl->name, align1, align2, len); + { + error (0, 0, "Iteration %zd - different strings, %s (%zd, %zd, %zd)", + n, impl->name, align1, align2, len); @@ -259,22 +298,22 @@ test_main (void) - + for (i = 1; i < 8; ++i) { - do_test (i, i, 16, 16, 127); @@ -507,7 +507,7 @@ index a623093..bdccc98 100644 + do_test (8 - i, 2 * i, 1 << i, 2 << i, BIG_CHAR); + do_test (2 * i, 8 - i, 2 << i, 1 << i, BIG_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (0, 0, 4 << i, 8 << i, 127); @@ -519,7 +519,7 @@ index a623093..bdccc98 100644 + do_test (8 - i, 2 * i, 4 << i, 8 << i, SMALL_CHAR); + do_test (8 - i, 2 * i, 16 << i, 8 << i, SMALL_CHAR); } - + do_random_tests (); diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 5b57342..0dff2dc 100644 @@ -527,17 +527,17 @@ index 5b57342..0dff2dc 100644 +++ b/sysdeps/s390/multiarch/Makefile @@ -2,12 +2,14 @@ ifeq ($(subdir),string) sysdep_routines += strlen strlen-vx strlen-c \ - strnlen strnlen-vx strnlen-c \ - strcpy strcpy-vx \ + strnlen strnlen-vx strnlen-c \ + strcpy strcpy-vx \ - stpcpy stpcpy-vx stpcpy-c + stpcpy stpcpy-vx stpcpy-c \ + strncpy strncpy-vx endif - + ifeq ($(subdir),wcsmbs) sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsnlen wcsnlen-vx wcsnlen-c \ - wcscpy wcscpy-vx wcscpy-c \ + wcsnlen wcsnlen-vx wcsnlen-c \ + wcscpy wcscpy-vx wcscpy-c \ - wcpcpy wcpcpy-vx wcpcpy-c + wcpcpy wcpcpy-vx wcpcpy-c \ + wcsncpy wcsncpy-vx wcsncpy-c @@ -549,12 +549,12 @@ index a402301..940421d 100644 @@ -91,6 +91,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (stpcpy); IFUNC_VX_IMPL (wcpcpy); - + + IFUNC_VX_IMPL (strncpy); + IFUNC_VX_IMPL (wcsncpy); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strncpy-vx.S b/sysdeps/s390/multiarch/strncpy-vx.S new file mode 100644 @@ -1152,14 +1152,14 @@ index 3b91b6d..c26ab0c 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy + wcpcpy wcsncpy tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcsncpy-ifunc.c b/wcsmbs/test-wcsncpy-ifunc.c new file mode 100644 index 0000000..0141b38 @@ -1217,21 +1217,22 @@ index f134c36..2e3cebe 100644 --- a/wcsmbs/wcsncpy.c +++ b/wcsmbs/wcsncpy.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCSNCPY +# define __wcsncpy WCSNCPY +#endif - + /* Copy no more than N wide-characters of SRC to DEST. */ wchar_t * @@ -83,4 +86,6 @@ __wcsncpy (dest, src, n) - + return s; } +#ifndef WCSNCPY weak_alias (__wcsncpy, wcsncpy) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-15.patch b/SOURCES/glibc-rh1268008-15.patch index dadd5835..70454f98 100644 --- a/SOURCES/glibc-rh1268008-15.patch +++ b/SOURCES/glibc-rh1268008-15.patch @@ -61,20 +61,20 @@ index f898258..dfab95f 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-stpncpy.c b/benchtests/bench-stpncpy.c index 65ed800..e428102 100644 --- a/benchtests/bench-stpncpy.c +++ b/benchtests/bench-stpncpy.c @@ -18,18 +18,36 @@ - + #define STRNCPY_RESULT(dst, len, n) ((dst) + ((len) > (n) ? (n) : (len))) #define TEST_MAIN -#define TEST_NAME "stpncpy" @@ -98,19 +98,19 @@ index 65ed800..e428102 100644 +# define STPNCPY wcpncpy +# define STRNLEN wcsnlen +#endif /* WIDE */ - + -char *simple_stpncpy (char *, const char *, size_t); -char *stupid_stpncpy (char *, const char *, size_t); +CHAR *SIMPLE_STPNCPY (CHAR *, const CHAR *, size_t); +CHAR *STUPID_STPNCPY (CHAR *, const CHAR *, size_t); - + -IMPL (stupid_stpncpy, 0) -IMPL (simple_stpncpy, 0) -IMPL (stpncpy, 1) +IMPL (STUPID_STPNCPY, 0) +IMPL (SIMPLE_STPNCPY, 0) +IMPL (STPNCPY, 1) - + -char * -simple_stpncpy (char *dst, const char *src, size_t n) +CHAR * @@ -121,7 +121,7 @@ index 65ed800..e428102 100644 @@ -43,10 +61,10 @@ simple_stpncpy (char *dst, const char *src, size_t n) return dst; } - + -char * -stupid_stpncpy (char *dst, const char *src, size_t n) +CHAR * @@ -130,7 +130,7 @@ index 65ed800..e428102 100644 - size_t nc = strnlen (src, n); + size_t nc = STRNLEN (src, n); size_t i; - + for (i = 0; i < nc; ++i) diff --git a/benchtests/bench-wcpncpy.c b/benchtests/bench-wcpncpy.c new file mode 100644 @@ -163,7 +163,7 @@ index 8647299..69c8181 100644 --- a/string/test-stpncpy.c +++ b/string/test-stpncpy.c @@ -19,18 +19,36 @@ - + #define STRNCPY_RESULT(dst, len, n) ((dst) + ((len) > (n) ? (n) : (len))) #define TEST_MAIN -#define TEST_NAME "stpncpy" @@ -187,19 +187,19 @@ index 8647299..69c8181 100644 +# define STPNCPY wcpncpy +# define STRNLEN wcsnlen +#endif /* WIDE */ - + -char *simple_stpncpy (char *, const char *, size_t); -char *stupid_stpncpy (char *, const char *, size_t); +CHAR *SIMPLE_STPNCPY (CHAR *, const CHAR *, size_t); +CHAR *STUPID_STPNCPY (CHAR *, const CHAR *, size_t); - + -IMPL (stupid_stpncpy, 0) -IMPL (simple_stpncpy, 0) -IMPL (stpncpy, 1) +IMPL (STUPID_STPNCPY, 0) +IMPL (SIMPLE_STPNCPY, 0) +IMPL (STPNCPY, 1) - + -char * -simple_stpncpy (char *dst, const char *src, size_t n) +CHAR * @@ -210,7 +210,7 @@ index 8647299..69c8181 100644 @@ -44,10 +62,10 @@ simple_stpncpy (char *dst, const char *src, size_t n) return dst; } - + -char * -stupid_stpncpy (char *dst, const char *src, size_t n) +CHAR * @@ -219,26 +219,26 @@ index 8647299..69c8181 100644 - size_t nc = strnlen (src, n); + size_t nc = STRNLEN (src, n); size_t i; - + for (i = 0; i < nc; ++i) diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 0dff2dc..98b588f 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -3,7 +3,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strnlen strnlen-vx strnlen-c \ - strcpy strcpy-vx \ - stpcpy stpcpy-vx stpcpy-c \ + strnlen strnlen-vx strnlen-c \ + strcpy strcpy-vx \ + stpcpy stpcpy-vx stpcpy-c \ - strncpy strncpy-vx + strncpy strncpy-vx \ + stpncpy stpncpy-vx stpncpy-c endif - + ifeq ($(subdir),wcsmbs) @@ -11,5 +12,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsnlen wcsnlen-vx wcsnlen-c \ - wcscpy wcscpy-vx wcscpy-c \ - wcpcpy wcpcpy-vx wcpcpy-c \ + wcsnlen wcsnlen-vx wcsnlen-c \ + wcscpy wcscpy-vx wcscpy-c \ + wcpcpy wcpcpy-vx wcpcpy-c \ - wcsncpy wcsncpy-vx wcsncpy-c + wcsncpy wcsncpy-vx wcsncpy-c \ + wcpncpy wcpncpy-vx wcpncpy-c @@ -250,12 +250,12 @@ index 940421d..ca69983 100644 @@ -94,6 +94,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strncpy); IFUNC_VX_IMPL (wcsncpy); - + + IFUNC_VX_IMPL (stpncpy); + IFUNC_VX_IMPL (wcpncpy); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/stpncpy-c.c b/sysdeps/s390/multiarch/stpncpy-c.c new file mode 100644 @@ -829,14 +829,14 @@ index c26ab0c..89b5b3b 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy + wcpcpy wcsncpy wcpncpy tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcpncpy-ifunc.c b/wcsmbs/test-wcpncpy-ifunc.c new file mode 100644 index 0000000..0685487 @@ -894,21 +894,22 @@ index 2fab857..6337a87 100644 --- a/wcsmbs/wcpncpy.c +++ b/wcsmbs/wcpncpy.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCPNCPY +# define __wcpncpy WCPNCPY +#endif - + /* Copy no more than N wide-characters of SRC to DEST, returning the address of the last character written into DEST. */ @@ -82,4 +85,6 @@ __wcpncpy (dest, src, n) return dest - 1; } - + +#ifndef WCPNCPY weak_alias (__wcpncpy, wcpncpy) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-16.patch b/SOURCES/glibc-rh1268008-16.patch index 51de403c..350acf48 100644 --- a/SOURCES/glibc-rh1268008-16.patch +++ b/SOURCES/glibc-rh1268008-16.patch @@ -63,13 +63,13 @@ index dfab95f..91db23c 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strcat.c b/benchtests/bench-strcat.c index 6602009..1abf6d3 100644 @@ -80,11 +80,11 @@ index 6602009..1abf6d3 100644 - Copyright (C) 2013 Free Software Foundation, Inc. + Copyright (C) 2013-2015 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 @@ -17,19 +17,45 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strcat" +#ifndef WIDE @@ -93,7 +93,7 @@ index 6602009..1abf6d3 100644 +# define TEST_NAME "wcscat" +#endif /* WIDE */ #include "bench-string.h" - + -typedef char *(*proto_t) (char *, const char *); -char *simple_strcat (char *, const char *); - @@ -140,7 +140,7 @@ index 6602009..1abf6d3 100644 while ((*dst++ = *src++) != '\0'); @@ -37,9 +63,9 @@ simple_strcat (char *dst, const char *src) } - + static void -do_one_test (impl_t *impl, char *dst, const char *src) +do_one_test (impl_t *impl, CHAR *dst, const CHAR *src) @@ -148,18 +148,18 @@ index 6602009..1abf6d3 100644 - size_t k = strlen (dst), i, iters = INNER_LOOP_ITERS; + size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; - + if (CALL (impl, dst, src) != dst) @@ -50,9 +76,9 @@ do_one_test (impl_t *impl, char *dst, const char *src) return; } - + - if (strcmp (dst + k, src) != 0) + if (STRCMP (dst + k, src) != 0) { - error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"", + error (0, 0, "Wrong result in function %s dst \"%" sfmt "\" src \"%" sfmt "\"", - impl->name, dst, src); + impl->name, dst, src); ret = 1; return; @@ -75,18 +101,18 @@ static void @@ -168,26 +168,26 @@ index 6602009..1abf6d3 100644 size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + align1 &= 7; - if (align1 + len1 >= page_size) + if ((align1 + len1) * sizeof (CHAR) >= page_size) return; - + align2 &= 7; - if (align2 + len1 + len2 >= page_size) + if ((align2 + len1 + len2) * sizeof (CHAR) >= page_size) return; - + - s1 = (char *) (buf1 + align1); - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1) + align1; + s2 = (CHAR *) (buf2) + align2; - + for (i = 0; i < len1; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -120,26 +146,26 @@ test_main (void) - + for (i = 0; i < 16; ++i) { - do_test (0, 0, i, i, 127); @@ -199,7 +199,7 @@ index 6602009..1abf6d3 100644 + do_test (0, i, i, i, SMALL_CHAR); + do_test (i, 0, i, i, BIG_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (0, 0, 8 << i, 8 << i, 127); @@ -211,7 +211,7 @@ index 6602009..1abf6d3 100644 + do_test (0, 0, 8 << i, 2 << i, SMALL_CHAR); + do_test (8 - i, 2 * i, 8 << i, 2 << i, SMALL_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (i, 2 * i, 8 << i, 1, 127); @@ -223,7 +223,7 @@ index 6602009..1abf6d3 100644 + do_test (i, i, 8 << i, 10, SMALL_CHAR); + do_test (i, i, 8 << i, 10, BIG_CHAR); } - + return ret; diff --git a/benchtests/bench-wcscat.c b/benchtests/bench-wcscat.c new file mode 100644 @@ -256,9 +256,9 @@ index f9e4bc6..017bb41 100644 --- a/string/strcat.c +++ b/string/strcat.c @@ -20,11 +20,13 @@ - + #undef strcat - + +#ifndef STRCAT +# define STRCAT strcat +#endif @@ -278,7 +278,7 @@ index 2dc189a..a822733 100644 +++ b/string/test-strcat.c @@ -18,19 +18,52 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strcat" +#ifndef WIDE @@ -287,7 +287,7 @@ index 2dc189a..a822733 100644 +# define TEST_NAME "wcscat" +#endif /* WIDE */ #include "test-string.h" - + -typedef char *(*proto_t) (char *, const char *); -char *simple_strcat (char *, const char *); +#ifndef WIDE @@ -318,12 +318,12 @@ index 2dc189a..a822733 100644 +# define BIG_CHAR WCHAR_MAX +# define SMALL_CHAR 1273 +#endif /* WIDE */ - + -IMPL (simple_strcat, 0) -IMPL (strcat, 1) +typedef CHAR *(*proto_t) (CHAR *, const CHAR *); +CHAR *SIMPLE_STRCAT (CHAR *, const CHAR *); - + -char * -simple_strcat (char *dst, const char *src) +IMPL (SIMPLE_STRCAT, 0) @@ -339,7 +339,7 @@ index 2dc189a..a822733 100644 while ((*dst++ = *src++) != '\0'); @@ -38,9 +71,9 @@ simple_strcat (char *dst, const char *src) } - + static void -do_one_test (impl_t *impl, char *dst, const char *src) +do_one_test (impl_t *impl, CHAR *dst, const char *src) @@ -352,13 +352,13 @@ index 2dc189a..a822733 100644 @@ -49,9 +82,9 @@ do_one_test (impl_t *impl, char *dst, const char *src) return; } - + - if (strcmp (dst + k, src) != 0) + if (STRCMP (dst + k, src) != 0) { - error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"", + error (0, 0, "Wrong result in function %s dst \"%" sfmt "\" src \"%" sfmt "\"", - impl->name, dst, src); + impl->name, dst, src); ret = 1; return; @@ -62,18 +95,18 @@ static void @@ -367,22 +367,22 @@ index 2dc189a..a822733 100644 size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + align1 &= 7; - if (align1 + len1 >= page_size) + if ((align1 + len1) * sizeof (CHAR) >= page_size) return; - + align2 &= 7; - if (align2 + len1 + len2 >= page_size) + if ((align2 + len1 + len2) * sizeof (CHAR) >= page_size) return; - + - s1 = (char *) (buf1 + align1); - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1) + align1; + s2 = (CHAR *) (buf2) + align2; - + for (i = 0; i < len1; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -93,9 +126,10 @@ static void @@ -396,34 +396,34 @@ index 2dc189a..a822733 100644 + UCHAR *p2 = (UCHAR *) (buf2 + page_size) - 512; + UCHAR *p3 = (UCHAR *) buf1; + UCHAR *res; - + for (n = 0; n < ITERATIONS; n++) { @@ -132,26 +166,26 @@ do_random_tests (void) - p1[i] = 0; - else - { + p1[i] = 0; + else + { - p1[i] = random () & 255; + p1[i] = random () & BIG_CHAR; - if (i >= align1 && i < len1 + align1 && !p1[i]) + if (i >= align1 && i < len1 + align1 && !p1[i]) - p1[i] = (random () & 127) + 3; + p1[i] = (random () & SMALL_CHAR) + 3; - } - } + } + } for (i = 0; i < len2; i++) - { + { - buf1[i] = random () & 255; - if (!buf1[i]) - buf1[i] = (random () & 127) + 3; + p3[i] = random () & BIG_CHAR; + if (!p3[i]) + p3[i] = (random () & SMALL_CHAR) + 3; - } + } - buf1[len2] = 0; + p3[len2] = 0; - + FOR_EACH_IMPL (impl, 1) - { + { - memset (p2 - 64, '\1', align2 + 64); - memset (p2 + align2 + len2 + 1, '\1', 512 - align2 - len2 - 1); - memcpy (p2 + align2, buf1, len2 + 1); @@ -434,29 +434,29 @@ index 2dc189a..a822733 100644 + MEMCPY (p2 + align2, p3, len2 + 1); + res = (UCHAR *) CALL (impl, (CHAR *) (p2 + align2), + (CHAR *) (p1 + align1)); - if (res != p2 + align2) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd %zd) %p != %p", + if (res != p2 + align2) + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd %zd) %p != %p", @@ -169,7 +203,7 @@ do_random_tests (void) - break; - } - } + break; + } + } - if (memcmp (p2 + align2, buf1, len2)) + if (MEMCMP (p2 + align2, p3, len2)) - { - error (0, 0, "Iteration %zd - garbage in string before, %s (%zd, %zd, %zd, %zd)", - n, impl->name, align1, align2, len1, len2); + { + error (0, 0, "Iteration %zd - garbage in string before, %s (%zd, %zd, %zd, %zd)", + n, impl->name, align1, align2, len1, len2); @@ -185,7 +219,7 @@ do_random_tests (void) - break; - } - } + break; + } + } - if (memcmp (p1 + align1, p2 + align2 + len2, len1 + 1)) + if (MEMCMP (p1 + align1, p2 + align2 + len2, len1 + 1)) - { - error (0, 0, "Iteration %zd - different strings, %s (%zd, %zd, %zd, %zd)", - n, impl->name, align1, align2, len1, len2); + { + error (0, 0, "Iteration %zd - different strings, %s (%zd, %zd, %zd, %zd)", + n, impl->name, align1, align2, len1, len2); @@ -209,26 +243,26 @@ test_main (void) - + for (i = 0; i < 16; ++i) { - do_test (0, 0, i, i, 127); @@ -468,7 +468,7 @@ index 2dc189a..a822733 100644 + do_test (0, i, i, i, SMALL_CHAR); + do_test (i, 0, i, i, BIG_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (0, 0, 8 << i, 8 << i, 127); @@ -480,7 +480,7 @@ index 2dc189a..a822733 100644 + do_test (0, 0, 8 << i, 2 << i, SMALL_CHAR); + do_test (8 - i, 2 * i, 8 << i, 2 << i, SMALL_CHAR); } - + for (i = 1; i < 8; ++i) { - do_test (i, 2 * i, 8 << i, 1, 127); @@ -492,26 +492,26 @@ index 2dc189a..a822733 100644 + do_test (i, i, 8 << i, 10, SMALL_CHAR); + do_test (i, i, 8 << i, 10, BIG_CHAR); } - + do_random_tests (); diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 98b588f..6283999 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -4,7 +4,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strcpy strcpy-vx \ - stpcpy stpcpy-vx stpcpy-c \ - strncpy strncpy-vx \ + strcpy strcpy-vx \ + stpcpy stpcpy-vx stpcpy-c \ + strncpy strncpy-vx \ - stpncpy stpncpy-vx stpncpy-c + stpncpy stpncpy-vx stpncpy-c \ + strcat strcat-vx strcat-c endif - + ifeq ($(subdir),wcsmbs) @@ -13,5 +14,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcscpy wcscpy-vx wcscpy-c \ - wcpcpy wcpcpy-vx wcpcpy-c \ - wcsncpy wcsncpy-vx wcsncpy-c \ + wcscpy wcscpy-vx wcscpy-c \ + wcpcpy wcpcpy-vx wcpcpy-c \ + wcsncpy wcsncpy-vx wcsncpy-c \ - wcpncpy wcpncpy-vx wcpncpy-c + wcpncpy wcpncpy-vx wcpncpy-c \ + wcscat wcscat-vx wcscat-c @@ -523,12 +523,12 @@ index ca69983..ccf4dea 100644 @@ -97,6 +97,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (stpncpy); IFUNC_VX_IMPL (wcpncpy); - + + IFUNC_VX_IMPL (strcat); + IFUNC_VX_IMPL (wcscat); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strcat-c.c b/sysdeps/s390/multiarch/strcat-c.c new file mode 100644 @@ -1015,14 +1015,14 @@ index 89b5b3b..9bfc78c 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy + wcpcpy wcsncpy wcpncpy wcscat tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcscat-ifunc.c b/wcsmbs/test-wcscat-ifunc.c new file mode 100644 index 0000000..53305c6 @@ -1080,21 +1080,22 @@ index 0d34d76..4eb2d93 100644 --- a/wcsmbs/wcscat.c +++ b/wcsmbs/wcscat.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCSCAT +# define __wcscat WCSCAT +#endif - + /* Append SRC on the end of DEST. */ wchar_t * @@ -47,4 +50,6 @@ __wcscat (dest, src) - + return dest; } +#ifndef WCSCAT weak_alias (__wcscat, wcscat) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-17.patch b/SOURCES/glibc-rh1268008-17.patch index 6e11297c..6379a132 100644 --- a/SOURCES/glibc-rh1268008-17.patch +++ b/SOURCES/glibc-rh1268008-17.patch @@ -61,13 +61,13 @@ index 91db23c..fd8b7ee 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strncat.c b/benchtests/bench-strncat.c index 2a17817..8f3339d 100644 @@ -78,11 +78,11 @@ index 2a17817..8f3339d 100644 - Copyright (C) 2013 Free Software Foundation, Inc. + Copyright (C) 2013-2015 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 @@ -17,33 +17,58 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strncat" +#ifndef WIDE @@ -91,7 +91,7 @@ index 2a17817..8f3339d 100644 +# define TEST_NAME "wcsncat" +#endif /* WIDE */ #include "bench-string.h" - + -typedef char *(*proto_t) (char *, const char *, size_t); -char *stupid_strncat (char *, const char *, size_t); -char *simple_strncat (char *, const char *, size_t); @@ -143,7 +143,7 @@ index 2a17817..8f3339d 100644 *dst = '\0'; return ret; } - + static void -do_one_test (impl_t *impl, char *dst, const char *src, size_t n) +do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t n) @@ -151,12 +151,12 @@ index 2a17817..8f3339d 100644 - size_t k = strlen (dst), i, iters = INNER_LOOP_ITERS; + size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; - + if (CALL (impl, dst, src, n) != dst) @@ -54,10 +79,10 @@ do_one_test (impl_t *impl, char *dst, const char *src, size_t n) return; } - + - size_t len = strlen (src); - if (memcmp (dst + k, src, len + 1 > n ? n : len + 1) != 0) + size_t len = STRLEN (src); @@ -164,16 +164,16 @@ index 2a17817..8f3339d 100644 { - error (0, 0, "Incorrect cancatination in function %s", + error (0, 0, "Incorrect concatenation in function %s", - impl->name); + impl->name); ret = 1; return; @@ -88,20 +113,20 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, - size_t n, int max_char) + size_t n, int max_char) { size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + align1 &= 7; - if (align1 + len1 >= page_size) + if ((align1 + len1) * sizeof (CHAR) >= page_size) @@ -192,11 +192,11 @@ index 2a17817..8f3339d 100644 - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1) + align1; + s2 = (CHAR *) (buf2) + align2; - + for (i = 0; i < len1; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -136,25 +161,25 @@ main (void) - + for (n = 2; n <= 2048; n*=4) { - do_test (0, 2, 2, 2, n, 127); @@ -209,9 +209,9 @@ index 2a17817..8f3339d 100644 + do_test (4, 0, 4, 4, n, BIG_CHAR); + do_test (0, 0, 8, 8, n, SMALL_CHAR); + do_test (0, 8, 8, 8, n, SMALL_CHAR); - + for (i = 1; i < 8; ++i) - { + { - do_test (0, 0, 8 << i, 8 << i, n, 127); - do_test (8 - i, 2 * i, 8 << i, 8 << i, n, 127); - do_test (0, 0, 8 << i, 2 << i, n, 127); @@ -220,19 +220,19 @@ index 2a17817..8f3339d 100644 + do_test (8 - i, 2 * i, 8 << i, 8 << i, n, SMALL_CHAR); + do_test (0, 0, 8 << i, 2 << i, n, SMALL_CHAR); + do_test (8 - i, 2 * i, 8 << i, 2 << i, n, SMALL_CHAR); - } - + } + for (i = 1; i < 8; ++i) - { + { - do_test (i, 2 * i, 8 << i, 1, n, 127); - do_test (2 * i, i, 8 << i, 1, n, 255); - do_test (i, i, 8 << i, 10, n, 127); + do_test (i, 2 * i, 8 << i, 1, n, SMALL_CHAR); + do_test (2 * i, i, 8 << i, 1, n, BIG_CHAR); + do_test (i, i, 8 << i, 10, n, SMALL_CHAR); - } + } } - + diff --git a/benchtests/bench-wcsncat.c b/benchtests/bench-wcsncat.c new file mode 100644 index 0000000..b9d7c3f @@ -265,7 +265,7 @@ index 2bfe25f..790d8aa 100644 +++ b/string/test-strncat.c @@ -17,33 +17,64 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strncat" +#ifndef WIDE @@ -274,7 +274,7 @@ index 2bfe25f..790d8aa 100644 +# define TEST_NAME "wcsncat" +#endif /* WIDE */ #include "test-string.h" - + -typedef char *(*proto_t) (char *, const char *, size_t); -char *stupid_strncat (char *, const char *, size_t); -char *simple_strncat (char *, const char *, size_t); @@ -304,13 +304,13 @@ index 2bfe25f..790d8aa 100644 +# define BIG_CHAR WCHAR_MAX +# define SMALL_CHAR 1273 +#endif /* WIDE */ - + -IMPL (stupid_strncat, 0) -IMPL (strncat, 2) +typedef CHAR *(*proto_t) (CHAR *, const CHAR *, size_t); +CHAR *STUPID_STRNCAT (CHAR *, const CHAR *, size_t); +CHAR *SIMPLE_STRNCAT (CHAR *, const CHAR *, size_t); - + -char * -stupid_strncat (char *dst, const char *src, size_t n) +IMPL (STUPID_STRNCAT, 0) @@ -330,7 +330,7 @@ index 2bfe25f..790d8aa 100644 *dst = '\0'; return ret; } - + static void -do_one_test (impl_t *impl, char *dst, const char *src, size_t n) +do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t n) @@ -343,7 +343,7 @@ index 2bfe25f..790d8aa 100644 @@ -52,10 +83,10 @@ do_one_test (impl_t *impl, char *dst, const char *src, size_t n) return; } - + - size_t len = strlen (src); - if (memcmp (dst + k, src, len + 1 > n ? n : len + 1) != 0) + size_t len = STRLEN (src); @@ -351,16 +351,16 @@ index 2bfe25f..790d8aa 100644 { - error (0, 0, "Incorrect cancatination in function %s", + error (0, 0, "Incorrect concatenation in function %s", - impl->name); + impl->name); ret = 1; return; @@ -74,20 +105,20 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, - size_t n, int max_char) + size_t n, int max_char) { size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + align1 &= 7; - if (align1 + len1 >= page_size) + if ((align1 + len1) * sizeof (CHAR) >= page_size) @@ -379,7 +379,7 @@ index 2bfe25f..790d8aa 100644 - s2 = (char *) (buf2 + align2); + s1 = (CHAR *) (buf1) + align1; + s2 = (CHAR *) (buf2) + align2; - + for (i = 0; i < len1; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -107,9 +138,10 @@ static void @@ -394,33 +394,33 @@ index 2bfe25f..790d8aa 100644 + UCHAR *p3 = (UCHAR *) buf1; + UCHAR *res; fprintf (stdout, "Number of iterations in random test = %zd\n", - ITERATIONS); + ITERATIONS); for (n = 0; n < ITERATIONS; n++) @@ -148,26 +180,26 @@ do_random_tests (void) - p1[i] = 0; - else - { + p1[i] = 0; + else + { - p1[i] = random () & 255; + p1[i] = random () & BIG_CHAR; - if (i >= align1 && i < len1 + align1 && !p1[i]) + if (i >= align1 && i < len1 + align1 && !p1[i]) - p1[i] = (random () & 127) + 3; + p1[i] = (random () & SMALL_CHAR) + 3; - } - } + } + } for (i = 0; i < len2; i++) - { + { - buf1[i] = random () & 255; - if (!buf1[i]) - buf1[i] = (random () & 127) + 3; + p3[i] = random () & BIG_CHAR; + if (!p3[i]) + p3[i] = (random () & SMALL_CHAR) + 3; - } + } - buf1[len2] = 0; + p3[len2] = 0; - + FOR_EACH_IMPL (impl, 1) - { + { - memset (p2 - 64, '\1', align2 + 64); - memset (p2 + align2 + len2 + 1, '\1', 512 - align2 - len2 - 1); - memcpy (p2 + align2, buf1, len2 + 1); @@ -431,29 +431,29 @@ index 2bfe25f..790d8aa 100644 + MEMCPY (p2 + align2, p3, len2 + 1); + res = (UCHAR *) CALL (impl, (CHAR *) (p2 + align2), + (CHAR *) (p1 + align1), N); - if (res != p2 + align2) - { - error (0, 0, "Iteration %zd - wrong result in function %s " + if (res != p2 + align2) + { + error (0, 0, "Iteration %zd - wrong result in function %s " @@ -187,7 +219,7 @@ do_random_tests (void) - break; - } - } + break; + } + } - if (memcmp (p2 + align2, buf1, len2)) + if (MEMCMP (p2 + align2, p3, len2)) - { - error (0, 0, "Iteration %zd - garbage in string before, %s " - "(%zd, %zd, %zd, %zd, %zd)", + { + error (0, 0, "Iteration %zd - garbage in string before, %s " + "(%zd, %zd, %zd, %zd, %zd)", @@ -220,7 +252,7 @@ do_random_tests (void) - ret = 1; - } - } + ret = 1; + } + } - if (memcmp (p1 + align1, p2 + align2 + len2, + if (MEMCMP (p1 + align1, p2 + align2 + len2, - (len1 + 1) > N ? N : len1 + 1)) - { - error (0, 0, "Iteration %zd - different strings, %s " + (len1 + 1) > N ? N : len1 + 1)) + { + error (0, 0, "Iteration %zd - different strings, %s " @@ -246,25 +278,25 @@ main (void) - + for (n = 2; n <= 2048; n*=4) { - do_test (0, 2, 2, 2, n, 127); @@ -466,9 +466,9 @@ index 2bfe25f..790d8aa 100644 + do_test (4, 0, 4, 4, n, BIG_CHAR); + do_test (0, 0, 8, 8, n, SMALL_CHAR); + do_test (0, 8, 8, 8, n, SMALL_CHAR); - + for (i = 1; i < 8; ++i) - { + { - do_test (0, 0, 8 << i, 8 << i, n, 127); - do_test (8 - i, 2 * i, 8 << i, 8 << i, n, 127); - do_test (0, 0, 8 << i, 2 << i, n, 127); @@ -477,37 +477,37 @@ index 2bfe25f..790d8aa 100644 + do_test (8 - i, 2 * i, 8 << i, 8 << i, n, SMALL_CHAR); + do_test (0, 0, 8 << i, 2 << i, n, SMALL_CHAR); + do_test (8 - i, 2 * i, 8 << i, 2 << i, n, SMALL_CHAR); - } - + } + for (i = 1; i < 8; ++i) - { + { - do_test (i, 2 * i, 8 << i, 1, n, 127); - do_test (2 * i, i, 8 << i, 1, n, 255); - do_test (i, i, 8 << i, 10, n, 127); + do_test (i, 2 * i, 8 << i, 1, n, SMALL_CHAR); + do_test (2 * i, i, 8 << i, 1, n, BIG_CHAR); + do_test (i, i, 8 << i, 10, n, SMALL_CHAR); - } + } } - + diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 6283999..33c1398 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -5,7 +5,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - stpcpy stpcpy-vx stpcpy-c \ - strncpy strncpy-vx \ - stpncpy stpncpy-vx stpncpy-c \ + stpcpy stpcpy-vx stpcpy-c \ + strncpy strncpy-vx \ + stpncpy stpncpy-vx stpncpy-c \ - strcat strcat-vx strcat-c + strcat strcat-vx strcat-c \ + strncat strncat-vx strncat-c endif - + ifeq ($(subdir),wcsmbs) @@ -15,5 +16,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcpcpy wcpcpy-vx wcpcpy-c \ - wcsncpy wcsncpy-vx wcsncpy-c \ - wcpncpy wcpncpy-vx wcpncpy-c \ + wcpcpy wcpcpy-vx wcpcpy-c \ + wcsncpy wcsncpy-vx wcsncpy-c \ + wcpncpy wcpncpy-vx wcpncpy-c \ - wcscat wcscat-vx wcscat-c + wcscat wcscat-vx wcscat-c \ + wcsncat wcsncat-vx wcsncat-c @@ -519,12 +519,12 @@ index ccf4dea..1e57c0e 100644 @@ -100,6 +100,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strcat); IFUNC_VX_IMPL (wcscat); - + + IFUNC_VX_IMPL (strncat); + IFUNC_VX_IMPL (wcsncat); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strncat-c.c b/sysdeps/s390/multiarch/strncat-c.c new file mode 100644 @@ -1173,14 +1173,14 @@ index 9bfc78c..44b1502 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat + wcpcpy wcsncpy wcpncpy wcscat wcsncat tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcsncat-ifunc.c b/wcsmbs/test-wcsncat-ifunc.c new file mode 100644 index 0000000..5497f7d @@ -1238,13 +1238,13 @@ index 2131466..21a3a1e 100644 --- a/wcsmbs/wcsncat.c +++ b/wcsmbs/wcsncat.c @@ -18,10 +18,13 @@ - + #include - + +#ifndef WCSNCAT +# define WCSNCAT wcsncat +#endif - + /* Append no more than N wide-character of SRC onto DEST. */ wchar_t * -wcsncat (dest, src, n) @@ -1252,5 +1252,6 @@ index 2131466..21a3a1e 100644 wchar_t *dest; const wchar_t *src; size_t n; --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-18.patch b/SOURCES/glibc-rh1268008-18.patch index 60cae143..0ff8f316 100644 --- a/SOURCES/glibc-rh1268008-18.patch +++ b/SOURCES/glibc-rh1268008-18.patch @@ -60,14 +60,14 @@ index fd8b7ee..f6333eb 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -38,7 +38,8 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strcat strchr strchrnul strcmp strcpy strcspn strlen \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strcat strchr strchrnul strcmp strcpy strcspn strlen \ + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok -wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat +wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ + wcsncmp string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-wcscmp.c b/benchtests/bench-wcscmp.c new file mode 100644 @@ -100,9 +100,9 @@ index 8229d7c..5384db9 100644 --- a/string/strcmp.c +++ b/string/strcmp.c @@ -20,11 +20,15 @@ - + #undef strcmp - + +#ifndef STRCMP +# define STRCMP strcmp +#endif @@ -123,7 +123,7 @@ index f3070f1..037aa71 100644 @@ -226,8 +226,8 @@ memchr (const void *__str, int __c, size_t __n) } #endif - + -/* Search N bytes of S for C. */ -#define _HAVE_STRING_ARCH_memchr 1 +/* Compare S1 and S2. */ @@ -136,19 +136,19 @@ index 33c1398..d8fbd55 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -6,7 +6,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strncpy strncpy-vx \ - stpncpy stpncpy-vx stpncpy-c \ - strcat strcat-vx strcat-c \ + strncpy strncpy-vx \ + stpncpy stpncpy-vx stpncpy-c \ + strcat strcat-vx strcat-c \ - strncat strncat-vx strncat-c + strncat strncat-vx strncat-c \ + strcmp strcmp-vx endif - + ifeq ($(subdir),wcsmbs) @@ -17,5 +18,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsncpy wcsncpy-vx wcsncpy-c \ - wcpncpy wcpncpy-vx wcpncpy-c \ - wcscat wcscat-vx wcscat-c \ + wcsncpy wcsncpy-vx wcsncpy-c \ + wcpncpy wcpncpy-vx wcpncpy-c \ + wcscat wcscat-vx wcscat-c \ - wcsncat wcsncat-vx wcsncat-c + wcsncat wcsncat-vx wcsncat-c \ + wcscmp wcscmp-vx wcscmp-c @@ -160,12 +160,12 @@ index 1e57c0e..196d3ec 100644 @@ -103,6 +103,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strncat); IFUNC_VX_IMPL (wcsncat); - + + IFUNC_VX_IMPL (strcmp); + IFUNC_VX_IMPL (wcscmp); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strcmp-vx.S b/sysdeps/s390/multiarch/strcmp-vx.S new file mode 100644 @@ -581,5 +581,6 @@ index 0000000..1598bbc +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/strcmp.S will be used. */ +#include --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-19.patch b/SOURCES/glibc-rh1268008-19.patch index bcf6c7fd..eb308c89 100644 --- a/SOURCES/glibc-rh1268008-19.patch +++ b/SOURCES/glibc-rh1268008-19.patch @@ -66,13 +66,13 @@ index f6333eb..f6342da 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp + wcsncmp wcsncmp string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strncmp.c b/benchtests/bench-strncmp.c index 25df3db..496ed68 100644 @@ -80,7 +80,7 @@ index 25df3db..496ed68 100644 +++ b/benchtests/bench-strncmp.c @@ -17,17 +17,66 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strncmp" +#ifdef WIDE @@ -89,7 +89,7 @@ index 25df3db..496ed68 100644 +# define TEST_NAME "strncmp" +#endif /* !WIDE */ #include "bench-string.h" - + -typedef int (*proto_t) (const char *, const char *, size_t); -int simple_strncmp (const char *, const char *, size_t); -int stupid_strncmp (const char *, const char *, size_t); @@ -117,7 +117,7 @@ index 25df3db..496ed68 100644 + } + return 0; +} - + -IMPL (stupid_strncmp, 0) -IMPL (simple_strncmp, 0) -IMPL (strncmp, 1) @@ -129,7 +129,7 @@ index 25df3db..496ed68 100644 + + n = ns1 < n ? ns1 : n; + n = ns2 < n ? ns2 : n; - + + while (n--) + { + c1 = *s1++; @@ -163,20 +163,20 @@ index 25df3db..496ed68 100644 +IMPL (STUPID_STRNCMP, 0) +IMPL (SIMPLE_STRNCMP, 0) +IMPL (STRNCMP, 1) - + static void -do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n, +do_one_test (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t n, - int exp_result) + int exp_result) { size_t i, iters = INNER_LOOP_ITERS; @@ -74,12 +130,12 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, - int exp_result) + int exp_result) { size_t i, align_n; - char *s1, *s2; + CHAR *s1, *s2; - + if (n == 0) { - s1 = (char*)(buf1 + page_size); @@ -184,69 +184,69 @@ index 25df3db..496ed68 100644 + s1 = (CHAR*)(buf1 + page_size); + s2 = (CHAR*)(buf2 + page_size); printf ("Length %4zd/%4zd:", len, n); - + FOR_EACH_IMPL (impl, 0) @@ -92,16 +148,16 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, - + align1 &= 15; align2 &= 15; - align_n = (page_size - n) & 15; + align_n = (page_size - n * CHARBYTES) & 15; - + - s1 = (char*)(buf1 + page_size - n); - s2 = (char*)(buf2 + page_size - n); + s1 = (CHAR*)(buf1 + page_size - n * CHARBYTES); + s2 = (CHAR*)(buf2 + page_size - n * CHARBYTES); - + if (align1 < align_n) - s1 -= (align_n - align1); + s1 = (CHAR *) ((char *) s1 - (align_n - align1)); - + if (align2 < align_n) - s2 -= (align_n - align2); + s2 = (CHAR *) ((char *) s2 - (align_n - align2)); - + for (i = 0; i < n; i++) s1[i] = s2[i] = 1 + 23 * i % max_char; @@ -129,24 +185,24 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, - int exp_result) + int exp_result) { size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + if (n == 0) return; - + - align1 &= 7; - if (align1 + n + 1 >= page_size) + align1 &= 63; + if (align1 + (n + 1) * CHARBYTES >= page_size) return; - + align2 &= 7; - if (align2 + n + 1 >= page_size) + if (align2 + (n + 1) * CHARBYTES >= page_size) return; - + - s1 = (char*)(buf1 + align1); - s2 = (char*)(buf2 + align2); + s1 = (CHAR*)(buf1 + align1); + s2 = (CHAR*)(buf2 + align2); - + for (i = 0; i < n; i++) - s1[i] = s2[i] = 1 + 23 * i % max_char; + s1[i] = s2[i] = 1 + (23 << ((CHARBYTES - 1) * 8)) * i % max_char; - + s1[n] = 24 + exp_result; s2[n] = 23; @@ -162,7 +218,7 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, printf ("Length %4zd/%4zd, alignment %2zd/%2zd:", len, n, align1, align2); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char*)s1, (char*)s2, n, exp_result); + do_one_test (impl, s1, s2, n, exp_result); - + putchar ('\n'); } diff --git a/benchtests/bench-wcsncmp.c b/benchtests/bench-wcsncmp.c @@ -282,21 +282,21 @@ index 167ce48..f468a8b 100644 @@ -33,7 +33,7 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, - { 0x0000,0x00D2,0x00D3,0x0000 }, 3 }, /* #06 */ + { 0x0000,0x00D2,0x00D3,0x0000 }, 3 }, /* #06 */ - /*expect*/ { 0,1,0x00D1, }, + /*expect*/ { 0,1,1, }, }, { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, - { 0x00D1,0x00D2,0x00D9,0x0000 }, 2 }, /* #07 */ + { 0x00D1,0x00D2,0x00D9,0x0000 }, 2 }, /* #07 */ @@ -41,11 +41,11 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, - { 0x00D1,0x00D2,0x00D9,0x0000 }, 3 }, /* #08 */ + { 0x00D1,0x00D2,0x00D9,0x0000 }, 3 }, /* #08 */ - /*expect*/ { 0,1,-0x0006, }, + /*expect*/ { 0,1,-1, }, }, { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, - { 0x00D1,0x00D2,0x0000 }, 4 }, /* #09 */ + { 0x00D1,0x00D2,0x0000 }, 4 }, /* #09 */ - /*expect*/ { 0,1,0x00D3, }, + /*expect*/ { 0,1,1, }, }, @@ -305,21 +305,21 @@ index 167ce48..f468a8b 100644 @@ -75,7 +75,7 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, - { 0x0000,0x0042,0x0043,0x0000 }, 3 }, /* #06 */ + { 0x0000,0x0042,0x0043,0x0000 }, 3 }, /* #06 */ - /*expect*/ { 0,1,0x0041, }, + /*expect*/ { 0,1,1, }, }, { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, - { 0x0041,0x0042,0x0049,0x0000 }, 2 }, /* #07 */ + { 0x0041,0x0042,0x0049,0x0000 }, 2 }, /* #07 */ @@ -83,11 +83,11 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, - { 0x0041,0x0042,0x0049,0x0000 }, 3 }, /* #08 */ + { 0x0041,0x0042,0x0049,0x0000 }, 3 }, /* #08 */ - /*expect*/ { 0,1,-0x0006, }, + /*expect*/ { 0,1,-1, }, }, { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, - { 0x0041,0x0042,0x0000 }, 4 }, /* #09 */ + { 0x0041,0x0042,0x0000 }, 4 }, /* #09 */ - /*expect*/ { 0,1,0x0043, }, + /*expect*/ { 0,1,1, }, }, @@ -328,21 +328,21 @@ index 167ce48..f468a8b 100644 @@ -117,7 +117,7 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, - { 0x0000,0x3042,0x3043,0x0000 }, 3 }, /* #06 */ + { 0x0000,0x3042,0x3043,0x0000 }, 3 }, /* #06 */ - /*expect*/ { 0,1,0x3041, }, + /*expect*/ { 0,1,1, }, }, { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, - { 0x3041,0x3042,0x3049,0x0000 }, 2 }, /* #07 */ + { 0x3041,0x3042,0x3049,0x0000 }, 2 }, /* #07 */ @@ -125,11 +125,11 @@ TST_WCSNCMP tst_wcsncmp_loc [] = { }, { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, - { 0x3041,0x3042,0x3049,0x0000 }, 3 }, /* #08 */ + { 0x3041,0x3042,0x3049,0x0000 }, 3 }, /* #08 */ - /*expect*/ { 0,1,-0x0006, }, + /*expect*/ { 0,1,-1, }, }, { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, - { 0x3041,0x3042,0x0000 }, 4 }, /* #09 */ + { 0x3041,0x3042,0x0000 }, 4 }, /* #09 */ - /*expect*/ { 0,1,0x3043, }, + /*expect*/ { 0,1,1, }, }, @@ -358,21 +358,21 @@ index d046ecd..e378efb 100644 ret = wcsncmp (ws1, ws2, n); + ret = (ret > 0 ? 1 : ret < 0 ? -1 : 0); + - + if (debug_flg) - { + { diff --git a/string/strncmp.c b/string/strncmp.c index d79305a..bd52138 100644 --- a/string/strncmp.c +++ b/string/strncmp.c @@ -21,7 +21,7 @@ #undef strncmp - + #ifndef STRNCMP -#define STRNCMP strncmp +# define STRNCMP strncmp #endif - + /* Compare no more than N characters of S1 and S2, diff --git a/string/test-strncmp.c b/string/test-strncmp.c index 7169593..950bf24 100644 @@ -384,10 +384,10 @@ index 7169593..950bf24 100644 + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek , 1999. - + @@ -18,18 +18,82 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strncmp" +#ifdef WIDE @@ -396,7 +396,7 @@ index 7169593..950bf24 100644 +# define TEST_NAME "strncmp" +#endif #include "test-string.h" - + -typedef int (*proto_t) (const char *, const char *, size_t); -int simple_strncmp (const char *, const char *, size_t); -int stupid_strncmp (const char *, const char *, size_t); @@ -432,11 +432,11 @@ index 7169593..950bf24 100644 + } + return 0; +} - + -IMPL (stupid_strncmp, 0) -IMPL (simple_strncmp, 0) -IMPL (strncmp, 1) - + int +stupid_wcsncmp (const CHAR *s1, const CHAR *s2, size_t n) +{ @@ -486,100 +486,100 @@ index 7169593..950bf24 100644 +IMPL (STUPID_STRNCMP, 0) +IMPL (SIMPLE_STRNCMP, 0) +IMPL (STRNCMP, 1) - + static int -check_result (impl_t *impl, const char *s1, const char *s2, size_t n, +check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t n, - int exp_result) + int exp_result) { int result = CALL (impl, s1, s2, n); @@ -70,7 +141,7 @@ check_result (impl_t *impl, const char *s1, const char *s2, size_t n, } - + static void -do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n, +do_one_test (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t n, - int exp_result) + int exp_result) { if (check_result (impl, s1, s2, n, exp_result) < 0) @@ -82,12 +153,12 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, - int exp_result) + int exp_result) { size_t i, align_n; - char *s1, *s2; + CHAR *s1, *s2; - + if (n == 0) { - s1 = (char*)(buf1 + page_size); - s2 = (char*)(buf2 + page_size); + s1 = (CHAR*) (buf1 + page_size); + s2 = (CHAR*) (buf2 + page_size); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, s1, s2, n, 0); + do_one_test (impl, s1, s2, n, 0); @@ -97,16 +168,16 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, - + align1 &= 15; align2 &= 15; - align_n = (page_size - n) & 15; + align_n = (page_size - n * CHARBYTES) & 15; - + - s1 = (char*)(buf1 + page_size - n); - s2 = (char*)(buf2 + page_size - n); + s1 = (CHAR*) (buf1 + page_size - n * CHARBYTES); + s2 = (CHAR*) (buf2 + page_size - n * CHARBYTES); - + if (align1 < align_n) - s1 -= (align_n - align1); + s1 = (CHAR *) ((char *) s1 - (align_n - align1)); - + if (align2 < align_n) - s2 -= (align_n - align2); + s2 = (CHAR *) ((char *) s2 - (align_n - align2)); - + for (i = 0; i < n; i++) s1[i] = s2[i] = 1 + 23 * i % max_char; @@ -130,24 +201,24 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, - int exp_result) + int exp_result) { size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + if (n == 0) return; - + - align1 &= 7; - if (align1 + n + 1 >= page_size) + align1 &= 63; + if (align1 + (n + 1) * CHARBYTES >= page_size) return; - + align2 &= 7; - if (align2 + n + 1 >= page_size) + if (align2 + (n + 1) * CHARBYTES >= page_size) return; - + - s1 = (char*)(buf1 + align1); - s2 = (char*)(buf2 + align2); + s1 = (CHAR*) (buf1 + align1); + s2 = (CHAR*) (buf2 + align2); - + for (i = 0; i < n; i++) - s1[i] = s2[i] = 1 + 23 * i % max_char; + s1[i] = s2[i] = 1 + (23 << ((CHARBYTES - 1) * 8)) * i % max_char; - + s1[n] = 24 + exp_result; s2[n] = 23; @@ -161,19 +232,20 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, s2[n - 1] -= exp_result; - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char*)s1, (char*)s2, n, exp_result); + do_one_test (impl, s1, s2, n, exp_result); } - + static void -do_page_test (size_t offset1, size_t offset2, char *s2) +do_page_test (size_t offset1, size_t offset2, CHAR *s2) @@ -587,16 +587,16 @@ index 7169593..950bf24 100644 - char *s1; + CHAR *s1; int exp_result; - + - if (offset1 >= page_size || offset2 >= page_size) + if (offset1 * CHARBYTES >= page_size || offset2 * CHARBYTES >= page_size) return; - + - s1 = (char *) (buf1 + offset1); + s1 = (CHAR *) buf1; + s1 += offset1; s2 += offset2; - + exp_result= *s1; @@ -191,8 +263,8 @@ do_random_tests (void) size_t i, j, n, align1, align2, pos, len1, len2, size; @@ -606,27 +606,27 @@ index 7169593..950bf24 100644 - unsigned char *p2 = buf2 + page_size - 512; + UCHAR *p1 = (UCHAR *) (buf1 + page_size - 512 * CHARBYTES); + UCHAR *p2 = (UCHAR *) (buf2 + page_size - 512 * CHARBYTES); - + for (n = 0; n < ITERATIONS; n++) { @@ -240,7 +312,7 @@ do_random_tests (void) - } - + } + result = 0; - memcpy (p2 + align2, p1 + align1, pos); + MEMCPY (p2 + align2, p1 + align1, pos); if (pos < len1) - { - if (p2[align2 + pos] == p1[align1 + pos]) + { + if (p2[align2 + pos] == p1[align1 + pos]) @@ -263,7 +335,7 @@ do_random_tests (void) - + FOR_EACH_IMPL (impl, 1) - { + { - r = CALL (impl, (char*)(p1 + align1), (char*)(p2 + align2), size); + r = CALL (impl, (CHAR *)(p1 + align1), (CHAR *)(p2 + align2), size); - /* Test whether on 64-bit architectures where ABI requires - callee to promote has the promotion been done. */ - asm ("" : "=g" (r) : "0" (r)); + /* Test whether on 64-bit architectures where ABI requires + callee to promote has the promotion been done. */ + asm ("" : "=g" (r) : "0" (r)); @@ -282,19 +354,26 @@ do_random_tests (void) static void check1 (void) @@ -638,7 +638,7 @@ index 7169593..950bf24 100644 + CHAR *s2 = (CHAR *)(buf1 + 0xfd8); + size_t i, offset; int exp_result; - + - strcpy(s1, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"); - strcpy(s2, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkLMNOPQRSTUV"); + strcpy(s1, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs")); @@ -647,7 +647,7 @@ index 7169593..950bf24 100644 + /* Check possible overflow bug for wcsncmp */ + s1[4] = CHAR__MAX; + s2[4] = CHAR__MIN; - + - for (i = 0; i < 80; i++) + for (offset = 0; offset < 6; offset++) { @@ -662,28 +662,28 @@ index 7169593..950bf24 100644 + } } } - + @@ -302,17 +381,17 @@ static void check2 (void) { size_t i; - char *s1, *s2; + CHAR *s1, *s2; - + - s1 = (char *) buf1; - for (i = 0; i < page_size - 1; i++) + s1 = (CHAR *) buf1; + for (i = 0; i < (page_size / CHARBYTES) - 1; i++) s1[i] = 23; s1[i] = 0; - + - s2 = strdup (s1); + s2 = STRDUP (s1); - + for (i = 0; i < 64; ++i) - do_page_test (3990 + i, 2635, s2); + do_page_test ((3988 / CHARBYTES) + i, (2636 / CHARBYTES), s2); - + free (s2); } diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile @@ -691,19 +691,19 @@ index d8fbd55..d77bee5 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -7,7 +7,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - stpncpy stpncpy-vx stpncpy-c \ - strcat strcat-vx strcat-c \ - strncat strncat-vx strncat-c \ + stpncpy stpncpy-vx stpncpy-c \ + strcat strcat-vx strcat-c \ + strncat strncat-vx strncat-c \ - strcmp strcmp-vx + strcmp strcmp-vx \ + strncmp strncmp-vx strncmp-c endif - + ifeq ($(subdir),wcsmbs) @@ -19,5 +20,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcpncpy wcpncpy-vx wcpncpy-c \ - wcscat wcscat-vx wcscat-c \ - wcsncat wcsncat-vx wcsncat-c \ + wcpncpy wcpncpy-vx wcpncpy-c \ + wcscat wcscat-vx wcscat-c \ + wcsncat wcsncat-vx wcsncat-c \ - wcscmp wcscmp-vx wcscmp-c + wcscmp wcscmp-vx wcscmp-c \ + wcsncmp wcsncmp-vx wcsncmp-c @@ -715,12 +715,12 @@ index 196d3ec..5bfc493 100644 @@ -106,6 +106,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strcmp); IFUNC_VX_IMPL (wcscmp); - + + IFUNC_VX_IMPL (strncmp); + IFUNC_VX_IMPL (wcsncmp); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strncmp-c.c b/sysdeps/s390/multiarch/strncmp-c.c new file mode 100644 @@ -1187,14 +1187,14 @@ index 44b1502..611b2c9 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -41,7 +41,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - isoc99_swscanf isoc99_vswscanf \ - mbrtoc16 c16rtomb - + isoc99_swscanf isoc99_vswscanf \ + mbrtoc16 c16rtomb + -strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ +strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat + wcpcpy wcsncpy wcpncpy wcscat wcsncat tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ diff --git a/wcsmbs/test-wcsncmp-ifunc.c b/wcsmbs/test-wcsncmp-ifunc.c new file mode 100644 index 0000000..35176f0 @@ -1234,13 +1234,13 @@ index 7f1704f..1522b6f 100644 --- a/wcsmbs/wcsncmp.c +++ b/wcsmbs/wcsncmp.c @@ -18,53 +18,56 @@ - + #include - + +#ifndef WCSNCMP +# define WCSNCMP wcsncmp +#endif - + /* Compare no more than N characters of S1 and S2, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or @@ -1256,44 +1256,44 @@ index 7f1704f..1522b6f 100644 - wint_t c2 = L'\0'; + wchar_t c1 = L'\0'; + wchar_t c2 = L'\0'; - + if (n >= 4) { size_t n4 = n >> 2; do - { + { - c1 = (wint_t) *s1++; - c2 = (wint_t) *s2++; + c1 = *s1++; + c2 = *s2++; - if (c1 == L'\0' || c1 != c2) + if (c1 == L'\0' || c1 != c2) - return c1 - c2; - c1 = (wint_t) *s1++; - c2 = (wint_t) *s2++; + return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0); + c1 = *s1++; + c2 = *s2++; - if (c1 == L'\0' || c1 != c2) + if (c1 == L'\0' || c1 != c2) - return c1 - c2; - c1 = (wint_t) *s1++; - c2 = (wint_t) *s2++; + return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0); + c1 = *s1++; + c2 = *s2++; - if (c1 == L'\0' || c1 != c2) + if (c1 == L'\0' || c1 != c2) - return c1 - c2; - c1 = (wint_t) *s1++; - c2 = (wint_t) *s2++; + return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0); + c1 = *s1++; + c2 = *s2++; - if (c1 == L'\0' || c1 != c2) + if (c1 == L'\0' || c1 != c2) - return c1 - c2; + return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0); - } while (--n4 > 0); + } while (--n4 > 0); n &= 3; } - + while (n > 0) { - c1 = (wint_t) *s1++; @@ -1305,9 +1305,10 @@ index 7f1704f..1522b6f 100644 + return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0); n--; } - + - return c1 - c2; + return 0; } --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-2.patch b/SOURCES/glibc-rh1268008-2.patch index 5e61cf73..4eeb4b29 100644 --- a/SOURCES/glibc-rh1268008-2.patch +++ b/SOURCES/glibc-rh1268008-2.patch @@ -19,7 +19,7 @@ index f1bf8a3..42ca8da 100644 --- a/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c +++ b/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c @@ -34,9 +34,9 @@ - \ + \ /* Make the declarations of the optimized functions hidden in order to prevent GOT slots being generated for them. */ \ - extern __attribute__((visibility("hidden"))) void *FUNC##_z196; \ @@ -28,7 +28,7 @@ index f1bf8a3..42ca8da 100644 + extern void *FUNC##_z196 attribute_hidden; \ + extern void *FUNC##_z10 attribute_hidden; \ + extern void *FUNC##_g5 attribute_hidden; \ - \ + \ void *resolve_##FUNC (unsigned long int dl_hwcap) \ { \ diff --git a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c @@ -36,7 +36,7 @@ index 5f56764..8db2c38 100644 --- a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c +++ b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c @@ -34,9 +34,9 @@ - \ + \ /* Make the declarations of the optimized functions hidden in order to prevent GOT slots being generated for them. */ \ - extern __attribute__((visibility("hidden"))) void *FUNC##_z196; \ @@ -45,8 +45,9 @@ index 5f56764..8db2c38 100644 + extern void *FUNC##_z196 attribute_hidden; \ + extern void *FUNC##_z10 attribute_hidden; \ + extern void *FUNC##_z900 attribute_hidden; \ - \ + \ void *resolve_##FUNC (unsigned long int dl_hwcap) \ { \ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-20.patch b/SOURCES/glibc-rh1268008-20.patch index e6b37b7a..917dc1d3 100644 --- a/SOURCES/glibc-rh1268008-20.patch +++ b/SOURCES/glibc-rh1268008-20.patch @@ -50,13 +50,13 @@ index f6342da..bcb0288 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp + wcsncmp wcsncmp wcschr string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-wcschr.c b/benchtests/bench-wcschr.c new file mode 100644 @@ -89,9 +89,9 @@ index 9d18b7e..69a9cd9 100644 --- a/string/strchr.c +++ b/string/strchr.c @@ -27,11 +27,13 @@ - + #undef strchr - + +#ifndef STRCHR +# define STRCHR strchr +#endif @@ -110,19 +110,19 @@ index d77bee5..1a3673b 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -8,7 +8,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strcat strcat-vx strcat-c \ - strncat strncat-vx strncat-c \ - strcmp strcmp-vx \ + strcat strcat-vx strcat-c \ + strncat strncat-vx strncat-c \ + strcmp strcmp-vx \ - strncmp strncmp-vx strncmp-c + strncmp strncmp-vx strncmp-c \ + strchr strchr-vx strchr-c endif - + ifeq ($(subdir),wcsmbs) @@ -21,5 +22,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcscat wcscat-vx wcscat-c \ - wcsncat wcsncat-vx wcsncat-c \ - wcscmp wcscmp-vx wcscmp-c \ + wcscat wcscat-vx wcscat-c \ + wcsncat wcsncat-vx wcsncat-c \ + wcscmp wcscmp-vx wcscmp-c \ - wcsncmp wcsncmp-vx wcsncmp-c + wcsncmp wcsncmp-vx wcsncmp-c \ + wcschr wcschr-vx wcschr-c @@ -134,12 +134,12 @@ index 5bfc493..b0782ff 100644 @@ -109,6 +109,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strncmp); IFUNC_VX_IMPL (wcsncmp); - + + IFUNC_VX_IMPL (strchr); + IFUNC_VX_IMPL (wcschr); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strchr-c.c b/sysdeps/s390/multiarch/strchr-c.c new file mode 100644 @@ -495,5 +495,6 @@ index 0000000..9c8c097 +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-21.patch b/SOURCES/glibc-rh1268008-21.patch index 41a0fb92..b07aa73a 100644 --- a/SOURCES/glibc-rh1268008-21.patch +++ b/SOURCES/glibc-rh1268008-21.patch @@ -61,13 +61,13 @@ index bcb0288..d34bb3d 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr + wcsncmp wcsncmp wcschr wcschrnul string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strchr.c b/benchtests/bench-strchr.c index d432ba5..9b1aaf9 100644 @@ -89,7 +89,7 @@ index d432ba5..9b1aaf9 100644 +# endif /* !USE_FOR_STRCHRNUL */ +#endif /* WIDE */ #include "bench-string.h" - + #ifndef WIDE @@ -44,20 +48,26 @@ # define UCHAR unsigned char @@ -111,15 +111,15 @@ index d432ba5..9b1aaf9 100644 # define UCHAR wchar_t -#endif +#endif /* WIDE */ - + #ifdef USE_FOR_STRCHRNUL # define NULLRET(endptr) endptr #else # define NULLRET(endptr) NULL -#endif +#endif /* !USE_FOR_STRCHRNUL */ - - + + typedef CHAR *(*proto_t) (const CHAR *, int); diff --git a/benchtests/bench-wcschrnul.c b/benchtests/bench-wcschrnul.c new file mode 100644 @@ -164,7 +164,7 @@ index b84e138..1cd14d7 100644 +# endif /* !USE_FOR_STRCHRNUL */ +#endif /* WIDE */ #include "test-string.h" - + #ifndef WIDE @@ -44,15 +48,23 @@ # define MIDDLE_CHAR 127 @@ -189,7 +189,7 @@ index b84e138..1cd14d7 100644 # define UCHAR wchar_t +# define L(s) L ## s #endif - + #ifdef USE_FOR_STRCHRNUL @@ -219,9 +231,9 @@ do_random_tests (void) static void @@ -201,7 +201,7 @@ index b84e138..1cd14d7 100644 + CHAR s[] __attribute__((aligned(16))) = L ("\xff"); + CHAR c = L ('\xfe'); + CHAR *exp_result = stupid_STRCHR (s, c); - + FOR_EACH_IMPL (impl, 0) check_result (impl, s, c, exp_result); diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile @@ -209,19 +209,19 @@ index 1a3673b..b6b64c9 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -9,7 +9,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strncat strncat-vx strncat-c \ - strcmp strcmp-vx \ - strncmp strncmp-vx strncmp-c \ + strncat strncat-vx strncat-c \ + strcmp strcmp-vx \ + strncmp strncmp-vx strncmp-c \ - strchr strchr-vx strchr-c + strchr strchr-vx strchr-c \ + strchrnul strchrnul-vx strchrnul-c endif - + ifeq ($(subdir),wcsmbs) @@ -23,5 +24,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsncat wcsncat-vx wcsncat-c \ - wcscmp wcscmp-vx wcscmp-c \ - wcsncmp wcsncmp-vx wcsncmp-c \ + wcsncat wcsncat-vx wcsncat-c \ + wcscmp wcscmp-vx wcscmp-c \ + wcsncmp wcsncmp-vx wcsncmp-c \ - wcschr wcschr-vx wcschr-c + wcschr wcschr-vx wcschr-c \ + wcschrnul wcschrnul-vx wcschrnul-c @@ -233,12 +233,12 @@ index b0782ff..ea474a8 100644 @@ -112,6 +112,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strchr); IFUNC_VX_IMPL (wcschr); - + + IFUNC_VX_IMPL (strchrnul); + IFUNC_VX_IMPL (wcschrnul); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strchrnul-c.c b/sysdeps/s390/multiarch/strchrnul-c.c new file mode 100644 @@ -578,14 +578,14 @@ index 611b2c9..de3635d 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcschrnul-ifunc.c b/wcsmbs/test-wcschrnul-ifunc.c new file mode 100644 index 0000000..e64a1e4 @@ -643,21 +643,22 @@ index 04db8f1..1e4c44f 100644 --- a/wcsmbs/wcschrnul.c +++ b/wcsmbs/wcschrnul.c @@ -17,6 +17,9 @@ - + #include - + +#ifdef WCSCHRNUL +# define __wcschrnul WCSCHRNUL +#endif - + /* Find the first occurrence of WC in WCS. */ wchar_t * @@ -32,4 +35,6 @@ __wcschrnul (wcs, wc) - + return (wchar_t *) wcs; } +#ifndef WCSCHRNUL weak_alias (__wcschrnul, wcschrnul) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-22.patch b/SOURCES/glibc-rh1268008-22.patch index dea8911e..0b388fae 100644 --- a/SOURCES/glibc-rh1268008-22.patch +++ b/SOURCES/glibc-rh1268008-22.patch @@ -49,13 +49,13 @@ index d34bb3d..6444394 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul + wcsncmp wcsncmp wcschr wcschrnul wcsrchr string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-wcsrchr.c b/benchtests/bench-wcsrchr.c new file mode 100644 @@ -88,9 +88,9 @@ index a986ff9..03f3957 100644 --- a/string/strrchr.c +++ b/string/strrchr.c @@ -19,9 +19,13 @@ - + #undef strrchr - + +#ifndef STRRCHR +# define STRRCHR strrchr +#endif @@ -101,25 +101,25 @@ index a986ff9..03f3957 100644 +STRRCHR (const char *s, int c) { register const char *found, *p; - + diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index b6b64c9..b8b141e 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -10,7 +10,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strcmp strcmp-vx \ - strncmp strncmp-vx strncmp-c \ - strchr strchr-vx strchr-c \ + strcmp strcmp-vx \ + strncmp strncmp-vx strncmp-c \ + strchr strchr-vx strchr-c \ - strchrnul strchrnul-vx strchrnul-c + strchrnul strchrnul-vx strchrnul-c \ + strrchr strrchr-vx strrchr-c endif - + ifeq ($(subdir),wcsmbs) @@ -25,5 +26,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcscmp wcscmp-vx wcscmp-c \ - wcsncmp wcsncmp-vx wcsncmp-c \ - wcschr wcschr-vx wcschr-c \ + wcscmp wcscmp-vx wcscmp-c \ + wcsncmp wcsncmp-vx wcsncmp-c \ + wcschr wcschr-vx wcschr-c \ - wcschrnul wcschrnul-vx wcschrnul-c + wcschrnul wcschrnul-vx wcschrnul-c \ + wcsrchr wcsrchr-vx wcsrchr-c @@ -131,12 +131,12 @@ index ea474a8..ee84d80 100644 @@ -115,6 +115,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strchrnul); IFUNC_VX_IMPL (wcschrnul); - + + IFUNC_VX_IMPL (strrchr); + IFUNC_VX_IMPL (wcsrchr); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strrchr-c.c b/sysdeps/s390/multiarch/strrchr-c.c new file mode 100644 @@ -653,5 +653,6 @@ index 0000000..db3f467 +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-23.patch b/SOURCES/glibc-rh1268008-23.patch index 4f7a35b3..eeaad595 100644 --- a/SOURCES/glibc-rh1268008-23.patch +++ b/SOURCES/glibc-rh1268008-23.patch @@ -62,13 +62,13 @@ index 6444394..337b2a1 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strspn.c b/benchtests/bench-strspn.c index 634bca1..e1f2272 100644 @@ -76,7 +76,7 @@ index 634bca1..e1f2272 100644 +++ b/benchtests/bench-strspn.c @@ -17,22 +17,47 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strspn" +#ifndef WIDE @@ -85,7 +85,7 @@ index 634bca1..e1f2272 100644 +# define TEST_NAME "wcsspn" +#endif /* WIDE */ #include "bench-string.h" - + -typedef size_t (*proto_t) (const char *, const char *); -size_t simple_strspn (const char *, const char *); -size_t stupid_strspn (const char *, const char *); @@ -121,7 +121,7 @@ index 634bca1..e1f2272 100644 +IMPL (STUPID_STRSPN, 0) +IMPL (SIMPLE_STRSPN, 0) +IMPL (STRSPN, 1) - + size_t -simple_strspn (const char *s, const char *acc) +SIMPLE_STRSPN (const CHAR *s, const CHAR *acc) @@ -130,12 +130,12 @@ index 634bca1..e1f2272 100644 - char c; + const CHAR *r, *str = s; + CHAR c; - + while ((c = *s++) != '\0') { @@ -46,9 +71,9 @@ simple_strspn (const char *s, const char *acc) } - + size_t -stupid_strspn (const char *s, const char *acc) +STUPID_STRSPN (const CHAR *s, const CHAR *acc) @@ -143,11 +143,11 @@ index 634bca1..e1f2272 100644 - size_t ns = strlen (s), nacc = strlen (acc); + size_t ns = STRLEN (s), nacc = STRLEN (acc); size_t i, j; - + for (i = 0; i < ns; ++i) @@ -63,7 +88,7 @@ stupid_strspn (const char *s, const char *acc) } - + static void -do_one_test (impl_t *impl, const char *s, const char *acc, size_t exp_res) +do_one_test (impl_t *impl, const CHAR *s, const CHAR *acc, size_t exp_res) @@ -160,17 +160,17 @@ index 634bca1..e1f2272 100644 size_t i; - char *acc, *s; + CHAR *acc, *s; - + align &= 7; - if (align + pos + 10 >= page_size || len > 240 || ! len) + if ((align + pos + 10) * sizeof (CHAR) >= page_size || len > 240 || ! len) return; - + - acc = (char *) (buf2 + (random () & 255)); - s = (char *) (buf1 + align); + acc = (CHAR *) (buf2) + (random () & BIG_CHAR); + s = (CHAR *) (buf1) + align; - + for (i = 0; i < len; ++i) { - acc[i] = random () & 255; @@ -183,7 +183,7 @@ index 634bca1..e1f2272 100644 + acc[i] = 1 + (random () & SMALL_CHAR); } acc[len] = '\0'; - + for (i = 0; i < pos; ++i) s[i] = acc[random () % len]; - s[pos] = random () & 255; @@ -197,7 +197,7 @@ index 634bca1..e1f2272 100644 + s[i] = random () & BIG_CHAR; s[i] = '\0'; } - + diff --git a/benchtests/bench-wcsspn.c b/benchtests/bench-wcsspn.c new file mode 100644 index 0000000..7bdef50 @@ -230,12 +230,12 @@ index 48624aa..f0ac9db 100644 +++ b/string/strspn.c @@ -18,13 +18,14 @@ #include - + #undef strspn +#ifndef STRSPN +#define STRSPN strspn +#endif - + /* Return the length of the maximum initial segment of S which contains only characters in ACCEPT. */ size_t @@ -252,7 +252,7 @@ index 0d6cd19..306958e 100644 +++ b/string/test-strspn.c @@ -18,22 +18,49 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "strspn" +#ifndef WIDE @@ -261,7 +261,7 @@ index 0d6cd19..306958e 100644 +# define TEST_NAME "wcsspn" +#endif /* WIDE */ #include "test-string.h" - + -typedef size_t (*proto_t) (const char *, const char *); -size_t simple_strspn (const char *, const char *); -size_t stupid_strspn (const char *, const char *); @@ -299,7 +299,7 @@ index 0d6cd19..306958e 100644 +IMPL (STUPID_STRSPN, 0) +IMPL (SIMPLE_STRSPN, 0) +IMPL (STRSPN, 1) - + size_t -simple_strspn (const char *s, const char *acc) +SIMPLE_STRSPN (const CHAR *s, const CHAR *acc) @@ -308,12 +308,12 @@ index 0d6cd19..306958e 100644 - char c; + const CHAR *r, *str = s; + CHAR c; - + while ((c = *s++) != '\0') { @@ -47,9 +74,9 @@ simple_strspn (const char *s, const char *acc) } - + size_t -stupid_strspn (const char *s, const char *acc) +STUPID_STRSPN (const CHAR *s, const CHAR *acc) @@ -321,11 +321,11 @@ index 0d6cd19..306958e 100644 - size_t ns = strlen (s), nacc = strlen (acc); + size_t ns = STRLEN (s), nacc = STRLEN (acc); size_t i, j; - + for (i = 0; i < ns; ++i) @@ -64,7 +91,7 @@ stupid_strspn (const char *s, const char *acc) } - + static void -do_one_test (impl_t *impl, const char *s, const char *acc, size_t exp_res) +do_one_test (impl_t *impl, const CHAR *s, const CHAR *acc, size_t exp_res) @@ -338,17 +338,17 @@ index 0d6cd19..306958e 100644 size_t i; - char *acc, *s; + CHAR *acc, *s; - + align &= 7; - if (align + pos + 10 >= page_size || len > 240 || ! len) + if ((align + pos + 10) * sizeof (CHAR) >= page_size || len > 240 || ! len) return; - + - acc = (char *) (buf2 + (random () & 255)); - s = (char *) (buf1 + align); + acc = (CHAR *) (buf2) + (random () & 255); + s = (CHAR *) (buf1) + align; - + for (i = 0; i < len; ++i) { - acc[i] = random () & 255; @@ -361,7 +361,7 @@ index 0d6cd19..306958e 100644 + acc[i] = 1 + (random () & SMALL_CHAR); } acc[len] = '\0'; - + for (i = 0; i < pos; ++i) s[i] = acc[random () % len]; - s[pos] = random () & 255; @@ -376,7 +376,7 @@ index 0d6cd19..306958e 100644 + s[i] = random () & BIG_CHAR; s[i] = '\0'; } - + @@ -119,8 +146,8 @@ static void do_random_tests (void) { @@ -385,80 +385,80 @@ index 0d6cd19..306958e 100644 - unsigned char *acc; + UCHAR *p = (UCHAR *) (buf1 + page_size) - 512; + UCHAR *acc; - + for (n = 0; n < ITERATIONS; n++) { @@ -138,14 +165,14 @@ do_random_tests (void) len = random () & 511; if (len + align >= 512) - len = 511 - align - (random () & 7); + len = 511 - align - (random () & 7); - acc = buf2 + page_size - alen - 1 - (random () & 7); + acc = (UCHAR *) (buf2 + page_size) - alen - 1 - (random () & 7); for (i = 0; i < alen; ++i) - { + { - acc[i] = random () & 255; + acc[i] = random () & BIG_CHAR; - if (!acc[i]) + if (!acc[i]) - acc[i] = random () & 255; + acc[i] = random () & BIG_CHAR; - if (!acc[i]) + if (!acc[i]) - acc[i] = 1 + (random () & 127); + acc[i] = 1 + (random () & SMALL_CHAR); - } + } acc[i] = '\0'; j = (pos > len ? pos : len) + align + 64; @@ -158,26 +185,27 @@ do_random_tests (void) - p[i] = '\0'; - else if (i == pos + align) - { + p[i] = '\0'; + else if (i == pos + align) + { - p[i] = random () & 255; - if (strchr ((char *) acc, p[i])) + p[i] = random () & BIG_CHAR; + if (STRCHR ((CHAR *) acc, p[i])) - p[i] = '\0'; - } - else if (i < align || i > pos + align) + p[i] = '\0'; + } + else if (i < align || i > pos + align) - p[i] = random () & 255; + p[i] = random () & BIG_CHAR; - else - p[i] = acc [random () % alen]; - } - + else + p[i] = acc [random () % alen]; + } + FOR_EACH_IMPL (impl, 1) - if (CALL (impl, (char *) (p + align), - (char *) acc) != (pos < len ? pos : len)) + if (CALL (impl, (CHAR *) (p + align), + (CHAR *) acc) != (pos < len ? pos : len)) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %zd != %zd", - n, impl->name, align, acc, alen, pos, len, + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %zd != %zd", + n, impl->name, align, acc, alen, pos, len, - CALL (impl, (char *) (p + align), (char *) acc), + CALL (impl, (CHAR *) (p + align), (CHAR *) acc), - (pos < len ? pos : len)); - ret = 1; - } + (pos < len ? pos : len)); + ret = 1; + } + } } - + diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index b8b141e..9403169 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -11,7 +11,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strncmp strncmp-vx strncmp-c \ - strchr strchr-vx strchr-c \ - strchrnul strchrnul-vx strchrnul-c \ + strncmp strncmp-vx strncmp-c \ + strchr strchr-vx strchr-c \ + strchrnul strchrnul-vx strchrnul-c \ - strrchr strrchr-vx strrchr-c + strrchr strrchr-vx strrchr-c \ + strspn strspn-vx strspn-c endif - + ifeq ($(subdir),wcsmbs) @@ -27,5 +28,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsncmp wcsncmp-vx wcsncmp-c \ - wcschr wcschr-vx wcschr-c \ - wcschrnul wcschrnul-vx wcschrnul-c \ + wcsncmp wcsncmp-vx wcsncmp-c \ + wcschr wcschr-vx wcschr-c \ + wcschrnul wcschrnul-vx wcschrnul-c \ - wcsrchr wcsrchr-vx wcsrchr-c + wcsrchr wcsrchr-vx wcsrchr-c \ + wcsspn wcsspn-vx wcsspn-c @@ -470,12 +470,12 @@ index ee84d80..cbedf64 100644 @@ -118,6 +118,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strrchr); IFUNC_VX_IMPL (wcsrchr); - + + IFUNC_VX_IMPL (strspn); + IFUNC_VX_IMPL (wcsspn); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strspn-c.c b/sysdeps/s390/multiarch/strspn-c.c new file mode 100644 @@ -1157,14 +1157,14 @@ index de3635d..843a23c 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcsspn-ifunc.c b/wcsmbs/test-wcsspn-ifunc.c new file mode 100644 index 0000000..73f288f @@ -1222,14 +1222,15 @@ index dad72b4..3e84726 100644 --- a/wcsmbs/wcsspn.c +++ b/wcsmbs/wcsspn.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCSSPN +# define wcsspn WCSSPN +#endif - + /* Return the length of the maximum initial segment of WCS which contains only wide-characters in ACCEPT. */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-24.patch b/SOURCES/glibc-rh1268008-24.patch index 09998458..2b355e6f 100644 --- a/SOURCES/glibc-rh1268008-24.patch +++ b/SOURCES/glibc-rh1268008-24.patch @@ -62,13 +62,13 @@ index 337b2a1..015b5d6 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strpbrk.c b/benchtests/bench-strpbrk.c index fe966be..f2db902 100644 @@ -77,7 +77,7 @@ index fe966be..f2db902 100644 @@ -16,50 +16,80 @@ License along with the GNU C Library; if not, see . */ - + +#ifndef WIDE +# define CHAR char +# define STRLEN strlen @@ -105,7 +105,7 @@ index fe966be..f2db902 100644 +# define TEST_NAME "wcspbrk" +# endif /* WIDE */ # include "bench-string.h" - + -typedef char *(*proto_t) (const char *, const char *); -char *simple_strpbrk (const char *, const char *); -char *stupid_strpbrk (const char *, const char *); @@ -142,7 +142,7 @@ index fe966be..f2db902 100644 - char c; + const CHAR *r; + CHAR c; - + while ((c = *s++) != '\0') for (r = rej; *r != '\0'; ++r) if (*r == c) @@ -150,7 +150,7 @@ index fe966be..f2db902 100644 + return (CHAR *) s - 1; return NULL; } - + -char * -stupid_strpbrk (const char *s, const char *rej) +CHAR * @@ -159,7 +159,7 @@ index fe966be..f2db902 100644 - size_t ns = strlen (s), nrej = strlen (rej); + size_t ns = STRLEN (s), nrej = STRLEN (rej); size_t i, j; - + for (i = 0; i < ns; ++i) for (j = 0; j < nrej; ++j) if (s[i] == rej[j]) @@ -169,7 +169,7 @@ index fe966be..f2db902 100644 } -#endif +#endif /* !STRPBRK_RESULT */ - + static void -do_one_test (impl_t *impl, const char *s, const char *rej, RES_TYPE exp_res) +do_one_test (impl_t *impl, const CHAR *s, const CHAR *rej, RES_TYPE exp_res) @@ -182,17 +182,17 @@ index fe966be..f2db902 100644 RES_TYPE result; - char *rej, *s; + CHAR *rej, *s; - + align &= 7; - if (align + pos + 10 >= page_size || len > 240) + if ((align + pos + 10) * sizeof (CHAR) >= page_size || len > 240) return; - + - rej = (char *) (buf2 + (random () & 255)); - s = (char *) (buf1 + align); + rej = (CHAR *) (buf2) + (random () & BIG_CHAR); + s = (CHAR *) (buf1) + align; - + for (i = 0; i < len; ++i) { - rej[i] = random () & 255; @@ -210,20 +210,20 @@ index fe966be..f2db902 100644 + for (c = 1; c <= BIG_CHAR; ++c) + if (STRCHR (rej, c) == NULL) break; - + for (i = 0; i < pos; ++i) { - s[i] = random () & 255; - if (strchr (rej, s[i])) + s[i] = random () & BIG_CHAR; + if (STRCHR (rej, s[i])) - { + { - s[i] = random () & 255; - if (strchr (rej, s[i])) + s[i] = random () & BIG_CHAR; + if (STRCHR (rej, s[i])) - s[i] = c; - } + s[i] = c; + } } @@ -127,7 +157,7 @@ do_test (size_t align, size_t pos, size_t len) if (s[pos]) @@ -265,9 +265,9 @@ index 7f45fdf..c153d8e 100644 --- a/string/strpbrk.c +++ b/string/strpbrk.c @@ -25,11 +25,13 @@ - + #undef strpbrk - + +#ifndef STRPBRK +# define STRPBRK strpbrk +#endif @@ -288,7 +288,7 @@ index 72eaaa1..c36c5b5 100644 @@ -17,50 +17,82 @@ License along with the GNU C Library; if not, see . */ - + +#ifndef WIDE +# define CHAR char +# define UCHAR unsigned char @@ -318,7 +318,7 @@ index 72eaaa1..c36c5b5 100644 +# define TEST_NAME "wcspbrk" +# endif /* WIDE */ # include "test-string.h" - + -typedef char *(*proto_t) (const char *, const char *); -char *simple_strpbrk (const char *, const char *); -char *stupid_strpbrk (const char *, const char *); @@ -336,14 +336,14 @@ index 72eaaa1..c36c5b5 100644 +typedef CHAR *(*proto_t) (const CHAR *, const CHAR *); +CHAR *SIMPLE_STRPBRK (const CHAR *, const CHAR *); +CHAR *STUPID_STRPBRK (const CHAR *, const CHAR *); - + -IMPL (stupid_strpbrk, 0) -IMPL (simple_strpbrk, 0) -IMPL (strpbrk, 1) +IMPL (STUPID_STRPBRK, 0) +IMPL (SIMPLE_STRPBRK, 0) +IMPL (STRPBRK, 1) - + -char * -simple_strpbrk (const char *s, const char *rej) +CHAR * @@ -353,7 +353,7 @@ index 72eaaa1..c36c5b5 100644 - char c; + const CHAR *r; + CHAR c; - + while ((c = *s++) != '\0') for (r = rej; *r != '\0'; ++r) if (*r == c) @@ -361,7 +361,7 @@ index 72eaaa1..c36c5b5 100644 + return (CHAR *) s - 1; return NULL; } - + -char * -stupid_strpbrk (const char *s, const char *rej) +CHAR * @@ -370,7 +370,7 @@ index 72eaaa1..c36c5b5 100644 - size_t ns = strlen (s), nrej = strlen (rej); + size_t ns = STRLEN (s), nrej = STRLEN (rej); size_t i, j; - + for (i = 0; i < ns; ++i) for (j = 0; j < nrej; ++j) if (s[i] == rej[j]) @@ -380,7 +380,7 @@ index 72eaaa1..c36c5b5 100644 } -#endif +#endif /* !STRPBRK_RESULT */ - + static void -do_one_test (impl_t *impl, const char *s, const char *rej, RES_TYPE exp_res) +do_one_test (impl_t *impl, const CHAR *s, const CHAR *rej, RES_TYPE exp_res) @@ -393,17 +393,17 @@ index 72eaaa1..c36c5b5 100644 RES_TYPE result; - char *rej, *s; + CHAR *rej, *s; - + align &= 7; - if (align + pos + 10 >= page_size || len > 240) + if ((align + pos + 10) * sizeof (CHAR) >= page_size || len > 240) return; - + - rej = (char *) (buf2 + (random () & 255)); - s = (char *) (buf1 + align); + rej = (CHAR *) (buf2) + (random () & 255); + s = (CHAR *) (buf1) + align; - + for (i = 0; i < len; ++i) { - rej[i] = random () & 255; @@ -421,20 +421,20 @@ index 72eaaa1..c36c5b5 100644 + for (c = 1; c <= BIG_CHAR; ++c) + if (STRCHR (rej, c) == NULL) break; - + for (i = 0; i < pos; ++i) { - s[i] = random () & 255; - if (strchr (rej, s[i])) + s[i] = random () & BIG_CHAR; + if (STRCHR (rej, s[i])) - { + { - s[i] = random () & 255; - if (strchr (rej, s[i])) + s[i] = random () & BIG_CHAR; + if (STRCHR (rej, s[i])) - s[i] = c; - } + s[i] = c; + } } @@ -114,7 +146,7 @@ do_test (size_t align, size_t pos, size_t len) if (s[pos]) @@ -453,88 +453,88 @@ index 72eaaa1..c36c5b5 100644 - unsigned char *rej; + UCHAR *p = (UCHAR *) (buf1 + page_size) - 512; + UCHAR *rej; - + for (n = 0; n < ITERATIONS; n++) { @@ -147,18 +179,18 @@ do_random_tests (void) - rlen = random () & 63; + rlen = random () & 63; else - rlen = random () & 15; + rlen = random () & 15; - rej = buf2 + page_size - rlen - 1 - (random () & 7); + rej = (UCHAR *) (buf2 + page_size) - rlen - 1 - (random () & 7); for (i = 0; i < rlen; ++i) - { + { - rej[i] = random () & 255; + rej[i] = random () & BIG_CHAR; - if (!rej[i]) + if (!rej[i]) - rej[i] = random () & 255; + rej[i] = random () & BIG_CHAR; - if (!rej[i]) + if (!rej[i]) - rej[i] = 1 + (random () & 127); + rej[i] = 1 + (random () & SMALL_CHAR); - } + } rej[i] = '\0'; - for (c = 1; c <= 255; ++c) - if (strchr ((char *) rej, c) == NULL) + for (c = 1; c <= BIG_CHAR; ++c) + if (STRCHR ((CHAR *) rej, c) == NULL) - break; + break; j = (pos > len ? pos : len) + align + 64; if (j > 512) @@ -171,27 +203,27 @@ do_random_tests (void) - else if (i == pos + align) - p[i] = rej[random () % (rlen + 1)]; - else if (i < align || i > pos + align) + else if (i == pos + align) + p[i] = rej[random () % (rlen + 1)]; + else if (i < align || i > pos + align) - p[i] = random () & 255; + p[i] = random () & BIG_CHAR; - else - { + else + { - p[i] = random () & 255; - if (strchr ((char *) rej, p[i])) + p[i] = random () & BIG_CHAR; + if (STRCHR ((CHAR *) rej, p[i])) - { + { - p[i] = random () & 255; - if (strchr ((char *) rej, p[i])) + p[i] = random () & BIG_CHAR; + if (STRCHR ((CHAR *) rej, p[i])) - p[i] = c; - } - } - } - + p[i] = c; + } + } + } + - result = STRPBRK_RESULT ((char *) (p + align), pos < len ? pos : len); + result = STRPBRK_RESULT ((CHAR *) (p + align), pos < len ? pos : len); - + FOR_EACH_IMPL (impl, 1) - if (CALL (impl, (char *) (p + align), (char *) rej) != result) + if (CALL (impl, (CHAR *) (p + align), (CHAR *) rej) != result) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %p != %p", - n, impl->name, align, rej, rlen, pos, len, + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %p != %p", + n, impl->name, align, rej, rlen, pos, len, - (void *) CALL (impl, (char *) (p + align), (char *) rej), + (void *) CALL (impl, (CHAR *) (p + align), (CHAR *) rej), - (void *) result); - ret = 1; - } + (void *) result); + ret = 1; + } diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 9403169..5765a8c 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -12,7 +12,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strchr strchr-vx strchr-c \ - strchrnul strchrnul-vx strchrnul-c \ - strrchr strrchr-vx strrchr-c \ + strchr strchr-vx strchr-c \ + strchrnul strchrnul-vx strchrnul-c \ + strrchr strrchr-vx strrchr-c \ - strspn strspn-vx strspn-c + strspn strspn-vx strspn-c \ + strpbrk strpbrk-vx strpbrk-c endif - + ifeq ($(subdir),wcsmbs) @@ -29,5 +30,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcschr wcschr-vx wcschr-c \ - wcschrnul wcschrnul-vx wcschrnul-c \ - wcsrchr wcsrchr-vx wcsrchr-c \ + wcschr wcschr-vx wcschr-c \ + wcschrnul wcschrnul-vx wcschrnul-c \ + wcsrchr wcsrchr-vx wcsrchr-c \ - wcsspn wcsspn-vx wcsspn-c + wcsspn wcsspn-vx wcsspn-c \ + wcspbrk wcspbrk-vx wcspbrk-c @@ -546,12 +546,12 @@ index cbedf64..b39a5c5 100644 @@ -121,6 +121,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strspn); IFUNC_VX_IMPL (wcsspn); - + + IFUNC_VX_IMPL (strpbrk); + IFUNC_VX_IMPL (wcspbrk); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strpbrk-c.c b/sysdeps/s390/multiarch/strpbrk-c.c new file mode 100644 @@ -1324,14 +1324,14 @@ index 843a23c..7ecff8b 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcspbrk-ifunc.c b/wcsmbs/test-wcspbrk-ifunc.c new file mode 100644 index 0000000..af389b6 @@ -1389,14 +1389,15 @@ index a39f148..b769a38 100644 --- a/wcsmbs/wcspbrk.c +++ b/wcsmbs/wcspbrk.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCSPBRK +# define wcspbrk WCSPBRK +#endif - + /* Find the first occurrence in WCS of any wide-character in ACCEPT. */ wchar_t * --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-25.patch b/SOURCES/glibc-rh1268008-25.patch index 7f1f48a5..19d49778 100644 --- a/SOURCES/glibc-rh1268008-25.patch +++ b/SOURCES/glibc-rh1268008-25.patch @@ -62,13 +62,13 @@ index 015b5d6..4e811a9 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-strcspn.c b/benchtests/bench-strcspn.c index 22b3b84..25de640 100644 @@ -85,7 +85,7 @@ index 22b3b84..25de640 100644 +# define TEST_NAME "wcscspn" +#endif /* WIDE */ #include "bench-string.h" - + -typedef size_t (*proto_t) (const char *, const char *); -size_t simple_strcspn (const char *, const char *); -size_t stupid_strcspn (const char *, const char *); @@ -103,7 +103,7 @@ index 22b3b84..25de640 100644 +# define STUPID_STRCSPN stupid_wcscspn +# define STRLEN wcslen +#endif /* WIDE */ - + -IMPL (stupid_strcspn, 0) -IMPL (simple_strcspn, 0) -IMPL (strcspn, 1) @@ -114,7 +114,7 @@ index 22b3b84..25de640 100644 +IMPL (STUPID_STRCSPN, 0) +IMPL (SIMPLE_STRCSPN, 0) +IMPL (STRCSPN, 1) - + size_t -simple_strcspn (const char *s, const char *rej) +SIMPLE_STRCSPN (const CHAR *s, const CHAR *rej) @@ -123,12 +123,12 @@ index 22b3b84..25de640 100644 - char c; + const CHAR *r, *str = s; + CHAR c; - + while ((c = *s++) != '\0') for (r = rej; *r != '\0'; ++r) @@ -44,9 +63,9 @@ simple_strcspn (const char *s, const char *rej) } - + size_t -stupid_strcspn (const char *s, const char *rej) +STUPID_STRCSPN (const CHAR *s, const CHAR *rej) @@ -136,12 +136,12 @@ index 22b3b84..25de640 100644 - size_t ns = strlen (s), nrej = strlen (rej); + size_t ns = STRLEN (s), nrej = STRLEN (rej); size_t i, j; - + for (i = 0; i < ns; ++i) @@ -56,4 +75,6 @@ stupid_strcspn (const char *s, const char *rej) return i; } - + +#undef CHAR +#undef STRLEN #include "bench-strpbrk.c" @@ -176,9 +176,9 @@ index 6290429..0c750a8 100644 --- a/string/strcspn.c +++ b/string/strcspn.c @@ -30,12 +30,14 @@ - + #undef strcspn - + +#ifndef STRCSPN +# define STRCSPN strcspn +#endif @@ -192,7 +192,7 @@ index 6290429..0c750a8 100644 +STRCSPN (const char *s, const char *reject) { size_t count = 0; - + diff --git a/string/test-strcspn.c b/string/test-strcspn.c index e2863c7..3443425 100644 --- a/string/test-strcspn.c @@ -208,7 +208,7 @@ index e2863c7..3443425 100644 +# define TEST_NAME "wcscspn" +#endif /* WIDE */ #include "test-string.h" - + -typedef size_t (*proto_t) (const char *, const char *); -size_t simple_strcspn (const char *, const char *); -size_t stupid_strcspn (const char *, const char *); @@ -226,7 +226,7 @@ index e2863c7..3443425 100644 +# define STUPID_STRCSPN stupid_wcscspn +# define STRLEN wcslen +#endif /* WIDE */ - + -IMPL (stupid_strcspn, 0) -IMPL (simple_strcspn, 0) -IMPL (strcspn, 1) @@ -237,7 +237,7 @@ index e2863c7..3443425 100644 +IMPL (STUPID_STRCSPN, 0) +IMPL (SIMPLE_STRCSPN, 0) +IMPL (STRCSPN, 1) - + size_t -simple_strcspn (const char *s, const char *rej) +SIMPLE_STRCSPN (const CHAR *s, const CHAR *rej) @@ -246,12 +246,12 @@ index e2863c7..3443425 100644 - char c; + const CHAR *r, *str = s; + CHAR c; - + while ((c = *s++) != '\0') for (r = rej; *r != '\0'; ++r) @@ -45,9 +64,9 @@ simple_strcspn (const char *s, const char *rej) } - + size_t -stupid_strcspn (const char *s, const char *rej) +STUPID_STRCSPN (const CHAR *s, const CHAR *rej) @@ -259,12 +259,12 @@ index e2863c7..3443425 100644 - size_t ns = strlen (s), nrej = strlen (rej); + size_t ns = STRLEN (s), nrej = STRLEN (rej); size_t i, j; - + for (i = 0; i < ns; ++i) @@ -57,4 +76,6 @@ stupid_strcspn (const char *s, const char *rej) return i; } - + +#undef CHAR +#undef STRLEN #include "test-strpbrk.c" @@ -273,19 +273,19 @@ index 5765a8c..2c1fce0 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -13,7 +13,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strchrnul strchrnul-vx strchrnul-c \ - strrchr strrchr-vx strrchr-c \ - strspn strspn-vx strspn-c \ + strchrnul strchrnul-vx strchrnul-c \ + strrchr strrchr-vx strrchr-c \ + strspn strspn-vx strspn-c \ - strpbrk strpbrk-vx strpbrk-c + strpbrk strpbrk-vx strpbrk-c \ + strcspn strcspn-vx strcspn-c endif - + ifeq ($(subdir),wcsmbs) @@ -31,5 +32,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcschrnul wcschrnul-vx wcschrnul-c \ - wcsrchr wcsrchr-vx wcsrchr-c \ - wcsspn wcsspn-vx wcsspn-c \ + wcschrnul wcschrnul-vx wcschrnul-c \ + wcsrchr wcsrchr-vx wcsrchr-c \ + wcsspn wcsspn-vx wcsspn-c \ - wcspbrk wcspbrk-vx wcspbrk-c + wcspbrk wcspbrk-vx wcspbrk-c \ + wcscspn wcscspn-vx wcscspn-c @@ -297,12 +297,12 @@ index b39a5c5..7f62e49 100644 @@ -124,6 +124,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strpbrk); IFUNC_VX_IMPL (wcspbrk); - + + IFUNC_VX_IMPL (strcspn); + IFUNC_VX_IMPL (wcscspn); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/strcspn-c.c b/sysdeps/s390/multiarch/strcspn-c.c new file mode 100644 @@ -1027,15 +1027,15 @@ index 7ecff8b..9730b00 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -42,7 +42,8 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - mbrtoc16 c16rtomb - + mbrtoc16 c16rtomb + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \ + wcscspn tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wcscspn-ifunc.c b/wcsmbs/test-wcscspn-ifunc.c new file mode 100644 index 0000000..e5dcdaf @@ -1093,14 +1093,15 @@ index 5d38d07..9e84226 100644 --- a/wcsmbs/wcscspn.c +++ b/wcsmbs/wcscspn.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WCSCSPN +# define wcscspn WCSCSPN +#endif - + /* Return the length of the maximum initial segment of WCS which contains only wide-characters not in REJECT. */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-26.patch b/SOURCES/glibc-rh1268008-26.patch index ac0c371c..207511b0 100644 --- a/SOURCES/glibc-rh1268008-26.patch +++ b/SOURCES/glibc-rh1268008-26.patch @@ -74,14 +74,14 @@ index 4e811a9..b4b3127 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,7 +39,8 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ + wmemchr string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-memchr.c b/benchtests/bench-memchr.c index 30c472c..84a90b4 100644 @@ -90,7 +90,7 @@ index 30c472c..84a90b4 100644 @@ -16,31 +16,51 @@ License along with the GNU C Library; if not, see . */ - + +#ifndef WIDE +# define CHAR char +# define SMALL_CHAR 127 @@ -108,7 +108,7 @@ index 30c472c..84a90b4 100644 +# define TEST_NAME "wmemchr" +# endif /* WIDE */ # include "bench-string.h" - + -typedef char *(*proto_t) (const char *, int, size_t); -char *simple_memchr (const char *, int, size_t); +# ifndef WIDE @@ -118,12 +118,12 @@ index 30c472c..84a90b4 100644 +# define MEMCHR wmemchr +# define SIMPLE_MEMCHR simple_wmemchr +# endif /* WIDE */ - + -IMPL (simple_memchr, 0) -IMPL (memchr, 1) +typedef CHAR *(*proto_t) (const CHAR *, int, size_t); +CHAR *SIMPLE_MEMCHR (const CHAR *, int, size_t); - + -char * -simple_memchr (const char *s, int c, size_t n) +IMPL (SIMPLE_MEMCHR, 0) @@ -141,7 +141,7 @@ index 30c472c..84a90b4 100644 } -#endif +#endif /* !USE_AS_MEMRCHR */ - + static void -do_one_test (impl_t *impl, const char *s, int c, size_t n, char *exp_res) +do_one_test (impl_t *impl, const CHAR *s, int c, size_t n, CHAR *exp_res) @@ -150,19 +150,19 @@ index 30c472c..84a90b4 100644 + CHAR *res = CALL (impl, s, c, n); size_t i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; - + @@ -68,36 +88,38 @@ static void do_test (size_t align, size_t pos, size_t len, int seek_char) { size_t i; - char *result; + CHAR *result; - + align &= 7; - if (align + len >= page_size) + if ((align + len) * sizeof (CHAR) >= page_size) return; - + + CHAR *buf = (CHAR *) (buf1); + for (i = 0; i < len; ++i) @@ -176,7 +176,7 @@ index 30c472c..84a90b4 100644 } - buf1[align + len] = 0; + buf[align + len] = 0; - + if (pos < len) { - buf1[align + pos] = seek_char; @@ -192,13 +192,13 @@ index 30c472c..84a90b4 100644 - buf1[align + len] = seek_char; + buf[align + len] = seek_char; } - + printf ("Length %4zd, alignment %2zd:", pos, align); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) (buf1 + align), seek_char, len, result); + do_one_test (impl, (CHAR *) (buf + align), seek_char, len, result); - + putchar ('\n'); } diff --git a/benchtests/bench-wmemchr.c b/benchtests/bench-wmemchr.c @@ -233,7 +233,7 @@ index cdcceeb..058a837 100644 +++ b/string/test-memchr.c @@ -18,28 +18,49 @@ . */ - + #define TEST_MAIN -#define TEST_NAME "memchr" +#ifndef WIDE @@ -242,7 +242,7 @@ index cdcceeb..058a837 100644 +# define TEST_NAME "wmemchr" +#endif /* WIDE */ #include "test-string.h" - + -typedef char *(*proto_t) (const char *, int, size_t); -char *simple_memchr (const char *, int, size_t); - @@ -284,7 +284,7 @@ index cdcceeb..058a837 100644 + return (CHAR *) s - 1; return NULL; } - + static void -do_one_test (impl_t *impl, const char *s, int c, size_t n, char *exp_res) +do_one_test (impl_t *impl, const CHAR *s, int c, size_t n, CHAR *exp_res) @@ -300,12 +300,12 @@ index cdcceeb..058a837 100644 size_t i; - char *result; + CHAR *result; - + align &= 7; - if (align + len >= page_size) + if ((align + len) * sizeof (CHAR) >= page_size) return; - + + CHAR *buf = (CHAR *) (buf1); + for (i = 0; i < len; ++i) @@ -319,7 +319,7 @@ index cdcceeb..058a837 100644 } - buf1[align + len] = 0; + buf[align + len] = 0; - + if (pos < len) { - buf1[align + pos] = seek_char; @@ -335,12 +335,12 @@ index cdcceeb..058a837 100644 - buf1[align + len] = seek_char; + buf[align + len] = seek_char; } - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) (buf1 + align), seek_char, len, result); + do_one_test (impl, (CHAR *) (buf + align), seek_char, len, result); } - + static void @@ -88,8 +111,8 @@ do_random_tests (void) { @@ -350,12 +350,12 @@ index cdcceeb..058a837 100644 - unsigned char *p = buf1 + page_size - 512; + CHAR *result; + UCHAR *p = (UCHAR *) (buf1 + page_size) - 512; - + for (n = 0; n < ITERATIONS; n++) { @@ -101,11 +124,11 @@ do_random_tests (void) if (pos >= len) - len = pos + (random () & 7); + len = pos + (random () & 7); if (len + align >= 512) - len = 512 - align - (random () & 7); - seek_char = random () & 255; @@ -365,58 +365,58 @@ index cdcceeb..058a837 100644 if (j > 512) - j = 512; + j = 512; - + for (i = 0; i < j; i++) - { + { @@ -113,7 +136,7 @@ do_random_tests (void) - p[i] = seek_char; - else - { + p[i] = seek_char; + else + { - p[i] = random () & 255; + p[i] = random () & BIG_CHAR; - if (i < pos + align && p[i] == seek_char) - p[i] = seek_char + 13; - } + if (i < pos + align && p[i] == seek_char) + p[i] = seek_char + 13; + } @@ -124,17 +147,17 @@ do_random_tests (void) - size_t r = random (); - if ((r & 31) == 0) - len = ~(uintptr_t) (p + align) - ((r >> 5) & 31); + size_t r = random (); + if ((r & 31) == 0) + len = ~(uintptr_t) (p + align) - ((r >> 5) & 31); - result = (char *) (p + pos + align); + result = (CHAR *) (p + pos + align); - } + } else - result = NULL; - + result = NULL; + FOR_EACH_IMPL (impl, 1) - if (CALL (impl, (char *) (p + align), seek_char, len) != result) + if (CALL (impl, (CHAR *) (p + align), seek_char, len) != result) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p", - n, impl->name, align, seek_char, len, pos, + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p", + n, impl->name, align, seek_char, len, pos, - CALL (impl, (char *) (p + align), seek_char, len), + CALL (impl, (CHAR *) (p + align), seek_char, len), - result, p); - ret = 1; - } + result, p); + ret = 1; + } diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile index 2c1fce0..4a04c34 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -14,7 +14,9 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strrchr strrchr-vx strrchr-c \ - strspn strspn-vx strspn-c \ - strpbrk strpbrk-vx strpbrk-c \ + strrchr strrchr-vx strrchr-c \ + strspn strspn-vx strspn-c \ + strpbrk strpbrk-vx strpbrk-c \ - strcspn strcspn-vx strcspn-c + strcspn strcspn-vx strcspn-c \ + memchr memchr-vx \ + rawmemchr rawmemchr-vx rawmemchr-c endif - + ifeq ($(subdir),wcsmbs) @@ -33,5 +35,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsrchr wcsrchr-vx wcsrchr-c \ - wcsspn wcsspn-vx wcsspn-c \ - wcspbrk wcspbrk-vx wcspbrk-c \ + wcsrchr wcsrchr-vx wcsrchr-c \ + wcsspn wcsspn-vx wcsspn-c \ + wcspbrk wcspbrk-vx wcspbrk-c \ - wcscspn wcscspn-vx wcscspn-c + wcscspn wcscspn-vx wcscspn-c \ + wmemchr wmemchr-vx wmemchr-c @@ -428,13 +428,13 @@ index 7f62e49..d4c7c0d 100644 @@ -127,6 +127,10 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (strcspn); IFUNC_VX_IMPL (wcscspn); - + + IFUNC_VX_IMPL (memchr); + IFUNC_VX_IMPL (wmemchr); + IFUNC_VX_IMPL (rawmemchr); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/memchr-vx.S b/sysdeps/s390/multiarch/memchr-vx.S new file mode 100644 @@ -1104,14 +1104,14 @@ index 9730b00..f8bc401 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -43,7 +43,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \ + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \ - wcscspn + wcscspn wmemchr tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wmemchr-ifunc.c b/wcsmbs/test-wmemchr-ifunc.c new file mode 100644 index 0000000..4b40871 @@ -1169,9 +1169,9 @@ index 99ebed4..905a321 100644 --- a/wcsmbs/wmemchr.c +++ b/wcsmbs/wmemchr.c @@ -18,6 +18,10 @@ - + #include - + +#ifdef WMEMCHR +# define wmemchr WMEMCHR +#endif @@ -1179,5 +1179,6 @@ index 99ebed4..905a321 100644 wchar_t * wmemchr (s, c, n) register const wchar_t *s; --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-27.patch b/SOURCES/glibc-rh1268008-27.patch index 3d62e8e2..49e382cd 100644 --- a/SOURCES/glibc-rh1268008-27.patch +++ b/SOURCES/glibc-rh1268008-27.patch @@ -38,7 +38,7 @@ index a8649ff..78c13b6 100644 @@ -20,6 +20,10 @@ #undef __memccpy #undef memccpy - + +#ifdef MEMCCPY +# define __memccpy MEMCCPY +#endif @@ -51,14 +51,14 @@ index 4a04c34..87dff0f 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -16,7 +16,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strpbrk strpbrk-vx strpbrk-c \ - strcspn strcspn-vx strcspn-c \ - memchr memchr-vx \ + strpbrk strpbrk-vx strpbrk-c \ + strcspn strcspn-vx strcspn-c \ + memchr memchr-vx \ - rawmemchr rawmemchr-vx rawmemchr-c + rawmemchr rawmemchr-vx rawmemchr-c \ + memccpy memccpy-vx memccpy-c endif - + ifeq ($(subdir),wcsmbs) diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c index d4c7c0d..c90fb6b 100644 @@ -67,11 +67,11 @@ index d4c7c0d..c90fb6b 100644 @@ -131,6 +131,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_VX_IMPL (wmemchr); IFUNC_VX_IMPL (rawmemchr); - + + IFUNC_VX_IMPL (memccpy); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/memccpy-c.c b/sysdeps/s390/multiarch/memccpy-c.c new file mode 100644 @@ -302,5 +302,6 @@ index 0000000..746bc25 +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-28.patch b/SOURCES/glibc-rh1268008-28.patch index c37faf60..adc3e26c 100644 --- a/SOURCES/glibc-rh1268008-28.patch +++ b/SOURCES/glibc-rh1268008-28.patch @@ -52,13 +52,13 @@ index b4b3127..b5edfdd 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -40,7 +40,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ - wmemchr + wmemchr wmemset string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-memset.c b/benchtests/bench-memset.c index 9786ce7..66c3c45 100644 @@ -78,7 +78,7 @@ index 9786ce7..66c3c45 100644 +#endif /* !TEST_BZERO */ #define MIN_PAGE_SIZE 131072 #include "bench-string.h" - + -char *simple_memset (char *, int, size_t); +#ifndef WIDE +# define MEMSET memset @@ -94,7 +94,7 @@ index 9786ce7..66c3c45 100644 +#endif /* WIDE */ + +CHAR *SIMPLE_MEMSET (CHAR *, int, size_t); - + #ifdef TEST_BZERO typedef void (*proto_t) (char *, size_t); @@ -39,7 +56,7 @@ IMPL (bzero, 1) @@ -104,7 +104,7 @@ index 9786ce7..66c3c45 100644 - simple_memset (s, 0, n); + SIMPLE_MEMSET (s, 0, n); } - + void @@ -48,46 +65,50 @@ builtin_bzero (char *s, size_t n) __builtin_bzero (s, n); @@ -113,7 +113,7 @@ index 9786ce7..66c3c45 100644 -typedef char *(*proto_t) (char *, int, size_t); -char *builtin_memset (char *, int, size_t); +typedef CHAR *(*proto_t) (CHAR *, int, size_t); - + -IMPL (simple_memset, 0) +IMPL (SIMPLE_MEMSET, 0) +# ifndef WIDE @@ -122,7 +122,7 @@ index 9786ce7..66c3c45 100644 -IMPL (memset, 1) +# endif /* !WIDE */ +IMPL (MEMSET, 1) - + +# ifndef WIDE char * builtin_memset (char *s, int c, size_t n) @@ -132,7 +132,7 @@ index 9786ce7..66c3c45 100644 -#endif +# endif /* !WIDE */ +#endif /* !TEST_BZERO */ - + -char * +CHAR * inhibit_loop_to_libcall @@ -145,7 +145,7 @@ index 9786ce7..66c3c45 100644 *r++ = c; return s; } - + static void -do_one_test (impl_t *impl, char *s, int c __attribute ((unused)), size_t n) +do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n) @@ -179,7 +179,7 @@ index 9786ce7..66c3c45 100644 +#endif /* !TEST_BZERO */ } TIMING_NOW (stop); - + @@ -114,13 +135,13 @@ static void do_test (size_t align, int c, size_t len) { @@ -187,13 +187,13 @@ index 9786ce7..66c3c45 100644 - if (align + len > page_size) + if ((align + len) * sizeof (CHAR) > page_size) return; - + printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c); - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) buf1 + align, c, len); + do_one_test (impl, (CHAR *) (buf1) + align, c, len); - + putchar ('\n'); } diff --git a/benchtests/bench-wmemset.c b/benchtests/bench-wmemset.c @@ -240,7 +240,7 @@ index e556a88..99fc282 100644 +#endif /* !TEST_BZERO */ #define MIN_PAGE_SIZE 131072 #include "test-string.h" - + -char *simple_memset (char *, int, size_t); +#ifndef WIDE +# define MEMSET memset @@ -260,7 +260,7 @@ index e556a88..99fc282 100644 +#endif /* WIDE */ + +CHAR *SIMPLE_MEMSET (CHAR *, int, size_t); - + #ifdef TEST_BZERO typedef void (*proto_t) (char *, size_t); @@ -40,7 +61,7 @@ IMPL (bzero, 1) @@ -270,7 +270,7 @@ index e556a88..99fc282 100644 - simple_memset (s, 0, n); + SIMPLE_MEMSET (s, 0, n); } - + void @@ -49,44 +70,48 @@ builtin_bzero (char *s, size_t n) __builtin_bzero (s, n); @@ -279,7 +279,7 @@ index e556a88..99fc282 100644 -typedef char *(*proto_t) (char *, int, size_t); -char *builtin_memset (char *, int, size_t); +typedef CHAR *(*proto_t) (CHAR *, int, size_t); - + -IMPL (simple_memset, 0) +IMPL (SIMPLE_MEMSET, 0) +# ifndef WIDE @@ -288,7 +288,7 @@ index e556a88..99fc282 100644 -IMPL (memset, 1) +# endif /* !WIDE */ +IMPL (MEMSET, 1) - + +# ifndef WIDE char * builtin_memset (char *s, int c, size_t n) @@ -298,7 +298,7 @@ index e556a88..99fc282 100644 -#endif +# endif /* !WIDE */ +#endif /* !TEST_BZERO */ - + -char * +CHAR * inhibit_loop_to_libcall @@ -311,7 +311,7 @@ index e556a88..99fc282 100644 *r++ = c; return s; } - + static void -do_one_test (impl_t *impl, char *s, int c __attribute ((unused)), size_t n) +do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n) @@ -342,12 +342,12 @@ index e556a88..99fc282 100644 - if (align + len > page_size) + if ((align + len) * sizeof (CHAR) > page_size) return; - + FOR_EACH_IMPL (impl, 0) - do_one_test (impl, (char *) buf1 + align, c, len); + do_one_test (impl, (CHAR *) (buf1) + align, c, len); } - + #ifndef TEST_BZERO @@ -111,18 +136,19 @@ do_random_tests (void) { @@ -356,19 +356,19 @@ index e556a88..99fc282 100644 - unsigned char *p, *res; + UCHAR *p, *res; + UCHAR *p2 = (UCHAR *) buf2; - + - for (i = 0; i < 65536; ++i) - buf2[i] = random () & 255; + for (i = 0; i < 65536 / sizeof (CHAR); ++i) + p2[i] = random () & BIG_CHAR; - + for (n = 0; n < ITERATIONS; n++) { if ((random () & 31) == 0) - size = 65536; + size = 65536 / sizeof (CHAR); else - size = 512; + size = 512; - p = buf1 + page_size - size; + p = (UCHAR *) (buf1 + page_size) - size; len = random () & (size - 1); @@ -376,7 +376,7 @@ index e556a88..99fc282 100644 if (align > size) @@ -132,10 +158,10 @@ do_random_tests (void) if ((random () & 7) == 0) - c = 0; + c = 0; else - c = random () & 255; - o = random () & 255; @@ -387,28 +387,28 @@ index e556a88..99fc282 100644 + o = (c + 1) & BIG_CHAR; j = len + align + 128; if (j > size) - j = size; + j = size; @@ -152,11 +178,11 @@ do_random_tests (void) - { - for (i = 0; i < len; ++i) - { + { + for (i = 0; i < len; ++i) + { - p[i + align] = buf2[i]; + p[i + align] = p2[i]; - if (p[i + align] == c) - p[i + align] = o; - } + if (p[i + align] == c) + p[i + align] = o; + } - res = (unsigned char *) CALL (impl, (char *) p + align, c, len); + res = (UCHAR *) CALL (impl, (CHAR *) p + align, c, len); - if (res != p + align) - { - error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd) %p != %p", + if (res != p + align) + { + error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd) %p != %p", @@ -190,7 +216,7 @@ do_random_tests (void) - } + } } } -#endif +#endif /* !TEST_BZERO */ - + int test_main (void) diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile @@ -416,9 +416,9 @@ index 87dff0f..eac88e0 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -37,5 +37,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcsspn wcsspn-vx wcsspn-c \ - wcspbrk wcspbrk-vx wcspbrk-c \ - wcscspn wcscspn-vx wcscspn-c \ + wcsspn wcsspn-vx wcsspn-c \ + wcspbrk wcspbrk-vx wcspbrk-c \ + wcscspn wcscspn-vx wcscspn-c \ - wmemchr wmemchr-vx wmemchr-c + wmemchr wmemchr-vx wmemchr-c \ + wmemset wmemset-vx wmemset-c @@ -428,13 +428,13 @@ index c90fb6b..44d534b 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -133,6 +133,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + IFUNC_VX_IMPL (memccpy); - + + IFUNC_VX_IMPL (wmemset); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/wmemset-c.c b/sysdeps/s390/multiarch/wmemset-c.c new file mode 100644 @@ -659,14 +659,14 @@ index f8bc401..1ca3ace 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -43,7 +43,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ - + strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \ - wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \ + wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \ - wcscspn wmemchr + wcscspn wmemchr wmemset tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ - tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) + tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) diff --git a/wcsmbs/test-wmemset-ifunc.c b/wcsmbs/test-wmemset-ifunc.c new file mode 100644 index 0000000..b58b6bd @@ -724,14 +724,15 @@ index cc9a725..8049bb8 100644 --- a/wcsmbs/wmemset.c +++ b/wcsmbs/wmemset.c @@ -18,6 +18,9 @@ - + #include - + +#ifdef WMEMSET +# define wmemset WMEMSET +#endif - + wchar_t * wmemset (s, c, n) --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-29.patch b/SOURCES/glibc-rh1268008-29.patch index 1e6318c0..972c8a65 100644 --- a/SOURCES/glibc-rh1268008-29.patch +++ b/SOURCES/glibc-rh1268008-29.patch @@ -39,13 +39,13 @@ index b5edfdd..911b6df 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -40,7 +40,7 @@ string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ - strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok + strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok wcsmbs-bench := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ - wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ + wcsncmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ - wmemchr wmemset + wmemchr wmemset wmemcmp string-bench-all := $(string-bench) ${wcsmbs-bench} - + stdlib-bench := strtod diff --git a/benchtests/bench-wmemcmp.c b/benchtests/bench-wmemcmp.c new file mode 100644 @@ -78,9 +78,9 @@ index eac88e0..929a545 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -38,5 +38,6 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wcspbrk wcspbrk-vx wcspbrk-c \ - wcscspn wcscspn-vx wcscspn-c \ - wmemchr wmemchr-vx wmemchr-c \ + wcspbrk wcspbrk-vx wcspbrk-c \ + wcscspn wcscspn-vx wcscspn-c \ + wmemchr wmemchr-vx wmemchr-c \ - wmemset wmemset-vx wmemset-c + wmemset wmemset-vx wmemset-c \ + wmemcmp wmemcmp-vx wmemcmp-c @@ -90,13 +90,13 @@ index 44d534b..5ea258b 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -135,6 +135,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + IFUNC_VX_IMPL (wmemset); - + + IFUNC_VX_IMPL (wmemcmp); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/wmemcmp-c.c b/sysdeps/s390/multiarch/wmemcmp-c.c new file mode 100644 @@ -318,5 +318,6 @@ index 0000000..24a57e9 +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-3.patch b/SOURCES/glibc-rh1268008-3.patch index 77266749..8ce96ac5 100644 --- a/SOURCES/glibc-rh1268008-3.patch +++ b/SOURCES/glibc-rh1268008-3.patch @@ -32,7 +32,7 @@ index 9ff84a3..b6eabe5 100644 --- a/sysdeps/s390/s390-32/memcmp.S +++ b/sysdeps/s390/s390-32/memcmp.S @@ -27,7 +27,7 @@ - + .text #ifdef USE_MULTIARCH -ENTRY(memcmp_g5) @@ -55,7 +55,7 @@ index 90cc4cb..a3b1ace 100644 +++ b/sysdeps/s390/s390-32/memcpy.S @@ -26,7 +26,7 @@ %r4 = number of bytes to copy. */ - + #ifdef USE_MULTIARCH -ENTRY(memcpy_g5) +ENTRY(__memcpy_g5) @@ -81,7 +81,7 @@ index 90cc4cb..a3b1ace 100644 END(memcpy) libc_hidden_builtin_def (memcpy) #endif - + -ENTRY(memcpy_mvcle) +ENTRY(__memcpy_mvcle) # Using as standalone function will result in unexpected @@ -99,7 +99,7 @@ index 31a70f0..a73dc6c 100644 +++ b/sysdeps/s390/s390-32/memset.S @@ -28,7 +28,7 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(memset_g5) +ENTRY(__memset_g5) @@ -127,7 +127,7 @@ index 42ca8da..522c63c 100644 + ".set " #FUNC ",__resolve_" #FUNC "\n\t" \ ".globl __GI_" #FUNC "\n\t" \ ".set __GI_" #FUNC "," #FUNC "\n"); \ - \ + \ /* Make the declarations of the optimized functions hidden in order to prevent GOT slots being generated for them. */ \ - extern void *FUNC##_z196 attribute_hidden; \ @@ -136,39 +136,39 @@ index 42ca8da..522c63c 100644 + extern void *__##FUNC##_z196 attribute_hidden; \ + extern void *__##FUNC##_z10 attribute_hidden; \ + extern void *__##FUNC##_g5 attribute_hidden; \ - \ + \ - void *resolve_##FUNC (unsigned long int dl_hwcap) \ + void *__resolve_##FUNC (unsigned long int dl_hwcap) \ { \ if ((dl_hwcap & HWCAP_S390_STFLE) \ - && (dl_hwcap & HWCAP_S390_ZARCH) \ + && (dl_hwcap & HWCAP_S390_ZARCH) \ @@ -53,11 +53,11 @@ - : : "cc"); \ - \ - if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z196))) != 0) \ + : : "cc"); \ + \ + if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z196))) != 0) \ - return &FUNC##_z196; \ + return &__##FUNC##_z196; \ - else if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z10))) != 0) \ + else if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z10))) != 0) \ - return &FUNC##_z10; \ + return &__##FUNC##_z10; \ } \ - return &FUNC##_g5; \ + return &__##FUNC##_g5; \ } - + IFUNC_RESOLVE(memset) diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.S b/sysdeps/s390/s390-32/multiarch/memcmp.S index 9ca8891..c654d19 100644 --- a/sysdeps/s390/s390-32/multiarch/memcmp.S +++ b/sysdeps/s390/s390-32/multiarch/memcmp.S @@ -29,7 +29,7 @@ - + #ifndef NOT_IN_libc - + -ENTRY(memcmp_z196) +ENTRY(__memcmp_z196) - .machine "z196" - .machinemode "zarch_nohighgprs" + .machine "z196" + .machinemode "zarch_nohighgprs" ltr %r4,%r4 @@ -61,9 +61,9 @@ ENTRY(memcmp_z196) br %r14 @@ -176,11 +176,11 @@ index 9ca8891..c654d19 100644 clc 0(1,%r3),0(%r2) -END(memcmp_z196) +END(__memcmp_z196) - + -ENTRY(memcmp_z10) +ENTRY(__memcmp_z10) - .machine "z10" - .machinemode "zarch_nohighgprs" + .machine "z10" + .machinemode "zarch_nohighgprs" ltr %r4,%r4 @@ -90,7 +90,7 @@ ENTRY(memcmp_z10) j .L_Z10_3 @@ -188,11 +188,11 @@ index 9ca8891..c654d19 100644 clc 0(1,%r3),0(%r2) -END(memcmp_z10) +END(__memcmp_z10) - + #endif - + @@ -98,7 +98,7 @@ END(memcmp_z10) - + #ifdef NOT_IN_libc .globl memcmp -.set memcmp,memcmp_g5 @@ -206,13 +206,13 @@ index 7b85602..5c2113f 100644 --- a/sysdeps/s390/s390-32/multiarch/memcpy.S +++ b/sysdeps/s390/s390-32/multiarch/memcpy.S @@ -29,7 +29,7 @@ - + #if defined SHARED && !defined NOT_IN_libc - + -ENTRY(memcpy_z196) +ENTRY(__memcpy_z196) - .machine "z196" - .machinemode "zarch_nohighgprs" + .machine "z196" + .machinemode "zarch_nohighgprs" llgfr %r4,%r4 @@ -46,7 +46,7 @@ ENTRY(memcpy_z196) br %r14 @@ -229,11 +229,11 @@ index 7b85602..5c2113f 100644 mvc 0(1,%r1),0(%r3) -END(memcpy_z196) +END(__memcpy_z196) - + -ENTRY(memcpy_z10) +ENTRY(__memcpy_z10) - .machine "z10" - .machinemode "zarch_nohighgprs" + .machine "z10" + .machinemode "zarch_nohighgprs" llgfr %r4,%r4 @@ -75,7 +75,7 @@ ENTRY(memcpy_z10) br %r14 @@ -250,11 +250,11 @@ index 7b85602..5c2113f 100644 mvc 0(1,%r1),0(%r3) -END(memcpy_z10) +END(__memcpy_z10) - + #endif - + @@ -94,5 +94,5 @@ END(memcpy_z10) - + #if !defined SHARED || defined NOT_IN_libc .globl memcpy -.set memcpy,memcpy_g5 @@ -265,18 +265,18 @@ index ba43d67..54aa028 100644 --- a/sysdeps/s390/s390-32/multiarch/memset.S +++ b/sysdeps/s390/s390-32/multiarch/memset.S @@ -29,7 +29,7 @@ - + #ifndef NOT_IN_libc - + -ENTRY(memset_z196) +ENTRY(__memset_z196) - .machine "z196" - .machinemode "zarch_nohighgprs" + .machine "z196" + .machinemode "zarch_nohighgprs" llgfr %r4,%r4 @@ -49,7 +49,7 @@ ENTRY(memset_z196) br %r14 .L_Z196_1: - cgfi %r5,1048576 + cgfi %r5,1048576 - jh memset_mvcle # Switch to mvcle for >256MB + jh __memset_mvcle # Switch to mvcle for >256MB .L_Z196_2: @@ -288,16 +288,16 @@ index ba43d67..54aa028 100644 mvc 1(1,%r1),0(%r1) -END(memset_z196) +END(__memset_z196) - + -ENTRY(memset_z10) +ENTRY(__memset_z10) - .machine "z10" - .machinemode "zarch_nohighgprs" + .machine "z10" + .machinemode "zarch_nohighgprs" llgfr %r4,%r4 @@ -78,7 +78,7 @@ ENTRY(memset_z10) br %r14 .L_Z10_15: - cgfi %r5,163840 # Switch to mvcle for >40MB + cgfi %r5,163840 # Switch to mvcle for >40MB - jh memset_mvcle + jh __memset_mvcle .L_Z10_14: @@ -309,23 +309,23 @@ index ba43d67..54aa028 100644 mvc 1(1,%r1),0(%r1) -END(memset_z10) +END(__memset_z10) - + -ENTRY(memset_mvcle) +ENTRY(__memset_mvcle) - ahi %r4,2 # take back the change done by the caller - lr %r0,%r2 # save source address - lr %r1,%r3 # move pad byte to R1 + ahi %r4,2 # take back the change done by the caller + lr %r0,%r2 # save source address + lr %r1,%r3 # move pad byte to R1 @@ -101,7 +101,7 @@ ENTRY(memset_mvcle) - lr %r2,%r0 # return value is source address + lr %r2,%r0 # return value is source address .L1: - br %r14 + br %r14 -END(memset_mvcle) +END(__memset_mvcle) - + #endif - + @@ -109,5 +109,5 @@ END(memset_mvcle) - + #ifdef NOT_IN_libc .globl memset -.set memset,memset_g5 @@ -336,7 +336,7 @@ index 1b43440..eb5370f 100644 --- a/sysdeps/s390/s390-64/memcmp.S +++ b/sysdeps/s390/s390-64/memcmp.S @@ -27,7 +27,7 @@ - + .text #ifdef USE_MULTIARCH -ENTRY(memcmp_z900) @@ -359,7 +359,7 @@ index bae8836..61fca0b 100644 +++ b/sysdeps/s390/s390-64/memcpy.S @@ -29,7 +29,7 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(memcpy_z900) +ENTRY(__memcpy_z900) @@ -377,7 +377,7 @@ index bae8836..61fca0b 100644 la %r1,256(%r1) @@ -59,13 +59,13 @@ ENTRY(memcpy) mvc 0(1,%r1),0(%r3) - + #ifdef USE_MULTIARCH -END(memcpy_z900) +END(__memcpy_z900) @@ -385,7 +385,7 @@ index bae8836..61fca0b 100644 END(memcpy) libc_hidden_builtin_def (memcpy) #endif - + -ENTRY(memcpy_mvcle) +ENTRY(__memcpy_mvcle) # Using as standalone function will result in unexpected @@ -403,7 +403,7 @@ index 4edfb4e..8185e94 100644 +++ b/sysdeps/s390/s390-64/memset.S @@ -29,7 +29,7 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(memset_z900) +ENTRY(__memset_z900) @@ -431,7 +431,7 @@ index 8db2c38..b6be970 100644 + ".set " #FUNC ",__resolve_" #FUNC "\n\t" \ ".globl __GI_" #FUNC "\n\t" \ ".set __GI_" #FUNC "," #FUNC "\n"); \ - \ + \ /* Make the declarations of the optimized functions hidden in order to prevent GOT slots being generated for them. */ \ - extern void *FUNC##_z196 attribute_hidden; \ @@ -440,22 +440,22 @@ index 8db2c38..b6be970 100644 + extern void *__##FUNC##_z196 attribute_hidden; \ + extern void *__##FUNC##_z10 attribute_hidden; \ + extern void *__##FUNC##_z900 attribute_hidden; \ - \ + \ - void *resolve_##FUNC (unsigned long int dl_hwcap) \ + void *__resolve_##FUNC (unsigned long int dl_hwcap) \ { \ if (dl_hwcap & HWCAP_S390_STFLE) \ { \ @@ -54,14 +54,14 @@ - : : "cc"); \ - \ - if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) \ + : : "cc"); \ + \ + if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) \ - return &FUNC##_z196; \ + return &__##FUNC##_z196; \ - else if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z10))) != 0) \ + else if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z10))) != 0) \ - return &FUNC##_z10; \ + return &__##FUNC##_z10; \ - else \ + else \ - return &FUNC##_z900; \ + return &__##FUNC##_z900; \ } \ @@ -463,19 +463,19 @@ index 8db2c38..b6be970 100644 - return &FUNC##_z900; \ + return &__##FUNC##_z900; \ } - + IFUNC_RESOLVE(memset) diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.S b/sysdeps/s390/s390-64/multiarch/memcmp.S index f40a3c1..9a8cba8 100644 --- a/sysdeps/s390/s390-64/multiarch/memcmp.S +++ b/sysdeps/s390/s390-64/multiarch/memcmp.S @@ -29,7 +29,7 @@ - + #ifndef NOT_IN_libc - + -ENTRY(memcmp_z196) +ENTRY(__memcmp_z196) - .machine "z196" + .machine "z196" ltgr %r4,%r4 je .L_Z196_4 @@ -60,9 +60,9 @@ ENTRY(memcmp_z196) @@ -484,10 +484,10 @@ index f40a3c1..9a8cba8 100644 clc 0(1,%r3),0(%r2) -END(memcmp_z196) +END(__memcmp_z196) - + -ENTRY(memcmp_z10) +ENTRY(__memcmp_z10) - .machine "z10" + .machine "z10" ltgr %r4,%r4 je .L_Z10_4 @@ -87,7 +87,7 @@ ENTRY(memcmp_z10) @@ -496,11 +496,11 @@ index f40a3c1..9a8cba8 100644 clc 0(1,%r3),0(%r2) -END(memcmp_z10) +END(__memcmp_z10) - + #endif - + @@ -95,7 +95,7 @@ END(memcmp_z10) - + #ifdef NOT_IN_libc .globl memcmp -.set memcmp,memcmp_z900 @@ -514,9 +514,9 @@ index b00ffc1..525588f 100644 --- a/sysdeps/s390/s390-64/multiarch/memcpy.S +++ b/sysdeps/s390/s390-64/multiarch/memcpy.S @@ -29,7 +29,7 @@ - + #if defined SHARED && !defined NOT_IN_libc - + -ENTRY(memcpy_z196) +ENTRY(__memcpy_z196) .machine "z196" @@ -537,10 +537,10 @@ index b00ffc1..525588f 100644 mvc 0(1,%r1),0(%r3) -END(memcpy_z196) +END(__memcpy_z196) - + -ENTRY(memcpy_z10) +ENTRY(__memcpy_z10) - .machine "z10" + .machine "z10" cgije %r4,0,.L_Z10_4 aghi %r4,-1 @@ -71,7 +71,7 @@ ENTRY(memcpy_z10) @@ -558,11 +558,11 @@ index b00ffc1..525588f 100644 mvc 0(1,%r1),0(%r3) -END(memcpy_z10) +END(__memcpy_z10) - + #endif - + @@ -90,5 +90,5 @@ END(memcpy_z10) - + #if !defined SHARED || defined NOT_IN_libc .globl memcpy -.set memcpy,memcpy_z900 @@ -573,18 +573,18 @@ index 1f9064d..8dbb3cb 100644 --- a/sysdeps/s390/s390-64/multiarch/memset.S +++ b/sysdeps/s390/s390-64/multiarch/memset.S @@ -29,7 +29,7 @@ - + #ifndef NOT_IN_libc - + -ENTRY(memset_z196) +ENTRY(__memset_z196) - .machine "z196" + .machine "z196" ltgr %r4,%r4 je .L_Z196_4 @@ -47,7 +47,7 @@ ENTRY(memset_z196) br %r14 .L_Z196_1: - cgfi %r5,1048576 + cgfi %r5,1048576 - jh memset_mvcle # Switch to mvcle for >256MB + jh __memset_mvcle # Switch to mvcle for >256MB .L_Z196_2: @@ -596,16 +596,16 @@ index 1f9064d..8dbb3cb 100644 mvc 1(1,%r1),0(%r1) -END(memset_z196) +END(__memset_z196) - + -ENTRY(memset_z10) +ENTRY(__memset_z10) - .machine "z10" + .machine "z10" cgije %r4,0,.L_Z10_4 stc %r3,0(%r2) @@ -74,7 +74,7 @@ ENTRY(memset_z10) br %r14 .L_Z10_15: - cgfi %r5,163840 # Switch to mvcle for >40MB + cgfi %r5,163840 # Switch to mvcle for >40MB - jh memset_mvcle + jh __memset_mvcle .L_Z10_14: @@ -617,27 +617,28 @@ index 1f9064d..8dbb3cb 100644 mvc 1(1,%r1),0(%r1) -END(memset_z10) +END(__memset_z10) - + -ENTRY(memset_mvcle) +ENTRY(__memset_mvcle) - aghi %r4,2 # take back the change done by the caller - lgr %r0,%r2 # save source address - lgr %r1,%r3 # move pad byte to R1 + aghi %r4,2 # take back the change done by the caller + lgr %r0,%r2 # save source address + lgr %r1,%r3 # move pad byte to R1 @@ -97,7 +97,7 @@ ENTRY(memset_mvcle) - lgr %r2,%r0 # return value is source address + lgr %r2,%r0 # return value is source address .L1: - br %r14 + br %r14 -END(memset_mvcle) +END(__memset_mvcle) - + #endif - + @@ -105,5 +105,5 @@ END(memset_mvcle) - + #ifdef NOT_IN_libc .globl memset -.set memset,memset_z900 +.set memset,__memset_z900 #endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-30.patch b/SOURCES/glibc-rh1268008-30.patch index 2ebe297d..b1af6022 100644 --- a/SOURCES/glibc-rh1268008-30.patch +++ b/SOURCES/glibc-rh1268008-30.patch @@ -34,27 +34,27 @@ index 929a545..0805b07 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -17,7 +17,8 @@ sysdep_routines += strlen strlen-vx strlen-c \ - strcspn strcspn-vx strcspn-c \ - memchr memchr-vx \ - rawmemchr rawmemchr-vx rawmemchr-c \ + strcspn strcspn-vx strcspn-c \ + memchr memchr-vx \ + rawmemchr rawmemchr-vx rawmemchr-c \ - memccpy memccpy-vx memccpy-c + memccpy memccpy-vx memccpy-c \ + memrchr memrchr-vx memrchr-c endif - + ifeq ($(subdir),wcsmbs) diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c index 5ea258b..c235bdc 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -137,6 +137,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + IFUNC_VX_IMPL (wmemcmp); - + + IFUNC_VX_IMPL (memrchr); + #endif /* HAVE_S390_VX_ASM_SUPPORT */ - + return i; diff --git a/sysdeps/s390/multiarch/memrchr-c.c b/sysdeps/s390/multiarch/memrchr-c.c new file mode 100644 @@ -287,5 +287,6 @@ index 0000000..6596067 +#else +# include +#endif /* !(defined HAVE_S390_VX_ASM_SUPPORT && !defined NOT_IN_libc) */ --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-4.patch b/SOURCES/glibc-rh1268008-4.patch index fce14582..341cf3db 100644 --- a/SOURCES/glibc-rh1268008-4.patch +++ b/SOURCES/glibc-rh1268008-4.patch @@ -68,14 +68,14 @@ index 88c6f7a..93177dc 100644 + commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) + and isn´t used anymore. */ } fenv_t; - + /* If the default argument is used we use this value. */ diff --git a/sysdeps/s390/fpu/fclrexcpt.c b/sysdeps/s390/fpu/fclrexcpt.c index 3e8d9bb..c2647ba 100644 --- a/sysdeps/s390/fpu/fclrexcpt.c +++ b/sysdeps/s390/fpu/fclrexcpt.c @@ -29,7 +29,12 @@ feclearexcept (int excepts) - + _FPU_GETCW (temp); /* Clear the relevant bits. */ - temp &= ~((excepts << FPC_DXC_SHIFT)|(excepts << FPC_FLAGS_SHIFT)); @@ -85,7 +85,7 @@ index 3e8d9bb..c2647ba 100644 + thus bits 0-5 of dxc-byte correspond to the flag-bits. + Clear the relevant bits in flags and dxc-field. */ + temp &= ~(excepts << FPC_DXC_SHIFT); - + /* Put the new data in effect. */ _FPU_SETCW (temp); diff --git a/sysdeps/s390/fpu/fesetenv.c b/sysdeps/s390/fpu/fesetenv.c @@ -110,7 +110,7 @@ index 7457678..7941904 100644 --- a/sysdeps/s390/fpu/fgetexcptflg.c +++ b/sysdeps/s390/fpu/fgetexcptflg.c @@ -27,7 +27,13 @@ fegetexceptflag (fexcept_t *flagp, int excepts) - + /* Get the current exceptions. */ _FPU_GETCW (temp); - newexcepts = (excepts << FPC_DXC_SHIFT) | (excepts << FPC_FLAGS_SHIFT); @@ -122,7 +122,7 @@ index 7457678..7941904 100644 + newexcepts |= excepts << FPC_DXC_SHIFT; + *flagp = temp & newexcepts; - + /* Success. */ diff --git a/sysdeps/s390/fpu/fpu_control.h b/sysdeps/s390/fpu/fpu_control.h index af81bc2..dba904d 100644 @@ -130,18 +130,18 @@ index af81bc2..dba904d 100644 +++ b/sysdeps/s390/fpu/fpu_control.h @@ -19,12 +19,12 @@ . */ - + #ifndef _FPU_CONTROL_H -# define _FPU_CONTROL_H +#define _FPU_CONTROL_H - + -# include +#include - + /* These bits are reserved are not changed. */ -# define _FPU_RESERVED 0x070700FC +#define _FPU_RESERVED 0x0707FFFC - + /* The fdlibm code requires no interrupts for exceptions. Don't change the rounding mode, it would break long double I/O! */ diff --git a/sysdeps/s390/fpu/fsetexcptflg.c b/sysdeps/s390/fpu/fsetexcptflg.c @@ -154,7 +154,7 @@ index aada675..85c68e8 100644 { - fexcept_t temp,newexcepts; + fexcept_t temp, newexcepts; - + /* Get the current environment. We have to do this since we cannot separately set the status word. */ _FPU_GETCW (temp); @@ -174,7 +174,7 @@ index aada675..85c68e8 100644 + either an ieee-exception or 0 (see fegetexceptflag). */ + temp |= (*flagp | ((*flagp >> FPC_DXC_SHIFT) << FPC_FLAGS_SHIFT)) + & newexcepts; - + /* Store the new status word (along with the rest of the environment. Possibly new exceptions are set but they won't get executed unless diff --git a/sysdeps/s390/fpu/ftestexcept.c b/sysdeps/s390/fpu/ftestexcept.c @@ -187,7 +187,7 @@ index 5594994..c36aefd 100644 { - fexcept_t temp; + fexcept_t temp, res; - + /* Get current exceptions. */ _FPU_GETCW (temp); - temp = (temp >> FPC_DXC_SHIFT) | (temp >> FPC_FLAGS_SHIFT); @@ -202,5 +202,6 @@ index 5594994..c36aefd 100644 + return res & excepts & FE_ALL_EXCEPT; } libm_hidden_def (fetestexcept) --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-5.patch b/SOURCES/glibc-rh1268008-5.patch index c82603a6..da86d5ea 100644 --- a/SOURCES/glibc-rh1268008-5.patch +++ b/SOURCES/glibc-rh1268008-5.patch @@ -289,7 +289,7 @@ index b6eabe5..104e280 100644 --- a/sysdeps/s390/s390-32/memcmp.S +++ b/sysdeps/s390/s390-32/memcmp.S @@ -27,38 +27,38 @@ - + .text #ifdef USE_MULTIARCH -ENTRY(__memcmp_g5) @@ -297,7 +297,7 @@ index b6eabe5..104e280 100644 #else ENTRY(memcmp) #endif - .machine "g5" + .machine "g5" - basr %r5,0 + basr %r5,0 .L_G5_16: @@ -356,14 +356,14 @@ index a3b1ace..6a2cf68 100644 +++ b/sysdeps/s390/s390-32/memcpy.S @@ -26,41 +26,41 @@ %r4 = number of bytes to copy. */ - + #ifdef USE_MULTIARCH -ENTRY(__memcpy_g5) +ENTRY(__memcpy_default) #else ENTRY(memcpy) #endif - .machine "g5" + .machine "g5" - st %r13,52(%r15) - .cfi_offset 13, -44 - basr %r13,0 @@ -427,14 +427,14 @@ index a73dc6c..d363cf1 100644 +++ b/sysdeps/s390/s390-32/memset.S @@ -28,37 +28,37 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(__memset_g5) +ENTRY(__memset_default) #else ENTRY(memset) #endif - .machine "g5" + .machine "g5" - basr %r5,0 + basr %r5,0 .L_G5_19: @@ -1333,7 +1333,7 @@ index eb5370f..1d7e788 100644 --- a/sysdeps/s390/s390-64/memcmp.S +++ b/sysdeps/s390/s390-64/memcmp.S @@ -27,36 +27,36 @@ - + .text #ifdef USE_MULTIARCH -ENTRY(__memcmp_z900) @@ -1341,7 +1341,7 @@ index eb5370f..1d7e788 100644 #else ENTRY(memcmp) #endif - .machine "z900" + .machine "z900" - ltgr %r4,%r4 - je .L_Z900_4 - aghi %r4,-1 @@ -1396,14 +1396,14 @@ index 61fca0b..6827a0e 100644 +++ b/sysdeps/s390/s390-64/memcpy.S @@ -29,37 +29,37 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(__memcpy_z900) +ENTRY(__memcpy_default) #else ENTRY(memcpy) #endif - .machine "z900" + .machine "z900" - ltgr %r4,%r4 - je .L_Z900_4 - aghi %r4,-1 @@ -1445,7 +1445,7 @@ index 61fca0b..6827a0e 100644 .L_Z900_15: - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) - + #ifdef USE_MULTIARCH -END(__memcpy_z900) +END(__memcpy_default) @@ -1458,14 +1458,14 @@ index 8185e94..b1ba9e2 100644 +++ b/sysdeps/s390/s390-64/memset.S @@ -29,35 +29,35 @@ .text - + #ifdef USE_MULTIARCH -ENTRY(__memset_z900) +ENTRY(__memset_default) #else ENTRY(memset) #endif - .machine "z900" + .machine "z900" - ltgr %r4,%r4 - je .L_Z900_4 - stc %r3,0(%r2) @@ -2337,5 +2337,6 @@ index 0000000..3b15446 + +s390_libc_ifunc (memset) +#endif --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-6.patch b/SOURCES/glibc-rh1268008-6.patch index c6d4715d..83f9e1f0 100644 --- a/SOURCES/glibc-rh1268008-6.patch +++ b/SOURCES/glibc-rh1268008-6.patch @@ -49,19 +49,19 @@ index 26de043..89766e0 100644 @@ -21,7 +21,7 @@ #define _DL_PROCINFO_H 1 #include - + -#define _DL_HWCAP_COUNT 10 +#define _DL_HWCAP_COUNT 12 - + #define _DL_PLATFORMS_COUNT 5 - + @@ -50,6 +50,7 @@ enum HWCAP_S390_ETF3EH = 1 << 8, HWCAP_S390_HIGH_GPRS = 1 << 9, HWCAP_S390_TE = 1 << 10, + HWCAP_S390_VX = 1 << 11, }; - + #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \ diff --git a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h index 59d68b0..bd2ce3a 100644 @@ -72,5 +72,6 @@ index 59d68b0..bd2ce3a 100644 #define HWCAP_S390_HIGH_GPRS 512 #define HWCAP_S390_TE 1024 +#define HWCAP_S390_VX 2048 --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-7.patch b/SOURCES/glibc-rh1268008-7.patch index 89ab7e71..ff7b0575 100644 --- a/SOURCES/glibc-rh1268008-7.patch +++ b/SOURCES/glibc-rh1268008-7.patch @@ -43,13 +43,14 @@ index 89766e0..80747f0 100644 --- a/sysdeps/s390/dl-procinfo.h +++ b/sysdeps/s390/dl-procinfo.h @@ -23,7 +23,7 @@ - + #define _DL_HWCAP_COUNT 12 - + -#define _DL_PLATFORMS_COUNT 5 +#define _DL_PLATFORMS_COUNT 8 - + /* The kernel provides up to 32 capability bits with elf_hwcap. */ #define _DL_FIRST_PLATFORM 32 --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-8.patch b/SOURCES/glibc-rh1268008-8.patch index f4a616ae..28276846 100644 --- a/SOURCES/glibc-rh1268008-8.patch +++ b/SOURCES/glibc-rh1268008-8.patch @@ -39,21 +39,21 @@ index 68321d4..f7f2388 100644 @@ -110,6 +110,9 @@ /* Define if assembler supports Intel MPX. */ #undef HAVE_MPX_SUPPORT - + +/* Define if assembler supports vector instructions on S390. */ +#undef HAVE_S390_VX_ASM_SUPPORT + /* Define if gcc supports FMA4. */ #undef HAVE_FMA4_SUPPORT - + diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index 669bb9b..cc4c1e0 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -3,3 +3,42 @@ - + $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector instruction support" >&5 +$as_echo_n "checking for S390 vector instruction support... " >&6; } @@ -128,5 +128,6 @@ index b5af4e1..733e356 100644 +else + AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.]) +fi --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1268008-9.patch b/SOURCES/glibc-rh1268008-9.patch index 2c1da5be..dc7f1143 100644 --- a/SOURCES/glibc-rh1268008-9.patch +++ b/SOURCES/glibc-rh1268008-9.patch @@ -45,5 +45,6 @@ index 491df68..e9fd90e 100644 + return &RESOLVERFUNC##_c; \ + } \ + __asm__ (".type " #FUNC ", %gnu_indirect_function"); --- +-- 2.3.0 + diff --git a/SOURCES/glibc-rh1276753-0.patch b/SOURCES/glibc-rh1276753-0.patch index a7ac1a61..7c157d5b 100644 --- a/SOURCES/glibc-rh1276753-0.patch +++ b/SOURCES/glibc-rh1276753-0.patch @@ -11,30 +11,30 @@ Index: glibc-2.17-c758a686/malloc/Makefile @@ -121,7 +121,6 @@ endif tst-mcheck-ENV = MALLOC_CHECK_=3 tst-malloc-usable-ENV = MALLOC_CHECK_=3 - + -CPPFLAGS-malloc.c += -DPER_THREAD # Uncomment this for test releases. For public releases it is too expensive. #CPPFLAGS-malloc.o += -DMALLOC_DEBUG=1 - + Index: glibc-2.17-c758a686/malloc/arena.c =================================================================== --- glibc-2.17-c758a686.orig/malloc/arena.c +++ glibc-2.17-c758a686/malloc/arena.c @@ -78,10 +78,8 @@ extern int sanity_check_heap_info_alignm - + static tsd_key_t arena_key; static mutex_t list_lock = MUTEX_INITIALIZER; -#ifdef PER_THREAD static size_t narenas = 1; static mstate free_list; -#endif - + #if THREAD_STATS static int stat_n_heaps; @@ -117,21 +115,12 @@ int __malloc_initialized = -1; ptr = (mstate)tsd_getspecific(arena_key, vptr); \ } while(0) - + -#ifdef PER_THREAD # define arena_lock(ptr, size) do { \ if(ptr && !arena_is_corrupt (ptr)) \ @@ -50,9 +50,9 @@ Index: glibc-2.17-c758a686/malloc/arena.c - ptr = arena_get2(ptr, (size), NULL); \ -} while(0) -#endif - + /* find the heap and corresponding arena for a given ptr */ - + @@ -297,17 +286,13 @@ ptmalloc_unlock_all2 (void) tsd_setspecific(arena_key, save_arena); __malloc_hook = save_malloc_hook; @@ -72,73 +72,73 @@ Index: glibc-2.17-c758a686/malloc/arena.c if(ar_ptr == &main_arena) break; } @@ -428,13 +413,10 @@ ptmalloc_init (void) - { - if (memcmp (envline, "MMAP_MAX_", 9) == 0) - __libc_mallopt(M_MMAP_MAX, atoi(&envline[10])); + { + if (memcmp (envline, "MMAP_MAX_", 9) == 0) + __libc_mallopt(M_MMAP_MAX, atoi(&envline[10])); -#ifdef PER_THREAD - else if (memcmp (envline, "ARENA_MAX", 9) == 0) - __libc_mallopt(M_ARENA_MAX, atoi(&envline[10])); + else if (memcmp (envline, "ARENA_MAX", 9) == 0) + __libc_mallopt(M_ARENA_MAX, atoi(&envline[10])); -#endif - } - break; + } + break; -#ifdef PER_THREAD - case 10: - if (! __builtin_expect (__libc_enable_secure, 0)) - { + case 10: + if (! __builtin_expect (__libc_enable_secure, 0)) + { @@ -442,7 +424,6 @@ ptmalloc_init (void) - __libc_mallopt(M_ARENA_TEST, atoi(&envline[11])); - } - break; + __libc_mallopt(M_ARENA_TEST, atoi(&envline[11])); + } + break; -#endif - case 15: - if (! __builtin_expect (__libc_enable_secure, 0)) - { + case 15: + if (! __builtin_expect (__libc_enable_secure, 0)) + { @@ -750,18 +731,14 @@ _int_new_arena(size_t size) mutex_init(&a->mutex); (void)mutex_lock(&a->mutex); - + -#ifdef PER_THREAD (void)mutex_lock(&list_lock); -#endif - + /* Add the new arena to the global list. */ a->next = main_arena.next; atomic_write_barrier (); main_arena.next = a; - + -#ifdef PER_THREAD (void)mutex_unlock(&list_lock); -#endif - + THREAD_STAT(++(a->stat_lock_loop)); - + @@ -769,7 +746,6 @@ _int_new_arena(size_t size) } - - + + -#ifdef PER_THREAD static mstate get_free_list (void) { @@ -846,7 +822,6 @@ reused_arena (mstate avoid_arena) - + return result; } -#endif - + static mstate internal_function @@ -854,7 +829,6 @@ arena_get2(mstate a_tsd, size_t size, ms { mstate a; - + -#ifdef PER_THREAD static size_t narenas_limit; - + a = get_free_list (); @@ -897,54 +871,6 @@ arena_get2(mstate a_tsd, size_t size, ms else - a = reused_arena (avoid_arena); + a = reused_arena (avoid_arena); } -#else - if(!a_tsd) @@ -190,11 +190,11 @@ Index: glibc-2.17-c758a686/malloc/arena.c - return a; } - + @@ -970,7 +896,6 @@ arena_get_retry (mstate ar_ptr, size_t b return ar_ptr; } - + -#ifdef PER_THREAD static void __attribute__ ((section ("__libc_thread_freeres_fn"))) arena_thread_freeres (void) @@ -204,7 +204,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c } text_set_element (__libc_thread_subfreeres, arena_thread_freeres); -#endif - + /* * Local variables: Index: glibc-2.17-c758a686/malloc/hooks.c @@ -234,7 +234,7 @@ Index: glibc-2.17-c758a686/malloc/hooks.c -#endif } check_malloc_state(&main_arena); - + Index: glibc-2.17-c758a686/malloc/malloc.c =================================================================== --- glibc-2.17-c758a686.orig/malloc/malloc.c @@ -242,12 +242,12 @@ Index: glibc-2.17-c758a686/malloc/malloc.c @@ -1727,10 +1727,8 @@ struct malloc_state { /* Linked list */ struct malloc_state *next; - + -#ifdef PER_THREAD /* Linked list for free arenas. */ struct malloc_state *next_free; -#endif - + /* Memory allocated from the system in this arena. */ INTERNAL_SIZE_T system_mem; @@ -1742,10 +1740,8 @@ struct malloc_par { @@ -258,7 +258,7 @@ Index: glibc-2.17-c758a686/malloc/malloc.c INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max; -#endif - + /* Memory map support */ int n_mmaps; @@ -1787,18 +1783,14 @@ static struct malloc_par mp_ = @@ -270,38 +270,38 @@ Index: glibc-2.17-c758a686/malloc/malloc.c .arena_test = NARENAS_FROM_NCORES (1) -#endif }; - - + + -#ifdef PER_THREAD /* Non public mallopt parameters. */ #define M_ARENA_TEST -7 #define M_ARENA_MAX -8 -#endif - - + + /* Maximum size of memory handled in fastbins. */ @@ -3008,11 +3000,6 @@ __libc_realloc(void* oldmem, size_t byte (void)mutex_lock(&ar_ptr->mutex); #endif - + -#if !defined PER_THREAD - LIBC_PROBE (memory_arena_reuse_realloc, 1, ar_ptr); - /* As in malloc(), remember this arena for the next allocation. */ - tsd_setspecific(arena_key, (void *)ar_ptr); -#endif - + newp = _int_realloc(ar_ptr, oldp, oldsize, nb); - + @@ -4823,7 +4810,6 @@ int __libc_mallopt(int param_number, int perturb_byte = value; break; - + -#ifdef PER_THREAD case M_ARENA_TEST: if (value > 0) { @@ -4839,7 +4825,6 @@ int __libc_mallopt(int param_number, int - mp_.arena_max = value; + mp_.arena_max = value; } break; -#endif diff --git a/SOURCES/glibc-rh1276753.patch b/SOURCES/glibc-rh1276753.patch index 32ea4245..5577d7e4 100644 --- a/SOURCES/glibc-rh1276753.patch +++ b/SOURCES/glibc-rh1276753.patch @@ -34,15 +34,15 @@ Also included is the following change, which has not yet been committed upstream: malloc: Preserve arena free list/thread count invariant [BZ #20370] - + It is necessary to preserve the invariant that if an arena is on the free list, it has thread attach count zero. Otherwise, when arena_thread_freeres sees the zero attach count, it will add it, and without the invariant, an arena could get pushed to the list twice, resulting in a cycle. - + One possible execution trace looks like this: - + Thread 1 examines free list and observes it as empty. Thread 2 exits and adds its arena to the free list, with attached_threads == 0). @@ -51,11 +51,11 @@ committed upstream: (The arena remains on the free list.) Thread 1 exits, decrements attached_threads, and adds the arena to the free list. - + The final step creates a cycle in the usual way (by overwriting the next_free member with the former list head, while there is another list item pointing to the arena structure). - + tst-malloc-thread-exit exhibits this issue, but it was only visible with a debugger because the incorrect fix in bug 19243 removed the assert from get_free_list. @@ -67,7 +67,7 @@ Index: b/malloc/arena.c +++ b/malloc/arena.c @@ -77,10 +77,30 @@ extern int sanity_check_heap_info_alignm /* Thread specific data */ - + static tsd_key_t arena_key; -static mutex_t list_lock = MUTEX_INITIALIZER; + @@ -79,7 +79,7 @@ Index: b/malloc/arena.c +static mutex_t free_list_lock = MUTEX_INITIALIZER; static size_t narenas = 1; static mstate free_list; - + +/* list_lock prevents concurrent writes to the next member of struct + malloc_state objects. + @@ -98,7 +98,7 @@ Index: b/malloc/arena.c static int stat_n_heaps; #define THREAD_STAT(x) x @@ -221,6 +241,10 @@ ptmalloc_lock_all (void) - + if(__malloc_initialized < 1) return; + @@ -158,9 +158,9 @@ Index: b/malloc/arena.c @@ -692,8 +730,25 @@ heap_trim(heap_info *heap, size_t pad) return 1; } - + -/* Create a new arena with initial size "size". */ - + +/* If REPLACED_ARENA is not NULL, detach it from this thread. Must be + called while free_list_lock is held. */ +static void @@ -192,7 +192,7 @@ Index: b/malloc/arena.c arena_mem += h->size; @@ -727,36 +783,68 @@ _int_new_arena(size_t size) set_head(top(a), (((char*)h + h->size) - ptr) | PREV_INUSE); - + LIBC_PROBE (memory_arena_new, 2, a, size); + mstate replaced_arena; + { @@ -202,9 +202,9 @@ Index: b/malloc/arena.c tsd_setspecific(arena_key, (void *)a); mutex_init(&a->mutex); - (void)mutex_lock(&a->mutex); - + (void)mutex_lock(&list_lock); - + /* Add the new arena to the global list. */ a->next = main_arena.next; + /* FIXME: The barrier is an attempt to synchronize with read access @@ -212,9 +212,9 @@ Index: b/malloc/arena.c + traversing the list. */ atomic_write_barrier (); main_arena.next = a; - + (void)mutex_unlock(&list_lock); - + + (void) mutex_lock (&free_list_lock); + detach_arena (replaced_arena); + (void) mutex_unlock (&free_list_lock); @@ -231,10 +231,10 @@ Index: b/malloc/arena.c + (void) mutex_lock (&a->mutex); + THREAD_STAT(++(a->stat_lock_loop)); - + return a; } - + - +/* Remove an arena from free_list. */ static mstate @@ -261,13 +261,13 @@ Index: b/malloc/arena.c + detach_arena (replaced_arena); + } + (void)mutex_unlock(&free_list_lock); - + if (result != NULL) - { + { @@ -770,6 +858,26 @@ get_free_list (void) return result; } - + +/* Remove the arena from the free list (if it is present). + free_list_lock must have been acquired by the caller. */ +static void @@ -299,22 +299,22 @@ Index: b/malloc/arena.c static mstate next_to_use; if (next_to_use == NULL) next_to_use = &main_arena; - + + /* Iterate over all arenas (including those linked from + free_list). */ result = next_to_use; do { if (!arena_is_corrupt (result) && !mutex_trylock(&result->mutex)) - goto out; - + goto out; + + /* FIXME: This is a data race, see _int_new_arena. */ result = result->next; } while (result != next_to_use); @@ -815,6 +927,27 @@ reused_arena (mstate avoid_arena) (void)mutex_lock(&result->mutex); - + out: + /* Attach the arena to the current thread. */ + { @@ -341,7 +341,7 @@ Index: b/malloc/arena.c tsd_setspecific(arena_key, (void *)result); THREAD_STAT(++(result->stat_lock_loop)); @@ -905,10 +1038,16 @@ arena_thread_freeres (void) - + if (a != NULL) { - (void)mutex_lock(&list_lock); @@ -368,7 +368,7 @@ Index: b/malloc/malloc.c @@ -1727,8 +1727,13 @@ struct malloc_state { /* Linked list */ struct malloc_state *next; - + - /* Linked list for free arenas. */ + /* Linked list for free arenas. Access to this field is serialized + by free_list_lock in arena.c. */ @@ -377,7 +377,7 @@ Index: b/malloc/malloc.c + the free list. Access to this field is serialized by + free_list_lock in arena.c. */ + INTERNAL_SIZE_T attached_threads; - + /* Memory allocated from the system in this arena. */ INTERNAL_SIZE_T system_mem; @@ -1772,7 +1777,8 @@ struct malloc_par { @@ -388,7 +388,7 @@ Index: b/malloc/malloc.c + .next = &main_arena, + .attached_threads = 1, }; - + /* There is only one instance of the malloc parameters. */ Index: b/malloc/Makefile =================================================================== @@ -397,37 +397,37 @@ Index: b/malloc/Makefile @@ -20,13 +20,14 @@ # subdir := malloc - + -all: +include ../Makeconfig - + dist-headers := malloc.h headers := $(dist-headers) obstack.h mcheck.h tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ + tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ - tst-malloc-usable tst-malloc-backtrace + tst-malloc-usable \ + tst-malloc-backtrace tst-malloc-thread-exit test-srcs = tst-mtrace - + routines = malloc morecore mcheck mtrace obstack @@ -43,6 +44,8 @@ libmemusage-inhibit-o = $(filter-out .os - + $(objpfx)tst-malloc-backtrace: $(common-objpfx)nptl/libpthread.so \ - $(common-objpfx)nptl/libpthread_nonshared.a + $(common-objpfx)nptl/libpthread_nonshared.a +$(objpfx)tst-malloc-thread-exit: $(common-objpfx)nptl/libpthread.so \ + $(common-objpfx)nptl/libpthread_nonshared.a - + # These should be removed by `make clean'. extra-objs = mcheck-init.o libmcheck.a @@ -50,8 +53,6 @@ extra-objs = mcheck-init.o libmcheck.a # Include the cleanup handler. aux := set-freeres thread-freeres - + -include ../Makeconfig - CPPFLAGS-memusagestat = -DNOT_IN_libc - + # The Perl script to analyze the output of the mtrace functions. Index: b/malloc/tst-malloc-thread-exit.c =================================================================== diff --git a/SOURCES/glibc-rh1284959-1.patch b/SOURCES/glibc-rh1284959-1.patch index 70b8aecf..cdb15858 100644 --- a/SOURCES/glibc-rh1284959-1.patch +++ b/SOURCES/glibc-rh1284959-1.patch @@ -14,43 +14,43 @@ Author: Mel Gorman Date: Thu Apr 2 12:14:14 2015 +0530 malloc: Consistently apply trim_threshold to all heaps [BZ #17195] - + Trimming heaps is a balance between saving memory and the system overhead required to update page tables and discard allocated pages. The malloc option M_TRIM_THRESHOLD is a tunable that users are meant to use to decide where this balance point is but it is only applied to the main arena. - + For scalability reasons, glibc malloc has per-thread heaps but these are shrunk with madvise() if there is one page free at the top of the heap. In some circumstances this can lead to high system overhead if a thread has a control flow like - + while (data_to_process) { buf = malloc(large_size); do_stuff(); free(buf); } - + For a large size, the free() will call madvise (pagetable teardown, page free and TLB flush) every time followed immediately by a malloc (fault, kernel page alloc, zeroing and charge accounting). The kernel overhead can dominate such a workload. - + This patch allows the user to tune when madvise gets called by applying the trim threshold to the per-thread heaps and using similar logic to the main arena when deciding whether to shrink. Alternatively if the dynamic brk/mmap threshold gets adjusted then the new values will be obeyed by the per-thread heaps. - + Bug 17195 was a test case motivated by a problem encountered in scientific applications written in python that performance badly due to high page fault overhead. The basic operation of such a program was posted by Julian Taylor https://sourceware.org/ml/libc-alpha/2015-02/msg00373.html - + With this patch applied, the overhead is eliminated. All numbers in this report are in seconds and were recorded by running Julian's program 30 times. - + pyarray glibc madvise 2.21 v2 @@ -62,40 +62,40 @@ Date: Thu Apr 2 12:14:14 2015 +0530 Elapsed mean 3.39 ( 0.00%) 2.41 ( 28.84%) Elapsed stddev 0.14 ( 0.00%) 0.02 ( 82.73%) Elapsed max 4.05 ( 0.00%) 2.47 ( 39.01%) - + glibc madvise 2.21 v2 User 141.86 142.28 System 57.94 0.60 Elapsed 102.02 72.66 - + Note that almost a minutes worth of system time is eliminted and the program completes 28% faster on average. - + To illustrate the problem without python this is a basic test-case for the worst case scenario where every free is a madvise followed by a an alloc - + /* gcc bench-free.c -lpthread -o bench-free */ static int num = 1024; - + void __attribute__((noinline,noclone)) dostuff (void *p) { } - + void *worker (void *data) { int i; - + for (i = num; i--;) { void *m = malloc (48*4096); dostuff (m); free (m); } - + return NULL; } - + int main() { int i; @@ -107,20 +107,20 @@ Date: Thu Apr 2 12:14:14 2015 +0530 exit (3); return 0; } - + Before the patch, this resulted in 1024 calls to madvise. With the patch applied, madvise is called twice because the default trim threshold is high enough to avoid this. - + This a more complex case where there is a mix of frees. It's simply a different worker function for the test case above - + void *worker (void *data) { int i; int j = 0; void *free_index[num]; - + for (i = num; i--;) { void *m = malloc ((i % 58) *4096); @@ -135,14 +135,14 @@ Date: Thu Apr 2 12:14:14 2015 +0530 { free(free_index[j]); } - + return NULL; } - + glibc 2.21 calls malloc 90305 times but with the patch applied, it's called 13438. Increasing the trim threshold will decrease the number of times it's called with the option of eliminating the overhead. - + ebizzy is meant to generate a workload resembling common web application server workloads. It is threaded with a large working set that at its core has an allocation, do_stuff, free loop that also hits this case. The primary @@ -150,43 +150,43 @@ Date: Thu Apr 2 12:14:14 2015 +0530 my desktop which is a single socket machine with an I7-4770 and 8 cores. Each thread count was run for 30 seconds. It was only run once as the performance difference is so high that the variation is insignificant. - + glibc 2.21 patch threads 1 10230 44114 threads 2 19153 84925 threads 4 34295 134569 threads 8 51007 183387 - + Note that the saving happens to be a concidence as the size allocated by ebizzy was less than the default threshold. If a different number of chunks were specified then it may also be necessary to tune the threshold to compensate - + This is roughly quadrupling the performance of this benchmark. The difference in system CPU usage illustrates why. - + ebizzy running 1 thread with glibc 2.21 10230 records/s 306904 real 30.00 s user 7.47 s sys 22.49 s - + 22.49 seconds was spent in the kernel for a workload runinng 30 seconds. With the patch applied - + ebizzy running 1 thread with patch applied 44126 records/s 1323792 real 30.00 s user 29.97 s sys 0.00 s - + system CPU usage was zero with the patch applied. strace shows that glibc running this workload calls madvise approximately 9000 times a second. With the patch applied madvise was called twice during the workload (or 0.06 times per second). - + 2015-02-10 Mel Gorman - + [BZ #17195] * malloc/arena.c (free): Apply trim threshold to per-thread heaps as well as the main arena. @@ -201,7 +201,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c heap_info *prev_heap; - long new_size, top_size, extra, prev_size, misalign; + long new_size, top_size, top_area, extra, prev_size, misalign; - + /* Can this heap go away completely? */ while(top_chunk == chunk_at_offset(heap, sizeof(*heap))) { @@ -695,9 +695,16 @@ heap_trim(heap_info *heap, size_t pad) @@ -230,9 +230,9 @@ Index: glibc-2.17-c758a686/malloc/malloc.c @@ -236,6 +236,8 @@ /* For va_arg, va_start, va_end. */ #include - + +/* For ALIGN_UP. */ +#include - + /* Debugging: diff --git a/SOURCES/glibc-rh1284959-2.patch b/SOURCES/glibc-rh1284959-2.patch index f66e6a68..9d45fb47 100644 --- a/SOURCES/glibc-rh1284959-2.patch +++ b/SOURCES/glibc-rh1284959-2.patch @@ -11,7 +11,7 @@ Author: Carlos O'Donell Date: Wed Oct 7 22:21:36 2015 -0400 malloc: Consistently apply trim_threshold to all heaps (Bug 17195) - + In the per-thread arenas we apply trim_threshold-based checks to the extra space between the pad and the top_area. This isn't quite accurate and instead we should be harmonizing with the way @@ -20,7 +20,7 @@ Date: Wed Oct 7 22:21:36 2015 -0400 the top chunk and only the size of the top chunk. The following patch harmonizes the trimming and make it consistent for the main arena and thread arenas. - + In the old code a large padding request might have meant that trimming was not triggered. Now trimming is considered first based on the chunk, then the pad is subtracted, and the remainder trimmed. @@ -29,7 +29,7 @@ Date: Wed Oct 7 22:21:36 2015 -0400 consider to be a behavioural anomaly. We'll need some profile driven optimization to make this code better, and even there Ondrej and others have better ideas on how to speedup malloc. - + Tested on x86_64 with no regressions. Already reviewed by Siddhesh Poyarekar and Mel Gorman here and discussed here: https://sourceware.org/ml/libc-alpha/2015-05/msg00002.html @@ -40,7 +40,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c +++ glibc-2.17-c758a686/malloc/arena.c @@ -697,14 +697,20 @@ heap_trim(heap_info *heap, size_t pad) } - + /* Uses similar logic for per-thread arenas as the main arena with systrim - by preserving the top pad and at least a page. */ + and _int_free by preserving the top pad and rounding down to the nearest @@ -53,7 +53,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c top_area = top_size - MINSIZE - 1; if (top_area <= pad) return 0; - + + /* Release in pagesize units and round down to the nearest page. */ extra = ALIGN_DOWN(top_area - pad, pagesz); - if ((unsigned long) extra < mp_.trim_threshold) diff --git a/SOURCES/glibc-rh1284959-3.patch b/SOURCES/glibc-rh1284959-3.patch index 8a479d0a..4de01306 100644 --- a/SOURCES/glibc-rh1284959-3.patch +++ b/SOURCES/glibc-rh1284959-3.patch @@ -11,28 +11,28 @@ Author: Mel Gorman Date: Mon Jun 8 13:36:13 2015 +0100 malloc: Do not corrupt the top of a threaded heap if top chunk is MINSIZE [BZ #18502] - + mksquashfs was reported in openSUSE to be causing segmentation faults when creating installation images. Testing showed that mksquashfs sometimes failed and could be reproduced within 10 attempts. The core dump looked like the heap top was corrupted and was pointing to an unmapped area. In other cases, this has been due to an application corrupting glibc structures but mksquashfs appears to be fine in this regard. - + The problem is that heap_trim is "growing" the top into unmapped space. If the top chunk == MINSIZE then top_area is -1 and this check does not behave as expected due to a signed/unsigned comparison - + if (top_area <= pad) return 0; - + The next calculation extra = ALIGN_DOWN(top_area - pad, pagesz) calculates extra as a negative number which also is unnoticed due to a signed/unsigned comparison. We then call shrink_heap(heap, negative_number) which crashes later. This patch adds a simple check against MINSIZE to make sure extra does not become negative. It adds a cast to hint to the reader that this is a signed vs unsigned issue. - + Without the patch, mksquash fails within 10 attempts. With it applied, it completed 1000 times without error. The standard test suite "make check" showed no changes in the summary of test results. @@ -43,10 +43,10 @@ Index: glibc-2.17-c758a686/malloc/arena.c +++ glibc-2.17-c758a686/malloc/arena.c @@ -705,7 +705,7 @@ heap_trim(heap_info *heap, size_t pad) return 0; - + top_area = top_size - MINSIZE - 1; - if (top_area <= pad) + if (top_area < 0 || (size_t) top_area <= pad) return 0; - + /* Release in pagesize units and round down to the nearest page. */ diff --git a/SOURCES/glibc-rh1288613.patch b/SOURCES/glibc-rh1288613.patch index 5d1ec4f9..754b4226 100644 --- a/SOURCES/glibc-rh1288613.patch +++ b/SOURCES/glibc-rh1288613.patch @@ -3,17 +3,17 @@ Author: Dmitry V. Levin Date: Thu Jun 18 21:40:46 2015 +0000 Fix potential hanging of gethostbyaddr_r/gethostbyname_r - + When "reorder" resolver option is enabled, threads of a multi-threaded process could hang in gethostbyaddr_r, gethostbyname_r, or gethostbyname2_r. - + Due to a trivial bug in _res_hconf_reorder_addrs, simultaneous invocations of this function in a multi-threaded process could result to _res_hconf_reorder_addrs returning without releasing the lock it holds, causing other threads to block indefinitely while waiting for the lock that is not going to be released. - + [BZ #17977] * resolv/res_hconf.c (_res_hconf_reorder_addrs): Fix unlocking when initializing interface list, based on the bug analysis @@ -38,9 +38,9 @@ Index: glibc-2.17-c758a686/resolv/Makefile extra-libs-others = $(extra-libs) libresolv-routines := gethnamaddr res_comp res_debug \ @@ -108,6 +108,9 @@ $(objpfx)libanl.so: $(common-objpfx)libc - + $(objpfx)ga_test: $(objpfx)libanl.so $(shared-thread-library) - + +$(objpfx)tst-res_hconf_reorder: $(libdl) $(shared-thread-library) +tst-res_hconf_reorder-ENV = RESOLV_REORDER=on + @@ -52,18 +52,18 @@ Index: glibc-2.17-c758a686/resolv/res_hconf.c --- glibc-2.17-c758a686.orig/resolv/res_hconf.c +++ glibc-2.17-c758a686/resolv/res_hconf.c @@ -462,10 +462,10 @@ _res_hconf_reorder_addrs (struct hostent - errno = save; - - num_ifs = new_num_ifs; + errno = save; + + num_ifs = new_num_ifs; - - __libc_lock_unlock (lock); - } - + } + + __libc_lock_unlock (lock); + __close (sd); } - + Index: glibc-2.17-c758a686/resolv/tst-res_hconf_reorder.c =================================================================== --- /dev/null diff --git a/SOURCES/glibc-rh1292018-0.patch b/SOURCES/glibc-rh1292018-0.patch index 29f5a9d7..e0b4da74 100644 --- a/SOURCES/glibc-rh1292018-0.patch +++ b/SOURCES/glibc-rh1292018-0.patch @@ -3,11 +3,11 @@ Author: H.J. Lu Date: Tue Mar 31 13:17:51 2015 -0700 Limit threads sharing L2 cache to 2 for SLM/KNL - + Silvermont and Knights Landing have a modular system design with two cores sharing an L2 cache. If more than 2 cores are detected to shared L2 cache, it should be adjusted for Silvermont and Knights Landing. - + [BZ #18185] * sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Limit threads sharing L2 cache to 2 for Silvermont/Knights Landing. @@ -19,18 +19,18 @@ index f1cbf50..b99fb9a 100644 @@ -585,6 +585,10 @@ init_cacheinfo (void) __cpuid (1, eax, ebx_1, ecx, edx); #endif - + + unsigned int family = (eax >> 8) & 0x0f; + unsigned int model = (eax >> 4) & 0x0f; + unsigned int extended_model = (eax >> 12) & 0xf0; + #ifndef DISABLE_PREFERRED_MEMORY_INSTRUCTION /* Intel prefers SSSE3 instructions for memory/string routines - if they are available. */ + if they are available. */ @@ -647,6 +651,25 @@ init_cacheinfo (void) - } - } - threads += 1; + } + } + threads += 1; + if (threads > 2 && level == 2 && family == 6) + { + model += extended_model; @@ -50,6 +50,6 @@ index f1cbf50..b99fb9a 100644 + break; + } + } - } + } else - { + { diff --git a/SOURCES/glibc-rh1292018-0a.patch b/SOURCES/glibc-rh1292018-0a.patch index 635ba3dd..915832ba 100644 --- a/SOURCES/glibc-rh1292018-0a.patch +++ b/SOURCES/glibc-rh1292018-0a.patch @@ -12,15 +12,15 @@ Index: glibc-2.17-c758a686/Makefile --- glibc-2.17-c758a686.orig/Makefile +++ glibc-2.17-c758a686/Makefile @@ -127,6 +127,9 @@ lib: $(common-objpfx)libc.so - + lib: $(common-objpfx)linkobj/libc.so - + +# Do not filter ld.so out of libc.so link. +$(common-objpfx)linkobj/libc.so: link-libc-deps = # empty + $(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \ - $(common-objpfx)linkobj/libc_pic.a \ - $(elfobjdir)/sofini.os \ + $(common-objpfx)linkobj/libc_pic.a \ + $(elfobjdir)/sofini.os \ Index: glibc-2.17-c758a686/Makerules =================================================================== --- glibc-2.17-c758a686.orig/Makerules @@ -36,37 +36,37 @@ Index: glibc-2.17-c758a686/Makerules +# to be as similar as possible to a default link with an installed libc. +lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) $(link-libc-deps) + $(build-shlib) $(link-libc-args) - + define build-shlib-helper $(LINK.o) -shared $(static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) \ @@ -558,7 +559,8 @@ endef - + build-module-helper-objlist = \ - $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\ + $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\ - $(filter-out %.lds $(map-file) $(+preinit) $(+postinit),$^)) + $(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \ + $(link-libc-deps),$^)) - + build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so) build-shlib-objlist = $(build-module-helper-objlist) \ @@ -601,6 +603,9 @@ generated += libc_pic.opts libc_pic.os.c libc_pic_clean := .clean endif - + +# Do not filter ld.so out of libc.so link. +$(common-objpfx)libc.so: link-libc-deps = # empty + # Use our own special initializer and finalizer files for libc.so. $(common-objpfx)libc.so: $(elfobjdir)/soinit.os \ - $(common-objpfx)libc_pic.os$(libc_pic_clean) \ + $(common-objpfx)libc_pic.os$(libc_pic_clean) \ @@ -660,8 +665,7 @@ include $(patsubst %,$(..)extra-modules. - + extra-modules-build := $(filter-out $(modules-names-nobuild),$(modules-names)) $(extra-modules-build:%=$(objpfx)%.so): $(objpfx)%.so: \ - $(objpfx)%.os $(shlib-lds) \ - $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a + $(objpfx)%.os $(shlib-lds) $(link-libs-deps) - $(build-module) + $(build-module) endif Index: glibc-2.17-c758a686/crypt/Makefile @@ -87,9 +87,9 @@ Index: glibc-2.17-c758a686/debug/Makefile --- glibc-2.17-c758a686.orig/debug/Makefile +++ glibc-2.17-c758a686/debug/Makefile @@ -159,13 +159,3 @@ $(objpfx)xtrace: xtrace.sh - -e 's|@PKGVERSION@|$(PKGVERSION)|' \ - -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \ - && rm -f $@ && mv $@.new $@ && chmod +x $@ + -e 's|@PKGVERSION@|$(PKGVERSION)|' \ + -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \ + && rm -f $@ && mv $@.new $@ && chmod +x $@ - -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by @@ -107,13 +107,13 @@ Index: glibc-2.17-c758a686/dlfcn/Makefile @@ -117,16 +117,9 @@ $(objpfx)bug-atexit1.out: $(objpfx)bug-a $(objpfx)bug-atexit2: $(libdl) $(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so - + -LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh $(elfobjdir)/ld.so \ - $(common-objpfx)libc_nonshared.a +LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh $(objpfx)bug-atexit3: $(libdl) $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so - + $(objpfx)tst-rec-dlopen: $(libdl) $(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so - @@ -127,9 +127,9 @@ Index: glibc-2.17-c758a686/hesiod/Makefile --- glibc-2.17-c758a686.orig/hesiod/Makefile +++ glibc-2.17-c758a686/hesiod/Makefile @@ -33,12 +33,7 @@ libnss_hesiod-inhibit-o = $(filter-out . - + include ../Rules - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -147,12 +147,12 @@ Index: glibc-2.17-c758a686/iconvdata/extra-module.mk +++ glibc-2.17-c758a686/iconvdata/extra-module.mk @@ -4,16 +4,9 @@ extra-modules-left := $(strip $(filter-o extra-objs := $(extra-objs) $(patsubst %,%.os,$($(mod)-routines)) - + $(objpfx)$(mod).so: $(addprefix $(objpfx),$(addsuffix .os,$($(mod)-routines)))\ - $(shlib-lds) + $(shlib-lds) $(link-libc-deps) - $(build-module-asneeded) - + $(build-module-asneeded) + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -169,7 +169,7 @@ Index: glibc-2.17-c758a686/libidn/Makefile +++ glibc-2.17-c758a686/libidn/Makefile @@ -33,5 +33,3 @@ include $(..)Makeconfig libcidn-inhibit-o = $(filter-out .os,$(object-suffixes)) - + include $(..)Rules - -$(objpfx)libcidn.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a @@ -178,7 +178,7 @@ Index: glibc-2.17-c758a686/locale/Makefile --- glibc-2.17-c758a686.orig/locale/Makefile +++ glibc-2.17-c758a686/locale/Makefile @@ -99,9 +99,3 @@ cpp-srcs-left := $(localedef-modules) $( - $(lib-modules) + $(lib-modules) lib := locale-programs include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) - @@ -193,8 +193,8 @@ Index: glibc-2.17-c758a686/login/Makefile +++ glibc-2.17-c758a686/login/Makefile @@ -76,8 +76,3 @@ endif $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force) - $(make-target-directory) - -$(INSTALL_PROGRAM) -m 4755 -o root $< $@ + $(make-target-directory) + -$(INSTALL_PROGRAM) -m 4755 -o root $< $@ - -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by @@ -205,12 +205,12 @@ Index: glibc-2.17-c758a686/malloc/Makefile --- glibc-2.17-c758a686.orig/malloc/Makefile +++ glibc-2.17-c758a686/malloc/Makefile @@ -151,7 +151,7 @@ $(objpfx)memusage: memusage.sh - - + + # The implementation uses `dlsym' -$(objpfx)libmemusage.so: $(common-objpfx)dlfcn/libdl.so $(elfobjdir)/ld.so +$(objpfx)libmemusage.so: $(common-objpfx)dlfcn/libdl.so - + # Extra dependencies $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c Index: glibc-2.17-c758a686/math/Makefile @@ -231,9 +231,9 @@ Index: glibc-2.17-c758a686/nis/Makefile --- glibc-2.17-c758a686.orig/nis/Makefile +++ glibc-2.17-c758a686/nis/Makefile @@ -77,12 +77,12 @@ $(objpfx)libnss_nis.so: $(objpfx)libnsl. - $(common-objpfx)nss/libnss_files.so + $(common-objpfx)nss/libnss_files.so $(objpfx)libnss_nisplus.so: $(objpfx)libnsl.so$(libnsl.so-version) - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -245,8 +245,8 @@ Index: glibc-2.17-c758a686/nis/Makefile +# for new links: +$(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \ + libc-for-link = $(libnsl-libc) - - + + ifeq ($(build-shared),yes) Index: glibc-2.17-c758a686/nptl/Makefile =================================================================== @@ -255,7 +255,7 @@ Index: glibc-2.17-c758a686/nptl/Makefile @@ -530,14 +530,6 @@ $(objpfx)libpthread.so: $(addprefix $(ob $(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs)) $(objpfx)libpthread.so: +postinit += $(addprefix $(objpfx),$(crtn-objs)) - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -272,9 +272,9 @@ Index: glibc-2.17-c758a686/nptl_db/Makefile --- glibc-2.17-c758a686.orig/nptl_db/Makefile +++ glibc-2.17-c758a686/nptl_db/Makefile @@ -51,12 +51,6 @@ libthread_db.so-no-z-defs = yes - + include ../Rules - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -283,7 +283,7 @@ Index: glibc-2.17-c758a686/nptl_db/Makefile - tests: $(objpfx)db-symbols.out $(objpfx)db-symbols.out: $(objpfx)db-symbols.v.i \ - $(common-objpfx)nptl/libpthread.so + $(common-objpfx)nptl/libpthread.so Index: glibc-2.17-c758a686/nss/Makefile =================================================================== --- glibc-2.17-c758a686.orig/nss/Makefile @@ -291,7 +291,7 @@ Index: glibc-2.17-c758a686/nss/Makefile @@ -86,12 +86,11 @@ ifeq (yes,$(have-selinux)) LDLIBS-makedb := -lselinux endif - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -302,17 +302,17 @@ Index: glibc-2.17-c758a686/nss/Makefile +# RPC interfaces with the version of libc.so that makes them available +# for new links: +$(services:%=$(objpfx)libnss_%.so): libc-for-link = $(libnss-libc) - + $(objpfx)libnss_db.so: $(objpfx)libnss_files.so - + @@ -109,8 +108,7 @@ $(inst_vardbdir)/Makefile: db-Makefile $ - $(do-install) - + $(do-install) + libof-nss_test1 = extramodules -$(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(common-objpfx)libc.so \ - $(common-objpfx)libc_nonshared.a +$(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps) - $(build-module) + $(build-module) ifdef libnss_test1.so-version $(objpfx)/libnss_test1.so$(libnss_test1.so-version): $(objpfx)/libnss_test1.so Index: glibc-2.17-c758a686/ports/sysdeps/arm/Makefile @@ -322,7 +322,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/arm/Makefile @@ -25,11 +25,6 @@ sysdep_routines += $(aeabi_constants) $( static-only-routines += $(aeabi_constants) endif - + -# to pull in __aeabi_read_tp, needed for tls -ifeq ($(subdir),malloc) -$(objpfx)libmemusage.so: $(common-objpfx)libc_nonshared.a @@ -346,7 +346,7 @@ Index: glibc-2.17-c758a686/resolv/Makefile @@ -88,23 +88,11 @@ CFLAGS-res_hconf.c = -fexceptions # The BIND code elicits some harmless warnings. +cflags += -Wno-strict-prototypes -Wno-write-strings - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -361,22 +361,22 @@ Index: glibc-2.17-c758a686/resolv/Makefile -$(objpfx)libnss_dns.so: $(objpfx)libresolv.so $(common-objpfx)libc.so \ - $(common-objpfx)libc_nonshared.a +$(objpfx)libnss_dns.so: $(objpfx)libresolv.so - + # The asynchronous name lookup code needs the thread library. -$(objpfx)libanl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a \ - $(shared-thread-library) +$(objpfx)libanl.so: $(shared-thread-library) - + $(objpfx)ga_test: $(objpfx)libanl.so $(shared-thread-library) - + Index: glibc-2.17-c758a686/rt/Makefile =================================================================== --- glibc-2.17-c758a686.orig/rt/Makefile +++ glibc-2.17-c758a686/rt/Makefile @@ -64,12 +64,7 @@ CFLAGS-librt-cancellation.c = -fasynchro - + LDFLAGS-rt.so = -Wl,--enable-new-dtags,-z,nodelete - + -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. @@ -384,7 +384,7 @@ Index: glibc-2.17-c758a686/rt/Makefile - $(shared-thread-library) \ - $(elfobjdir)/ld.so +$(objpfx)librt.so: $(shared-thread-library) - + ifeq (yes,$(build-shared)) $(addprefix $(objpfx),$(tests)): $(objpfx)librt.so $(shared-thread-library) Index: glibc-2.17-c758a686/stdlib/Makefile @@ -394,12 +394,12 @@ Index: glibc-2.17-c758a686/stdlib/Makefile @@ -136,7 +136,7 @@ $(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $ $(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so LDFLAGS-tst-putenv = $(no-as-needed) - + -$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os +$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps) - $(build-module) + $(build-module) libof-tst-putenvmod = extramodules - + Index: glibc-2.17-c758a686/sysdeps/i386/fpu/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/fpu/Makefile @@ -415,9 +415,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/fpu/Makefile @@ -2,8 +2,6 @@ ifeq ($(subdir),math) libm-support += fenv_const fe_nomask fe_mask t_sqrt libm-tests += test-powerpc-snan - + -# libm needs ld.so to access dl_hwcap -$(objpfx)libm.so: $(elfobjdir)/ld.so endif - + ifeq ($(subdir),stdlib) diff --git a/SOURCES/glibc-rh1292018-0b.patch b/SOURCES/glibc-rh1292018-0b.patch index a0a28d2f..a764cbb9 100644 --- a/SOURCES/glibc-rh1292018-0b.patch +++ b/SOURCES/glibc-rh1292018-0b.patch @@ -13,41 +13,41 @@ Index: glibc-2.17-c758a686/elf/Makefile +++ glibc-2.17-c758a686/elf/Makefile @@ -22,7 +22,7 @@ subdir := elf include ../Makeconfig - + headers = elf.h bits/elfclass.h link.h bits/link.h -routines = $(dl-routines) dl-support dl-iteratephdr \ +routines = $(all-dl-routines) dl-support dl-iteratephdr \ - dl-addr enbl-secure dl-profstub \ - dl-origin dl-libc dl-sym dl-tsd dl-sysdep - + dl-addr enbl-secure dl-profstub \ + dl-origin dl-libc dl-sym dl-tsd dl-sysdep + @@ -43,7 +43,7 @@ shared-only-routines += dl-caller - + # ld.so uses those routines, plus some special stuff for being the program # interpreter and operating independent of libc. -rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal +rtld-routines = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) - + CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables Index: glibc-2.17-c758a686/ports/sysdeps/aarch64/Makefile =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/aarch64/Makefile +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/Makefile @@ -2,8 +2,6 @@ long-double-fcts = yes - + ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc -sysdep_routines += tlsdesc dl-tlsdesc -sysdep-rtld-routines += tlsdesc dl-tlsdesc gen-as-const-headers += dl-link.sym endif - + Index: glibc-2.17-c758a686/ports/sysdeps/arm/Makefile =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/arm/Makefile +++ glibc-2.17-c758a686/ports/sysdeps/arm/Makefile @@ -3,8 +3,8 @@ static-gnulib-arch = $(elfobjdir)/libgcc - + ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc -sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx tlsdesc dl-tlsdesc @@ -55,7 +55,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/arm/Makefile +sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx +sysdep-rtld-routines += aeabi_unwind_cpp_pr1 shared-only-routines += aeabi_unwind_cpp_pr1 - + $(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os Index: glibc-2.17-c758a686/ports/sysdeps/hppa/Makefile =================================================================== @@ -68,27 +68,27 @@ Index: glibc-2.17-c758a686/ports/sysdeps/hppa/Makefile -sysdep_routines += $(sysdep-dl-routines) -sysdep-rtld-routines += $(sysdep-dl-routines) endif - + ifeq ($(subdir),csu) Index: glibc-2.17-c758a686/sysdeps/i386/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/Makefile +++ glibc-2.17-c758a686/sysdeps/i386/Makefile @@ -74,8 +74,6 @@ endif - + ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc -sysdep_routines += tlsdesc dl-tlsdesc -sysdep-rtld-routines += tlsdesc dl-tlsdesc endif - + ifeq ($(subdir),csu) Index: glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile =================================================================== --- glibc-2.17-c758a686.orig/ports/sysdeps/ia64/Makefile +++ glibc-2.17-c758a686/ports/sysdeps/ia64/Makefile @@ -17,6 +17,4 @@ endif - + ifeq ($(subdir),elf) sysdep-dl-routines += dl-symaddr dl-fptr -sysdep_routines += $(sysdep-dl-routines) @@ -99,13 +99,13 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/Makefile --- glibc-2.17-c758a686.orig/ports/sysdeps/unix/sysv/linux/ia64/Makefile +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/ia64/Makefile @@ -14,8 +14,6 @@ endif - + ifeq ($(subdir),elf) sysdep-dl-routines += dl-static -sysdep_routines += $(sysdep-dl-routines) -sysdep-rtld-routines += $(sysdep-dl-routines) endif - + ifeq ($(subdir),rt) Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/Makefile =================================================================== @@ -119,7 +119,7 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/mips/Makefile -sysdep-rtld-routines += dl-static endif endif - + Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -132,17 +132,17 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile -sysdep-rtld-routines += dl-static endif endif - + Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/Makefile +++ glibc-2.17-c758a686/sysdeps/x86_64/Makefile @@ -20,8 +20,6 @@ endif - + ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc -sysdep_routines += tlsdesc dl-tlsdesc -sysdep-rtld-routines += tlsdesc dl-tlsdesc - + tests += tst-quad1 tst-quad2 modules-names += tst-quadmod1 tst-quadmod2 diff --git a/SOURCES/glibc-rh1292018-1.patch b/SOURCES/glibc-rh1292018-1.patch index 861759e1..b54b0b33 100644 --- a/SOURCES/glibc-rh1292018-1.patch +++ b/SOURCES/glibc-rh1292018-1.patch @@ -7,7 +7,7 @@ Author: H.J. Lu Date: Thu Aug 13 03:37:47 2015 -0700 Add _dl_x86_cpu_features to rtld_global - + This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so and initializes it early before __libc_start_main is called so that cpu_features is always available when it is used and we can avoid @@ -22,7 +22,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-machine.h #include #include +#include - + /* Return nonzero iff ELF header is compatible with the running host. */ static inline int __attribute__ ((unused)) @@ -266,6 +267,8 @@ dl_platform_init (void) @@ -32,7 +32,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-machine.h + + init_cpu_features (&GLRO(dl_x86_cpu_features)); } - + static inline Elf32_Addr Index: glibc-2.17-c758a686/sysdeps/i386/dl-procinfo.c =================================================================== @@ -41,7 +41,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-procinfo.c @@ -43,6 +43,22 @@ # define PROCINFO_CLASS #endif - + +#if !IS_IN (ldconfig) +# if !defined PROCINFO_DECL && defined SHARED + ._dl_x86_cpu_features @@ -67,10 +67,10 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/cacheinfo.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/cacheinfo.c @@ -8,6 +8,5 @@ #define __x86_64_raw_shared_cache_size_half __x86_raw_shared_cache_size_half - + #define DISABLE_PREFETCHW -#define DISABLE_PREFERRED_MEMORY_INSTRUCTION - + #include Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/Makefile =================================================================== @@ -98,7 +98,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/ifunc-defines.sym +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/ifunc-defines.sym @@ -4,7 +4,6 @@ -- - + CPU_FEATURES_SIZE sizeof (struct cpu_features) -KIND_OFFSET offsetof (struct cpu_features, kind) CPUID_OFFSET offsetof (struct cpu_features, cpuid) @@ -110,10 +110,10 @@ Index: glibc-2.17-c758a686/sysdeps/i386/ldsodefs.h +++ glibc-2.17-c758a686/sysdeps/i386/ldsodefs.h @@ -20,6 +20,7 @@ #define _I386_LDSODEFS_H 1 - + #include +#include - + struct La_i86_regs; struct La_i86_retval; Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c @@ -132,8 +132,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86/Makefile --- glibc-2.17-c758a686.orig/sysdeps/x86/Makefile +++ glibc-2.17-c758a686/sysdeps/x86/Makefile @@ -7,3 +7,14 @@ $(objpfx)tst-xmmymmzmm.out: ../sysdeps/x - @echo "Checking ld.so for SSE register use. This will take a few seconds..." - $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@ + @echo "Checking ld.so for SSE register use. This will take a few seconds..." + $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@ endif + +ifeq ($(subdir),csu) @@ -805,7 +805,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c #include #include +#include "multiarch/init-arch.h" - + -#ifndef __cpuid_count -/* FIXME: Provide __cpuid_count if it isn't defined. Copied from gcc - 4.4.0. Remove this if gcc 4.4 is the minimum requirement. */ @@ -842,13 +842,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c +#define is_intel GLRO(dl_x86_cpu_features).kind == arch_kind_intel +#define is_amd GLRO(dl_x86_cpu_features).kind == arch_kind_amd +#define max_cpuid GLRO(dl_x86_cpu_features).max_cpuid - + static const struct intel_02_cache_info { @@ -237,21 +208,8 @@ intel_check_word (int name, unsigned int - /* Intel reused this value. For family 15, model 6 it - specifies the 3rd level cache. Otherwise the 2nd - level cache. */ + /* Intel reused this value. For family 15, model 6 it + specifies the 3rd level cache. Otherwise the 2nd + level cache. */ - unsigned int family; - unsigned int model; -#ifdef USE_MULTIARCH @@ -866,9 +866,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c -#endif + unsigned int family = GLRO(dl_x86_cpu_features).family; + unsigned int model = GLRO(dl_x86_cpu_features).model; - - if (family == 15 && model == 6) - { + + if (family == 15 && model == 6) + { @@ -478,18 +436,6 @@ long int attribute_hidden __cache_sysconf (int name) @@ -887,11 +887,11 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c - if (is_intel) return handle_intel (name, max_cpuid); - + @@ -525,18 +471,6 @@ long int __x86_64_raw_shared_cache_size int __x86_64_prefetchw attribute_hidden; #endif - + -#ifndef DISABLE_PREFERRED_MEMORY_INSTRUCTION -/* Instructions preferred for memory and string routines. - @@ -904,13 +904,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c -int __x86_64_preferred_memory_instruction attribute_hidden; -#endif - - + static void __attribute__((constructor)) @@ -553,14 +487,6 @@ init_cacheinfo (void) unsigned int level; unsigned int threads = 0; - + -#ifdef USE_MULTIARCH - if (__cpu_features.kind == arch_kind_unknown) - __init_cpu_features (); @@ -923,9 +923,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c { data = handle_intel (_SC_LEVEL1_DCACHE_SIZE, max_cpuid); @@ -576,34 +502,13 @@ init_cacheinfo (void) - shared = handle_intel (_SC_LEVEL2_CACHE_SIZE, max_cpuid); - } - + shared = handle_intel (_SC_LEVEL2_CACHE_SIZE, max_cpuid); + } + - unsigned int ebx_1; - -#ifdef USE_MULTIARCH @@ -951,38 +951,38 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c -#endif - /* Figure out the number of logical threads that share the - highest cache level. */ + highest cache level. */ if (max_cpuid >= 4) - { + { + unsigned int family = GLRO(dl_x86_cpu_features).family; + unsigned int model = GLRO(dl_x86_cpu_features).model; + - int i = 0; - - /* Query until desired cache level is enumerated. */ + int i = 0; + + /* Query until desired cache level is enumerated. */ @@ -655,7 +560,6 @@ init_cacheinfo (void) - threads += 1; - if (threads > 2 && level == 2 && family == 6) - { + threads += 1; + if (threads > 2 && level == 2 && family == 6) + { - model += extended_model; - switch (model) - { - case 0x57: + switch (model) + { + case 0x57: @@ -678,7 +582,9 @@ init_cacheinfo (void) - intel_bug_no_cache_info: - /* Assume that all logical threads share the highest cache level. */ - + intel_bug_no_cache_info: + /* Assume that all logical threads share the highest cache level. */ + - threads = (ebx_1 >> 16) & 0xff; + threads + = ((GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].ebx + >> 16) & 0xff); - } - + } + /* Cap usage of highest cache level to the number of supported @@ -693,25 +599,6 @@ init_cacheinfo (void) long int core = handle_amd (_SC_LEVEL2_CACHE_SIZE); shared = handle_amd (_SC_LEVEL3_CACHE_SIZE); - + -#ifndef DISABLE_PREFERRED_MEMORY_INSTRUCTION -# ifdef USE_MULTIARCH - eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax; @@ -1004,7 +1004,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/cacheinfo.c - /* Get maximum extended function. */ __cpuid (0x80000000, max_cpuid_ex, ebx, ecx, edx); - + Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/dl-machine.h @@ -1014,7 +1014,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h #include #include +#include - + /* Return nonzero iff ELF header is compatible with the running host. */ static inline int __attribute__ ((unused)) @@ -200,6 +201,8 @@ dl_platform_init (void) @@ -1024,7 +1024,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h + + init_cpu_features (&GLRO(dl_x86_cpu_features)); } - + static inline ElfW(Addr) Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-procinfo.c =================================================================== @@ -1094,10 +1094,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/ldsodefs.h +++ glibc-2.17-c758a686/sysdeps/x86_64/ldsodefs.h @@ -20,6 +20,7 @@ #define _X86_64_LDSODEFS_H 1 - + #include +#include - + struct La_x86_64_regs; struct La_x86_64_retval; Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile @@ -1133,7 +1133,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-defines.sym +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-defines.sym @@ -4,7 +4,6 @@ -- - + CPU_FEATURES_SIZE sizeof (struct cpu_features) -KIND_OFFSET offsetof (struct cpu_features, kind) CPUID_OFFSET offsetof (struct cpu_features, cpuid) @@ -1334,7 +1334,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/init-arch.h @@ -15,183 +15,8 @@ License along with the GNU C Library; if not, see . */ - + -#define bit_Fast_Rep_String (1 << 0) -#define bit_Fast_Copy_Backward (1 << 1) -#define bit_Slow_BSF (1 << 2) diff --git a/SOURCES/glibc-rh1292018-2.patch b/SOURCES/glibc-rh1292018-2.patch index bc22259b..4e55e09b 100644 --- a/SOURCES/glibc-rh1292018-2.patch +++ b/SOURCES/glibc-rh1292018-2.patch @@ -6,32 +6,32 @@ Author: H.J. Lu Date: Thu Aug 13 03:38:47 2015 -0700 Update x86_64 multiarch functions for - + This patch updates x86_64 multiarch functions to use the newly defined HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from . - + Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_asin.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/e_asin.c +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_asin.c @@ -8,11 +8,15 @@ extern double __ieee754_acos_fma4 (doubl extern double __ieee754_asin_fma4 (double); - + libm_ifunc (__ieee754_acos, - HAS_FMA4 ? __ieee754_acos_fma4 : __ieee754_acos_sse2); + HAS_ARCH_FEATURE (FMA4_Usable) + ? __ieee754_acos_fma4 + : __ieee754_acos_sse2); strong_alias (__ieee754_acos, __acos_finite) - + libm_ifunc (__ieee754_asin, - HAS_FMA4 ? __ieee754_asin_fma4 : __ieee754_asin_sse2); + HAS_ARCH_FEATURE (FMA4_Usable) + ? __ieee754_asin_fma4 + : __ieee754_asin_sse2); strong_alias (__ieee754_asin, __asin_finite) - + # define __ieee754_acos __ieee754_acos_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_atan2.c =================================================================== @@ -47,7 +47,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_atan2.c +# define HAS_ARCH_FEATURE(feature) 0 # define __ieee754_atan2_fma4 ((void *) 0) # endif - + libm_ifunc (__ieee754_atan2, - HAS_FMA4 ? __ieee754_atan2_fma4 - : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2)); @@ -55,7 +55,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_atan2.c + : (HAS_ARCH_FEATURE (AVX_Usable) + ? __ieee754_atan2_avx : __ieee754_atan2_sse2)); strong_alias (__ieee754_atan2, __atan2_finite) - + # define __ieee754_atan2 __ieee754_atan2_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_exp.c =================================================================== @@ -71,7 +71,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_exp.c +# define HAS_ARCH_FEATURE(feature) 0 # define __ieee754_exp_fma4 ((void *) 0) # endif - + libm_ifunc (__ieee754_exp, - HAS_FMA4 ? __ieee754_exp_fma4 - : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2)); @@ -79,7 +79,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_exp.c + : (HAS_ARCH_FEATURE (AVX_Usable) + ? __ieee754_exp_avx : __ieee754_exp_sse2)); strong_alias (__ieee754_exp, __exp_finite) - + # define __ieee754_exp __ieee754_exp_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_log.c =================================================================== @@ -95,7 +95,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_log.c +# define HAS_ARCH_FEATURE(feature) 0 # define __ieee754_log_fma4 ((void *) 0) # endif - + libm_ifunc (__ieee754_log, - HAS_FMA4 ? __ieee754_log_fma4 - : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2)); @@ -103,7 +103,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_log.c + : (HAS_ARCH_FEATURE (AVX_Usable) + ? __ieee754_log_avx : __ieee754_log_sse2)); strong_alias (__ieee754_log, __log_finite) - + # define __ieee754_log __ieee754_log_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_pow.c =================================================================== @@ -112,14 +112,14 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/e_pow.c @@ -5,7 +5,10 @@ extern double __ieee754_pow_sse2 (double, double); extern double __ieee754_pow_fma4 (double, double); - + -libm_ifunc (__ieee754_pow, HAS_FMA4 ? __ieee754_pow_fma4 : __ieee754_pow_sse2); +libm_ifunc (__ieee754_pow, + HAS_ARCH_FEATURE (FMA4_Usable) + ? __ieee754_pow_fma4 + : __ieee754_pow_sse2); strong_alias (__ieee754_pow, __pow_finite) - + # define __ieee754_pow __ieee754_pow_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_atan.c =================================================================== @@ -135,13 +135,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_atan.c +# define HAS_ARCH_FEATURE(feature) 0 # define __atan_fma4 ((void *) 0) # endif - + -libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 : - HAS_AVX ? __atan_avx : __atan_sse2)); +libm_ifunc (atan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __atan_fma4 : + HAS_ARCH_FEATURE (AVX_Usable) + ? __atan_avx : __atan_sse2)); - + # define atan __atan_sse2 #endif Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceil.S @@ -149,68 +149,68 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceil.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_ceil.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceil.S @@ -22,10 +22,9 @@ - + ENTRY(__ceil) - .type __ceil, @gnu_indirect_function + .type __ceil, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __ceil_sse41(%rip), %rax + leaq __ceil_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __ceil_c(%rip), %rax + jnz 2f + leaq __ceil_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceilf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_ceilf.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_ceilf.S @@ -22,10 +22,9 @@ - + ENTRY(__ceilf) - .type __ceilf, @gnu_indirect_function + .type __ceilf, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __ceilf_sse41(%rip), %rax + leaq __ceilf_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __ceilf_c(%rip), %rax + jnz 2f + leaq __ceilf_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floor.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_floor.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floor.S @@ -22,10 +22,9 @@ - + ENTRY(__floor) - .type __floor, @gnu_indirect_function + .type __floor, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __floor_sse41(%rip), %rax + leaq __floor_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __floor_c(%rip), %rax + jnz 2f + leaq __floor_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floorf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_floorf.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_floorf.S @@ -22,10 +22,10 @@ - + ENTRY(__floorf) - .type __floorf, @gnu_indirect_function + .type __floorf, @gnu_indirect_function - call __get_cpu_features@plt + LOAD_RTLD_GLOBAL_RO_RDX - movq %rax, %rdx - leaq __floorf_sse41(%rip), %rax + movq %rax, %rdx + leaq __floorf_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __floorf_c(%rip), %rax + jnz 2f + leaq __floorf_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fma.c =================================================================== @@ -226,15 +226,15 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fma.c +# define HAS_ARCH_FEATURE(feature) 0 # define __fma_fma4 ((void *) 0) # endif - - + + -libm_ifunc (__fma, HAS_FMA - ? __fma_fma3 : (HAS_FMA4 ? __fma_fma4 : __fma_sse2)); +libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable) + ? __fma_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable) + ? __fma_fma4 : __fma_sse2)); weak_alias (__fma, fma) - + # define __fma __fma_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fmaf.c =================================================================== @@ -250,83 +250,83 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_fmaf.c +# define HAS_ARCH_FEATURE(feature) 0 # define __fmaf_fma4 ((void *) 0) # endif - - + + -libm_ifunc (__fmaf, HAS_FMA - ? __fmaf_fma3 : (HAS_FMA4 ? __fmaf_fma4 : __fmaf_sse2)); +libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) + ? __fmaf_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable) + ? __fmaf_fma4 : __fmaf_sse2)); weak_alias (__fmaf, fmaf) - + # define __fmaf __fmaf_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S @@ -22,10 +22,10 @@ - + ENTRY(__nearbyint) - .type __nearbyint, @gnu_indirect_function + .type __nearbyint, @gnu_indirect_function - call __get_cpu_features@plt + LOAD_RTLD_GLOBAL_RO_RDX - movq %rax, %rdx - leaq __nearbyint_sse41(%rip), %rax + movq %rax, %rdx + leaq __nearbyint_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __nearbyint_c(%rip), %rax + jnz 2f + leaq __nearbyint_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S @@ -22,10 +22,9 @@ - + ENTRY(__nearbyintf) - .type __nearbyintf, @gnu_indirect_function + .type __nearbyintf, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __nearbyintf_sse41(%rip), %rax + leaq __nearbyintf_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __nearbyintf_c(%rip), %rax + jnz 2f + leaq __nearbyintf_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rint.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_rint.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rint.S @@ -22,10 +22,9 @@ - + ENTRY(__rint) - .type __rint, @gnu_indirect_function + .type __rint, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __rint_sse41(%rip), %rax + leaq __rint_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __rint_c(%rip), %rax + jnz 2f + leaq __rint_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rintf.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/fpu/multiarch/s_rintf.S +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_rintf.S @@ -22,10 +22,9 @@ - + ENTRY(__rintf) - .type __rintf, @gnu_indirect_function + .type __rintf, @gnu_indirect_function - call __get_cpu_features@plt - movq %rax, %rdx + LOAD_RTLD_GLOBAL_RO_RDX - leaq __rintf_sse41(%rip), %rax + leaq __rintf_sse41(%rip), %rax - testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx) + HAS_CPU_FEATURE (SSE4_1) - jnz 2f - leaq __rintf_c(%rip), %rax + jnz 2f + leaq __rintf_c(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_sin.c =================================================================== @@ -343,21 +343,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_sin.c # define __cos_fma4 ((void *) 0) # define __sin_fma4 ((void *) 0) # endif - + -libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 : - HAS_AVX ? __cos_avx : __cos_sse2)); +libm_ifunc (__cos, (HAS_ARCH_FEATURE (FMA4_Usable) ? __cos_fma4 : + HAS_ARCH_FEATURE (AVX_Usable) + ? __cos_avx : __cos_sse2)); weak_alias (__cos, cos) - + -libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 : - HAS_AVX ? __sin_avx : __sin_sse2)); +libm_ifunc (__sin, (HAS_ARCH_FEATURE (FMA4_Usable) ? __sin_fma4 : + HAS_ARCH_FEATURE (AVX_Usable) + ? __sin_avx : __sin_sse2)); weak_alias (__sin, sin) - + # define __cos __cos_sse2 Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_tan.c =================================================================== @@ -373,13 +373,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/fpu/multiarch/s_tan.c +# define HAS_ARCH_FEATURE(feature) 0 # define __tan_fma4 ((void *) 0) # endif - + -libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 : - HAS_AVX ? __tan_avx : __tan_sse2)); +libm_ifunc (tan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __tan_fma4 : + HAS_ARCH_FEATURE (AVX_Usable) + ? __tan_avx : __tan_sse2)); - + # define tan __tan_sse2 #endif Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -387,120 +387,120 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/ifunc-impl-list.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -39,25 +39,26 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/memcmp.S. */ IFUNC_IMPL (i, name, memcmp, - IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSE4_1, + IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSE4_1), - __memcmp_sse4_1) + __memcmp_sse4_1) - IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSSE3, __memcmp_ssse3) + IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSSE3), + __memcmp_ssse3) - IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2)) - + IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2)) + /* Support sysdeps/x86_64/multiarch/memmove_chk.S. */ IFUNC_IMPL (i, name, __memmove_chk, - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3_back) + __memmove_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __memmove_chk, 1, - __memmove_chk_sse2)) - + __memmove_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __memmove_chk, 1, + __memmove_chk_sse2)) + /* Support sysdeps/x86_64/multiarch/memmove.S. */ IFUNC_IMPL (i, name, memmove, - IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3_back) + __memmove_ssse3_back) - IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3) - IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2)) - + __memmove_ssse3) + IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2)) + @@ -74,13 +75,13 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/rawmemchr.S. */ IFUNC_IMPL (i, name, rawmemchr, - IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE4_2), - __rawmemchr_sse42) - IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_sse2)) - + __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, + IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSSE3), - __stpncpy_ssse3) - IFUNC_IMPL_ADD (array, i, stpncpy, 1, - __stpncpy_sse2_unaligned) + __stpncpy_ssse3) + IFUNC_IMPL_ADD (array, i, stpncpy, 1, + __stpncpy_sse2_unaligned) @@ -88,92 +89,105 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/stpcpy.S. */ IFUNC_IMPL (i, name, stpcpy, - IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSSE3, __stpcpy_ssse3) + IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSSE3), + __stpcpy_ssse3) - IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2)) - + IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2_unaligned) + IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */ IFUNC_IMPL (i, name, strcasecmp, - IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_AVX, + IFUNC_IMPL_ADD (array, i, strcasecmp, + HAS_ARCH_FEATURE (AVX_Usable), - __strcasecmp_avx) + __strcasecmp_avx) - IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasecmp, + HAS_CPU_FEATURE (SSE4_2), - __strcasecmp_sse42) + __strcasecmp_sse42) - IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strcasecmp, + HAS_CPU_FEATURE (SSSE3), - __strcasecmp_ssse3) - IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_sse2)) - + __strcasecmp_ssse3) + IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_sse2)) + /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */ IFUNC_IMPL (i, name, strcasecmp_l, - IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_AVX, + IFUNC_IMPL_ADD (array, i, strcasecmp_l, + HAS_ARCH_FEATURE (AVX_Usable), - __strcasecmp_l_avx) + __strcasecmp_l_avx) - IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasecmp_l, + HAS_CPU_FEATURE (SSE4_2), - __strcasecmp_l_sse42) + __strcasecmp_l_sse42) - IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strcasecmp_l, + HAS_CPU_FEATURE (SSSE3), - __strcasecmp_l_ssse3) - IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1, - __strcasecmp_l_sse2)) - + __strcasecmp_l_ssse3) + IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1, + __strcasecmp_l_sse2)) + /* Support sysdeps/x86_64/multiarch/strcasestr.c. */ IFUNC_IMPL (i, name, strcasestr, - IFUNC_IMPL_ADD (array, i, strcasestr, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasestr, HAS_CPU_FEATURE (SSE4_2), - __strcasestr_sse42) - IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_sse2)) - + __strcasestr_sse42) + IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_sse2)) + /* Support sysdeps/x86_64/multiarch/strcat.S. */ IFUNC_IMPL (i, name, strcat, - IFUNC_IMPL_ADD (array, i, strcat, HAS_SSSE3, __strcat_ssse3) + IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSSE3), + __strcat_ssse3) - IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2)) - + IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2_unaligned) + IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2)) + /* Support sysdeps/x86_64/multiarch/strchr.S. */ IFUNC_IMPL (i, name, strchr, - IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE4_2, __strchr_sse42) + IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE4_2), + __strchr_sse42) - IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2_no_bsf) - IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2)) - + IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2_no_bsf) + IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2)) + /* Support sysdeps/x86_64/multiarch/strcmp.S. */ IFUNC_IMPL (i, name, strcmp, - IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2, __strcmp_sse42) @@ -509,188 +509,188 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c + __strcmp_sse42) + IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSSE3), + __strcmp_ssse3) - IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2)) - + IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2)) + /* Support sysdeps/x86_64/multiarch/strcpy.S. */ IFUNC_IMPL (i, name, strcpy, - IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSSE3, __strcpy_ssse3) + IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSSE3), + __strcpy_ssse3) - IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2)) - + IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2_unaligned) + IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/strcspn.S. */ IFUNC_IMPL (i, name, strcspn, - IFUNC_IMPL_ADD (array, i, strcspn, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcspn, HAS_CPU_FEATURE (SSE4_2), - __strcspn_sse42) - IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2)) - + __strcspn_sse42) + IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2)) + /* Support sysdeps/x86_64/multiarch/strncase_l.S. */ IFUNC_IMPL (i, name, strncasecmp, - IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_AVX, + IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_ARCH_FEATURE (AVX_Usable), - __strncasecmp_avx) + __strncasecmp_avx) - IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSE4_2), - __strncasecmp_sse42) + __strncasecmp_sse42) - IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSSE3), - __strncasecmp_ssse3) - IFUNC_IMPL_ADD (array, i, strncasecmp, 1, - __strncasecmp_sse2)) - + __strncasecmp_ssse3) + IFUNC_IMPL_ADD (array, i, strncasecmp, 1, + __strncasecmp_sse2)) + /* Support sysdeps/x86_64/multiarch/strncase_l.S. */ IFUNC_IMPL (i, name, strncasecmp_l, - IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_AVX, + IFUNC_IMPL_ADD (array, i, strncasecmp_l, + HAS_ARCH_FEATURE (AVX_Usable), - __strncasecmp_l_avx) + __strncasecmp_l_avx) - IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_CPU_FEATURE (SSE4_2), - __strncasecmp_l_sse42) + __strncasecmp_l_sse42) - IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_CPU_FEATURE (SSSE3), - __strncasecmp_l_ssse3) - IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, - __strncasecmp_l_sse2)) - + __strncasecmp_l_ssse3) + IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, + __strncasecmp_l_sse2)) + /* Support sysdeps/x86_64/multiarch/strncat.S. */ IFUNC_IMPL (i, name, strncat, - IFUNC_IMPL_ADD (array, i, strncat, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSSE3), - __strncat_ssse3) - IFUNC_IMPL_ADD (array, i, strncat, 1, - __strncat_sse2_unaligned) + __strncat_ssse3) + IFUNC_IMPL_ADD (array, i, strncat, 1, + __strncat_sse2_unaligned) @@ -181,7 +195,7 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/strncpy.S. */ IFUNC_IMPL (i, name, strncpy, - IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSSE3), - __strncpy_ssse3) - IFUNC_IMPL_ADD (array, i, strncpy, 1, - __strncpy_sse2_unaligned) + __strncpy_ssse3) + IFUNC_IMPL_ADD (array, i, strncpy, 1, + __strncpy_sse2_unaligned) @@ -194,79 +208,83 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/strpbrk.S. */ IFUNC_IMPL (i, name, strpbrk, - IFUNC_IMPL_ADD (array, i, strpbrk, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strpbrk, HAS_CPU_FEATURE (SSE4_2), - __strpbrk_sse42) - IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2)) - + __strpbrk_sse42) + IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2)) + /* Support sysdeps/x86_64/multiarch/strrchr.S. */ IFUNC_IMPL (i, name, strrchr, - IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE4_2), - __strrchr_sse42) - IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2_no_bsf) - IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2)) - + __strrchr_sse42) + IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2_no_bsf) + IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2)) + /* Support sysdeps/x86_64/multiarch/strspn.S. */ IFUNC_IMPL (i, name, strspn, - IFUNC_IMPL_ADD (array, i, strspn, HAS_SSE4_2, __strspn_sse42) + IFUNC_IMPL_ADD (array, i, strspn, HAS_CPU_FEATURE (SSE4_2), + __strspn_sse42) - IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_sse2)) - + IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_sse2)) + /* Support sysdeps/x86_64/multiarch/strstr-c.c. */ IFUNC_IMPL (i, name, strstr, - IFUNC_IMPL_ADD (array, i, strstr, use_unaligned_strstr (), - __strstr_sse2_unaligned) + IFUNC_IMPL_ADD (array, i, strstr, use_unaligned_strstr (), + __strstr_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42) + IFUNC_IMPL_ADD (array, i, strstr, HAS_CPU_FEATURE (SSE4_2), + __strstr_sse42) - IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2)) - + IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2)) + /* Support sysdeps/x86_64/multiarch/wcscpy.S. */ IFUNC_IMPL (i, name, wcscpy, - IFUNC_IMPL_ADD (array, i, wcscpy, HAS_SSSE3, __wcscpy_ssse3) + IFUNC_IMPL_ADD (array, i, wcscpy, HAS_CPU_FEATURE (SSSE3), + __wcscpy_ssse3) - IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2)) - + IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2)) + /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */ IFUNC_IMPL (i, name, wmemcmp, - IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSE4_1, + IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSE4_1), - __wmemcmp_sse4_1) + __wmemcmp_sse4_1) - IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSSE3), - __wmemcmp_ssse3) - IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_sse2)) - + __wmemcmp_ssse3) + IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_sse2)) + #ifdef SHARED /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */ IFUNC_IMPL (i, name, __memcpy_chk, - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3_back) + __memcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1, - __memcpy_chk_sse2)) - + __memcpy_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1, + __memcpy_chk_sse2)) + /* Support sysdeps/x86_64/multiarch/memcpy.S. */ IFUNC_IMPL (i, name, memcpy, - IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), - __memcpy_ssse3_back) + __memcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, __memcpy_ssse3) + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), __memcpy_ssse3) - IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) - + IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */ IFUNC_IMPL (i, name, __mempcpy_chk, - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3_back) + __mempcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1, - __mempcpy_chk_sse2)) - + __mempcpy_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1, + __mempcpy_chk_sse2)) + /* Support sysdeps/x86_64/multiarch/mempcpy.S. */ IFUNC_IMPL (i, name, mempcpy, - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3_back) + __mempcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3) - IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_sse2)) - + __mempcpy_ssse3) + IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/strlen.S. */ IFUNC_IMPL (i, name, strlen, - IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE4_2, __strlen_sse42) + IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE4_2), + __strlen_sse42) - IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_pminub) - IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_no_bsf) - IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2) + IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_pminub) + IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_no_bsf) + IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2) @@ -274,9 +292,9 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/strncmp.S. */ IFUNC_IMPL (i, name, strncmp, - IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSE4_2), - __strncmp_sse42) + __strncmp_sse42) - IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSSE3), - __strncmp_ssse3) - IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_sse2)) + __strncmp_ssse3) + IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_sse2)) #endif Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S @@ -26,16 +26,13 @@ - .text + .text ENTRY(memcmp) - .type memcmp, @gnu_indirect_function + .type memcmp, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -698,23 +698,23 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcmp.S -1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + LOAD_RTLD_GLOBAL_RO_RDX + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq __memcmp_sse2(%rip), %rax - ret - + jnz 2f + leaq __memcmp_sse2(%rip), %rax + ret + -2: testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip) +2: HAS_CPU_FEATURE (SSE4_1) - jz 3f - leaq __memcmp_sse4_1(%rip), %rax - ret + jz 3f + leaq __memcmp_sse4_1(%rip), %rax + ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S @@ -29,14 +29,12 @@ - .text + .text ENTRY(__new_memcpy) - .type __new_memcpy, @gnu_indirect_function + .type __new_memcpy, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -723,21 +723,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __memcpy_sse2(%rip), %rax + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __memcpy_ssse3(%rip), %rax + jz 2f + leaq __memcpy_ssse3(%rip), %rax - testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip) + HAS_ARCH_FEATURE (Fast_Copy_Backward) - jz 2f - leaq __memcpy_ssse3_back(%rip), %rax + jz 2f + leaq __memcpy_ssse3_back(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S @@ -29,14 +29,12 @@ - .text + .text ENTRY(__memcpy_chk) - .type __memcpy_chk, @gnu_indirect_function + .type __memcpy_chk, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -746,12 +746,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __memcpy_chk_sse2(%rip), %rax + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __memcpy_chk_ssse3(%rip), %rax + jz 2f + leaq __memcpy_chk_ssse3(%rip), %rax - testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip) + HAS_ARCH_FEATURE (Fast_Copy_Backward) - jz 2f - leaq __memcpy_chk_ssse3_back(%rip), %rax + jz 2f + leaq __memcpy_chk_ssse3_back(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c =================================================================== @@ -765,23 +765,23 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c - ? (HAS_FAST_COPY_BACKWARD + HAS_CPU_FEATURE (SSSE3) + ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) - ? __memmove_ssse3_back : __memmove_ssse3) - : __memmove_sse2) - + ? __memmove_ssse3_back : __memmove_ssse3) + : __memmove_sse2) + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memmove_chk.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c @@ -29,7 +29,7 @@ extern __typeof (__memmove_chk) __memmov #include "debug/memmove_chk.c" - + libc_ifunc (__memmove_chk, - HAS_SSSE3 - ? (HAS_FAST_COPY_BACKWARD + HAS_CPU_FEATURE (SSSE3) + ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) - ? __memmove_chk_ssse3_back : __memmove_chk_ssse3) - : __memmove_chk_sse2); + ? __memmove_chk_ssse3_back : __memmove_chk_ssse3) + : __memmove_chk_sse2); Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy.S @@ -789,7 +789,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S @@ -27,14 +27,12 @@ #if defined SHARED && IS_IN (libc) ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function + .type __mempcpy, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -798,21 +798,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __mempcpy_sse2(%rip), %rax + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __mempcpy_ssse3(%rip), %rax + jz 2f + leaq __mempcpy_ssse3(%rip), %rax - testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip) + HAS_ARCH_FEATURE (Fast_Copy_Backward) - jz 2f - leaq __mempcpy_ssse3_back(%rip), %rax + jz 2f + leaq __mempcpy_ssse3_back(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S @@ -29,14 +29,12 @@ - .text + .text ENTRY(__mempcpy_chk) - .type __mempcpy_chk, @gnu_indirect_function + .type __mempcpy_chk, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -821,12 +821,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __mempcpy_chk_sse2(%rip), %rax + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __mempcpy_chk_ssse3(%rip), %rax + jz 2f + leaq __mempcpy_chk_ssse3(%rip), %rax - testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip) + HAS_ARCH_FEATURE (Fast_Copy_Backward) - jz 2f - leaq __mempcpy_chk_ssse3_back(%rip), %rax + jz 2f + leaq __mempcpy_chk_ssse3_back(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S =================================================================== @@ -835,7 +835,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S @@ -24,11 +24,9 @@ #if IS_IN (libc) ENTRY(memset) - .type memset, @gnu_indirect_function + .type memset, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -844,8 +844,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __memset_x86_64(%rip), %rax + HAS_ARCH_FEATURE (Prefer_SSE_for_memop) - jz 2f - leaq __memset_sse2(%rip), %rax + jz 2f + leaq __memset_sse2(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S =================================================================== @@ -854,7 +854,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S @@ -25,11 +25,9 @@ # ifdef SHARED ENTRY(__memset_chk) - .type __memset_chk, @gnu_indirect_function + .type __memset_chk, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -863,8 +863,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __memset_chk_x86_64(%rip), %rax + HAS_ARCH_FEATURE (Prefer_SSE_for_memop) - jz 2f - leaq __memset_chk_sse2(%rip), %rax + jz 2f + leaq __memset_chk_sse2(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/sched_cpucount.c =================================================================== @@ -872,7 +872,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/sched_cpucount.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/sched_cpucount.c @@ -33,4 +33,4 @@ #undef __sched_cpucount - + libc_ifunc (__sched_cpucount, - HAS_POPCOUNT ? popcount_cpucount : generic_cpucount); + HAS_CPU_FEATURE (POPCOUNT) ? popcount_cpucount : generic_cpucount); @@ -881,9 +881,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcat.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S @@ -47,14 +47,12 @@ - .text + .text ENTRY(STRCAT) - .type STRCAT, @gnu_indirect_function + .type STRCAT, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -892,21 +892,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcat.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq STRCAT_SSE2_UNALIGNED(%rip), %rax + HAS_ARCH_FEATURE (Fast_Unaligned_Load) - jnz 2f - leaq STRCAT_SSE2(%rip), %rax + jnz 2f + leaq STRCAT_SSE2(%rip), %rax - testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq STRCAT_SSSE3(%rip), %rax + jz 2f + leaq STRCAT_SSSE3(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strchr.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S @@ -25,15 +25,13 @@ - .text + .text ENTRY(strchr) - .type strchr, @gnu_indirect_function + .type strchr, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -915,42 +915,42 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strchr.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __strchr_sse2(%rip), %rax + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq __strchr_sse42(%rip), %rax - ret + jz 2f + leaq __strchr_sse42(%rip), %rax + ret -2: testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip) +2: HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - leaq __strchr_sse2_no_bsf(%rip), %rax + jz 3f + leaq __strchr_sse2_no_bsf(%rip), %rax 3: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S @@ -83,16 +83,12 @@ - .text + .text ENTRY(STRCMP) - .type STRCMP, @gnu_indirect_function + .type STRCMP, @gnu_indirect_function - /* Manually inlined call to __get_cpu_features. */ - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features -1: + LOAD_RTLD_GLOBAL_RO_RDX - leaq STRCMP_SSE42(%rip), %rax + leaq STRCMP_SSE42(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + HAS_CPU_FEATURE (SSE4_2) - jnz 2f - leaq STRCMP_SSSE3(%rip), %rax + jnz 2f + leaq STRCMP_SSSE3(%rip), %rax - testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq STRCMP_SSE2(%rip), %rax + jnz 2f + leaq STRCMP_SSE2(%rip), %rax 2: ret @@ -101,21 +97,17 @@ END(STRCMP) # ifdef USE_AS_STRCASECMP_L ENTRY(__strcasecmp) - .type __strcasecmp, @gnu_indirect_function + .type __strcasecmp, @gnu_indirect_function - /* Manually inlined call to __get_cpu_features. */ - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f @@ -958,25 +958,25 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S -1: + LOAD_RTLD_GLOBAL_RO_RDX # ifdef HAVE_AVX_SUPPORT - leaq __strcasecmp_avx(%rip), %rax + leaq __strcasecmp_avx(%rip), %rax - testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip) + HAS_ARCH_FEATURE (AVX_Usable) - jnz 2f + jnz 2f # endif - leaq __strcasecmp_sse42(%rip), %rax + leaq __strcasecmp_sse42(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + HAS_CPU_FEATURE (SSE4_2) - jnz 2f - leaq __strcasecmp_ssse3(%rip), %rax + jnz 2f + leaq __strcasecmp_ssse3(%rip), %rax - testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq __strcasecmp_sse2(%rip), %rax + jnz 2f + leaq __strcasecmp_sse2(%rip), %rax 2: ret @@ -125,21 +117,17 @@ weak_alias (__strcasecmp, strcasecmp) # ifdef USE_AS_STRNCASECMP_L ENTRY(__strncasecmp) - .type __strncasecmp, @gnu_indirect_function + .type __strncasecmp, @gnu_indirect_function - /* Manually inlined call to __get_cpu_features. */ - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f @@ -984,29 +984,29 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcmp.S -1: + LOAD_RTLD_GLOBAL_RO_RDX # ifdef HAVE_AVX_SUPPORT - leaq __strncasecmp_avx(%rip), %rax + leaq __strncasecmp_avx(%rip), %rax - testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip) + HAS_ARCH_FEATURE (AVX_Usable) - jnz 2f + jnz 2f # endif - leaq __strncasecmp_sse42(%rip), %rax + leaq __strncasecmp_sse42(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + HAS_CPU_FEATURE (SSE4_2) - jnz 2f - leaq __strncasecmp_ssse3(%rip), %rax + jnz 2f + leaq __strncasecmp_ssse3(%rip), %rax - testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq __strncasecmp_sse2(%rip), %rax + jnz 2f + leaq __strncasecmp_sse2(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S @@ -61,14 +61,12 @@ - .text + .text ENTRY(STRCPY) - .type STRCPY, @gnu_indirect_function + .type STRCPY, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1015,21 +1015,21 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcpy.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq STRCPY_SSE2_UNALIGNED(%rip), %rax + HAS_ARCH_FEATURE (Fast_Unaligned_Load) - jnz 2f - leaq STRCPY_SSE2(%rip), %rax + jnz 2f + leaq STRCPY_SSE2(%rip), %rax - testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq STRCPY_SSSE3(%rip), %rax + jz 2f + leaq STRCPY_SSSE3(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcspn.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S @@ -45,11 +45,9 @@ - .text + .text ENTRY(STRCSPN) - .type STRCSPN, @gnu_indirect_function + .type STRCSPN, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1038,17 +1038,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcspn.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq STRCSPN_SSE2(%rip), %rax + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq STRCSPN_SSE42(%rip), %rax + jz 2f + leaq STRCSPN_SSE42(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strspn.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S @@ -30,11 +30,9 @@ - .text + .text ENTRY(strspn) - .type strspn, @gnu_indirect_function + .type strspn, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1057,8 +1057,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strspn.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __strspn_sse2(%rip), %rax + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq __strspn_sse42(%rip), %rax + jz 2f + leaq __strspn_sse42(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c =================================================================== @@ -1066,7 +1066,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c @@ -75,12 +75,18 @@ do_test (int argc, char **argv) int fails; - + get_cpuinfo (); - fails = check_proc ("avx", HAS_AVX, "HAS_AVX"); - fails += check_proc ("fma4", HAS_FMA4, "HAS_FMA4"); @@ -1086,17 +1086,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/test-multiarch.c + "HAS_CPU_FEATURE (SSSE3)"); + fails += check_proc ("popcnt", HAS_CPU_FEATURE (POPCOUNT), + "HAS_CPU_FEATURE (POPCOUNT)"); - + printf ("%d differences between /proc/cpuinfo and glibc code.\n", fails); - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wcscpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S @@ -27,11 +27,8 @@ - .text + .text ENTRY(wcscpy) - .type wcscpy, @gnu_indirect_function + .type wcscpy, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -1104,17 +1104,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wcscpy.S -1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + LOAD_RTLD_GLOBAL_RO_RDX + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq __wcscpy_sse2(%rip), %rax - ret + jnz 2f + leaq __wcscpy_sse2(%rip), %rax + ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/wmemcmp.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S @@ -26,16 +26,13 @@ - .text + .text ENTRY(wmemcmp) - .type wmemcmp, @gnu_indirect_function + .type wmemcmp, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features(%rip) - jne 1f - call __init_cpu_features @@ -1122,43 +1122,43 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/wmemcmp.S -1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) + LOAD_RTLD_GLOBAL_RO_RDX + HAS_CPU_FEATURE (SSSE3) - jnz 2f - leaq __wmemcmp_sse2(%rip), %rax - ret - + jnz 2f + leaq __wmemcmp_sse2(%rip), %rax + ret + -2: testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip) +2: HAS_CPU_FEATURE (SSE4_1) - jz 3f - leaq __wmemcmp_sse4_1(%rip), %rax - ret + jz 3f + leaq __wmemcmp_sse4_1(%rip), %rax + ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/rawmemchr.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rawmemchr.S @@ -27,12 +27,10 @@ - .text + .text ENTRY(rawmemchr) - .type rawmemchr, @gnu_indirect_function + .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) + LOAD_RTLD_GLOBAL_RO_RDX + HAS_ARCH_FEATURE (Prefer_PMINUB_for_stringop) - jnz 2f + jnz 2f - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq __rawmemchr_sse42(%rip), %rax - ret + jz 2f + leaq __rawmemchr_sse42(%rip), %rax + ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strlen.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S @@ -29,18 +29,16 @@ - .text + .text ENTRY(strlen) - .type strlen, @gnu_indirect_function + .type strlen, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1167,26 +1167,26 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strlen.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __strlen_sse2_pminub(%rip), %rax + HAS_ARCH_FEATURE (Prefer_PMINUB_for_stringop) - jnz 2f - leaq __strlen_sse2(%rip), %rax + jnz 2f + leaq __strlen_sse2(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq __strlen_sse42(%rip), %rax - ret + jz 2f + leaq __strlen_sse42(%rip), %rax + ret -2: testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip) +2: HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - leaq __strlen_sse2_no_bsf(%rip), %rax + jz 3f + leaq __strlen_sse2_no_bsf(%rip), %rax 3: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strnlen.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S @@ -27,11 +27,9 @@ - .text + .text ENTRY(__strnlen) - .type __strnlen, @gnu_indirect_function + .type __strnlen, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1195,17 +1195,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strnlen.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __strnlen_sse2(%rip), %rax + HAS_ARCH_FEATURE (Slow_BSF) - jz 2f - leaq __strnlen_sse2_no_bsf(%rip), %rax + jz 2f + leaq __strnlen_sse2_no_bsf(%rip), %rax 2: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strrchr.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S @@ -28,15 +28,13 @@ - .text + .text ENTRY(strrchr) - .type strrchr, @gnu_indirect_function + .type strrchr, @gnu_indirect_function - cmpl $0, __cpu_features+KIND_OFFSET(%rip) - jne 1f - call __init_cpu_features @@ -1214,20 +1214,20 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strrchr.S + LOAD_RTLD_GLOBAL_RO_RDX + leaq __strrchr_sse2(%rip), %rax + HAS_CPU_FEATURE (SSE4_2) - jz 2f - leaq __strrchr_sse42(%rip), %rax - ret + jz 2f + leaq __strrchr_sse42(%rip), %rax + ret -2: testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip) +2: HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - leaq __strrchr_sse2_no_bsf(%rip), %rax + jz 3f + leaq __strrchr_sse2_no_bsf(%rip), %rax 3: ret Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strcasestr-c.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c @@ -12,8 +12,8 @@ extern __typeof (__strcasestr_sse2) __st - + #if 1 libc_ifunc (__strcasestr, - HAS_SSE4_2 && !use_unaligned_strstr () ? __strcasestr_sse42 : @@ -1236,7 +1236,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strcasestr-c.c + ? __strcasestr_sse42 : __strcasestr_sse2); #else libc_ifunc (__strcasestr, - 0 ? __strcasestr_sse42 : __strcasestr_sse2); + 0 ? __strcasestr_sse42 : __strcasestr_sse2); Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/strstr-c.c @@ -1247,5 +1247,6 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c extern __typeof (__redirect_strstr) __libc_strstr; -libc_ifunc (__libc_strstr, HAS_SSE4_2 ? (use_unaligned_strstr () ? +libc_ifunc (__libc_strstr, HAS_CPU_FEATURE (SSE4_2) ? (use_unaligned_strstr () ? - __strstr_sse2_unaligned : - __strstr_sse42) : __strstr_sse2) + __strstr_sse2_unaligned : + __strstr_sse42) : __strstr_sse2) + diff --git a/SOURCES/glibc-rh1292018-3.patch b/SOURCES/glibc-rh1292018-3.patch index 833fbb48..36b703ee 100644 --- a/SOURCES/glibc-rh1292018-3.patch +++ b/SOURCES/glibc-rh1292018-3.patch @@ -13,7 +13,7 @@ Author: H.J. Lu Date: Sun Mar 6 08:23:24 2016 -0800 Use HAS_ARCH_FEATURE with Fast_Rep_String - + HAS_ARCH_FEATURE, not HAS_CPU_FEATURE, should be used with Fast_Rep_String. @@ -22,17 +22,17 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/e_expf.c --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/fpu/multiarch/e_expf.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/e_expf.c @@ -23,11 +23,15 @@ extern double __ieee754_expf_ia32 (doubl - + double __ieee754_expf (double); libm_ifunc (__ieee754_expf, - HAS_SSE2 ? __ieee754_expf_sse2 : __ieee754_expf_ia32); + HAS_CPU_FEATURE (SSE2) + ? __ieee754_expf_sse2 + : __ieee754_expf_ia32); - + extern double __expf_finite_sse2 (double); extern double __expf_finite_ia32 (double); - + double __expf_finite (double); libm_ifunc (__expf_finite, - HAS_SSE2 ? __expf_finite_sse2 : __expf_finite_ia32); @@ -46,11 +46,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/s_cosf.c @@ -22,7 +22,7 @@ extern float __cosf_sse2 (float); extern float __cosf_ia32 (float); float __cosf (float); - + -libm_ifunc (__cosf, HAS_SSE2 ? __cosf_sse2 : __cosf_ia32); +libm_ifunc (__cosf, HAS_CPU_FEATURE (SSE2) ? __cosf_sse2 : __cosf_ia32); weak_alias (__cosf, cosf); - + #define COSF __cosf_ia32 Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c =================================================================== @@ -59,12 +59,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c @@ -22,7 +22,8 @@ extern void __sincosf_sse2 (float, float extern void __sincosf_ia32 (float, float *, float *); void __sincosf (float, float *, float *); - + -libm_ifunc (__sincosf, HAS_SSE2 ? __sincosf_sse2 : __sincosf_ia32); +libm_ifunc (__sincosf, + HAS_CPU_FEATURE (SSE2) ? __sincosf_sse2 : __sincosf_ia32); weak_alias (__sincosf, sincosf); - + #define SINCOSF __sincosf_ia32 Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/s_sinf.c =================================================================== @@ -73,7 +73,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/fpu/multiarch/s_sinf.c @@ -22,7 +22,7 @@ extern float __sinf_sse2 (float); extern float __sinf_ia32 (float); float __sinf (float); - + -libm_ifunc (__sinf, HAS_SSE2 ? __sinf_sse2 : __sinf_ia32); +libm_ifunc (__sinf, HAS_CPU_FEATURE (SSE2) ? __sinf_sse2 : __sinf_ia32); weak_alias (__sinf, sinf); @@ -84,13 +84,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/bcopy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S @@ -23,46 +23,19 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(bcopy) - .type bcopy, @gnu_indirect_function + .type bcopy, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -103,12 +103,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__bcopy_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __bcopy_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__bcopy_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __bcopy_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -133,7 +133,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bcopy.S 2: ret END(bcopy) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S @@ -141,13 +141,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/bzero.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S @@ -23,46 +23,19 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(__bzero) - .type __bzero, @gnu_indirect_function + .type __bzero, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -160,12 +160,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__bzero_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __bzero_sse2@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX ( __bzero_sse2) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __bzero_sse2_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -190,7 +190,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/bzero.S 2: ret END(__bzero) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/ifunc-impl-list.c @@ -198,362 +198,362 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/ifunc-impl-list.c --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/ifunc-impl-list.c +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/ifunc-impl-list.c @@ -38,152 +38,152 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/i386/i686/multiarch/bcopy.S. */ IFUNC_IMPL (i, name, bcopy, - IFUNC_IMPL_ADD (array, i, bcopy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, bcopy, HAS_CPU_FEATURE (SSSE3), - __bcopy_ssse3_rep) + __bcopy_ssse3_rep) - IFUNC_IMPL_ADD (array, i, bcopy, HAS_SSSE3, __bcopy_ssse3) + IFUNC_IMPL_ADD (array, i, bcopy, HAS_CPU_FEATURE (SSSE3), __bcopy_ssse3) - IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ia32)) - + IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ia32)) + /* Support sysdeps/i386/i686/multiarch/bzero.S. */ IFUNC_IMPL (i, name, bzero, - IFUNC_IMPL_ADD (array, i, bzero, HAS_SSE2, __bzero_sse2_rep) - IFUNC_IMPL_ADD (array, i, bzero, HAS_SSE2, __bzero_sse2) + IFUNC_IMPL_ADD (array, i, bzero, HAS_CPU_FEATURE (SSE2), __bzero_sse2_rep) + IFUNC_IMPL_ADD (array, i, bzero, HAS_CPU_FEATURE (SSE2), __bzero_sse2) - IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ia32)) - + IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ia32)) + /* Support sysdeps/i386/i686/multiarch/memchr.S. */ IFUNC_IMPL (i, name, memchr, - IFUNC_IMPL_ADD (array, i, memchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, memchr, HAS_CPU_FEATURE (SSE2), - __memchr_sse2_bsf) + __memchr_sse2_bsf) - IFUNC_IMPL_ADD (array, i, memchr, HAS_SSE2, __memchr_sse2) + IFUNC_IMPL_ADD (array, i, memchr, HAS_CPU_FEATURE (SSE2), __memchr_sse2) - IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_ia32)) - + IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/memcmp.S. */ IFUNC_IMPL (i, name, memcmp, - IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSE4_2), - __memcmp_sse4_2) + __memcmp_sse4_2) - IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSSE3, __memcmp_ssse3) + IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSSE3), __memcmp_ssse3) - IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ia32)) - + IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ia32)) + /* Support sysdeps/i386/i686/multiarch/memmove_chk.S. */ IFUNC_IMPL (i, name, __memmove_chk, - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3_rep) + __memmove_chk_ssse3_rep) - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __memmove_chk, 1, - __memmove_chk_ia32)) - + __memmove_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __memmove_chk, 1, + __memmove_chk_ia32)) + /* Support sysdeps/i386/i686/multiarch/memmove.S. */ IFUNC_IMPL (i, name, memmove, - IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3_rep) + __memmove_ssse3_rep) - IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3) - IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ia32)) - + __memmove_ssse3) + IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ia32)) + /* Support sysdeps/i386/i686/multiarch/memrchr.S. */ IFUNC_IMPL (i, name, memrchr, - IFUNC_IMPL_ADD (array, i, memrchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, memrchr, HAS_CPU_FEATURE (SSE2), - __memrchr_sse2_bsf) + __memrchr_sse2_bsf) - IFUNC_IMPL_ADD (array, i, memrchr, HAS_SSE2, __memrchr_sse2) + IFUNC_IMPL_ADD (array, i, memrchr, HAS_CPU_FEATURE (SSE2), __memrchr_sse2) - IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_ia32)) - + IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/memset_chk.S. */ IFUNC_IMPL (i, name, __memset_chk, - IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_CPU_FEATURE (SSE2), - __memset_chk_sse2_rep) + __memset_chk_sse2_rep) - IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_CPU_FEATURE (SSE2), - __memset_chk_sse2) - IFUNC_IMPL_ADD (array, i, __memset_chk, 1, - __memset_chk_ia32)) - + __memset_chk_sse2) + IFUNC_IMPL_ADD (array, i, __memset_chk, 1, + __memset_chk_ia32)) + /* Support sysdeps/i386/i686/multiarch/memset.S. */ IFUNC_IMPL (i, name, memset, - IFUNC_IMPL_ADD (array, i, memset, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, memset, HAS_CPU_FEATURE (SSE2), - __memset_sse2_rep) + __memset_sse2_rep) - IFUNC_IMPL_ADD (array, i, memset, HAS_SSE2, __memset_sse2) + IFUNC_IMPL_ADD (array, i, memset, HAS_CPU_FEATURE (SSE2), __memset_sse2) - IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ia32)) - + IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ia32)) + /* Support sysdeps/i386/i686/multiarch/rawmemchr.S. */ IFUNC_IMPL (i, name, rawmemchr, - IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE2), - __rawmemchr_sse2_bsf) + __rawmemchr_sse2_bsf) - IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_CPU_FEATURE (SSE2), - __rawmemchr_sse2) - IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_ia32)) - + __rawmemchr_sse2) + IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/stpncpy.S. */ IFUNC_IMPL (i, name, stpncpy, - IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSSE3), - __stpncpy_ssse3) + __stpncpy_ssse3) - IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSE2, __stpncpy_sse2) + IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSE2), __stpncpy_sse2) - IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_ia32)) - + IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/stpcpy.S. */ IFUNC_IMPL (i, name, stpcpy, - IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSSE3, __stpcpy_ssse3) - IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSE2, __stpcpy_sse2) + IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSSE3), __stpcpy_ssse3) + IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSE2), __stpcpy_sse2) - IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_ia32)) - + IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcasecmp.S. */ IFUNC_IMPL (i, name, strcasecmp, - IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_CPU_FEATURE (SSE4_2), - __strcasecmp_sse4_2) + __strcasecmp_sse4_2) - IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_CPU_FEATURE (SSSE3), - __strcasecmp_ssse3) - IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ia32)) - + __strcasecmp_ssse3) + IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcasecmp_l.S. */ IFUNC_IMPL (i, name, strcasecmp_l, - IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_CPU_FEATURE (SSE4_2), - __strcasecmp_l_sse4_2) + __strcasecmp_l_sse4_2) - IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_CPU_FEATURE (SSSE3), - __strcasecmp_l_ssse3) - IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1, - __strcasecmp_l_ia32)) - + __strcasecmp_l_ssse3) + IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1, + __strcasecmp_l_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcasestr.c. */ IFUNC_IMPL (i, name, strcasestr, - IFUNC_IMPL_ADD (array, i, strcasestr, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcasestr, HAS_CPU_FEATURE (SSE4_2), - __strcasestr_sse42) - IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_ia32)) - + __strcasestr_sse42) + IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcat.S. */ IFUNC_IMPL (i, name, strcat, - IFUNC_IMPL_ADD (array, i, strcat, HAS_SSSE3, __strcat_ssse3) - IFUNC_IMPL_ADD (array, i, strcat, HAS_SSE2, __strcat_sse2) + IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSSE3), __strcat_ssse3) + IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSE2), __strcat_sse2) - IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_ia32)) - + IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_ia32)) + /* Support sysdeps/i386/i686/multiarch/strchr.S. */ IFUNC_IMPL (i, name, strchr, - IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE2), - __strchr_sse2_bsf) + __strchr_sse2_bsf) - IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE2, __strchr_sse2) + IFUNC_IMPL_ADD (array, i, strchr, HAS_CPU_FEATURE (SSE2), __strchr_sse2) - IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_ia32)) - + IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcmp.S. */ IFUNC_IMPL (i, name, strcmp, - IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSE4_2), - __strcmp_sse4_2) + __strcmp_sse4_2) - IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSSE3, __strcmp_ssse3) + IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSSE3), __strcmp_ssse3) - IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_ia32)) - + IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcpy.S. */ IFUNC_IMPL (i, name, strcpy, - IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSSE3, __strcpy_ssse3) - IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSE2, __strcpy_sse2) + IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSSE3), __strcpy_ssse3) + IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSE2), __strcpy_sse2) - IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_ia32)) - + IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/strcspn.S. */ IFUNC_IMPL (i, name, strcspn, - IFUNC_IMPL_ADD (array, i, strcspn, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strcspn, HAS_CPU_FEATURE (SSE4_2), - __strcspn_sse42) - IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_ia32)) - + __strcspn_sse42) + IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_ia32)) + /* Support sysdeps/i386/i686/multiarch/strncase.S. */ IFUNC_IMPL (i, name, strncasecmp, - IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSE4_2), - __strncasecmp_sse4_2) + __strncasecmp_sse4_2) - IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_CPU_FEATURE (SSSE3), - __strncasecmp_ssse3) - IFUNC_IMPL_ADD (array, i, strncasecmp, 1, - __strncasecmp_ia32)) + __strncasecmp_ssse3) + IFUNC_IMPL_ADD (array, i, strncasecmp, 1, + __strncasecmp_ia32)) @@ -191,133 +191,133 @@ __libc_ifunc_impl_list (const char *name /* Support sysdeps/i386/i686/multiarch/strncase_l.S. */ IFUNC_IMPL (i, name, strncasecmp_l, - IFUNC_IMPL_ADD (array, i, strncasecmp_l, + IFUNC_IMPL_ADD (array, i, strncasecmp_l, - HAS_SSE4_2, __strncasecmp_l_sse4_2) + HAS_CPU_FEATURE (SSE4_2), __strncasecmp_l_sse4_2) - IFUNC_IMPL_ADD (array, i, strncasecmp_l, + IFUNC_IMPL_ADD (array, i, strncasecmp_l, - HAS_SSSE3, __strncasecmp_l_ssse3) + HAS_CPU_FEATURE (SSSE3), __strncasecmp_l_ssse3) - IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, - __strncasecmp_l_ia32)) - + IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, + __strncasecmp_l_ia32)) + /* Support sysdeps/i386/i686/multiarch/strncat.S. */ IFUNC_IMPL (i, name, strncat, - IFUNC_IMPL_ADD (array, i, strncat, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSSE3), - __strncat_ssse3) + __strncat_ssse3) - IFUNC_IMPL_ADD (array, i, strncat, HAS_SSE2, __strncat_sse2) + IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSE2), __strncat_sse2) - IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_ia32)) - + IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_ia32)) + /* Support sysdeps/i386/i686/multiarch/strncpy.S. */ IFUNC_IMPL (i, name, strncpy, - IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSSE3), - __strncpy_ssse3) + __strncpy_ssse3) - IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSE2, __strncpy_sse2) + IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSE2), __strncpy_sse2) - IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_ia32)) - + IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/strnlen.S. */ IFUNC_IMPL (i, name, strnlen, - IFUNC_IMPL_ADD (array, i, strnlen, HAS_SSE2, __strnlen_sse2) + IFUNC_IMPL_ADD (array, i, strnlen, HAS_CPU_FEATURE (SSE2), __strnlen_sse2) - IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_ia32)) - + IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_ia32)) + /* Support sysdeps/i386/i686/multiarch/strpbrk.S. */ IFUNC_IMPL (i, name, strpbrk, - IFUNC_IMPL_ADD (array, i, strpbrk, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strpbrk, HAS_CPU_FEATURE (SSE4_2), - __strpbrk_sse42) - IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_ia32)) - + __strpbrk_sse42) + IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_ia32)) + /* Support sysdeps/i386/i686/multiarch/strrchr.S. */ IFUNC_IMPL (i, name, strrchr, - IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE2), - __strrchr_sse2_bsf) + __strrchr_sse2_bsf) - IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE2, __strrchr_sse2) + IFUNC_IMPL_ADD (array, i, strrchr, HAS_CPU_FEATURE (SSE2), __strrchr_sse2) - IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_ia32)) - + IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/strspn.S. */ IFUNC_IMPL (i, name, strspn, - IFUNC_IMPL_ADD (array, i, strspn, HAS_SSE4_2, __strspn_sse42) + IFUNC_IMPL_ADD (array, i, strspn, HAS_CPU_FEATURE (SSE4_2), __strspn_sse42) - IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_ia32)) - + IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_ia32)) + /* Support sysdeps/i386/i686/multiarch/strstr-c.c. */ IFUNC_IMPL (i, name, strstr, - IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42) + IFUNC_IMPL_ADD (array, i, strstr, HAS_CPU_FEATURE (SSE4_2), __strstr_sse42) - IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_ia32)) - + IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_ia32)) + /* Support sysdeps/i386/i686/multiarch/wcschr.S. */ IFUNC_IMPL (i, name, wcschr, - IFUNC_IMPL_ADD (array, i, wcschr, HAS_SSE2, __wcschr_sse2) + IFUNC_IMPL_ADD (array, i, wcschr, HAS_CPU_FEATURE (SSE2), __wcschr_sse2) - IFUNC_IMPL_ADD (array, i, wcschr, 1, __wcschr_ia32)) - + IFUNC_IMPL_ADD (array, i, wcschr, 1, __wcschr_ia32)) + /* Support sysdeps/i386/i686/multiarch/wcscmp.S. */ IFUNC_IMPL (i, name, wcscmp, - IFUNC_IMPL_ADD (array, i, wcscmp, HAS_SSE2, __wcscmp_sse2) + IFUNC_IMPL_ADD (array, i, wcscmp, HAS_CPU_FEATURE (SSE2), __wcscmp_sse2) - IFUNC_IMPL_ADD (array, i, wcscmp, 1, __wcscmp_ia32)) - + IFUNC_IMPL_ADD (array, i, wcscmp, 1, __wcscmp_ia32)) + /* Support sysdeps/i386/i686/multiarch/wcscpy.S. */ IFUNC_IMPL (i, name, wcscpy, - IFUNC_IMPL_ADD (array, i, wcscpy, HAS_SSSE3, __wcscpy_ssse3) + IFUNC_IMPL_ADD (array, i, wcscpy, HAS_CPU_FEATURE (SSSE3), __wcscpy_ssse3) - IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_ia32)) - + IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/wcslen.S. */ IFUNC_IMPL (i, name, wcslen, - IFUNC_IMPL_ADD (array, i, wcslen, HAS_SSE2, __wcslen_sse2) + IFUNC_IMPL_ADD (array, i, wcslen, HAS_CPU_FEATURE (SSE2), __wcslen_sse2) - IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_ia32)) - + IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_ia32)) + /* Support sysdeps/i386/i686/multiarch/wcsrchr.S. */ IFUNC_IMPL (i, name, wcsrchr, - IFUNC_IMPL_ADD (array, i, wcsrchr, HAS_SSE2, __wcsrchr_sse2) + IFUNC_IMPL_ADD (array, i, wcsrchr, HAS_CPU_FEATURE (SSE2), __wcsrchr_sse2) - IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ia32)) - + IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ia32)) + /* Support sysdeps/i386/i686/multiarch/wmemcmp.S. */ IFUNC_IMPL (i, name, wmemcmp, - IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSE4_2), - __wmemcmp_sse4_2) + __wmemcmp_sse4_2) - IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSSE3), - __wmemcmp_ssse3) - IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_ia32)) - + __wmemcmp_ssse3) + IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_ia32)) + #ifdef SHARED /* Support sysdeps/i386/i686/multiarch/memcpy_chk.S. */ IFUNC_IMPL (i, name, __memcpy_chk, - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3_rep) + __memcpy_chk_ssse3_rep) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1, - __memcpy_chk_ia32)) - + __memcpy_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1, + __memcpy_chk_ia32)) + /* Support sysdeps/i386/i686/multiarch/memcpy.S. */ IFUNC_IMPL (i, name, memcpy, - IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), - __memcpy_ssse3_rep) + __memcpy_ssse3_rep) - IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, __memcpy_ssse3) + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), __memcpy_ssse3) - IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ia32)) - + IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/mempcpy_chk.S. */ IFUNC_IMPL (i, name, __mempcpy_chk, - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3_rep) + __mempcpy_chk_ssse3_rep) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1, - __mempcpy_chk_ia32)) - + __mempcpy_chk_ssse3) + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1, + __mempcpy_chk_ia32)) + /* Support sysdeps/i386/i686/multiarch/mempcpy.S. */ IFUNC_IMPL (i, name, mempcpy, - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3_rep) + __mempcpy_ssse3_rep) - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3) - IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ia32)) - + __mempcpy_ssse3) + IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ia32)) + /* Support sysdeps/i386/i686/multiarch/strlen.S. */ IFUNC_IMPL (i, name, strlen, - IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE2, + IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE2), - __strlen_sse2_bsf) + __strlen_sse2_bsf) - IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE2, __strlen_sse2) + IFUNC_IMPL_ADD (array, i, strlen, HAS_CPU_FEATURE (SSE2), __strlen_sse2) - IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_ia32)) - + IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_ia32)) + /* Support sysdeps/i386/i686/multiarch/strncmp.S. */ IFUNC_IMPL (i, name, strncmp, - IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSE4_2, + IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSE4_2), - __strncmp_sse4_2) + __strncmp_sse4_2) - IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSSE3, + IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSSE3), - __strncmp_ssse3) - IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_ia32)) + __strncmp_ssse3) + IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_ia32)) #endif Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S =================================================================== @@ -561,7 +561,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S @@ -22,46 +22,22 @@ #include - + #if IS_IN (libc) -# define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ @@ -571,9 +571,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S - cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (REG, 0) - - .text + .text ENTRY(__memchr) - .type __memchr, @gnu_indirect_function + .type __memchr, @gnu_indirect_function - pushl %ebx - CFI_PUSH (%ebx) - LOAD_PIC_REG(bx) @@ -584,46 +584,46 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memchr.S -1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx) + LOAD_GOT_AND_RTLD_GLOBAL_RO + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - + jz 3f + - leal __memchr_sse2@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) + LOAD_FUNC_GOT_EAX ( __memchr_sse2) - ret - + ret + - CFI_PUSH (%ebx) - -2: leal __memchr_ia32@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +2: LOAD_FUNC_GOT_EAX (__memchr_ia32) - ret - + ret + - CFI_PUSH (%ebx) - -3: leal __memchr_sse2_bsf@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +3: LOAD_FUNC_GOT_EAX (__memchr_sse2_bsf) - ret + ret END(__memchr) - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcmp.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S @@ -23,46 +23,19 @@ - + /* Define multiple versions only for the definition in libc. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(memcmp) - .type memcmp, @gnu_indirect_function + .type memcmp, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -636,12 +636,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memcmp_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __memcmp_ssse3@GOTOFF(%ebx), %eax - testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memcmp_ssse3) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __memcmp_sse4_2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -666,7 +666,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcmp.S 2: ret END(memcmp) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S @@ -674,9 +674,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S @@ -28,24 +28,15 @@ - .text + .text ENTRY(memcpy) - .type memcpy, @gnu_indirect_function + .type memcpy, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -689,12 +689,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memcpy_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __memcpy_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memcpy_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memcpy_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -703,16 +703,16 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy.S + LOAD_FUNC_GOT_EAX (__memcpy_ssse3_rep) +2: ret END(memcpy) - + # undef ENTRY Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy_chk.S @@ -29,24 +29,15 @@ - .text + .text ENTRY(__memcpy_chk) - .type __memcpy_chk, @gnu_indirect_function + .type __memcpy_chk, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -725,12 +725,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memcpy_chk.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memcpy_chk_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __memcpy_chk_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memcpy_chk_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -746,13 +746,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memmove.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S @@ -23,32 +23,23 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(memmove) - .type memmove, @gnu_indirect_function + .type memmove, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -765,12 +765,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memmove_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __memmove_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memmove_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memmove_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -779,18 +779,18 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S + LOAD_FUNC_GOT_EAX (__memmove_ssse3_rep) +2: ret END(memmove) - + -# undef ENTRY -# define ENTRY(name) \ +# ifdef SHARED +# undef ENTRY +# define ENTRY(name) \ - .type __memmove_ia32, @function; \ - .p2align 4; \ - .globl __memmove_ia32; \ + .type __memmove_ia32, @function; \ + .p2align 4; \ + .globl __memmove_ia32; \ @@ -56,24 +47,9 @@ END(memmove) - __memmove_ia32: cfi_startproc; \ - CALL_MCOUNT + __memmove_ia32: cfi_startproc; \ + CALL_MCOUNT # else - .text -ENTRY(memmove) @@ -807,26 +807,26 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove.S - leal __memmove_ssse3_rep, %eax -2: ret -END(memmove) - + -# undef ENTRY -# define ENTRY(name) \ +# undef ENTRY +# define ENTRY(name) \ - .type __memmove_ia32, @function; \ - .globl __memmove_ia32; \ - .p2align 4; \ + .type __memmove_ia32, @function; \ + .globl __memmove_ia32; \ + .p2align 4; \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memmove_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S @@ -23,46 +23,21 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(__memmove_chk) - .type __memmove_chk, @gnu_indirect_function + .type __memmove_chk, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -839,12 +839,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memmove_chk_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __memmove_chk_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memmove_chk_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -868,19 +868,19 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memmove_chk.S + LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3_rep) 2: ret END(__memmove_chk) - + +# ifndef SHARED - .type __memmove_chk_ssse3, @function - .p2align 4; + .type __memmove_chk_ssse3, @function + .p2align 4; __memmove_chk_ssse3: Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/mempcpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S @@ -28,24 +28,15 @@ - .text + .text ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function + .type __mempcpy, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -893,12 +893,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__mempcpy_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __mempcpy_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__mempcpy_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __mempcpy_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -907,16 +907,16 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy.S + LOAD_FUNC_GOT_EAX (__mempcpy_ssse3_rep) +2: ret END(__mempcpy) - + # undef ENTRY Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/mempcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy_chk.S @@ -29,24 +29,15 @@ - .text + .text ENTRY(__mempcpy_chk) - .type __mempcpy_chk, @gnu_indirect_function + .type __mempcpy_chk, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -929,12 +929,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/mempcpy_chk.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__mempcpy_chk_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __mempcpy_chk_ssse3@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __mempcpy_chk_ssse3_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -951,7 +951,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S @@ -22,46 +22,22 @@ #include - + #if IS_IN (libc) -# define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ @@ -961,9 +961,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S - cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (REG, 0) - - .text + .text ENTRY(__memrchr) - .type __memrchr, @gnu_indirect_function + .type __memrchr, @gnu_indirect_function - pushl %ebx - CFI_PUSH (%ebx) - LOAD_PIC_REG(bx) @@ -974,46 +974,46 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memrchr.S -1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx) + LOAD_GOT_AND_RTLD_GLOBAL_RO + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - + jz 3f + - leal __memrchr_sse2@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) + LOAD_FUNC_GOT_EAX (__memrchr_sse2) - ret - + ret + - CFI_PUSH (%ebx) - -2: leal __memrchr_ia32@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +2: LOAD_FUNC_GOT_EAX (__memrchr_ia32) - ret - + ret + - CFI_PUSH (%ebx) - -3: leal __memrchr_sse2_bsf@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +3: LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf) - ret + ret END(__memrchr) - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memset.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S @@ -23,46 +23,19 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(memset) - .type memset, @gnu_indirect_function + .type memset, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1026,12 +1026,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memset_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __memset_sse2@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memset_sse2) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memset_sse2_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1056,7 +1056,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset.S 2: ret END(memset) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S @@ -1064,13 +1064,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/memset_chk.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S @@ -23,50 +23,26 @@ - + /* Define multiple versions only for the definition in lib. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(__memset_chk) - .type __memset_chk, @gnu_indirect_function + .type __memset_chk, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1083,12 +1083,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__memset_chk_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __memset_chk_sse2@GOTOFF(%ebx), %eax - testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__memset_chk_sse2) + HAS_ARCH_FEATURE (Fast_Rep_String) - jz 2f + jz 2f - leal __memset_chk_sse2_rep@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1097,13 +1097,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S + LOAD_FUNC_GOT_EAX (__memset_chk_sse2_rep) +2: ret END(__memset_chk) - + +# ifdef SHARED strong_alias (__memset_chk, __memset_zero_constant_len_parameter) - .section .gnu.warning.__memset_zero_constant_len_parameter - .string "memset used with constant zero length parameter; this could be due to transposed parameters" + .section .gnu.warning.__memset_zero_constant_len_parameter + .string "memset used with constant zero length parameter; this could be due to transposed parameters" # else - .text + .text -ENTRY(__memset_chk) - .type __memset_chk, @gnu_indirect_function - cmpl $0, KIND_OFFSET+__cpu_features @@ -1119,8 +1119,8 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/memset_chk.S -2: ret -END(__memset_chk) - - .type __memset_chk_sse2, @function - .p2align 4; + .type __memset_chk_sse2, @function + .p2align 4; __memset_chk_sse2: Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S =================================================================== @@ -1128,7 +1128,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S @@ -22,46 +22,22 @@ #include - + #if IS_IN (libc) -# define CFI_POP(REG) \ - cfi_adjust_cfa_offset (-4); \ @@ -1138,9 +1138,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S - cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (REG, 0) - - .text + .text ENTRY(__rawmemchr) - .type __rawmemchr, @gnu_indirect_function + .type __rawmemchr, @gnu_indirect_function - pushl %ebx - CFI_PUSH (%ebx) - LOAD_PIC_REG(bx) @@ -1151,34 +1151,34 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/rawmemchr.S -1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx) + LOAD_GOT_AND_RTLD_GLOBAL_RO + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + HAS_ARCH_FEATURE (Slow_BSF) - jz 3f - + jz 3f + - leal __rawmemchr_sse2@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) + LOAD_FUNC_GOT_EAX (__rawmemchr_sse2) - ret - + ret + - CFI_PUSH (%ebx) - -2: leal __rawmemchr_ia32@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +2: LOAD_FUNC_GOT_EAX (__rawmemchr_ia32) - ret - + ret + - CFI_PUSH (%ebx) - -3: leal __rawmemchr_sse2_bsf@GOTOFF(%ebx), %eax - popl %ebx - CFI_POP (%ebx) +3: LOAD_FUNC_GOT_EAX (__rawmemchr_sse2_bsf) - ret + ret END(__rawmemchr) - + Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/s_fma.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/s_fma.c @@ -1186,12 +1186,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/s_fma.c @@ -26,7 +26,8 @@ extern double __fma_ia32 (double x, double y, double z) attribute_hidden; extern double __fma_fma (double x, double y, double z) attribute_hidden; - + -libm_ifunc (__fma, HAS_FMA ? __fma_fma : __fma_ia32); +libm_ifunc (__fma, + HAS_ARCH_FEATURE (FMA_Usable) ? __fma_fma : __fma_ia32); weak_alias (__fma, fma) - + # define __fma __fma_ia32 Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/s_fmaf.c =================================================================== @@ -1200,12 +1200,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/s_fmaf.c @@ -26,7 +26,8 @@ extern float __fmaf_ia32 (float x, float y, float z) attribute_hidden; extern float __fmaf_fma (float x, float y, float z) attribute_hidden; - + -libm_ifunc (__fmaf, HAS_FMA ? __fmaf_fma : __fmaf_ia32); +libm_ifunc (__fmaf, + HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma : __fmaf_ia32); weak_alias (__fmaf, fmaf) - + # define __fmaf __fmaf_ia32 Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcasecmp.S =================================================================== @@ -1214,11 +1214,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcasecmp.S @@ -20,48 +20,18 @@ #include #include - + -#ifdef SHARED - .text + .text ENTRY(__strcasecmp) - .type __strcasecmp, @gnu_indirect_function + .type __strcasecmp, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1231,12 +1231,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcasecmp.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strcasecmp_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __strcasecmp_ssse3@GOTOFF(%ebx), %eax - testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__strcasecmp_ssse3) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __strcasecmp_sse4_2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1264,7 +1264,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcasecmp.S 2: ret END(__strcasecmp) -#endif - + weak_alias (__strcasecmp, strcasecmp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S =================================================================== @@ -1273,11 +1273,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S @@ -45,52 +45,22 @@ need strncat before the initialization happened. */ #if IS_IN (libc) - + -# ifdef SHARED - .text + .text ENTRY(STRCAT) - .type STRCAT, @gnu_indirect_function + .type STRCAT, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1290,15 +1290,15 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (STRCAT_IA32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal STRCAT_SSE2@GOTOFF(%ebx), %eax - testl $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (STRCAT_SSE2) + HAS_ARCH_FEATURE (Fast_Unaligned_Load) - jnz 2f + jnz 2f - testl $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal STRCAT_SSSE3@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1324,20 +1324,20 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcat.S + LOAD_FUNC_GOT_EAX (STRCAT_SSSE3) 2: ret END(STRCAT) - + -# endif - # undef ENTRY # define ENTRY(name) \ - .type STRCAT_IA32, @function; \ + .type STRCAT_IA32, @function; \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S @@ -25,24 +25,15 @@ - .text + .text ENTRY(strchr) - .type strchr, @gnu_indirect_function + .type strchr, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1350,12 +1350,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strchr_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __strchr_sse2_bsf@GOTOFF(%ebx), %eax - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__strchr_sse2_bsf) + HAS_ARCH_FEATURE (Slow_BSF) - jz 2f + jz 2f - leal __strchr_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1364,7 +1364,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strchr.S + LOAD_FUNC_GOT_EAX (__strchr_sse2) +2: ret END(strchr) - + # undef ENTRY Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S =================================================================== @@ -1375,9 +1375,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S need strncmp before the initialization happened. */ #if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(STRCMP) - .type STRCMP, @gnu_indirect_function + .type STRCMP, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1390,12 +1390,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__STRCMP_IA32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __STRCMP_SSSE3@GOTOFF(%ebx), %eax - testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__STRCMP_SSSE3) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __STRCMP_SSE4_2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1420,7 +1420,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcmp.S 2: ret END(STRCMP) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S @@ -1430,11 +1430,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S @@ -61,52 +61,22 @@ need strncpy before the initialization happened. */ #if IS_IN (libc) - + -# ifdef SHARED - .text + .text ENTRY(STRCPY) - .type STRCPY, @gnu_indirect_function + .type STRCPY, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1447,15 +1447,15 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (STRCPY_IA32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal STRCPY_SSE2@GOTOFF(%ebx), %eax - testl $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (STRCPY_SSE2) + HAS_ARCH_FEATURE (Fast_Unaligned_Load) - jnz 2f + jnz 2f - testl $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal STRCPY_SSSE3@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1481,12 +1481,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcpy.S + LOAD_FUNC_GOT_EAX (STRCPY_SSSE3) 2: ret END(STRCPY) - + -# endif - # undef ENTRY # define ENTRY(name) \ - .type STRCPY_IA32, @function; \ + .type STRCPY_IA32, @function; \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strcspn.S @@ -1496,9 +1496,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S need strpbrk before the initialization happened. */ #if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(STRCSPN) - .type STRCSPN, @gnu_indirect_function + .type STRCSPN, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1511,7 +1511,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (STRCSPN_IA32) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal STRCSPN_SSE42@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1533,7 +1533,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strcspn.S 2: ret END(STRCSPN) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S @@ -1541,9 +1541,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strlen.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S @@ -28,24 +28,15 @@ - .text + .text ENTRY(strlen) - .type strlen, @gnu_indirect_function + .type strlen, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1556,12 +1556,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strlen_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __strlen_sse2_bsf@GOTOFF(%ebx), %eax - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__strlen_sse2_bsf) + HAS_ARCH_FEATURE (Slow_BSF) - jz 2f + jz 2f - leal __strlen_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1570,7 +1570,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strlen.S + LOAD_FUNC_GOT_EAX (__strlen_sse2) +2: ret END(strlen) - + # undef ENTRY Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strncase.S =================================================================== @@ -1579,11 +1579,11 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strncase.S @@ -20,48 +20,18 @@ #include #include - + -#ifdef SHARED - .text + .text ENTRY(__strncasecmp) - .type __strncasecmp, @gnu_indirect_function + .type __strncasecmp, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1596,12 +1596,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strncase.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strncasecmp_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __strncasecmp_ssse3@GOTOFF(%ebx), %eax - testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__strncasecmp_ssse3) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __strncasecmp_sse4_2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1629,16 +1629,16 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strncase.S 2: ret END(__strncasecmp) -#endif - + weak_alias (__strncasecmp, strncasecmp) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strnlen.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S @@ -25,21 +25,12 @@ - .text + .text ENTRY(__strnlen) - .type __strnlen, @gnu_indirect_function + .type __strnlen, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1651,7 +1651,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strnlen_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __strnlen_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1660,16 +1660,16 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strnlen.S + LOAD_FUNC_GOT_EAX (__strnlen_sse2) +2: ret END(__strnlen) - + weak_alias(__strnlen, strnlen) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strrchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S @@ -25,24 +25,15 @@ - .text + .text ENTRY(strrchr) - .type strrchr, @gnu_indirect_function + .type strrchr, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1682,12 +1682,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strrchr_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __strrchr_sse2_bsf@GOTOFF(%ebx), %eax - testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__strrchr_sse2_bsf) + HAS_ARCH_FEATURE (Slow_BSF) - jz 2f + jz 2f - leal __strrchr_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1696,20 +1696,20 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strrchr.S + LOAD_FUNC_GOT_EAX (__strrchr_sse2) +2: ret END(strrchr) - + # undef ENTRY Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/strspn.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S @@ -27,40 +27,16 @@ - + /* Define multiple versions only for the definition in libc. */ #if IS_IN (libc) -# ifdef SHARED - .text + .text ENTRY(strspn) - .type strspn, @gnu_indirect_function + .type strspn, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1722,7 +1722,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__strspn_ia32) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __strspn_sse42@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1744,7 +1744,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strspn.S 2: ret END(strspn) -# endif - + # undef ENTRY # define ENTRY(name) \ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S @@ -1752,9 +1752,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcschr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S @@ -25,20 +25,11 @@ - .text + .text ENTRY(wcschr) - .type wcschr, @gnu_indirect_function + .type wcschr, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1767,7 +1767,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcschr.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wcschr_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __wcschr_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1782,9 +1782,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscmp.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp.S @@ -28,20 +28,11 @@ - .text + .text ENTRY(wcscmp) - .type wcscmp, @gnu_indirect_function + .type wcscmp, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1797,7 +1797,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscmp.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wcscmp_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __wcscmp_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1812,9 +1812,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcscpy.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S @@ -26,20 +26,11 @@ - .text + .text ENTRY(wcscpy) - .type wcscpy, @gnu_indirect_function + .type wcscpy, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1827,7 +1827,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcscpy.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wcscpy_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __wcscpy_ssse3@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1842,9 +1842,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcslen.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S @@ -25,21 +25,12 @@ - .text + .text ENTRY(__wcslen) - .type __wcslen, @gnu_indirect_function + .type __wcslen, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1857,7 +1857,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wcslen_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __wcslen_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1866,16 +1866,16 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcslen.S + LOAD_FUNC_GOT_EAX (__wcslen_sse2) +2: ret END(__wcslen) - + weak_alias(__wcslen, wcslen) Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wcsrchr.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr.S @@ -25,20 +25,11 @@ - .text + .text ENTRY(wcsrchr) - .type wcsrchr, @gnu_indirect_function + .type wcsrchr, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1888,7 +1888,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wcsrchr.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wcsrchr_ia32) + HAS_CPU_FEATURE (SSE2) - jz 2f + jz 2f - leal __wcsrchr_sse2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4); @@ -1903,9 +1903,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp.S --- glibc-2.17-c758a686.orig/sysdeps/i386/i686/multiarch/wmemcmp.S +++ glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp.S @@ -27,23 +27,14 @@ - .text + .text ENTRY(wmemcmp) - .type wmemcmp, @gnu_indirect_function + .type wmemcmp, @gnu_indirect_function - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) @@ -1918,12 +1918,12 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/wmemcmp.S + LOAD_GOT_AND_RTLD_GLOBAL_RO + LOAD_FUNC_GOT_EAX (__wmemcmp_ia32) + HAS_CPU_FEATURE (SSSE3) - jz 2f + jz 2f - leal __wmemcmp_ssse3@GOTOFF(%ebx), %eax - testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) + LOAD_FUNC_GOT_EAX (__wmemcmp_ssse3) + HAS_CPU_FEATURE (SSE4_2) - jz 2f + jz 2f - leal __wmemcmp_sse4_2@GOTOFF(%ebx), %eax -2: popl %ebx - cfi_adjust_cfa_offset (-4) @@ -1943,6 +1943,6 @@ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/strstr-c.c libc_ifunc (__libc_strstr, - HAS_SSE4_2 && !use_unaligned_strstr () ? + HAS_CPU_FEATURE (SSE4_2) && !use_unaligned_strstr () ? - __strstr_sse42 : __strstr_ia32) - + __strstr_sse42 : __strstr_ia32) + #undef strstr diff --git a/SOURCES/glibc-rh1292018-4.patch b/SOURCES/glibc-rh1292018-4.patch index 54e049ef..1e03502e 100644 --- a/SOURCES/glibc-rh1292018-4.patch +++ b/SOURCES/glibc-rh1292018-4.patch @@ -3,13 +3,13 @@ Author: Siddhesh Poyarekar Date: Fri Aug 14 05:30:17 2015 -0700 Remove incorrect register mov in floorf/nearbyint on x86_64 - + The change in 0b5395f052ee09cd7e3d219af4e805c38058afb5 replaced calls to __get_cpu_features@plt followed by a mov from rax to rdx, with a single macro LOAD_RTLD_GLOBAL_RO_RDX. It is pretty clear that there was a typo in s_floorf and __nearbyint due to which the (now incorrect) mov was not removed. This patch removes that mov. - + * sysdeps/x86_64/fpu/multiarch/s_floorf.S (__floorf): Remove unnecessary movq. * sysdeps/x86_64/fpu/multiarch/s_nearbyint.S (__nearbyint): @@ -21,21 +21,21 @@ index f60f662..9d67847 100644 +++ b/sysdeps/x86_64/fpu/multiarch/s_floorf.S @@ -23,7 +23,6 @@ ENTRY(__floorf) - .type __floorf, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __floorf, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - movq %rax, %rdx - leaq __floorf_sse41(%rip), %rax - HAS_CPU_FEATURE (SSE4_1) - jnz 2f + leaq __floorf_sse41(%rip), %rax + HAS_CPU_FEATURE (SSE4_1) + jnz 2f diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S index 109395c..2c13024 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S +++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S @@ -23,7 +23,6 @@ ENTRY(__nearbyint) - .type __nearbyint, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __nearbyint, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - movq %rax, %rdx - leaq __nearbyint_sse41(%rip), %rax - HAS_CPU_FEATURE (SSE4_1) - jnz 2f + leaq __nearbyint_sse41(%rip), %rax + HAS_CPU_FEATURE (SSE4_1) + jnz 2f diff --git a/SOURCES/glibc-rh1292018-5.patch b/SOURCES/glibc-rh1292018-5.patch index f4d7dff0..ce0422bf 100644 --- a/SOURCES/glibc-rh1292018-5.patch +++ b/SOURCES/glibc-rh1292018-5.patch @@ -15,12 +15,12 @@ index fba3ef0..aff894c 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -78,6 +78,9 @@ init_cpu_features (struct cpu_features *cpu_features) - cpu_features->feature[index_Slow_BSF] |= bit_Slow_BSF; - break; - + cpu_features->feature[index_Slow_BSF] |= bit_Slow_BSF; + break; + + case 0x57: + /* Knights Landing. Enable Silvermont optimizations. */ + - case 0x37: - case 0x4a: - case 0x4d: + case 0x37: + case 0x4a: + case 0x4d: diff --git a/SOURCES/glibc-rh1292018-6.patch b/SOURCES/glibc-rh1292018-6.patch index bb0b61fd..50c3775f 100644 --- a/SOURCES/glibc-rh1292018-6.patch +++ b/SOURCES/glibc-rh1292018-6.patch @@ -3,7 +3,7 @@ Author: H.J. Lu Date: Wed Oct 21 14:44:23 2015 -0700 Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT - + According to Silvermont software optimization guide, for 64-bit applications, branch prediction performance can be negatively impacted when the target of a branch is more than 4GB away from the branch. Add @@ -13,9 +13,9 @@ Date: Wed Oct 21 14:44:23 2015 -0700 address space layout randomization (ASLR), which is always disabled for SUID programs and can only be enabled by setting environment variable, LD_PREFER_MAP_32BIT_EXEC. - + On Fedora 23, this patch speeds up GCC 5 testsuite by 3% on Silvermont. - + [BZ #19367] * sysdeps/unix/sysv/linux/wordsize-64/mmap.c: New file. * sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h: Likewise. @@ -168,15 +168,15 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h #define bit_AVX512F_Usable (1 << 12) #define bit_AVX512DQ_Usable (1 << 13) +#define bit_Prefer_MAP_32BIT_EXEC (1 << 16) - + /* CPUID Feature flags. */ - + @@ -91,6 +92,7 @@ # define index_AVX_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE # define index_AVX512F_Usable FEATURE_INDEX_1*FEATURE_SIZE # define index_AVX512DQ_Usable FEATURE_INDEX_1*FEATURE_SIZE +# define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1*FEATURE_SIZE - + # if defined (_LIBC) && !IS_IN (nonlib) # ifdef __x86_64__ @@ -267,6 +269,7 @@ extern const struct cpu_features *__get_ @@ -184,5 +184,6 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h # define index_AVX512F_Usable FEATURE_INDEX_1 # define index_AVX512DQ_Usable FEATURE_INDEX_1 +# define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1 - + #endif /* !__ASSEMBLER__ */ + diff --git a/SOURCES/glibc-rh1292018-7.patch b/SOURCES/glibc-rh1292018-7.patch index 1bf5ea19..fc87662c 100644 --- a/SOURCES/glibc-rh1292018-7.patch +++ b/SOURCES/glibc-rh1292018-7.patch @@ -3,10 +3,10 @@ Author: H.J. Lu Date: Thu Mar 3 14:51:40 2016 -0800 Or bit_Prefer_MAP_32BIT_EXEC in EXTRA_LD_ENVVARS - + We should turn on bit_Prefer_MAP_32BIT_EXEC in EXTRA_LD_ENVVARS without overriding other bits. - + [BZ #19758] * sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h (EXTRA_LD_ENVVARS): Or bit_Prefer_MAP_32BIT_EXEC. @@ -22,5 +22,5 @@ index c9db5ea..a759934 100644 - = bit_Prefer_MAP_32BIT_EXEC; \ + |= bit_Prefer_MAP_32BIT_EXEC; \ break; - + /* Extra unsecure variables. The names are all stuffed in a single diff --git a/SOURCES/glibc-rh1293433.patch b/SOURCES/glibc-rh1293433.patch index 4aaaad78..853e53d8 100644 --- a/SOURCES/glibc-rh1293433.patch +++ b/SOURCES/glibc-rh1293433.patch @@ -3,13 +3,13 @@ Author: Florian Weimer Date: Fri Sep 25 20:20:33 2015 +0200 Fix inconsistent passwd compensation in nss/bug17079.c - + It used to be common practice to have a statically linked shell for an alternative root account, as in: - + root:x:0:0:root:/root:/bin/bash toor:x:0:0:root recovery account:/root:/sbin/sash - + This causes problems with passwd NSS tests because a UID-based lookup will only retrieve one of those entries. The original version of nss/bug17079.c detected this, but failed to use this information later diff --git a/SOURCES/glibc-rh1293916.patch b/SOURCES/glibc-rh1293916.patch index db145e97..8efa8a58 100644 --- a/SOURCES/glibc-rh1293916.patch +++ b/SOURCES/glibc-rh1293916.patch @@ -7,7 +7,7 @@ Date: Thu Jul 24 17:32:56 2014 +0200 --- a/iconvdata/Makefile +++ b/iconvdata/Makefile @@ -67,7 +67,8 @@ - + ifeq (yes,$(build-shared)) tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \ - tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 @@ -17,13 +17,13 @@ Date: Thu Jul 24 17:32:56 2014 +0200 tests += bug-iconv3 endif @@ -286,6 +287,8 @@ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) $(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) +$(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \ + $(addprefix $(objpfx),$(modules.so)) $(objpfx)tst-loading.out: $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) $(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \ diff --git a/iconvdata/bug-iconv10.c b/iconvdata/bug-iconv10.c @@ -31,7 +31,7 @@ new file mode 100644 index 0000000..98353a2 --- /dev/null +++ b/iconvdata/bug-iconv10.c -@@ -0,0 +1,77 @@ +@@ -0,0 +1,77 @@ +/* bug 17197: check for redundant shift character at block boundary. + Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. @@ -112,90 +112,90 @@ index 0000000..98353a2 --- a/iconvdata/ibm930.c 2015-12-01 18:13:56.799658234 -0500 +++ b/iconvdata/ibm930.c 2015-12-01 18:14:12.729906742 -0500 @@ -257,6 +257,7 @@ enum - break; \ - } \ - *outptr++ = SI; \ + break; \ + } \ + *outptr++ = SI; \ + curcs = sb; \ - } \ - \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + } \ + \ + if (__builtin_expect (outptr + 1 > outend, 0)) \ @@ -270,7 +271,6 @@ enum - *outptr++ = 0x5b; \ - else \ - *outptr++ = cp[0]; \ + *outptr++ = 0x5b; \ + else \ + *outptr++ = cp[0]; \ - curcs = sb; \ } \ - \ + \ /* Now that we wrote the output increment the input pointer. */ \ --- a/iconvdata/ibm933.c 2015-12-01 18:13:56.799658234 -0500 +++ b/iconvdata/ibm933.c 2015-12-01 18:14:12.729906742 -0500 @@ -255,6 +255,7 @@ enum - break; \ - } \ - *outptr++ = SI; \ + break; \ + } \ + *outptr++ = SI; \ + curcs = sb; \ - } \ - \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + } \ + \ + if (__builtin_expect (outptr + 1 > outend, 0)) \ @@ -263,7 +264,6 @@ enum - break; \ - } \ - *outptr++ = cp[0]; \ + break; \ + } \ + *outptr++ = cp[0]; \ - curcs = sb; \ } \ - \ + \ /* Now that we wrote the output increment the input pointer. */ \ --- a/iconvdata/ibm935.c 2015-12-01 18:13:56.799658234 -0500 +++ b/iconvdata/ibm935.c 2015-12-01 18:14:12.729906742 -0500 @@ -255,6 +255,7 @@ enum - break; \ - } \ - *outptr++ = SI; \ + break; \ + } \ + *outptr++ = SI; \ + curcs = sb; \ - } \ - \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + } \ + \ + if (__builtin_expect (outptr + 1 > outend, 0)) \ @@ -263,7 +264,6 @@ enum - break; \ - } \ - *outptr++ = cp[0]; \ + break; \ + } \ + *outptr++ = cp[0]; \ - curcs = sb; \ } \ - \ + \ /* Now that we wrote the output increment the input pointer. */ \ --- a/iconvdata/ibm937.c 2015-12-01 18:13:56.799658234 -0500 +++ b/iconvdata/ibm937.c 2015-12-01 18:14:12.729906742 -0500 @@ -255,6 +255,7 @@ enum - break; \ - } \ - *outptr++ = SI; \ + break; \ + } \ + *outptr++ = SI; \ + curcs = sb; \ - } \ - \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + } \ + \ + if (__builtin_expect (outptr + 1 > outend, 0)) \ @@ -263,7 +264,6 @@ enum - break; \ - } \ - *outptr++ = cp[0]; \ + break; \ + } \ + *outptr++ = cp[0]; \ - curcs = sb; \ } \ - \ + \ /* Now that we wrote the output increment the input pointer. */ \ --- a/iconvdata/ibm939.c 2015-12-01 18:13:56.799658234 -0500 +++ b/iconvdata/ibm939.c 2015-12-01 18:14:12.739906898 -0500 @@ -255,6 +255,7 @@ enum - break; \ - } \ - *outptr++ = SI; \ + break; \ + } \ + *outptr++ = SI; \ + curcs = sb; \ - } \ - \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + } \ + \ + if (__builtin_expect (outptr + 1 > outend, 0)) \ @@ -268,7 +269,6 @@ enum - *outptr++ = 0xb2; \ - else \ - *outptr++ = cp[0]; \ + *outptr++ = 0xb2; \ + else \ + *outptr++ = cp[0]; \ - curcs = sb; \ } \ - \ + \ /* Now that we wrote the output increment the input pointer. */ \ diff --git a/SOURCES/glibc-rh1293976-2.patch b/SOURCES/glibc-rh1293976-2.patch index b638018f..c41dab33 100644 --- a/SOURCES/glibc-rh1293976-2.patch +++ b/SOURCES/glibc-rh1293976-2.patch @@ -9,27 +9,27 @@ Upstream status: committed # commit 1bd5483e104c8bde6e61dc5e3f8a848bc861872d # Author: Florian Weimer # Date: Tue Dec 29 20:32:35 2015 +0100 -# +# # malloc: Test various special cases related to allocation failures -# +# # This test case exercises unusual code paths in allocation functions, # related to allocation failures. Specifically, the test can reveal # the following bugs: -# +# # (a) calloc returns non-zero memory on fallback to sysmalloc. # (b) calloc can self-deadlock because it fails to release # the arena lock on certain allocation failures. # (c) pvalloc can dereference a NULL arena pointer. -# +# # (a) and (b) appear specific to a faulty downstream backport. # (c) was fixed as part of commit 10ad46bc6526edc5c7afcc57112da96917ff3629. # # commit f690b56979dea81340a397c1b5e44827a6fb06e7 # Author: Florian Weimer # Date: Tue Aug 2 17:01:02 2016 +0200 -# +# # malloc: Run tests without calling mallopt [BZ #19469] -# +# # The compiled tests no longer refer to the mallopt symbol # from their main functions. (Some tests still call mallopt # explicitly, which is fine.) @@ -40,25 +40,25 @@ Index: b/malloc/Makefile +++ b/malloc/Makefile @@ -27,7 +27,8 @@ headers := $(dist-headers) obstack.h mch tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ - tst-malloc-usable \ + tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ + tst-malloc-usable \ - tst-malloc-backtrace tst-malloc-thread-exit + tst-malloc-backtrace tst-malloc-thread-exit \ + tst-malloc-thread-fail test-srcs = tst-mtrace - + routines = malloc morecore mcheck mtrace obstack @@ -44,6 +45,8 @@ libmemusage-inhibit-o = $(filter-out .os - + $(objpfx)tst-malloc-backtrace: $(common-objpfx)nptl/libpthread.so \ - $(common-objpfx)nptl/libpthread_nonshared.a + $(common-objpfx)nptl/libpthread_nonshared.a +$(objpfx)tst-malloc-thread-fail: $(common-objpfx)nptl/libpthread.so \ + $(common-objpfx)nptl/libpthread_nonshared.a $(objpfx)tst-malloc-thread-exit: $(common-objpfx)nptl/libpthread.so \ - $(common-objpfx)nptl/libpthread_nonshared.a - + $(common-objpfx)nptl/libpthread_nonshared.a + @@ -149,3 +152,7 @@ $(objpfx)libmemusage.so: $(common-objpfx - + # Extra dependencies $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c + @@ -541,11 +541,11 @@ Index: b/test-skeleton.c @@ -247,8 +247,10 @@ main (int argc, char *argv[]) unsigned int timeoutfactor = 1; pid_t termpid; - + +#ifndef TEST_NO_MALLOPT /* Make uses of freed and uninitialized memory known. */ mallopt (M_PERTURB, 42); +#endif - + #ifdef STDOUT_UNBUFFERED setbuf (stdout, NULL); diff --git a/SOURCES/glibc-rh1293976.patch b/SOURCES/glibc-rh1293976.patch index 7b891f04..11331bbd 100644 --- a/SOURCES/glibc-rh1293976.patch +++ b/SOURCES/glibc-rh1293976.patch @@ -17,9 +17,9 @@ index 4821deb..ac8c3f6 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1870,8 +1870,20 @@ static int check_action = DEFAULT_CHECK_ACTION; - + static int perturb_byte; - + -#define alloc_perturb(p, n) memset (p, (perturb_byte ^ 0xff) & 0xff, n) -#define free_perturb(p, n) memset (p, perturb_byte & 0xff, n) +static inline void @@ -36,11 +36,11 @@ index 4821deb..ac8c3f6 100644 + memset (p, perturb_byte, n); +} + - - + + #include @@ -3287,8 +3299,7 @@ _int_malloc(mstate av, size_t bytes) - } + } check_remalloced_chunk(av, victim, nb); void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) @@ -50,57 +50,57 @@ index 4821deb..ac8c3f6 100644 } } @@ -3323,8 +3334,7 @@ _int_malloc(mstate av, size_t bytes) - victim->size |= NON_MAIN_ARENA; - check_malloced_chunk(av, victim, nb); - void *p = chunk2mem(victim); + victim->size |= NON_MAIN_ARENA; + check_malloced_chunk(av, victim, nb); + void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); - return p; + return p; } } @@ -3403,8 +3413,7 @@ _int_malloc(mstate av, size_t bytes) - - check_malloced_chunk(av, victim, nb); - void *p = chunk2mem(victim); + + check_malloced_chunk(av, victim, nb); + void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); - return p; + return p; } - + @@ -3420,8 +3429,7 @@ _int_malloc(mstate av, size_t bytes) - victim->size |= NON_MAIN_ARENA; - check_malloced_chunk(av, victim, nb); - void *p = chunk2mem(victim); + victim->size |= NON_MAIN_ARENA; + check_malloced_chunk(av, victim, nb); + void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); - return p; + return p; } - + @@ -3545,8 +3553,7 @@ _int_malloc(mstate av, size_t bytes) - } - check_malloced_chunk(av, victim, nb); - void *p = chunk2mem(victim); + } + check_malloced_chunk(av, victim, nb); + void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); - return p; + return p; } } @@ -3649,8 +3656,7 @@ _int_malloc(mstate av, size_t bytes) - } - check_malloced_chunk(av, victim, nb); - void *p = chunk2mem(victim); + } + check_malloced_chunk(av, victim, nb); + void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); - return p; + return p; } } @@ -3684,8 +3690,7 @@ _int_malloc(mstate av, size_t bytes) - + check_malloced_chunk(av, victim, nb); void *p = chunk2mem(victim); - if (__builtin_expect (perturb_byte, 0)) @@ -108,33 +108,33 @@ index 4821deb..ac8c3f6 100644 + alloc_perturb (p, bytes); return p; } - + @@ -3705,7 +3710,7 @@ _int_malloc(mstate av, size_t bytes) */ else { void *p = sysmalloc(nb, av); - if (p != NULL && __builtin_expect (perturb_byte, 0)) + if (p != NULL) - alloc_perturb (p, bytes); + alloc_perturb (p, bytes); return p; } @@ -3798,8 +3803,7 @@ _int_free(mstate av, mchunkptr p, int have_lock) - } + } } - + - if (__builtin_expect (perturb_byte, 0)) - free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); + free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); - + set_fastchunks(av); unsigned int idx = fastbin_index(size); @@ -3881,8 +3885,7 @@ _int_free(mstate av, mchunkptr p, int have_lock) - goto errout; + goto errout; } - + - if (__builtin_expect (perturb_byte, 0)) - free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); + free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); - + /* consolidate backward */ if (!prev_inuse(p)) { diff --git a/SOURCES/glibc-rh1296031-0.patch b/SOURCES/glibc-rh1296031-0.patch index 7fcf297a..ed88f03c 100644 --- a/SOURCES/glibc-rh1296031-0.patch +++ b/SOURCES/glibc-rh1296031-0.patch @@ -11,7 +11,7 @@ Author: Ondřej Bílka Date: Sun Feb 16 12:59:23 2014 +0100 Deduplicate resolv/nss_dns/dns-host.c - + In resolv/nss_dns/dns-host.c one of code path duplicated code after that. We merge these paths. @@ -20,7 +20,7 @@ Author: Andreas Schwab Date: Tue Feb 18 10:57:25 2014 +0100 Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer - + Instead of trying to guess whether the second buffer needs to be freed set a flag at the place it is allocated @@ -30,7 +30,7 @@ Index: glibc-2.17-c758a686/include/resolv.h +++ glibc-2.17-c758a686/include/resolv.h @@ -56,11 +56,11 @@ libc_hidden_proto (__res_randomid) libc_hidden_proto (__res_state) - + int __libc_res_nquery (res_state, const char *, int, int, u_char *, int, - u_char **, u_char **, int *, int *); + u_char **, u_char **, int *, int *, int *); @@ -41,36 +41,36 @@ Index: glibc-2.17-c758a686/include/resolv.h - u_char *, int, u_char **, u_char **, int *, int *) + u_char *, int, u_char **, u_char **, int *, int *, int *) attribute_hidden; - + libresolv_hidden_proto (_sethtent) Index: glibc-2.17-c758a686/resolv/gethnamaddr.c =================================================================== --- glibc-2.17-c758a686.orig/resolv/gethnamaddr.c +++ glibc-2.17-c758a686/resolv/gethnamaddr.c @@ -616,7 +616,7 @@ gethostbyname2(name, af) - buf.buf = origbuf = (querybuf *) alloca (1024); - - if ((n = __libc_res_nsearch(&_res, name, C_IN, type, buf.buf->buf, 1024, + buf.buf = origbuf = (querybuf *) alloca (1024); + + if ((n = __libc_res_nsearch(&_res, name, C_IN, type, buf.buf->buf, 1024, - &buf.ptr, NULL, NULL, NULL)) < 0) { + &buf.ptr, NULL, NULL, NULL, NULL)) < 0) { - if (buf.buf != origbuf) - free (buf.buf); - Dprintf("res_nsearch failed (%d)\n", n); + if (buf.buf != origbuf) + free (buf.buf); + Dprintf("res_nsearch failed (%d)\n", n); @@ -711,12 +711,12 @@ gethostbyaddr(addr, len, af) - buf.buf = orig_buf = (querybuf *) alloca (1024); - - n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, 1024, + buf.buf = orig_buf = (querybuf *) alloca (1024); + + n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, 1024, - &buf.ptr, NULL, NULL, NULL); + &buf.ptr, NULL, NULL, NULL, NULL); - if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) { - strcpy(qp, "ip6.int"); - n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, - buf.buf != orig_buf ? MAXPACKET : 1024, + if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) { + strcpy(qp, "ip6.int"); + n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, + buf.buf != orig_buf ? MAXPACKET : 1024, - &buf.ptr, NULL, NULL, NULL); + &buf.ptr, NULL, NULL, NULL, NULL); - } - if (n < 0) { - if (buf.buf != orig_buf) + } + if (n < 0) { + if (buf.buf != orig_buf) Index: glibc-2.17-c758a686/resolv/nss_dns/dns-canon.c =================================================================== --- glibc-2.17-c758a686.orig/resolv/nss_dns/dns-canon.c @@ -78,19 +78,19 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-canon.c @@ -61,7 +61,7 @@ _nss_dns_getcanonname_r (const char *nam { int r = __libc_res_nquery (&_res, name, ns_c_in, qtypes[i], - buf, sizeof (buf), &ansp.ptr, NULL, NULL, + buf, sizeof (buf), &ansp.ptr, NULL, NULL, - NULL); + NULL, NULL); if (r > 0) - { - /* We need to decode the response. Just one question record. + { + /* We need to decode the response. Just one question record. Index: glibc-2.17-c758a686/resolv/nss_dns/dns-host.c =================================================================== --- glibc-2.17-c758a686.orig/resolv/nss_dns/dns-host.c +++ glibc-2.17-c758a686/resolv/nss_dns/dns-host.c @@ -190,7 +190,7 @@ _nss_dns_gethostbyname3_r (const char *n host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024); - + n = __libc_res_nsearch (&_res, name, C_IN, type, host_buffer.buf->buf, - 1024, &host_buffer.ptr, NULL, NULL, NULL); + 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); @@ -98,24 +98,24 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-host.c { switch (errno) @@ -225,7 +225,7 @@ _nss_dns_gethostbyname3_r (const char *n - n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer - ? MAXPACKET : 1024, &host_buffer.ptr, + n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, + host_buffer.buf != orig_host_buffer + ? MAXPACKET : 1024, &host_buffer.ptr, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); - + if (n < 0) - { + { @@ -308,13 +308,20 @@ _nss_dns_gethostbyname4_r (const char *n u_char *ans2p = NULL; int nans2p = 0; int resplen2 = 0; + int ans2p_malloced = 0; - + int olderr = errno; enum nss_status status; int n = __libc_res_nsearch (&_res, name, C_IN, T_UNSPEC, - host_buffer.buf->buf, 2048, &host_buffer.ptr, + host_buffer.buf->buf, 2048, &host_buffer.ptr, - &ans2p, &nans2p, &resplen2); - if (n < 0) + &ans2p, &nans2p, &resplen2, &ans2p_malloced); @@ -128,39 +128,39 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-host.c + else { switch (errno) - { + { @@ -341,16 +348,11 @@ _nss_dns_gethostbyname4_r (const char *n - *errnop = EAGAIN; + *errnop = EAGAIN; else - __set_errno (olderr); + __set_errno (olderr); - - if (host_buffer.buf != orig_host_buffer) - free (host_buffer.buf); - - return status; } - + - status = gaih_getanswer(host_buffer.buf, n, (const querybuf *) ans2p, - resplen2, name, pat, buffer, buflen, - errnop, herrnop, ttlp); + /* Check whether ans2p was separately allocated. */ + if (ans2p_malloced) + free (ans2p); - + if (host_buffer.buf != orig_host_buffer) free (host_buffer.buf); @@ -460,7 +462,7 @@ _nss_dns_gethostbyaddr2_r (const void *a - strcpy (qp, "].ip6.arpa"); - n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, - host_buffer.buf->buf, 1024, &host_buffer.ptr, + strcpy (qp, "].ip6.arpa"); + n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, + host_buffer.buf->buf, 1024, &host_buffer.ptr, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); - if (n >= 0) - goto got_it_already; - } + if (n >= 0) + goto got_it_already; + } @@ -481,14 +483,14 @@ _nss_dns_gethostbyaddr2_r (const void *a } - + n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf, - 1024, &host_buffer.ptr, NULL, NULL, NULL); + 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); @@ -168,8 +168,8 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-host.c { strcpy (qp, "ip6.int"); n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer - ? MAXPACKET : 1024, &host_buffer.ptr, + host_buffer.buf != orig_host_buffer + ? MAXPACKET : 1024, &host_buffer.ptr, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); } @@ -181,7 +181,7 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-network.c +++ glibc-2.17-c758a686/resolv/nss_dns/dns-network.c @@ -129,7 +129,7 @@ _nss_dns_getnetbyname_r (const char *nam net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - + anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL); + 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); @@ -190,7 +190,7 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-network.c /* Nothing found. */ @@ -205,7 +205,7 @@ _nss_dns_getnetbyaddr_r (uint32_t net, i net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - + anslen = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL); + 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); @@ -203,259 +203,259 @@ Index: glibc-2.17-c758a686/resolv/res_query.c +++ glibc-2.17-c758a686/resolv/res_query.c @@ -98,7 +98,7 @@ static int __libc_res_nquerydomain(res_state statp, const char *name, const char *domain, - int class, int type, u_char *answer, int anslen, - u_char **answerp, u_char **answerp2, int *nanswerp2, + int class, int type, u_char *answer, int anslen, + u_char **answerp, u_char **answerp2, int *nanswerp2, - int *resplen2); + int *resplen2, int *answerp2_malloced); - + /* * Formulate a normal query, send, and await answer. @@ -119,7 +119,8 @@ __libc_res_nquery(res_state statp, - u_char **answerp, /* if buffer needs to be enlarged */ - u_char **answerp2, - int *nanswerp2, + u_char **answerp, /* if buffer needs to be enlarged */ + u_char **answerp2, + int *nanswerp2, - int *resplen2) + int *resplen2, + int *answerp2_malloced) { - HEADER *hp = (HEADER *) answer; - HEADER *hp2; + HEADER *hp = (HEADER *) answer; + HEADER *hp2; @@ -224,7 +225,8 @@ __libc_res_nquery(res_state statp, - } - assert (answerp == NULL || (void *) *answerp == (void *) answer); - n = __libc_res_nsend(statp, query1, nquery1, query2, nquery2, answer, + } + assert (answerp == NULL || (void *) *answerp == (void *) answer); + n = __libc_res_nsend(statp, query1, nquery1, query2, nquery2, answer, - anslen, answerp, answerp2, nanswerp2, resplen2); + anslen, answerp, answerp2, nanswerp2, resplen2, + answerp2_malloced); - if (use_malloc) - free (buf); - if (n < 0) { + if (use_malloc) + free (buf); + if (n < 0) { @@ -316,7 +318,7 @@ res_nquery(res_state statp, - int anslen) /* size of answer buffer */ + int anslen) /* size of answer buffer */ { - return __libc_res_nquery(statp, name, class, type, answer, anslen, + return __libc_res_nquery(statp, name, class, type, answer, anslen, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); } libresolv_hidden_def (res_nquery) - + @@ -335,7 +337,8 @@ __libc_res_nsearch(res_state statp, - u_char **answerp, - u_char **answerp2, - int *nanswerp2, + u_char **answerp, + u_char **answerp2, + int *nanswerp2, - int *resplen2) + int *resplen2, + int *answerp2_malloced) { - const char *cp, * const *domain; - HEADER *hp = (HEADER *) answer; + const char *cp, * const *domain; + HEADER *hp = (HEADER *) answer; @@ -360,7 +363,7 @@ __libc_res_nsearch(res_state statp, - if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL) - return (__libc_res_nquery(statp, cp, class, type, answer, - anslen, answerp, answerp2, + if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL) + return (__libc_res_nquery(statp, cp, class, type, answer, + anslen, answerp, answerp2, - nanswerp2, resplen2)); + nanswerp2, resplen2, answerp2_malloced)); - + #ifdef DEBUG - if (statp->options & RES_DEBUG) + if (statp->options & RES_DEBUG) @@ -377,7 +380,8 @@ __libc_res_nsearch(res_state statp, - if (dots >= statp->ndots || trailing_dot) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, + if (dots >= statp->ndots || trailing_dot) { + ret = __libc_res_nquerydomain(statp, name, NULL, class, type, + answer, anslen, answerp, - answerp2, nanswerp2, resplen2); + answerp2, nanswerp2, resplen2, + answerp2_malloced); - if (ret > 0 || trailing_dot - /* If the second response is valid then we use that. */ - || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) + if (ret > 0 || trailing_dot + /* If the second response is valid then we use that. */ + || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) @@ -388,11 +392,11 @@ __libc_res_nsearch(res_state statp, - answer = *answerp; - anslen = MAXPACKET; - } + answer = *answerp; + anslen = MAXPACKET; + } - if (answerp2 - && (*answerp2 < answer || *answerp2 >= answer + anslen)) + if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *answerp2_malloced = 0; - } - } - + } + } + @@ -419,7 +423,7 @@ __libc_res_nsearch(res_state statp, - class, type, - answer, anslen, answerp, - answerp2, nanswerp2, + class, type, + answer, anslen, answerp, + answerp2, nanswerp2, - resplen2); + resplen2, answerp2_malloced); - if (ret > 0 || (ret == 0 && resplen2 != NULL - && *resplen2 > 0)) - return (ret); + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) + return (ret); @@ -428,12 +432,11 @@ __libc_res_nsearch(res_state statp, - answer = *answerp; - anslen = MAXPACKET; - } + answer = *answerp; + anslen = MAXPACKET; + } - if (answerp2 - && (*answerp2 < answer - || *answerp2 >= answer + anslen)) + if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *answerp2_malloced = 0; - } - - /* + } + + /* @@ -489,7 +492,8 @@ __libc_res_nsearch(res_state statp, - && !(tried_as_is || root_on_list)) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, + && !(tried_as_is || root_on_list)) { + ret = __libc_res_nquerydomain(statp, name, NULL, class, type, + answer, anslen, answerp, - answerp2, nanswerp2, resplen2); + answerp2, nanswerp2, resplen2, + answerp2_malloced); - if (ret > 0 || (ret == 0 && resplen2 != NULL - && *resplen2 > 0)) - return (ret); + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) + return (ret); @@ -502,10 +506,11 @@ __libc_res_nsearch(res_state statp, - * else send back meaningless H_ERRNO, that being the one from - * the last DNSRCH we did. - */ + * else send back meaningless H_ERRNO, that being the one from + * the last DNSRCH we did. + */ - if (answerp2 && (*answerp2 < answer || *answerp2 >= answer + anslen)) + if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *answerp2_malloced = 0; - } - if (saved_herrno != -1) - RES_SET_H_ERRNO(statp, saved_herrno); + } + if (saved_herrno != -1) + RES_SET_H_ERRNO(statp, saved_herrno); @@ -525,7 +530,7 @@ res_nsearch(res_state statp, - int anslen) /* size of answer */ + int anslen) /* size of answer */ { - return __libc_res_nsearch(statp, name, class, type, answer, + return __libc_res_nsearch(statp, name, class, type, answer, - anslen, NULL, NULL, NULL, NULL); + anslen, NULL, NULL, NULL, NULL, NULL); } libresolv_hidden_def (res_nsearch) - + @@ -543,7 +548,8 @@ __libc_res_nquerydomain(res_state statp, - u_char **answerp, - u_char **answerp2, - int *nanswerp2, + u_char **answerp, + u_char **answerp2, + int *nanswerp2, - int *resplen2) + int *resplen2, + int *answerp2_malloced) { - char nbuf[MAXDNAME]; - const char *longname = nbuf; + char nbuf[MAXDNAME]; + const char *longname = nbuf; @@ -585,7 +591,7 @@ __libc_res_nquerydomain(res_state statp, - } - return (__libc_res_nquery(statp, longname, class, type, answer, - anslen, answerp, answerp2, nanswerp2, + } + return (__libc_res_nquery(statp, longname, class, type, answer, + anslen, answerp, answerp2, nanswerp2, - resplen2)); + resplen2, answerp2_malloced)); } - + int @@ -597,7 +603,8 @@ res_nquerydomain(res_state statp, - int anslen) /* size of answer */ + int anslen) /* size of answer */ { - return __libc_res_nquerydomain(statp, name, domain, class, type, + return __libc_res_nquerydomain(statp, name, domain, class, type, - answer, anslen, NULL, NULL, NULL, NULL); + answer, anslen, NULL, NULL, NULL, NULL, + NULL); } libresolv_hidden_def (res_nquerydomain) - + Index: glibc-2.17-c758a686/resolv/res_send.c =================================================================== --- glibc-2.17-c758a686.orig/resolv/res_send.c +++ glibc-2.17-c758a686/resolv/res_send.c @@ -186,12 +186,12 @@ evNowTime(struct timespec *res) { static int send_vc(res_state, const u_char *, int, - const u_char *, int, - u_char **, int *, int *, int, u_char **, + const u_char *, int, + u_char **, int *, int *, int, u_char **, - u_char **, int *, int *); + u_char **, int *, int *, int *); static int send_dg(res_state, const u_char *, int, - const u_char *, int, - u_char **, int *, int *, int, - int *, int *, u_char **, + const u_char *, int, + u_char **, int *, int *, int, + int *, int *, u_char **, - u_char **, int *, int *); + u_char **, int *, int *, int *); #ifdef DEBUG static void Aerror(const res_state, FILE *, const char *, int, - const struct sockaddr *); + const struct sockaddr *); @@ -343,7 +343,7 @@ int __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - const u_char *buf2, int buflen2, - u_char *ans, int anssiz, u_char **ansp, u_char **ansp2, + const u_char *buf2, int buflen2, + u_char *ans, int anssiz, u_char **ansp, u_char **ansp2, - int *nansp2, int *resplen2) + int *nansp2, int *resplen2, int *ansp2_malloced) { int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; - + @@ -546,7 +546,8 @@ __libc_res_nsend(res_state statp, const - try = statp->retry; - n = send_vc(statp, buf, buflen, buf2, buflen2, - &ans, &anssiz, &terrno, + try = statp->retry; + n = send_vc(statp, buf, buflen, buf2, buflen2, + &ans, &anssiz, &terrno, - ns, ansp, ansp2, nansp2, resplen2); + ns, ansp, ansp2, nansp2, resplen2, + ansp2_malloced); - if (n < 0) - return (-1); - if (n == 0 && (buf2 == NULL || *resplen2 == 0)) + if (n < 0) + return (-1); + if (n == 0 && (buf2 == NULL || *resplen2 == 0)) @@ -556,7 +557,7 @@ __libc_res_nsend(res_state statp, const - n = send_dg(statp, buf, buflen, buf2, buflen2, - &ans, &anssiz, &terrno, - ns, &v_circuit, &gotsomewhere, ansp, + n = send_dg(statp, buf, buflen, buf2, buflen2, + &ans, &anssiz, &terrno, + ns, &v_circuit, &gotsomewhere, ansp, - ansp2, nansp2, resplen2); + ansp2, nansp2, resplen2, ansp2_malloced); - if (n < 0) - return (-1); - if (n == 0 && (buf2 == NULL || *resplen2 == 0)) + if (n < 0) + return (-1); + if (n == 0 && (buf2 == NULL || *resplen2 == 0)) @@ -646,7 +647,7 @@ res_nsend(res_state statp, - const u_char *buf, int buflen, u_char *ans, int anssiz) + const u_char *buf, int buflen, u_char *ans, int anssiz) { return __libc_res_nsend(statp, buf, buflen, NULL, 0, ans, anssiz, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); } libresolv_hidden_def (res_nsend) - + @@ -657,7 +658,7 @@ send_vc(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, - u_char **ansp, int *anssizp, - int *terrno, int ns, u_char **anscp, u_char **ansp2, int *anssizp2, + const u_char *buf, int buflen, const u_char *buf2, int buflen2, + u_char **ansp, int *anssizp, + int *terrno, int ns, u_char **anscp, u_char **ansp2, int *anssizp2, - int *resplen2) + int *resplen2, int *ansp2_malloced) { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; + const HEADER *hp = (HEADER *) buf; + const HEADER *hp2 = (HEADER *) buf2; @@ -823,6 +824,8 @@ send_vc(res_state statp, - } - *thisanssizp = MAXPACKET; - *thisansp = newp; + } + *thisanssizp = MAXPACKET; + *thisansp = newp; + if (thisansp == ansp2) + *ansp2_malloced = 1; - anhp = (HEADER *) newp; - len = rlen; - } else { + anhp = (HEADER *) newp; + len = rlen; + } else { @@ -992,7 +995,7 @@ send_dg(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, - u_char **ansp, int *anssizp, - int *terrno, int ns, int *v_circuit, int *gotsomewhere, u_char **anscp, + const u_char *buf, int buflen, const u_char *buf2, int buflen2, + u_char **ansp, int *anssizp, + int *terrno, int ns, int *v_circuit, int *gotsomewhere, u_char **anscp, - u_char **ansp2, int *anssizp2, int *resplen2) + u_char **ansp2, int *anssizp2, int *resplen2, int *ansp2_malloced) { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; + const HEADER *hp = (HEADER *) buf; + const HEADER *hp2 = (HEADER *) buf2; @@ -1235,6 +1238,8 @@ send_dg(res_state statp, - if (newp != NULL) { - *anssizp = MAXPACKET; - *thisansp = ans = newp; + if (newp != NULL) { + *anssizp = MAXPACKET; + *thisansp = ans = newp; + if (thisansp == ansp2) + *ansp2_malloced = 1; - } - } - HEADER *anhp = (HEADER *) *thisansp; + } + } + HEADER *anhp = (HEADER *) *thisansp; diff --git a/SOURCES/glibc-rh1296031-2.patch b/SOURCES/glibc-rh1296031-2.patch index 54cb492a..c46d6bd7 100644 --- a/SOURCES/glibc-rh1296031-2.patch +++ b/SOURCES/glibc-rh1296031-2.patch @@ -3,7 +3,7 @@ Author: Andreas Schwab Date: Mon Jun 8 15:21:18 2015 +0200 Record TTL also for DNS PTR queries (bug 18513) - + This allows nscd to manage proper TTL for GETHOSTBYADDR[v6] requests. 2015-06-22 Andreas Schwab @@ -17,22 +17,22 @@ Index: glibc-2.17-c758a686/resolv/nss_dns/dns-host.c --- glibc-2.17-c758a686.orig/resolv/nss_dns/dns-host.c +++ glibc-2.17-c758a686/resolv/nss_dns/dns-host.c @@ -800,6 +800,10 @@ getanswer_r (const querybuf *answer, int - + if (qtype == T_PTR && type == T_CNAME) - { + { + /* A CNAME could also have a TTL entry. */ + if (ttlp != NULL && ttl < *ttlp) + *ttlp = ttl; + - n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); - if (__builtin_expect (n < 0 || res_dnok (tbuf) == 0, 0)) - { + n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); + if (__builtin_expect (n < 0 || res_dnok (tbuf) == 0, 0)) + { @@ -863,6 +867,8 @@ getanswer_r (const querybuf *answer, int - ++had_error; - break; - } + ++had_error; + break; + } + if (ttlp != NULL && ttl < *ttlp) + *ttlp = ttl; #if MULTI_PTRS_ARE_ALIASES - cp += n; - if (haveanswer == 0) + cp += n; + if (haveanswer == 0) diff --git a/SOURCES/glibc-rh1296031.patch b/SOURCES/glibc-rh1296031.patch index ef62f96f..3fb87465 100644 --- a/SOURCES/glibc-rh1296031.patch +++ b/SOURCES/glibc-rh1296031.patch @@ -12,14 +12,14 @@ Index: b/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -1051,7 +1051,10 @@ gaih_getanswer_slice (const querybuf *an int h_namelen = 0; - + if (ancount == 0) - return NSS_STATUS_NOTFOUND; + { + *h_errnop = HOST_NOT_FOUND; + return NSS_STATUS_NOTFOUND; + } - + while (ancount-- > 0 && cp < end_of_message && had_error == 0) { @@ -1228,7 +1231,14 @@ gaih_getanswer_slice (const querybuf *an @@ -36,12 +36,12 @@ Index: b/resolv/nss_dns/dns-host.c + *h_errnop = NETDB_INTERNAL; + return NSS_STATUS_TRYAGAIN; } - - + + @@ -1242,11 +1252,101 @@ gaih_getanswer (const querybuf *answer1, - + enum nss_status status = NSS_STATUS_NOTFOUND; - + + /* Combining the NSS status of two distinct queries requires some + compromise and attention to symmetry (A or AAAA queries can be + returned in any order). What follows is a breakdown of how this @@ -133,20 +133,20 @@ Index: b/resolv/nss_dns/dns-host.c + if (anslen1 > 0) status = gaih_getanswer_slice(answer1, anslen1, qname, - &pat, &buffer, &buflen, - errnop, h_errnop, ttlp, - &first); + &pat, &buffer, &buflen, + errnop, h_errnop, ttlp, + &first); + if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND || (status == NSS_STATUS_TRYAGAIN - /* We want to look at the second answer in case of an + /* We want to look at the second answer in case of an @@ -1262,8 +1362,15 @@ gaih_getanswer (const querybuf *answer1, - &pat, &buffer, &buflen, - errnop, h_errnop, ttlp, - &first); + &pat, &buffer, &buflen, + errnop, h_errnop, ttlp, + &first); + /* Use the second response status in some cases. */ if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND) - status = status2; + status = status2; + /* Do not return a truncated second response (unless it was + unavoidable e.g. unrecoverable TRYAGAIN). */ + if (status == NSS_STATUS_SUCCESS @@ -154,36 +154,36 @@ Index: b/resolv/nss_dns/dns-host.c + && *errnop == ERANGE && *h_errnop != NO_RECOVERY)) + status = NSS_STATUS_TRYAGAIN; } - + return status; Index: b/resolv/res_query.c =================================================================== --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -396,6 +396,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *nanswerp2 = 0; - *answerp2_malloced = 0; - } - } + *answerp2_malloced = 0; + } + } @@ -436,6 +437,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *nanswerp2 = 0; - *answerp2_malloced = 0; - } - + *answerp2_malloced = 0; + } + @@ -510,6 +512,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; + { + free (*answerp2); + *answerp2 = NULL; + *nanswerp2 = 0; - *answerp2_malloced = 0; - } - if (saved_herrno != -1) + *answerp2_malloced = 0; + } + if (saved_herrno != -1) Index: b/resolv/res_send.c =================================================================== --- a/resolv/res_send.c @@ -211,17 +211,17 @@ Index: b/resolv/res_send.c * The Regents of the University of California. All rights reserved. @@ -360,6 +377,8 @@ __libc_res_nsend(res_state statp, const #ifdef USE_HOOKS - if (__builtin_expect (statp->qhook || statp->rhook, 0)) { - if (anssiz < MAXPACKET && ansp) { + if (__builtin_expect (statp->qhook || statp->rhook, 0)) { + if (anssiz < MAXPACKET && ansp) { + /* Always allocate MAXPACKET, callers expect + this specific size. */ - u_char *buf = malloc (MAXPACKET); - if (buf == NULL) - return (-1); + u_char *buf = malloc (MAXPACKET); + if (buf == NULL) + return (-1); @@ -653,6 +672,77 @@ libresolv_hidden_def (res_nsend) - + /* Private */ - + +/* The send_vc function is responsible for sending a DNS query over TCP + to the nameserver numbered NS from the res_state STATP i.e. + EXT(statp).nssocks[ns]. The function supports sending both IPv4 and @@ -295,41 +295,41 @@ Index: b/resolv/res_send.c + a the length of the first response in bytes is returned. */ static int send_vc(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, + const u_char *buf, int buflen, const u_char *buf2, int buflen2, @@ -662,11 +752,7 @@ send_vc(res_state statp, { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; + const HEADER *hp = (HEADER *) buf; + const HEADER *hp2 = (HEADER *) buf2; - u_char *ans = *ansp; - int orig_anssizp = *anssizp; - // XXX REMOVE - // int anssiz = *anssizp; - HEADER *anhp = (HEADER *) ans; + HEADER *anhp = (HEADER *) *ansp; - struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns]; - int truncating, connreset, resplen, n; - struct iovec iov[4]; + struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns]; + int truncating, connreset, resplen, n; + struct iovec iov[4]; @@ -742,6 +828,8 @@ send_vc(res_state statp, - * Receive length & response - */ - int recvresp1 = 0; + * Receive length & response + */ + int recvresp1 = 0; + /* Skip the second response if there is no second query. + To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - uint16_t rlen16; + int recvresp2 = buf2 == NULL; + uint16_t rlen16; read_len: @@ -778,33 +866,14 @@ send_vc(res_state statp, - u_char **thisansp; - int *thisresplenp; - if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { + u_char **thisansp; + int *thisresplenp; + if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { + /* We have not received any responses + yet or we only have one response to + receive. */ - thisanssizp = anssizp; - thisansp = anscp ?: ansp; - assert (anscp != NULL || ansp2 == NULL); - thisresplenp = &resplen; - } else { + thisanssizp = anssizp; + thisansp = anscp ?: ansp; + assert (anscp != NULL || ansp2 == NULL); + thisresplenp = &resplen; + } else { - if (*anssizp != MAXPACKET) { - /* No buffer allocated for the first - reply. We can try to use the rest @@ -352,13 +352,13 @@ Index: b/resolv/res_send.c - *ansp2 = *ansp; - } - - thisanssizp = anssizp2; - thisansp = ansp2; - thisresplenp = resplen2; + thisanssizp = anssizp2; + thisansp = ansp2; + thisresplenp = resplen2; @@ -812,10 +881,14 @@ send_vc(res_state statp, - anhp = (HEADER *) *thisansp; - - *thisresplenp = rlen; + anhp = (HEADER *) *thisansp; + + *thisresplenp = rlen; - if (rlen > *thisanssizp) { - /* Yes, we test ANSCP here. If we have two buffers - both will be allocatable. */ @@ -371,23 +371,23 @@ Index: b/resolv/res_send.c + if (thisansp != NULL && thisansp != ansp) { + /* Always allocate MAXPACKET, callers expect + this specific size. */ - u_char *newp = malloc (MAXPACKET); - if (newp == NULL) { - *terrno = ENOMEM; + u_char *newp = malloc (MAXPACKET); + if (newp == NULL) { + *terrno = ENOMEM; @@ -827,6 +900,9 @@ send_vc(res_state statp, - if (thisansp == ansp2) - *ansp2_malloced = 1; - anhp = (HEADER *) newp; + if (thisansp == ansp2) + *ansp2_malloced = 1; + anhp = (HEADER *) newp; + /* A uint16_t can't be larger than MAXPACKET + thus it's safe to allocate MAXPACKET but + read RLEN bytes instead. */ - len = rlen; - } else { - Dprint(statp->options & RES_DEBUG, + len = rlen; + } else { + Dprint(statp->options & RES_DEBUG, @@ -990,6 +1066,66 @@ reopen (res_state statp, int *terrno, in - return 1; + return 1; } - + +/* The send_dg function is responsible for sending a DNS query over UDP + to the nameserver numbered NS from the res_state STATP i.e. + EXT(statp).nssocks[ns]. The function supports IPv4 and IPv6 queries @@ -450,37 +450,37 @@ Index: b/resolv/res_send.c + a the length of the first response in bytes is returned. */ static int send_dg(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, + const u_char *buf, int buflen, const u_char *buf2, int buflen2, @@ -999,8 +1135,6 @@ send_dg(res_state statp, { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; + const HEADER *hp = (HEADER *) buf; + const HEADER *hp2 = (HEADER *) buf2; - u_char *ans = *ansp; - int orig_anssizp = *anssizp; - struct timespec now, timeout, finish; - struct pollfd pfd[1]; - int ptimeout; + struct timespec now, timeout, finish; + struct pollfd pfd[1]; + int ptimeout; @@ -1033,6 +1167,8 @@ send_dg(res_state statp, - int need_recompute = 0; - int nwritten = 0; - int recvresp1 = 0; + int need_recompute = 0; + int nwritten = 0; + int recvresp1 = 0; + /* Skip the second response if there is no second query. + To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - pfd[0].fd = EXT(statp).nssocks[ns]; - pfd[0].events = POLLOUT; + int recvresp2 = buf2 == NULL; + pfd[0].fd = EXT(statp).nssocks[ns]; + pfd[0].events = POLLOUT; @@ -1196,52 +1332,54 @@ send_dg(res_state statp, - int *thisresplenp; - - if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { + int *thisresplenp; + + if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { + /* We have not received any responses + yet or we only have one response to + receive. */ - thisanssizp = anssizp; - thisansp = anscp ?: ansp; - assert (anscp != NULL || ansp2 == NULL); - thisresplenp = &resplen; - } else { + thisanssizp = anssizp; + thisansp = anscp ?: ansp; + assert (anscp != NULL || ansp2 == NULL); + thisresplenp = &resplen; + } else { - if (*anssizp != MAXPACKET) { - /* No buffer allocated for the first - reply. We can try to use the rest @@ -503,12 +503,12 @@ Index: b/resolv/res_send.c - *ansp2 = *ansp; - } - - thisanssizp = anssizp2; - thisansp = ansp2; - thisresplenp = resplen2; - } - - if (*thisanssizp < MAXPACKET + thisanssizp = anssizp2; + thisansp = ansp2; + thisresplenp = resplen2; + } + + if (*thisanssizp < MAXPACKET - /* Yes, we test ANSCP here. If we have two buffers - both will be allocatable. */ - && anscp @@ -517,22 +517,22 @@ Index: b/resolv/res_send.c + we can reallocate it. */ + && (thisansp != NULL && thisansp != ansp) + /* Is the size too small? */ - && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0 + && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0 - || *thisanssizp < *thisresplenp)) { + || *thisanssizp < *thisresplenp) + ) { + /* Always allocate MAXPACKET, callers expect + this specific size. */ - u_char *newp = malloc (MAXPACKET); - if (newp != NULL) { + u_char *newp = malloc (MAXPACKET); + if (newp != NULL) { - *anssizp = MAXPACKET; - *thisansp = ans = newp; + *thisanssizp = MAXPACKET; + *thisansp = newp; - if (thisansp == ansp2) - *ansp2_malloced = 1; - } - } + if (thisansp == ansp2) + *ansp2_malloced = 1; + } + } + /* We could end up with truncation if anscp was NULL + (not allowed to change caller's buffer) and the + response buffer size is too small. This isn't a @@ -549,6 +549,6 @@ Index: b/resolv/res_send.c + ); + } + - HEADER *anhp = (HEADER *) *thisansp; - socklen_t fromlen = sizeof(struct sockaddr_in6); - assert (sizeof(from) <= fromlen); + HEADER *anhp = (HEADER *) *thisansp; + socklen_t fromlen = sizeof(struct sockaddr_in6); + assert (sizeof(from) <= fromlen); diff --git a/SOURCES/glibc-rh1296297-1.patch b/SOURCES/glibc-rh1296297-1.patch index 17af5e73..7d435bac 100644 --- a/SOURCES/glibc-rh1296297-1.patch +++ b/SOURCES/glibc-rh1296297-1.patch @@ -13,13 +13,13 @@ Author: Carlos O'Donell Date: Mon Feb 24 22:33:35 2014 -0500 Fix failure load locale template. - + The call to open_tmpl_archive was being passed a pointer to an object allocated on the stack. The object on the stack is not guaranteed to be initialized to zero so we need to minimally initialize `fname' in the struct locarhandle to ensure that open_tml_archive loads the default tempalte. - + This error was seen while debugging glibc installs in a qemu VM where it is more likely the stack pages were dirty. It has not been reported on non-VM systems. @@ -28,7 +28,7 @@ Author: Carlos O'Donell Date: Fri Oct 18 23:27:45 2013 -0400 Allow fill_archive to be called with NULL fname. - + The fill_archive function should support being called with a NULL fname argument. A NULL fname argument indicates that the default archive should @@ -50,7 +50,7 @@ Author: Carlos O'Donell Date: Fri Oct 18 23:41:30 2013 -0400 Enhance localedef --list-archive option. - + The localedef --list-archive option claims that it can accept a [file] argument and list the contents of that archive. The support was never implemented. This patch @@ -67,7 +67,7 @@ Index: glibc-2.17-c758a686/locale/locarchive.h --- glibc-2.17-c758a686.orig/locale/locarchive.h +++ glibc-2.17-c758a686/locale/locarchive.h @@ -80,6 +80,8 @@ struct locrecent - + struct locarhandle { + /* Full path to the locale archive file. */ @@ -80,14 +80,14 @@ Index: glibc-2.17-c758a686/locale/programs/localedef.c --- glibc-2.17-c758a686.orig/locale/programs/localedef.c +++ glibc-2.17-c758a686/locale/programs/localedef.c @@ -202,7 +202,7 @@ main (int argc, char *argv[]) - + /* Handle a few special cases. */ if (list_archive) - show_archive_content (verbose); + show_archive_content (remaining > 1 ? argv[remaining] : NULL, verbose); if (add_to_archive) return add_locales_to_archive (argc - remaining, &argv[remaining], - replace_archive); + replace_archive); Index: glibc-2.17-c758a686/locale/programs/localedef.h =================================================================== --- glibc-2.17-c758a686.orig/locale/programs/localedef.h @@ -95,22 +95,22 @@ Index: glibc-2.17-c758a686/locale/programs/localedef.h @@ -176,7 +176,8 @@ extern int add_locales_to_archive (size_ /* Removed named locales from archive. */ extern int delete_locales_from_archive (size_t nlist, char *list[]); - + -/* List content of locale archive. */ -extern void show_archive_content (int verbose) __attribute__ ((noreturn)); +/* List content of locale archive. If FNAME is non-null use that as + the locale archive to list, otherwise the default. */ +extern void show_archive_content (char *fname, int verbose) __attribute__ ((noreturn)); - + #endif /* localedef.h */ Index: glibc-2.17-c758a686/locale/programs/locarchive.c =================================================================== --- glibc-2.17-c758a686.orig/locale/programs/locarchive.c +++ glibc-2.17-c758a686/locale/programs/locarchive.c @@ -197,6 +197,7 @@ create_archive (const char *archivefname - _("cannot change mode of new locale archive")); + _("cannot change mode of new locale archive")); } - + + ah->fname = NULL; ah->fd = fd; ah->addr = p; @@ -137,13 +137,13 @@ Index: glibc-2.17-c758a686/locale/programs/locarchive.c + memcpy (archivefname, output_prefix, prefix_len); + strcpy (archivefname + prefix_len, ARCHIVE_NAME); + } - + while (1) { @@ -531,8 +540,11 @@ open_archive (struct locarhandle *ah, bo fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); if (fd == -1) - { + { - /* Maybe the file does not yet exist. */ - if (errno == ENOENT) + /* Maybe the file does not yet exist? If we are opening @@ -151,28 +151,28 @@ Index: glibc-2.17-c758a686/locale/programs/locarchive.c + list an empty archive, otherwise we print an error + and exit. */ + if (errno == ENOENT && defaultfname) - { - if (readonly) - { + { + if (readonly) + { @@ -1258,6 +1270,7 @@ add_locales_to_archive (nlist, list, rep - + /* Open the archive. This call never returns if we cannot successfully open the archive. */ + ah.fname = NULL; open_archive (&ah, false); - + while (nlist-- > 0) @@ -1457,6 +1470,7 @@ delete_locales_from_archive (nlist, list - + /* Open the archive. This call never returns if we cannot successfully open the archive. */ + ah.fname = NULL; open_archive (&ah, false); - + head = ah.addr; @@ -1545,7 +1559,7 @@ dataentcmp (const void *a, const void *b - - + + void -show_archive_content (int verbose) +show_archive_content (char *fname, int verbose) @@ -180,22 +180,22 @@ Index: glibc-2.17-c758a686/locale/programs/locarchive.c struct locarhandle ah; struct locarhead *head; @@ -1555,6 +1569,7 @@ show_archive_content (int verbose) - + /* Open the archive. This call never returns if we cannot successfully open the archive. */ + ah.fname = fname; open_archive (&ah, true); - + head = ah.addr; Index: glibc-2.17-c758a686/locale/programs/locfile.c =================================================================== --- glibc-2.17-c758a686.orig/locale/programs/locfile.c +++ glibc-2.17-c758a686/locale/programs/locfile.c @@ -337,6 +337,7 @@ write_all_categories (struct localedef_t - + /* Open the archive. This call never returns if we cannot - successfully open the archive. */ + successfully open the archive. */ + ah.fname = NULL; open_archive (&ah, false); - + if (add_locale_to_archive (&ah, locname, to_archive, true) != 0) diff --git a/SOURCES/glibc-rh1296297.patch b/SOURCES/glibc-rh1296297.patch index 50f3c468..875e760e 100644 --- a/SOURCES/glibc-rh1296297.patch +++ b/SOURCES/glibc-rh1296297.patch @@ -12,7 +12,7 @@ Author: Carlos O'Donell Date: Thu Mar 5 16:05:43 2015 -0500 Resolves: #156477 - + - Support installing only those locales specified by the RPM macro %%_install_langs (#156477). @@ -42,28 +42,28 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c struct locarhead head; - const char *archivefname = tmpl_file; + const char *archivefname = ah->fname == NULL ? tmpl_file : ah->fname; - + /* Open the archive. We must have exclusive write access. */ fd = open64 (archivefname, O_RDONLY); @@ -116,7 +118,7 @@ open_tmpl_archive (struct locarhandle *a ah->mmaped = (head.sumhash_offset - + head.sumhash_size * sizeof (struct sumhashent)); + + head.sumhash_size * sizeof (struct sumhashent)); if (ah->mmaped > (unsigned long) st.st_size) - error (EXIT_FAILURE, 0, "locale archite template file truncated"); + error (EXIT_FAILURE, 0, "locale archive template file truncated"); ah->mmaped = st.st_size; ah->reserved = st.st_size; - + @@ -250,7 +252,10 @@ compute_data (struct locarhandle *ah, st } - + static int -fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[], +fill_archive (struct locarhandle *tmpl_ah, + const char *fname, + size_t install_langs_count, char *install_langs_list[], + size_t nlist, char *list[], - const char *primary) + const char *primary) { struct locarhandle ah; @@ -281,11 +286,40 @@ fill_archive (struct locarhandle *tmpl_a @@ -72,7 +72,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c { + char * name; + int i; - assert (used < head->namehash_used); + assert (used < head->namehash_used); - names[used].name = tmpl_ah->addr + namehashtab[cnt].name_offset; - names[used++].locrec - = (struct locrecent *) ((char *) tmpl_ah->addr + @@ -109,22 +109,22 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c + } + } } - + /* Sort the names. */ @@ -304,6 +338,9 @@ fill_archive (struct locarhandle *tmpl_a - + /* Open the archive. This call never returns if we cannot successfully open the archive. */ + ah.fname = NULL; + if (fname != NULL) + ah.fname = fname; open_archive (&ah, false); - + if (primary != NULL) @@ -532,24 +569,197 @@ fill_archive (struct locarhandle *tmpl_a return result; } - + -int main () +void usage() +{ @@ -198,7 +198,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c struct locarhandle tmpl_ah; + char *new_locar_fname = NULL; size_t loc_path_len = strlen (loc_path); - + + while (1) + { + int c; @@ -309,9 +309,9 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c dirp = opendir (loc_path); if (dirp == NULL) error (EXIT_FAILURE, errno, "cannot open directory \"%s\"", loc_path); - + open_tmpl_archive (&tmpl_ah); - + - unlink (locar_file); + if (new_locar_fname) + unlink (new_locar_fname); @@ -322,15 +322,15 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c if (primary == NULL) primary = getenv ("LANG"); @@ -560,7 +770,8 @@ int main () - && strncmp (primary, "zh", 2) != 0) - { - char *ptr = malloc (strlen (primary) + strlen (".utf8") + 1), *p, *q; + && strncmp (primary, "zh", 2) != 0) + { + char *ptr = malloc (strlen (primary) + strlen (".utf8") + 1), *p, *q; - + /* This leads to invalid locales sometimes: + de_DE.iso885915@euro -> de_DE.utf8@euro */ - if (ptr != NULL) - { - p = ptr; + if (ptr != NULL) + { + p = ptr; @@ -623,10 +834,19 @@ int main () cnt++; } diff --git a/SOURCES/glibc-rh1298349.patch b/SOURCES/glibc-rh1298349.patch index 7e1ecd14..863c2151 100644 --- a/SOURCES/glibc-rh1298349.patch +++ b/SOURCES/glibc-rh1298349.patch @@ -3,13 +3,13 @@ Author: Carlos O'Donell Date: Wed Jan 21 10:08:18 2015 -0500 tst-getpw: Rewrite. - + The test is rewritten to look for the testable conditions and exit once they are all detected. This prevents the test from iterating over 2000 UIDs and looking up each one. It speeds up the test and prevents it from failing if the system under test has an NSS-based passwd that is slower than the test timeout. - + See: https://sourceware.org/ml/libc-alpha/2015-01/msg00394.html @@ -21,12 +21,12 @@ index 059c9e0..e3e101b 100644 -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 1999-2016 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 @@ -15,26 +15,100 @@ License along with the GNU C Library; if not, see . */ - + +#include #include +#include @@ -42,13 +42,13 @@ index 059c9e0..e3e101b 100644 + +/* How many errors we've had while running the test. */ +int errors; - + static void check (uid_t uid) { + int ret; char buf[1024]; - + - (void) getpw (uid, buf); + ret = getpw (uid, buf); + @@ -86,7 +86,7 @@ index 059c9e0..e3e101b 100644 + errors++; + } } - + -int -main (void) +static int @@ -94,7 +94,7 @@ index 059c9e0..e3e101b 100644 { + int ret; uid_t uid; - + - /* Just call it a different number of times the range should be - large enough to find some existing and some non existing uids. */ + /* Should return -1 and set errnot to EINVAL. */ @@ -117,12 +117,12 @@ index 059c9e0..e3e101b 100644 + if (seen_miss && seen_hit) + break; + } - + - for (uid = 0; uid < 2000; ++uid) - check (uid); + if (!seen_hit) + printf ("FAIL: Did not read even one password line given a uid.\n"); - + - return 0; + if (!seen_miss) + printf ("FAIL: Did not find even one invalid uid.\n"); @@ -134,7 +134,7 @@ index 059c9e0..e3e101b 100644 +#include "../test-skeleton.c" License along with the GNU C Library; if not, see . */ - + +#include #include +#include @@ -150,13 +150,13 @@ index 059c9e0..e3e101b 100644 + +/* How many errors we've had while running the test. */ +int errors; - + static void check (uid_t uid) { + int ret; char buf[1024]; - + - (void) getpw (uid, buf); + ret = getpw (uid, buf); + @@ -194,13 +194,13 @@ index 059c9e0..e3e101b 100644 + errors++; + } } - + static int do_test (void) { + int ret; uid_t uid; - + - /* Just call it a different number of times the range should be - large enough to find some existing and some non existing uids. */ + /* Should return -1 and set errnot to EINVAL. */ @@ -226,14 +226,14 @@ index 059c9e0..e3e101b 100644 + + if (!seen_hit) + printf ("FAIL: Did not read even one password line given a uid.\n"); - + - for (uid = 0; uid < 2000; ++uid) - check (uid); + if (!seen_miss) + printf ("FAIL: Did not find even one invalid uid.\n"); - + - return 0; + return errors; } - + #define TEST_FUNCTION do_test () diff --git a/SOURCES/glibc-rh1298354.patch b/SOURCES/glibc-rh1298354.patch index 375c75b9..c6e66f8b 100644 --- a/SOURCES/glibc-rh1298354.patch +++ b/SOURCES/glibc-rh1298354.patch @@ -3,143 +3,143 @@ Author: Arjun Shankar Date: Wed Nov 5 15:24:08 2014 +0530 Modify several tests to use test-skeleton.c - + This patch modifies several test cases to use test-skeleton.c. It was generated by a bash script written for this purpose and thus excludes several other tests which I deemed worth a visual inspection before making the change. - + I intend to follow up with individual patches to the tests skipped by the script. - + The script itself resides at http://git.io/WODAmg and should reproduce this very patch when run against master. - + ChangeLog: - + 2014-10-30 Arjun Shankar - - * catgets/test-gencat.c: Use test-skeleton.c. - * catgets/tst-catgets.c: Likewise. - * csu/tst-empty.c: Likewise. - * elf/tst-audit2.c: Likewise. - * elf/tst-global1.c: Likewise. - * elf/tst-pathopt.c: Likewise. - * elf/tst-piemod1.c: Likewise. - * elf/tst-tls10.c: Likewise. - * elf/tst-tls11.c: Likewise. - * elf/tst-tls12.c: Likewise. - * gnulib/tst-gcc.c: Likewise. - * iconvdata/tst-e2big.c: Likewise. - * iconvdata/tst-loading.c: Likewise. - * iconv/tst-iconv1.c: Likewise. - * iconv/tst-iconv2.c: Likewise. - * inet/test-inet6_opt.c: Likewise. - * inet/tst-gethnm.c: Likewise. - * inet/tst-network.c: Likewise. - * inet/tst-ntoa.c: Likewise. - * intl/tst-codeset.c: Likewise. - * intl/tst-gettext2.c: Likewise. - * intl/tst-gettext3.c: Likewise. - * intl/tst-ngettext.c: Likewise. - * intl/tst-translit.c: Likewise. - * io/test-stat.c: Likewise. - * libio/test-fmemopen.c: Likewise. - * libio/tst-freopen.c: Likewise. - * libio/tst-sscanf.c: Likewise. - * libio/tst-ungetwc1.c: Likewise. - * libio/tst-ungetwc2.c: Likewise. - * libio/tst-widetext.c: Likewise. - * localedata/tst-ctype.c: Likewise. - * localedata/tst-digits.c: Likewise. - * localedata/tst-leaks.c: Likewise. - * localedata/tst-mbswcs1.c: Likewise. - * localedata/tst-mbswcs2.c: Likewise. - * localedata/tst-mbswcs3.c: Likewise. - * localedata/tst-mbswcs4.c: Likewise. - * localedata/tst-mbswcs5.c: Likewise. - * localedata/tst-setlocale.c: Likewise. - * localedata/tst-trans.c: Likewise. - * localedata/tst-wctype.c: Likewise. - * localedata/tst-xlocale1.c: Likewise. - * login/tst-grantpt.c: Likewise. - * malloc/tst-calloc.c: Likewise. - * malloc/tst-malloc.c: Likewise. - * malloc/tst-mallocstate.c: Likewise. - * malloc/tst-mcheck.c: Likewise. - * malloc/tst-mtrace.c: Likewise. - * malloc/tst-obstack.c: Likewise. - * math/atest-exp2.c: Likewise. - * math/atest-exp.c: Likewise. - * math/atest-sincos.c: Likewise. - * math/test-matherr.c: Likewise. - * math/test-misc.c: Likewise. - * math/test-powl.c: Likewise. - * math/tst-definitions.c: Likewise. - * misc/tst-dirname.c: Likewise. - * misc/tst-efgcvt.c: Likewise. - * misc/tst-fdset.c: Likewise. - * misc/tst-hsearch.c: Likewise. - * misc/tst-mntent2.c: Likewise. - * nptl/tst-sem7.c: Likewise. - * nptl/tst-sem8.c: Likewise. - * nptl/tst-sem9.c: Likewise. - * nss/test-netdb.c: Likewise. - * posix/tst-fnmatch.c: Likewise. - * posix/tst-getlogin.c: Likewise. - * posix/tst-gnuglob.c: Likewise. - * posix/tst-mmap.c: Likewise. - * resolv/tst-inet_ntop.c: Likewise. - * rt/tst-timer.c: Likewise. - * stdio-common/test-fseek.c: Likewise. - * stdio-common/test-popen.c: Likewise. - * stdio-common/test-vfprintf.c: Likewise. - * stdio-common/tst-cookie.c: Likewise. - * stdio-common/tst-fileno.c: Likewise. - * stdio-common/tst-gets.c: Likewise. - * stdio-common/tst-obprintf.c: Likewise. - * stdio-common/tst-perror.c: Likewise. - * stdio-common/tst-sprintf2.c: Likewise. - * stdio-common/tst-sprintf3.c: Likewise. - * stdio-common/tst-sprintf.c: Likewise. - * stdio-common/tst-swprintf.c: Likewise. - * stdio-common/tst-tmpnam.c: Likewise. - * stdio-common/tst-unbputc.c: Likewise. - * stdio-common/tst-wc-printf.c: Likewise. - * stdlib/tst-environ.c: Likewise. - * stdlib/tst-fmtmsg.c: Likewise. - * stdlib/tst-limits.c: Likewise. - * stdlib/tst-rand48-2.c: Likewise. - * stdlib/tst-rand48.c: Likewise. - * stdlib/tst-random2.c: Likewise. - * stdlib/tst-random.c: Likewise. - * stdlib/tst-strtol.c: Likewise. - * stdlib/tst-strtoll.c: Likewise. - * stdlib/tst-xpg-basename.c: Likewise. - * string/test-ffs.c: Likewise. - * string/tst-bswap.c: Likewise. - * string/tst-inlcall.c: Likewise. - * string/tst-strtok.c: Likewise. - * string/tst-strxfrm.c: Likewise. - * sysdeps/x86_64/tst-audit10.c: Likewise. - * elf/tst-audit3.c: Likewise. - * elf/tst-audit4.c: Likewise. - * elf/tst-audit5.c: Likewise. - * time/tst-ftime_l.c: Likewise. - * time/tst-getdate.c: Likewise. - * time/tst-mktime3.c: Likewise. - * time/tst-mktime.c: Likewise. - * time/tst-posixtz.c: Likewise. - * time/tst-strptime2.c: Likewise. - * time/tst-strptime3.c: Likewise. - * wcsmbs/tst-btowc.c: Likewise. - * wcsmbs/tst-mbrtowc.c: Likewise. - * wcsmbs/tst-mbsrtowcs.c: Likewise. - * wcsmbs/tst-wchar-h.c: Likewise. - * wcsmbs/tst-wcpncpy.c: Likewise. - * wcsmbs/tst-wcrtomb.c: Likewise. - * wcsmbs/tst-wcsnlen.c: Likewise. - * wcsmbs/tst-wcstof.c: Likewise. + + * catgets/test-gencat.c: Use test-skeleton.c. + * catgets/tst-catgets.c: Likewise. + * csu/tst-empty.c: Likewise. + * elf/tst-audit2.c: Likewise. + * elf/tst-global1.c: Likewise. + * elf/tst-pathopt.c: Likewise. + * elf/tst-piemod1.c: Likewise. + * elf/tst-tls10.c: Likewise. + * elf/tst-tls11.c: Likewise. + * elf/tst-tls12.c: Likewise. + * gnulib/tst-gcc.c: Likewise. + * iconvdata/tst-e2big.c: Likewise. + * iconvdata/tst-loading.c: Likewise. + * iconv/tst-iconv1.c: Likewise. + * iconv/tst-iconv2.c: Likewise. + * inet/test-inet6_opt.c: Likewise. + * inet/tst-gethnm.c: Likewise. + * inet/tst-network.c: Likewise. + * inet/tst-ntoa.c: Likewise. + * intl/tst-codeset.c: Likewise. + * intl/tst-gettext2.c: Likewise. + * intl/tst-gettext3.c: Likewise. + * intl/tst-ngettext.c: Likewise. + * intl/tst-translit.c: Likewise. + * io/test-stat.c: Likewise. + * libio/test-fmemopen.c: Likewise. + * libio/tst-freopen.c: Likewise. + * libio/tst-sscanf.c: Likewise. + * libio/tst-ungetwc1.c: Likewise. + * libio/tst-ungetwc2.c: Likewise. + * libio/tst-widetext.c: Likewise. + * localedata/tst-ctype.c: Likewise. + * localedata/tst-digits.c: Likewise. + * localedata/tst-leaks.c: Likewise. + * localedata/tst-mbswcs1.c: Likewise. + * localedata/tst-mbswcs2.c: Likewise. + * localedata/tst-mbswcs3.c: Likewise. + * localedata/tst-mbswcs4.c: Likewise. + * localedata/tst-mbswcs5.c: Likewise. + * localedata/tst-setlocale.c: Likewise. + * localedata/tst-trans.c: Likewise. + * localedata/tst-wctype.c: Likewise. + * localedata/tst-xlocale1.c: Likewise. + * login/tst-grantpt.c: Likewise. + * malloc/tst-calloc.c: Likewise. + * malloc/tst-malloc.c: Likewise. + * malloc/tst-mallocstate.c: Likewise. + * malloc/tst-mcheck.c: Likewise. + * malloc/tst-mtrace.c: Likewise. + * malloc/tst-obstack.c: Likewise. + * math/atest-exp2.c: Likewise. + * math/atest-exp.c: Likewise. + * math/atest-sincos.c: Likewise. + * math/test-matherr.c: Likewise. + * math/test-misc.c: Likewise. + * math/test-powl.c: Likewise. + * math/tst-definitions.c: Likewise. + * misc/tst-dirname.c: Likewise. + * misc/tst-efgcvt.c: Likewise. + * misc/tst-fdset.c: Likewise. + * misc/tst-hsearch.c: Likewise. + * misc/tst-mntent2.c: Likewise. + * nptl/tst-sem7.c: Likewise. + * nptl/tst-sem8.c: Likewise. + * nptl/tst-sem9.c: Likewise. + * nss/test-netdb.c: Likewise. + * posix/tst-fnmatch.c: Likewise. + * posix/tst-getlogin.c: Likewise. + * posix/tst-gnuglob.c: Likewise. + * posix/tst-mmap.c: Likewise. + * resolv/tst-inet_ntop.c: Likewise. + * rt/tst-timer.c: Likewise. + * stdio-common/test-fseek.c: Likewise. + * stdio-common/test-popen.c: Likewise. + * stdio-common/test-vfprintf.c: Likewise. + * stdio-common/tst-cookie.c: Likewise. + * stdio-common/tst-fileno.c: Likewise. + * stdio-common/tst-gets.c: Likewise. + * stdio-common/tst-obprintf.c: Likewise. + * stdio-common/tst-perror.c: Likewise. + * stdio-common/tst-sprintf2.c: Likewise. + * stdio-common/tst-sprintf3.c: Likewise. + * stdio-common/tst-sprintf.c: Likewise. + * stdio-common/tst-swprintf.c: Likewise. + * stdio-common/tst-tmpnam.c: Likewise. + * stdio-common/tst-unbputc.c: Likewise. + * stdio-common/tst-wc-printf.c: Likewise. + * stdlib/tst-environ.c: Likewise. + * stdlib/tst-fmtmsg.c: Likewise. + * stdlib/tst-limits.c: Likewise. + * stdlib/tst-rand48-2.c: Likewise. + * stdlib/tst-rand48.c: Likewise. + * stdlib/tst-random2.c: Likewise. + * stdlib/tst-random.c: Likewise. + * stdlib/tst-strtol.c: Likewise. + * stdlib/tst-strtoll.c: Likewise. + * stdlib/tst-xpg-basename.c: Likewise. + * string/test-ffs.c: Likewise. + * string/tst-bswap.c: Likewise. + * string/tst-inlcall.c: Likewise. + * string/tst-strtok.c: Likewise. + * string/tst-strxfrm.c: Likewise. + * sysdeps/x86_64/tst-audit10.c: Likewise. + * elf/tst-audit3.c: Likewise. + * elf/tst-audit4.c: Likewise. + * elf/tst-audit5.c: Likewise. + * time/tst-ftime_l.c: Likewise. + * time/tst-getdate.c: Likewise. + * time/tst-mktime3.c: Likewise. + * time/tst-mktime.c: Likewise. + * time/tst-posixtz.c: Likewise. + * time/tst-strptime2.c: Likewise. + * time/tst-strptime3.c: Likewise. + * wcsmbs/tst-btowc.c: Likewise. + * wcsmbs/tst-mbrtowc.c: Likewise. + * wcsmbs/tst-mbsrtowcs.c: Likewise. + * wcsmbs/tst-wchar-h.c: Likewise. + * wcsmbs/tst-wcpncpy.c: Likewise. + * wcsmbs/tst-wcrtomb.c: Likewise. + * wcsmbs/tst-wcsnlen.c: Likewise. + * wcsmbs/tst-wcstof.c: Likewise. diff --git a/catgets/test-gencat.c b/catgets/test-gencat.c index eaa9b89..282974c 100644 @@ -148,7 +148,7 @@ index eaa9b89..282974c 100644 @@ -3,8 +3,8 @@ #include #include - + -int -main (void) +static int @@ -157,7 +157,7 @@ index eaa9b89..282974c 100644 nl_catd catalog; setlocale (LC_ALL, ""); @@ -29,3 +29,6 @@ main (void) - + return 0; } + @@ -168,9 +168,9 @@ index fdaa834..a0a4089 100644 --- a/catgets/tst-catgets.c +++ b/catgets/tst-catgets.c @@ -14,8 +14,8 @@ static const char *msgs[] = - + #define ROUNDS 5 - + -int -main (void) +static int @@ -179,7 +179,7 @@ index fdaa834..a0a4089 100644 int rnd; int result = 0; @@ -64,3 +64,6 @@ main (void) - + return result; } + @@ -208,7 +208,7 @@ index b4fa906..acad1b0 100644 @@ -31,8 +31,8 @@ calloc (size_t n, size_t m) return ptr; } - + -int -main (void) +static int @@ -217,7 +217,7 @@ index b4fa906..acad1b0 100644 if (magic[1] != MAGIC1 || magic[0] != MAGIC2) { @@ -42,3 +42,6 @@ main (void) - + return 0; } + @@ -230,7 +230,7 @@ index 1611b51..4df335c 100644 @@ -1,8 +1,8 @@ #include #include - + -int -main (void) +static int @@ -239,7 +239,7 @@ index 1611b51..4df335c 100644 void *h1 = dlopen ("$ORIGIN/testobj6.so", RTLD_GLOBAL|RTLD_LAZY); if (h1 == NULL) @@ -34,3 +34,6 @@ main (void) - + return 0; } + @@ -251,8 +251,8 @@ index 1f7aac2..8d73ad4 100644 +++ b/elf/tst-pathopt.c @@ -4,8 +4,8 @@ #include - - + + -int -main (void) +static int @@ -261,7 +261,7 @@ index 1f7aac2..8d73ad4 100644 void *h; int (*fp) (int); @@ -37,3 +37,6 @@ main (void) - + return result; } + @@ -274,7 +274,7 @@ index ad439da..6e98b5f 100644 @@ -6,8 +6,8 @@ foo (void) return 21; } - + -int -main (void) +static int @@ -283,7 +283,7 @@ index ad439da..6e98b5f 100644 int val = foo (); if (val != 34) @@ -18,3 +18,6 @@ main (void) - + return 0; } + @@ -296,7 +296,7 @@ index 347243f..eb1ecb9 100644 @@ -8,8 +8,8 @@ __thread struct A local = { 1, 2, 3 }; if (p->a != S || p->b != S + 1 || p->c != S + 2) \ abort () - + -int -main (void) +static int @@ -305,7 +305,7 @@ index 347243f..eb1ecb9 100644 struct A *p; if (local.a != 1 || local.b != 2 || local.c != 3) @@ -35,3 +35,6 @@ main (void) - + exit (0); } + @@ -318,7 +318,7 @@ index 8a2fef4..8ceac14 100644 @@ -5,8 +5,8 @@ if (p->a != S || p->b != S + 1 || p->c != S + 2) \ abort () - + -int -main (void) +static int @@ -327,7 +327,7 @@ index 8a2fef4..8ceac14 100644 struct A *p; check1 (); @@ -24,3 +24,6 @@ main (void) - + exit (0); } + @@ -340,7 +340,7 @@ index 9086d17..8093894 100644 @@ -5,8 +5,8 @@ if (p->a != S || p->b != S + 1 || p->c != S + 2) \ abort () - + -int -main (void) +static int @@ -349,7 +349,7 @@ index 9086d17..8093894 100644 struct A *p; check1 (); @@ -15,3 +15,6 @@ main (void) - + exit (0); } + @@ -361,8 +361,8 @@ index 71fab28..9f4ba83 100644 +++ b/gnulib/tst-gcc.c @@ -51,8 +51,8 @@ }) - - + + -int -main (void) +static int @@ -371,7 +371,7 @@ index 71fab28..9f4ba83 100644 int result = 0; int __integer_type; @@ -71,3 +71,6 @@ main (void) - + return result; } + @@ -384,7 +384,7 @@ index d806ce6..0609f50 100644 @@ -5,8 +5,8 @@ #include #include - + -int -main (void) +static int @@ -393,7 +393,7 @@ index d806ce6..0609f50 100644 char utf8[5]; wchar_t ucs4[5]; @@ -42,3 +42,6 @@ main (void) - + return 0; } + @@ -405,8 +405,8 @@ index 5036ad1..0672a51 100644 +++ b/iconv/tst-iconv2.c @@ -25,8 +25,8 @@ #include - - + + -int -main (void) +static int @@ -415,7 +415,7 @@ index 5036ad1..0672a51 100644 char buf[3]; const wchar_t wc[1] = L"a"; @@ -97,3 +97,6 @@ main (void) - + return result; } + @@ -428,7 +428,7 @@ index 9533eb0..8de64b2 100644 @@ -95,10 +95,13 @@ test_tscii (void) test ("TSCII", inbuf, sizeof (inbuf), 9); } - + -int -main (void) +static int @@ -447,8 +447,8 @@ index 0d8a959..eff9d78 100644 +++ b/iconvdata/tst-loading.c @@ -114,8 +114,8 @@ static const char inbuf[] = " function. Later modifications of the variable have no effect.\n"; - - + + -int -main (void) +static int @@ -457,7 +457,7 @@ index 0d8a959..eff9d78 100644 size_t count = TEST_ROUNDS; int result = 0; @@ -180,3 +180,6 @@ main (void) - + return result; } + @@ -470,7 +470,7 @@ index 3bf319e..a7ebf00 100644 @@ -194,8 +194,8 @@ decode_inet6_opt (void *eb, socklen_t el) return ret; } - + -int -main (void) +static int @@ -492,7 +492,7 @@ index 8af44d6..dd3a547 100644 @@ -10,8 +10,8 @@ #include #include - + -int -main (void) +static int @@ -501,7 +501,7 @@ index 8af44d6..dd3a547 100644 struct hostent *ent; struct in_addr hostaddr; @@ -62,3 +62,6 @@ main (void) - + return result; } + @@ -513,8 +513,8 @@ index fc90bd7..cc840e0 100644 +++ b/inet/tst-network.c @@ -51,8 +51,8 @@ struct }; - - + + -int -main (void) +static int @@ -523,7 +523,7 @@ index fc90bd7..cc840e0 100644 int errors = 0; size_t i; @@ -76,3 +76,6 @@ main (void) - + return errors != 0; } + @@ -535,17 +535,17 @@ index 9be91eb..ef82d4d 100644 +++ b/inet/tst-ntoa.c @@ -22,8 +22,8 @@ test (unsigned int inaddr, const char *expected) } - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -34,3 +34,6 @@ main (void) - + return result; } + @@ -558,7 +558,7 @@ index f5b37ec..37f731e 100644 @@ -23,8 +23,8 @@ #include #include - + -int -main (void) +static int @@ -567,7 +567,7 @@ index f5b37ec..37f731e 100644 char *s; int result = 0; @@ -55,3 +55,6 @@ main (void) - + return result; } + @@ -580,16 +580,16 @@ index 075680a..3c44165 100644 @@ -40,8 +40,8 @@ struct data_t strings[] = const int lang_cnt = 3; const char *lang[] = {"lang1", "lang2", "lang3"}; - + -int -main (void) +static int +do_test (void) { int i; - + @@ -70,3 +70,6 @@ main (void) - + return 0; } + @@ -602,7 +602,7 @@ index dd88987..11e9b08 100644 @@ -24,8 +24,8 @@ #include #include - + -int -main (void) +static int @@ -611,7 +611,7 @@ index dd88987..11e9b08 100644 char *s; int result = 0; @@ -57,3 +57,6 @@ main (void) - + return result; } + @@ -623,8 +623,8 @@ index 4fb0ca2..71e91b9 100644 +++ b/intl/tst-ngettext.c @@ -25,8 +25,8 @@ #include - - + + -int -main (void) +static int @@ -633,7 +633,7 @@ index 4fb0ca2..71e91b9 100644 const char *strs[2] = { "singular", "plural" }; unsigned long int i; @@ -63,3 +63,6 @@ main (void) - + return res; } + @@ -646,7 +646,7 @@ index 1aecee7..299fa40 100644 @@ -24,8 +24,8 @@ #include #include - + -int -main (void) +static int @@ -655,7 +655,7 @@ index 1aecee7..299fa40 100644 int result = 0; const char *s; @@ -49,3 +49,6 @@ main (void) - + return result; } + @@ -668,7 +668,7 @@ index c5cfd26..e9c8468 100644 @@ -25,8 +25,8 @@ #include #include - + -int -main (void) +static int @@ -690,7 +690,7 @@ index 3099894..211176e 100644 @@ -22,8 +22,8 @@ static char buffer[] = "foobar"; #include #include - + -int -main (void) +static int @@ -699,7 +699,7 @@ index 3099894..211176e 100644 int ch; FILE *stream; @@ -37,3 +37,6 @@ main (void) - + return 0; } + @@ -712,7 +712,7 @@ index f9e7177..94284ec 100644 @@ -22,8 +22,8 @@ #include #include - + -int -main (void) +static int @@ -732,9 +732,9 @@ index b1a2b84..fb4be34 100644 --- a/libio/tst-sscanf.c +++ b/libio/tst-sscanf.c @@ -3,8 +3,8 @@ - + #define WCS_LENGTH 256 - + -int -main (void) +static int @@ -743,7 +743,7 @@ index b1a2b84..fb4be34 100644 const char cnv[] ="%l[abc]"; const char str[] = "abbcXab"; @@ -18,3 +18,6 @@ main (void) - + return result; } + @@ -756,7 +756,7 @@ index f74c407..f71b390 100644 @@ -7,8 +7,8 @@ #include #include - + -int -main (void) +static int @@ -765,7 +765,7 @@ index f74c407..f71b390 100644 FILE *fp; const char *str = "abcdef"; @@ -79,3 +79,6 @@ main (void) - + return result; } + @@ -778,7 +778,7 @@ index d15e287..a7c5193 100644 @@ -7,8 +7,8 @@ #include #include - + -int -main (void) +static int @@ -787,7 +787,7 @@ index d15e287..a7c5193 100644 FILE *fp; const char *str = "abcdef"; @@ -79,3 +79,6 @@ main (void) - + return result; } + @@ -799,8 +799,8 @@ index 179763e..acab72b 100644 +++ b/libio/tst-widetext.c @@ -31,8 +31,8 @@ #define SIZE 210000 - - + + -int -main (void) +static int @@ -809,7 +809,7 @@ index 179763e..acab72b 100644 char name[] = "/tmp/widetext.out.XXXXXX"; char mbbuf[SIZE]; @@ -367,3 +367,6 @@ main (void) - + return status; } + @@ -821,8 +821,8 @@ index ceda891..a4e8fcf 100644 +++ b/localedata/tst-ctype.c @@ -61,8 +61,8 @@ static struct classes } - - + + -int -main (void) +static int @@ -843,8 +843,8 @@ index 9b3ebcd..76356e9 100644 +++ b/localedata/tst-digits.c @@ -111,8 +111,8 @@ static struct wprintf_int_test (sizeof (wprintf_int_tests) / sizeof (wprintf_int_tests[0])) - - + + -int -main (void) +static int @@ -853,7 +853,7 @@ index 9b3ebcd..76356e9 100644 int cnt; int failures; @@ -246,3 +246,6 @@ main (void) - + return status; } + @@ -866,16 +866,16 @@ index 7a4b557..ccd44f2 100644 @@ -1,8 +1,8 @@ #include #include - + -int -main (void) +static int +do_test (void) { int cnt; - + @@ -16,3 +16,6 @@ main (void) - + return 0; } + @@ -888,7 +888,7 @@ index 14f1372..1404829 100644 @@ -33,8 +33,8 @@ } \ putc ('\n', stdout) - + -int -main (void) +static int @@ -897,7 +897,7 @@ index 14f1372..1404829 100644 const unsigned char buf[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb }; mbstate_t state; @@ -60,3 +60,6 @@ main (void) - + return result; } + @@ -910,7 +910,7 @@ index 25fa951..9cd95d6 100644 @@ -35,8 +35,8 @@ } \ putc ('\n', stdout) - + -int -main (void) +static int @@ -919,7 +919,7 @@ index 25fa951..9cd95d6 100644 unsigned char buf[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb }; mbstate_t state; @@ -62,3 +62,6 @@ main (void) - + return result; } + @@ -932,7 +932,7 @@ index 8db65c5..a068541 100644 @@ -38,8 +38,8 @@ putc ('\n', stdout); \ } - + -int -main (void) +static int @@ -941,7 +941,7 @@ index 8db65c5..a068541 100644 unsigned char buf[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const unsigned char bufcheck[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb }; @@ -73,3 +73,6 @@ main (void) - + return result; } + @@ -954,7 +954,7 @@ index 09b7417..a4fe60d 100644 @@ -34,8 +34,8 @@ } \ putc ('\n', stdout) - + -int -main (void) +static int @@ -963,7 +963,7 @@ index 09b7417..a4fe60d 100644 unsigned char buf[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb }; mbstate_t state; @@ -60,3 +60,6 @@ main (void) - + return result; } + @@ -976,7 +976,7 @@ index e18862c..c44f12a 100644 @@ -37,8 +37,8 @@ putc ('\n', stdout); \ } - + -int -main (void) +static int @@ -985,7 +985,7 @@ index e18862c..c44f12a 100644 unsigned char buf[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const unsigned char bufcheck[7] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb, 0 }; @@ -72,3 +72,6 @@ main (void) - + return result; } + @@ -998,7 +998,7 @@ index 1f8e68d..a09a4de 100644 @@ -3,8 +3,8 @@ #include #include - + -int -main (void) +static int @@ -1007,7 +1007,7 @@ index 1f8e68d..a09a4de 100644 char q[30]; char *s; @@ -23,3 +23,6 @@ main (void) - + return strcmp (s, "de_DE.UTF-8") != 0; } + @@ -1020,7 +1020,7 @@ index 5e09631..0b0be83 100644 @@ -24,8 +24,8 @@ #include #include - + -int -main (void) +static int @@ -1029,7 +1029,7 @@ index 5e09631..0b0be83 100644 char buf[30]; wchar_t wbuf[30]; @@ -68,3 +68,6 @@ main (void) - + return errors; } + @@ -1042,7 +1042,7 @@ index bd2b057..eb72030 100644 @@ -24,8 +24,8 @@ #include #include - + -int -main (void) +static int @@ -1051,7 +1051,7 @@ index bd2b057..eb72030 100644 wctype_t wct; wchar_t buf[1000]; @@ -141,3 +141,6 @@ main (void) - + return result; } + @@ -1063,8 +1063,8 @@ index 297c9ad..9f545a0 100644 +++ b/localedata/tst-xlocale1.c @@ -20,8 +20,8 @@ static struct #define ntests (sizeof (tests) / sizeof (tests[0])) - - + + -int -main (void) +static int @@ -1073,7 +1073,7 @@ index 297c9ad..9f545a0 100644 size_t cnt; int result = 0; @@ -73,3 +73,6 @@ main (void) - + return result; } + @@ -1086,16 +1086,16 @@ index 5078dac..65bb344 100644 @@ -66,8 +66,8 @@ test_einval (void) return ret; } - + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -76,3 +76,6 @@ main (void) - + return result; } + @@ -1107,8 +1107,8 @@ index 51e6c25..7ad5124 100644 +++ b/malloc/tst-calloc.c @@ -104,8 +104,8 @@ null_test (void) } - - + + -int -main (void) +static int @@ -1117,7 +1117,7 @@ index 51e6c25..7ad5124 100644 /* We are allocating blocks with `calloc' and check whether every block is completely cleared. We first try this for some fixed @@ -123,3 +123,6 @@ main (void) - + return 0; } + @@ -1130,7 +1130,7 @@ index a75ab1e..2685315 100644 @@ -29,8 +29,8 @@ merror (const char *msg) printf ("Error: %s\n", msg); } - + -int -main (void) +static int @@ -1139,7 +1139,7 @@ index a75ab1e..2685315 100644 void *p, *q; int save; @@ -75,3 +75,6 @@ main (void) - + return errors != 0; } + @@ -1152,7 +1152,7 @@ index 69c4500..539539e 100644 @@ -29,8 +29,8 @@ merror (const char *msg) printf ("Error: %s\n", msg); } - + -int -main (void) +static int @@ -1174,16 +1174,16 @@ index 478ca8c..bd9ab0e 100644 @@ -29,8 +29,8 @@ merror (const char *msg) printf ("Error: %s\n", msg); } - + -int -main (void) +static int +do_test (void) { void *p, *q; - + @@ -88,3 +88,6 @@ main (void) - + return errors != 0; } + @@ -1195,8 +1195,8 @@ index 9b5151c..b2c0c2c 100644 +++ b/malloc/tst-mtrace.c @@ -30,8 +30,8 @@ static void print (const void *node, VISIT value, int level); static FILE *fp; - - + + -int -main (void) +static int @@ -1218,7 +1218,7 @@ index 769697f..ee1385d 100644 @@ -25,8 +25,8 @@ verbose_free (void *buf) printf ("free (%p)\n", buf); } - + -int -main (void) +static int @@ -1227,7 +1227,7 @@ index 769697f..ee1385d 100644 int result = 0; int align = 2; @@ -62,3 +62,6 @@ main (void) - + return result; } + @@ -1240,7 +1240,7 @@ index 3a538b2..6a551de 100644 @@ -102,8 +102,8 @@ mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE) return i * mpbpl + j; } - + -int -main (void) +static int @@ -1249,7 +1249,7 @@ index 3a538b2..6a551de 100644 mp1 ex, x, xt, e2, e3; int i; @@ -190,3 +190,6 @@ main (void) - + return failures == 0 ? 0 : 1; } + @@ -1262,7 +1262,7 @@ index 3442715..945bb7a 100644 @@ -144,8 +144,8 @@ mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE) return i * mpbpl + j; } - + -int -main (void) +static int @@ -1271,7 +1271,7 @@ index 3442715..945bb7a 100644 mp1 ex, x, xt, e2, e3; int i; @@ -227,3 +227,6 @@ main (void) - + return failures == 0 ? 0 : 1; } + @@ -1284,7 +1284,7 @@ index 5ad59b2..1f5e730 100644 @@ -141,8 +141,8 @@ mpn_bitsize (const mp_limb_t *SRC_PTR, mp_size_t SIZE) return i * mpbpl + j; } - + -int -main (void) +static int @@ -1293,7 +1293,7 @@ index 5ad59b2..1f5e730 100644 mp1 si, co, x, ox, xt, s2, c2, s3, c3; int i; @@ -277,3 +277,6 @@ main (void) - + return (sin_failures == 0 && cos_failures == 0) ? 0 : 1; } + @@ -1306,7 +1306,7 @@ index cd09a39..6983879 100644 @@ -12,10 +12,13 @@ matherr (struct exception *s) return 1; } - + -int -main (void) +static int @@ -1325,17 +1325,17 @@ index 3fd2bca..4801bfe 100644 +++ b/math/test-misc.c @@ -25,8 +25,8 @@ #include - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -1201,3 +1201,6 @@ main (void) - + return result; } + @@ -1348,16 +1348,16 @@ index fd2a1cb..66ef886 100644 @@ -21,8 +21,8 @@ #include #include - + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -48,3 +48,6 @@ main (void) - + return result; } + @@ -1369,17 +1369,17 @@ index 2501c8c..76a4125 100644 +++ b/math/tst-definitions.c @@ -21,8 +21,8 @@ #include - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -44,3 +44,6 @@ main (void) - + return result; } + @@ -1392,16 +1392,16 @@ index d8f33df..d6c05ad 100644 @@ -37,8 +37,8 @@ test (const char *input, const char *result) return retval; } - + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -67,3 +67,6 @@ main (void) - + return result != 0; } + @@ -1413,8 +1413,8 @@ index 303042d..11427a0 100644 +++ b/misc/tst-efgcvt.c @@ -200,8 +200,8 @@ special (void) } - - + + -int -main (void) +static int @@ -1423,7 +1423,7 @@ index 303042d..11427a0 100644 test (ecvt_tests, ecvt, "ecvt"); test (fcvt_tests, fcvt, "fcvt"); @@ -211,3 +211,6 @@ main (void) - + return error_count; } + @@ -1436,7 +1436,7 @@ index 78a34e9..ef93ac3 100644 @@ -20,8 +20,8 @@ #include #include - + -int -main (void) +static int @@ -1445,7 +1445,7 @@ index 78a34e9..ef93ac3 100644 int retval = 0; int i; @@ -62,3 +62,6 @@ main (void) - + return retval; } + @@ -1458,7 +1458,7 @@ index 6c19b22..d390f1d 100644 @@ -1,8 +1,8 @@ #include #include - + -int -main (void) +static int @@ -1467,7 +1467,7 @@ index 6c19b22..d390f1d 100644 int a = 1; int b = 2; @@ -29,3 +29,6 @@ main (void) - + return 0; } + @@ -1479,8 +1479,8 @@ index 6c25e01..e61d506 100644 +++ b/misc/tst-mntent2.c @@ -3,8 +3,8 @@ #include - - + + -int -main (void) +static int @@ -1489,7 +1489,7 @@ index 6c25e01..e61d506 100644 int result = 0; struct mntent mef; @@ -39,3 +39,6 @@ main (void) - + return result; } + @@ -1501,8 +1501,8 @@ index d0e7f05..4fc5f1f 100644 +++ b/nptl/tst-sem7.c @@ -31,8 +31,8 @@ remove_sem (int status, void *arg) } - - + + -int -main (void) +static int @@ -1511,7 +1511,7 @@ index d0e7f05..4fc5f1f 100644 sem_t *s; sem_t *s2; @@ -106,3 +106,6 @@ main (void) - + return 0; } + @@ -1523,8 +1523,8 @@ index 1aeb1e1..4d7197c 100644 +++ b/nptl/tst-sem8.c @@ -31,8 +31,8 @@ remove_sem (int status, void *arg) } - - + + -int -main (void) +static int @@ -1533,7 +1533,7 @@ index 1aeb1e1..4d7197c 100644 sem_t *s; int i; @@ -71,3 +71,6 @@ main (void) - + return 0; } + @@ -1545,8 +1545,8 @@ index 9727486..b7d81a9 100644 +++ b/nptl/tst-sem9.c @@ -31,8 +31,8 @@ remove_sem (int status, void *arg) } - - + + -int -main (void) +static int @@ -1555,7 +1555,7 @@ index 9727486..b7d81a9 100644 sem_t *s; int i; @@ -78,3 +78,6 @@ main (void) - + return 0; } + @@ -1567,8 +1567,8 @@ index 1620b5b..384f32b 100644 +++ b/nss/test-netdb.c @@ -356,8 +356,8 @@ setdb (const char *dbname) } - - + + -int -main (void) +static int @@ -1577,7 +1577,7 @@ index 1620b5b..384f32b 100644 /* setdb ("db"); @@ -376,3 +376,6 @@ main (void) - + return (error_count != 0); } + @@ -1589,8 +1589,8 @@ index ff2674c..021734d 100644 +++ b/posix/tst-fnmatch.c @@ -33,8 +33,8 @@ static char *flag_output (int flags); static char *escape (const char *str, size_t *reslenp, char **resbuf); - - + + -int -main (void) +static int @@ -1599,7 +1599,7 @@ index ff2674c..021734d 100644 char *linebuf = NULL; size_t linebuflen = 0; @@ -388,3 +388,6 @@ escape (const char *str, size_t *reslenp, char **resbufp) - + return resbuf; } + @@ -1612,7 +1612,7 @@ index 1393c3a..141a699 100644 @@ -19,8 +19,8 @@ #include #include - + -int -main (void) +static int @@ -1621,7 +1621,7 @@ index 1393c3a..141a699 100644 char *login; int errors = 0; @@ -55,3 +55,6 @@ main (void) - + return errors != 0; } + @@ -1633,8 +1633,8 @@ index 1c72357..39b5b24 100644 +++ b/posix/tst-gnuglob.c @@ -379,8 +379,8 @@ test_result (const char *fmt, int flags, glob_t *gl, const char *str[]) } - - + + -int -main (void) +static int @@ -1643,7 +1643,7 @@ index 1c72357..39b5b24 100644 glob_t gl; int errval; @@ -497,3 +497,6 @@ main (void) - + return result; } + @@ -1655,8 +1655,8 @@ index c03acf5..5e52b49 100644 +++ b/posix/tst-mmap.c @@ -6,8 +6,8 @@ #include - - + + -int -main (void) +static int @@ -1678,7 +1678,7 @@ index f968ec4..f0de063 100644 @@ -4,8 +4,8 @@ #include #include - + -int -main (void) +static int @@ -1687,7 +1687,7 @@ index f968ec4..f0de063 100644 struct in_addr addr4; struct in6_addr addr6; @@ -109,3 +109,6 @@ main (void) - + return result; } + @@ -1698,7 +1698,7 @@ index f35d3e7..87f6491 100644 --- a/rt/tst-timer.c +++ b/rt/tst-timer.c @@ -20,8 +20,8 @@ - + /* This file is only used if there is no other implementation and it should means that there is no implementation of POSIX timers. */ -int @@ -1720,9 +1720,9 @@ index fe57df6..8a7f1ae 100644 --- a/stdio-common/test-fseek.c +++ b/stdio-common/test-fseek.c @@ -19,8 +19,8 @@ - + #define TESTFILE "/tmp/test.dat" - + -int -main (void) +static int @@ -1744,7 +1744,7 @@ index d36cd61..1f1c88a 100644 @@ -49,8 +49,8 @@ read_data (FILE *stream) } } - + -int -main (void) +static int @@ -1764,9 +1764,9 @@ index a936c28..9cc56d7 100644 --- a/stdio-common/test-vfprintf.c +++ b/stdio-common/test-vfprintf.c @@ -36,8 +36,8 @@ const char *locs[] = - + char large[50000]; - + -int -main (void) +static int @@ -1775,7 +1775,7 @@ index a936c28..9cc56d7 100644 char buf[25]; size_t i; @@ -124,3 +124,6 @@ main (void) - + return res; } + @@ -1787,8 +1787,8 @@ index dcdabf3..030e684 100644 +++ b/stdio-common/tst-cookie.c @@ -63,8 +63,8 @@ cookieclose (void *cookie) } - - + + -int -main (void) +static int @@ -1797,7 +1797,7 @@ index dcdabf3..030e684 100644 cookie_io_functions_t fcts; char buf[1]; @@ -90,3 +90,6 @@ main (void) - + return errors != 0; } + @@ -1810,15 +1810,15 @@ index a0c8853..753df9f 100644 @@ -28,10 +28,13 @@ check (const char *name, FILE *stream, int fd) return sfd != fd; } - + -int -main (void) +static int +do_test (void) { return (check ("stdin", stdin, STDIN_FILENO) || - check ("stdout", stdout, STDOUT_FILENO) || - check ("stderr", stderr, STDERR_FILENO)); + check ("stdout", stdout, STDOUT_FILENO) || + check ("stderr", stderr, STDERR_FILENO)); } + +#define TEST_FUNCTION do_test () @@ -1829,8 +1829,8 @@ index 7f78fc1..052f1f9 100644 +++ b/stdio-common/tst-gets.c @@ -21,8 +21,8 @@ #include - - + + -int -main (void) +static int @@ -1839,7 +1839,7 @@ index 7f78fc1..052f1f9 100644 char buf[100]; int result = 0; @@ -61,3 +61,6 @@ main (void) - + return result; } + @@ -1851,8 +1851,8 @@ index 39e8fda..5151593 100644 +++ b/stdio-common/tst-obprintf.c @@ -4,8 +4,8 @@ #include - - + + -int -main (void) +static int @@ -1861,7 +1861,7 @@ index 39e8fda..5151593 100644 struct obstack ob; int n; @@ -40,3 +40,6 @@ main (void) - + return 0; } + @@ -1873,8 +1873,8 @@ index b809c2f..416b120 100644 +++ b/stdio-common/tst-perror.c @@ -24,8 +24,8 @@ #define WC_EXP_LEN (sizeof (WC_EXP) - 1) - - + + -int -main (void) +static int @@ -1883,7 +1883,7 @@ index b809c2f..416b120 100644 int fd; char fname[] = "/tmp/tst-perror.XXXXXX"; @@ -152,3 +152,6 @@ main (void) - + return result; } + @@ -1895,8 +1895,8 @@ index c4e911f..2fe373f 100644 +++ b/stdio-common/tst-sprintf.c @@ -4,8 +4,8 @@ #include - - + + -int -main (void) +static int @@ -1905,7 +1905,7 @@ index c4e911f..2fe373f 100644 char buf[100]; int result = 0; @@ -73,3 +73,6 @@ main (void) - + return result; } + @@ -1918,7 +1918,7 @@ index 422278d..0ddf15b 100644 @@ -3,8 +3,8 @@ #include #include - + -int -main (void) +static int @@ -1940,7 +1940,7 @@ index e54b23b..e927761 100644 @@ -22,8 +22,8 @@ #include #include - + -int -main (void) +static int @@ -1960,9 +1960,9 @@ index e65234b..ce62c6b 100644 --- a/stdio-common/tst-swprintf.c +++ b/stdio-common/tst-swprintf.c @@ -12,8 +12,8 @@ - + const char input[] = "\x8e\xa1g\x8e\xa2h\x8e\xa3i\x8e\xa4j"; - + -int -main (void) +static int @@ -1971,7 +1971,7 @@ index e65234b..ce62c6b 100644 wchar_t buf[1000]; #define nbuf (sizeof (buf) / sizeof (buf[0])) @@ -54,3 +54,6 @@ swprintf (.., .., L\"%ls\", \"%ls\") produced \"%ls\", not \"%ls\"\n", \ - + return result; } + @@ -1984,7 +1984,7 @@ index a3bd9fb..3b97064 100644 @@ -19,8 +19,8 @@ #include #include - + -int -main (void) +static int @@ -1993,7 +1993,7 @@ index a3bd9fb..3b97064 100644 const char *name; int retval = 0; @@ -48,3 +48,6 @@ main (void) - + return retval; } + @@ -2005,8 +2005,8 @@ index bbd8622..7200a82 100644 +++ b/stdio-common/tst-unbputc.c @@ -1,11 +1,14 @@ #include - - + + -int -main (void) +static int @@ -2014,7 +2014,7 @@ index bbd8622..7200a82 100644 { putc ('1', stderr); putc ('2', stderr); - + return 0; } + @@ -2027,7 +2027,7 @@ index abbeeb5..2a2acb5 100644 @@ -4,8 +4,8 @@ #include #include - + -int -main (void) +static int @@ -2036,7 +2036,7 @@ index abbeeb5..2a2acb5 100644 wchar_t tmp[3]; tmp[0] = '8'; @@ -20,3 +20,6 @@ main (void) - + return 0; } + @@ -2047,9 +2047,9 @@ index 3316d7e..b1de2f9 100644 --- a/stdlib/tst-environ.c +++ b/stdlib/tst-environ.c @@ -25,8 +25,8 @@ - + char putenv_val[100] = VAR "=some longer value"; - + -int -main (void) +static int @@ -2058,7 +2058,7 @@ index 3316d7e..b1de2f9 100644 int result = 0; const char *valp; @@ -219,3 +219,6 @@ main (void) - + return result; } + @@ -2069,18 +2069,18 @@ index c3748d6..b7948c5 100644 --- a/stdlib/tst-fmtmsg.c +++ b/stdlib/tst-fmtmsg.c @@ -7,8 +7,8 @@ - + #define MM_TEST 10 - + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -80,3 +80,6 @@ main (void) - + return result; } + @@ -2092,17 +2092,17 @@ index 265b9db..6e51dca 100644 +++ b/stdlib/tst-limits.c @@ -16,8 +16,8 @@ bitval (int bits) } - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -67,3 +67,6 @@ main (void) - + return result; } + @@ -2115,7 +2115,7 @@ index 3079b98..8b8fef4 100644 @@ -3,8 +3,8 @@ #include #include - + -int -main (void) +static int @@ -2124,7 +2124,7 @@ index 3079b98..8b8fef4 100644 time_t t = time (NULL); int i, ret = 0; @@ -111,3 +111,6 @@ main (void) - + return ret; } + @@ -2136,8 +2136,8 @@ index 52e1b96..973c62e 100644 +++ b/stdlib/tst-rand48.c @@ -8,8 +8,8 @@ #endif - - + + -int -main (void) +static int @@ -2146,7 +2146,7 @@ index 52e1b96..973c62e 100644 unsigned short int xs[3] = { 0x0001, 0x0012, 0x0123 }; unsigned short int lxs[7]; @@ -388,3 +388,6 @@ drand48() and erand48 in lines %d and %d produce different results\n", - + return result; } + @@ -2157,9 +2157,9 @@ index 47195d6..8fe0993 100644 --- a/stdlib/tst-random.c +++ b/stdlib/tst-random.c @@ -46,8 +46,8 @@ const unsigned int seed[3] = { 0x12344321U, 0xEE11DD22U, 0xFEDCBA98 }; - + void fail (const char *msg, int s, int i) __attribute__ ((__noreturn__)); - + -int -main (void) +static int @@ -2181,7 +2181,7 @@ index 0553b62..da840f3 100644 @@ -20,8 +20,8 @@ #include #include - + -int -main (void) +static int @@ -2203,7 +2203,7 @@ index eebd8f7..448102a 100644 @@ -534,8 +534,8 @@ static const struct ltest tests[] = /* Prototypes for local functions. */ static void expand (char *dst, int c); - + -int -main (void) +static int @@ -2225,7 +2225,7 @@ index 0c77254..93f1a56 100644 @@ -309,8 +309,8 @@ static const struct ltest tests[] = /* Prototypes for local functions. */ static void expand (char *dst, int c); - + -int -main (void) +static int @@ -2246,8 +2246,8 @@ index 61e2e4b..facc783 100644 +++ b/stdlib/tst-xpg-basename.c @@ -37,8 +37,8 @@ static struct }; - - + + -int -main (void) +static int @@ -2256,7 +2256,7 @@ index 61e2e4b..facc783 100644 size_t i = 0; int errors = 0; @@ -64,3 +64,6 @@ main (void) - + return errors; } + @@ -2269,7 +2269,7 @@ index 7ac1dd6..a64a1cc 100644 @@ -21,8 +21,8 @@ #include #include - + -int -main (void) +static int @@ -2278,7 +2278,7 @@ index 7ac1dd6..a64a1cc 100644 int failures = 0; int i; @@ -61,3 +61,6 @@ main (void) - + return failures; } + @@ -2289,16 +2289,16 @@ index cca704c..6c1c911 100644 --- a/string/tst-bswap.c +++ b/string/tst-bswap.c @@ -21,8 +21,8 @@ - + extern unsigned long long int wash (unsigned long long int a); - + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -71,3 +71,6 @@ wash (unsigned long long int a) regards the argument to the bswap_*() functions as constant. */ return a + 0; @@ -2312,8 +2312,8 @@ index 32d8863..0f8b1bd 100644 +++ b/string/tst-inlcall.c @@ -31,8 +31,8 @@ #include - - + + -int -main (void) +static int @@ -2335,7 +2335,7 @@ index 7e34aee..6fbef9f 100644 @@ -2,8 +2,8 @@ #include #include - + -int -main (void) +static int @@ -2344,7 +2344,7 @@ index 7e34aee..6fbef9f 100644 char buf[1] = { 0 }; int result = 0; @@ -21,3 +21,6 @@ main (void) - + return result; } + @@ -2356,17 +2356,17 @@ index 2ae2e29..f48cfc0 100644 +++ b/string/tst-strxfrm.c @@ -58,8 +58,8 @@ test (const char *locale) } - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -69,3 +69,6 @@ main (void) - + return result; } + @@ -2377,9 +2377,9 @@ index 24c9696..8d6721a 100644 --- a/sysdeps/x86_64/tst-audit10.c +++ b/sysdeps/x86_64/tst-audit10.c @@ -45,8 +45,8 @@ avx512_enabled (void) - + extern __m512i audit_test (__m512i, __m512i, __m512i, __m512i, - __m512i, __m512i, __m512i, __m512i); + __m512i, __m512i, __m512i, __m512i); -int -main (void) +static int @@ -2407,9 +2407,9 @@ index d00db99..0602aa2 100644 --- a/elf/tst-audit3.c +++ b/elf/tst-audit3.c @@ -7,8 +7,8 @@ - + extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i, - __m128i, __m128i, __m128i, __m128i); + __m128i, __m128i, __m128i, __m128i); -int -main (void) +static int @@ -2418,7 +2418,7 @@ index d00db99..0602aa2 100644 __m128i xmm = _mm_setzero_si128 (); __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm); @@ -18,3 +18,6 @@ main (void) - + return 0; } + @@ -2429,9 +2429,9 @@ index c4f1d5b..44d5123 100644 --- a/elf/tst-audit4.c +++ b/elf/tst-audit4.c @@ -25,8 +25,8 @@ avx_enabled (void) - + extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i, - __m256i, __m256i, __m256i, __m256i); + __m256i, __m256i, __m256i, __m256i); -int -main (void) +static int @@ -2459,9 +2459,9 @@ index 0094fee..225b4c8 100644 --- a/elf/tst-audit5.c +++ b/elf/tst-audit5.c @@ -7,8 +7,8 @@ - + extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i, - __m128i, __m128i, __m128i, __m128i); + __m128i, __m128i, __m128i, __m128i); -int -main (void) +static int @@ -2470,7 +2470,7 @@ index 0094fee..225b4c8 100644 __m128i xmm = _mm_setzero_si128 (); __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm); @@ -19,3 +19,6 @@ main (void) - + return 0; } + @@ -2482,8 +2482,8 @@ index fc3d78d..6690efe 100644 +++ b/time/tst-ftime_l.c @@ -6,8 +6,8 @@ #include - - + + -int -main (void) +static int @@ -2492,7 +2492,7 @@ index fc3d78d..6690efe 100644 locale_t l; locale_t old; @@ -124,3 +124,6 @@ main (void) - + return result; } + @@ -2504,8 +2504,8 @@ index fd87923..b3377ee 100644 +++ b/time/tst-getdate.c @@ -76,8 +76,8 @@ report_date_error (int err) } - - + + -int -main (void) +static int @@ -2527,7 +2527,7 @@ index 416a856..c147360 100644 @@ -3,8 +3,8 @@ #include #include - + -int -main (void) +static int @@ -2536,7 +2536,7 @@ index 416a856..c147360 100644 struct tm time_str, *tm; time_t t; @@ -68,3 +68,6 @@ main (void) - + return result; } + @@ -2549,7 +2549,7 @@ index 60d0e0b..c738e53 100644 @@ -17,8 +17,8 @@ struct tm expected[] = { .tm_sec = 5, .tm_mday = 1, .tm_year = 102, .tm_wday = 2 } }; - + -int -main (void) +static int @@ -2571,7 +2571,7 @@ index 019d92a..c1ea267 100644 @@ -28,8 +28,8 @@ struct "1999/02/25 15:18:12 dst=0 zone=EST" }, }; - + -int -main (void) +static int @@ -2580,7 +2580,7 @@ index 019d92a..c1ea267 100644 int result = 0; size_t cnt; @@ -116,3 +116,6 @@ main (void) - + return result; } + @@ -2592,17 +2592,17 @@ index 73552bb..bcd6cc8 100644 +++ b/time/tst-strptime2.c @@ -26,8 +26,8 @@ static const struct #define ntests (sizeof (tests) / sizeof (tests[0])) - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -57,3 +57,6 @@ main (void) - + return 0; } + @@ -2614,8 +2614,8 @@ index 9a8c648..75b57c1 100644 +++ b/time/tst-strptime3.c @@ -4,8 +4,8 @@ #include - - + + -int -main (void) +static int @@ -2624,7 +2624,7 @@ index 9a8c648..75b57c1 100644 int result = 0; struct tm tm; @@ -53,3 +53,6 @@ main (void) - + return 0; } + @@ -2635,8 +2635,8 @@ index d793622..dc34f2b 100644 --- a/wcsmbs/tst-btowc.c +++ b/wcsmbs/tst-btowc.c @@ -74,8 +74,8 @@ eof_test (void) - - + + /* Test the btowc() function for a few locales with known character sets. */ -int -main (void) @@ -2644,9 +2644,9 @@ index d793622..dc34f2b 100644 +do_test (void) { int result = 0; - + @@ -172,3 +172,6 @@ main (void) - + return result; } + @@ -2658,17 +2658,17 @@ index 3e1eb72..a30b619 100644 +++ b/wcsmbs/tst-mbrtowc.c @@ -151,8 +151,8 @@ utf8_test (void) } - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -230,3 +230,6 @@ check_ascii (const char *locname) - + return res != 0; } + @@ -2681,7 +2681,7 @@ index 8d7e2cb..405534d 100644 @@ -21,8 +21,8 @@ #include #include - + -int -main (void) +static int @@ -2703,7 +2703,7 @@ index 4cf2dd0..fd2ad56 100644 @@ -1,9 +1,12 @@ #include #include - + -int -main (void) +static int @@ -2721,17 +2721,17 @@ index 74765e7..4cf4aec 100644 +++ b/wcsmbs/tst-wcpncpy.c @@ -20,8 +20,8 @@ #include - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -74,3 +74,6 @@ main (void) - + return result; } + @@ -2743,17 +2743,17 @@ index 3f052f3..cad343e 100644 +++ b/wcsmbs/tst-wcrtomb.c @@ -26,8 +26,8 @@ static int check_ascii (const char *locname); - - + + -int -main (void) +static int +do_test (void) { int result = 0; - + @@ -92,3 +92,6 @@ check_ascii (const char *locname) - + return res != 0; } + @@ -2766,7 +2766,7 @@ index 60e64ad..8d4b8b5 100644 @@ -27,8 +27,8 @@ printf ("wcsnlen (L\"%s\", %d) = %d, not %d\n", Str, Max, n, Exp); \ } - + -int -main (void) +static int @@ -2775,7 +2775,7 @@ index 60e64ad..8d4b8b5 100644 int result = 0; int n; @@ -48,3 +48,6 @@ main (void) - + return result; } + @@ -2788,7 +2788,7 @@ index 197cb5c..576a58c 100644 @@ -4,8 +4,8 @@ #include #include - + -int -main (void) +static int @@ -2797,7 +2797,7 @@ index 197cb5c..576a58c 100644 int result = 0; char buf[100]; @@ -21,3 +21,6 @@ main (void) - + return result; } + diff --git a/SOURCES/glibc-rh1298526-0.patch b/SOURCES/glibc-rh1298526-0.patch index ae6cf62a..e7f5809b 100644 --- a/SOURCES/glibc-rh1298526-0.patch +++ b/SOURCES/glibc-rh1298526-0.patch @@ -3,10 +3,10 @@ Author: Andrew Senkevich Date: Sat Dec 19 02:47:28 2015 +0300 Added memset optimized with AVX512 for KNL hardware. - + It shows improvement up to 28% over AVX2 memset (performance results attached at ). - + * sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S: New file. * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new file. * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests. @@ -22,14 +22,14 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c --- glibc-2.17-c758a686.orig/sysdeps/x86/cpu-features.c +++ glibc-2.17-c758a686/sysdeps/x86/cpu-features.c @@ -76,6 +76,8 @@ init_cpu_features (struct cpu_features * - - case 0x57: - /* Knights Landing. Enable Silvermont optimizations. */ + + case 0x57: + /* Knights Landing. Enable Silvermont optimizations. */ + cpu_features->feature[index_Prefer_No_VZEROUPPER] + |= bit_Prefer_No_VZEROUPPER; - - case 0x37: - case 0x4a: + + case 0x37: + case 0x4a: Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86/cpu-features.h @@ -39,15 +39,15 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h #define bit_AVX512DQ_Usable (1 << 13) #define bit_Prefer_MAP_32BIT_EXEC (1 << 16) +#define bit_Prefer_No_VZEROUPPER (1 << 17) - + /* CPUID Feature flags. */ - + @@ -93,6 +94,7 @@ # define index_AVX512F_Usable FEATURE_INDEX_1*FEATURE_SIZE # define index_AVX512DQ_Usable FEATURE_INDEX_1*FEATURE_SIZE # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1*FEATURE_SIZE +# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE - + # if defined (_LIBC) && !IS_IN (nonlib) # ifdef __x86_64__ @@ -270,6 +272,7 @@ extern const struct cpu_features *__get_ @@ -55,17 +55,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h # define index_AVX512DQ_Usable FEATURE_INDEX_1 # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1 +# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1 - + #endif /* !__ASSEMBLER__ */ - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/Makefile +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile @@ -16,7 +16,8 @@ sysdep_routines += strncat-c stpncpy-c s - strcat-sse2-unaligned strncat-sse2-unaligned \ - strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ - strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ + strcat-sse2-unaligned strncat-sse2-unaligned \ + strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ + strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ - memcmp-ssse3 strstr-sse2-unaligned + memcmp-ssse3 strstr-sse2-unaligned \ + memset-avx512-no-vzeroupper @@ -82,12 +82,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c #include +#include #include "init-arch.h" - + /* Maximum number of IFUNC implementations. */ @@ -66,12 +67,24 @@ __libc_ifunc_impl_list (const char *name IFUNC_IMPL (i, name, __memset_chk, - IFUNC_IMPL_ADD (array, i, __memset_chk, 1, __memset_chk_sse2) - IFUNC_IMPL_ADD (array, i, __memset_chk, 1, + IFUNC_IMPL_ADD (array, i, __memset_chk, 1, __memset_chk_sse2) + IFUNC_IMPL_ADD (array, i, __memset_chk, 1, - __memset_chk_x86_64)) + __memset_chk_x86_64) +#ifdef HAVE_AVX512_ASM_SUPPORT @@ -96,10 +96,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c + __memset_chk_avx512_no_vzeroupper) +#endif + ) - + /* Support sysdeps/x86_64/multiarch/memset.S. */ IFUNC_IMPL (i, name, memset, - IFUNC_IMPL_ADD (array, i, memset, 1, __memset_sse2) + IFUNC_IMPL_ADD (array, i, memset, 1, __memset_sse2) - IFUNC_IMPL_ADD (array, i, memset, 1, __memset_x86_64)) + IFUNC_IMPL_ADD (array, i, memset, 1, __memset_x86_64) +#ifdef HAVE_AVX512_ASM_SUPPORT @@ -108,7 +108,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c + __memset_avx512_no_vzeroupper) +#endif + ) - + /* Support sysdeps/x86_64/multiarch/rawmemchr.S. */ IFUNC_IMPL (i, name, rawmemchr, Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S @@ -315,9 +315,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memset.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S @@ -29,6 +29,13 @@ ENTRY(memset) - HAS_ARCH_FEATURE (Prefer_SSE_for_memop) - jz 2f - leaq __memset_sse2(%rip), %rax + HAS_ARCH_FEATURE (Prefer_SSE_for_memop) + jz 2f + leaq __memset_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) + jz 2f @@ -327,15 +327,15 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset.S +#endif 2: ret END(memset) - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memset_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S @@ -30,6 +30,13 @@ ENTRY(__memset_chk) - HAS_ARCH_FEATURE (Prefer_SSE_for_memop) - jz 2f - leaq __memset_chk_sse2(%rip), %rax + HAS_ARCH_FEATURE (Prefer_SSE_for_memop) + jz 2f + leaq __memset_chk_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) + jz 2f @@ -345,3 +345,4 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memset_chk.S +#endif 2: ret END(__memset_chk) + diff --git a/SOURCES/glibc-rh1298526-1.patch b/SOURCES/glibc-rh1298526-1.patch index 65110890..d364530b 100644 --- a/SOURCES/glibc-rh1298526-1.patch +++ b/SOURCES/glibc-rh1298526-1.patch @@ -27,9 +27,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/Makefile +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/Makefile @@ -17,7 +17,8 @@ sysdep_routines += strncat-c stpncpy-c s - strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ - strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ - memcmp-ssse3 strstr-sse2-unaligned \ + strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \ + strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \ + memcmp-ssse3 strstr-sse2-unaligned \ - memset-avx512-no-vzeroupper + memset-avx512-no-vzeroupper memcpy-avx512-no-vzeroupper \ + mempcpy-avx512-no-vzeroupper memmove-avx512-no-vzeroupper @@ -42,36 +42,36 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -24,7 +24,7 @@ #include "init-arch.h" - + /* Maximum number of IFUNC implementations. */ -#define MAX_IFUNC 4 +#define MAX_IFUNC 5 - + /* Fill ARRAY of MAX elements with IFUNC implementations for function NAME supported on target machine and return the number of valid @@ -46,8 +46,11 @@ __libc_ifunc_impl_list (const char *name - __memcmp_ssse3) - IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2)) - + __memcmp_ssse3) + IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2)) + - /* Support sysdeps/x86_64/multiarch/memmove_chk.S. */ + /* Support sysdeps/x86_64/multiarch/memmove_chk.c. */ IFUNC_IMPL (i, name, __memmove_chk, + IFUNC_IMPL_ADD (array, i, __memmove_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memmove_chk_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), + __memmove_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), @@ -57,6 +60,9 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/memmove.S. */ IFUNC_IMPL (i, name, memmove, + IFUNC_IMPL_ADD (array, i, memmove, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memmove_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3_back) - IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), + __memmove_ssse3_back) + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), @@ -263,6 +269,9 @@ __libc_ifunc_impl_list (const char *name #ifdef SHARED /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */ @@ -79,39 +79,39 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c + IFUNC_IMPL_ADD (array, i, __memcpy_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memcpy_chk_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), + __memcpy_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), @@ -274,11 +283,18 @@ __libc_ifunc_impl_list (const char *name IFUNC_IMPL (i, name, memcpy, - IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), - __memcpy_ssse3_back) + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), + __memcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), __memcpy_ssse3) + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), + __memcpy_ssse3) + IFUNC_IMPL_ADD (array, i, memcpy, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memcpy_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) - + IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */ IFUNC_IMPL (i, name, __mempcpy_chk, + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __mempcpy_chk_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), + __mempcpy_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), @@ -288,6 +304,9 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/mempcpy.S. */ IFUNC_IMPL (i, name, mempcpy, + IFUNC_IMPL_ADD (array, i, mempcpy, + HAS_ARCH_FEATURE (AVX512F_Usable), + __mempcpy_avx512_no_vzeroupper) - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), + __mempcpy_ssse3_back) + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S =================================================================== --- /dev/null @@ -531,8 +531,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S @@ -30,7 +30,15 @@ ENTRY(__new_memcpy) - .type __new_memcpy, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __new_memcpy, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - leaq __memcpy_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) @@ -543,17 +543,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy.S + ret +#endif +1: leaq __memcpy_sse2(%rip), %rax - HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __memcpy_ssse3(%rip), %rax + HAS_CPU_FEATURE (SSSE3) + jz 2f + leaq __memcpy_ssse3(%rip), %rax Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S @@ -30,7 +30,15 @@ ENTRY(__memcpy_chk) - .type __memcpy_chk, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __memcpy_chk, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - leaq __memcpy_chk_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) @@ -564,9 +564,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S + ret +#endif +1: leaq __memcpy_chk_sse2(%rip), %rax - HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __memcpy_chk_ssse3(%rip), %rax + HAS_CPU_FEATURE (SSSE3) + jz 2f + leaq __memcpy_chk_ssse3(%rip), %rax Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S =================================================================== --- /dev/null @@ -606,7 +606,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c +extern __typeof (__redirect_memmove) __memmove_avx512_no_vzeroupper attribute_hidden; +# endif #endif - + #include "string/memmove.c" @@ -47,10 +50,16 @@ extern __typeof (__redirect_memmove) __m ifunc symbol properly. */ @@ -620,13 +620,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove.c + : +#endif + (HAS_CPU_FEATURE (SSSE3) - ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) - ? __memmove_ssse3_back : __memmove_ssse3) + ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) + ? __memmove_ssse3_back : __memmove_ssse3) - : __memmove_sse2) + : __memmove_sse2)) - + strong_alias (__libc_memmove, memmove) - + Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/memmove_chk.c @@ -638,9 +638,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c +# ifdef HAVE_AVX512_ASM_SUPPORT +extern __typeof (__memmove_chk) __memmove_chk_avx512_no_vzeroupper attribute_hidden; +# endif - + #include "debug/memmove_chk.c" - + libc_ifunc (__memmove_chk, - HAS_CPU_FEATURE (SSSE3) +#ifdef HAVE_AVX512_ASM_SUPPORT @@ -650,8 +650,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memmove_chk.c + : +#endif + (HAS_CPU_FEATURE (SSSE3) - ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) - ? __memmove_chk_ssse3_back : __memmove_chk_ssse3) + ? (HAS_ARCH_FEATURE (Fast_Copy_Backward) + ? __memmove_chk_ssse3_back : __memmove_chk_ssse3) - : __memmove_chk_sse2); + : __memmove_chk_sse2)); Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S @@ -687,8 +687,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S @@ -28,7 +28,15 @@ ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __mempcpy, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - leaq __mempcpy_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) @@ -699,17 +699,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy.S + ret +#endif +1: leaq __mempcpy_sse2(%rip), %rax - HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __mempcpy_ssse3(%rip), %rax + HAS_CPU_FEATURE (SSSE3) + jz 2f + leaq __mempcpy_ssse3(%rip), %rax Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/mempcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S @@ -30,7 +30,15 @@ ENTRY(__mempcpy_chk) - .type __mempcpy_chk, @gnu_indirect_function - LOAD_RTLD_GLOBAL_RO_RDX + .type __mempcpy_chk, @gnu_indirect_function + LOAD_RTLD_GLOBAL_RO_RDX - leaq __mempcpy_chk_sse2(%rip), %rax +#ifdef HAVE_AVX512_ASM_SUPPORT + HAS_ARCH_FEATURE (AVX512F_Usable) @@ -720,6 +720,6 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/mempcpy_chk.S + ret +#endif +1: leaq __mempcpy_chk_sse2(%rip), %rax - HAS_CPU_FEATURE (SSSE3) - jz 2f - leaq __mempcpy_chk_ssse3(%rip), %rax + HAS_CPU_FEATURE (SSSE3) + jz 2f + leaq __mempcpy_chk_ssse3(%rip), %rax diff --git a/SOURCES/glibc-rh1298526-2.patch b/SOURCES/glibc-rh1298526-2.patch index 0993e051..51d08062 100644 --- a/SOURCES/glibc-rh1298526-2.patch +++ b/SOURCES/glibc-rh1298526-2.patch @@ -12,14 +12,14 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/memcpy_chk.S @@ -33,9 +33,9 @@ ENTRY(__memcpy_chk) #ifdef HAVE_AVX512_ASM_SUPPORT - HAS_ARCH_FEATURE (AVX512F_Usable) - jz 1f + HAS_ARCH_FEATURE (AVX512F_Usable) + jz 1f -# HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER) -# jz 1f - leaq __memcpy_avx512_no_vzeroupper(%rip), %rax + HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER) + jz 1f + leaq __memcpy_chk_avx512_no_vzeroupper(%rip), %rax - ret + ret #endif 1: leaq __memcpy_chk_sse2(%rip), %rax diff --git a/SOURCES/glibc-rh1298526-3.patch b/SOURCES/glibc-rh1298526-3.patch index 405143ff..80b7577f 100644 --- a/SOURCES/glibc-rh1298526-3.patch +++ b/SOURCES/glibc-rh1298526-3.patch @@ -12,71 +12,71 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c --- glibc-2.17-c758a686.orig/sysdeps/x86_64/multiarch/ifunc-impl-list.c +++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -48,9 +48,11 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/memmove_chk.c. */ IFUNC_IMPL (i, name, __memmove_chk, +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, __memmove_chk, - HAS_ARCH_FEATURE (AVX512F_Usable), - __memmove_chk_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, __memmove_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memmove_chk_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), - __memmove_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), + __memmove_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_CPU_FEATURE (SSSE3), @@ -60,9 +62,11 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/memmove.S. */ IFUNC_IMPL (i, name, memmove, +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, memmove, - HAS_ARCH_FEATURE (AVX512F_Usable), - __memmove_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, memmove, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memmove_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), - __memmove_ssse3_back) - IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), + __memmove_ssse3_back) + IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), @@ -269,9 +273,11 @@ __libc_ifunc_impl_list (const char *name #ifdef SHARED /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */ IFUNC_IMPL (i, name, __memcpy_chk, +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, __memcpy_chk, - HAS_ARCH_FEATURE (AVX512F_Usable), - __memcpy_chk_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, __memcpy_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memcpy_chk_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), - __memcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), + __memcpy_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_CPU_FEATURE (SSSE3), @@ -285,16 +291,20 @@ __libc_ifunc_impl_list (const char *name - __memcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), - __memcpy_ssse3) + __memcpy_ssse3_back) + IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), + __memcpy_ssse3) +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, memcpy, - HAS_ARCH_FEATURE (AVX512F_Usable), - __memcpy_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, memcpy, + HAS_ARCH_FEATURE (AVX512F_Usable), + __memcpy_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) - + IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2)) + /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */ IFUNC_IMPL (i, name, __mempcpy_chk, +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, - HAS_ARCH_FEATURE (AVX512F_Usable), - __mempcpy_chk_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, + HAS_ARCH_FEATURE (AVX512F_Usable), + __mempcpy_chk_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), - __mempcpy_chk_ssse3_back) - IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), + __mempcpy_chk_ssse3_back) + IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_CPU_FEATURE (SSSE3), @@ -304,9 +314,11 @@ __libc_ifunc_impl_list (const char *name - + /* Support sysdeps/x86_64/multiarch/mempcpy.S. */ IFUNC_IMPL (i, name, mempcpy, +#ifdef HAVE_AVX512_ASM_SUPPORT - IFUNC_IMPL_ADD (array, i, mempcpy, - HAS_ARCH_FEATURE (AVX512F_Usable), - __mempcpy_avx512_no_vzeroupper) + IFUNC_IMPL_ADD (array, i, mempcpy, + HAS_ARCH_FEATURE (AVX512F_Usable), + __mempcpy_avx512_no_vzeroupper) +#endif - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), - __mempcpy_ssse3_back) - IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), + __mempcpy_ssse3_back) + IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3), diff --git a/SOURCES/glibc-rh1298526-4.patch b/SOURCES/glibc-rh1298526-4.patch index 249da9e0..a0c92f1c 100644 --- a/SOURCES/glibc-rh1298526-4.patch +++ b/SOURCES/glibc-rh1298526-4.patch @@ -6,18 +6,18 @@ Author: Carlos O'Donell Date: Tue Jul 16 17:55:43 2013 -0400 BZ #15711: Avoid circular dependency for syscall.h - + The generated header is compiled with `-ffreestanding' to avoid any circular dependencies against the installed implementation headers. Such a dependency would require the implementation header to be installed before the generated header could be built (See bug 15711). In current practice the generated header dependencies do not include any of the implementation headers removed by the use of `-ffreestanding'. - + --- - + 2013-07-15 Carlos O'Donell - + [BZ #15711] * sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h): Avoid system header dependency with -ffreestanding. @@ -38,24 +38,24 @@ index f580635..94916a2 100644 +# installed before the generated header could be built (See bug 15711). +# In current practice the generated header dependencies do not include +# any of the implementation headers removed by the use of `-ffreestanding'. - + $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h - $(make-target-directory) + $(make-target-directory) @@ -64,7 +71,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/ - echo ''; \ - $(if $(abi-variants), \ - $(foreach v,$(abi-variants),\ + echo ''; \ + $(if $(abi-variants), \ + $(foreach v,$(abi-variants),\ - $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ + $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ - -x c $(sysincludes) $< $(abi-$(v)-options) \ - -D_LIBC -dM | \ - sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ + -x c $(sysincludes) $< $(abi-$(v)-options) \ + -D_LIBC -dM | \ + sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ @@ -75,7 +82,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/ - $(if $(abi-$(v)-condition),echo '#endif';) \ - rm -f $(@:.d=.h).new$(v); \ - ), \ + $(if $(abi-$(v)-condition),echo '#endif';) \ + rm -f $(@:.d=.h).new$(v); \ + ), \ - $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ + $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ - -x c $(sysincludes) $< \ - -D_LIBC -dM | \ - sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ + -x c $(sysincludes) $< \ + -D_LIBC -dM | \ + sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ diff --git a/SOURCES/glibc-rh1298975.patch b/SOURCES/glibc-rh1298975.patch index cf0e5ee6..f2495afe 100644 --- a/SOURCES/glibc-rh1298975.patch +++ b/SOURCES/glibc-rh1298975.patch @@ -13,15 +13,15 @@ Date: Mon Jul 18 09:33:21 2016 -0300 --- glibc-2.17-c758a686/grp/Makefile +++ glibc-2.17-c758a686/grp/Makefile @@ -23,7 +23,8 @@ - + routines := fgetgrent initgroups setgroups \ - getgrent getgrgid getgrnam putgrent \ + getgrent getgrgid getgrnam putgrent \ - getgrent_r getgrgid_r getgrnam_r fgetgrent_r + getgrent_r getgrgid_r getgrnam_r fgetgrent_r \ + grp-merge - + include ../Makeconfig - + --- glibc-2.17-c758a686/grp/Versions +++ glibc-2.17-c758a686/grp/Versions @@ -28,4 +28,7 @@ @@ -35,11 +35,11 @@ Date: Mon Jul 18 09:33:21 2016 -0300 --- glibc-2.17-c758a686/grp/getgrgid_r.c +++ glibc-2.17-c758a686/grp/getgrgid_r.c @@ -18,6 +18,7 @@ - + #include - + +#include - + #define LOOKUP_TYPE struct group #define FUNCTION_NAME getgrgid @@ -25,5 +26,7 @@ @@ -48,22 +48,22 @@ Date: Mon Jul 18 09:33:21 2016 -0300 #define BUFLEN NSS_BUFLEN_GROUP +#define DEEPCOPY_FN __copy_grp +#define MERGE_FN __merge_grp - + #include --- glibc-2.17-c758a686/grp/getgrnam_r.c +++ glibc-2.17-c758a686/grp/getgrnam_r.c @@ -18,6 +18,7 @@ - + #include - + +#include - + #define LOOKUP_TYPE struct group #define FUNCTION_NAME getgrnam @@ -25,4 +26,7 @@ #define ADD_PARAMS const char *name #define ADD_VARIABLES name - + +#define DEEPCOPY_FN __copy_grp +#define MERGE_FN __merge_grp + @@ -310,17 +310,17 @@ Date: Mon Jul 18 09:33:21 2016 -0300 --- glibc-2.17-c758a686/manual/nss.texi +++ glibc-2.17-c758a686/manual/nss.texi @@ -180,7 +180,7 @@ - + The case of the keywords is insignificant. The @var{status} values are the results of a call to a lookup function of a specific -service. They mean +service. They mean: - + @ftable @samp @item success @@ -204,6 +204,50 @@ @end ftable - + @noindent +The @var{action} values mean: + @@ -367,54 +367,54 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + +@noindent If we have a line like - + @smallexample --- glibc-2.17-c758a686/nscd/getgrgid_r.c +++ glibc-2.17-c758a686/nscd/getgrgid_r.c @@ -17,6 +17,7 @@ - + #include - + +#include - + #define LOOKUP_TYPE struct group #define FUNCTION_NAME getgrgid @@ -25,6 +26,9 @@ #define ADD_VARIABLES gid #define BUFLEN NSS_BUFLEN_GROUP - + +#define DEEPCOPY_FN __copy_grp +#define MERGE_FN __merge_grp + /* We are nscd, so we don't want to be talking to ourselves. */ #undef USE_NSCD - + --- glibc-2.17-c758a686/nscd/getgrnam_r.c +++ glibc-2.17-c758a686/nscd/getgrnam_r.c @@ -17,6 +17,7 @@ - + #include - + +#include - + #define LOOKUP_TYPE struct group #define FUNCTION_NAME getgrnam @@ -24,6 +25,9 @@ #define ADD_PARAMS const char *name #define ADD_VARIABLES name - + +#define DEEPCOPY_FN __copy_grp +#define MERGE_FN __merge_grp + /* We are nscd, so we don't want to be talking to ourselves. */ #undef USE_NSCD - + --- glibc-2.17-c758a686/nss/getXXbyYY_r.c +++ glibc-2.17-c758a686/nss/getXXbyYY_r.c @@ -131,6 +131,52 @@ # define AF_VAL AF_INET #endif - + + +/* Set defaults for merge functions that haven't been defined. */ +#ifndef DEEPCOPY_FN @@ -463,7 +463,7 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + /* Type of the lookup function we need here. */ typedef enum nss_status (*lookup_function) (ADD_PARAMS, LOOKUP_TYPE *, char *, - size_t, int * H_ERRNO_PARM + size_t, int * H_ERRNO_PARM @@ -152,13 +198,16 @@ static service_user *startp; static lookup_function start_fct; @@ -484,9 +484,9 @@ Date: Mon Jul 18 09:33:21 2016 -0300 #ifdef USE_NSCD int nscd_status; @@ -278,9 +327,66 @@ - && errno == ERANGE) - break; - + && errno == ERANGE) + break; + + if (do_merge) + { + @@ -543,19 +543,19 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + } + no_more = __nss_next2 (&nip, REENTRANT_NAME_STRING, - REENTRANT2_NAME_STRING, &fct.ptr, status, 0); + REENTRANT2_NAME_STRING, &fct.ptr, status, 0); } + free (mergebuf); + mergebuf = NULL; - + #ifdef HANDLE_DIGITS_DOTS done: --- glibc-2.17-c758a686/nss/getnssent_r.c +++ glibc-2.17-c758a686/nss/getnssent_r.c @@ -79,7 +79,18 @@ else - status = DL_CALL_FCT (fct.f, (0)); - + status = DL_CALL_FCT (fct.f, (0)); + - no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, status, 0); + + /* This is a special-case. When [SUCCESS=merge] is in play, @@ -570,12 +570,12 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, status, 0); + if (is_last_nip) - *last_nip = *nip; + *last_nip = *nip; } @@ -175,8 +186,18 @@ - + do - { + { - no_more = __nss_next2 (nip, getent_func_name, NULL, &fct.ptr, - status, 0); + /* This is a special-case. When [SUCCESS=merge] is in play, @@ -590,21 +590,21 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + else + no_more = __nss_next2 (nip, getent_func_name, NULL, &fct.ptr, + status, 0); - - if (is_last_nip) - *last_nip = *nip; + + if (is_last_nip) + *last_nip = *nip; --- glibc-2.17-c758a686/nss/nsswitch.c +++ glibc-2.17-c758a686/nss/nsswitch.c @@ -712,6 +712,9 @@ - else if (line - name == 8 - && __strncasecmp (name, "CONTINUE", 8) == 0) - action = NSS_ACTION_CONTINUE; + else if (line - name == 8 + && __strncasecmp (name, "CONTINUE", 8) == 0) + action = NSS_ACTION_CONTINUE; + else if (line - name == 5 + && __strncasecmp (name, "MERGE", 5) == 0) + action = NSS_ACTION_MERGE; - else - goto finish; - + else + goto finish; + --- glibc-2.17-c758a686/nss/nsswitch.h +++ glibc-2.17-c758a686/nss/nsswitch.h @@ -32,7 +32,8 @@ @@ -615,3 +615,5 @@ Date: Mon Jul 18 09:33:21 2016 -0300 + NSS_ACTION_RETURN, + NSS_ACTION_MERGE } lookup_actions; + + diff --git a/SOURCES/glibc-rh1302086-1.patch b/SOURCES/glibc-rh1302086-1.patch index acc6523a..2ed2fdce 100644 --- a/SOURCES/glibc-rh1302086-1.patch +++ b/SOURCES/glibc-rh1302086-1.patch @@ -3,7 +3,7 @@ Author: Marcus Shawcroft Date: Tue Jan 7 16:16:35 2014 +0000 [AArch64] Fix FP_ROUNDMODE. - + [BZ #16387] Fix FP_ROUNDMODE to extract the correct bits from FPCR. diff --git a/ports/sysdeps/aarch64/fpu/fpu_control.h b/ports/sysdeps/aarch64/fpu/fpu_control.h @@ -25,11 +25,11 @@ index d21d00a..9bb94e5 100644 --- a/ports/sysdeps/aarch64/soft-fp/sfp-machine.h +++ b/ports/sysdeps/aarch64/soft-fp/sfp-machine.h @@ -47,7 +47,7 @@ - + #define _FP_DECL_EX fpu_control_t _fcw - + -#define FP_ROUNDMODE (_fcw & 0x3) +#define FP_ROUNDMODE (_fcw & _FPU_FPCR_RM_MASK) - + #define FP_RND_NEAREST FE_TONEAREST #define FP_RND_ZERO FE_TOWARDZERO diff --git a/SOURCES/glibc-rh1302086-10.patch b/SOURCES/glibc-rh1302086-10.patch index 0545de2b..f466f418 100644 --- a/SOURCES/glibc-rh1302086-10.patch +++ b/SOURCES/glibc-rh1302086-10.patch @@ -3,7 +3,7 @@ Author: Wilco Dijkstra Date: Mon Jun 23 17:15:41 2014 +0100 Add generic HAVE_RM_CTX implementation - + This patch adds a generic implementation of HAVE_RM_CTX using standard fenv calls. As a result math functions using SET_RESTORE_ROUND* macros do not suffer from a large slowdown on targets which do not implement @@ -13,34 +13,34 @@ Date: Mon Jun 23 17:15:41 2014 +0100 and libc_fe* inline functions - they could be updated to use SET_RESTORE_ROUND or improved to avoid expensive fenv manipulations across just a few FP instructions). - + libc_feholdsetround*_noex_ctx is added to enable better optimization of SET_RESTORE_ROUND_NOEX* implementations. - + Performance measurements on ARM and x86 of sin() show significant gains over the current default, fairly close to a highly optimized fenv_private: - + ARM x86 no fenv_private : 100% 100% generic HAVE_RM_CTX : 250% 350% fenv_private (CTX) : 250% 450% - + 2014-06-23 Will Newton - Wilco - - * sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX - implementation. Include get-rounding-mode.h. - [!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero. - [!libc_feholdsetround_noex_ctx]: Define - libc_feholdsetround_noex_ctx. - [!libc_feholdsetround_noexf_ctx]: Define - libc_feholdsetround_noexf_ctx. - [!libc_feholdsetround_noexl_ctx]: Define - libc_feholdsetround_noexl_ctx. - (libc_feholdsetround_ctx): New function. - (libc_feresetround_ctx): New function. - (libc_feholdsetround_noex_ctx): New function. - (libc_feresetround_noex_ctx): New function. + Wilco + + * sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX + implementation. Include get-rounding-mode.h. + [!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero. + [!libc_feholdsetround_noex_ctx]: Define + libc_feholdsetround_noex_ctx. + [!libc_feholdsetround_noexf_ctx]: Define + libc_feholdsetround_noexf_ctx. + [!libc_feholdsetround_noexl_ctx]: Define + libc_feholdsetround_noexl_ctx. + (libc_feholdsetround_ctx): New function. + (libc_feresetround_ctx): New function. + (libc_feholdsetround_noex_ctx): New function. + (libc_feresetround_noex_ctx): New function. diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h index 9b881a3..94c1e4a 100644 @@ -51,13 +51,13 @@ index 9b881a3..94c1e4a 100644 #include #include +#include - + /* The original fdlibm code used statements like: - n0 = ((*(int*)&one)>>29)^1; * index of high word * + n0 = ((*(int*)&one)>>29)^1; * index of high word * @@ -551,12 +552,26 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) # define libc_feresetround_noexl libc_fesetenvl #endif - + +#ifndef HAVE_RM_CTX +# define HAVE_RM_CTX 0 +#endif @@ -67,7 +67,7 @@ index 9b881a3..94c1e4a 100644 set/restore floating point state only if the state needed within the lexical block is different from the current state. This saves a lot of time when the floating point unit is much slower than the fixed point units. */ - + +# ifndef libc_feholdsetround_noex_ctx +# define libc_feholdsetround_noex_ctx libc_feholdsetround_ctx +# endif @@ -84,12 +84,12 @@ index 9b881a3..94c1e4a 100644 @@ -567,24 +582,80 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) # define libc_feresetround_noexl_ctx libc_fesetenvl_ctx # endif - + -# ifndef libc_feholdsetround_53bit_ctx -# define libc_feholdsetround_53bit_ctx libc_feholdsetround_ctx -# endif +#else - + -# ifndef libc_feresetround_53bit_ctx -# define libc_feresetround_53bit_ctx libc_feresetround_ctx -# endif @@ -97,7 +97,7 @@ index 9b881a3..94c1e4a 100644 + Avoid unnecessary rounding mode changes by first checking the + current rounding mode. Note the use of __glibc_unlikely is + important for performance. */ - + -# define SET_RESTORE_ROUND_GENERIC(RM,ROUNDFUNC,CLEANUPFUNC) \ - struct rm_ctx ctx __attribute__((cleanup(CLEANUPFUNC ## _ctx))); \ - ROUNDFUNC ## _ctx (&ctx, (RM)) @@ -163,7 +163,7 @@ index 9b881a3..94c1e4a 100644 +#ifndef libc_feresetround_53bit_ctx +# define libc_feresetround_53bit_ctx libc_feresetround_ctx #endif - + -/* Save and restore the rounding mode within a lexical block. */ +#define SET_RESTORE_ROUND_GENERIC(RM,ROUNDFUNC,CLEANUPFUNC) \ + struct rm_ctx ctx __attribute__((cleanup (CLEANUPFUNC ## _ctx))); \ @@ -173,13 +173,13 @@ index 9b881a3..94c1e4a 100644 + the value at the start of the block. The exception mode must be preserved. + Exceptions raised within the block must be set in the exception flags. + Non-stop mode may be enabled inside the block. */ - + #define SET_RESTORE_ROUND(RM) \ SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround, libc_feresetround) @@ -593,15 +664,21 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) #define SET_RESTORE_ROUNDL(RM) \ SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetroundl) - + -/* Save and restore the rounding mode within a lexical block, and also - the set of exceptions raised within the block may be discarded. */ +/* Set the rounding mode within a lexical block. Restore the rounding mode to @@ -187,7 +187,7 @@ index 9b881a3..94c1e4a 100644 + Exceptions raised within the block must be discarded, and exception flags + are restored to the value at the start of the block. + Non-stop mode may be enabled inside the block. */ - + #define SET_RESTORE_ROUND_NOEX(RM) \ - SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround, libc_feresetround_noex) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_noex, \ @@ -200,6 +200,6 @@ index 9b881a3..94c1e4a 100644 - SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetround_noexl) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_noexl, \ + libc_feresetround_noexl) - + /* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits. */ #define SET_RESTORE_ROUND_53BIT(RM) \ diff --git a/SOURCES/glibc-rh1302086-11.patch b/SOURCES/glibc-rh1302086-11.patch index 699e5a34..be5596e2 100644 --- a/SOURCES/glibc-rh1302086-11.patch +++ b/SOURCES/glibc-rh1302086-11.patch @@ -18,16 +18,16 @@ index 023c9d0..b13c030 100644 fpu_control_t fpcr; - fpu_fpsr_t fpsr; int round; - + _FPU_GETCW (fpcr); - _FPU_GETFPSR (fpsr); - ctx->env.__fpsr = fpsr; - + /* Check whether rounding modes are different. */ round = (fpcr ^ r) & _FPU_FPCR_RM_MASK; @@ -264,6 +261,33 @@ libc_feresetround_aarch64_ctx (struct rm_ctx *ctx) #define libc_feresetroundl_ctx libc_feresetround_aarch64_ctx - + static __always_inline void +libc_feholdsetround_noex_aarch64_ctx (struct rm_ctx *ctx, int r) +{ diff --git a/SOURCES/glibc-rh1302086-3.patch b/SOURCES/glibc-rh1302086-3.patch index 742a5f0c..ef5a9959 100644 --- a/SOURCES/glibc-rh1302086-3.patch +++ b/SOURCES/glibc-rh1302086-3.patch @@ -11,7 +11,7 @@ index dbf203d..7424952 100644 @@ -209,6 +209,61 @@ libc_feresetround_aarch64 (fenv_t *envp) #define libc_feresetroundf libc_feresetround_aarch64 #define libc_feresetroundl libc_feresetround_aarch64 - + +/* We have support for rounding mode context. */ +#define HAVE_RM_CTX 1 + @@ -68,5 +68,5 @@ index dbf203d..7424952 100644 +#define libc_feresetround_noexl_ctx libc_feresetround_noex_aarch64_ctx + #include_next - + #endif diff --git a/SOURCES/glibc-rh1302086-5.patch b/SOURCES/glibc-rh1302086-5.patch index 8b505584..53321523 100644 --- a/SOURCES/glibc-rh1302086-5.patch +++ b/SOURCES/glibc-rh1302086-5.patch @@ -13,17 +13,17 @@ index 531269f..b24f0ff 100644 { fpu_fpsr_t fpsr; + fpu_fpsr_t fpsr_new; - + excepts &= FE_ALL_EXCEPT; - + _FPU_GETFPSR (fpsr); - fpsr = (fpsr & ~FE_ALL_EXCEPT) | (fpsr & FE_ALL_EXCEPT & ~excepts); + fpsr_new = (fpsr & ~FE_ALL_EXCEPT) | (fpsr & FE_ALL_EXCEPT & ~excepts); - + - _FPU_SETFPSR (fpsr); + if (fpsr != fpsr_new) + _FPU_SETFPSR (fpsr_new); - + return 0; } diff --git a/ports/sysdeps/aarch64/fpu/fedisblxcpt.c b/ports/sysdeps/aarch64/fpu/fedisblxcpt.c @@ -36,19 +36,19 @@ index 719d52f..c43335c 100644 fpu_control_t fpcr; + fpu_control_t fpcr_new; int original_excepts; - + _FPU_GETCW (fpcr); @@ -31,9 +32,10 @@ fedisableexcept (int excepts) - + excepts &= FE_ALL_EXCEPT; - + - fpcr &= ~(excepts << FE_EXCEPT_SHIFT); + fpcr_new = fpcr & ~(excepts << FE_EXCEPT_SHIFT); - + - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); - + return original_excepts; } diff --git a/ports/sysdeps/aarch64/fpu/feenablxcpt.c b/ports/sysdeps/aarch64/fpu/feenablxcpt.c @@ -61,19 +61,19 @@ index 07a4bbb..70e413c 100644 fpu_control_t fpcr; + fpu_control_t fpcr_new; int original_excepts; - + _FPU_GETCW (fpcr); @@ -31,9 +32,10 @@ feenableexcept (int excepts) - + excepts &= FE_ALL_EXCEPT; - + - fpcr |= (excepts << FE_EXCEPT_SHIFT); + fpcr_new = fpcr | (excepts << FE_EXCEPT_SHIFT); - + - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); - + /* Trapping exceptions are optional in AArch64 the relevant enable bits in FPCR are RES0 hence the absence of support can be diff --git a/ports/sysdeps/aarch64/fpu/feholdexcpt.c b/ports/sysdeps/aarch64/fpu/feholdexcpt.c @@ -89,28 +89,28 @@ index 0514ac1..973ba4a 100644 + fpu_control_t fpcr_new; + fpu_fpsr_t fpsr; + fpu_fpsr_t fpsr_new; - + _FPU_GETCW (fpcr); envp->__fpcr = fpcr; @@ -32,14 +34,16 @@ feholdexcept (fenv_t *envp) envp->__fpsr = fpsr; - + /* Now set all exceptions to non-stop. */ - fpcr &= ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT); + fpcr_new = fpcr & ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT); - + /* And clear all exception flags. */ - fpsr &= ~FE_ALL_EXCEPT; + fpsr_new = fpsr & ~FE_ALL_EXCEPT; - + - _FPU_SETFPSR (fpsr); + if (fpsr != fpsr_new) + _FPU_SETFPSR (fpsr_new); - + - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); - + return 0; } diff --git a/ports/sysdeps/aarch64/fpu/fesetenv.c b/ports/sysdeps/aarch64/fpu/fesetenv.c @@ -126,15 +126,15 @@ index a2434e3..30193e9 100644 fpu_control_t updated_fpcr; + fpu_fpsr_t fpsr; + fpu_fpsr_t fpsr_new; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); - + - fpcr &= _FPU_RESERVED; - fpsr &= _FPU_FPSR_RESERVED; + fpcr_new = fpcr & _FPU_RESERVED; + fpsr_new = fpsr & _FPU_FPSR_RESERVED; - + if (envp == FE_DFL_ENV) { - fpcr |= _FPU_DEFAULT; @@ -156,25 +156,25 @@ index a2434e3..30193e9 100644 + fpcr_new |= envp->__fpcr & ~_FPU_RESERVED; + fpsr_new |= envp->__fpsr & ~_FPU_FPSR_RESERVED; } - + - _FPU_SETFPSR (fpsr); + if (fpsr != fpsr_new) + _FPU_SETFPSR (fpsr_new); - + - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); - + /* Trapping exceptions are optional in AArch64 the relevant enable bits in FPCR are RES0 hence the absence of support can be @@ -58,7 +62,7 @@ fesetenv (const fenv_t *envp) value. */ - + _FPU_GETCW (updated_fpcr); - if ((updated_fpcr & fpcr) != fpcr) + if ((updated_fpcr & fpcr_new) != fpcr_new) return 1; - + return 0; diff --git a/ports/sysdeps/aarch64/fpu/fesetround.c b/ports/sysdeps/aarch64/fpu/fesetround.c index 40a05f6..225096a 100644 @@ -185,7 +185,7 @@ index 40a05f6..225096a 100644 { fpu_control_t fpcr; + fpu_control_t fpcr_new; - + switch (round) { @@ -31,9 +32,10 @@ fesetround (int round) @@ -194,12 +194,12 @@ index 40a05f6..225096a 100644 _FPU_GETCW (fpcr); - fpcr = (fpcr & ~FE_TOWARDZERO) | round; + fpcr_new = (fpcr & ~FE_TOWARDZERO) | round; - + - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); return 0; - + default: diff --git a/ports/sysdeps/aarch64/fpu/fsetexcptflg.c b/ports/sysdeps/aarch64/fpu/fsetexcptflg.c index 49cd1e4..60bb1c9 100644 @@ -210,20 +210,20 @@ index 49cd1e4..60bb1c9 100644 { fpu_fpsr_t fpsr; + fpu_fpsr_t fpsr_new; - + /* Get the current environment. */ _FPU_GETFPSR (fpsr); - + /* Set the desired exception mask. */ - fpsr &= ~(excepts & FE_ALL_EXCEPT); - fpsr |= (*flagp & excepts & FE_ALL_EXCEPT); + fpsr_new = fpsr & ~(excepts & FE_ALL_EXCEPT); + fpsr_new |= (*flagp & excepts & FE_ALL_EXCEPT); - + /* Save state back to the FPU. */ - _FPU_SETFPSR (fpsr); + if (fpsr != fpsr_new) + _FPU_SETFPSR (fpsr_new); - + return 0; } diff --git a/SOURCES/glibc-rh1302086-6.patch b/SOURCES/glibc-rh1302086-6.patch index c7ad9010..a336dad8 100644 --- a/SOURCES/glibc-rh1302086-6.patch +++ b/SOURCES/glibc-rh1302086-6.patch @@ -18,19 +18,19 @@ index 6d64a9b..ac2f6fe 100644 fpu_fpsr_t fpsr; + fpu_fpsr_t fpsr_new; + int excepts; - + - /* Get the current exception state. */ + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); + excepts = fpsr & FE_ALL_EXCEPT; - + - /* Install new environment. */ - fesetenv (envp); + if ((envp != FE_DFL_ENV) && (envp != FE_NOMASK_ENV)) + { + fpcr_new = envp->__fpcr; + fpsr_new = envp->__fpsr | excepts; - + - /* Raise the saved exceptions. */ - feraiseexcept (fpsr & FE_ALL_EXCEPT); + if (fpcr != fpcr_new) @@ -76,6 +76,6 @@ index 6d64a9b..ac2f6fe 100644 + + if (excepts & (fpcr_new >> FE_EXCEPT_SHIFT)) + return feraiseexcept (excepts); - + return 0; } diff --git a/SOURCES/glibc-rh1302086-7.patch b/SOURCES/glibc-rh1302086-7.patch index de238061..4665299b 100644 --- a/SOURCES/glibc-rh1302086-7.patch +++ b/SOURCES/glibc-rh1302086-7.patch @@ -11,7 +11,7 @@ index 6a265e8..d5a890d 100644 @@ -24,11 +24,8 @@ #define _FPU_GETCW(fpcr) \ __asm__ __volatile__ ("mrs %0, fpcr" : "=r" (fpcr)) - + -#define _FPU_SETCW(fpcr) \ - { \ - __asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr)); \ @@ -19,6 +19,6 @@ index 6a265e8..d5a890d 100644 - } +#define _FPU_SETCW(fpcr) \ + __asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr)) - + #define _FPU_GETFPSR(fpsr) \ __asm__ __volatile__ ("mrs %0, fpsr" : "=r" (fpsr)) diff --git a/SOURCES/glibc-rh1302086-8.patch b/SOURCES/glibc-rh1302086-8.patch index 1f541ab9..e2248be4 100644 --- a/SOURCES/glibc-rh1302086-8.patch +++ b/SOURCES/glibc-rh1302086-8.patch @@ -17,7 +17,7 @@ index 7424952..a3f466b 100644 + fpu_control_t new_fpcr; + fpu_fpsr_t fpsr; + fpu_fpsr_t new_fpsr; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); @@ -69,7 +72,10 @@ libc_fesetround_aarch64 (int round) @@ -29,7 +29,7 @@ index 7424952..a3f466b 100644 + fpu_control_t new_fpcr; + fpu_fpsr_t fpsr; + fpu_fpsr_t new_fpsr; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); @@ -96,7 +102,7 @@ libc_feholdexcept_setround_aarch64 (fenv_t *envp, int round) @@ -38,7 +38,7 @@ index 7424952..a3f466b 100644 { - fpu_control_t fpsr; + fpu_fpsr_t fpsr; - + _FPU_GETFPSR (fpsr); return fpsr & ex & FE_ALL_EXCEPT; @@ -109,7 +115,8 @@ libc_fetestexcept_aarch64 (int ex) @@ -48,7 +48,7 @@ index 7424952..a3f466b 100644 - fpu_control_t fpcr, new_fpcr; + fpu_control_t fpcr; + fpu_control_t new_fpcr; - + _FPU_GETCW (fpcr); new_fpcr = envp->__fpcr; @@ -130,7 +137,10 @@ libc_fesetenv_aarch64 (const fenv_t *envp) @@ -61,7 +61,7 @@ index 7424952..a3f466b 100644 + fpu_fpsr_t fpsr; + fpu_fpsr_t new_fpsr; int excepts; - + _FPU_GETCW (fpcr); @@ -171,7 +181,8 @@ libc_feupdateenv_aarch64 (const fenv_t *envp) static __always_inline void @@ -70,7 +70,7 @@ index 7424952..a3f466b 100644 - fpu_control_t fpcr, fpsr; + fpu_control_t fpcr; + fpu_fpsr_t fpsr; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); @@ -193,7 +204,8 @@ libc_feholdsetround_aarch64 (fenv_t *envp, int round) @@ -80,9 +80,9 @@ index 7424952..a3f466b 100644 - fpu_control_t fpcr, round; + fpu_control_t fpcr; + int round; - + _FPU_GETCW (fpcr); - + @@ -215,7 +227,9 @@ libc_feresetround_aarch64 (fenv_t *envp) static __always_inline void libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r) @@ -91,6 +91,6 @@ index 7424952..a3f466b 100644 + fpu_control_t fpcr; + fpu_fpsr_t fpsr; + int round; - + _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); diff --git a/SOURCES/glibc-rh1302086-9.patch b/SOURCES/glibc-rh1302086-9.patch index 658221f0..4a1ef3e4 100644 --- a/SOURCES/glibc-rh1302086-9.patch +++ b/SOURCES/glibc-rh1302086-9.patch @@ -10,12 +10,12 @@ index 5c1615d..425b50e 100644 +++ b/ports/sysdeps/aarch64/fpu/get-rounding-mode.h @@ -32,7 +32,7 @@ get_rounding_mode (void) fpu_control_t fpcr; - + _FPU_GETCW (fpcr); - return fpcr & FE_TOWARDZERO; + return fpcr & _FPU_FPCR_RM_MASK; } - + #endif /* get-rounding-mode.h */ diff --git a/ports/sysdeps/aarch64/fpu/math_private.h b/ports/sysdeps/aarch64/fpu/math_private.h index a3f466b..023c9d0 100644 @@ -23,46 +23,46 @@ index a3f466b..023c9d0 100644 +++ b/ports/sysdeps/aarch64/fpu/math_private.h @@ -58,7 +58,7 @@ libc_fesetround_aarch64 (int round) _FPU_GETCW (fpcr); - + /* Check whether rounding modes are different. */ - round = (fpcr ^ round) & FE_TOWARDZERO; + round = (fpcr ^ round) & _FPU_FPCR_RM_MASK; - + /* Set new rounding mode if different. */ if (__glibc_unlikely (round != 0)) @@ -84,7 +84,7 @@ libc_feholdexcept_setround_aarch64 (fenv_t *envp, int round) - + /* Clear exception flags, set all exceptions to non-stop, and set new rounding mode. */ - new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | FE_TOWARDZERO); + new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | _FPU_FPCR_RM_MASK); new_fpcr |= round; new_fpsr = fpsr & ~FE_ALL_EXCEPT; - + @@ -190,7 +190,7 @@ libc_feholdsetround_aarch64 (fenv_t *envp, int round) envp->__fpsr = fpsr; - + /* Check whether rounding modes are different. */ - round = (fpcr ^ round) & FE_TOWARDZERO; + round = (fpcr ^ round) & _FPU_FPCR_RM_MASK; - + /* Set new rounding mode if different. */ if (__glibc_unlikely (round != 0)) @@ -210,7 +210,7 @@ libc_feresetround_aarch64 (fenv_t *envp) _FPU_GETCW (fpcr); - + /* Check whether rounding modes are different. */ - round = (envp->__fpcr ^ fpcr) & FE_TOWARDZERO; + round = (envp->__fpcr ^ fpcr) & _FPU_FPCR_RM_MASK; - + /* Restore the rounding mode if it was changed. */ if (__glibc_unlikely (round != 0)) @@ -236,7 +236,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r) ctx->env.__fpsr = fpsr; - + /* Check whether rounding modes are different. */ - round = (fpcr ^ r) & FE_TOWARDZERO; + round = (fpcr ^ r) & _FPU_FPCR_RM_MASK; ctx->updated_status = round != 0; - + /* Set the rounding mode if changed. */ diff --git a/SOURCES/glibc-rh1308728.patch b/SOURCES/glibc-rh1308728.patch index c91d10c4..e1f1e8c2 100644 --- a/SOURCES/glibc-rh1308728.patch +++ b/SOURCES/glibc-rh1308728.patch @@ -17,21 +17,22 @@ index f3b5f01..e59bb4e 100644 + && buf) { /* This might be an error or not. For architectures which have - no separate return value and error indicators we cannot - distinguish a return value of -1 from an error. Do it the + no separate return value and error indicators we cannot + distinguish a return value of -1 from an error. Do it the - hard way. We crash applications which pass in an invalid BUF - pointer. */ + hard way. We crash applications which pass in an invalid + non-NULL BUF pointer. Linux allows BUF to be NULL. */ #define touch(v) \ do { \ - clock_t temp = v; \ + clock_t temp = v; \ @@ -44,7 +45,8 @@ __times (struct tms *buf) touch (buf->tms_cutime); touch (buf->tms_cstime); - + - /* If we come here the memory is valid and the kernel did not + /* If we come here the memory is valid (or BUF is NULL, which is + * a valid condition for the kernel syscall) and the kernel did not - return an EFAULT error. Return the value given by the kernel. */ + return an EFAULT error. Return the value given by the kernel. */ } + diff --git a/SOURCES/glibc-rh1310530.patch b/SOURCES/glibc-rh1310530.patch index 20042ae8..e78ceb97 100644 --- a/SOURCES/glibc-rh1310530.patch +++ b/SOURCES/glibc-rh1310530.patch @@ -9,10 +9,10 @@ index f123add..ebc06e8 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -711,6 +711,7 @@ do_ftell_wide (_IO_FILE *fp) - return WEOF; - - offset += outstop - out; + return WEOF; + + offset += outstop - out; + free (out); - } - - /* We don't trust _IO_read_end to represent the current file offset + } + + /* We don't trust _IO_read_end to represent the current file offset diff --git a/SOURCES/glibc-rh1318877.patch b/SOURCES/glibc-rh1318877.patch index 832dd6c0..4b435aec 100644 --- a/SOURCES/glibc-rh1318877.patch +++ b/SOURCES/glibc-rh1318877.patch @@ -9,8 +9,8 @@ Date: Thu Apr 25 11:08:31 2013 -0700 +++ glibc-2.17-c758a686/sysdeps/generic/inttypes.h @@ -41,10 +41,6 @@ #endif - - + + -/* The ISO C99 standard specifies that these macros must only be - defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_FORMAT_MACROS @@ -21,18 +21,18 @@ Date: Thu Apr 25 11:08:31 2013 -0700 @@ -267,8 +263,6 @@ # define SCNuPTR __PRIPTR_PREFIX "u" # define SCNxPTR __PRIPTR_PREFIX "x" - + -#endif /* C++ && format macros */ - - + __BEGIN_DECLS - + --- glibc-2.17-c758a686/sysdeps/generic/stdint.h +++ glibc-2.17-c758a686/sysdeps/generic/stdint.h @@ -141,10 +141,6 @@ #endif - - + + -/* The ISO C99 standard specifies that in C++ implementations these - macros should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_LIMIT_MACROS @@ -43,20 +43,20 @@ Date: Thu Apr 25 11:08:31 2013 -0700 @@ -278,12 +274,6 @@ # define WINT_MIN (0u) # define WINT_MAX (4294967295u) - + -#endif /* C++ && limit macros */ - - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS - + /* Signed. */ # define INT8_C(c) c @@ -314,6 +304,4 @@ # define UINTMAX_C(c) c ## ULL # endif - + -#endif /* C++ && constant macros */ - #endif /* stdint.h */ diff --git a/SOURCES/glibc-rh1318890.patch b/SOURCES/glibc-rh1318890.patch index 1564e053..f091765b 100644 --- a/SOURCES/glibc-rh1318890.patch +++ b/SOURCES/glibc-rh1318890.patch @@ -3,18 +3,18 @@ Author: Florian Weimer Date: Tue Mar 29 11:27:32 2016 +0200 nss_db: Propagate ERANGE error if parse_line fails [BZ #19837] - + Reproducer (needs to run as root): - + perl -e \ 'print "large:x:999:" . join(",", map {"user$_"} (1 .. 135))."\n"' \ >> /etc/group cd /var/db make getent -s db group - + After the fix, the last command should list the "large" group. - + The magic number 135 has been chosen so that the line is shorter than 1024 bytes, but the pointers required to encode the member array will cross the threshold, triggering the bug. @@ -24,12 +24,13 @@ Index: b/nss/nss_db/db-XXX.c --- a/nss/nss_db/db-XXX.c +++ b/nss/nss_db/db-XXX.c @@ -284,8 +284,8 @@ CONCAT(_nss_db_get,ENTNAME_r) (struct ST - } - if (err < 0) - { + } + if (err < 0) + { - H_ERRNO_SET (HOST_NOT_FOUND); - status = NSS_STATUS_NOTFOUND; + H_ERRNO_SET (NETDB_INTERNAL); + status = NSS_STATUS_TRYAGAIN; - break; - } + break; + } + diff --git a/SOURCES/glibc-rh1320596.patch b/SOURCES/glibc-rh1320596.patch index 96e4bf18..09a0cfa9 100644 --- a/SOURCES/glibc-rh1320596.patch +++ b/SOURCES/glibc-rh1320596.patch @@ -3,14 +3,14 @@ Author: Florian Weimer Date: Fri Mar 25 11:49:51 2016 +0100 resolv: Always set *resplen2 out parameter in send_dg [BZ #19791] - + Since commit 44d20bca52ace85850012b0ead37b360e3ecd96e (Implement second fallback mode for DNS requests), there is a code path which returns early, before *resplen2 is initialized. This happens if the name server address is immediately recognized as invalid (because of lack of protocol support, or if it is a broadcast address such 255.255.255.255, or another invalid address). - + If this happens and *resplen2 was non-zero (which is the case if a previous query resulted in a failure), __libc_res_nquery would reuse an existing second answer buffer. This answer has been previously @@ -20,20 +20,20 @@ Date: Fri Mar 25 11:49:51 2016 +0100 although a successful resolution would have been possible if name servers have been switched and queries had proceeded along the search path. - + The above paragraph still simplifies the situation. Before glibc 2.23, if the second answer needed malloc, the stub resolver would still attempt to reuse the second answer, but this is not possible because __libc_res_nsearch has freed it, after the unsuccessful call to __libc_res_nquerydomain, and set the buffer pointer to NULL. This eventually leads to an assertion failure in __libc_res_nquery: - + /* Make sure both hp and hp2 are defined */ assert((hp != NULL) && (hp2 != NULL)); - + If assertions are disabled, the consequence is a NULL pointer dereference on the next line. - + Starting with glibc 2.23, as a result of commit e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca (CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665)), the second answer is always @@ -41,10 +41,10 @@ Date: Fri Mar 25 11:49:51 2016 +0100 with small responses as well because there is no buffer to reuse, as soon as there is a name resolution failure which triggers a search for an answer along the search path. - + This commit addresses the issue by ensuring that *resplen2 is initialized before the send_dg function returns. - + This commit also addresses a bug where an invalid second reply is incorrectly returned as a valid to the caller. @@ -53,9 +53,9 @@ Index: glibc-2.17-c758a686/resolv/res_send.c --- glibc-2.17-c758a686.orig/resolv/res_send.c +++ glibc-2.17-c758a686/resolv/res_send.c @@ -672,6 +672,18 @@ libresolv_hidden_def (res_nsend) - + /* Private */ - + +/* Close the resolver structure, assign zero to *RESPLEN2 if RESPLEN2 + is not NULL, and return zero. */ +static int @@ -73,8 +73,8 @@ Index: glibc-2.17-c758a686/resolv/res_send.c EXT(statp).nssocks[ns]. The function supports sending both IPv4 and @@ -1159,7 +1171,11 @@ send_dg(res_state statp, retry_reopen: - retval = reopen (statp, terrno, ns); - if (retval <= 0) + retval = reopen (statp, terrno, ns); + if (retval <= 0) - return retval; + { + if (resplen2 != NULL) @@ -82,128 +82,128 @@ Index: glibc-2.17-c758a686/resolv/res_send.c + return retval; + } retry: - evNowTime(&now); - evConsTime(&timeout, seconds, 0); + evNowTime(&now); + evConsTime(&timeout, seconds, 0); @@ -1172,8 +1188,6 @@ send_dg(res_state statp, - int recvresp2 = buf2 == NULL; - pfd[0].fd = EXT(statp).nssocks[ns]; - pfd[0].events = POLLOUT; + int recvresp2 = buf2 == NULL; + pfd[0].fd = EXT(statp).nssocks[ns]; + pfd[0].events = POLLOUT; - if (resplen2 != NULL) - *resplen2 = 0; wait: - if (need_recompute) { - recompute_resend: + if (need_recompute) { + recompute_resend: @@ -1181,9 +1195,7 @@ send_dg(res_state statp, - if (evCmpTime(finish, now) <= 0) { - poll_err_out: - Perror(statp, stderr, "poll", errno); + if (evCmpTime(finish, now) <= 0) { + poll_err_out: + Perror(statp, stderr, "poll", errno); - err_out: - __res_iclose(statp, false); - return (0); + return close_and_return_error (statp, resplen2); - } - evSubTime(&timeout, &finish, &now); - need_recompute = 0; + } + evSubTime(&timeout, &finish, &now); + need_recompute = 0; @@ -1230,7 +1242,9 @@ send_dg(res_state statp, - } - - *gotsomewhere = 1; + } + + *gotsomewhere = 1; - return (0); + if (resplen2 != NULL) + *resplen2 = 0; + return 0; - } - if (n < 0) { - if (errno == EINTR) + } + if (n < 0) { + if (errno == EINTR) @@ -1298,7 +1312,7 @@ send_dg(res_state statp, - - fail_sendmmsg: - Perror(statp, stderr, "sendmmsg", errno); + + fail_sendmmsg: + Perror(statp, stderr, "sendmmsg", errno); - goto err_out; + return close_and_return_error (statp, resplen2); - } - } - else + } + } + else @@ -1316,7 +1330,7 @@ send_dg(res_state statp, - if (errno == EINTR || errno == EAGAIN) - goto recompute_resend; - Perror(statp, stderr, "send", errno); + if (errno == EINTR || errno == EAGAIN) + goto recompute_resend; + Perror(statp, stderr, "send", errno); - goto err_out; + return close_and_return_error (statp, resplen2); - } - just_one: - if (nwritten != 0 || buf2 == NULL || single_request) + } + just_one: + if (nwritten != 0 || buf2 == NULL || single_request) @@ -1392,7 +1406,7 @@ send_dg(res_state statp, - goto wait; - } - Perror(statp, stderr, "recvfrom", errno); + goto wait; + } + Perror(statp, stderr, "recvfrom", errno); - goto err_out; + return close_and_return_error (statp, resplen2); - } - *gotsomewhere = 1; - if (__builtin_expect (*thisresplenp < HFIXEDSZ, 0)) { + } + *gotsomewhere = 1; + if (__builtin_expect (*thisresplenp < HFIXEDSZ, 0)) { @@ -1403,7 +1417,7 @@ send_dg(res_state statp, - (stdout, ";; undersized: %d\n", - *thisresplenp)); - *terrno = EMSGSIZE; + (stdout, ";; undersized: %d\n", + *thisresplenp)); + *terrno = EMSGSIZE; - goto err_out; + return close_and_return_error (statp, resplen2); - } - if ((recvresp1 || hp->id != anhp->id) - && (recvresp2 || hp2->id != anhp->id)) { + } + if ((recvresp1 || hp->id != anhp->id) + && (recvresp2 || hp2->id != anhp->id)) { @@ -1452,7 +1466,7 @@ send_dg(res_state statp, - ? *thisanssizp : *thisresplenp); - /* record the error */ - statp->_flags |= RES_F_EDNS0ERR; + ? *thisanssizp : *thisresplenp); + /* record the error */ + statp->_flags |= RES_F_EDNS0ERR; - goto err_out; + return close_and_return_error (statp, resplen2); - } + } #endif - if (!(statp->options & RES_INSECURE2) + if (!(statp->options & RES_INSECURE2) @@ -1504,10 +1518,10 @@ send_dg(res_state statp, - goto wait; - } - + goto wait; + } + - __res_iclose(statp, false); - /* don't retry if called from dig */ - if (!statp->pfcode) + /* don't retry if called from dig */ + if (!statp->pfcode) - return (0); + return close_and_return_error (statp, resplen2); + __res_iclose(statp, false); - } - if (anhp->rcode == NOERROR && anhp->ancount == 0 - && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { + } + if (anhp->rcode == NOERROR && anhp->ancount == 0 + && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { @@ -1529,6 +1543,8 @@ send_dg(res_state statp, - __res_iclose(statp, false); - // XXX if we have received one reply we could - // XXX use it and not repeat it over TCP... + __res_iclose(statp, false); + // XXX if we have received one reply we could + // XXX use it and not repeat it over TCP... + if (resplen2 != NULL) + *resplen2 = 0; - return (1); - } - /* Mark which reply we received. */ + return (1); + } + /* Mark which reply we received. */ @@ -1544,21 +1560,22 @@ send_dg(res_state statp, - __res_iclose (statp, false); - retval = reopen (statp, terrno, ns); - if (retval <= 0) + __res_iclose (statp, false); + retval = reopen (statp, terrno, ns); + if (retval <= 0) - return retval; + { + if (resplen2 != NULL) + *resplen2 = 0; + return retval; + } - pfd[0].fd = EXT(statp).nssocks[ns]; - } - } - goto wait; - } + pfd[0].fd = EXT(statp).nssocks[ns]; + } + } + goto wait; + } - /* - * All is well, or the error is fatal. Signal that the - * next nameserver ought not be tried. - */ + /* All is well. We have received both responses (if + two responses were requested). */ - return (resplen); + return (resplen); - } else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) { - /* Something went wrong. We can stop trying. */ - goto err_out; @@ -211,6 +211,6 @@ Index: glibc-2.17-c758a686/resolv/res_send.c + } else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) + /* Something went wrong. We can stop trying. */ + return close_and_return_error (statp, resplen2); - else { - /* poll should not have returned > 0 in this case. */ - abort (); + else { + /* poll should not have returned > 0 in this case. */ + abort (); diff --git a/SOURCES/glibc-rh1321993.patch b/SOURCES/glibc-rh1321993.patch index 078e294b..c229e3b9 100644 --- a/SOURCES/glibc-rh1321993.patch +++ b/SOURCES/glibc-rh1321993.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Tue Mar 29 12:57:56 2016 +0200 CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879] - + The defensive copy is not needed because the name may not alias the output buffer. @@ -17,16 +17,16 @@ index 2eb2f67..8f301a7 100644 int anslen; - char *qbuf; enum nss_status status; - + if (__res_maybe_init (&_res, 0) == -1) return NSS_STATUS_UNAVAIL; - + - qbuf = strdupa (name); - net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - + - anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, + anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); + 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); if (anslen < 0) { diff --git a/SOURCES/glibc-rh1322544.patch b/SOURCES/glibc-rh1322544.patch index 56e8fbb4..2c85dda5 100644 --- a/SOURCES/glibc-rh1322544.patch +++ b/SOURCES/glibc-rh1322544.patch @@ -3,7 +3,7 @@ Author: Andreas Schwab Date: Mon Dec 8 15:13:38 2014 +0100 Don't touch user-controlled stdio locks in forked child (bug 12847) - + The stdio locks for streams with the _IO_USER_LOCK flag should not be touched by internal code. @@ -11,9 +11,11 @@ Date: Mon Dec 8 15:13:38 2014 +0100 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/fork.c @@ -45,7 +45,8 @@ _IO_ITER i; - + for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i)) - _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock)); + if ((_IO_iter_file (i)->_flags & _IO_USER_LOCK) == 0) + _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock)); } + + diff --git a/SOURCES/glibc-rh1324427-1.patch b/SOURCES/glibc-rh1324427-1.patch index ae3aac70..76d1570a 100644 --- a/SOURCES/glibc-rh1324427-1.patch +++ b/SOURCES/glibc-rh1324427-1.patch @@ -3,23 +3,23 @@ Author: Stefan Liebler Date: Thu Mar 31 17:37:16 2016 +0200 S390: Save and restore fprs/vrs while resolving symbols. - + On s390, no fpr/vrs were saved while resolving a symbol via _dl_runtime_resolve/_dl_runtime_profile. - + According to the abi, the fpr-arguments are defined as call clobbered. In leaf-functions, gcc 4.9 and newer can use fprs for saving/restoring gprs instead of saving them to the stack. If gcc do this in one of the resolver-functions, then the floating point arguments of a library-function are invalid for the first library-function-call. Thus, this patch saves/restores the fprs around the resolving code. - + The same could occur for vector registers. Furthermore an ifunc-resolver could also clobber the vector/floating point argument registers. Thus this patch provides the further variants _dl_runtime_resolve_vx/ _dl_runtime_profile_vx, which are used if the kernel claims, that we run on a machine with vector registers. - + Furthermore, if _dl_runtime_profile calls _dl_call_pltexit, the pointers to inregs-/outregs-structs were setup invalid. Now they point to the correct location in the stack-frame. @@ -29,26 +29,26 @@ Date: Thu Mar 31 17:37:16 2016 +0200 On s390-32, an endless loop occurs if _dl_call_pltexit() should be called. Now, this code-path branches to this function instead of just after the preceding basr-instruction. - + ChangeLog: - - * sysdeps/s390/s390-32/dl-trampoline.S: Include dl-trampoline.h twice - to create a non-vector/vector version for _dl_runtime_resolve and - _dl_runtime_profile. Move implementation to ... - * sysdeps/s390/s390-32/dl-trampoline.h: ... here. - (_dl_runtime_resolve) Save and restore fpr/vrs. - (_dl_runtime_profile) Save and restore vrs and fix some issues - if _dl_call_pltexit is called. - * sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup): - Choose the correct resolver function if running on a machine with vx. - * sysdeps/s390/s390-64/dl-trampoline.S: Include dl-trampoline.h twice - to create a non-vector/vector version for _dl_runtime_resolve and - _dl_runtime_profile. Move implementation to ... - * sysdeps/s390/s390-64/dl-trampoline.h: ... here. - (_dl_runtime_resolve) Save and restore fpr/vrs. - (_dl_runtime_profile) Save and restore vrs and fix some issues - * sysdeps/s390/s390-64/dl-machine.h: (elf_machine_runtime_setup): - Choose the correct resolver function if running on a machine with vx. + + * sysdeps/s390/s390-32/dl-trampoline.S: Include dl-trampoline.h twice + to create a non-vector/vector version for _dl_runtime_resolve and + _dl_runtime_profile. Move implementation to ... + * sysdeps/s390/s390-32/dl-trampoline.h: ... here. + (_dl_runtime_resolve) Save and restore fpr/vrs. + (_dl_runtime_profile) Save and restore vrs and fix some issues + if _dl_call_pltexit is called. + * sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup): + Choose the correct resolver function if running on a machine with vx. + * sysdeps/s390/s390-64/dl-trampoline.S: Include dl-trampoline.h twice + to create a non-vector/vector version for _dl_runtime_resolve and + _dl_runtime_profile. Move implementation to ... + * sysdeps/s390/s390-64/dl-trampoline.h: ... here. + (_dl_runtime_resolve) Save and restore fpr/vrs. + (_dl_runtime_profile) Save and restore vrs and fix some issues + * sysdeps/s390/s390-64/dl-machine.h: (elf_machine_runtime_setup): + Choose the correct resolver function if running on a machine with vx. diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index 14bde3b..ec0ae4a 100644 @@ -63,27 +63,27 @@ index 14bde3b..ec0ae4a 100644 + extern void _dl_runtime_profile_vx (Elf32_Word); +#endif + - + if (l->l_info[DT_JMPREL] && lazy) { @@ -116,7 +121,14 @@ - end in this function. */ + end in this function. */ if (__builtin_expect (profile, 0)) - { + { +#if defined HAVE_S390_VX_ASM_SUPPORT + if (GLRO(dl_hwcap) & HWCAP_S390_VX) + got[2] = (Elf32_Addr) &_dl_runtime_profile_vx; + else + got[2] = (Elf32_Addr) &_dl_runtime_profile; +#else - got[2] = (Elf32_Addr) &_dl_runtime_profile; + got[2] = (Elf32_Addr) &_dl_runtime_profile; +#endif - - if (GLRO(dl_profile) != NULL - && _dl_name_match_p (GLRO(dl_profile), l)) + + if (GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), l)) @@ -125,9 +137,18 @@ - GL(dl_profile_map) = l; - } + GL(dl_profile_map) = l; + } else - /* This function will get called to fix up the GOT entry indicated by - the offset on the stack, and then jump to the resolved address. */ @@ -101,7 +101,7 @@ index 14bde3b..ec0ae4a 100644 +#endif + } } - + return lazy; diff --git a/sysdeps/s390/s390-32/dl-trampoline.S b/sysdeps/s390/s390-32/dl-trampoline.S index 1645610..859183c 100644 @@ -110,7 +110,7 @@ index 1645610..859183c 100644 @@ -16,130 +16,18 @@ License along with the GNU C Library; if not, see . */ - + -/* This code is used in dl-runtime.c to call the `fixup' function - and then redirect to the address it returns. */ - @@ -130,8 +130,8 @@ index 1645610..859183c 100644 - */ - #include - - .text + + .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, @function - cfi_startproc @@ -480,7 +480,7 @@ index cb81aaf..9ee7c92 100644 #include +#include #include - + #define ELF_MACHINE_IRELATIVE R_390_IRELATIVE @@ -78,6 +79,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) { @@ -490,27 +490,27 @@ index cb81aaf..9ee7c92 100644 + extern void _dl_runtime_resolve_vx (Elf64_Word); + extern void _dl_runtime_profile_vx (Elf64_Word); +#endif - + if (l->l_info[DT_JMPREL] && lazy) { @@ -105,7 +110,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) - end in this function. */ + end in this function. */ if (__builtin_expect (profile, 0)) - { + { +#if defined HAVE_S390_VX_ASM_SUPPORT + if (GLRO(dl_hwcap) & HWCAP_S390_VX) + got[2] = (Elf64_Addr) &_dl_runtime_profile_vx; + else + got[2] = (Elf64_Addr) &_dl_runtime_profile; +#else - got[2] = (Elf64_Addr) &_dl_runtime_profile; + got[2] = (Elf64_Addr) &_dl_runtime_profile; +#endif - - if (GLRO(dl_profile) != NULL - && _dl_name_match_p (GLRO(dl_profile), l)) + + if (GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), l)) @@ -114,9 +126,18 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) - GL(dl_profile_map) = l; - } + GL(dl_profile_map) = l; + } else - /* This function will get called to fix up the GOT entry indicated by - the offset on the stack, and then jump to the resolved address. */ @@ -528,7 +528,7 @@ index cb81aaf..9ee7c92 100644 +#endif + } } - + return lazy; diff --git a/sysdeps/s390/s390-64/dl-trampoline.S b/sysdeps/s390/s390-64/dl-trampoline.S index 6919ed0..1b0c9e2 100644 @@ -537,7 +537,7 @@ index 6919ed0..1b0c9e2 100644 @@ -16,126 +16,18 @@ License along with the GNU C Library; if not, see . */ - + -/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile - * with the following linkage: - * r2 - r6 : parameter registers @@ -554,8 +554,8 @@ index 6919ed0..1b0c9e2 100644 - */ - #include - - .text + + .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, @function - cfi_startproc diff --git a/SOURCES/glibc-rh1324427-2.patch b/SOURCES/glibc-rh1324427-2.patch index fe5f4674..9d6f9f18 100644 --- a/SOURCES/glibc-rh1324427-2.patch +++ b/SOURCES/glibc-rh1324427-2.patch @@ -3,25 +3,25 @@ Author: Stefan Liebler Date: Thu Mar 31 17:37:16 2016 +0200 S390: Extend structs La_s390_regs / La_s390_retval with vector-registers. - + Starting with z13, vector registers can also occur as argument registers. Thus the passed input/output register structs for la_s390_[32|64]_gnu_plt[enter|exit] functions should reflect those new registers. This patch extends these structs La_s390_regs and La_s390_retval and adjusts _dl_runtime_profile() to handle those fields in case of running on a z13 machine. - + ChangeLog: - - * sysdeps/s390/bits/link.h: (La_s390_vr) New typedef. - (La_s390_32_regs): Append vector register lr_v24-lr_v31. - (La_s390_64_regs): Likewise. - (La_s390_32_retval): Append vector register lrv_v24. - (La_s390_64_retval): Likeweise. - * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_profile): - Handle extended structs La_s390_32_regs and La_s390_32_retval. - * sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile): - Handle extended structs La_s390_64_regs and La_s390_64_retval. + + * sysdeps/s390/bits/link.h: (La_s390_vr) New typedef. + (La_s390_32_regs): Append vector register lr_v24-lr_v31. + (La_s390_64_regs): Likewise. + (La_s390_32_retval): Append vector register lrv_v24. + (La_s390_64_retval): Likeweise. + * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_profile): + Handle extended structs La_s390_32_regs and La_s390_32_retval. + * sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile): + Handle extended structs La_s390_64_regs and La_s390_64_retval. diff --git a/sysdeps/s390/bits/link.h b/sysdeps/s390/bits/link.h index 2ef7f44..e27ed67 100644 @@ -30,13 +30,13 @@ index 2ef7f44..e27ed67 100644 @@ -19,6 +19,9 @@ # error "Never include directly; use instead." #endif - + +#if defined HAVE_S390_VX_ASM_SUPPORT +typedef char La_s390_vr[16]; +#endif - + #if __ELF_NATIVE_CLASS == 32 - + @@ -32,6 +35,16 @@ typedef struct La_s390_32_regs uint32_t lr_r6; double lr_fp0; @@ -52,7 +52,7 @@ index 2ef7f44..e27ed67 100644 + La_s390_vr lr_v31; +# endif } La_s390_32_regs; - + /* Return values for calls from PLT on s390-32. */ @@ -40,6 +53,9 @@ typedef struct La_s390_32_retval uint32_t lrv_r2; @@ -62,8 +62,8 @@ index 2ef7f44..e27ed67 100644 + La_s390_vr lrv_v24; +# endif } La_s390_32_retval; - - + + @@ -77,6 +93,16 @@ typedef struct La_s390_64_regs double lr_fp2; double lr_fp4; @@ -79,7 +79,7 @@ index 2ef7f44..e27ed67 100644 + La_s390_vr lr_v31; +# endif } La_s390_64_regs; - + /* Return values for calls from PLT on s390-64. */ @@ -84,6 +110,9 @@ typedef struct La_s390_64_retval { @@ -89,15 +89,15 @@ index 2ef7f44..e27ed67 100644 + La_s390_vr lrv_v24; +# endif } La_s390_64_retval; - - + + diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h index a152a7b..bb74d27 100644 --- a/sysdeps/s390/s390-32/dl-trampoline.h +++ b/sysdeps/s390/s390-32/dl-trampoline.h @@ -112,28 +112,31 @@ _dl_runtime_resolve: - cfi_startproc - .align 16 + cfi_startproc + .align 16 _dl_runtime_profile: - stm %r2,%r6,32(%r15) # save registers - cfi_offset (r2, -64) # + r6 needed as arg for @@ -109,12 +109,12 @@ index a152a7b..bb74d27 100644 - cfi_offset (f0, -40) - std %f2,64(%r15) - cfi_offset (f2, -32) - st %r12,12(%r15) # r12 is used as backup of r15 - cfi_offset (r12, -84) - st %r14,16(%r15) - cfi_offset (r14, -80) - lr %r12,%r15 # backup stack pointer - cfi_def_cfa_register (12) + st %r12,12(%r15) # r12 is used as backup of r15 + cfi_offset (r12, -84) + st %r14,16(%r15) + cfi_offset (r14, -80) + lr %r12,%r15 # backup stack pointer + cfi_def_cfa_register (12) + ahi %r15,-264 # create stack frame: + # 96 + sizeof(La_s390_32_regs) + st %r12,0(%r15) # save backchain @@ -131,72 +131,72 @@ index a152a7b..bb74d27 100644 + cfi_offset (f2, -232) #ifdef RESTORE_VRS - ahi %r15,-224 # create stack frame - .machine push - .machine "z13" - .machinemode "zarch_nohighgprs" + .machine push + .machine "z13" + .machinemode "zarch_nohighgprs" - vstm %v24,%v31,96(%r15) # store call-clobbered vr arguments + vstm %v24,%v31,136(%r15) # store call-clobbered vr arguments - cfi_offset (v24, -224) - cfi_offset (v25, -208) - cfi_offset (v26, -192) + cfi_offset (v24, -224) + cfi_offset (v25, -208) + cfi_offset (v26, -192) @@ -143,31 +146,31 @@ _dl_runtime_profile: - cfi_offset (v30, -128) - cfi_offset (v31, -112) - .machine pop + cfi_offset (v30, -128) + cfi_offset (v31, -112) + .machine pop -#else - ahi %r15,-96 # create stack frame #endif - st %r12,0(%r15) # save backchain + - lm %r2,%r3,24(%r12) # load arguments saved by PLT - lr %r4,%r14 # return address as third parameter - basr %r1,0 + lm %r2,%r3,24(%r12) # load arguments saved by PLT + lr %r4,%r14 # return address as third parameter + basr %r1,0 0: l %r14,6f-0b(%r1) - la %r5,32(%r12) # pointer to struct La_s390_32_regs + la %r5,96(%r15) # pointer to struct La_s390_32_regs - la %r6,20(%r12) # long int * framesize - bas %r14,0(%r14,%r1) # call resolver - lr %r1,%r2 # function addr returned in r2 + la %r6,20(%r12) # long int * framesize + bas %r14,0(%r14,%r1) # call resolver + lr %r1,%r2 # function addr returned in r2 - ld %f0,56(%r12) # restore call-clobbered arg fprs - ld %f2,64(%r12) + ld %f0,120(%r15) # restore call-clobbered arg fprs + ld %f2,128(%r15) #ifdef RESTORE_VRS - .machine push - .machine "z13" - .machinemode "zarch_nohighgprs" + .machine push + .machine "z13" + .machinemode "zarch_nohighgprs" - vlm %v24,%v31,96(%r15) # restore call-clobbered arg vrs + vlm %v24,%v31,136(%r15) # restore call-clobbered arg vrs - .machine pop + .machine pop #endif - icm %r0,15,20(%r12) # load & test framesize - jnm 2f - + icm %r0,15,20(%r12) # load & test framesize + jnm 2f + - lm %r2,%r6,32(%r12) + lm %r2,%r6,96(%r15) # framesize < 0 means no pltexit call + # so we can do a tail call without + # copying the arg overflow area - lr %r15,%r12 # remove stack frame - cfi_def_cfa_register (15) - l %r14,16(%r15) # restore registers + lr %r15,%r12 # remove stack frame + cfi_def_cfa_register (15) + l %r14,16(%r15) # restore registers @@ -175,7 +178,9 @@ _dl_runtime_profile: - br %r1 # tail-call to the resolved function - - cfi_def_cfa_register (12) + br %r1 # tail-call to the resolved function + + cfi_def_cfa_register (12) -2: jz 4f # framesize == 0 ? +2: la %r4,96(%r15) # pointer to struct La_s390_32_regs + st %r4,32(%r12) + jz 4f # framesize == 0 ? - ahi %r0,7 # align framesize to 8 - lhi %r2,-8 - nr %r0,%r2 + ahi %r0,7 # align framesize to 8 + lhi %r2,-8 + nr %r0,%r2 @@ -188,24 +193,35 @@ _dl_runtime_profile: - la %r2,8(%r2) - la %r3,8(%r3) - brct %r0,3b + la %r2,8(%r2) + la %r3,8(%r3) + brct %r0,3b -4: lm %r2,%r6,32(%r12) # load register parameters +4: lm %r2,%r6,0(%r4) # load register parameters - basr %r14,%r1 # call resolved function + basr %r14,%r1 # call resolved function - stm %r2,%r3,72(%r12) # store return values r2, r3, f0 - std %f0,80(%r12) # to struct La_s390_32_retval - lm %r2,%r3,24(%r12) # load arguments saved by PLT @@ -210,17 +210,17 @@ index a152a7b..bb74d27 100644 +#endif + lm %r2,%r4,24(%r12) # r2, r3: load arguments saved by PLT + # r4: pointer to struct La_s390_32_regs - basr %r1,0 + basr %r1,0 5: l %r14,7f-5b(%r1) - la %r4,32(%r12) # pointer to struct La_s390_32_regs - la %r5,72(%r12) # pointer to struct La_s390_32_retval + la %r5,40(%r12) # pointer to struct La_s390_32_retval - bas %r14,0(%r14,%r1) # call _dl_call_pltexit - - lr %r15,%r12 # remove stack frame - cfi_def_cfa_register (15) - l %r14,16(%r15) # restore registers - l %r12,12(%r15) + bas %r14,0(%r14,%r1) # call _dl_call_pltexit + + lr %r15,%r12 # remove stack frame + cfi_def_cfa_register (15) + l %r14,16(%r15) # restore registers + l %r12,12(%r15) - l %r2,72(%r15) # restore return values - l %r3,76(%r15) - ld %f0,80(%r15) @@ -232,16 +232,16 @@ index a152a7b..bb74d27 100644 + vl %v24,56(%r15) # restore return value v24 + .machine pop +#endif - br %r14 - + br %r14 + 6: .long _dl_profile_fixup - 0b diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h index 658e3a3..33ea3de 100644 --- a/sysdeps/s390/s390-64/dl-trampoline.h +++ b/sysdeps/s390/s390-64/dl-trampoline.h @@ -109,31 +109,34 @@ _dl_runtime_resolve: - cfi_startproc - .align 16 + cfi_startproc + .align 16 _dl_runtime_profile: - stmg %r2,%r6,64(%r15) # save call-clobbered arg regs - cfi_offset (r2, -96) # + r6 needed as arg for @@ -257,12 +257,12 @@ index 658e3a3..33ea3de 100644 - cfi_offset (f4, -40) - std %f6,128(%r15) - cfi_offset (f6, -32) - stg %r12,24(%r15) # r12 is used as backup of r15 - cfi_offset (r12, -136) - stg %r14,32(%r15) - cfi_offset (r14, -128) - lgr %r12,%r15 # backup stack pointer - cfi_def_cfa_register (12) + stg %r12,24(%r15) # r12 is used as backup of r15 + cfi_offset (r12, -136) + stg %r14,32(%r15) + cfi_offset (r14, -128) + lgr %r12,%r15 # backup stack pointer + cfi_def_cfa_register (12) + aghi %r15,-360 # create stack frame: + # 160 + sizeof(La_s390_64_regs) + stg %r12,0(%r15) # save backchain @@ -283,28 +283,28 @@ index 658e3a3..33ea3de 100644 + cfi_offset (f6, -296) #ifdef RESTORE_VRS - aghi %r15,-288 # create stack frame - .machine push - .machine "z13" + .machine push + .machine "z13" - vstm %v24,%v31,160(%r15)# store call-clobbered vector argument registers + vstm %v24,%v31,232(%r15) # store call-clobbered vector arguments - cfi_offset (v24, -288) - cfi_offset (v25, -272) - cfi_offset (v26, -256) + cfi_offset (v24, -288) + cfi_offset (v25, -272) + cfi_offset (v26, -256) @@ -143,31 +146,28 @@ _dl_runtime_profile: - cfi_offset (v30, -192) - cfi_offset (v31, -176) - .machine pop + cfi_offset (v30, -192) + cfi_offset (v31, -176) + .machine pop -#else - aghi %r15,-160 # create stack frame #endif - stg %r12,0(%r15) # save backchain - lmg %r2,%r3,48(%r12) # load arguments saved by PLT - lgr %r4,%r14 # return address as third parameter + lmg %r2,%r3,48(%r12) # load arguments saved by PLT + lgr %r4,%r14 # return address as third parameter - la %r5,64(%r12) # pointer to struct La_s390_64_regs + la %r5,160(%r15) # pointer to struct La_s390_64_regs - la %r6,40(%r12) # long int * framesize - brasl %r14,_dl_profile_fixup # call resolver - lgr %r1,%r2 # function addr returned in r2 + la %r6,40(%r12) # long int * framesize + brasl %r14,_dl_profile_fixup # call resolver + lgr %r1,%r2 # function addr returned in r2 - ld %f0,104(%r12) # restore call-clobbered arg fprs - ld %f2,112(%r12) - ld %f4,120(%r12) @@ -314,39 +314,39 @@ index 658e3a3..33ea3de 100644 + ld %f4,216(%r15) + ld %f6,224(%r15) #ifdef RESTORE_VRS - .machine push - .machine "z13" + .machine push + .machine "z13" - vlm %v24,%v31,160(%r15) # restore call-clobbered arg vrs + vlm %v24,%v31,232(%r15) # restore call-clobbered arg vrs - .machine pop + .machine pop #endif - lg %r0,40(%r12) # load framesize - ltgr %r0,%r0 - jnm 1f - + lg %r0,40(%r12) # load framesize + ltgr %r0,%r0 + jnm 1f + - lmg %r2,%r6,64(%r12) # framesize < 0 means no pltexit call + lmg %r2,%r6,160(%r15) # framesize < 0 means no pltexit call - # so we can do a tail call without - # copying the arg overflow area - lgr %r15,%r12 # remove stack frame + # so we can do a tail call without + # copying the arg overflow area + lgr %r15,%r12 # remove stack frame @@ -177,7 +177,9 @@ _dl_runtime_profile: - br %r1 # tail-call to resolved function - - cfi_def_cfa_register (12) + br %r1 # tail-call to resolved function + + cfi_def_cfa_register (12) -1: jz 4f # framesize == 0 ? +1: la %r4,160(%r15) # pointer to struct La_s390_64_regs + stg %r4,64(%r12) + jz 4f # framesize == 0 ? - aghi %r0,7 # align framesize to 8 - nill %r0,0xfff8 - slgr %r15,%r0 # make room for framesize bytes + aghi %r0,7 # align framesize to 8 + nill %r0,0xfff8 + slgr %r15,%r0 # make room for framesize bytes @@ -189,21 +191,33 @@ _dl_runtime_profile: - la %r2,8(%r2) # depending on framesize - la %r3,8(%r3) - brctg %r0,3b + la %r2,8(%r2) # depending on framesize + la %r3,8(%r3) + brctg %r0,3b -4: lmg %r2,%r6,64(%r12) # restore call-clobbered arg gprs +4: lmg %r2,%r6,0(%r4) # restore call-clobbered arg gprs - basr %r14,%r1 # call resolved function + basr %r14,%r1 # call resolved function - stg %r2,136(%r12) # store return values r2, f0 - std %f0,144(%r12) # to struct La_s390_64_retval - lmg %r2,%r3,48(%r12) # load arguments saved by PLT @@ -363,12 +363,12 @@ index 658e3a3..33ea3de 100644 + lmg %r2,%r4,48(%r12) # r2, r3: load arguments saved by PLT + # r4: pointer to struct La_s390_64_regs + la %r5,72(%r12) # pointer to struct La_s390_64_retval - brasl %r14,_dl_call_pltexit - - lgr %r15,%r12 # remove stack frame - cfi_def_cfa_register (15) - lg %r14,32(%r15) # restore registers - lg %r12,24(%r15) + brasl %r14,_dl_call_pltexit + + lgr %r15,%r12 # remove stack frame + cfi_def_cfa_register (15) + lg %r14,32(%r15) # restore registers + lg %r12,24(%r15) - lg %r2,136(%r15) # restore return values - ld %f0,144(%r15) + lg %r2,72(%r15) # restore return values @@ -379,6 +379,6 @@ index 658e3a3..33ea3de 100644 + vl %v24,88(%r15) # restore return value v24 + .machine pop +#endif - br %r14 # Jump back to caller - - cfi_endproc + br %r14 # Jump back to caller + + cfi_endproc diff --git a/SOURCES/glibc-rh1324427-3.patch b/SOURCES/glibc-rh1324427-3.patch index 47dd3949..1fbe7ae6 100644 --- a/SOURCES/glibc-rh1324427-3.patch +++ b/SOURCES/glibc-rh1324427-3.patch @@ -3,26 +3,26 @@ Author: Stefan Liebler Date: Fri Apr 1 10:42:54 2016 +0200 S390: Use ahi instead of aghi in 32bit _dl_runtime_resolve. - + This patch uses ahi instead of aghi in 32bit _dl_runtime_resolve to adjust the stack pointer. This is no functional change, but a cosmetic one. - + ChangeLog: - - * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve): - Use ahi instead of aghi to adjust stack pointer. + + * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve): + Use ahi instead of aghi to adjust stack pointer. diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h index bb74d27..086449f 100644 --- a/sysdeps/s390/s390-32/dl-trampoline.h +++ b/sysdeps/s390/s390-32/dl-trampoline.h @@ -90,7 +90,7 @@ _dl_runtime_resolve: - .machinemode "zarch_nohighgprs" - vlm %v24,%v31,96(%r15) # restore vector registers - .machine pop + .machinemode "zarch_nohighgprs" + vlm %v24,%v31,96(%r15) # restore vector registers + .machine pop - aghi %r15,224 # remove stack frame + ahi %r15,224 # remove stack frame - cfi_adjust_cfa_offset (-224) + cfi_adjust_cfa_offset (-224) #else - ahi %r15,96 # remove stack frame + ahi %r15,96 # remove stack frame diff --git a/SOURCES/glibc-rh1324568.patch b/SOURCES/glibc-rh1324568.patch index 1f1eaa20..7b463507 100644 --- a/SOURCES/glibc-rh1324568.patch +++ b/SOURCES/glibc-rh1324568.patch @@ -5,15 +5,15 @@ Author: Andreas Schwab Date: Thu Mar 20 15:05:25 2014 +0100 Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743) - + This fixes a bug in the way the results from __nscd_getai are collected: for every returned result a new entry is first added to the gaih_addrtuple list, but if that result doesn't match the request this entry remains uninitialized. So for this non-matching result an extra result with uninitialized content is returned. - + To reproduce (with nscd running): - + $ getent ahostsv4 localhost 127.0.0.1 STREAM localhost 127.0.0.1 DGRAM @@ -34,9 +34,9 @@ Index: b/sysdeps/posix/getaddrinfo.c --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -725,6 +725,18 @@ gaih_inet (const char *name, const struc - { - socklen_t size = (air->family[i] == AF_INET - ? INADDRSZ : IN6ADDRSZ); + { + socklen_t size = (air->family[i] == AF_INET + ? INADDRSZ : IN6ADDRSZ); + + if (!((air->family[i] == AF_INET + && req->ai_family == AF_INET6 @@ -49,6 +49,6 @@ Index: b/sysdeps/posix/getaddrinfo.c + continue; + } + - if (*pat == NULL) - { - *pat = addrfree++; + if (*pat == NULL) + { + *pat = addrfree++; diff --git a/SOURCES/glibc-rh1326739.patch b/SOURCES/glibc-rh1326739.patch index 32d2aec4..b99ed077 100644 --- a/SOURCES/glibc-rh1326739.patch +++ b/SOURCES/glibc-rh1326739.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Wed Sep 10 20:29:15 2014 +0200 malloc: additional unlink hardening for non-small bins [BZ #17344] - + Turn two asserts into a conditional call to malloc_printerr. The memory locations are accessed later anyway, so the performance impact is minor. @@ -15,7 +15,7 @@ Index: b/malloc/malloc.c @@ -1441,8 +1441,11 @@ typedef struct malloc_chunk* mbinptr; BK->fd = FD; \ if (!in_smallbin_range (P->size) \ - && __builtin_expect (P->fd_nextsize != NULL, 0)) { \ + && __builtin_expect (P->fd_nextsize != NULL, 0)) { \ - assert (P->fd_nextsize->bk_nextsize == P); \ - assert (P->bk_nextsize->fd_nextsize == P); \ + if (__builtin_expect (P->fd_nextsize->bk_nextsize != P, 0) \ @@ -24,5 +24,5 @@ Index: b/malloc/malloc.c + "corrupted double-linked list (not small)", P,\ + AV); \ if (FD->fd_nextsize == NULL) { \ - if (P->fd_nextsize == P) \ - FD->fd_nextsize = FD->bk_nextsize = FD; \ + if (P->fd_nextsize == P) \ + FD->fd_nextsize = FD->bk_nextsize = FD; \ diff --git a/SOURCES/glibc-rh1330705-1.patch b/SOURCES/glibc-rh1330705-1.patch index 63a6c745..987a58ff 100644 --- a/SOURCES/glibc-rh1330705-1.patch +++ b/SOURCES/glibc-rh1330705-1.patch @@ -13,7 +13,7 @@ index 2e31691..02c9a7f 100644 #define __O_NOATIME 04000000 /* Do not set atime. */ #define __O_PATH 040000000 /* Resolve pathname but do not open file. */ +#define __O_TMPFILE 0100100000 /* Atomically create nameless file. */ - + /* Not necessary, files are always with 64bit off_t. */ #define __O_LARGEFILE 0 diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h @@ -25,9 +25,9 @@ index 744548a..76faa40 100644 #define __O_NOATIME 004000000 /* Do not set atime. */ #define __O_PATH 020000000 +#define __O_TMPFILE 040010000 /* Atomically create nameless file. */ - + #define __O_LARGEFILE 00004000 - + diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h index b5929bd..9b0421e 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h @@ -39,7 +39,7 @@ index b5929bd..9b0421e 100644 +#ifndef __O_TMPFILE +# define __O_TMPFILE 020200000 +#endif - + #ifndef F_GETLK # ifndef __USE_FILE_OFFSET64 @@ -128,6 +131,7 @@ @@ -48,7 +48,7 @@ index b5929bd..9b0421e 100644 # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ +# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif - + /* For now, Linux has no separate synchronicitiy options for read diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index 01084bb..f384bc7 100644 @@ -59,6 +59,6 @@ index 01084bb..f384bc7 100644 #define __O_NOATIME 0x200000 /* Do not set atime. */ #define __O_PATH 0x1000000 /* Resolve pathname but do not open file. */ +#define __O_TMPFILE 0x2010000 /* Atomically create nameless file. */ - + #if __WORDSIZE == 64 # define __O_LARGEFILE 0 diff --git a/SOURCES/glibc-rh1330705-2.patch b/SOURCES/glibc-rh1330705-2.patch index 9e4b9974..cc1687c6 100644 --- a/SOURCES/glibc-rh1330705-2.patch +++ b/SOURCES/glibc-rh1330705-2.patch @@ -15,5 +15,5 @@ index 3d28c84..d2baeb3 100644 -# define __O_TMPFILE 020200000 +# define __O_TMPFILE (020000000 | __O_DIRECTORY) #endif - + #ifndef F_GETLK diff --git a/SOURCES/glibc-rh1330705-3.patch b/SOURCES/glibc-rh1330705-3.patch index e412f7c7..7ec90554 100644 --- a/SOURCES/glibc-rh1330705-3.patch +++ b/SOURCES/glibc-rh1330705-3.patch @@ -9,18 +9,18 @@ Index: b/io/Makefile --- a/io/Makefile +++ b/io/Makefile @@ -36,10 +36,10 @@ routines := \ - statvfs fstatvfs statvfs64 fstatvfs64 \ - umask chmod fchmod lchmod fchmodat \ - mkdir mkdirat \ + statvfs fstatvfs statvfs64 fstatvfs64 \ + umask chmod fchmod lchmod fchmodat \ + mkdir mkdirat \ - open open64 openat openat64 close \ + open open_2 open64 open64_2 openat openat_2 openat64 openat64_2 \ - read write lseek lseek64 access euidaccess faccessat \ - fcntl flock lockf lockf64 \ + read write lseek lseek64 access euidaccess faccessat \ + fcntl flock lockf lockf64 \ - dup dup2 dup3 pipe pipe2 \ + close dup dup2 dup3 pipe pipe2 \ - creat creat64 \ - chdir fchdir \ - getcwd getwd getdirname \ + creat creat64 \ + chdir fchdir \ + getcwd getwd getdirname \ Index: b/io/open.c =================================================================== --- a/io/open.c @@ -28,15 +28,15 @@ Index: b/io/open.c @@ -22,7 +22,6 @@ #include #include - + -extern char **__libc_argv attribute_hidden; - + /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ @@ -57,15 +56,6 @@ weak_alias (__libc_open, open) - + stub_warning (open) - + - -int -__open_2 (file, oflag) @@ -56,9 +56,9 @@ Index: b/io/open64.c --- a/io/open64.c +++ b/io/open64.c @@ -54,15 +54,6 @@ weak_alias (__libc_open64, open64) - + stub_warning (open64) - + - -int -__open64_2 (file, oflag) @@ -148,7 +148,7 @@ Index: b/io/openat.c @@ -75,16 +75,6 @@ libc_hidden_def (__openat) weak_alias (__openat, openat) stub_warning (openat) - + - -int -__openat_2 (fd, file, oflag) @@ -171,7 +171,7 @@ Index: b/io/openat64.c @@ -68,16 +68,6 @@ libc_hidden_def (__openat64) weak_alias (__openat64, openat64) stub_warning (openat64) - + - -int -__openat64_2 (fd, file, oflag) @@ -262,7 +262,7 @@ Index: b/sysdeps/mach/hurd/open.c @@ -52,20 +52,9 @@ weak_alias (__libc_open, __open) libc_hidden_weak (__open) weak_alias (__libc_open, open) - + -int -__open_2 (file, oflag) - const char *file; @@ -273,7 +273,7 @@ Index: b/sysdeps/mach/hurd/open.c - - return __open (file, oflag); -} - + /* open64 is just the same as open for us. */ weak_alias (__libc_open, __libc_open64) weak_alias (__libc_open, __open64) @@ -287,7 +287,7 @@ Index: b/sysdeps/mach/hurd/openat.c @@ -56,20 +56,7 @@ __openat (fd, file, oflag) libc_hidden_def (__openat) weak_alias (__openat, openat) - + -int -__openat_2 (fd, file, oflag) - int fd; @@ -310,14 +310,14 @@ Index: b/sysdeps/unix/sysv/linux/Makefile --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -158,7 +158,7 @@ endif - + ifeq ($(subdir),io) sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ - sync_file_range open_2 open64_2 fallocate fallocate64 + sync_file_range fallocate fallocate64 sysdep_headers += bits/fcntl-linux.h endif - + Index: b/sysdeps/unix/sysv/linux/open64_2.c =================================================================== --- a/sysdeps/unix/sysv/linux/open64_2.c @@ -395,11 +395,11 @@ Index: b/sysdeps/unix/sysv/linux/openat.c --- a/sysdeps/unix/sysv/linux/openat.c +++ b/sysdeps/unix/sysv/linux/openat.c @@ -29,7 +29,6 @@ - + #ifndef OPENAT # define OPENAT openat -# define __OPENAT_2 __openat_2 - + # ifndef __ASSUME_ATFCTS /* Set errno after a failed call. If BUF is not null, @@ -179,18 +178,3 @@ __OPENAT (fd, file, oflag) @@ -429,7 +429,7 @@ Index: b/sysdeps/unix/sysv/linux/openat64.c #define OPENAT openat64 -#define __OPENAT_2 __openat64_2 #define MORE_OFLAGS O_LARGEFILE - + #include "openat.c" Index: b/sysdeps/unix/sysv/linux/wordsize-64/openat.c =================================================================== @@ -440,14 +440,14 @@ Index: b/sysdeps/unix/sysv/linux/wordsize-64/openat.c -#define __openat64_2 __rename___openat64_2 #define __openat64_nocancel __rename___openat64_nocancel #define openat64 __rename_openat64 - + #include "../openat.c" - + #undef __openat64 -#undef __openat64_2 #undef __openat64_nocancel #undef openat64 - + -weak_alias (__openat, __openat64) -weak_alias (__openat_2, __openat64_2) -weak_alias (__openat_nocancel, __openat64_nocancel) diff --git a/SOURCES/glibc-rh1330705-4.patch b/SOURCES/glibc-rh1330705-4.patch index 7f883536..24710488 100644 --- a/SOURCES/glibc-rh1330705-4.patch +++ b/SOURCES/glibc-rh1330705-4.patch @@ -5,22 +5,22 @@ Author: Eric Rannaud Date: Tue Feb 24 13:12:26 2015 +0530 linux: open and openat ignore 'mode' with O_TMPFILE in flags - + Both open and openat load their last argument 'mode' lazily, using va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also necessary if O_TMPFILE is in oflag. - + By chance on x86_64, the problem wasn't evident when using O_TMPFILE with open, as the 3rd argument of open, even when not loaded with va_arg, is left untouched in RDX, where the syscall expects it. - + However, openat was not so lucky, and O_TMPFILE couldn't be used: mode is the 4th argument, in RCX, but the syscall expects its 4th argument in a different register than the glibc wrapper, in R10. - + Introduce a macro __OPEN_NEEDS_MODE (oflag) to test if either O_CREAT or O_TMPFILE is set in oflag. - + Index: b/io/bits/fcntl2.h =================================================================== --- a/io/bits/fcntl2.h @@ -28,7 +28,7 @@ Index: b/io/bits/fcntl2.h @@ -20,7 +20,7 @@ # error "Never include directly; use instead." #endif - + -/* Check that calls to open and openat with O_CREAT set have an +/* Check that calls to open and openat with O_CREAT or O_TMPFILE set have an appropriate third/fourth parameter. */ @@ -36,76 +36,76 @@ Index: b/io/bits/fcntl2.h extern int __open_2 (const char *__path, int __oflag) __nonnull ((1)); @@ -35,7 +35,7 @@ extern int __REDIRECT (__open_alias, (co __errordecl (__open_too_many_args, - "open can be called either with 2 or 3 arguments, not more"); + "open can be called either with 2 or 3 arguments, not more"); __errordecl (__open_missing_mode, - "open with O_CREAT in second argument needs 3 arguments"); + "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments"); - + __fortify_function int open (const char *__path, int __oflag, ...) @@ -45,7 +45,7 @@ open (const char *__path, int __oflag, . - + if (__builtin_constant_p (__oflag)) { - if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1) + if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) - { - __open_missing_mode (); - return __open_2 (__path, __oflag); + { + __open_missing_mode (); + return __open_2 (__path, __oflag); @@ -67,7 +67,7 @@ extern int __REDIRECT (__open64_alias, ( __errordecl (__open64_too_many_args, - "open64 can be called either with 2 or 3 arguments, not more"); + "open64 can be called either with 2 or 3 arguments, not more"); __errordecl (__open64_missing_mode, - "open64 with O_CREAT in second argument needs 3 arguments"); + "open64 with O_CREAT or O_TMPFILE in second argument needs 3 arguments"); - + __fortify_function int open64 (const char *__path, int __oflag, ...) @@ -77,7 +77,7 @@ open64 (const char *__path, int __oflag, - + if (__builtin_constant_p (__oflag)) { - if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1) + if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) - { - __open64_missing_mode (); - return __open64_2 (__path, __oflag); + { + __open64_missing_mode (); + return __open64_2 (__path, __oflag); @@ -111,7 +111,7 @@ extern int __REDIRECT (__openat_alias, ( __errordecl (__openat_too_many_args, - "openat can be called either with 3 or 4 arguments, not more"); + "openat can be called either with 3 or 4 arguments, not more"); __errordecl (__openat_missing_mode, - "openat with O_CREAT in third argument needs 4 arguments"); + "openat with O_CREAT or O_TMPFILE in third argument needs 4 arguments"); - + __fortify_function int openat (int __fd, const char *__path, int __oflag, ...) @@ -121,7 +121,7 @@ openat (int __fd, const char *__path, in - + if (__builtin_constant_p (__oflag)) { - if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1) + if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) - { - __openat_missing_mode (); - return __openat_2 (__fd, __path, __oflag); + { + __openat_missing_mode (); + return __openat_2 (__fd, __path, __oflag); @@ -145,7 +145,7 @@ extern int __REDIRECT (__openat64_alias, __errordecl (__openat64_too_many_args, - "openat64 can be called either with 3 or 4 arguments, not more"); + "openat64 can be called either with 3 or 4 arguments, not more"); __errordecl (__openat64_missing_mode, - "openat64 with O_CREAT in third argument needs 4 arguments"); + "openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments"); - + __fortify_function int openat64 (int __fd, const char *__path, int __oflag, ...) @@ -155,7 +155,7 @@ openat64 (int __fd, const char *__path, - + if (__builtin_constant_p (__oflag)) { - if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1) + if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) - { - __openat64_missing_mode (); - return __openat64_2 (__fd, __path, __oflag); + { + __openat64_missing_mode (); + return __openat64_2 (__fd, __path, __oflag); Index: b/io/fcntl.h =================================================================== --- a/io/fcntl.h @@ -113,7 +113,7 @@ Index: b/io/fcntl.h @@ -34,6 +34,15 @@ __BEGIN_DECLS numbers and flag bits for `open', `fcntl', et al. */ #include - + +/* Detect if open needs mode as a third argument (or for openat as a fourth + argument). */ +#ifdef __O_TMPFILE @@ -128,14 +128,14 @@ Index: b/io/fcntl.h by any POSIX header, so we don't conditionalize the definitions here. */ @@ -154,8 +163,9 @@ typedef __pid_t pid_t; extern int fcntl (int __fd, int __cmd, ...); - + /* Open FILE and return a new file descriptor for it, or -1 on error. - OFLAG determines the type of access used. If O_CREAT is on OFLAG, - the third argument is taken as a `mode_t', the mode of the created file. + OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set + in OFLAG, the third argument is taken as a `mode_t', the mode of the + created file. - + This function is a cancellation point and therefore not marked with __THROW. */ Index: b/io/open.c @@ -144,8 +144,8 @@ Index: b/io/open.c +++ b/io/open.c @@ -23,7 +23,7 @@ #include - - + + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -154,7 +154,7 @@ Index: b/io/open.c @@ -38,7 +38,7 @@ __libc_open (file, oflag) return -1; } - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -167,7 +167,7 @@ Index: b/io/open64.c @@ -22,7 +22,7 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -176,7 +176,7 @@ Index: b/io/open64.c @@ -37,7 +37,7 @@ __libc_open64 (file, oflag) return -1; } - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -194,7 +194,7 @@ Index: b/io/open64_2.c - __fortify_fail ("invalid open64 call: O_CREAT without mode"); + if (__OPEN_NEEDS_MODE (oflag)) + __fortify_fail ("invalid open64 call: O_CREAT or O_TMPFILE without mode"); - + return __open64 (file, oflag); } Index: b/io/open_2.c @@ -209,7 +209,7 @@ Index: b/io/open_2.c - __fortify_fail ("invalid open call: O_CREAT without mode"); + if (__OPEN_NEEDS_MODE (oflag)) + __fortify_fail ("invalid open call: O_CREAT or O_TMPFILE without mode"); - + return __open (file, oflag); } Index: b/io/openat.c @@ -218,7 +218,7 @@ Index: b/io/openat.c +++ b/io/openat.c @@ -30,7 +30,7 @@ int __have_atfcts; #endif - + /* Open FILE with access OFLAG. Interpret relative paths relative to - the directory associated with FD. If OFLAG includes O_CREAT, a + the directory associated with FD. If O_CREAT or O_TMPFILE is in OFLAG, a @@ -226,9 +226,9 @@ Index: b/io/openat.c int __openat (fd, file, oflag) @@ -60,7 +60,7 @@ __openat (fd, file, oflag) - } + } } - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -240,7 +240,7 @@ Index: b/io/openat64.c +++ b/io/openat64.c @@ -23,7 +23,7 @@ #include - + /* Open FILE with access OFLAG. Interpret relative paths relative to - the directory associated with FD. If OFLAG includes O_CREAT, a + the directory associated with FD. If O_CREAT or O_TMPFILE is in OFLAG, a @@ -248,9 +248,9 @@ Index: b/io/openat64.c int __openat64 (fd, file, oflag) @@ -53,7 +53,7 @@ __openat64 (fd, file, oflag) - } + } } - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -268,7 +268,7 @@ Index: b/io/openat64_2.c - __fortify_fail ("invalid openat64 call: O_CREAT without mode"); + if (__OPEN_NEEDS_MODE (oflag)) + __fortify_fail ("invalid openat64 call: O_CREAT or O_TMPFILE without mode"); - + return __openat64 (fd, file, oflag); } Index: b/io/openat_2.c @@ -283,7 +283,7 @@ Index: b/io/openat_2.c - __fortify_fail ("invalid openat call: O_CREAT without mode"); + if (__OPEN_NEEDS_MODE (oflag)) + __fortify_fail ("invalid openat call: O_CREAT or O_TMPFILE without mode"); - + return __openat (fd, file, oflag); } Index: b/sysdeps/mach/hurd/open.c @@ -293,7 +293,7 @@ Index: b/sysdeps/mach/hurd/open.c @@ -22,7 +22,7 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -302,7 +302,7 @@ Index: b/sysdeps/mach/hurd/open.c @@ -30,7 +30,7 @@ __libc_open (const char *file, int oflag mode_t mode; io_t port; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -314,7 +314,7 @@ Index: b/sysdeps/mach/hurd/openat.c +++ b/sysdeps/mach/hurd/openat.c @@ -26,7 +26,7 @@ #include - + /* Open FILE with access OFLAG. Interpret relative paths relative to - the directory associated with FD. If OFLAG includes O_CREAT, a + the directory associated with FD. If O_CREAT or O_TMPFILE is in OFLAG, a @@ -324,7 +324,7 @@ Index: b/sysdeps/mach/hurd/openat.c @@ -37,7 +37,7 @@ __openat (fd, file, oflag) mode_t mode; io_t port; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -337,7 +337,7 @@ Index: b/sysdeps/posix/open64.c @@ -20,14 +20,14 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -345,7 +345,7 @@ Index: b/sysdeps/posix/open64.c __libc_open64 (const char *file, int oflag, ...) { int mode = 0; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -361,7 +361,7 @@ Index: b/sysdeps/unix/sysv/linux/dl-openat64.c { - assert ((oflag & O_CREAT) == 0); + assert (!__OPEN_NEEDS_MODE (oflag)); - + #ifdef __NR_openat return INLINE_SYSCALL (openat, 3, dfd, file, oflag | O_LARGEFILE); Index: b/ports/sysdeps/unix/sysv/linux/generic/open.c @@ -371,7 +371,7 @@ Index: b/ports/sysdeps/unix/sysv/linux/generic/open.c @@ -22,14 +22,14 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -379,7 +379,7 @@ Index: b/ports/sysdeps/unix/sysv/linux/generic/open.c __libc_open (const char *file, int oflag, ...) { int mode = 0; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -388,7 +388,7 @@ Index: b/ports/sysdeps/unix/sysv/linux/generic/open.c @@ -59,7 +59,7 @@ __open_nocancel (const char *file, int o { int mode = 0; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -401,7 +401,7 @@ Index: b/ports/sysdeps/unix/sysv/linux/generic/open64.c @@ -22,14 +22,14 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -409,7 +409,7 @@ Index: b/ports/sysdeps/unix/sysv/linux/generic/open64.c __libc_open64 (const char *file, int oflag, ...) { int mode = 0; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -422,7 +422,7 @@ Index: b/sysdeps/unix/sysv/linux/open64.c @@ -22,14 +22,14 @@ #include #include - + -/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, +/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, a third argument is the file protection. */ @@ -430,7 +430,7 @@ Index: b/sysdeps/unix/sysv/linux/open64.c __libc_open64 (const char *file, int oflag, ...) { int mode = 0; - + - if (oflag & O_CREAT) + if (__OPEN_NEEDS_MODE (oflag)) { @@ -441,8 +441,8 @@ Index: b/sysdeps/unix/sysv/linux/openat.c --- a/sysdeps/unix/sysv/linux/openat.c +++ b/sysdeps/unix/sysv/linux/openat.c @@ -148,8 +148,8 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode - - + + /* Open FILE with access OFLAG. Interpret relative paths relative to - the directory associated with FD. If OFLAG includes O_CREAT, a - third argument is the file protection. */ diff --git a/SOURCES/glibc-rh1330705-5.patch b/SOURCES/glibc-rh1330705-5.patch index 437c68c1..f4282865 100644 --- a/SOURCES/glibc-rh1330705-5.patch +++ b/SOURCES/glibc-rh1330705-5.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Wed Sep 21 15:24:01 2016 +0200 Add test case for O_TMPFILE handling in open, openat - + Also put xasprintf into test-skeleton.c (written in such a way that including is not needed). @@ -346,13 +346,13 @@ Index: b/test-skeleton.c #include #include +#include - + /* The test function is normally called `do_test' and it is called with argc and argv as the arguments. We nevertheless provide the @@ -63,6 +64,20 @@ static pid_t pid; /* Directory to place temporary files in. */ static const char *test_dir; - + +/* Call asprintf with error checking. */ +__attribute__ ((always_inline, format (printf, 1, 2))) +static __inline__ char * @@ -375,11 +375,12 @@ Index: b/io/Makefile --- a/io/Makefile +++ b/io/Makefile @@ -69,7 +69,8 @@ tests := test-utime test-stat test-stat - tst-renameat tst-fchownat tst-fchmodat tst-faccessat \ - tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \ - tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \ + tst-renameat tst-fchownat tst-fchmodat tst-faccessat \ + tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \ + tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \ - tst-posix_fallocate + tst-posix_fallocate \ + tst-open-tmpfile - + include ../Rules + diff --git a/SOURCES/glibc-rh1330705-6.patch b/SOURCES/glibc-rh1330705-6.patch index ada33284..85581a11 100644 --- a/SOURCES/glibc-rh1330705-6.patch +++ b/SOURCES/glibc-rh1330705-6.patch @@ -10,10 +10,10 @@ Index: b/io/tst-open-tmpfile.c @@ -33,7 +33,6 @@ static int do_test (void); #define TEST_FUNCTION do_test () #include "../test-skeleton.c" - + -#ifdef O_TMPFILE typedef int (*wrapper_func) (const char *, int, mode_t); - + /* Error-checking wrapper for the open function, compatible with the @@ -157,7 +156,7 @@ static void check_wrapper_flags_mode (const char *op, wrapper_func wrapper, @@ -26,7 +26,7 @@ Index: b/io/tst-open-tmpfile.c { @@ -257,20 +256,20 @@ check_wrapper (const char *op, wrapper_f } - + /* Verify that the directory at PATH supports O_TMPFILE. Exit with - status 77 (unsupported) if the kernel does not support O_TMPFILE. - Even with kernel support, not all file systems O_TMPFILE, so return @@ -64,7 +64,7 @@ Index: b/io/tst-open-tmpfile.c check_wrapper ("open64", wrap_open64, paths[i]); check_wrapper ("openat64", wrap_openat64, paths[i]); } - + - if (!supported) - return 77; - @@ -90,5 +90,5 @@ Index: b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ -# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif - + /* For now, Linux has no separate synchronicitiy options for read diff --git a/SOURCES/glibc-rh1331283-1.patch b/SOURCES/glibc-rh1331283-1.patch index ed464e24..1ade53de 100644 --- a/SOURCES/glibc-rh1331283-1.patch +++ b/SOURCES/glibc-rh1331283-1.patch @@ -3,16 +3,16 @@ Author: Carlos O'Donell Date: Thu Feb 6 11:12:48 2014 -0500 BZ #16529: Fix pedantic warning with netinet/in.h. - + When compiling with pedantic the following warning is seen: - + gcc -Wall -pedantic -O0 -o test test.c In file included from test.c:3:0: /path/inet/netinet/in.h:111:21: warning: comma at end of \ enumerator list [-Wpedantic] IPPROTO_MH = 135, /* IPv6 mobility header. */ ^ - + It is valid C99 to have a trailing comma after the last item in an enumeration. However it is not valid C90. If possible glibc attempts to keep all headers C90 + long long without requiring diff --git a/SOURCES/glibc-rh1331283-2.patch b/SOURCES/glibc-rh1331283-2.patch index 6216b5a9..a422471d 100644 --- a/SOURCES/glibc-rh1331283-2.patch +++ b/SOURCES/glibc-rh1331283-2.patch @@ -3,10 +3,10 @@ Author: Cong Wang Date: Tue Jan 6 16:13:19 2015 -0800 in.h: Coordinate in6_pktinfo and ip6_mtuinfo for kernel and glibc [BZ #15850] - + Similarly to what we did for in6_addr, we need a macro to guard in6_pktinfo and ip6_mtuinfo too. - + Cc: Carlos O'Donell Signed-off-by: Cong Wang @@ -17,7 +17,7 @@ index bf3c8b1..f541c58 100644 @@ -530,6 +530,7 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) #ifdef __USE_GNU struct cmsghdr; /* Forward declaration. */ - + +#ifndef __USE_KERNEL_IPV6_DEFS /* IPv6 packet information. */ struct in6_pktinfo @@ -28,7 +28,7 @@ index bf3c8b1..f541c58 100644 }; - +#endif /* !__USE_KERNEL_IPV6_DEFS */ - + /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space (int __nbytes) diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h @@ -36,7 +36,7 @@ index b80a27f..b1d2cf6 100644 --- a/sysdeps/unix/sysv/linux/bits/in.h +++ b/sysdeps/unix/sysv/linux/bits/in.h @@ -23,10 +23,10 @@ - + /* If the application has already included linux/in6.h from a linux-based kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the - defines), sockaddr_in6, or ipv6_mreq. The ABI used by the linux-kernel and diff --git a/SOURCES/glibc-rh1331283-3.patch b/SOURCES/glibc-rh1331283-3.patch index 1e383cd7..444ec369 100644 --- a/SOURCES/glibc-rh1331283-3.patch +++ b/SOURCES/glibc-rh1331283-3.patch @@ -3,18 +3,18 @@ Author: Carlos O'Donell Date: Thu Jun 2 23:30:11 2016 -0400 Fix macro API for __USE_KERNEL_IPV6_DEFS. - + The use of __USE_KERNEL_IPV6_DEFS with ifndef is bad practice per: https://sourceware.org/glibc/wiki/Wundef. This change moves it to use 'if' and always define the macro. - + Please note that this is not the only problem with this code. I have a series of fixes after this one to resolve breakage with this code and add regression tests for it via compile-only source testing (to be discussed in another thread). - + Unfortunately __USE_KERNEL_XATTR_DEFS is set by the kernel and not glibc, and uses 'define', so we can't fix that yet. @@ -25,7 +25,7 @@ Index: glibc-2.17-c758a686/inet/netinet/in.h @@ -91,10 +91,10 @@ enum IPPROTO_MAX }; - + -/* If __USER_KERNEL_IPV6_DEFS is defined then the user has included the kernel +/* If __USE_KERNEL_IPV6_DEFS is 1 then the user has included the kernel network headers first and we should use those ABI-identical definitions @@ -39,16 +39,16 @@ Index: glibc-2.17-c758a686/inet/netinet/in.h @@ -205,7 +205,7 @@ enum #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ - + -#ifndef __USE_KERNEL_IPV6_DEFS +#if !__USE_KERNEL_IPV6_DEFS /* IPv6 address */ struct in6_addr { @@ -248,7 +248,7 @@ struct sockaddr_in - sizeof (struct in_addr)]; + sizeof (struct in_addr)]; }; - + -#ifndef __USE_KERNEL_IPV6_DEFS +#if !__USE_KERNEL_IPV6_DEFS /* Ditto, for IPv6. */ @@ -57,7 +57,7 @@ Index: glibc-2.17-c758a686/inet/netinet/in.h @@ -284,7 +284,7 @@ struct ip_mreq_source }; #endif - + -#ifndef __USE_KERNEL_IPV6_DEFS +#if !__USE_KERNEL_IPV6_DEFS /* Likewise, for IPv6. */ @@ -66,7 +66,7 @@ Index: glibc-2.17-c758a686/inet/netinet/in.h @@ -531,7 +531,7 @@ extern int bindresvport6 (int __sockfd, #ifdef __USE_GNU struct cmsghdr; /* Forward declaration. */ - + -#ifndef __USE_KERNEL_IPV6_DEFS +#if !__USE_KERNEL_IPV6_DEFS /* IPv6 packet information. */ @@ -85,5 +85,5 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/bits/in.h +#else +# define __USE_KERNEL_IPV6_DEFS 0 #endif - + /* Options for use with `getsockopt' and `setsockopt' at the IP level. diff --git a/SOURCES/glibc-rh1331283-4.patch b/SOURCES/glibc-rh1331283-4.patch index 56320c78..e94581b7 100644 --- a/SOURCES/glibc-rh1331283-4.patch +++ b/SOURCES/glibc-rh1331283-4.patch @@ -3,16 +3,16 @@ Author: Carlos O'Donell Date: Tue Jun 7 04:46:37 2016 -0400 Bug 20214: Fix linux/in6.h and netinet/in.h sync. - + In: https://sourceware.org/glibc/wiki/Synchronizing_Headers we explain how we synchronize our headers with Linux kernel headers. - + In order to synchronize with the Linux linux/in6.h and linux/ipv6.h headers we checked for their guard macros and then defined __USE_KERNEL_IPV6_DEFS and conditionalized code on this macro. - + In upstream kernel 56c176c9 the _UAPI prefix was stripped and this broke our synchronized headers again. We now need to check for _LINUX_IN6_H and _IPV6_H, and keep checking the old versions @@ -22,7 +22,7 @@ Date: Tue Jun 7 04:46:37 2016 -0400 *before* our fix was ever applied to glibc, but without glibc testing we didn't notice and distro kernels have their own testing to fix this). - + This patch fixes synchronization with linux/in6.h and with netinet/in.h. @@ -49,7 +49,7 @@ index 9bdadf3..4d70a6b 100644 following member" and that holds true. */ @@ -209,8 +215,10 @@ struct in_pktinfo #define IPV6_TCLASS 67 - + /* Obsolete synonyms for the above. */ -#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP @@ -59,3 +59,4 @@ index 9bdadf3..4d70a6b 100644 +#endif #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS + diff --git a/SOURCES/glibc-rh1331283.patch b/SOURCES/glibc-rh1331283.patch index df20886a..cf9a9243 100644 --- a/SOURCES/glibc-rh1331283.patch +++ b/SOURCES/glibc-rh1331283.patch @@ -3,11 +3,11 @@ Author: Carlos O'Donell Date: Fri Sep 6 01:02:30 2013 -0400 Coordinate IPv6 definitions for Linux and glibc - + This change synchronizes the glibc headers with the Linux kernel headers and arranges to coordinate the definition of structures already defined the Linux kernel UAPI headers. - + It is now safe to include glibc's netinet/in.h or Linux's linux/in6.h in any order in a userspace application and you will get the same ABI. The ABI is guaranteed by UAPI and glibc. @@ -17,9 +17,9 @@ index 89e3813..05c77e2 100644 --- a/inet/netinet/in.h +++ b/inet/netinet/in.h @@ -26,13 +26,21 @@ - + __BEGIN_DECLS - + +/* Internet address. */ +typedef uint32_t in_addr_t; +struct in_addr @@ -71,7 +71,7 @@ index 89e3813..05c77e2 100644 @@ -90,6 +90,28 @@ enum IPPROTO_MAX }; - + +/* If __USER_KERNEL_IPV6_DEFS is defined then the user has included the kernel + network headers first and we should use those ABI-identical definitions + instead of our own. */ @@ -94,13 +94,13 @@ index 89e3813..05c77e2 100644 +#define IPPROTO_MH IPPROTO_MH + }; +#endif /* !__USE_KERNEL_IPV6_DEFS */ - + /* Type to represent a port. */ typedef uint16_t in_port_t; @@ -134,15 +156,6 @@ enum IPPORT_USERRESERVED = 5000 }; - + - -/* Internet address. */ -typedef uint32_t in_addr_t; @@ -111,12 +111,12 @@ index 89e3813..05c77e2 100644 - - /* Definitions of the bits in an Internet address integer. - + On subnets, host and network parts are found according to @@ -191,7 +204,7 @@ struct in_addr #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */ - + - +#ifndef __USE_KERNEL_IPV6_DEFS /* IPv6 address */ @@ -127,13 +127,13 @@ index 89e3813..05c77e2 100644 #endif }; +#endif /* !__USE_KERNEL_IPV6_DEFS */ - + extern const struct in6_addr in6addr_any; /* :: */ extern const struct in6_addr in6addr_loopback; /* ::1 */ @@ -233,6 +247,7 @@ struct sockaddr_in - sizeof (struct in_addr)]; + sizeof (struct in_addr)]; }; - + +#ifndef __USE_KERNEL_IPV6_DEFS /* Ditto, for IPv6. */ struct sockaddr_in6 @@ -144,13 +144,13 @@ index 89e3813..05c77e2 100644 }; - +#endif /* !__USE_KERNEL_IPV6_DEFS */ - + #if defined __USE_MISC || defined __USE_GNU /* IPv4 multicast request. */ @@ -268,7 +283,7 @@ struct ip_mreq_source }; #endif - + - +#ifndef __USE_KERNEL_IPV6_DEFS /* Likewise, for IPv6. */ @@ -162,19 +162,19 @@ index 89e3813..05c77e2 100644 }; - +#endif /* !__USE_KERNEL_IPV6_DEFS */ - + #if defined __USE_MISC || defined __USE_GNU /* Multicast group request. */ @@ -349,10 +364,6 @@ struct group_filter - * sizeof (struct sockaddr_storage))) + * sizeof (struct sockaddr_storage))) #endif - + - -/* Get system-specific definitions. */ -#include - /* Functions to convert between host and network byte order. - + Please note that these functions normally take `unsigned long int' or diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h index e959b33..d763ce9 100644 @@ -183,7 +183,7 @@ index e959b33..d763ce9 100644 @@ -21,6 +21,18 @@ # error "Never use directly; include instead." #endif - + +/* If the application has already included linux/in6.h from a linux-based + kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the + defines), sockaddr_in6, or ipv6_mreq. The ABI used by the linux-kernel and diff --git a/SOURCES/glibc-rh1335286-0.patch b/SOURCES/glibc-rh1335286-0.patch index b9bc3624..80f64c61 100644 --- a/SOURCES/glibc-rh1335286-0.patch +++ b/SOURCES/glibc-rh1335286-0.patch @@ -11,9 +11,9 @@ Author: Siddhesh Poyarekar Date: Sat Jun 15 00:09:26 2013 +0530 Add rtld-memset.S for x86_64 - + Resolves: BZ #15627 - + Add an assembler version of rtld-memset to avoid using SSE registers. Index: glibc-2.17-c758a686/sysdeps/x86_64/rtld-memset.S diff --git a/SOURCES/glibc-rh1335286.patch b/SOURCES/glibc-rh1335286.patch index 1cbb1452..39b0e338 100644 --- a/SOURCES/glibc-rh1335286.patch +++ b/SOURCES/glibc-rh1335286.patch @@ -21,16 +21,16 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S --- glibc-2.17-c758a686.orig/sysdeps/x86_64/memset.S +++ glibc-2.17-c758a686/sysdeps/x86_64/memset.S @@ -19,17 +19,31 @@ - + #include - + -#define __STOS_LOWER_BOUNDARY $8192 -#define __STOS_UPPER_BOUNDARY $65536 +#ifndef ALIGN +# define ALIGN(n) .p2align n +#endif - - .text + + .text #if IS_IN (libc) && !defined USE_MULTIARCH ENTRY(__bzero) - mov %rsi,%rdx /* Adjust parameter. */ @@ -55,10 +55,10 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S + jmp L(entry_from_bzero) +END(__memset_tail) #endif - + #if defined PIC && IS_IN (libc) @@ -38,1318 +52,80 @@ ENTRY_CHK (__memset_chk) - jb HIDDEN_JUMPTARGET (__chk_fail) + jb HIDDEN_JUMPTARGET (__chk_fail) END_CHK (__memset_chk) #endif -ENTRY (memset) @@ -1303,7 +1303,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S - jz L(8byte_stos_skip) - - xchgq %rax,%rdx - + +ENTRY (memset) + movd %esi, %xmm8 + movq %rdi, %rax @@ -1320,7 +1320,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S + movdqu %xmm8, -16(%rdi,%rdx) + ja L(between_32_64_bytes) +L(return): - rep + rep - stosq - - xchgq %rax,%rdx @@ -1352,7 +1352,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S -L(8byte_nt_move_loop): - decq %rcx + ret - + - movntiq %rdx, (%rdi) - movntiq %rdx, 8 (%rdi) - movntiq %rdx, 16 (%rdi) @@ -1444,6 +1444,6 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/memset.S + movq %rcx, (%rdi) + movq %rcx, -8(%rdi,%rdx) + ret - + END (memset) libc_hidden_builtin_def (memset) diff --git a/SOURCES/glibc-rh1335925-1.patch b/SOURCES/glibc-rh1335925-1.patch index 60f4eb5c..82f2b21a 100644 --- a/SOURCES/glibc-rh1335925-1.patch +++ b/SOURCES/glibc-rh1335925-1.patch @@ -5,7 +5,7 @@ Author: Alan Hayward Date: Tue Nov 11 16:32:34 2014 +0000 [AArch64] Add ipc.h. - + Adding ipc.h for AArch64 adjusted to behave correctly on big endian targets. diff --git a/SOURCES/glibc-rh1335925-2.patch b/SOURCES/glibc-rh1335925-2.patch index 253d124e..02037be2 100644 --- a/SOURCES/glibc-rh1335925-2.patch +++ b/SOURCES/glibc-rh1335925-2.patch @@ -5,17 +5,17 @@ Author: Szabolcs Nagy Date: Thu Jul 9 09:39:51 2015 +0100 [AArch64][BZ 18400] fix elf_prpsinfo in procfs.h - + Kernel uses int pr_uid, pr_gid, but glibc used unsigned short. - + This is an ABI breaking change, but the size and alignment of the struct and the layout of other members is not changed and there is no known usage of pr_uid and pr_gid so it is expected to be safe. - - [BZ #18400] - * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (struct elf_prpsinfo): - Fix pr_uid and pr_gid members. + + [BZ #18400] + * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (struct elf_prpsinfo): + Fix pr_uid and pr_gid members. diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index cf5e76c..ecc65ab 100644 diff --git a/SOURCES/glibc-rh1335925-3.patch b/SOURCES/glibc-rh1335925-3.patch index d4efbdc2..966f5f5c 100644 --- a/SOURCES/glibc-rh1335925-3.patch +++ b/SOURCES/glibc-rh1335925-3.patch @@ -5,23 +5,23 @@ Author: Szabolcs Nagy Date: Thu Jul 9 09:53:30 2015 +0100 [AArch64][BZ 18648] change greg_t definition in ucontext.h - + This is an ABI breaking change, but - - typedef int greg_t; - + + typedef int greg_t; + is not a useful definition on aarch64. - + greg_t is usually used for defining gregset_t which is used in mcontext_t. The general registers in mcontext_t can only be accessed by target specific code and on aarch64 greg_t is not needed for that so this change is not supposed to break existing code, just fix the definition. - - [BZ #18648] - * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (greg_t): Change the - definition to elf_greg_t. - + + [BZ #18648] + * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (greg_t): Change the + definition to elf_greg_t. + (Added another BZ entry that was missed in the previous commit). diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h @@ -31,9 +31,9 @@ index db7a7c1..e7268ce 100644 @@ -29,7 +29,7 @@ included in . */ #include - + -typedef int greg_t; +typedef elf_greg_t greg_t; - + /* Container for all general registers. */ typedef elf_gregset_t gregset_t; diff --git a/SOURCES/glibc-rh1335925-4.patch b/SOURCES/glibc-rh1335925-4.patch index 593f31ac..2b0105b7 100644 --- a/SOURCES/glibc-rh1335925-4.patch +++ b/SOURCES/glibc-rh1335925-4.patch @@ -5,31 +5,31 @@ Author: Szabolcs Nagy Date: Mon Jul 6 12:46:43 2015 +0100 [AArch64] make setcontext etc functions consistent with the kernel - + since https://sourceware.org/ml/libc-alpha/2014-04/msg00006.html setcontext etc is no longer tied to the kernel use of ucontext. - + in that patch the ucontext reserved space is not used consistently with the kernel abi: the d8,d9 pair is saved in the slot of q8. - + this is ok (*context functions work together), but probably not desirable (ucontexts created by the kernel and getcontext are subtly different). - + the fix just replaces dN with qN in the save/restore code, which does a bit more than needed (saves/restores the top half of qN that is not callee saved), but this should not be an issue (and avoids having to deal with endianness). - + (kernel fpsimd context layout: the first 64bit contains 0x210 the fpsimd context size and 0x46508001 the FPSIMD_MAGIC, the second 64bit is for fpsr and fpcr, and the rest is the 128bit q0..q31 registers). - + given d8=8.1, d9=9.1,... d15=15.1, the context created by getcontext is - + current: - + (gdb) x/40xg ctx.uc_mcontext.__reserved 0x410df0 : 0x0000021046508001 0x0000000000000000 0x410e00 : 0x0000000000000000 0x0000000000000000 @@ -51,9 +51,9 @@ Date: Mon Jul 6 12:46:43 2015 +0100 0x410f00 : 0x0000000000000000 0x0000000000000000 0x410f10 : 0x0000000000000000 0x0000000000000000 0x410f20 : 0x0000000000000000 0x0000000000000000 - + fixed: - + (gdb) x/40xg ctx.uc_mcontext.__reserved 0x410d70 : 0x0000021046508001 0x0000000000000000 0x410d80 : 0x0000000000000000 0x0000000000000000 @@ -75,23 +75,23 @@ Date: Mon Jul 6 12:46:43 2015 +0100 0x410e80 : 0x0000000000000000 0x0000000000000000 0x410e90 : 0x0000000000000000 0x0000000000000000 0x410ea0 : 0x0000000000000000 0x0000000000000000 - + 2015-07-06 Szabolcs Nagy - - * sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext): Use q - registers instead of d ones so the layout is kernel abi compatible. - * sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext): Likewise. - * sysdeps/unix/sysv/linux/aarch64/swapcontext.S (__swapcontext): - Likewise.# Please enter the commit message for your changes. Lines starting + + * sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext): Use q + registers instead of d ones so the layout is kernel abi compatible. + * sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext): Likewise. + * sysdeps/unix/sysv/linux/aarch64/swapcontext.S (__swapcontext): + Likewise.# Please enter the commit message for your changes. Lines starting diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S index adf8037..b72436f 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S +++ b/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S @@ -69,10 +69,10 @@ ENTRY(__getcontext) - - /* Fill in the FP SIMD context. */ - add x3, x2, #oV0 + 8 * SZVREG + + /* Fill in the FP SIMD context. */ + add x3, x2, #oV0 + 8 * SZVREG - stp d8, d9, [x3], # 2 * SZVREG - stp d10, d11, [x3], # 2 * SZVREG - stp d12, d13, [x3], # 2 * SZVREG @@ -100,17 +100,17 @@ index adf8037..b72436f 100644 + stp q10, q11, [x3], # 2 * SZVREG + stp q12, q13, [x3], # 2 * SZVREG + stp q14, q15, [x3], # 2 * SZVREG - - add x3, x2, oFPSR - + + add x3, x2, oFPSR + diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S b/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S index ae67581..8d926f7 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S +++ b/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S @@ -97,10 +97,10 @@ ENTRY (__setcontext) - - /* Restore the FP SIMD context. */ - add x3, x2, #oV0 + 8 * SZVREG + + /* Restore the FP SIMD context. */ + add x3, x2, #oV0 + 8 * SZVREG - ldp d8, d9, [x3], #2 * SZVREG - ldp d10, d11, [x3], #2 * SZVREG - ldp d12, d13, [x3], #2 * SZVREG @@ -119,17 +119,17 @@ index ae67581..8d926f7 100644 + ldp q10, q11, [x3], #2 * SZVREG + ldp q12, q13, [x3], #2 * SZVREG + ldp q14, q15, [x3], #2 * SZVREG - - add x3, x2, oFPSR - + + add x3, x2, oFPSR + diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/ports/sysdeps/unix/sysv/linux/aarch64/swapcontext.S index f62fc11..05ad8d3 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/swapcontext.S +++ b/ports/sysdeps/unix/sysv/linux/aarch64/swapcontext.S @@ -54,10 +54,10 @@ ENTRY(__swapcontext) - - /* Fill in the FP SIMD context. */ - add x3, x2, #oV0 + 8 * SZVREG + + /* Fill in the FP SIMD context. */ + add x3, x2, #oV0 + 8 * SZVREG - stp d8, d9, [x3], #2 * SZVREG - stp d10, d11, [x3], #2 * SZVREG - stp d12, d13, [x3], #2 * SZVREG @@ -138,5 +138,6 @@ index f62fc11..05ad8d3 100644 + stp q10, q11, [x3], #2 * SZVREG + stp q12, q13, [x3], #2 * SZVREG + stp q14, q15, [x3], #2 * SZVREG - - add x3, x2, #oFPSR + + add x3, x2, #oFPSR + diff --git a/SOURCES/glibc-rh1337242.patch b/SOURCES/glibc-rh1337242.patch index 84ade8dc..04194ed4 100644 --- a/SOURCES/glibc-rh1337242.patch +++ b/SOURCES/glibc-rh1337242.patch @@ -3,12 +3,12 @@ Author: Stefan Liebler Date: Tue May 17 10:45:48 2016 +0200 Fix tst-cancel17/tst-cancelx17, which sometimes segfaults while exiting. - + The testcase tst-cancel[x]17 ends sometimes with a segmentation fault. This happens in one of 10000 cases. Then the real testcase has already exited with success and returned from do_test(). The segmentation fault occurs after returning from main in _dl_fini(). - + In those cases, the aio_read(&a) was not canceled because the read request was already in progress. In the meanwhile aio_write(ap) wrote something to the pipe and the read request is able to read the @@ -18,29 +18,29 @@ Date: Tue May 17 10:45:48 2016 +0200 read syscall to the struct aiocb a, which lies on the stack of do_test. The stack of the subsequent function call of _dl_fini or _dl_sort_fini, which is inlined in _dl_fini is corrupted. - + In case of S390, it reads a zero and decrements it by 1: unsigned int k = nmaps - 1; struct link_map **runp = maps[k]->l_initfini; The load from unmapped memory leads to the segmentation fault. The stack corruption also happens on other architectures. I saw them e.g. on x86 and ppc, too. - + This patch adds an aio_suspend call to ensure, that the read request is finished before returning from do_test(). - + ChangeLog: - - * nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a). + + * nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a). diff --git a/nptl/tst-cancel17.c b/nptl/tst-cancel17.c index fb89292..eedd28e 100644 --- a/nptl/tst-cancel17.c +++ b/nptl/tst-cancel17.c @@ -333,6 +333,22 @@ do_test (void) - + puts ("early cancellation succeeded"); - + + if (ap == &a2) + { + /* The aio_read(&a) was not canceled because the read request was @@ -59,3 +59,4 @@ index fb89292..eedd28e 100644 + return 0; } + diff --git a/SOURCES/glibc-rh1338672.patch b/SOURCES/glibc-rh1338672.patch index aa72e26b..eb896660 100644 --- a/SOURCES/glibc-rh1338672.patch +++ b/SOURCES/glibc-rh1338672.patch @@ -3,10 +3,10 @@ Author: Florian Weimer Date: Mon May 23 19:43:09 2016 +0200 Make padding in struct sockaddr_storage explicit [BZ #20111] - + This avoids aliasing issues with GCC 6 in -fno-strict-aliasing mode. (With implicit padding, not all data is copied.) - + This change makes it explicit that struct sockaddr_storage is only 126 bytes large on m68k (unlike elsewhere, where we end up with the requested 128 bytes). The new test case makes sure that @@ -22,11 +22,11 @@ diff -rupN a/bits/sockaddr.h b/bits/sockaddr.h +/* Definition of struct sockaddr_* common members and sizes, generic version. Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. - + @@ -36,4 +36,7 @@ typedef unsigned short int sa_family_t; - + #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) - + +/* Size of struct sockaddr_storage. */ +#define _SS_SIZE 128 + @@ -35,8 +35,8 @@ diff -rupN a/bits/socket.h b/bits/socket.h --- a/bits/socket.h 2012-12-24 22:02:13.000000000 -0500 +++ b/bits/socket.h 2017-03-01 16:38:24.861208175 -0500 @@ -133,20 +133,20 @@ struct sockaddr - - + + /* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ + exception of AF_UNIX). */ @@ -49,7 +49,7 @@ diff -rupN a/bits/socket.h b/bits/socket.h -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) +#define _SS_PADSIZE \ + (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) - + struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ @@ -57,28 +57,28 @@ diff -rupN a/bits/socket.h b/bits/socket.h char __ss_padding[_SS_PADSIZE]; + __ss_aligntype __ss_align; /* Force desired alignment. */ }; - - + + diff -rupN a/inet/Makefile b/inet/Makefile --- a/inet/Makefile 2017-03-01 16:06:12.000000000 -0500 +++ b/inet/Makefile 2017-03-01 16:55:21.919485376 -0500 @@ -51,7 +51,7 @@ aux := check_pf check_native ifreq - + tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \ - tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ + tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ - tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-deadline + tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-deadline tst-sockaddr - + # tst-deadline must be linked statically so that we can access # internal functions. @@ -89,6 +89,8 @@ CFLAGS-either_hton.c = -fexceptions CFLAGS-getnetgrent.c = -fexceptions CFLAGS-getnetgrent_r.c = -fexceptions - + +CFLAGS-tst-sockaddr.c = -fno-strict-aliasing + endif - + ifeq ($(build-static-nss),yes) diff -rupN a/inet/tst-sockaddr.c b/inet/tst-sockaddr.c --- a/inet/tst-sockaddr.c 1969-12-31 19:00:00.000000000 -0500 @@ -213,8 +213,8 @@ diff -rupN a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h --- a/sysdeps/mach/hurd/bits/socket.h 2012-12-24 22:02:13.000000000 -0500 +++ b/sysdeps/mach/hurd/bits/socket.h 2017-03-01 16:38:24.873208329 -0500 @@ -156,20 +156,20 @@ struct sockaddr - - + + /* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ + exception of AF_UNIX). */ @@ -227,7 +227,7 @@ diff -rupN a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) +#define _SS_PADSIZE \ + (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) - + struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ @@ -235,20 +235,20 @@ diff -rupN a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h char __ss_padding[_SS_PADSIZE]; + __ss_aligntype __ss_align; /* Force desired alignment. */ }; - - + + diff -rupN a/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h b/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h --- a/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h 2012-12-24 22:02:13.000000000 -0500 +++ b/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h 2017-03-01 17:30:34.962261748 -0500 @@ -37,6 +37,9 @@ typedef unsigned char sa_family_t; - + #define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char)) - + +/* Size of struct sockaddr_storage. */ +#define _SS_SIZE 128 + #define _HAVE_SA_LEN 1 /* We have the sa_len field. */ - + #endif /* bits/sockaddr.h */ diff -rupN a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bits/socket.h --- a/sysdeps/unix/bsd/bsd4.4/bits/socket.h 2012-12-24 22:02:13.000000000 -0500 @@ -260,7 +260,7 @@ diff -rupN a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bit -#define _SS_SIZE 128 -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) +#define _SS_PADSIZE (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) - + struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ @@ -268,14 +268,14 @@ diff -rupN a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bit char __ss_padding[_SS_PADSIZE]; + __ss_aligntype __ss_align; /* Force desired alignment. */ }; - - + + diff -rupN a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h --- a/sysdeps/unix/sysv/linux/bits/socket.h 2017-03-01 16:06:12.000000000 -0500 +++ b/sysdeps/unix/sysv/linux/bits/socket.h 2017-03-01 16:38:26.993235460 -0500 @@ -155,16 +155,16 @@ struct sockaddr - - + + /* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ + exception of AF_UNIX). */ @@ -284,7 +284,7 @@ diff -rupN a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bit -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) +#define _SS_PADSIZE \ + (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) - + struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ @@ -292,3 +292,5 @@ diff -rupN a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bit char __ss_padding[_SS_PADSIZE]; + __ss_aligntype __ss_align; /* Force desired alignment. */ }; + + diff --git a/SOURCES/glibc-rh1346397.patch b/SOURCES/glibc-rh1346397.patch index 0a252ae6..3300da54 100644 --- a/SOURCES/glibc-rh1346397.patch +++ b/SOURCES/glibc-rh1346397.patch @@ -5,10 +5,10 @@ Author: Florian Weimer Date: Mon Jun 13 13:08:39 2016 +0200 debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248] - + Currently, printf needs more stack space than what is available with SIGSTKSZ. This commit use the the write system call directly instead. - + Also use sig_atomic_t for the “pass” variable (for general correctness), and restore signal handlers to their defaults, to avoid masking crashes. @@ -18,11 +18,11 @@ Author: Mike Frysinger Date: Sun Dec 29 16:30:35 2013 -0500 tst-longjmp_chk2: add comments/sanity check - + If the longjmp checking code is slightly broken, this code can loop forever which isn't too helpful. Add a sanity check to keep that from happening. - + Signed-off-by: Mike Frysinger Index: b/debug/tst-longjmp_chk2.c @@ -38,13 +38,13 @@ Index: b/debug/tst-longjmp_chk2.c #include #include +#include - - + + static jmp_buf mainloop; static sigset_t mainsigset; -static int pass; +static volatile sig_atomic_t pass; - + +static void +write_message (const char *message) +{ @@ -53,7 +53,7 @@ Index: b/debug/tst-longjmp_chk2.c + unused = write (STDOUT_FILENO, " ", 1); + unused = write (STDOUT_FILENO, message, strlen (message)); +} - + static void stackoverflow_handler (int sig) { @@ -70,11 +70,11 @@ Index: b/debug/tst-longjmp_chk2.c + write_message ("on alternate stack\n"); siglongjmp (mainloop, pass); } - + @@ -107,6 +116,11 @@ do_test (void) else printf ("disabling alternate stack succeeded \n"); - + + /* Restore the signal handlers, in case we trigger a crash after the + tests above. */ + signal (SIGBUS, SIG_DFL); @@ -82,3 +82,4 @@ Index: b/debug/tst-longjmp_chk2.c + return 0; } + diff --git a/SOURCES/glibc-rh1347277.patch b/SOURCES/glibc-rh1347277.patch index 5353402a..9ea98b7b 100644 --- a/SOURCES/glibc-rh1347277.patch +++ b/SOURCES/glibc-rh1347277.patch @@ -6,15 +6,15 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c --- a/malloc/hooks.c 2017-08-11 14:20:36.000000000 -0400 +++ b/malloc/hooks.c 2017-08-11 15:43:15.939831964 -0400 @@ -240,10 +240,10 @@ top_check(void) - (char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem))) + (char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem))) return 0; - + - mutex_unlock(&main_arena); + mutex_unlock(&main_arena.mutex); malloc_printerr (check_action, "malloc: top chunk is corrupt", t, - &main_arena); + &main_arena); - mutex_lock(&main_arena); + mutex_lock(&main_arena.mutex); - + /* Try to set up a new top chunk. */ brk = MORECORE(0); diff --git a/SOURCES/glibc-rh1348000.patch b/SOURCES/glibc-rh1348000.patch index 8c4c5398..d446b8f6 100644 --- a/SOURCES/glibc-rh1348000.patch +++ b/SOURCES/glibc-rh1348000.patch @@ -14,7 +14,7 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c @@ -87,11 +87,22 @@ __malloc_check_init() overruns. The goal here is to avoid obscure crashes due to invalid usage, unlike in the MALLOC_DEBUG code. */ - + -#define MAGICBYTE(p) ( ( ((size_t)p >> 3) ^ ((size_t)p >> 11)) & 0xFF ) +static unsigned char +magicbyte (const void *p) @@ -28,7 +28,7 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c + return magic; +} + - + -/* Visualize the chunk as being partitioned into blocks of 256 bytes from the - highest address of the chunk, downwards. The beginning of each block tells - us the size of the previous block, up to the actual size of the requested @@ -44,16 +44,16 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c unsigned char c; - unsigned char magic = MAGICBYTE(p); + unsigned char magic = magicbyte (p); - + assert(using_malloc_checking == 1); - + @@ -120,29 +131,35 @@ malloc_check_get_size(mchunkptr p) } - + /* Instrument a chunk with overrun detector byte(s) and convert it - into a user pointer with requested size sz. */ + into a user pointer with requested size req_sz. */ - + static void* internal_function -mem2mem_check(void *ptr, size_t sz) @@ -64,7 +64,7 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c - size_t i; + size_t max_sz, block_sz, i; + unsigned char magic; - + if (!ptr) return ptr; p = mem2chunk(ptr); @@ -94,9 +94,9 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c + m_ptr[req_sz] = magic; return (void*)m_ptr; } - + @@ -159,10 +176,11 @@ mem2chunk_check(void* mem, unsigned char - + if(!aligned_OK(mem)) return NULL; p = mem2chunk(mem); + sz = chunksize (p); @@ -106,11 +106,11 @@ diff -rup a/malloc/hooks.c b/malloc/hooks.c int contig = contiguous(&main_arena); - sz = chunksize(p); if((contig && - ((char*)p=(mp_.sbrk_base+main_arena.system_mem) )) || + ((char*)p=(mp_.sbrk_base+main_arena.system_mem) )) || @@ -171,9 +189,9 @@ mem2chunk_check(void* mem, unsigned char - (contig && (char*)prev_chunk(p)size & PREV_INUSE) || ( (((unsigned long)p - p->prev_size) & page_mask) != 0 ) || - ( (sz = chunksize(p)), ((p->prev_size + sz) & page_mask) != 0 ) ) diff --git a/SOURCES/glibc-rh1349962.patch b/SOURCES/glibc-rh1349962.patch index 6cd5aeb1..208dce6a 100644 --- a/SOURCES/glibc-rh1349962.patch +++ b/SOURCES/glibc-rh1349962.patch @@ -42,22 +42,22 @@ index 05a07cb301f9506e..19824f01a11f9af9 100644 { if (__gen_tempname (template, 0, 0, __GT_NOCREATE) < 0) @@ -31,5 +31,6 @@ mktemp (template) - + return template; } +weak_alias (__mktemp, mktemp) - + link_warning (mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'") diff --git a/nptl/sem_open.c b/nptl/sem_open.c index d87076e04a55cf71..a0c488b62ffebcc4 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -334,7 +334,7 @@ sem_open (const char *name, int oflag, ...) - since the file must be opened with a specific mode. The - mode cannot later be set since then we cannot apply the - file create mask. */ + since the file must be opened with a specific mode. The + mode cannot later be set since then we cannot apply the + file create mask. */ - if (mktemp (tmpfname) == NULL) + if (__mktemp (tmpfname) == NULL) - return SEM_FAILED; - - /* Open the file. Make sure we do not overwrite anything. */ + return SEM_FAILED; + + /* Open the file. Make sure we do not overwrite anything. */ diff --git a/SOURCES/glibc-rh1349964.patch b/SOURCES/glibc-rh1349964.patch index ed85dc87..e0e8a8b7 100644 --- a/SOURCES/glibc-rh1349964.patch +++ b/SOURCES/glibc-rh1349964.patch @@ -18,7 +18,7 @@ index dd4a5d147f46b0d4..1eae271186bc80a9 100644 - char *archivefname = ah->fname; + const char *archivefname = ah->fname; bool defaultfname = false; - + /* If ah has a non-NULL fname open that otherwise open the default. */ @@ -530,8 +530,8 @@ open_archive (struct locarhandle *ah, bool readonly) defaultfname = true; @@ -29,5 +29,5 @@ index dd4a5d147f46b0d4..1eae271186bc80a9 100644 + memcpy (fname, output_prefix, prefix_len); + strcpy (fname + prefix_len, ARCHIVE_NAME); } - + while (1) diff --git a/SOURCES/glibc-rh1350733-1.patch b/SOURCES/glibc-rh1350733-1.patch index d9af9979..1da74c66 100644 --- a/SOURCES/glibc-rh1350733-1.patch +++ b/SOURCES/glibc-rh1350733-1.patch @@ -10,7 +10,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c @@ -92,23 +92,34 @@ xmalloc (size_t size) return p; } - + +static char * +xasprintf (const char *format, ...) +{ @@ -30,7 +30,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c int fd; struct locarhead head; - const char *archivefname = ah->fname == NULL ? tmpl_file : ah->fname; - + /* Open the archive. We must have exclusive write access. */ - fd = open64 (archivefname, O_RDONLY); + fd = open64 (tmpl_file, O_RDONLY); @@ -38,22 +38,22 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c error (EXIT_FAILURE, errno, "cannot open locale archive template file \"%s\"", - archivefname); + tmpl_file); - + if (fstat64 (fd, &st) < 0) error (EXIT_FAILURE, errno, "cannot stat locale archive template file \"%s\"", - archivefname); + tmpl_file); - + /* Read the header. */ if (TEMP_FAILURE_RETRY (read (fd, &head, sizeof (head))) != sizeof (head)) @@ -253,12 +264,11 @@ compute_data (struct locarhandle *ah, st - + static int fill_archive (struct locarhandle *tmpl_ah, - const char *fname, - size_t install_langs_count, char *install_langs_list[], - size_t nlist, char *list[], - const char *primary) + size_t install_langs_count, char *install_langs_list[], + size_t nlist, char *list[], + const char *primary) { - struct locarhandle ah; + struct locarhandle ah = {}; @@ -61,14 +61,14 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c int result = 0; struct nameent *names; @@ -338,9 +348,6 @@ fill_archive (struct locarhandle *tmpl_a - + /* Open the archive. This call never returns if we cannot successfully open the archive. */ - ah.fname = NULL; - if (fname != NULL) - ah.fname = fname; open_archive (&ah, false); - + if (primary != NULL) @@ -619,38 +626,39 @@ Usage: build-locale-archive [OPTION]... \"de\" but also the aliases \"deutsch\"\n\ @@ -80,7 +80,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c - where the glibc used expects these files are used by default.\n\ "); } - + int main (int argc, char *argv[]) { - char path[4096]; @@ -98,11 +98,11 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c - char *new_locar_fname = NULL; - size_t loc_path_len = strlen (loc_path); + struct locarhandle tmpl_ah = {}; - + while (1) { int c; - + + enum + { + opt_prefix = 1000, @@ -120,7 +120,7 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c @@ -721,6 +729,10 @@ int main (int argc, char *argv[]) } break; - + + case opt_prefix: + output_prefix = optarg; + break; @@ -168,11 +168,11 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c + printf ("input locale directory prefix: %s\n", loc_path); + printf ("output archive file: %s\n", locar_file); } - + dirp = opendir (loc_path); @@ -754,11 +769,7 @@ int main (int argc, char *argv[]) error (EXIT_FAILURE, errno, "cannot open directory \"%s\"", loc_path); - + open_tmpl_archive (&tmpl_ah); - - if (new_locar_fname) @@ -180,13 +180,13 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c - else - unlink (locar_file); + unlink (locar_file); - + primary = getenv ("LC_ALL"); if (primary == NULL) @@ -790,8 +801,6 @@ int main (int argc, char *argv[]) - } + } } - + - memcpy (path, loc_path, loc_path_len); - while ((d = readdir64 (dirp)) != NULL) @@ -194,8 +194,8 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c if (strcmp (d->d_name, ".") == 0 || strcmp (d->d_name, "..") == 0) @@ -799,32 +808,25 @@ int main (int argc, char *argv[]) if (strchr (d->d_name, '_') == NULL) - continue; - + continue; + - size_t d_name_len = strlen (d->d_name); - if (loc_path_len + d_name_len + 1 > sizeof (path)) - { @@ -206,11 +206,11 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c - memcpy (path + loc_path_len, d->d_name, d_name_len + 1); + char *path = xasprintf ("%s%s", loc_path, d->d_name); if (stat64 (path, &st) < 0) - { - error (0, errno, "cannot stat \"%s\"", path); + { + error (0, errno, "cannot stat \"%s\"", path); + free (path); - continue; - } + continue; + } if (! S_ISDIR (st.st_mode)) - continue; + { @@ -218,11 +218,11 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c + continue; + } if (cnt == 16384) - { - error (0, 0, "too many directories in \"%s\"", loc_path); + { + error (0, 0, "too many directories in \"%s\"", loc_path); + free (path); - break; - } + break; + } - list[cnt] = strdup (path); - if (list[cnt] == NULL) - { @@ -231,8 +231,8 @@ Index: glibc-2.17-c758a686/releng/build-locale-archive.c - } + list[cnt] = path; if (primary != NULL && cnt > 0 && strcmp (primary, d->d_name) == 0) - { - char *p = list[0]; + { + char *p = list[0]; @@ -836,7 +838,7 @@ int main (int argc, char *argv[]) closedir (dirp); /* Store the archive to the file specified as the second argument on the diff --git a/SOURCES/glibc-rh1366569.patch b/SOURCES/glibc-rh1366569.patch index 1fc66ae3..c69b7337 100644 --- a/SOURCES/glibc-rh1366569.patch +++ b/SOURCES/glibc-rh1366569.patch @@ -11,6 +11,6 @@ Index: b/releng/nsswitch.conf group: files sss -initgroups: files +#initgroups: files sss - + #hosts: db files nisplus nis dns hosts: files dns diff --git a/SOURCES/glibc-rh1370630.patch b/SOURCES/glibc-rh1370630.patch index de5b4dc1..30d3d4fa 100644 --- a/SOURCES/glibc-rh1370630.patch +++ b/SOURCES/glibc-rh1370630.patch @@ -3,20 +3,20 @@ Author: Alexandre Oliva Date: Fri Nov 21 03:29:56 2014 -0200 BZ#14498: fix infinite loop in nss_db_getservbyname - + nss_db uses nss_files code for services, but a continue on protocol mismatch that doesn't affect nss_files skipped the code that advanced to the next db entry. Any one of these changes would suffice to fix it, but fixing both makes them both safer to reuse elsewhere. - + for ChangeLog - - [BZ #14498] - * NEWS: Fixed. - * nss/nss_db/db-XXX.c (_nss_db_get##name##_r): Update hidx - after parsing line but before break_if_match. - * nss/nss_files/files-service (DB_LOOKUP): Don't "continue;" - if there is a protocol mismatch. + + [BZ #14498] + * NEWS: Fixed. + * nss/nss_db/db-XXX.c (_nss_db_get##name##_r): Update hidx + after parsing line but before break_if_match. + * nss/nss_files/files-service (DB_LOOKUP): Don't "continue;" + if there is a protocol mismatch. Index: b/nss/nss_db/db-XXX.c =================================================================== @@ -24,7 +24,7 @@ Index: b/nss/nss_db/db-XXX.c +++ b/nss/nss_db/db-XXX.c @@ -190,6 +190,12 @@ enum nss_status \ char *p = memcpy (buffer, valstr, len); \ - \ + \ int err = parse_line (p, result, data, buflen, errnop EXTRA_ARGS); \ + \ + /* Advance before break_if_match, lest it uses continue to skip @@ -33,26 +33,26 @@ Index: b/nss/nss_db/db-XXX.c + hidx -= header->dbs[i].hashsize; \ + \ if (err > 0) \ - { \ - status = NSS_STATUS_SUCCESS; \ + { \ + status = NSS_STATUS_SUCCESS; \ @@ -202,9 +208,6 @@ enum nss_status \ - status = NSS_STATUS_TRYAGAIN; \ - break; \ - } \ + status = NSS_STATUS_TRYAGAIN; \ + break; \ + } \ - \ - if ((hidx += hval2) >= header->dbs[i].hashsize) \ - hidx -= header->dbs[i].hashsize; \ } \ - \ + \ if (status == NSS_STATUS_NOTFOUND) \ Index: b/nss/nss_files/files-service.c =================================================================== --- a/nss/nss_files/files-service.c +++ b/nss/nss_files/files-service.c @@ -44,8 +44,11 @@ DB_LOOKUP (servbyname, ':', - { - /* Must match both protocol (if specified) and name. */ - if (proto != NULL && strcmp (result->s_proto, proto)) + { + /* Must match both protocol (if specified) and name. */ + if (proto != NULL && strcmp (result->s_proto, proto)) - continue; - LOOKUP_NAME (s_name, s_aliases) + /* A continue statement here breaks nss_db, because it @@ -60,5 +60,6 @@ Index: b/nss/nss_files/files-service.c + doesn't make nss_files any more efficient. */; + else + LOOKUP_NAME (s_name, s_aliases) - }, - const char *name, const char *proto) + }, + const char *name, const char *proto) + diff --git a/SOURCES/glibc-rh1372305.patch b/SOURCES/glibc-rh1372305.patch index b6d7f22f..2429cf7e 100644 --- a/SOURCES/glibc-rh1372305.patch +++ b/SOURCES/glibc-rh1372305.patch @@ -14,15 +14,15 @@ index 5dcbe51f11182b68..b1c0d7f6ccc4db15 100644 struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; + cookie_read_function_t *read_cb = cfile->__io_functions.read; + PTR_DEMANGLE (read_cb); - + - if (cfile->__io_functions.read == NULL) + if (read_cb == NULL) return -1; - + - return cfile->__io_functions.read (cfile->__cookie, buf, size); + return read_cb (cfile->__cookie, buf, size); } - + static _IO_ssize_t @@ -60,14 +62,16 @@ _IO_cookie_write (fp, buf, size) _IO_ssize_t size; @@ -30,53 +30,53 @@ index 5dcbe51f11182b68..b1c0d7f6ccc4db15 100644 struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; + cookie_write_function_t *write_cb = cfile->__io_functions.write; + PTR_DEMANGLE (write_cb); - + - if (cfile->__io_functions.write == NULL) + if (write_cb == NULL) { fp->_flags |= _IO_ERR_SEEN; return 0; } - + - _IO_ssize_t n = cfile->__io_functions.write (cfile->__cookie, buf, size); + _IO_ssize_t n = write_cb (cfile->__cookie, buf, size); if (n < size) fp->_flags |= _IO_ERR_SEEN; - + @@ -81,9 +85,11 @@ _IO_cookie_seek (fp, offset, dir) int dir; { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; + cookie_seek_function_t *seek_cb = cfile->__io_functions.seek; + PTR_DEMANGLE (seek_cb); - + - return ((cfile->__io_functions.seek == NULL - || (cfile->__io_functions.seek (cfile->__cookie, &offset, dir) + return ((seek_cb == NULL + || (seek_cb (cfile->__cookie, &offset, dir) - == -1) - || offset == (_IO_off64_t) -1) - ? _IO_pos_BAD : offset); + == -1) + || offset == (_IO_off64_t) -1) + ? _IO_pos_BAD : offset); @@ -94,11 +100,13 @@ _IO_cookie_close (fp) _IO_FILE *fp; { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; + cookie_close_function_t *close_cb = cfile->__io_functions.close; + PTR_DEMANGLE (close_cb); - + - if (cfile->__io_functions.close == NULL) + if (close_cb == NULL) return 0; - + - return cfile->__io_functions.close (cfile->__cookie); + return close_cb (cfile->__cookie); } - - + + @@ -140,6 +148,19 @@ static const struct _IO_jump_t _IO_cookie_jumps libio_vtable = { }; - - + + +/* Copy the callbacks from SOURCE to *TARGET, with pointer + mangling. */ +static void @@ -92,16 +92,16 @@ index 5dcbe51f11182b68..b1c0d7f6ccc4db15 100644 + void _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write, - void *cookie, _IO_cookie_io_functions_t io_functions) + void *cookie, _IO_cookie_io_functions_t io_functions) @@ -148,7 +169,7 @@ _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write, _IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps; - + cfile->__cookie = cookie; - cfile->__io_functions = io_functions; + set_callbacks (&cfile->__io_functions, io_functions); - + _IO_new_file_init_internal (&cfile->__fp); - + @@ -223,14 +244,14 @@ _IO_old_cookie_seek (fp, offset, dir) int dir; { @@ -111,14 +111,14 @@ index 5dcbe51f11182b68..b1c0d7f6ccc4db15 100644 + int (*seek_cb) (_IO_FILE *, _IO_off_t, int) + = (int (*) (_IO_FILE *, _IO_off_t, int)) cfile->__io_functions.seek;; + PTR_DEMANGLE (seek_cb); - + - seek = (int (*)(_IO_FILE *, _IO_off_t, int)) cfile->__io_functions.seek; - if (seek == NULL) + if (seek_cb == NULL) return _IO_pos_BAD; - + - ret = seek (cfile->__cookie, offset, dir); + int ret = seek_cb (cfile->__cookie, offset, dir); - + return (ret == -1) ? _IO_pos_BAD : ret; } diff --git a/SOURCES/glibc-rh1374652.patch b/SOURCES/glibc-rh1374652.patch index c12441f6..e753e516 100644 --- a/SOURCES/glibc-rh1374652.patch +++ b/SOURCES/glibc-rh1374652.patch @@ -125,7 +125,7 @@ diff -rupN a/include/stdlib.h b/include/stdlib.h @@ -193,6 +193,24 @@ libc_hidden_proto (strtoll) libc_hidden_proto (strtoul) libc_hidden_proto (strtoull) - + +extern float __strtof_nan (const char *, char **, char) internal_function; +extern double __strtod_nan (const char *, char **, char) internal_function; +extern long double __strtold_nan (const char *, char **, char) @@ -145,15 +145,15 @@ diff -rupN a/include/stdlib.h b/include/stdlib.h +libc_hidden_proto (__wcstold_nan) + extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt, - int *__restrict __sign); + int *__restrict __sign); extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt, diff -rupN a/include/wchar.h b/include/wchar.h --- a/include/wchar.h 2012-12-24 22:02:13.000000000 -0500 +++ b/include/wchar.h 2017-03-02 16:45:05.461639109 -0500 @@ -52,6 +52,9 @@ extern unsigned long long int __wcstoull - __restrict __endptr, - int __base, - int __group) __THROW; + __restrict __endptr, + int __base, + int __group) __THROW; +extern unsigned long long int ____wcstoull_l_internal (const wchar_t *, + wchar_t **, int, int, + __locale_t); @@ -165,8 +165,8 @@ diff -rupN a/math/Makefile b/math/Makefile +++ b/math/Makefile 2017-03-02 16:44:30.659725844 -0500 @@ -88,7 +88,8 @@ long-c-yes = $(calls:=l) tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ - test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \ - bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \ + test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \ + bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \ - test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 + test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 \ + test-nan-overflow test-nan-payload @@ -428,13 +428,13 @@ diff -rupN a/stdlib/Makefile b/stdlib/Makefile --- a/stdlib/Makefile 2017-03-02 16:34:02.000000000 -0500 +++ b/stdlib/Makefile 2017-03-02 16:45:05.463639105 -0500 @@ -47,6 +47,7 @@ routines := \ - strtol_l strtoul_l strtoll_l strtoull_l \ - strtof strtod strtold \ - strtof_l strtod_l strtold_l \ + strtol_l strtoul_l strtoll_l strtoull_l \ + strtof strtod strtold \ + strtof_l strtod_l strtold_l \ + strtof_nan strtod_nan strtold_nan \ - system canonicalize \ - a64l l64a \ - rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \ + system canonicalize \ + a64l l64a \ + rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \ diff -rupN a/stdlib/Versions b/stdlib/Versions --- a/stdlib/Versions 2012-12-24 22:02:13.000000000 -0500 +++ b/stdlib/Versions 2017-03-02 16:44:52.140671064 -0500 @@ -450,11 +450,11 @@ diff -rupN a/stdlib/strtod_l.c b/stdlib/strtod_l.c +++ b/stdlib/strtod_l.c 2017-03-02 16:59:50.224590342 -0500 @@ -20,8 +20,6 @@ #include - + extern double ____strtod_l_internal (const char *, char **, int, __locale_t); -extern unsigned long long int ____strtoull_l_internal (const char *, char **, - int, int, __locale_t); - + /* Configuration part. These macros are defined by `strtold.c', `strtof.c', `wcstod.c', `wcstold.c', and `wcstof.c' to produce the @@ -33,28 +31,20 @@ extern unsigned long long int ____strtou @@ -502,12 +502,12 @@ diff -rupN a/stdlib/strtod_l.c b/stdlib/strtod_l.c __strncasecmp_l ((S1), (S2), (N), _nl_C_locobj_ptr) -# define STRTOULL(S, E, B) ____strtoull_l_internal ((S), (E), (B), 0, loc) #endif - - + + @@ -649,33 +637,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group - if (*cp == L_('(')) - { - const STRING_TYPE *startp = cp; + if (*cp == L_('(')) + { + const STRING_TYPE *startp = cp; - do - ++cp; - while ((*cp >= L_('0') && *cp <= L_('9')) @@ -524,7 +524,7 @@ diff -rupN a/stdlib/strtod_l.c b/stdlib/strtod_l.c + if (*endp == L_(')')) + /* Consume the closing parenthesis. */ + cp = endp + 1; - else + else - { - /* This is a system-dependent way to specify the - bitmask used for the NaN. We expect it to be @@ -542,9 +542,9 @@ diff -rupN a/stdlib/strtod_l.c b/stdlib/strtod_l.c - } + /* Only match the NAN part. */ + cp = startp; - } - - if (endptr != NULL) + } + + if (endptr != NULL) diff -rupN a/stdlib/strtod_nan.c b/stdlib/strtod_nan.c --- a/stdlib/strtod_nan.c 1969-12-31 19:00:00.000000000 -0500 +++ b/stdlib/strtod_nan.c 2017-03-02 16:45:05.473639081 -0500 @@ -764,11 +764,11 @@ diff -rupN a/stdlib/strtof_l.c b/stdlib/strtof_l.c +++ b/stdlib/strtof_l.c 2017-03-02 17:06:34.349227993 -0500 @@ -20,27 +20,19 @@ #include - + extern float ____strtof_l_internal (const char *, char **, int, __locale_t); -extern unsigned long long int ____strtoull_l_internal (const char *, char **, - int, int, __locale_t); - + #define FLOAT float #define FLT FLT #ifdef USE_WIDE_CHAR @@ -790,7 +790,7 @@ diff -rupN a/stdlib/strtof_l.c b/stdlib/strtof_l.c - u.ieee.mantissa = (mant) & 0x7fffff; \ - (flt) = u.f; \ - } while (0) - + #include "strtod_l.c" diff -rupN a/stdlib/strtof_nan.c b/stdlib/strtof_nan.c --- a/stdlib/strtof_nan.c 1969-12-31 19:00:00.000000000 -0500 @@ -915,7 +915,7 @@ diff -rupN a/sysdeps/ieee754/ldbl-128/strtold_l.c b/sysdeps/ieee754/ldbl-128/str - u.ieee.mantissa3 = (mant) & 0xffffffff; \ - (flt) = u.d; \ - } while (0) - + #include diff -rupN a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h --- a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h 1969-12-31 19:00:00.000000000 -0500 @@ -979,9 +979,9 @@ diff -rupN a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/sysdeps/ieee754/ldbl-128i - if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0) \ - (flt) = u.ld; \ - } while (0) - + #include - + diff -rupN a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-128/strtold_l.c --- a/sysdeps/ieee754/ldbl-64-128/strtold_l.c 2012-12-24 22:02:13.000000000 -0500 +++ b/sysdeps/ieee754/ldbl-64-128/strtold_l.c 2017-03-02 17:11:06.062475088 -0500 @@ -1011,9 +1011,9 @@ diff -rupN a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-1 - u.ieee.mantissa3 = (mant) & 0xffffffff; \ - (flt) = u.d; \ - } while (0) - + #include - + diff -rupN a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h --- a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h 1969-12-31 19:00:00.000000000 -0500 +++ b/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h 2017-03-02 16:45:05.521638969 -0500 @@ -1072,32 +1072,32 @@ diff -rupN a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strto - u.ieee.mantissa1 = (mant) & 0xffffffff; \ - (flt) = u.d; \ - } while (0) - + #include diff -rupN a/wcsmbs/Makefile b/wcsmbs/Makefile --- a/wcsmbs/Makefile 2017-03-02 16:33:59.000000000 -0500 +++ b/wcsmbs/Makefile 2017-03-02 16:45:05.529638950 -0500 @@ -32,6 +32,7 @@ routines := wcscat wcschr wcscmp wcscpy - wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \ - wcstol_l wcstoul_l wcstoll_l wcstoull_l \ - wcstod_l wcstold_l wcstof_l \ + wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \ + wcstol_l wcstoul_l wcstoll_l wcstoull_l \ + wcstod_l wcstold_l wcstof_l \ + wcstod_nan wcstold_nan wcstof_nan \ - wcscoll wcsxfrm \ - wcwidth wcswidth \ - wcscoll_l wcsxfrm_l \ + wcscoll wcsxfrm \ + wcwidth wcswidth \ + wcscoll_l wcsxfrm_l \ diff -rupN a/wcsmbs/wcstod_l.c b/wcsmbs/wcstod_l.c --- a/wcsmbs/wcstod_l.c 2012-12-24 22:02:13.000000000 -0500 +++ b/wcsmbs/wcstod_l.c 2017-03-02 16:45:05.532638943 -0500 @@ -23,9 +23,6 @@ - + extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int, - __locale_t); + __locale_t); -extern unsigned long long int ____wcstoull_l_internal (const wchar_t *, - wchar_t **, int, int, - __locale_t); - + #define USE_WIDE_CHAR 1 - + diff -rupN a/wcsmbs/wcstod_nan.c b/wcsmbs/wcstod_nan.c --- a/wcsmbs/wcstod_nan.c 1969-12-31 19:00:00.000000000 -0500 +++ b/wcsmbs/wcstod_nan.c 2017-03-02 16:45:05.535638936 -0500 @@ -1129,13 +1129,13 @@ diff -rupN a/wcsmbs/wcstof_l.c b/wcsmbs/wcstof_l.c --- a/wcsmbs/wcstof_l.c 2012-12-24 22:02:13.000000000 -0500 +++ b/wcsmbs/wcstof_l.c 2017-03-02 16:45:05.538638929 -0500 @@ -25,8 +25,5 @@ - + extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int, - __locale_t); + __locale_t); -extern unsigned long long int ____wcstoull_l_internal (const wchar_t *, - wchar_t **, int, int, - __locale_t); - + #include diff -rupN a/wcsmbs/wcstof_nan.c b/wcsmbs/wcstof_nan.c --- a/wcsmbs/wcstof_nan.c 1969-12-31 19:00:00.000000000 -0500 @@ -1168,13 +1168,13 @@ diff -rupN a/wcsmbs/wcstold_l.c b/wcsmbs/wcstold_l.c --- a/wcsmbs/wcstold_l.c 2012-12-24 22:02:13.000000000 -0500 +++ b/wcsmbs/wcstold_l.c 2017-03-02 16:45:05.544638915 -0500 @@ -24,8 +24,5 @@ - + extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int, - __locale_t); + __locale_t); -extern unsigned long long int ____wcstoull_l_internal (const wchar_t *, - wchar_t **, int, int, - __locale_t); - + #include diff -rupN a/wcsmbs/wcstold_nan.c b/wcsmbs/wcstold_nan.c --- a/wcsmbs/wcstold_nan.c 1969-12-31 19:00:00.000000000 -0500 diff --git a/SOURCES/glibc-rh1374654.patch b/SOURCES/glibc-rh1374654.patch index 4d561409..6beffc7b 100644 --- a/SOURCES/glibc-rh1374654.patch +++ b/SOURCES/glibc-rh1374654.patch @@ -7,16 +7,16 @@ diff -rupN a/catgets/Makefile b/catgets/Makefile --- a/catgets/Makefile 2017-03-03 17:54:39.000000000 -0500 +++ b/catgets/Makefile 2017-03-03 18:05:02.506889588 -0500 @@ -44,13 +44,15 @@ catgets-CPPFLAGS := -DNLSPATH='"$(msgcat - + generated = de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \ - test-gencat.h + test-gencat.h +generated += tst-catgets.mtrace tst-catgets-mem.out + generated-dirs = de - + -tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de +tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de MALLOC_TRACE=$(objpfx)tst-catgets.mtrace - + ifeq ($(run-built-tests),yes) tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \ - $(objpfx)test-gencat.out @@ -26,8 +26,8 @@ diff -rupN a/catgets/Makefile b/catgets/Makefile $(objpfx)test1.cat: test1.msg $(objpfx)gencat @@ -78,4 +80,8 @@ $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat - GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ - $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@ + GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ + $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@ + +$(objpfx)tst-catgets-mem.out: $(objpfx)tst-catgets.out + $(common-objpfx)malloc/mtrace $(objpfx)tst-catgets.mtrace > $@; \ @@ -39,7 +39,7 @@ diff -rupN a/catgets/catgets.c b/catgets/catgets.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ - + -#include #include #include @@ -49,23 +49,23 @@ diff -rupN a/catgets/catgets.c b/catgets/catgets.c const char *env_var = NULL; const char *nlspath = NULL; + char *tmp = NULL; - + if (strchr (cat_name, '/') == NULL) { @@ -54,7 +54,10 @@ catopen (const char *cat_name, int flag) - { - /* Append the system dependent directory. */ - size_t len = strlen (nlspath) + 1 + sizeof NLSPATH; + { + /* Append the system dependent directory. */ + size_t len = strlen (nlspath) + 1 + sizeof NLSPATH; - char *tmp = alloca (len); + tmp = malloc (len); + + if (__glibc_unlikely (tmp == NULL)) + return (nl_catd) -1; - - __stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH); - nlspath = tmp; + + __stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH); + nlspath = tmp; @@ -65,16 +68,18 @@ catopen (const char *cat_name, int flag) - + result = (__nl_catd) malloc (sizeof (*result)); if (result == NULL) - /* We cannot get enough memory. */ @@ -83,11 +83,11 @@ diff -rupN a/catgets/catgets.c b/catgets/catgets.c - return (nl_catd) -1; + result = (nl_catd) -1; } - + + free (tmp); return (nl_catd) result; } - + diff -rupN a/catgets/open_catalog.c b/catgets/open_catalog.c --- a/catgets/open_catalog.c 2012-12-24 22:02:13.000000000 -0500 +++ b/catgets/open_catalog.c 2017-03-03 17:55:43.753147332 -0500 @@ -96,7 +96,7 @@ diff -rupN a/catgets/open_catalog.c b/catgets/open_catalog.c const char *lastp; int result = -1; + char *buf = NULL; - + if (strchr (cat_name, '/') != NULL || nlspath == NULL) fd = open_not_cancel_2 (cat_name, O_RDONLY); @@ -57,23 +58,23 @@ __open_catalog (const char *cat_name, co @@ -114,25 +114,25 @@ diff -rupN a/catgets/open_catalog.c b/catgets/open_catalog.c + return -1; \ + } \ } - + /* The RUN_NLSPATH variable contains a colon separated list of - descriptions where we expect to find catalogs. We have to - recognize certain % substitutions and stop when we found the - first existing file. */ + descriptions where we expect to find catalogs. We have to + recognize certain % substitutions and stop when we found the + first existing file. */ - char *buf; size_t bufact; - size_t bufmax; + size_t bufmax = 0; size_t len; - + - buf = NULL; - bufmax = 0; - fd = -1; while (*run_nlspath != '\0') - { + { @@ -188,7 +189,10 @@ __open_catalog (const char *cat_name, co - + /* Avoid dealing with directories and block devices */ if (__builtin_expect (fd, 0) < 0) - return -1; @@ -140,7 +140,7 @@ diff -rupN a/catgets/open_catalog.c b/catgets/open_catalog.c + free (buf); + return -1; + } - + if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) goto close_unlock_return; @@ -325,6 +329,7 @@ __open_catalog (const char *cat_name, co @@ -148,7 +148,7 @@ diff -rupN a/catgets/open_catalog.c b/catgets/open_catalog.c close_unlock_return: close_not_cancel_no_status (fd); + free (buf); - + return result; } diff -rupN a/catgets/tst-catgets.c b/catgets/tst-catgets.c @@ -162,13 +162,13 @@ diff -rupN a/catgets/tst-catgets.c b/catgets/tst-catgets.c +#include #include +#include - - + + static const char *msgs[] = @@ -12,6 +15,33 @@ static const char *msgs[] = }; #define nmsgs (sizeof (msgs) / sizeof (msgs[0])) - + + +/* Test for unbounded alloca. */ +static int @@ -184,7 +184,7 @@ diff -rupN a/catgets/tst-catgets.c b/catgets/tst-catgets.c + rl.rlim_cur = sz; + setrlimit (RLIMIT_STACK, &rl); + -+ buf = malloc (sz + 1); ++ buf = malloc (sz + 1); + memset (buf, 'A', sz); + buf[sz] = '\0'; + setenv ("NLSPATH", buf, 1); @@ -197,12 +197,13 @@ diff -rupN a/catgets/tst-catgets.c b/catgets/tst-catgets.c +} + #define ROUNDS 5 - + static int @@ -62,6 +92,7 @@ do_test (void) - } + } } - + + result += do_bz17905 (); return result; } + diff --git a/SOURCES/glibc-rh1374657.patch b/SOURCES/glibc-rh1374657.patch index 9e44f2f4..7fd892ab 100644 --- a/SOURCES/glibc-rh1374657.patch +++ b/SOURCES/glibc-rh1374657.patch @@ -19,7 +19,7 @@ Date: Sat Jul 11 17:44:10 2015 +0200 - +#include #include - + /* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986 @@ -47,12 +47,10 @@ isprime (unsigned int number) @@ -36,12 +36,12 @@ Date: Sat Jul 11 17:44:10 2015 +0200 + return 0; + return 1; } - - + + @@ -74,6 +72,12 @@ return 0; } - + + if (nel >= SIZE_MAX / sizeof (_ENTRY)) + { + __set_errno (ENOMEM); @@ -72,7 +72,7 @@ Date: Sat Jul 11 17:44:10 2015 +0200 + if (isprime (nel)) + break; + } - + htab->size = nel; htab->filled = 0; --- /dev/null @@ -179,7 +179,7 @@ Date: Sat Jul 11 17:44:10 2015 +0200 +++ glibc-2.17-c758a686/misc/Makefile @@ -76,7 +76,7 @@ gpl2lgpl := error.c error.h - + tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ - tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 + tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 bug18240 diff --git a/SOURCES/glibc-rh1374658.patch b/SOURCES/glibc-rh1374658.patch index 6e252bbd..8dd0a456 100644 --- a/SOURCES/glibc-rh1374658.patch +++ b/SOURCES/glibc-rh1374658.patch @@ -29,7 +29,7 @@ index b48ef34..4eb647c 100644 + ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))) # define ampm \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ - ? NLW(PM_STR) : NLW(AM_STR))) + ? NLW(PM_STR) : NLW(AM_STR))) @@ -526,8 +530,10 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument # define ap_len STRLEN (ampm) #else @@ -44,22 +44,22 @@ index b48ef34..4eb647c 100644 # define a_month f_month # define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11)) @@ -1321,7 +1327,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument - *tzset_called = true; - } + *tzset_called = true; + } # endif - zone = tzname[tp->tm_isdst]; + zone = tp->tm_isdst <= 1 ? tzname[tp->tm_isdst] : "?"; - } + } #endif - if (! zone) + if (! zone) diff --git a/time/tst-strftime.c b/time/tst-strftime.c index 374fba4..af3ff72 100644 --- a/time/tst-strftime.c +++ b/time/tst-strftime.c @@ -4,6 +4,56 @@ #include - - + + +static int +do_bz18985 (void) +{ @@ -114,11 +114,11 @@ index 374fba4..af3ff72 100644 { const char *fmt; @@ -104,7 +154,7 @@ do_test (void) - } + } } - + - return result; + return result + do_bz18985 (); } - + #define TEST_FUNCTION do_test () diff --git a/SOURCES/glibc-rh1375235-1.patch b/SOURCES/glibc-rh1375235-1.patch index 9b5c1c1a..a87c1a07 100644 --- a/SOURCES/glibc-rh1375235-1.patch +++ b/SOURCES/glibc-rh1375235-1.patch @@ -31,20 +31,20 @@ index 66ac85a..07bc713 100644 @@ -110,6 +110,9 @@ /* Define if assembler supports Intel MPX. */ #undef HAVE_MPX_SUPPORT - + +/* Define if assembler supports z196 zarch instructions as default on S390. */ +#undef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT + /* Define if assembler supports vector instructions on S390. */ #undef HAVE_S390_VX_ASM_SUPPORT - + diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index eb49a4c..bb670f3 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -75,3 +75,39 @@ then $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h - + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5 @@ -116,5 +116,6 @@ index a3b1f25..bad92bd 100644 +then + AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT) +fi --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-10.patch b/SOURCES/glibc-rh1375235-10.patch index c51ec9f4..492694f5 100644 --- a/SOURCES/glibc-rh1375235-10.patch +++ b/SOURCES/glibc-rh1375235-10.patch @@ -27,8 +27,8 @@ index b55ef1a..1252281 100644 --- a/sysdeps/s390/multiarch/utf8-utf16-z9.c +++ b/sysdeps/s390/multiarch/utf8-utf16-z9.c @@ -41,8 +41,10 @@ s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP, - : FROM_LOOP_DEFAULT); - + : FROM_LOOP_DEFAULT); + s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP, - (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) - ? TO_LOOP_VX @@ -38,7 +38,7 @@ index b55ef1a..1252281 100644 + : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) + ? TO_LOOP_VX + : TO_LOOP_DEFAULT); - + #include diff --git a/sysdeps/s390/utf8-utf16-z9.c b/sysdeps/s390/utf8-utf16-z9.c index d870a29..76e463a 100644 @@ -54,12 +54,12 @@ index d870a29..76e463a 100644 # define HAVE_TO_VX 0 +# define HAVE_TO_VX_CU 0 #endif - + #if defined HAVE_S390_VX_GCC_SUPPORT @@ -817,6 +819,121 @@ gconv_end (struct __gconv_step *data) # define TO_LOOP_VX NULL #endif /* HAVE_TO_VX != 1 */ - + +#if HAVE_TO_VX_CU == 1 +#define BODY_TO_VX_CU \ + { \ @@ -178,5 +178,6 @@ index d870a29..76e463a 100644 /* This file also exists in sysdeps/s390/multiarch/ which generates ifunc resolvers for FROM/TO_LOOP functions and includes iconv/skeleton.c afterwards. */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-2.patch b/SOURCES/glibc-rh1375235-2.patch index dab685ef..0916642c 100644 --- a/SOURCES/glibc-rh1375235-2.patch +++ b/SOURCES/glibc-rh1375235-2.patch @@ -40,12 +40,12 @@ index 93565e1..9232240 100644 -# include -# include +# include - + # undef FROM_LOOP # undef TO_LOOP @@ -372,33 +371,17 @@ - - + + /* Generate ifunc'ed loop function. */ -__typeof(__from_generic_c) -__attribute__ ((ifunc ("__from_generic_resolver"))) @@ -55,7 +55,7 @@ index 93565e1..9232240 100644 + && hwcap & HWCAP_S390_VX) + ? __from_generic_vx + : __from_generic_c); - + -static void * -__from_generic_resolver (unsigned long int dl_hwcap) -{ @@ -84,11 +84,11 @@ index 93565e1..9232240 100644 + && hwcap & HWCAP_S390_VX) + ? __to_generic_vx + : __to_generic_c); - + strong_alias (__to_generic_c_single, __to_generic_single) - + @@ -410,6 +393,6 @@ strong_alias (__to_generic_c_single, __to_generic_single) - + #else /* Generate this module without ifunc if build environment lacks vector - support. Instead the common 8bit-generic.c is used. */ @@ -123,5 +123,6 @@ index e9fd90e..883365b 100644 +#define s390_libc_ifunc_expr(TYPE_FUNC, FUNC, EXPR) \ + __ifunc (TYPE_FUNC, FUNC, EXPR, unsigned long int hwcap, \ + s390_libc_ifunc_expr_init); --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-3.patch b/SOURCES/glibc-rh1375235-3.patch index f02294be..07f613b5 100644 --- a/SOURCES/glibc-rh1375235-3.patch +++ b/SOURCES/glibc-rh1375235-3.patch @@ -101,7 +101,7 @@ index d3dc9bd..d870a29 100644 @@ -1,4 +1,4 @@ -/* Conversion between UTF-16 and UTF-32 BE/internal. +/* Conversion between UTF-8 and UTF-16 - s390 version. - + This module uses the Z9-109 variants of the Convert Unicode instructions. @@ -27,8 +27,35 @@ @@ -138,7 +138,7 @@ index d3dc9bd..d870a29 100644 +# define HAVE_FROM_VX 0 +# define HAVE_TO_VX 0 +#endif - + #if defined HAVE_S390_VX_GCC_SUPPORT # define ASM_CLOBBER_VR(NR) , NR @@ -49,8 +76,8 @@ @@ -151,11 +151,11 @@ index d3dc9bd..d870a29 100644 +#define TO_LOOP TO_LOOP_DEFAULT #define FROM_DIRECTION (dir == from_utf8) #define ONE_DIRECTION 0 - + @@ -214,9 +241,8 @@ gconv_end (struct __gconv_step *data) STANDARD_FROM_LOOP_ERR_HANDLER (i); \ } - + -#define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu12 %0, %1, 1")) - -#define HW_FROM_VX \ @@ -170,7 +170,7 @@ index d3dc9bd..d870a29 100644 } -#define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) +# define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) - + +/* Generate loop-function with hardware vector and utf-convert instructions. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_FROM +# define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -187,7 +187,7 @@ index d3dc9bd..d870a29 100644 + +#if HAVE_FROM_CU == 1 +# define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu12 %0, %1, 1")) - + +/* Generate loop-function with hardware utf-convert instruction. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_FROM +# define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -211,7 +211,7 @@ index d3dc9bd..d870a29 100644 uint16_t ch = *inptr; \ @@ -443,66 +500,26 @@ gconv_end (struct __gconv_step *data) } - + /* Generate loop-function with software implementation. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -272,9 +272,9 @@ index d3dc9bd..d870a29 100644 +#else +# define FROM_LOOP_C NULL +#endif /* HAVE_FROM_C != 1 */ - + /* Conversion from UTF-16 to UTF-8. */ - + +#if HAVE_TO_C == 1 /* The software routine is based on the functionality of the S/390 hardware instruction (cu21) as described in the Principles of @@ -283,11 +283,11 @@ index d3dc9bd..d870a29 100644 +# define BODY_TO_C \ { \ uint16_t c = get16 (inptr); \ - \ + \ @@ -601,7 +618,22 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) inptr += 2; \ } - + -#define BODY_TO_VX \ +/* Generate loop-function with software implementation. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_TO @@ -311,7 +311,7 @@ index d3dc9bd..d870a29 100644 @@ -771,48 +803,23 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) STANDARD_TO_LOOP_ERR_HANDLER (2); \ } - + -/* Generate loop-function with software implementation. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MAX_NEEDED_INPUT MAX_NEEDED_TO @@ -369,5 +369,6 @@ index d3dc9bd..d870a29 100644 +#if ! defined USE_MULTIARCH +# include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-4.patch b/SOURCES/glibc-rh1375235-4.patch index da3e4121..944de7fc 100644 --- a/SOURCES/glibc-rh1375235-4.patch +++ b/SOURCES/glibc-rh1375235-4.patch @@ -112,7 +112,7 @@ index 5d2ac44..5a39d5d 100644 +# define HAVE_FROM_VX 0 +# define HAVE_TO_VX 0 +#endif - + #if defined HAVE_S390_VX_GCC_SUPPORT # define ASM_CLOBBER_VR(NR) , NR @@ -53,8 +68,8 @@ @@ -125,11 +125,11 @@ index 5d2ac44..5a39d5d 100644 +#define TO_LOOP TO_LOOP_DEFAULT #define FROM_DIRECTION (dir == from_utf16) #define ONE_DIRECTION 0 - + @@ -174,9 +189,10 @@ gconv_end (struct __gconv_step *data) - + /* Conversion function from UTF-16 to UTF-32 internal/BE. */ - + +#if HAVE_FROM_C == 1 /* The software routine is copied from utf-16.c (minus bytes swapping). */ @@ -137,11 +137,11 @@ index 5d2ac44..5a39d5d 100644 +# define BODY_FROM_C \ { \ uint16_t u1 = get16 (inptr); \ - \ + \ @@ -220,7 +236,22 @@ gconv_end (struct __gconv_step *data) outptr += 4; \ } - + -#define BODY_FROM_VX \ + +/* Generate loop-function with software routing. */ @@ -163,18 +163,18 @@ index 5d2ac44..5a39d5d 100644 size_t inlen = inend - inptr; \ size_t outlen = outend - outptr; \ @@ -255,7 +286,7 @@ gconv_end (struct __gconv_step *data) - /* Setup to check for ch >= 0xd800 && ch <= 0xdfff. (v30, v31) */ \ - "9: .short 0xd800,0xdfff,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \ - " .short 0xa000,0xc000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \ + /* Setup to check for ch >= 0xd800 && ch <= 0xdfff. (v30, v31) */ \ + "9: .short 0xd800,0xdfff,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \ + " .short 0xa000,0xc000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \ - /* At least on uint16_t is in range of surrogates. \ + /* At least one uint16_t is in range of surrogates. \ - Store the preceding chars. */ \ - "10: vlgvb %[R_TMP],%%v19,7\n\t" \ - " vuplhh %%v17,%%v16\n\t" \ + Store the preceding chars. */ \ + "10: vlgvb %[R_TMP],%%v19,7\n\t" \ + " vuplhh %%v17,%%v16\n\t" \ @@ -351,52 +382,26 @@ gconv_end (struct __gconv_step *data) } - - + + -/* Generate loop-function with software routing. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -220,9 +220,9 @@ index 5d2ac44..5a39d5d 100644 +# define FROM_LOOP_VX NULL +#endif /* HAVE_FROM_VX != 1 */ + - + /* Conversion from UTF-32 internal/BE to UTF-16. */ - + +#if HAVE_TO_C == 1 /* The software routine is copied from utf-16.c (minus bytes swapping). */ @@ -230,11 +230,11 @@ index 5d2ac44..5a39d5d 100644 +# define BODY_TO_C \ { \ uint32_t c = get32 (inptr); \ - \ + \ @@ -439,7 +444,21 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) inptr += 4; \ } - + -#define BODY_TO_VX \ +/* Generate loop-function with software routing. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_TO @@ -257,7 +257,7 @@ index 5d2ac44..5a39d5d 100644 @@ -563,43 +582,22 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) STANDARD_TO_LOOP_ERR_HANDLER (4); \ } - + -/* Generate loop-function with software routing. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -309,5 +309,6 @@ index 5d2ac44..5a39d5d 100644 - - -#include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-5.patch b/SOURCES/glibc-rh1375235-5.patch index 51fd2161..bf7f8a5e 100644 --- a/SOURCES/glibc-rh1375235-5.patch +++ b/SOURCES/glibc-rh1375235-5.patch @@ -133,7 +133,7 @@ index efae745..e06d11e 100644 +# define HAVE_FROM_VX 0 +# define HAVE_TO_VX 0 +#endif - + #if defined HAVE_S390_VX_GCC_SUPPORT # define ASM_CLOBBER_VR(NR) , NR @@ -48,8 +75,8 @@ @@ -146,11 +146,11 @@ index efae745..e06d11e 100644 +#define TO_LOOP TO_LOOP_DEFAULT #define FROM_DIRECTION (dir == from_utf8) #define ONE_DIRECTION 0 - + @@ -303,12 +330,9 @@ gconv_end (struct __gconv_step *data) STANDARD_FROM_LOOP_ERR_HANDLER (i); \ } - + -/* This hardware routine uses the Convert UTF8 to UTF32 (cu14) instruction. */ -#define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu14 %0, %1, 1")) - @@ -165,7 +165,7 @@ index efae745..e06d11e 100644 @@ -408,7 +432,50 @@ gconv_end (struct __gconv_step *data) outptr += sizeof (uint32_t); \ } - + -#define HW_FROM_VX \ +/* These definitions apply to the UTF-8 to UTF-32 direction. The + software implementation for UTF-8 still supports multibyte @@ -220,7 +220,7 @@ index efae745..e06d11e 100644 } -#define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) +# define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) - + -/* These definitions apply to the UTF-8 to UTF-32 direction. The - software implementation for UTF-8 still supports multibyte - characters up to 6 bytes whereas the hardware variant does not. */ @@ -261,9 +261,9 @@ index efae745..e06d11e 100644 -# define LOOPFCT __from_utf8_loop_vx +# define FROM_LOOP_VX __from_utf8_loop_vx +# define LOOPFCT FROM_LOOP_VX - + # define LOOP_NEED_FLAGS - + @@ -547,33 +583,13 @@ gconv_end (struct __gconv_step *data) # define CLEAR_STATE CLEAR_STATE_COMMON # define BODY BODY_FROM_VX @@ -295,18 +295,18 @@ index efae745..e06d11e 100644 +#else +# define FROM_LOOP_VX NULL +#endif /* HAVE_FROM_VX != 1 */ - + +#if HAVE_TO_C == 1 /* The software routine mimics the S/390 cu41 instruction. */ -#define BODY_TO_C \ +# define BODY_TO_C \ { \ uint32_t wc = *((const uint32_t *) inptr); \ - \ + \ @@ -657,8 +673,22 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) inptr += 4; \ } - + +/* Generate loop-function with software routing. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_TO +# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -330,7 +330,7 @@ index efae745..e06d11e 100644 @@ -820,43 +850,22 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) STANDARD_TO_LOOP_ERR_HANDLER (4); \ } - + -/* Generate loop-function with software routing. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -383,5 +383,6 @@ index efae745..e06d11e 100644 - - -#include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-6.patch b/SOURCES/glibc-rh1375235-6.patch index 4646beda..2f05af1d 100644 --- a/SOURCES/glibc-rh1375235-6.patch +++ b/SOURCES/glibc-rh1375235-6.patch @@ -54,12 +54,12 @@ index 80747f0..748c3d1 100644 @@ -21,7 +21,7 @@ #define _DL_PROCINFO_H 1 #include - + -#define _DL_HWCAP_COUNT 12 +#define _DL_HWCAP_COUNT 15 - + #define _DL_PLATFORMS_COUNT 8 - + @@ -51,6 +51,9 @@ enum HWCAP_S390_HIGH_GPRS = 1 << 9, HWCAP_S390_TE = 1 << 10, @@ -68,7 +68,7 @@ index 80747f0..748c3d1 100644 + HWCAP_S390_VXE = 1 << 13, + HWCAP_S390_GS = 1 << 14, }; - + #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \ diff --git a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h index bd2ce3a..58b1929 100644 @@ -81,5 +81,6 @@ index bd2ce3a..58b1929 100644 +#define HWCAP_S390_VXD 4096 +#define HWCAP_S390_VXE 8192 +#define HWCAP_S390_GS 16384 --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-7.patch b/SOURCES/glibc-rh1375235-7.patch index 0d19affe..0107f34e 100644 --- a/SOURCES/glibc-rh1375235-7.patch +++ b/SOURCES/glibc-rh1375235-7.patch @@ -27,8 +27,8 @@ index faf1f46..0c6d9e9 100644 --- a/sysdeps/s390/multiarch/utf8-utf32-z9.c +++ b/sysdeps/s390/multiarch/utf8-utf32-z9.c @@ -41,8 +41,10 @@ s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP, - : FROM_LOOP_DEFAULT); - + : FROM_LOOP_DEFAULT); + s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP, - (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) - ? TO_LOOP_VX @@ -38,7 +38,7 @@ index faf1f46..0c6d9e9 100644 + : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) + ? TO_LOOP_VX + : TO_LOOP_DEFAULT); - + #include diff --git a/sysdeps/s390/utf8-utf32-z9.c b/sysdeps/s390/utf8-utf32-z9.c index e06d11e..e4f2e0c 100644 @@ -54,12 +54,12 @@ index e06d11e..e4f2e0c 100644 # define HAVE_TO_VX 0 +# define HAVE_TO_VX_CU 0 #endif - + #if defined HAVE_S390_VX_GCC_SUPPORT @@ -863,6 +865,116 @@ gconv_end (struct __gconv_step *data) # define TO_LOOP_VX NULL #endif /* HAVE_TO_VX != 1 */ - + +#if HAVE_TO_VX_CU == 1 +#define BODY_TO_VX_CU \ + { \ @@ -173,5 +173,6 @@ index e06d11e..e4f2e0c 100644 /* This file also exists in sysdeps/s390/multiarch/ which generates ifunc resolvers for FROM/TO_LOOP functions and includes iconv/skeleton.c afterwards. */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-8.patch b/SOURCES/glibc-rh1375235-8.patch index ed67d69c..54452f70 100644 --- a/SOURCES/glibc-rh1375235-8.patch +++ b/SOURCES/glibc-rh1375235-8.patch @@ -27,8 +27,8 @@ index 6e64169..ded3cc2 100644 --- a/sysdeps/s390/multiarch/utf16-utf32-z9.c +++ b/sysdeps/s390/multiarch/utf16-utf32-z9.c @@ -37,8 +37,10 @@ s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP, - : FROM_LOOP_DEFAULT); - + : FROM_LOOP_DEFAULT); + s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP, - (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) - ? TO_LOOP_VX @@ -38,7 +38,7 @@ index 6e64169..ded3cc2 100644 + : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) + ? TO_LOOP_VX + : TO_LOOP_DEFAULT); - + #include diff --git a/sysdeps/s390/utf16-utf32-z9.c b/sysdeps/s390/utf16-utf32-z9.c index 5a39d5d..b1728d6 100644 @@ -54,21 +54,21 @@ index 5a39d5d..b1728d6 100644 # define HAVE_TO_VX 0 +# define HAVE_TO_VX_CU 0 #endif - + #if defined HAVE_S390_VX_GCC_SUPPORT @@ -471,7 +473,7 @@ gconv_end (struct __gconv_step *data) - " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \ - CONVERT_32BIT_SIZE_T ([R_INLEN]) \ - CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ + " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \ + CONVERT_32BIT_SIZE_T ([R_INLEN]) \ + CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ - /* Loop which handles UTF-16 chars \ + /* Loop which handles UTF-32 chars \ - ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \ - "0: clgijl %[R_INLEN],32,2f\n\t" \ - " clgijl %[R_OUTLEN],16,2f\n\t" \ + ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \ + "0: clgijl %[R_INLEN],32,2f\n\t" \ + " clgijl %[R_OUTLEN],16,2f\n\t" \ @@ -595,6 +597,109 @@ gconv_end (struct __gconv_step *data) # define TO_LOOP_VX NULL #endif /* HAVE_TO_VX != 1 */ - + +#if HAVE_TO_VX_CU == 1 +#define BODY_TO_VX_CU \ + { \ @@ -175,5 +175,6 @@ index 5a39d5d..b1728d6 100644 /* This file also exists in sysdeps/s390/multiarch/ which generates ifunc resolvers for FROM/TO_LOOP functions and includes iconv/skeleton.c afterwards. */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1375235-9.patch b/SOURCES/glibc-rh1375235-9.patch index 13b18b60..5accf8f4 100644 --- a/SOURCES/glibc-rh1375235-9.patch +++ b/SOURCES/glibc-rh1375235-9.patch @@ -15,8 +15,8 @@ ChangeLog: * sysdeps/s390/utf16-utf32-z9.c (__from_utf16_loop_vx_cu): Use vector and cu24 instruction. - * sysdeps/s390/multiarch/utf16-utf32-z9.c: - Add __from_utf16_loop_vx_cu in ifunc resolver. + * sysdeps/s390/multiarch/utf16-utf32-z9.c: + Add __from_utf16_loop_vx_cu in ifunc resolver. --- sysdeps/s390/multiarch/utf16-utf32-z9.c | 8 ++- sysdeps/s390/utf16-utf32-z9.c | 113 +++++++++++++++++++++++++++++++- @@ -27,7 +27,7 @@ index ded3cc2..917de5f 100644 --- a/sysdeps/s390/multiarch/utf16-utf32-z9.c +++ b/sysdeps/s390/multiarch/utf16-utf32-z9.c @@ -32,9 +32,11 @@ strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP)) - + /* Generate ifunc'ed loop functions for FROM/TO_LOOP. */ s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP, - (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX)) @@ -38,15 +38,15 @@ index ded3cc2..917de5f 100644 + : (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX)) + ? FROM_LOOP_VX + : FROM_LOOP_DEFAULT); - + s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP, - (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE)) + (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE)) diff --git a/sysdeps/s390/utf16-utf32-z9.c b/sysdeps/s390/utf16-utf32-z9.c index b1728d6..c09a425 100644 --- a/sysdeps/s390/utf16-utf32-z9.c +++ b/sysdeps/s390/utf16-utf32-z9.c @@ -39,10 +39,12 @@ - + #if defined HAVE_S390_VX_ASM_SUPPORT && defined USE_MULTIARCH # define HAVE_FROM_VX 1 +# define HAVE_FROM_VX_CU 1 @@ -61,7 +61,7 @@ index b1728d6..c09a425 100644 @@ -383,7 +385,6 @@ gconv_end (struct __gconv_step *data) STANDARD_FROM_LOOP_ERR_HANDLER (2); \ } - + - /* Generate loop-function with hardware vector instructions. */ # define MIN_NEEDED_INPUT MIN_NEEDED_FROM @@ -69,7 +69,7 @@ index b1728d6..c09a425 100644 @@ -397,6 +398,116 @@ gconv_end (struct __gconv_step *data) # define FROM_LOOP_VX NULL #endif /* HAVE_FROM_VX != 1 */ - + +#if HAVE_FROM_VX_CU == 1 +#define BODY_FROM_VX_CU \ + { \ @@ -180,8 +180,9 @@ index b1728d6..c09a425 100644 +#else +# define FROM_LOOP_VX_CU NULL +#endif /* HAVE_FROM_VX_CU != 1 */ - + /* Conversion from UTF-32 internal/BE to UTF-16. */ - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-1.patch b/SOURCES/glibc-rh1380680-1.patch index 5d2c26b2..470edbdb 100644 --- a/SOURCES/glibc-rh1380680-1.patch +++ b/SOURCES/glibc-rh1380680-1.patch @@ -54,16 +54,16 @@ index a99539e..e2624de 100644 @@ -244,7 +244,7 @@ headers: $(addprefix $(objpfx), $(generated-modules:=.h)) $(addprefix $(inst_gconvdir)/, $(modules.so)): \ $(inst_gconvdir)/%: $(objpfx)% $(+force) - $(do-install-program) + $(do-install-program) -$(inst_gconvdir)/gconv-modules: gconv-modules $(+force) +$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules $(+force) - $(do-install) + $(do-install) ifeq (no,$(cross-compiling)) # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary @@ -319,7 +319,5 @@ do-tests-clean common-mostlyclean: tst-tables-clean tst-tables-clean: - -rm -f $(objpfx)tst-*.table $(objpfx)tst-EUC-TW.irreversible - + -rm -f $(objpfx)tst-*.table $(objpfx)tst-EUC-TW.irreversible + -ifdef objpfx $(objpfx)gconv-modules: gconv-modules - cp $^ $@ @@ -131,8 +131,8 @@ index 939e947..bb958bd 100644 +++ b/sysdeps/s390/s390-64/Makefile @@ -39,54 +39,5 @@ $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) : \ $(inst_gconvdir)/%.so: $(objpfx)%.so $(+force) - $(do-install-program) - + $(do-install-program) + -$(objpfx)gconv-modules-s390: gconv-modules $(+force) - cp $< $@ - echo >> $@ @@ -185,5 +185,6 @@ index 939e947..bb958bd 100644 - +sysdeps-gconv-modules = ../sysdeps/s390/gconv-modules endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-10.patch b/SOURCES/glibc-rh1380680-10.patch index 319e1876..99550100 100644 --- a/SOURCES/glibc-rh1380680-10.patch +++ b/SOURCES/glibc-rh1380680-10.patch @@ -38,11 +38,12 @@ index 6dad1c2..590a149 100644 #define BODY \ @@ -340,6 +341,7 @@ gconv_end (struct __gconv_step *data) /* Conversion from UTF-16 to UTF-8. */ - + #define MIN_NEEDED_INPUT MIN_NEEDED_TO +#define MAX_NEEDED_INPUT MAX_NEEDED_TO #define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM #define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM #define LOOPFCT TO_LOOP --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-11.patch b/SOURCES/glibc-rh1380680-11.patch index 586e455b..d3fe103c 100644 --- a/SOURCES/glibc-rh1380680-11.patch +++ b/SOURCES/glibc-rh1380680-11.patch @@ -47,7 +47,7 @@ index 590a149..b36ee9e 100644 @@ -30,33 +30,27 @@ #include #include - + -/* UTF-16 big endian byte order mark. */ -#define BOM_UTF16 0xfeff +#if defined HAVE_S390_VX_GCC_SUPPORT @@ -55,7 +55,7 @@ index 590a149..b36ee9e 100644 +#else +# define ASM_CLOBBER_VR(NR) +#endif - + +/* Defines for skeleton.c. */ #define DEFINE_INIT 0 #define DEFINE_FINI 0 @@ -87,13 +87,13 @@ index 590a149..b36ee9e 100644 + +/* UTF-16 big endian byte order mark. */ +#define BOM_UTF16 0xfeff - + /* Direction of the transformation. */ enum direction @@ -151,16 +145,16 @@ gconv_end (struct __gconv_step *data) register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - __asm__ volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -114,22 +114,22 @@ index 590a149..b36ee9e 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ @@ -169,50 +163,135 @@ gconv_end (struct __gconv_step *data) if (cc == 1) \ { \ - result = __GCONV_FULL_OUTPUT; \ + result = __GCONV_FULL_OUTPUT; \ - break; \ } \ else if (cc == 2) \ { \ - result = __GCONV_ILLEGAL_INPUT; \ + result = __GCONV_ILLEGAL_INPUT; \ - break; \ } \ } - + +#define PREPARE_LOOP \ + enum direction dir = ((struct utf8_data *) step->__data)->dir; \ + int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \ @@ -244,7 +244,7 @@ index 590a149..b36ee9e 100644 + } +#define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) + - + -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM -#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO @@ -277,58 +277,58 @@ index 590a149..b36ee9e 100644 - \ /* Next input byte. */ \ uint16_t ch = *inptr; \ - \ + \ - if (__glibc_likely (ch < 0x80)) \ + if (__glibc_likely (ch < 0x80)) \ { \ - /* One byte sequence. */ \ - ++inptr; \ + /* One byte sequence. */ \ + ++inptr; \ @@ -230,13 +309,13 @@ gconv_end (struct __gconv_step *data) - cnt = 2; \ - ch &= 0x1f; \ - } \ + cnt = 2; \ + ch &= 0x1f; \ + } \ - else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ + else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ - { \ - /* We expect three bytes. */ \ - cnt = 3; \ - ch &= 0x0f; \ - } \ + { \ + /* We expect three bytes. */ \ + cnt = 3; \ + ch &= 0x0f; \ + } \ - else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ + else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ - { \ - /* We expect four bytes. */ \ - cnt = 4; \ + { \ + /* We expect four bytes. */ \ + cnt = 4; \ @@ -257,7 +336,7 @@ gconv_end (struct __gconv_step *data) - STANDARD_FROM_LOOP_ERR_HANDLER (i); \ - } \ - \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ + } \ + \ - if (__glibc_unlikely (inptr + cnt > inend)) \ + if (__glibc_unlikely (inptr + cnt > inend)) \ - { \ - /* We don't have enough input. But before we report \ - that check that all the bytes are correct. */ \ + { \ + /* We don't have enough input. But before we report \ + that check that all the bytes are correct. */ \ @@ -265,7 +344,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__glibc_likely (inptr + i == inend)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -280,23 +359,31 @@ gconv_end (struct __gconv_step *data) - low) are needed. */ \ - uint16_t zabcd, high, low; \ - \ + low) are needed. */ \ + uint16_t zabcd, high, low; \ + \ - if (__glibc_unlikely (outptr + 4 > outend)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ - \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ + \ + /* Check if tail-bytes >= 0x80, < 0xc0. */ \ + for (i = 1; i < cnt; ++i) \ + { \ @@ -337,27 +337,27 @@ index 590a149..b36ee9e 100644 + goto errout; \ + } \ + \ - /* See Principles of Operations cu12. */ \ - zabcd = (((inptr[0] & 0x7) << 2) | \ + /* See Principles of Operations cu12. */ \ + zabcd = (((inptr[0] & 0x7) << 2) | \ - ((inptr[1] & 0x30) >> 4)) - 1; \ + ((inptr[1] & 0x30) >> 4)) - 1; \ - \ - /* z-bit must be zero after subtracting 1. */ \ - if (zabcd & 0x10) \ - STANDARD_FROM_LOOP_ERR_HANDLER (4) \ - \ - high = (uint16_t)(0xd8 << 8); /* high surrogate id */ \ + \ + /* z-bit must be zero after subtracting 1. */ \ + if (zabcd & 0x10) \ + STANDARD_FROM_LOOP_ERR_HANDLER (4) \ + \ + high = (uint16_t)(0xd8 << 8); /* high surrogate id */ \ - high |= zabcd << 6; /* abcd bits */ \ + high |= zabcd << 6; /* abcd bits */ \ - high |= (inptr[1] & 0xf) << 2; /* efgh bits */ \ - high |= (inptr[2] & 0x30) >> 4; /* ij bits */ \ - \ + high |= (inptr[1] & 0xf) << 2; /* efgh bits */ \ + high |= (inptr[2] & 0x30) >> 4; /* ij bits */ \ + \ @@ -326,8 +413,19 @@ gconv_end (struct __gconv_step *data) - ch <<= 6; \ - ch |= byte & 0x3f; \ - } \ + ch <<= 6; \ + ch |= byte & 0x3f; \ + } \ - inptr += cnt; \ - \ + \ + /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \ + If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \ + have been represented with fewer than cnt bytes. */ \ @@ -370,13 +370,13 @@ index 590a149..b36ee9e 100644 + } \ + \ + inptr += cnt; \ - } \ + } \ } \ /* Now adjust the pointers and store the result. */ \ @@ -335,43 +433,70 @@ gconv_end (struct __gconv_step *data) outptr += sizeof (uint16_t); \ } - + +/* Generate loop-function with software implementation. */ +#define MIN_NEEDED_INPUT MIN_NEEDED_FROM +#define MAX_NEEDED_INPUT MAX_NEEDED_FROM @@ -396,7 +396,7 @@ index 590a149..b36ee9e 100644 #define LOOP_NEED_FLAGS +#define BODY BODY_FROM_ETF3EH #include - + +#if defined HAVE_S390_VX_ASM_SUPPORT +/* Generate loop-function with hardware vector and utf-convert instructions. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_FROM @@ -432,7 +432,7 @@ index 590a149..b36ee9e 100644 +strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) + /* Conversion from UTF-16 to UTF-8. */ - + -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MAX_NEEDED_INPUT MAX_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -464,75 +464,75 @@ index 590a149..b36ee9e 100644 - } \ - \ uint16_t c = get16 (inptr); \ - \ + \ - if (__glibc_likely (c <= 0x007f)) \ + if (__glibc_likely (c <= 0x007f)) \ { \ - /* Single byte UTF-8 char. */ \ - *outptr = c & 0xff; \ + /* Single byte UTF-8 char. */ \ + *outptr = c & 0xff; \ @@ -379,20 +504,20 @@ gconv_end (struct __gconv_step *data) } \ else if (c >= 0x0080 && c <= 0x07ff) \ { \ - /* Two byte UTF-8 char. */ \ + /* Two byte UTF-8 char. */ \ - \ + \ - if (__glibc_unlikely (outptr + 2 > outend)) \ + if (__glibc_unlikely (outptr + 2 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ - \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ + \ - outptr[0] = 0xc0; \ - outptr[0] |= c >> 6; \ + outptr[0] = 0xc0; \ + outptr[0] |= c >> 6; \ - \ + \ - outptr[1] = 0x80; \ - outptr[1] |= c & 0x3f; \ + outptr[1] = 0x80; \ + outptr[1] |= c & 0x3f; \ - \ - outptr += 2; \ + \ + outptr += 2; \ } \ @@ -400,7 +525,7 @@ gconv_end (struct __gconv_step *data) { \ - /* Three byte UTF-8 char. */ \ - \ + /* Three byte UTF-8 char. */ \ + \ - if (__glibc_unlikely (outptr + 3 > outend)) \ + if (__glibc_unlikely (outptr + 3 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -419,22 +544,22 @@ gconv_end (struct __gconv_step *data) } \ else if (c >= 0xd800 && c <= 0xdbff) \ { \ - /* Four byte UTF-8 char. */ \ + /* Four byte UTF-8 char. */ \ - uint16_t low, uvwxy; \ - \ + uint16_t low, uvwxy; \ + \ - if (__glibc_unlikely (outptr + 4 > outend)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ - inptr += 2; \ - if (__glibc_unlikely (inptr + 2 > inend)) \ + if (__glibc_unlikely (inptr + 4 > inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ - } \ - \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ + } \ + \ + inptr += 2; \ - low = get16 (inptr); \ - \ - if ((low & 0xfc00) != 0xdc00) \ + low = get16 (inptr); \ + \ + if ((low & 0xfc00) != 0xdc00) \ @@ -461,11 +586,221 @@ gconv_end (struct __gconv_step *data) } \ else \ @@ -756,7 +756,8 @@ index 590a149..b36ee9e 100644 +# define LOOP_NEED_FLAGS +# include +#endif /* !HAVE_S390_VX_ASM_SUPPORT */ - + #include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-12.patch b/SOURCES/glibc-rh1380680-12.patch index 658faf4c..1fbc333a 100644 --- a/SOURCES/glibc-rh1380680-12.patch +++ b/SOURCES/glibc-rh1380680-12.patch @@ -40,7 +40,7 @@ index e6a033d..33594f1 100644 @@ -30,47 +30,27 @@ #include #include - + +#if defined HAVE_S390_VX_GCC_SUPPORT +# define ASM_CLOBBER_VR(NR) , NR +#else @@ -49,11 +49,11 @@ index e6a033d..33594f1 100644 + /* UTF-32 big endian byte order mark. */ #define BOM_UTF32 0x0000feffu - + /* UTF-16 big endian byte order mark. */ -#define BOM_UTF16 0xfeff +#define BOM_UTF16 0xfeff - + #define DEFINE_INIT 0 #define DEFINE_FINI 0 #define MIN_NEEDED_FROM 2 @@ -91,13 +91,13 @@ index e6a033d..33594f1 100644 - outbuf += 4; \ - } \ - } - + /* Direction of the transformation. */ enum direction @@ -169,16 +149,16 @@ gconv_end (struct __gconv_step *data) register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - __asm__ volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -118,22 +118,22 @@ index e6a033d..33594f1 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ @@ -187,44 +167,46 @@ gconv_end (struct __gconv_step *data) if (cc == 1) \ { \ - result = __GCONV_FULL_OUTPUT; \ + result = __GCONV_FULL_OUTPUT; \ - break; \ } \ else if (cc == 2) \ { \ - result = __GCONV_ILLEGAL_INPUT; \ + result = __GCONV_ILLEGAL_INPUT; \ - break; \ } \ } - + +#define PREPARE_LOOP \ + enum direction dir = ((struct utf16_data *) step->__data)->dir; \ + int emit_bom = ((struct utf16_data *) step->__data)->emit_bom; \ @@ -162,7 +162,7 @@ index e6a033d..33594f1 100644 + } + /* Conversion function from UTF-16 to UTF-32 internal/BE. */ - + -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM -#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO @@ -192,7 +192,7 @@ index e6a033d..33594f1 100644 - } \ - \ uint16_t u1 = get16 (inptr); \ - \ + \ if (__builtin_expect (u1 < 0xd800, 1) || u1 > 0xdfff) \ @@ -235,15 +217,15 @@ gconv_end (struct __gconv_step *data) } \ @@ -200,19 +200,19 @@ index e6a033d..33594f1 100644 { \ - /* An isolated low-surrogate was found. This has to be \ + /* An isolated low-surrogate was found. This has to be \ - considered ill-formed. */ \ + considered ill-formed. */ \ - if (__glibc_unlikely (u1 >= 0xdc00)) \ + if (__glibc_unlikely (u1 >= 0xdc00)) \ - { \ - STANDARD_FROM_LOOP_ERR_HANDLER (2); \ - } \ - /* It's a surrogate character. At least the first word says \ - it is. */ \ + { \ + STANDARD_FROM_LOOP_ERR_HANDLER (2); \ + } \ + /* It's a surrogate character. At least the first word says \ + it is. */ \ - if (__glibc_unlikely (inptr + 4 > inend)) \ + if (__glibc_unlikely (inptr + 4 > inend)) \ - { \ - /* We don't have enough input for another complete input \ - character. */ \ + { \ + /* We don't have enough input for another complete input \ + character. */ \ @@ -266,48 +248,200 @@ gconv_end (struct __gconv_step *data) } \ outptr += 4; \ @@ -389,9 +389,9 @@ index e6a033d..33594f1 100644 +# define BODY BODY_FROM_C +# include +#endif - + /* Conversion from UTF-32 internal/BE to UTF-16. */ - + -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM -#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM @@ -414,9 +414,9 @@ index e6a033d..33594f1 100644 - } \ - \ uint32_t c = get32 (inptr); \ - \ + \ if (__builtin_expect (c <= 0xd7ff, 1) \ - || (c >=0xdc00 && c <= 0xffff)) \ + || (c >=0xdc00 && c <= 0xffff)) \ { \ - /* Two UTF-16 chars. */ \ - put16 (outptr, c); \ @@ -424,19 +424,19 @@ index e6a033d..33594f1 100644 + put16 (outptr, c); \ } \ else if (__builtin_expect (c >= 0x10000, 1) \ - && __builtin_expect (c <= 0x10ffff, 1)) \ + && __builtin_expect (c <= 0x10ffff, 1)) \ { \ - /* Four UTF-16 chars. */ \ + /* Four UTF-16 chars. */ \ - uint16_t zabcd = ((c & 0x1f0000) >> 16) - 1; \ + uint16_t zabcd = ((c & 0x1f0000) >> 16) - 1; \ - uint16_t out; \ - \ - /* Generate a surrogate character. */ \ + uint16_t out; \ + \ + /* Generate a surrogate character. */ \ - if (__glibc_unlikely (outptr + 4 > outend)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -326,12 +460,165 @@ gconv_end (struct __gconv_step *data) } \ else \ @@ -569,7 +569,7 @@ index e6a033d..33594f1 100644 #define LOOP_NEED_FLAGS +#define BODY BODY_TO_ETF3EH #include - + +#if defined HAVE_S390_VX_ASM_SUPPORT +/* Generate loop-function with hardware vector instructions. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_TO @@ -604,5 +604,6 @@ index e6a033d..33594f1 100644 + + #include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-13.patch b/SOURCES/glibc-rh1380680-13.patch index 6910bea8..fa43d8b8 100644 --- a/SOURCES/glibc-rh1380680-13.patch +++ b/SOURCES/glibc-rh1380680-13.patch @@ -5222,5 +5222,6 @@ index 0000000..e39e0a7 + + +#include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-14.patch b/SOURCES/glibc-rh1380680-14.patch index e462c16d..b1ed24ee 100644 --- a/SOURCES/glibc-rh1380680-14.patch +++ b/SOURCES/glibc-rh1380680-14.patch @@ -29,9 +29,9 @@ index e39e0a7..efae745 100644 --- a/sysdeps/s390/utf8-utf32-z9.c +++ b/sysdeps/s390/utf8-utf32-z9.c @@ -572,28 +572,6 @@ __from_utf8_loop_resolver (unsigned long int dl_hwcap) - + strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) - + - -/* Conversion from UTF-32 internal/BE to UTF-8. */ -#define BODY_TO_HW(ASM) \ @@ -58,18 +58,18 @@ index e39e0a7..efae745 100644 #define BODY_TO_C \ { \ @@ -632,7 +610,7 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ - if (wc >= 0xd800 && wc < 0xdc00) \ + if (wc >= 0xd800 && wc <= 0xdfff) \ - { \ - /* Do not accept UTF-16 surrogates. */ \ - result = __GCONV_ILLEGAL_INPUT; \ + { \ + /* Do not accept UTF-16 surrogates. */ \ + result = __GCONV_ILLEGAL_INPUT; \ @@ -679,13 +657,12 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) inptr += 4; \ } - + -#define HW_TO_VX \ +/* The hardware routine uses the S/390 vector instructions. */ +#define BODY_TO_VX \ @@ -83,32 +83,32 @@ index e39e0a7..efae745 100644 + size_t outlen = outend - outptr; \ + unsigned long tmp, tmp2, tmp3; \ asm volatile (".machine push\n\t" \ - ".machine \"z13\"\n\t" \ - ".machinemode \"zarch_nohighgprs\"\n\t" \ + ".machine \"z13\"\n\t" \ + ".machinemode \"zarch_nohighgprs\"\n\t" \ @@ -696,10 +673,10 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) - CONVERT_32BIT_SIZE_T ([R_INLEN]) \ - CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ - /* Loop which handles UTF-32 chars <=0x7f. */ \ + CONVERT_32BIT_SIZE_T ([R_INLEN]) \ + CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ + /* Loop which handles UTF-32 chars <=0x7f. */ \ - "0: clgijl %[R_INLEN],64,20f\n\t" \ - " clgijl %[R_OUTLEN],16,20f\n\t" \ + "0: clgijl %[R_INLEN],64,2f\n\t" \ + " clgijl %[R_OUTLEN],16,2f\n\t" \ - "1: vlm %%v16,%%v19,0(%[R_IN])\n\t" \ + "1: vlm %%v16,%%v19,0(%[R_IN])\n\t" \ - " lghi %[R_TMP],0\n\t" \ + " lghi %[R_TMP2],0\n\t" \ - /* Shorten to byte values. */ \ - " vpkf %%v23,%%v16,%%v17\n\t" \ - " vpkf %%v24,%%v18,%%v19\n\t" \ + /* Shorten to byte values. */ \ + " vpkf %%v23,%%v16,%%v17\n\t" \ + " vpkf %%v24,%%v18,%%v19\n\t" \ @@ -719,41 +696,116 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) - " aghi %[R_OUTLEN],-16\n\t" \ - " la %[R_IN],64(%[R_IN])\n\t" \ - " la %[R_OUT],16(%[R_OUT])\n\t" \ + " aghi %[R_OUTLEN],-16\n\t" \ + " la %[R_IN],64(%[R_IN])\n\t" \ + " la %[R_OUT],16(%[R_OUT])\n\t" \ - " clgijl %[R_INLEN],64,20f\n\t" \ - " clgijl %[R_OUTLEN],16,20f\n\t" \ + " clgijl %[R_INLEN],64,2f\n\t" \ + " clgijl %[R_OUTLEN],16,2f\n\t" \ - " j 1b\n\t" \ - /* Found a value > 0x7f. */ \ + " j 1b\n\t" \ + /* Found a value > 0x7f. */ \ - "13: ahi %[R_TMP],4\n\t" \ - "12: ahi %[R_TMP],4\n\t" \ - "11: ahi %[R_TMP],4\n\t" \ @@ -123,14 +123,14 @@ index e39e0a7..efae745 100644 + " srlg %[R_TMP],%[R_TMP],2\n\t" \ + " agr %[R_TMP],%[R_TMP2]\n\t" \ + " je 16f\n\t" \ - /* Store characters before invalid one... */ \ + /* Store characters before invalid one... */ \ - " slgr %[R_OUTLEN],%[R_I]\n\t" \ - "15: aghi %[R_I],-1\n\t" \ - " vstl %%v23,%[R_I],0(%[R_OUT])\n\t" \ + " slgr %[R_OUTLEN],%[R_TMP]\n\t" \ + "15: aghi %[R_TMP],-1\n\t" \ + " vstl %%v23,%[R_TMP],0(%[R_OUT])\n\t" \ - /* ... and update pointers. */ \ + /* ... and update pointers. */ \ - " aghi %[R_I],1\n\t" \ - " la %[R_OUT],0(%[R_I],%[R_OUT])\n\t" \ - " sllg %[R_I],%[R_I],2\n\t" \ @@ -225,7 +225,7 @@ index e39e0a7..efae745 100644 + " j 99f\n\t" \ + "90: lghi %[R_RES],%[RES_OUT_FULL]\n\t" \ + "99: \n\t" \ - ".machine pop" \ + ".machine pop" \ - : /* outputs */ [R_IN] "+a" (pInput) \ - , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \ - , [R_OUTLEN] "+d" (outlen), [R_TMP] "=d" (tmp) \ @@ -234,18 +234,18 @@ index e39e0a7..efae745 100644 + , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \ + , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \ + , [R_TMP2] "=a" (tmp2), [R_TMP3] "=d" (tmp3) \ - , [R_RES] "+d" (result) \ - : /* inputs */ \ - [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \ - , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \ + , [R_RES] "+d" (result) \ + : /* inputs */ \ + [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \ + , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \ + , [RES_IN_FULL] "i" (__GCONV_INCOMPLETE_INPUT) \ - : /* clobber list */ "memory", "cc" \ - ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \ - ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \ + : /* clobber list */ "memory", "cc" \ + ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \ + ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \ @@ -761,8 +813,11 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) - ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \ - ASM_CLOBBER_VR ("v24") \ - ); \ + ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \ + ASM_CLOBBER_VR ("v24") \ + ); \ - inptr = pInput; \ - outptr = pOutput; \ + if (__glibc_likely (inptr == inend) \ @@ -254,12 +254,12 @@ index e39e0a7..efae745 100644 + \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ } - + /* Generate loop-function with software routing. */ @@ -774,15 +829,6 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single) #define LOOP_NEED_FLAGS #include - + -/* Generate loop-function with hardware utf-convert instruction. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -282,6 +282,7 @@ index e39e0a7..efae745 100644 - else return __to_utf8_loop_c; } - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-15.patch b/SOURCES/glibc-rh1380680-15.patch index 8574c5b6..42a47fd3 100644 --- a/SOURCES/glibc-rh1380680-15.patch +++ b/SOURCES/glibc-rh1380680-15.patch @@ -31,7 +31,7 @@ index 8d42ab8..5d2ac44 100644 @@ -145,42 +145,6 @@ gconv_end (struct __gconv_step *data) free (data->__data); } - + -/* The macro for the hardware loop. This is used for both - directions. */ -#define HARDWARE_CONVERT(INSTRUCTION) \ @@ -72,27 +72,27 @@ index 8d42ab8..5d2ac44 100644 enum direction dir = ((struct utf16_data *) step->__data)->dir; \ int emit_bom = ((struct utf16_data *) step->__data)->emit_bom; \ @@ -310,7 +274,7 @@ gconv_end (struct __gconv_step *data) - " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \ - /* Calculate remaining uint16_t values in loaded vrs. */ \ - "12: lghi %[R_TMP2],16\n\t" \ + " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \ + /* Calculate remaining uint16_t values in loaded vrs. */ \ + "12: lghi %[R_TMP2],16\n\t" \ - " sgr %[R_TMP2],%[R_TMP]\n\t" \ + " slgr %[R_TMP2],%[R_TMP]\n\t" \ - " srl %[R_TMP2],1\n\t" \ - " llh %[R_TMP],0(%[R_IN])\n\t" \ - " aghi %[R_OUTLEN],-4\n\t" \ + " srl %[R_TMP2],1\n\t" \ + " llh %[R_TMP],0(%[R_IN])\n\t" \ + " aghi %[R_OUTLEN],-4\n\t" \ @@ -437,7 +401,7 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) uint32_t c = get32 (inptr); \ - \ + \ if (__builtin_expect (c <= 0xd7ff, 1) \ - || (c >=0xdc00 && c <= 0xffff)) \ + || (c > 0xdfff && c <= 0xffff)) \ { \ - /* Two UTF-16 chars. */ \ - put16 (outptr, c); \ + /* Two UTF-16 chars. */ \ + put16 (outptr, c); \ @@ -475,29 +439,10 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) inptr += 4; \ } - + -#define BODY_TO_ETF3EH \ - { \ - HARDWARE_CONVERT ("cu42 %0, %1"); \ @@ -120,48 +120,48 @@ index 8d42ab8..5d2ac44 100644 + size_t outlen = outend - outptr; \ unsigned long tmp, tmp2, tmp3; \ asm volatile (".machine push\n\t" \ - ".machine \"z13\"\n\t" \ + ".machine \"z13\"\n\t" \ @@ -509,8 +454,8 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) - CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ - /* Loop which handles UTF-16 chars \ - ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \ + CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \ + /* Loop which handles UTF-16 chars \ + ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \ - "0: clgijl %[R_INLEN],32,20f\n\t" \ - " clgijl %[R_OUTLEN],16,20f\n\t" \ + "0: clgijl %[R_INLEN],32,2f\n\t" \ + " clgijl %[R_OUTLEN],16,2f\n\t" \ - "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \ - " lghi %[R_TMP2],0\n\t" \ - /* Shorten to UTF-16. */ \ + "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \ + " lghi %[R_TMP2],0\n\t" \ + /* Shorten to UTF-16. */ \ @@ -526,9 +471,15 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) - " aghi %[R_INLEN],-32\n\t" \ - " aghi %[R_OUTLEN],-16\n\t" \ - " la %[R_OUT],16(%[R_OUT])\n\t" \ + " aghi %[R_INLEN],-32\n\t" \ + " aghi %[R_OUTLEN],-16\n\t" \ + " la %[R_OUT],16(%[R_OUT])\n\t" \ - " clgijl %[R_INLEN],32,20f\n\t" \ - " clgijl %[R_OUTLEN],16,20f\n\t" \ + " clgijl %[R_INLEN],32,2f\n\t" \ + " clgijl %[R_OUTLEN],16,2f\n\t" \ - " j 1b\n\t" \ + " j 1b\n\t" \ + /* Calculate remaining uint32_t values in inptr. */ \ + "2: \n\t" \ + " clgije %[R_INLEN],0,99f\n\t" \ + " clgijl %[R_INLEN],4,92f\n\t" \ + " srlg %[R_TMP2],%[R_INLEN],2\n\t" \ + " j 20f\n\t" \ - /* Setup to check for ch >= 0xd800 && ch <= 0xdfff \ - and check for ch >= 0x10000. (v30, v31) */ \ - "9: .long 0xd800,0xdfff,0x10000,0x10000\n\t" \ + /* Setup to check for ch >= 0xd800 && ch <= 0xdfff \ + and check for ch >= 0x10000. (v30, v31) */ \ + "9: .long 0xd800,0xdfff,0x10000,0x10000\n\t" \ @@ -540,21 +491,59 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) - " agr %[R_TMP],%[R_TMP2]\n\t" \ - " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \ - " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \ + " agr %[R_TMP],%[R_TMP2]\n\t" \ + " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \ + " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \ - " jl 20f\n\t" \ + " jl 12f\n\t" \ - " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \ - /* Update pointers. */ \ - " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \ - " slgr %[R_INLEN],%[R_TMP]\n\t" \ - " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \ - " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \ + " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \ + /* Update pointers. */ \ + " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \ + " slgr %[R_INLEN],%[R_TMP]\n\t" \ + " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \ + " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \ - /* Handles UTF16 surrogates with convert instruction. */ \ - "20: cu42 %[R_OUT],%[R_IN]\n\t" \ - " jo 0b\n\t" /* Try vector implemenation again. */ \ @@ -210,18 +210,18 @@ index 8d42ab8..5d2ac44 100644 + " j 99f\n\t" \ + "90: lghi %[R_RES],%[RES_OUT_FULL]\n\t" \ + "99: \n\t" \ - ".machine pop" \ + ".machine pop" \ - : /* outputs */ [R_IN] "+a" (pInput) \ - , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \ + : /* outputs */ [R_IN] "+a" (inptr) \ + , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \ - , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \ - , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \ - , [R_RES] "+d" (result) \ + , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \ + , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \ + , [R_RES] "+d" (result) \ @@ -567,17 +556,10 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) - ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \ - ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \ - ); \ + ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \ + ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \ + ); \ - inptr = pInput; \ - outptr = pOutput; \ - \ @@ -237,11 +237,11 @@ index 8d42ab8..5d2ac44 100644 + \ STANDARD_TO_LOOP_ERR_HANDLER (4); \ } - + @@ -590,15 +572,6 @@ strong_alias (__from_utf16_loop_c_single, __from_utf16_loop_single) #define BODY BODY_TO_C #include - + -/* Generate loop-function with hardware utf-convert instruction. */ -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM @@ -264,6 +264,7 @@ index 8d42ab8..5d2ac44 100644 - else return __to_utf16_loop_c; } - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-16.patch b/SOURCES/glibc-rh1380680-16.patch index c736e5d0..948eb9cf 100644 --- a/SOURCES/glibc-rh1380680-16.patch +++ b/SOURCES/glibc-rh1380680-16.patch @@ -36,10 +36,10 @@ index 3e7f567..4d34c3f 100644 @@ -43,7 +43,7 @@ CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ CFLAGS-linereader.c = -DNO_TRANSLITERATION CFLAGS-simple-hash.c = -I../locale - + -tests = tst-iconv1 tst-iconv2 tst-iconv3 tst-iconv4 tst-iconv5 +tests = tst-iconv1 tst-iconv2 tst-iconv3 tst-iconv4 tst-iconv5 tst-iconv6 - + others = iconv_prog iconvconfig install-others-programs = $(inst_bindir)/iconv diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c @@ -47,14 +47,14 @@ index 8697309..b9f846d 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -634,6 +634,8 @@ ucs4le_internal_loop (struct __gconv_step *step, - continue; - } - + continue; + } + + *inptrp = inptr; + *outptrp = outptr; - return __GCONV_ILLEGAL_INPUT; - } - + return __GCONV_ILLEGAL_INPUT; + } + diff --git a/iconv/tst-iconv6.c b/iconv/tst-iconv6.c new file mode 100644 index 0000000..57d7f38 @@ -178,5 +178,6 @@ index 0000000..57d7f38 + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-17.patch b/SOURCES/glibc-rh1380680-17.patch index 748e09b7..4d316dbb 100644 --- a/SOURCES/glibc-rh1380680-17.patch +++ b/SOURCES/glibc-rh1380680-17.patch @@ -58,8 +58,8 @@ index b9f846d..48932ee 100644 + else if (__builtin_expect (wc <= 0x7fffffff \ + && (wc < 0xd800 || wc > 0xdfff), 1)) \ { \ - size_t step; \ - unsigned char *start; \ + size_t step; \ + unsigned char *start; \ diff --git a/iconvdata/Makefile b/iconvdata/Makefile index e2624de..0ec6755 100644 --- a/iconvdata/Makefile @@ -67,20 +67,20 @@ index e2624de..0ec6755 100644 @@ -68,7 +68,7 @@ include ../Makeconfig ifeq (yes,$(build-shared)) tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \ - tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \ + tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \ - bug-iconv10 + bug-iconv10 bug-iconv12 ifeq ($(have-thread-library),yes) tests += bug-iconv3 endif @@ -294,6 +294,8 @@ $(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) $(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) +$(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \ + $(addprefix $(objpfx),$(modules.so)) $(objpfx)tst-loading.out: $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) + $(addprefix $(objpfx),$(modules.so)) $(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \ diff --git a/iconvdata/bug-iconv12.c b/iconvdata/bug-iconv12.c new file mode 100644 @@ -356,31 +356,31 @@ index b4ddfeb..e833d3c 100644 --- a/iconvdata/utf-16.c +++ b/iconvdata/utf-16.c @@ -294,6 +294,12 @@ gconv_end (struct __gconv_step *data) - { \ - uint16_t u2; \ - \ + { \ + uint16_t u2; \ + \ + if (__glibc_unlikely (u1 >= 0xdc00)) \ + { \ + /* This is no valid first word for a surrogate. */ \ + STANDARD_FROM_LOOP_ERR_HANDLER (2); \ + } \ + \ - /* It's a surrogate character. At least the first word says \ - it is. */ \ - if (__builtin_expect (inptr + 4 > inend, 0)) \ + /* It's a surrogate character. At least the first word says \ + it is. */ \ + if (__builtin_expect (inptr + 4 > inend, 0)) \ @@ -328,6 +334,12 @@ gconv_end (struct __gconv_step *data) - } \ - else \ - { \ + } \ + else \ + { \ + if (__glibc_unlikely (u1 >= 0xdc00)) \ + { \ + /* This is no valid first word for a surrogate. */ \ + STANDARD_FROM_LOOP_ERR_HANDLER (2); \ + } \ + \ - /* It's a surrogate character. At least the first word says \ - it is. */ \ - if (__builtin_expect (inptr + 4 > inend, 0)) \ + /* It's a surrogate character. At least the first word says \ + it is. */ \ + if (__builtin_expect (inptr + 4 > inend, 0)) \ diff --git a/iconvdata/utf-32.c b/iconvdata/utf-32.c index e0c4b19..1173d6f 100644 --- a/iconvdata/utf-32.c @@ -388,12 +388,13 @@ index e0c4b19..1173d6f 100644 @@ -238,7 +238,8 @@ gconv_end (struct __gconv_step *data) if (swap) \ u1 = bswap_32 (u1); \ - \ + \ - if (__builtin_expect (u1 >= 0x110000, 0)) \ + if (__builtin_expect (u1 >= 0x110000 \ + || (u1 >= 0xd800 && u1 < 0xe000), 0)) \ { \ - /* This is illegal. */ \ - STANDARD_FROM_LOOP_ERR_HANDLER (4); \ --- + /* This is illegal. */ \ + STANDARD_FROM_LOOP_ERR_HANDLER (4); \ +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-2.patch b/SOURCES/glibc-rh1380680-2.patch index 680d9be1..4341f935 100644 --- a/SOURCES/glibc-rh1380680-2.patch +++ b/SOURCES/glibc-rh1380680-2.patch @@ -30,14 +30,14 @@ index f7f2388..62e04c7 100644 @@ -113,6 +113,10 @@ /* Define if assembler supports vector instructions on S390. */ #undef HAVE_S390_VX_ASM_SUPPORT - + +/* Define if gcc supports vector registers as clobbers in inline assembly + on S390. */ +#undef HAVE_S390_VX_GCC_SUPPORT + /* Define if gcc supports FMA4. */ #undef HAVE_FMA4_SUPPORT - + diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index cc4c1e0..eb49a4c 100644 --- a/sysdeps/s390/configure @@ -109,5 +109,6 @@ index 733e356..a3b1f25 100644 +then + AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT) +fi --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-3.patch b/SOURCES/glibc-rh1380680-3.patch index 5d149748..56874472 100644 --- a/SOURCES/glibc-rh1380680-3.patch +++ b/SOURCES/glibc-rh1380680-3.patch @@ -468,8 +468,8 @@ index 0805b07..11ad2b9 100644 --- a/sysdeps/s390/multiarch/Makefile +++ b/sysdeps/s390/multiarch/Makefile @@ -42,3 +42,13 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \ - wmemset wmemset-vx wmemset-c \ - wmemcmp wmemcmp-vx wmemcmp-c + wmemset wmemset-vx wmemset-c \ + wmemcmp wmemcmp-vx wmemcmp-c endif + +ifeq ($(subdir),iconvdata) @@ -520,5 +520,6 @@ index 0000000..3a90031 +#ifndef IGNORE_ICONV_SKELETON +# include_next +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-4.patch b/SOURCES/glibc-rh1380680-4.patch index e526b543..e92c75b4 100644 --- a/SOURCES/glibc-rh1380680-4.patch +++ b/SOURCES/glibc-rh1380680-4.patch @@ -1309,5 +1309,6 @@ index 0000000..dc53a48 + lacks vector support. Instead simply include the common version. */ +# include +#endif /* !defined HAVE_S390_VX_ASM_SUPPORT */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-5.patch b/SOURCES/glibc-rh1380680-5.patch index bbca3d6f..117968b4 100644 --- a/SOURCES/glibc-rh1380680-5.patch +++ b/SOURCES/glibc-rh1380680-5.patch @@ -23,19 +23,19 @@ index 58641f5..3b63e6a 100644 +++ b/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c @@ -1,8 +1,7 @@ /* Conversion between ISO 8859-1 and IBM037. - + - This module uses the Z900 variant of the Translate One To One - instruction. - Copyright (C) 1997-2009 Free Software Foundation, Inc. + This module uses the translate instruction. + Copyright (C) 1997-2016 Free Software Foundation, Inc. - + Author: Andreas Krebbel Based on the work by Ulrich Drepper , 1997. @@ -176,50 +175,70 @@ __attribute__ ((aligned (8))) = #define MIN_NEEDED_FROM 1 #define MIN_NEEDED_TO 1 - + -/* The Z900 variant of troo forces us to always specify a test - character which ends the translation. So if we run into the - situation where the translation has been interrupted due to the @@ -56,7 +56,7 @@ index 58641f5..3b63e6a 100644 - ? inend - inptr : outend - outptr); \ + size_t length = (inend - inptr < outend - outptr \ + ? inend - inptr : outend - outptr); \ - \ + \ - asm volatile ("0: \n\t" \ - " troo %0,%1 \n\t" \ - " jz 1f \n\t" \ @@ -85,7 +85,7 @@ index 58641f5..3b63e6a 100644 + ); \ + length = length % 256; \ + } \ - \ + \ - : "+a" (pOutput), "+a" (pInput), "+d" (length), "=&a" (tmp) \ - : "a" (pTable), "d" (test) \ - : "cc"); \ @@ -108,7 +108,7 @@ index 58641f5..3b63e6a 100644 + } \ + length = length % 8; \ + } \ - \ + \ - inptr = pInput; \ - outptr = pOutput; \ + /* Process remaining 0...7 bytes. */ \ @@ -126,7 +126,7 @@ index 58641f5..3b63e6a 100644 + inptr += length; \ + outptr += length; \ } - + + /* First define the conversion function from ISO 8859-1 to CP037. */ #define MIN_NEEDED_INPUT MIN_NEEDED_FROM @@ -134,17 +134,18 @@ index 58641f5..3b63e6a 100644 #define LOOPFCT FROM_LOOP -#define BODY TROO_LOOP (table_iso8859_1_to_cp037) +#define BODY TR_LOOP (table_iso8859_1_to_cp037) - + #include - + @@ -228,7 +247,7 @@ __attribute__ ((aligned (8))) = #define MIN_NEEDED_INPUT MIN_NEEDED_TO #define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM #define LOOPFCT TO_LOOP -#define BODY TROO_LOOP (table_cp037_iso8859_1); +#define BODY TR_LOOP (table_cp037_iso8859_1); - + #include - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-6.patch b/SOURCES/glibc-rh1380680-6.patch index 9c23038e..9a9cee42 100644 --- a/SOURCES/glibc-rh1380680-6.patch +++ b/SOURCES/glibc-rh1380680-6.patch @@ -18,47 +18,47 @@ index 9eaa1a5..94a1a33 100644 +++ b/sysdeps/s390/s390-64/utf16-utf32-z9.c @@ -54,7 +54,7 @@ if (dir == to_utf16) \ - { \ + { \ /* Emit the UTF-16 Byte Order Mark. */ \ - if (__builtin_expect (outbuf + 2 > outend, 0)) \ + if (__glibc_unlikely (outbuf + 2 > outend)) \ - return __GCONV_FULL_OUTPUT; \ - \ - put16u (outbuf, BOM_UTF16); \ + return __GCONV_FULL_OUTPUT; \ + \ + put16u (outbuf, BOM_UTF16); \ @@ -63,7 +63,7 @@ else \ - { \ + { \ /* Emit the UTF-32 Byte Order Mark. */ \ - if (__builtin_expect (outbuf + 4 > outend, 0)) \ + if (__glibc_unlikely (outbuf + 4 > outend)) \ - return __GCONV_FULL_OUTPUT; \ - \ - put32u (outbuf, BOM_UTF32); \ + return __GCONV_FULL_OUTPUT; \ + \ + put32u (outbuf, BOM_UTF32); \ @@ -236,13 +236,13 @@ gconv_end (struct __gconv_step *data) { \ /* An isolated low-surrogate was found. This has to be \ - considered ill-formed. */ \ + considered ill-formed. */ \ - if (__builtin_expect (u1 >= 0xdc00, 0)) \ + if (__glibc_unlikely (u1 >= 0xdc00)) \ - { \ - STANDARD_FROM_LOOP_ERR_HANDLER (2); \ - } \ - /* It's a surrogate character. At least the first word says \ - it is. */ \ + { \ + STANDARD_FROM_LOOP_ERR_HANDLER (2); \ + } \ + /* It's a surrogate character. At least the first word says \ + it is. */ \ - if (__builtin_expect (inptr + 4 > inend, 0)) \ + if (__glibc_unlikely (inptr + 4 > inend)) \ - { \ - /* We don't have enough input for another complete input \ - character. */ \ + { \ + /* We don't have enough input for another complete input \ + character. */ \ @@ -306,7 +306,7 @@ gconv_end (struct __gconv_step *data) - uint16_t out; \ - \ - /* Generate a surrogate character. */ \ + uint16_t out; \ + \ + /* Generate a surrogate character. */ \ - if (__builtin_expect (outptr + 4 > outend, 0)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c index 9f59177..8e0515c 100644 --- a/sysdeps/s390/s390-64/utf8-utf16-z9.c @@ -69,114 +69,114 @@ index 9f59177..8e0515c 100644 /* Emit the UTF-16 Byte Order Mark. */ \ - if (__builtin_expect (outbuf + 2 > outend, 0)) \ + if (__glibc_unlikely (outbuf + 2 > outend)) \ - return __GCONV_FULL_OUTPUT; \ - \ + return __GCONV_FULL_OUTPUT; \ + \ put16u (outbuf, BOM_UTF16); \ @@ -197,7 +197,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__builtin_expect (inptr + i == inend, 1)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -210,7 +210,7 @@ gconv_end (struct __gconv_step *data) /* Next input byte. */ \ uint16_t ch = *inptr; \ - \ + \ - if (__builtin_expect (ch < 0x80, 1)) \ + if (__glibc_likely (ch < 0x80)) \ { \ - /* One byte sequence. */ \ - ++inptr; \ + /* One byte sequence. */ \ + ++inptr; \ @@ -228,13 +228,13 @@ gconv_end (struct __gconv_step *data) - cnt = 2; \ - ch &= 0x1f; \ - } \ + cnt = 2; \ + ch &= 0x1f; \ + } \ - else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \ + else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ - { \ - /* We expect three bytes. */ \ - cnt = 3; \ - ch &= 0x0f; \ - } \ + { \ + /* We expect three bytes. */ \ + cnt = 3; \ + ch &= 0x0f; \ + } \ - else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \ + else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ - { \ - /* We expect four bytes. */ \ - cnt = 4; \ + { \ + /* We expect four bytes. */ \ + cnt = 4; \ @@ -255,7 +255,7 @@ gconv_end (struct __gconv_step *data) - STANDARD_FROM_LOOP_ERR_HANDLER (i); \ - } \ - \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ + } \ + \ - if (__builtin_expect (inptr + cnt > inend, 0)) \ + if (__glibc_unlikely (inptr + cnt > inend)) \ - { \ - /* We don't have enough input. But before we report \ - that check that all the bytes are correct. */ \ + { \ + /* We don't have enough input. But before we report \ + that check that all the bytes are correct. */ \ @@ -263,7 +263,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__builtin_expect (inptr + i == inend, 1)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -278,7 +278,7 @@ gconv_end (struct __gconv_step *data) - low) are needed. */ \ - uint16_t zabcd, high, low; \ - \ + low) are needed. */ \ + uint16_t zabcd, high, low; \ + \ - if (__builtin_expect (outptr + 4 > outend, 0)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -368,7 +368,7 @@ gconv_end (struct __gconv_step *data) - \ + \ uint16_t c = get16 (inptr); \ - \ + \ - if (__builtin_expect (c <= 0x007f, 1)) \ + if (__glibc_likely (c <= 0x007f)) \ { \ - /* Single byte UTF-8 char. */ \ - *outptr = c & 0xff; \ + /* Single byte UTF-8 char. */ \ + *outptr = c & 0xff; \ @@ -378,7 +378,7 @@ gconv_end (struct __gconv_step *data) { \ /* Two byte UTF-8 char. */ \ - \ + \ - if (__builtin_expect (outptr + 2 > outend, 0)) \ + if (__glibc_unlikely (outptr + 2 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -397,7 +397,7 @@ gconv_end (struct __gconv_step *data) { \ - /* Three byte UTF-8 char. */ \ - \ + /* Three byte UTF-8 char. */ \ + \ - if (__builtin_expect (outptr + 3 > outend, 0)) \ + if (__glibc_unlikely (outptr + 3 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -419,14 +419,14 @@ gconv_end (struct __gconv_step *data) /* Four byte UTF-8 char. */ \ - uint16_t low, uvwxy; \ - \ + uint16_t low, uvwxy; \ + \ - if (__builtin_expect (outptr + 4 > outend, 0)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ - inptr += 2; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ + inptr += 2; \ - if (__builtin_expect (inptr + 2 > inend, 0)) \ + if (__glibc_unlikely (inptr + 2 > inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ diff --git a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c index a807980..c657a38 100644 --- a/sysdeps/s390/s390-64/utf8-utf32-z9.c @@ -187,102 +187,102 @@ index a807980..c657a38 100644 /* Emit the Byte Order Mark. */ \ - if (__builtin_expect (outbuf + 4 > outend, 0)) \ + if (__glibc_unlikely (outbuf + 4 > outend)) \ - return __GCONV_FULL_OUTPUT; \ - \ + return __GCONV_FULL_OUTPUT; \ + \ put32u (outbuf, BOM); \ @@ -201,7 +201,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__builtin_expect (inptr + i == inend, 1)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -214,7 +214,7 @@ gconv_end (struct __gconv_step *data) /* Next input byte. */ \ uint32_t ch = *inptr; \ - \ + \ - if (__builtin_expect (ch < 0x80, 1)) \ + if (__glibc_likely (ch < 0x80)) \ { \ - /* One byte sequence. */ \ - ++inptr; \ + /* One byte sequence. */ \ + ++inptr; \ @@ -232,25 +232,25 @@ gconv_end (struct __gconv_step *data) - cnt = 2; \ - ch &= 0x1f; \ - } \ + cnt = 2; \ + ch &= 0x1f; \ + } \ - else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \ + else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ - { \ - /* We expect three bytes. */ \ - cnt = 3; \ - ch &= 0x0f; \ - } \ + { \ + /* We expect three bytes. */ \ + cnt = 3; \ + ch &= 0x0f; \ + } \ - else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \ + else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ - { \ - /* We expect four bytes. */ \ - cnt = 4; \ - ch &= 0x07; \ - } \ + { \ + /* We expect four bytes. */ \ + cnt = 4; \ + ch &= 0x07; \ + } \ - else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1)) \ + else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \ - { \ - /* We expect five bytes. */ \ - cnt = 5; \ - ch &= 0x03; \ - } \ + { \ + /* We expect five bytes. */ \ + cnt = 5; \ + ch &= 0x03; \ + } \ - else if (__builtin_expect ((ch & 0xfe) == 0xfc, 1)) \ + else if (__glibc_likely ((ch & 0xfe) == 0xfc)) \ - { \ - /* We expect six bytes. */ \ - cnt = 6; \ + { \ + /* We expect six bytes. */ \ + cnt = 6; \ @@ -271,7 +271,7 @@ gconv_end (struct __gconv_step *data) - STANDARD_FROM_LOOP_ERR_HANDLER (i); \ - } \ - \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ + } \ + \ - if (__builtin_expect (inptr + cnt > inend, 0)) \ + if (__glibc_unlikely (inptr + cnt > inend)) \ - { \ - /* We don't have enough input. But before we report \ - that check that all the bytes are correct. */ \ + { \ + /* We don't have enough input. But before we report \ + that check that all the bytes are correct. */ \ @@ -279,7 +279,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__builtin_expect (inptr + i == inend, 1)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -338,19 +338,19 @@ gconv_end (struct __gconv_step *data) - cnt = 2; \ - ch &= 0x1f; \ + cnt = 2; \ + ch &= 0x1f; \ } \ - else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \ + else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ { \ - /* We expect three bytes. */ \ - cnt = 3; \ - ch &= 0x0f; \ + /* We expect three bytes. */ \ + cnt = 3; \ + ch &= 0x0f; \ } \ - else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \ + else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ { \ - /* We expect four bytes. */ \ - cnt = 4; \ - ch &= 0x07; \ + /* We expect four bytes. */ \ + cnt = 4; \ + ch &= 0x07; \ } \ - else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1)) \ + else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \ { \ - /* We expect five bytes. */ \ - cnt = 5; \ + /* We expect five bytes. */ \ + cnt = 5; \ @@ -431,7 +431,7 @@ gconv_end (struct __gconv_step *data) - \ + \ uint32_t wc = *((const uint32_t *) inptr); \ - \ + \ - if (__builtin_expect (wc <= 0x7f, 1)) \ + if (__glibc_likely (wc <= 0x7f)) \ { \ @@ -294,26 +294,27 @@ index a807980..c657a38 100644 /* Two UTF-8 chars. */ \ - if (__builtin_expect (outptr + 2 > outend, 0)) \ + if (__glibc_unlikely (outptr + 2 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -458,7 +458,7 @@ gconv_end (struct __gconv_step *data) else if (wc <= 0xffff) \ { \ - /* Three UTF-8 chars. */ \ + /* Three UTF-8 chars. */ \ - if (__builtin_expect (outptr + 3 > outend, 0)) \ + if (__glibc_unlikely (outptr + 3 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -478,7 +478,7 @@ gconv_end (struct __gconv_step *data) else if (wc <= 0x10ffff) \ - { \ - /* Four UTF-8 chars. */ \ + { \ + /* Four UTF-8 chars. */ \ - if (__builtin_expect (outptr + 4 > outend, 0)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ --- + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-7.patch b/SOURCES/glibc-rh1380680-7.patch index ef7e42e1..3ea9f2b6 100644 --- a/SOURCES/glibc-rh1380680-7.patch +++ b/SOURCES/glibc-rh1380680-7.patch @@ -58,5 +58,6 @@ index c657a38..c582155 100644 #define PREPARE_LOOP \ enum direction dir = ((struct utf8_data *) step->__data)->dir; \ int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-8.patch b/SOURCES/glibc-rh1380680-8.patch index af71f9f5..92d58890 100644 --- a/SOURCES/glibc-rh1380680-8.patch +++ b/SOURCES/glibc-rh1380680-8.patch @@ -29,7 +29,7 @@ index ddc42fe..e6a033d 100644 + register unsigned char* pOutput __asm__ ("10") = outptr; \ + register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - asm volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -50,7 +50,7 @@ index ddc42fe..e6a033d 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c @@ -70,7 +70,7 @@ index 2c2d92c..6dad1c2 100644 + register unsigned char* pOutput __asm__ ("10") = outptr; \ + register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - asm volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -91,7 +91,7 @@ index 2c2d92c..6dad1c2 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ diff --git a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c @@ -111,7 +111,7 @@ index c582155..721279e 100644 + register unsigned char* pOutput __asm__ ("10") = outptr; \ + register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - asm volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -132,8 +132,9 @@ index c582155..721279e 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1380680-9.patch b/SOURCES/glibc-rh1380680-9.patch index 3ed8edb2..2b2ac9eb 100644 --- a/SOURCES/glibc-rh1380680-9.patch +++ b/SOURCES/glibc-rh1380680-9.patch @@ -33,7 +33,7 @@ index 721279e..1ce5ac5 100644 @@ -30,35 +30,25 @@ #include #include - + -/* UTF-32 big endian byte order mark. */ -#define BOM 0x0000feffu +#if defined HAVE_S390_VX_GCC_SUPPORT @@ -41,7 +41,7 @@ index 721279e..1ce5ac5 100644 +#else +# define ASM_CLOBBER_VR(NR) +#endif - + +/* Defines for skeleton.c. */ #define DEFINE_INIT 0 #define DEFINE_FINI 0 @@ -74,13 +74,13 @@ index 721279e..1ce5ac5 100644 + +/* UTF-32 big endian byte order mark. */ +#define BOM 0x0000feffu - + /* Direction of the transformation. */ enum direction @@ -155,16 +145,16 @@ gconv_end (struct __gconv_step *data) register unsigned long long outlen __asm__("11") = outend - outptr; \ uint64_t cc = 0; \ - \ + \ - __asm__ volatile (".machine push \n\t" \ - ".machine \"z9-109\" \n\t" \ - "0: " INSTRUCTION " \n\t" \ @@ -101,22 +101,22 @@ index 721279e..1ce5ac5 100644 + "+d" (outlen), "+d" (inlen) \ + : \ + : "cc", "memory"); \ - \ + \ inptr = pInput; \ outptr = pOutput; \ @@ -173,49 +163,150 @@ gconv_end (struct __gconv_step *data) if (cc == 1) \ { \ - result = __GCONV_FULL_OUTPUT; \ + result = __GCONV_FULL_OUTPUT; \ - break; \ } \ else if (cc == 2) \ { \ - result = __GCONV_ILLEGAL_INPUT; \ + result = __GCONV_ILLEGAL_INPUT; \ - break; \ } \ } - + +#define PREPARE_LOOP \ + enum direction dir = ((struct utf8_data *) step->__data)->dir; \ + int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \ @@ -133,7 +133,7 @@ index 721279e..1ce5ac5 100644 + } + /* Conversion function from UTF-8 to UTF-32 internal/BE. */ - + -#define MIN_NEEDED_INPUT MIN_NEEDED_FROM -#define MAX_NEEDED_INPUT MAX_NEEDED_FROM -#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO @@ -237,7 +237,7 @@ index 721279e..1ce5ac5 100644 + if (__glibc_likely (inptr == inend) \ + || result == __GCONV_FULL_OUTPUT) \ + break; \ - \ + \ - if (inptr != inend) \ - { \ - int i; \ @@ -248,7 +248,7 @@ index 721279e..1ce5ac5 100644 + for (i = 1; inptr + i < inend && i < 5; ++i) \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ - \ + \ - if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ @@ -276,30 +276,30 @@ index 721279e..1ce5ac5 100644 + { \ /* Next input byte. */ \ uint32_t ch = *inptr; \ - \ + \ - if (__glibc_likely (ch < 0x80)) \ + if (__glibc_likely (ch < 0x80)) \ { \ - /* One byte sequence. */ \ - ++inptr; \ + /* One byte sequence. */ \ + ++inptr; \ @@ -233,30 +324,18 @@ gconv_end (struct __gconv_step *data) - cnt = 2; \ - ch &= 0x1f; \ - } \ + cnt = 2; \ + ch &= 0x1f; \ + } \ - else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ + else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \ - { \ - /* We expect three bytes. */ \ - cnt = 3; \ - ch &= 0x0f; \ - } \ + { \ + /* We expect three bytes. */ \ + cnt = 3; \ + ch &= 0x0f; \ + } \ - else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ + else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \ - { \ - /* We expect four bytes. */ \ - cnt = 4; \ - ch &= 0x07; \ - } \ + { \ + /* We expect four bytes. */ \ + cnt = 4; \ + ch &= 0x07; \ + } \ - else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \ - { \ - /* We expect five bytes. */ \ @@ -312,45 +312,45 @@ index 721279e..1ce5ac5 100644 - cnt = 6; \ - ch &= 0x01; \ - } \ - else \ - { \ - /* Search the end of this ill-formed UTF-8 character. This \ + else \ + { \ + /* Search the end of this ill-formed UTF-8 character. This \ @@ -272,7 +351,7 @@ gconv_end (struct __gconv_step *data) - STANDARD_FROM_LOOP_ERR_HANDLER (i); \ - } \ - \ + STANDARD_FROM_LOOP_ERR_HANDLER (i); \ + } \ + \ - if (__glibc_unlikely (inptr + cnt > inend)) \ + if (__glibc_unlikely (inptr + cnt > inend)) \ - { \ - /* We don't have enough input. But before we report \ - that check that all the bytes are correct. */ \ + { \ + /* We don't have enough input. But before we report \ + that check that all the bytes are correct. */ \ @@ -280,7 +359,7 @@ gconv_end (struct __gconv_step *data) - if ((inptr[i] & 0xc0) != 0x80) \ - break; \ - \ + if ((inptr[i] & 0xc0) != 0x80) \ + break; \ + \ - if (__glibc_likely (inptr + i == inend)) \ + if (__glibc_likely (inptr + i == inend)) \ - { \ - result = __GCONV_INCOMPLETE_INPUT; \ - break; \ + { \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ @@ -305,7 +384,10 @@ gconv_end (struct __gconv_step *data) - /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \ - If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \ - have been represented with fewer than cnt bytes. */ \ + /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \ + If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \ + have been represented with fewer than cnt bytes. */ \ - if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0)) \ + if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0) \ + /* Do not accept UTF-16 surrogates. */ \ + || (ch >= 0xd800 && ch <= 0xdfff) \ + || (ch > 0x10ffff)) \ - { \ - /* This is an illegal encoding. */ \ - goto errout; \ + { \ + /* This is an illegal encoding. */ \ + goto errout; \ @@ -318,137 +400,212 @@ gconv_end (struct __gconv_step *data) *((uint32_t *) outptr) = ch; \ outptr += sizeof (uint32_t); \ } -#define LOOP_NEED_FLAGS - + -#define STORE_REST \ - { \ - /* We store the remaining bytes while converting them into the UCS4 \ @@ -503,7 +503,7 @@ index 721279e..1ce5ac5 100644 + outptr = pOutput; \ } +#define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX) - + -#define UNPACK_BYTES \ - { \ - static const unsigned char inmask[5] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc }; \ @@ -531,17 +531,17 @@ index 721279e..1ce5ac5 100644 +#define MAX_NEEDED_INPUT MAX_NEEDED_FROM +#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO +#define LOOPFCT __from_utf8_loop_c - + -#define CLEAR_STATE \ - state->__count = 0 +#define LOOP_NEED_FLAGS - + +#define STORE_REST STORE_REST_COMMON +#define UNPACK_BYTES UNPACK_BYTES_COMMON +#define CLEAR_STATE CLEAR_STATE_COMMON +#define BODY BODY_FROM_C #include - + + +/* Generate loop-function with hardware utf-convert instruction. */ +#define MIN_NEEDED_INPUT MIN_NEEDED_FROM @@ -616,7 +616,7 @@ index 721279e..1ce5ac5 100644 + +/* The hardware routine uses the S/390 vector and cu41 instructions. */ +#define BODY_TO_VX BODY_TO_HW (HW_TO_VX) - + -#define MIN_NEEDED_INPUT MIN_NEEDED_TO -#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM -#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM @@ -638,7 +638,7 @@ index 721279e..1ce5ac5 100644 - } \ - \ uint32_t wc = *((const uint32_t *) inptr); \ - \ + \ - if (__glibc_likely (wc <= 0x7f)) \ + if (__glibc_likely (wc <= 0x7f)) \ { \ @@ -646,7 +646,7 @@ index 721279e..1ce5ac5 100644 - *outptr = (uint8_t)wc; \ + /* Single UTF-8 char. */ \ + *outptr = (uint8_t)wc; \ - outptr++; \ + outptr++; \ } \ else if (wc <= 0x7ff) \ { \ @@ -654,48 +654,48 @@ index 721279e..1ce5ac5 100644 - if (__glibc_unlikely (outptr + 2 > outend)) \ + /* Two UTF-8 chars. */ \ + if (__glibc_unlikely (outptr + 2 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ - \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ + \ - outptr[0] = 0xc0; \ + outptr[0] = 0xc0; \ - outptr[0] |= wc >> 6; \ - \ - outptr[1] = 0x80; \ + outptr[0] |= wc >> 6; \ + \ + outptr[1] = 0x80; \ @@ -459,12 +616,18 @@ gconv_end (struct __gconv_step *data) else if (wc <= 0xffff) \ { \ - /* Three UTF-8 chars. */ \ + /* Three UTF-8 chars. */ \ - if (__glibc_unlikely (outptr + 3 > outend)) \ + if (__glibc_unlikely (outptr + 3 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ - break; \ - } \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ + break; \ + } \ + if (wc >= 0xd800 && wc < 0xdc00) \ + { \ + /* Do not accept UTF-16 surrogates. */ \ + result = __GCONV_ILLEGAL_INPUT; \ + STANDARD_TO_LOOP_ERR_HANDLER (4); \ + } \ - outptr[0] = 0xe0; \ - outptr[0] |= wc >> 12; \ - \ + outptr[0] = 0xe0; \ + outptr[0] |= wc >> 12; \ + \ @@ -479,7 +642,7 @@ gconv_end (struct __gconv_step *data) else if (wc <= 0x10ffff) \ - { \ - /* Four UTF-8 chars. */ \ + { \ + /* Four UTF-8 chars. */ \ - if (__glibc_unlikely (outptr + 4 > outend)) \ + if (__glibc_unlikely (outptr + 4 > outend)) \ - { \ - /* Overflow in the output buffer. */ \ - result = __GCONV_FULL_OUTPUT; \ + { \ + /* Overflow in the output buffer. */ \ + result = __GCONV_FULL_OUTPUT; \ @@ -505,7 +668,140 @@ gconv_end (struct __gconv_step *data) - } \ + } \ inptr += 4; \ } + @@ -800,7 +800,7 @@ index 721279e..1ce5ac5 100644 #define LOOP_NEED_FLAGS +#define BODY BODY_TO_ETF3EH #include - + +#if defined HAVE_S390_VX_ASM_SUPPORT +/* Generate loop-function with hardware vector and utf-convert instructions. */ +# define MIN_NEEDED_INPUT MIN_NEEDED_TO @@ -835,5 +835,6 @@ index 721279e..1ce5ac5 100644 + + #include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1383951.patch b/SOURCES/glibc-rh1383951.patch index a2292c23..0a323ff8 100644 --- a/SOURCES/glibc-rh1383951.patch +++ b/SOURCES/glibc-rh1383951.patch @@ -25,10 +25,10 @@ diff -rup a/elf/rtld.c b/elf/rtld.c - ._dl_pointer_guard = 1, ._dl_pagesize = EXEC_PAGESIZE, ._dl_inhibit_cache = 0, - + @@ -844,15 +843,12 @@ security_init (void) #endif - + /* Set up the pointer guard as well, if necessary. */ - if (GLRO(dl_pointer_guard)) - { @@ -43,19 +43,19 @@ diff -rup a/elf/rtld.c b/elf/rtld.c - __pointer_chk_guard_local = pointer_chk_guard; - } + __pointer_chk_guard_local = pointer_chk_guard; - + /* We do not need the _dl_random value anymore. The less information we leave behind, the better, so clear the @@ -2599,9 +2595,6 @@ process_envvars (enum mode *modep) - GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0; - break; - } + GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0; + break; + } - - if (memcmp (envline, "POINTER_GUARD", 13) == 0) - GLRO(dl_pointer_guard) = envline[14] != '0'; - break; - - case 14: + break; + + case 14: diff -rup a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h --- a/sysdeps/generic/ldsodefs.h 2017-03-06 14:38:57.000000000 -0500 +++ b/sysdeps/generic/ldsodefs.h 2017-03-06 14:41:19.506556361 -0500 diff --git a/SOURCES/glibc-rh1385003.patch b/SOURCES/glibc-rh1385003.patch index 28fc23d5..4eba78c4 100644 --- a/SOURCES/glibc-rh1385003.patch +++ b/SOURCES/glibc-rh1385003.patch @@ -17,7 +17,7 @@ Date: Mon Mar 24 16:46:51 2014 +0100 +# define SIZE_MAX (4294967295U) +# endif # endif - + /* Limits of `wchar_t'. */ --- glibc-2.17-c758a686/sysdeps/s390/s390-32/bits/wordsize.h +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/bits/wordsize.h @@ -27,7 +27,7 @@ Date: Mon Mar 24 16:46:51 2014 +0100 # define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 1 #endif - + #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL --- glibc-2.17-c758a686/sysdeps/s390/s390-64/bits/wordsize.h +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/bits/wordsize.h @@ -37,5 +37,5 @@ Date: Mon Mar 24 16:46:51 2014 +0100 # define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 1 #endif - + #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL diff --git a/SOURCES/glibc-rh1385004-1.patch b/SOURCES/glibc-rh1385004-1.patch index ab1afeec..dad246dd 100644 --- a/SOURCES/glibc-rh1385004-1.patch +++ b/SOURCES/glibc-rh1385004-1.patch @@ -54,7 +54,7 @@ index f5fdea5..364385b 100644 @@ -322,6 +322,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */ + IFUNC_IMPL (i, name, strstr, + IFUNC_IMPL_ADD (array, i, strstr, @@ -706,5 +706,6 @@ index 0000000..8dca31c + blr +END (strstr) +libc_hidden_builtin_def (strstr) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-10.patch b/SOURCES/glibc-rh1385004-10.patch index af05dea8..9dd16143 100644 --- a/SOURCES/glibc-rh1385004-10.patch +++ b/SOURCES/glibc-rh1385004-10.patch @@ -29,5 +29,6 @@ index fad2505..ae0dbaf 100644 @@ -1,2 +1 @@ powerpc/powerpc64/power8/fpu -powerpc/powerpc64/power8 --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-11.patch b/SOURCES/glibc-rh1385004-11.patch index 1f9b46bc..ca50829d 100644 --- a/SOURCES/glibc-rh1385004-11.patch +++ b/SOURCES/glibc-rh1385004-11.patch @@ -44,7 +44,7 @@ index 364385b..f6c70ba 100644 @@ -322,6 +322,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */ + IFUNC_IMPL (i, name, strspn, + IFUNC_IMPL_ADD (array, i, strspn, @@ -359,5 +359,6 @@ index 0000000..0dda437 + +END(strspn) +libc_hidden_builtin_def (strspn) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-12.patch b/SOURCES/glibc-rh1385004-12.patch index 71159aa8..35cb194c 100644 --- a/SOURCES/glibc-rh1385004-12.patch +++ b/SOURCES/glibc-rh1385004-12.patch @@ -38,7 +38,7 @@ index f6c70ba..583885c 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -101,6 +101,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */ IFUNC_IMPL (i, name, strlen, + IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07, @@ -96,11 +96,11 @@ index 79a53d9..4b400a5 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c +++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c @@ -29,11 +29,14 @@ extern __typeof (__redirect_strlen) __libc_strlen; - + extern __typeof (__redirect_strlen) __strlen_ppc attribute_hidden; extern __typeof (__redirect_strlen) __strlen_power7 attribute_hidden; +extern __typeof (__redirect_strlen) __strlen_power8 attribute_hidden; - + libc_ifunc (__libc_strlen, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __strlen_power7 @@ -110,7 +110,7 @@ index 79a53d9..4b400a5 100644 + (hwcap & PPC_FEATURE_HAS_VSX) + ? __strlen_power7 + : __strlen_ppc); - + #undef strlen strong_alias (__libc_strlen, strlen) diff --git a/sysdeps/powerpc/powerpc64/power8/strlen.S b/sysdeps/powerpc/powerpc64/power8/strlen.S @@ -416,5 +416,6 @@ index 0000000..0142747 + +END (strlen) +libc_hidden_builtin_def (strlen) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-13.patch b/SOURCES/glibc-rh1385004-13.patch index a8a97550..cb14c95d 100644 --- a/SOURCES/glibc-rh1385004-13.patch +++ b/SOURCES/glibc-rh1385004-13.patch @@ -35,7 +35,7 @@ index af64b92..5c5379c 100644 +++ b/sysdeps/powerpc/locale-defines.sym @@ -3,3 +3,7 @@ -- - + LOCALE_CTYPE_TOLOWER offsetof (struct __locale_struct, __ctype_tolower) +LOCALE_CTYPE_TOUPPER offsetof (struct __locale_struct, __ctype_toupper) +_NL_CTYPE_NONASCII_CASE @@ -791,5 +791,6 @@ index 0000000..24b2b76 + blr +END (strcasestr) +libc_hidden_builtin_def (strcasestr) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-14.patch b/SOURCES/glibc-rh1385004-14.patch index dab158e5..062dc70a 100644 --- a/SOURCES/glibc-rh1385004-14.patch +++ b/SOURCES/glibc-rh1385004-14.patch @@ -44,7 +44,7 @@ index 994e852..228891f 100644 @@ -332,6 +332,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */ + IFUNC_IMPL (i, name, strcspn, + IFUNC_IMPL_ADD (array, i, strcspn, @@ -165,9 +165,9 @@ index 86a4e09..27d25e0 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S +++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S @@ -18,22 +18,7 @@ - + #include - + -#undef EALIGN -#define EALIGN(name, alignt, words) \ - .section ".text"; \ @@ -187,7 +187,7 @@ index 86a4e09..27d25e0 100644 +#define STRSPN __strspn_power8 #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) - + diff --git a/sysdeps/powerpc/powerpc64/power8/strcspn.S b/sysdeps/powerpc/powerpc64/power8/strcspn.S new file mode 100644 index 0000000..bfc58a8 @@ -219,9 +219,9 @@ index 0dda437..011081d 100644 --- a/sysdeps/powerpc/powerpc64/power8/strspn.S +++ b/sysdeps/powerpc/powerpc64/power8/strspn.S @@ -33,6 +33,21 @@ - + #include "sysdep.h" - + +#ifndef USE_AS_STRCSPN +# define USE_AS_STRCSPN 0 +# ifndef STRSPN @@ -239,20 +239,20 @@ index 0dda437..011081d 100644 + /* Simple macro to use VSX instructions in overlapping VR's. */ #define XXVR(insn, vrt, vra, vrb) \ - insn 32+vrt, 32+vra, 32+vrb + insn 32+vrt, 32+vra, 32+vrb @@ -53,7 +68,7 @@ - /* This can be updated to power8 once the minimum version of - binutils supports power8 and the above instructions. */ - .machine power7 + /* This can be updated to power8 once the minimum version of + binutils supports power8 and the above instructions. */ + .machine power7 -EALIGN(strspn, 4, 0) +EALIGN(STRSPN, 4, 0) - CALL_MCOUNT 2 - - /* Generate useful constants for later on. */ + CALL_MCOUNT 2 + + /* Generate useful constants for later on. */ @@ -66,10 +81,18 @@ EALIGN(strspn, 4, 0) - - /* Prepare to compute 256b mask. */ - addi r4, r4, -1 + + /* Prepare to compute 256b mask. */ + addi r4, r4, -1 - li r5, 0 - li r6, 0 - li r7, 0 @@ -269,35 +269,36 @@ index 0dda437..011081d 100644 + srdi r5, r5, 1 +#endif + - li r11, 1 - sldi r11, r11, 63 - + li r11, 1 + sldi r11, r11, 63 + @@ -97,14 +120,14 @@ L(next_needle): - - /* Now, or the value into the correct GPR. */ - bge cr1,L(needle_gt128) + + /* Now, or the value into the correct GPR. */ + bge cr1,L(needle_gt128) - or r5, r5, r10 /* 0 - 63. */ - or r6, r6, r12 /* 64 - 127. */ + UPDATE_MASK (r5, r5, r10) /* 0 - 63. */ + UPDATE_MASK (r6, r6, r12) /* 64 - 127. */ - b L(next_needle) - - .align 4 + b L(next_needle) + + .align 4 L(needle_gt128): - or r7, r7, r10 /* 128 - 191. */ - or r8, r8, r12 /* 192 - 255. */ + UPDATE_MASK (r7, r7, r10) /* 128 - 191. */ + UPDATE_MASK (r8, r8, r12) /* 192 - 255. */ - b L(next_needle) - - + b L(next_needle) + + @@ -175,5 +198,5 @@ L(done): - add r3, r3, r10 - blr - + add r3, r3, r10 + blr + -END(strspn) -libc_hidden_builtin_def (strspn) +END(STRSPN) +libc_hidden_builtin_def (STRSPN) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-15.patch b/SOURCES/glibc-rh1385004-15.patch index a855fb56..a885ca9a 100644 --- a/SOURCES/glibc-rh1385004-15.patch +++ b/SOURCES/glibc-rh1385004-15.patch @@ -57,7 +57,7 @@ index ed83541..298cf00 100644 extern __typeof (bzero) __bzero_power6 attribute_hidden; extern __typeof (bzero) __bzero_power7 attribute_hidden; +extern __typeof (bzero) __bzero_power8 attribute_hidden; - + libc_ifunc (__bzero, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __bzero_power7 : @@ -67,19 +67,19 @@ index ed83541..298cf00 100644 + (hwcap & PPC_FEATURE_HAS_VSX) + ? __bzero_power7 : + (hwcap & PPC_FEATURE_ARCH_2_05) - ? __bzero_power6 : - (hwcap & PPC_FEATURE_POWER4) + ? __bzero_power6 : + (hwcap & PPC_FEATURE_POWER4) - ? __bzero_power4 + ? __bzero_power4 : __bzero_ppc); - + weak_alias (__bzero, bzero) diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index a574487..06d5be9 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -69,6 +71,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c. */ IFUNC_IMPL (i, name, memset, + IFUNC_IMPL_ADD (array, i, memset, hwcap2 & PPC_FEATURE2_ARCH_2_07, @@ -88,7 +88,7 @@ index a574487..06d5be9 100644 __memset_power7) IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05, @@ -134,6 +138,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */ IFUNC_IMPL (i, name, bzero, + IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07, @@ -154,7 +154,7 @@ index aa2ae70..9c7ed10 100644 extern __typeof (__redirect_memset) __memset_power6 attribute_hidden; extern __typeof (__redirect_memset) __memset_power7 attribute_hidden; +extern __typeof (__redirect_memset) __memset_power8 attribute_hidden; - + /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ libc_ifunc (__libc_memset, @@ -166,12 +166,12 @@ index aa2ae70..9c7ed10 100644 + (hwcap & PPC_FEATURE_HAS_VSX) + ? __memset_power7 : + (hwcap & PPC_FEATURE_ARCH_2_05) - ? __memset_power6 : - (hwcap & PPC_FEATURE_POWER4) + ? __memset_power6 : + (hwcap & PPC_FEATURE_POWER4) - ? __memset_power4 + ? __memset_power4 : __memset_ppc); - + #undef memset diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S new file mode 100644 @@ -628,5 +628,6 @@ index 0000000..191a4df +#ifndef __bzero +weak_alias (__bzero, bzero) +#endif --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-16.patch b/SOURCES/glibc-rh1385004-16.patch index a6632809..2b3db4f8 100644 --- a/SOURCES/glibc-rh1385004-16.patch +++ b/SOURCES/glibc-rh1385004-16.patch @@ -23,26 +23,26 @@ index 5fda953..80136cc 100644 @@ -24,6 +24,8 @@ # define FUNC_NAME strncpy #endif - + +#define FRAMESIZE (FRAME_MIN_SIZE+48) + /* Implements the function - + char * [r3] strncpy (char *dest [r3], const char *src [r4], size_t n [r5]) @@ -54,8 +56,7 @@ EALIGN (FUNC_NAME, 4, 0) - addi r10,r4,16 - rlwinm r9,r4,0,19,19 - + addi r10,r4,16 + rlwinm r9,r4,0,19,19 + - /* Since it is a leaf function, save some non-volatile registers on the - protected/red zone. */ + /* Save some non-volatile registers on the stack. */ - std r26,-48(r1) - std r27,-40(r1) - + std r26,-48(r1) + std r27,-40(r1) + @@ -69,6 +70,14 @@ EALIGN (FUNC_NAME, 4, 0) - std r30,-16(r1) - std r31,-8(r1) - + std r30,-16(r1) + std r31,-8(r1) + + /* Update CFI. */ + cfi_offset(r26, -48) + cfi_offset(r27, -40) @@ -51,22 +51,22 @@ index 5fda953..80136cc 100644 + cfi_offset(r30, -16) + cfi_offset(r31, -8) + - beq cr7,L(unaligned_lt_16) - rldicl r9,r4,0,61 - subfic r8,r9,8 + beq cr7,L(unaligned_lt_16) + rldicl r9,r4,0,61 + subfic r8,r9,8 @@ -144,74 +153,58 @@ L(short_path_loop_end): - ld r31,-8(r1) - blr - + ld r31,-8(r1) + blr + - /* This code pads the remainder dest with NULL bytes. The algorithm - calculate the remanining size and issues a doubleword unrolled - loops followed by a byte a byte set. */ + /* This code pads the remainder of dest with NULL bytes. The algorithm + calculates the remaining size and calls memset. */ - .align 4 + .align 4 L(zero_pad_start): - mr r5,r10 - mr r9,r6 + mr r5,r10 + mr r9,r6 L(zero_pad_start_1): - srdi. r8,r5,r3 - mr r10,r9 @@ -166,24 +166,25 @@ index 5fda953..80136cc 100644 - .align 4 -2: bf 31,1f - stb r8,0(r9) - + - /* Restore non-volatile registers. */ -1: ld r26,-48(r1) + /* Restore non-volatile registers and return. */ + ld r26,-48(r1) - ld r27,-40(r1) - ld r28,-32(r1) - ld r29,-24(r1) + ld r27,-40(r1) + ld r28,-32(r1) + ld r29,-24(r1) @@ -407,10 +400,6 @@ L(short_path_prepare_2_3): - mr r4,r28 - mr r9,r29 - b L(short_path_2) + mr r4,r28 + mr r9,r29 + b L(short_path_2) -L(zero_pad_loop_b_prepare): - addi r10,r9,8 - rldicl r5,r5,0,61 - b L(zero_pad_loop_b_start) L(zero_pad_start_prepare_1): - mr r5,r6 - mr r9,r8 --- + mr r5,r6 + mr r9,r8 +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-17.patch b/SOURCES/glibc-rh1385004-17.patch index 5e9eaac9..61460945 100644 --- a/SOURCES/glibc-rh1385004-17.patch +++ b/SOURCES/glibc-rh1385004-17.patch @@ -26,7 +26,7 @@ index d5d835d..d9babb5 100644 @@ -36,4 +36,7 @@ TRACEBACK(__stpncpy_power8) \ END_2(__stpncpy_power8) - + +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(name) + @@ -38,7 +38,7 @@ index ed906a4..f86a0f0 100644 @@ -37,4 +37,7 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) - + +/* memset is used to pad the end of the string. */ +#define MEMSET __memset_power8 + @@ -48,7 +48,7 @@ index 76a1466..e66bd0a 100644 --- a/sysdeps/powerpc/powerpc64/power8/stpncpy.S +++ b/sysdeps/powerpc/powerpc64/power8/stpncpy.S @@ -18,3 +18,7 @@ - + #define USE_AS_STPNCPY #include + @@ -62,16 +62,16 @@ index 24b2b76..60015ae 100644 @@ -81,7 +81,7 @@ /* TODO: change this to .machine power8 when the minimum required binutils allows it. */ - .machine power7 + .machine power7 -EALIGN (strcasestr, 4, 0) +EALIGN (__strcasestr, 4, 0) - CALL_MCOUNT 2 - mflr r0 /* Load link register LR to r0. */ - std r31, -8(r1) /* Save callers register r31. */ + CALL_MCOUNT 2 + mflr r0 /* Load link register LR to r0. */ + std r31, -8(r1) /* Save callers register r31. */ @@ -527,5 +527,8 @@ L(end): - cfi_restore(r31) - mtlr r0 /* Branch to link register. */ - blr + cfi_restore(r31) + mtlr r0 /* Branch to link register. */ + blr -END (strcasestr) +END (__strcasestr) + @@ -85,7 +85,7 @@ index 80136cc..05c7d8a 100644 @@ -24,6 +24,16 @@ # define FUNC_NAME strncpy #endif - + +#ifndef MEMSET +/* For builds without IFUNC support, local calls should be made to internal + GLIBC symbol (created by libc_hidden_builtin_def). */ @@ -97,26 +97,27 @@ index 80136cc..05c7d8a 100644 +#endif + #define FRAMESIZE (FRAME_MIN_SIZE+48) - + /* Implements the function @@ -187,7 +197,7 @@ L(zero_pad_start_1): - stdu r1,-FRAMESIZE(r1) - cfi_adjust_cfa_offset(FRAMESIZE) - + stdu r1,-FRAMESIZE(r1) + cfi_adjust_cfa_offset(FRAMESIZE) + - bl __memset_power8 + bl MEMSET - nop - - /* Restore the stack frame. */ + nop + + /* Restore the stack frame. */ @@ -406,8 +416,6 @@ L(zero_pad_start_prepare_1): - b L(zero_pad_start_1) + b L(zero_pad_start_1) END (FUNC_NAME) - + -#ifdef USE_AS_STPNCPY -libc_hidden_def (__stpncpy) -#else +#ifndef USE_AS_STPNCPY libc_hidden_builtin_def (strncpy) #endif --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-18.patch b/SOURCES/glibc-rh1385004-18.patch index 858869f0..12aaccab 100644 --- a/SOURCES/glibc-rh1385004-18.patch +++ b/SOURCES/glibc-rh1385004-18.patch @@ -83,12 +83,12 @@ index 56eed9a..99cd7bd 100644 +/* Optimized strcasecmp implementation for POWER7. + Copyright (C) 2013-2016 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 @@ -18,21 +18,7 @@ - + #include - + -#undef ENTRY -#define ENTRY(name) \ - .section ".text"; \ @@ -107,7 +107,7 @@ index 56eed9a..99cd7bd 100644 +#define __strcasecmp __strcasecmp_power7 #undef weak_alias #define weak_alias(name, alias) - + diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S new file mode 100644 index 0000000..492047a @@ -179,12 +179,12 @@ index 979e9f1..5ec6885 100644 +/* Multiple versions of strcasecmp + Copyright (C) 2013-2016 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 @@ -16,25 +16,21 @@ License along with the GNU C Library; if not, see . */ - + -#if IS_IN (libc) -# include -# define strcasecmp __strcasecmp_ppc @@ -194,18 +194,18 @@ index 979e9f1..5ec6885 100644 +#include +#include +#include "init-arch.h" - + -#include -#undef strcasecmp +extern __typeof (__strcasecmp) __libc_strcasecmp; - + -#if IS_IN (libc) -# include -# include "init-arch.h" +extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden; +extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden; +extern __typeof (__strcasecmp) __strcasecmp_power8 attribute_hidden; - + -extern __typeof (__strcasecmp) __libc_strcasecmp; libc_ifunc (__libc_strcasecmp, - (hwcap & PPC_FEATURE_HAS_VSX) @@ -216,7 +216,7 @@ index 979e9f1..5ec6885 100644 + (hwcap & PPC_FEATURE_HAS_VSX) + ? __strcasecmp_power7 + : __strcasecmp_ppc); - + weak_alias (__libc_strcasecmp, strcasecmp) -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S @@ -287,7 +287,7 @@ index 4339f3a..5bfaf65 100644 @@ -16,26 +16,21 @@ License along with the GNU C Library; if not, see . */ - + -#if IS_IN (libc) -# include -# define strncasecmp __strncasecmp_ppc @@ -297,25 +297,25 @@ index 4339f3a..5bfaf65 100644 +#include +#include +#include "init-arch.h" - + -#include -#undef strncasecmp +extern __typeof (__strncasecmp) __libc_strncasecmp; - + -#if IS_IN (libc) -# include -# include "init-arch.h" +extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden; +extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden; +extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden; - + -/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle - ifunc symbol properly. */ -extern __typeof (__strncasecmp) __libc_strncasecmp; libc_ifunc (__libc_strncasecmp, + (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __strncasecmp_power8: - (hwcap & PPC_FEATURE_HAS_VSX) + (hwcap & PPC_FEATURE_HAS_VSX) ? __strncasecmp_power7 : __strncasecmp_ppc); + @@ -799,5 +799,6 @@ index 0000000..7ce2ed0 + +#define USE_AS_STRNCASECMP 1 +#include --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-19.patch b/SOURCES/glibc-rh1385004-19.patch index 22cd2713..be5da293 100644 --- a/SOURCES/glibc-rh1385004-19.patch +++ b/SOURCES/glibc-rh1385004-19.patch @@ -21,9 +21,9 @@ index 63f6217..c83dc52 100644 --- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S +++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S @@ -40,11 +40,20 @@ - vsel v5, v7, v5, v8; \ - vcmpequb. v7, v5, v4; - + vsel v5, v7, v5, v8; \ + vcmpequb. v7, v5, v4; + -/* Get 16 bytes for unaligned case. */ +/* + * Get 16 bytes for unaligned case. @@ -35,24 +35,25 @@ index 63f6217..c83dc52 100644 + */ #ifdef __LITTLE_ENDIAN__ #define GET16BYTES(reg1, reg2, reg3) \ - lvx reg1, 0, reg2; \ + lvx reg1, 0, reg2; \ - vcmpequb. v8, v0, reg1; \ + vspltisb v8, -1; \ + vperm v8, v8, reg1, reg3; \ + vcmpequb. v8, v0, v8; \ - beq cr6, 1f; \ - vspltisb v9, 0; \ - b 2f; \ + beq cr6, 1f; \ + vspltisb v9, 0; \ + b 2f; \ @@ -57,7 +66,9 @@ #else #define GET16BYTES(reg1, reg2, reg3) \ - lvx reg1, 0, reg2; \ + lvx reg1, 0, reg2; \ - vcmpequb. v8, v0, reg1; \ + vspltisb v8, -1; \ + vperm v8, reg1, v8, reg3; \ + vcmpequb. v8, v0, v8; \ - beq cr6, 1f; \ - vspltisb v9, 0; \ - b 2f; \ --- + beq cr6, 1f; \ + vspltisb v9, 0; \ + b 2f; \ +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-2.patch b/SOURCES/glibc-rh1385004-2.patch index a885c08d..09fed87a 100644 --- a/SOURCES/glibc-rh1385004-2.patch +++ b/SOURCES/glibc-rh1385004-2.patch @@ -29,7 +29,7 @@ index 40aacfa..89a2296 100644 +++ b/sysdeps/powerpc/powerpc64/power7/Makefile @@ -5,6 +5,7 @@ CFLAGS-rtld.c += -mno-vsx endif - + ifeq ($(subdir),string) +sysdep_routines += strstr-ppc64 CFLAGS-strncase.c += -funroll-loops @@ -68,5 +68,6 @@ index 0000000..bbab92d +extern __typeof (strstr) __strstr_ppc attribute_hidden; + +#include --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-20.patch b/SOURCES/glibc-rh1385004-20.patch index 6895a1c5..38931a19 100644 --- a/SOURCES/glibc-rh1385004-20.patch +++ b/SOURCES/glibc-rh1385004-20.patch @@ -37,7 +37,7 @@ index 0e3eac7..331763e 100644 - s_llrint-power8 s_llround-power8 + s_llrint-power8 s_llround-power8 \ + e_expf-power8 e_expf-ppc64 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S @@ -448,5 +448,6 @@ index 0000000..a5e68bb + .4byte 0 /* Single precision zero. */ + +strong_alias (__ieee754_expf, __expf_finite) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-21.patch b/SOURCES/glibc-rh1385004-21.patch index 8828b391..f5847603 100644 --- a/SOURCES/glibc-rh1385004-21.patch +++ b/SOURCES/glibc-rh1385004-21.patch @@ -33,7 +33,7 @@ index 331763e..add1fb8 100644 - e_expf-power8 e_expf-ppc64 + e_expf-power8 e_expf-ppc64 \ + s_sinf-ppc64 s_sinf-power8 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S @@ -662,5 +662,6 @@ index 0000000..3b8f5af + .8byte 0x4000000000000000 /* 2.0 */ + +weak_alias(__sinf, sinf) --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-22.patch b/SOURCES/glibc-rh1385004-22.patch index b285e4b4..3723bd0f 100644 --- a/SOURCES/glibc-rh1385004-22.patch +++ b/SOURCES/glibc-rh1385004-22.patch @@ -45,13 +45,13 @@ index aabd7bc..404a226 100644 @@ -311,6 +311,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */ IFUNC_IMPL (i, name, strcmp, - IFUNC_IMPL_ADD (array, i, strcmp, + IFUNC_IMPL_ADD (array, i, strcmp, + hwcap2 & PPC_FEATURE2_ARCH_3_00, + __strcmp_power9) + IFUNC_IMPL_ADD (array, i, strcmp, - hwcap2 & PPC_FEATURE2_ARCH_2_07, - __strcmp_power8) - IFUNC_IMPL_ADD (array, i, strcmp, + hwcap2 & PPC_FEATURE2_ARCH_2_07, + __strcmp_power8) + IFUNC_IMPL_ADD (array, i, strcmp, diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S new file mode 100644 index 0000000..0a09e5b @@ -107,7 +107,7 @@ index b45ba1f..7345f5a 100644 extern __typeof (strcmp) __strcmp_power7 attribute_hidden; extern __typeof (strcmp) __strcmp_power8 attribute_hidden; +extern __typeof (strcmp) __strcmp_power9 attribute_hidden; - + libc_ifunc (strcmp, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __strcmp_power8 : @@ -406,5 +406,6 @@ index 0000000..754d508 +#else +#include +#endif --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-23.patch b/SOURCES/glibc-rh1385004-23.patch index 55178c49..9c10e69f 100644 --- a/SOURCES/glibc-rh1385004-23.patch +++ b/SOURCES/glibc-rh1385004-23.patch @@ -44,7 +44,7 @@ index 404a226..a140583 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -110,6 +110,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - + /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */ IFUNC_IMPL (i, name, strncmp, + IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00, @@ -107,7 +107,7 @@ index 9b6a659..3859cbc 100644 extern __typeof (strncmp) __strncmp_power7 attribute_hidden; extern __typeof (strncmp) __strncmp_power8 attribute_hidden; +extern __typeof (strncmp) __strncmp_power9 attribute_hidden; - + /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ libc_ifunc (strncmp, @@ -509,5 +509,6 @@ index 0000000..3f2fa75 +#else +#include +#endif --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-24.patch b/SOURCES/glibc-rh1385004-24.patch index 5985c0ce..5705519a 100644 --- a/SOURCES/glibc-rh1385004-24.patch +++ b/SOURCES/glibc-rh1385004-24.patch @@ -32,7 +32,7 @@ Index: b/sysdeps/powerpc/fpu/libm-test-ulps +Test "sin_downward (9) == 0.4121184852417565697562725663524351793439": +float: 1 +ifloat: 1 - + # sin_tonearest Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226": @@ -2438,10 +2441,15 @@ float: 1 diff --git a/SOURCES/glibc-rh1385004-3.patch b/SOURCES/glibc-rh1385004-3.patch index 0d5e09b2..5e24b02c 100644 --- a/SOURCES/glibc-rh1385004-3.patch +++ b/SOURCES/glibc-rh1385004-3.patch @@ -30,6 +30,7 @@ index 8dca31c..bfb0c49 100644 +# define STRNLEN __strnlen # endif #endif - --- + +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-4.patch b/SOURCES/glibc-rh1385004-4.patch index e659010e..e09853f0 100644 --- a/SOURCES/glibc-rh1385004-4.patch +++ b/SOURCES/glibc-rh1385004-4.patch @@ -26,87 +26,88 @@ index bfb0c49..fb3c810 100644 @@ -23,6 +23,8 @@ /* The performance gain is obtained using aligned memory access, load * doubleword and usage of cmpb instruction for quicker comparison. */ - + +#define ITERATIONS 64 + #ifndef STRLEN /* For builds with no IFUNC support, local calls should be made to internal GLIBC symbol (created by libc_hidden_builtin_def). */ @@ -62,6 +64,8 @@ EALIGN (strstr, 4, 0) - cfi_offset(r30, -16) - std r29, -24(r1) /* Save callers register r29. */ - cfi_offset(r29, -24) + cfi_offset(r30, -16) + std r29, -24(r1) /* Save callers register r29. */ + cfi_offset(r29, -24) + std r28, -32(r1) /* Save callers register r28. */ + cfi_offset(r28, -32) - std r0, 16(r1) /* Store the link register. */ - cfi_offset(lr, 16) - stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */ + std r0, 16(r1) /* Store the link register. */ + cfi_offset(lr, 16) + stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */ @@ -69,7 +73,6 @@ EALIGN (strstr, 4, 0) - - dcbt 0, r3 - dcbt 0, r4 + + dcbt 0, r3 + dcbt 0, r4 - - cmpdi cr7, r3, 0 - beq cr7, L(retnull) - cmpdi cr7, r4, 0 + cmpdi cr7, r3, 0 + beq cr7, L(retnull) + cmpdi cr7, r4, 0 @@ -84,10 +87,6 @@ EALIGN (strstr, 4, 0) - cmpdi cr7, r3, 0 /* If search str is null. */ - beq cr7, L(ret_r3) - + cmpdi cr7, r3, 0 /* If search str is null. */ + beq cr7, L(ret_r3) + - /* Call __strstr_ppc if needle len > 2048 */ - cmpdi cr7, r3, 2048 - bgt cr7, L(default) - - mr r31, r3 - mr r4, r3 - mr r3, r29 + mr r31, r3 + mr r4, r3 + mr r3, r29 @@ -105,7 +104,8 @@ EALIGN (strstr, 4, 0) - /* If first char of search str is not present. */ - cmpdi cr7, r3, 0 - ble cr7, L(end) + /* If first char of search str is not present. */ + cmpdi cr7, r3, 0 + ble cr7, L(end) - + /* Reg r28 is used to count the number of iterations. */ + li r28, 0 - rldicl r8, r3, 0, 52 /* Page cross check. */ - cmpldi cr7, r8, 4096-16 - bgt cr7, L(bytebybyte) + rldicl r8, r3, 0, 52 /* Page cross check. */ + cmpldi cr7, r8, 4096-16 + bgt cr7, L(bytebybyte) @@ -324,6 +324,10 @@ L(return4): - .align 4 + .align 4 L(begin): - mr r3, r8 + mr r3, r8 + /* When our iterations exceed ITERATIONS,fall back to default. */ + addi r28, r28, 1 + cmpdi cr7, r28, ITERATIONS + beq cr7, L(default) - lbz r4, 0(r30) - bl STRCHR - nop + lbz r4, 0(r30) + bl STRCHR + nop @@ -423,6 +427,10 @@ L(nextbyte): - cmpdi cr7, r9, -1 - beq cr7, L(end) - addi r3, r4, 1 + cmpdi cr7, r9, -1 + beq cr7, L(end) + addi r3, r4, 1 + /* When our iterations exceed ITERATIONS,fall back to default. */ + addi r28, r28, 1 + cmpdi cr7, r28, ITERATIONS + beq cr7, L(default) - lbz r4, 0(r30) - bl STRCHR - nop + lbz r4, 0(r30) + bl STRCHR + nop @@ -490,7 +498,6 @@ L(retnull): - - .align 4 + + .align 4 L(default): - mr r3, r29 - mr r4, r30 - bl __strstr_ppc - nop + mr r4, r30 + bl __strstr_ppc + nop @@ -500,6 +507,7 @@ L(end): - addi r1, r1, FRAMESIZE /* Restore stack pointer. */ - cfi_adjust_cfa_offset(-FRAMESIZE) - ld r0, 16(r1) /* Restore the saved link register. */ + addi r1, r1, FRAMESIZE /* Restore stack pointer. */ + cfi_adjust_cfa_offset(-FRAMESIZE) + ld r0, 16(r1) /* Restore the saved link register. */ + ld r28, -32(r1) /* Restore callers save register r28. */ - ld r29, -24(r1) /* Restore callers save register r29. */ - ld r30, -16(r1) /* Restore callers save register r30. */ - ld r31, -8(r1) /* Restore callers save register r31. */ --- + ld r29, -24(r1) /* Restore callers save register r29. */ + ld r30, -16(r1) /* Restore callers save register r30. */ + ld r31, -8(r1) /* Restore callers save register r31. */ +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-5.patch b/SOURCES/glibc-rh1385004-5.patch index a9d56ba5..87a89785 100644 --- a/SOURCES/glibc-rh1385004-5.patch +++ b/SOURCES/glibc-rh1385004-5.patch @@ -35,7 +35,7 @@ index 3a8cc41..6eda5d9 100644 #endif #ifndef PROCINFO_DECL = { -- "vsx", +- "vsx", + "ppcle", "true_le", "archpmu", "vsx", "arch_2_06", "power6x", "dfp", "pa6t", "arch_2_05", "ic_snoop", "smt", "booke", @@ -56,13 +56,14 @@ index cf167b0..36873cf 100644 @@ -22,8 +22,8 @@ #include #include /* This defines the PPC_FEATURE[2]_* macros. */ - + -/* There are 25 bits used, but they are bits 7..31. */ -#define _DL_HWCAP_FIRST 7 +/* There are 28 bits used, but they are bits 4..31. */ +#define _DL_HWCAP_FIRST 4 - + /* The total number of available bits (including those prior to _DL_HWCAP_FIRST). Some of these bits might not be used. */ --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-6.patch b/SOURCES/glibc-rh1385004-6.patch index 55d60a5d..c3bc7ec0 100644 --- a/SOURCES/glibc-rh1385004-6.patch +++ b/SOURCES/glibc-rh1385004-6.patch @@ -24,5 +24,6 @@ index 7daec91..e894bd4 100644 #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */ +#define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 /* Target supports vector + instruction. */ --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-7.patch b/SOURCES/glibc-rh1385004-7.patch index 0a33f04e..5168cacf 100644 --- a/SOURCES/glibc-rh1385004-7.patch +++ b/SOURCES/glibc-rh1385004-7.patch @@ -31,7 +31,7 @@ index f8c48cd..12554ca 100644 @@ -64,3 +64,5 @@ #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */ #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 /* Target supports vector - instruction. */ + instruction. */ +#define PPC_FEATURE2_HTM_NOSC 0x01000000 /* Kernel aborts transaction + when a syscall is made. */ diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c @@ -47,5 +47,6 @@ index 6eda5d9..770c1f3 100644 "ebb", "dscr", "htm", "arch_2_07", } #endif --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-8.patch b/SOURCES/glibc-rh1385004-8.patch index 3aedb3f1..007c6436 100644 --- a/SOURCES/glibc-rh1385004-8.patch +++ b/SOURCES/glibc-rh1385004-8.patch @@ -55,11 +55,11 @@ index 36873cf..407149b 100644 +++ b/sysdeps/powerpc/dl-procinfo.h @@ -40,7 +40,7 @@ #define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \ - + PPC_FEATURE_HAS_DFP) - + + PPC_FEATURE_HAS_DFP) + -#define _DL_PLATFORMS_COUNT 14 +#define _DL_PLATFORMS_COUNT 15 - + #define _DL_FIRST_PLATFORM 32 /* Mask to filter out platforms. */ @@ -62,6 +62,7 @@ @@ -67,19 +67,19 @@ index 36873cf..407149b 100644 #define PPC_PLATFORM_PPC476 12 #define PPC_PLATFORM_POWER8 13 +#define PPC_PLATFORM_POWER9 14 - + static inline const char * __attribute__ ((unused)) @@ -125,6 +126,9 @@ _dl_string_platform (const char *str) - case '8': - ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER8; - break; + case '8': + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER8; + break; + case '9': + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER9; + break; - default: - return -1; - } + default: + return -1; + } diff --git a/sysdeps/powerpc/powerpc32/power9/Implies b/sysdeps/powerpc/powerpc32/power9/Implies new file mode 100644 index 0000000..066dea2 @@ -132,5 +132,6 @@ index 0000000..dd6bca4 +++ b/sysdeps/powerpc/powerpc64/power9/multiarch/Implies @@ -0,0 +1 @@ +powerpc/powerpc64/power8/multiarch --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1385004-9.patch b/SOURCES/glibc-rh1385004-9.patch index cf24a9a0..058286c1 100644 --- a/SOURCES/glibc-rh1385004-9.patch +++ b/SOURCES/glibc-rh1385004-9.patch @@ -20,9 +20,9 @@ index 12554ca..55b37a4 100644 --- a/sysdeps/powerpc/bits/hwcap.h +++ b/sysdeps/powerpc/bits/hwcap.h @@ -66,3 +66,6 @@ - instruction. */ + instruction. */ #define PPC_FEATURE2_HTM_NOSC 0x01000000 /* Kernel aborts transaction - when a syscall is made. */ + when a syscall is made. */ +#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.0 */ +#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float + 128-bit */ @@ -39,5 +39,6 @@ index a8df5b8..1bbeb89 100644 "htm-nosc", "vcrypto", "tar", "isel", "ebb", "dscr", "htm", "arch_2_07", } --- +-- 2.1.0 + diff --git a/SOURCES/glibc-rh1387874.patch b/SOURCES/glibc-rh1387874.patch index 1ea87493..02bbef87 100644 --- a/SOURCES/glibc-rh1387874.patch +++ b/SOURCES/glibc-rh1387874.patch @@ -3,10 +3,10 @@ Author: Andreas Jaeger Date: Fri Jan 11 11:53:13 2013 +0100 Add MSG_FASTOPEN - - [BZ #15003] - * sysdeps/unix/sysv/linux/bits/socket.h (MSG_FASTOPEN): New - value. Sync with Linux 3.7. + + [BZ #15003] + * sysdeps/unix/sysv/linux/bits/socket.h (MSG_FASTOPEN): New + value. Sync with Linux 3.7. diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index 25b115e..eadd7d9 100644 @@ -18,6 +18,6 @@ index 25b115e..eadd7d9 100644 #define MSG_WAITFORONE MSG_WAITFORONE + MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ +#define MSG_FASTOPEN MSG_FASTOPEN - + MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file - descriptor received through + descriptor received through diff --git a/SOURCES/glibc-rh1392540.patch b/SOURCES/glibc-rh1392540.patch index ac67735f..870c48d4 100644 --- a/SOURCES/glibc-rh1392540.patch +++ b/SOURCES/glibc-rh1392540.patch @@ -7,9 +7,10 @@ Index: b/releng/nsswitch.conf --- a/releng/nsswitch.conf +++ b/releng/nsswitch.conf @@ -59,6 +59,6 @@ netgroup: nisplus sss - + publickey: nisplus - + -automount: files nisplus +automount: files nisplus sss aliases: files nisplus + diff --git a/SOURCES/glibc-rh1398244.patch b/SOURCES/glibc-rh1398244.patch index cb56643d..0ed2864f 100644 --- a/SOURCES/glibc-rh1398244.patch +++ b/SOURCES/glibc-rh1398244.patch @@ -8,10 +8,10 @@ +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -112,7 +112,7 @@ #ifdef SHARED - b JUMPTARGET(__GI__exit) + b JUMPTARGET(__GI__exit) #else - b JUMPTARGET(_exit) + bl JUMPTARGET(_exit) - /* We won't ever get here but provide a nop so that the linker - will insert a toc adjusting stub if necessary. */ - nop + /* We won't ever get here but provide a nop so that the linker + will insert a toc adjusting stub if necessary. */ + nop diff --git a/SOURCES/glibc-rh1398413.patch b/SOURCES/glibc-rh1398413.patch index fdd737f4..05be512e 100644 --- a/SOURCES/glibc-rh1398413.patch +++ b/SOURCES/glibc-rh1398413.patch @@ -3,13 +3,13 @@ Author: Florian Weimer Date: Thu Jun 23 20:01:40 2016 +0200 libio: Implement vtable verification [BZ #20191] - + This commit puts all libio vtables in a dedicated, read-only ELF section, so that they are consecutive in memory. Before any indirect jump, the vtable pointer is checked against the section boundaries, and the process is terminated if the vtable pointer does not fall into the special ELF section. - + To enable backwards compatibility, a special flag variable (_IO_accept_foreign_vtables), protected by the pointer guard, avoids process termination if libio stream object constructor functions have @@ -18,7 +18,7 @@ Date: Thu Jun 23 20:01:40 2016 +0200 old binaries. Existing callers inside glibc of these functions are adjusted to call the original functions, not the wrappers which enable vtable compatiblity. - + The compatibility mechanism is used to enable passing FILE * objects across a static dlopen boundary, too. @@ -26,25 +26,25 @@ diff -rupN a/Makerules b/Makerules --- a/Makerules 2017-08-24 14:50:27.000000000 -0400 +++ b/Makerules 2017-08-24 14:56:40.194819878 -0400 @@ -520,6 +520,9 @@ $(common-objpfx)shlib.lds: $(common-objp - PROVIDE(__start___libc_thread_subfreeres = .);\ - __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\ - PROVIDE(__stop___libc_thread_subfreeres = .);\ + PROVIDE(__start___libc_thread_subfreeres = .);\ + __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\ + PROVIDE(__stop___libc_thread_subfreeres = .);\ + PROVIDE(__start___libc_IO_vtables = .);\ + __libc_IO_vtables : { *(__libc_IO_vtables) }\ + PROVIDE(__stop___libc_IO_vtables = .);\ - /DISCARD/ : { *(.gnu.glibc-stub.*) }@' - test -s $@T - mv -f $@T $@ + /DISCARD/ : { *(.gnu.glibc-stub.*) }@' + test -s $@T + mv -f $@T $@ diff -rupN a/debug/obprintf_chk.c b/debug/obprintf_chk.c --- a/debug/obprintf_chk.c 2012-12-24 22:02:13.000000000 -0500 +++ b/debug/obprintf_chk.c 2017-08-24 14:56:40.194819878 -0400 @@ -35,7 +35,7 @@ struct _IO_obstack_file struct obstack *obstack; }; - + -extern const struct _IO_jump_t _IO_obstack_jumps attribute_hidden; +extern const struct _IO_jump_t _IO_obstack_jumps libio_vtable attribute_hidden; - + int __obstack_vprintf_chk (struct obstack *obstack, int flags, const char *format, diff -rupN a/debug/vdprintf_chk.c b/debug/vdprintf_chk.c @@ -65,10 +65,10 @@ diff -rupN a/debug/vsnprintf_chk.c b/debug/vsnprintf_chk.c @@ -20,7 +20,7 @@ #include "../libio/libioP.h" #include "../libio/strfile.h" - + -extern const struct _IO_jump_t _IO_strn_jumps attribute_hidden; +extern const struct _IO_jump_t _IO_strn_jumps libio_vtable attribute_hidden; - + /* Write formatted output into S, according to the format string FORMAT, writing no more than MAXLEN characters. */ diff -rupN a/debug/vsprintf_chk.c b/debug/vsprintf_chk.c @@ -76,8 +76,8 @@ diff -rupN a/debug/vsprintf_chk.c b/debug/vsprintf_chk.c +++ b/debug/vsprintf_chk.c 2017-08-24 14:56:40.194819878 -0400 @@ -34,7 +34,7 @@ _IO_str_chk_overflow (fp, c) } - - + + -static const struct _IO_jump_t _IO_str_chk_jumps = +static const struct _IO_jump_t _IO_str_chk_jumps libio_vtable = { @@ -87,20 +87,20 @@ diff -rupN a/libio/Makefile b/libio/Makefile --- a/libio/Makefile 2017-08-24 14:50:22.000000000 -0400 +++ b/libio/Makefile 2017-08-24 17:29:03.754025266 -0400 @@ -44,7 +44,7 @@ routines := \ - __fbufsize __freading __fwriting __freadable __fwritable __flbf \ - __fpurge __fpending __fsetlocking \ - \ + __fbufsize __freading __fwriting __freadable __fwritable __flbf \ + __fpurge __fpending __fsetlocking \ + \ - libc_fatal fmemopen + libc_fatal fmemopen vtables - + include ../Makeconfig - + diff -rupN a/libio/fileops.c b/libio/fileops.c --- a/libio/fileops.c 2017-08-24 14:50:23.000000000 -0400 +++ b/libio/fileops.c 2017-08-24 14:57:57.765902179 -0400 @@ -139,7 +139,7 @@ extern struct __gconv_trans_data __libio - - + + void -_IO_new_file_init (fp) +_IO_new_file_init_internal (fp) @@ -121,13 +121,13 @@ diff -rupN a/libio/fileops.c b/libio/fileops.c + IO_set_accept_foreign_vtables (&_IO_vtable_check); + _IO_new_file_init_internal (fp); +} - + int _IO_new_file_close_it (fp) @@ -1586,7 +1594,7 @@ versioned_symbol (libc, _IO_new_file_wri versioned_symbol (libc, _IO_new_file_xsputn, _IO_file_xsputn, GLIBC_2_1); #endif - + -const struct _IO_jump_t _IO_file_jumps = +const struct _IO_jump_t _IO_file_jumps libio_vtable = { @@ -136,7 +136,7 @@ diff -rupN a/libio/fileops.c b/libio/fileops.c @@ -1611,7 +1619,7 @@ const struct _IO_jump_t _IO_file_jumps = }; libc_hidden_data_def (_IO_file_jumps) - + -const struct _IO_jump_t _IO_file_jumps_mmap = +const struct _IO_jump_t _IO_file_jumps_mmap libio_vtable = { @@ -145,7 +145,7 @@ diff -rupN a/libio/fileops.c b/libio/fileops.c @@ -1635,7 +1643,7 @@ const struct _IO_jump_t _IO_file_jumps_m JUMP_INIT(imbue, _IO_default_imbue) }; - + -const struct _IO_jump_t _IO_file_jumps_maybe_mmap = +const struct _IO_jump_t _IO_file_jumps_maybe_mmap libio_vtable = { @@ -156,7 +156,7 @@ diff -rupN a/libio/genops.c b/libio/genops.c +++ b/libio/genops.c 2017-08-24 15:44:28.757584527 -0400 @@ -595,13 +595,19 @@ _IO_default_doallocate (fp) libc_hidden_def (_IO_default_doallocate) - + void -_IO_init (fp, flags) +_IO_init_internal (fp, flags) @@ -173,7 +173,7 @@ diff -rupN a/libio/genops.c b/libio/genops.c + IO_set_accept_foreign_vtables (&_IO_vtable_check); + _IO_init_internal (fp, flags); +} - + void _IO_old_init (fp, flags) diff -rupN a/libio/iofdopen.c b/libio/iofdopen.c @@ -200,7 +200,7 @@ diff -rupN a/libio/iofdopen.c b/libio/iofdopen.c + ftell into believing that we have a valid offset. */ new_f->fp.file._fileno = fd; new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE; - + diff -rupN a/libio/iofopen.c b/libio/iofopen.c --- a/libio/iofopen.c 2012-12-24 22:02:13.000000000 -0500 +++ b/libio/iofopen.c 2017-08-24 14:56:40.223819909 -0400 @@ -218,8 +218,8 @@ diff -rupN a/libio/iofopncook.c b/libio/iofopncook.c +++ b/libio/iofopncook.c 2017-08-24 15:46:49.061694225 -0400 @@ -116,7 +116,7 @@ _IO_cookie_seekoff (fp, offset, dir, mod } - - + + -static const struct _IO_jump_t _IO_cookie_jumps = { +static const struct _IO_jump_t _IO_cookie_jumps libio_vtable = { JUMP_INIT_DUMMY, @@ -227,24 +227,24 @@ diff -rupN a/libio/iofopncook.c b/libio/iofopncook.c JUMP_INIT(overflow, _IO_file_overflow), @@ -144,13 +144,13 @@ void _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write, - void *cookie, _IO_cookie_io_functions_t io_functions) + void *cookie, _IO_cookie_io_functions_t io_functions) { - _IO_init (&cfile->__fp.file, 0); + _IO_init_internal (&cfile->__fp.file, 0); _IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps; - + cfile->__cookie = cookie; cfile->__io_functions = io_functions; - + - _IO_file_init (&cfile->__fp); + _IO_new_file_init_internal (&cfile->__fp); - + _IO_mask_flags (&cfile->__fp.file, read_write, - _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); @@ -235,7 +235,7 @@ _IO_old_cookie_seek (fp, offset, dir) return (ret == -1) ? _IO_pos_BAD : ret; } - + -static const struct _IO_jump_t _IO_old_cookie_jumps = { +static const struct _IO_jump_t _IO_old_cookie_jumps libio_vtable = { JUMP_INIT_DUMMY, @@ -268,7 +268,7 @@ diff -rupN a/libio/iopopen.c b/libio/iopopen.c @@ -350,7 +350,7 @@ _IO_new_proc_close (fp) return wstatus; } - + -static const struct _IO_jump_t _IO_proc_jumps = { +static const struct _IO_jump_t _IO_proc_jumps libio_vtable = { JUMP_INIT_DUMMY, @@ -290,7 +290,7 @@ diff -rupN a/libio/libioP.h b/libio/libioP.h --- a/libio/libioP.h 2017-08-24 14:50:26.000000000 -0400 +++ b/libio/libioP.h 2017-08-24 17:26:39.918165252 -0400 @@ -108,11 +108,12 @@ extern "C" { - + #if _IO_JUMPS_OFFSET # define _IO_JUMPS_FUNC(THIS) \ - (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \ @@ -325,9 +325,9 @@ diff -rupN a/libio/libioP.h b/libio/libioP.h libc_hidden_proto (_IO_file_attach) extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int); @@ -597,7 +595,8 @@ extern _IO_FILE* _IO_new_file_fopen (_IO - int); + int); extern void _IO_no_init (_IO_FILE *, int, int, struct _IO_wide_data *, - const struct _IO_jump_t *) __THROW; + const struct _IO_jump_t *) __THROW; -extern void _IO_new_file_init (struct _IO_FILE_plus *) __THROW; +extern void _IO_new_file_init_internal (struct _IO_FILE_plus *) + __THROW attribute_hidden; @@ -345,7 +345,7 @@ diff -rupN a/libio/libioP.h b/libio/libioP.h extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *); extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t); @@ -656,10 +656,6 @@ extern void _IO_str_finish (_IO_FILE *, - + /* Other strfile functions */ struct _IO_strfile_; -extern void _IO_str_init_static (struct _IO_strfile_ *, char *, int, char *) @@ -353,7 +353,7 @@ diff -rupN a/libio/libioP.h b/libio/libioP.h -extern void _IO_str_init_readonly (struct _IO_strfile_ *, const char *, int) - __THROW; extern _IO_ssize_t _IO_str_count (_IO_FILE *) __THROW; - + /* And the wide character versions. */ @@ -913,3 +909,57 @@ _IO_acquire_lock_clear_flags2_fct (_IO_F | _IO_FLAGS2_SCANF_STD); \ @@ -418,8 +418,8 @@ diff -rupN a/libio/memstream.c b/libio/memstream.c +++ b/libio/memstream.c 2017-08-24 15:56:02.643120827 -0400 @@ -33,7 +33,7 @@ static int _IO_mem_sync (_IO_FILE* fp) _ static void _IO_mem_finish (_IO_FILE* fp, int) __THROW; - - + + -static const struct _IO_jump_t _IO_mem_jumps = +static const struct _IO_jump_t _IO_mem_jumps libio_vtable = { @@ -438,8 +438,8 @@ diff -rupN a/libio/obprintf.c b/libio/obprintf.c --- a/libio/obprintf.c 2012-12-24 22:02:13.000000000 -0500 +++ b/libio/obprintf.c 2017-08-24 14:56:40.255819944 -0400 @@ -91,7 +91,7 @@ _IO_obstack_xsputn (_IO_FILE *fp, const - - + + /* the jump table. */ -const struct _IO_jump_t _IO_obstack_jumps attribute_hidden = +const struct _IO_jump_t _IO_obstack_jumps libio_vtable attribute_hidden = @@ -450,7 +450,7 @@ diff -rupN a/libio/oldfileops.c b/libio/oldfileops.c --- a/libio/oldfileops.c 2012-12-24 22:02:13.000000000 -0500 +++ b/libio/oldfileops.c 2017-08-24 15:56:27.333139635 -0400 @@ -113,7 +113,7 @@ extern int errno; - + void attribute_compat_text_section -_IO_old_file_init (fp) @@ -461,7 +461,7 @@ diff -rupN a/libio/oldfileops.c b/libio/oldfileops.c @@ -138,6 +138,14 @@ _IO_old_file_init (fp) #endif } - + +void +attribute_compat_text_section +_IO_old_file_init (struct _IO_FILE_plus *fp) @@ -475,8 +475,8 @@ diff -rupN a/libio/oldfileops.c b/libio/oldfileops.c _IO_old_file_close_it (fp) @@ -776,7 +784,7 @@ _IO_old_file_xsputn (f, data, n) } - - + + -const struct _IO_jump_t _IO_old_file_jumps = +const struct _IO_jump_t _IO_old_file_jumps libio_vtable = { @@ -521,7 +521,7 @@ diff -rupN a/libio/oldiopopen.c b/libio/oldiopopen.c @@ -273,7 +273,7 @@ _IO_old_proc_close (fp) return wstatus; } - + -const struct _IO_jump_t _IO_old_proc_jumps = { +const struct _IO_jump_t _IO_old_proc_jumps libio_vtable = { JUMP_INIT_DUMMY, @@ -533,7 +533,7 @@ diff -rupN a/libio/strops.c b/libio/strops.c @@ -345,7 +345,7 @@ _IO_str_finish (fp, dummy) _IO_default_finish (fp, 0); } - + -const struct _IO_jump_t _IO_str_jumps = +const struct _IO_jump_t _IO_str_jumps libio_vtable = { @@ -544,8 +544,8 @@ diff -rupN a/libio/vsnprintf.c b/libio/vsnprintf.c +++ b/libio/vsnprintf.c 2017-08-24 14:56:40.292819983 -0400 @@ -66,7 +66,7 @@ _IO_strn_overflow (fp, c) } - - + + -const struct _IO_jump_t _IO_strn_jumps attribute_hidden = +const struct _IO_jump_t _IO_strn_jumps libio_vtable attribute_hidden = { @@ -556,8 +556,8 @@ diff -rupN a/libio/vswprintf.c b/libio/vswprintf.c +++ b/libio/vswprintf.c 2017-08-24 14:56:40.296819988 -0400 @@ -65,7 +65,7 @@ _IO_wstrn_overflow (fp, c) } - - + + -const struct _IO_jump_t _IO_wstrn_jumps attribute_hidden = +const struct _IO_jump_t _IO_wstrn_jumps libio_vtable attribute_hidden = { @@ -642,8 +642,8 @@ diff -rupN a/libio/wfileops.c b/libio/wfileops.c +++ b/libio/wfileops.c 2017-08-24 14:56:40.303819995 -0400 @@ -1035,7 +1035,7 @@ _IO_wfile_xsputn (f, data, n) libc_hidden_def (_IO_wfile_xsputn) - - + + -const struct _IO_jump_t _IO_wfile_jumps = +const struct _IO_jump_t _IO_wfile_jumps libio_vtable = { @@ -651,8 +651,8 @@ diff -rupN a/libio/wfileops.c b/libio/wfileops.c JUMP_INIT(finish, _IO_new_file_finish), @@ -1061,7 +1061,7 @@ const struct _IO_jump_t _IO_wfile_jumps libc_hidden_data_def (_IO_wfile_jumps) - - + + -const struct _IO_jump_t _IO_wfile_jumps_mmap = +const struct _IO_jump_t _IO_wfile_jumps_mmap libio_vtable = { @@ -661,7 +661,7 @@ diff -rupN a/libio/wfileops.c b/libio/wfileops.c @@ -1085,7 +1085,7 @@ const struct _IO_jump_t _IO_wfile_jumps_ JUMP_INIT(imbue, _IO_default_imbue) }; - + -const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap = +const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap libio_vtable = { @@ -672,8 +672,8 @@ diff -rupN a/libio/wmemstream.c b/libio/wmemstream.c +++ b/libio/wmemstream.c 2017-08-24 14:56:40.307819999 -0400 @@ -34,7 +34,7 @@ static int _IO_wmem_sync (_IO_FILE* fp) static void _IO_wmem_finish (_IO_FILE* fp, int) __THROW; - - + + -static const struct _IO_jump_t _IO_wmem_jumps = +static const struct _IO_jump_t _IO_wmem_jumps libio_vtable = { @@ -685,7 +685,7 @@ diff -rupN a/libio/wstrops.c b/libio/wstrops.c @@ -347,7 +347,7 @@ _IO_wstr_finish (fp, dummy) _IO_wdefault_finish (fp, 0); } - + -const struct _IO_jump_t _IO_wstr_jumps = +const struct _IO_jump_t _IO_wstr_jumps libio_vtable = { @@ -696,7 +696,7 @@ diff -rupN a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c 2017-08-24 14:56:40.314820007 -0400 @@ -2234,7 +2234,7 @@ _IO_helper_overflow (_IO_FILE *s, int c) } - + #ifdef COMPILE_WPRINTF -static const struct _IO_jump_t _IO_helper_jumps = +static const struct _IO_jump_t _IO_helper_jumps libio_vtable = diff --git a/SOURCES/glibc-rh1409611.patch b/SOURCES/glibc-rh1409611.patch index fd456ddf..f2e22d5c 100644 --- a/SOURCES/glibc-rh1409611.patch +++ b/SOURCES/glibc-rh1409611.patch @@ -12,7 +12,7 @@ Author: Siddhesh Poyarekar Date: Fri Dec 21 09:15:10 2012 +0530 Move more constants into static variables - + Code cleanup. commit f93a8d15699ee699282465dc1e03e033f3fabb52 @@ -67,7 +67,7 @@ Author: Siddhesh Poyarekar Date: Wed Jan 9 19:07:15 2013 +0530 Update comments in mpa.c - + Fixed comment style and clearer wording in some cases. commit 1066a53440d2744566e97c59bcd0d422186b3e90 @@ -75,7 +75,7 @@ Author: Siddhesh Poyarekar Date: Mon Jan 14 21:31:25 2013 +0530 Fix code formatting in mpa.c - + This includes the overridden mpa.c in power4. commit 2a91b5735ac1bc65ce5c2a3646d75ba7208e26e9 @@ -83,7 +83,7 @@ Author: Siddhesh Poyarekar Date: Mon Jan 14 21:36:58 2013 +0530 Minor tweak to mp multiplication - + Add a local variable to remove extra copies to/from memory in the Z array. @@ -92,7 +92,7 @@ Author: Siddhesh Poyarekar Date: Tue Feb 26 21:28:16 2013 +0530 Another tweak to the multiplication algorithm - + Reduce the formula to calculate mantissa so that we reduce the net number of multiplications performed. @@ -114,7 +114,7 @@ Author: Siddhesh Poyarekar Date: Wed Feb 13 14:16:23 2013 +0530 Optimized mp multiplication - + Don't bother multiplying zeroes since that only wastes cycles. commit bdf028142eb77d6ae59500db875068fa5d7b059d @@ -146,7 +146,7 @@ Author: Siddhesh Poyarekar Date: Mon Feb 25 16:43:02 2013 +0530 Use long wherever possible in mpa.c - + Using long throughout like powerpc does is beneficial since it reduces the need to switch to 32-bit instructions. It gives a very minor performance improvement. @@ -176,7 +176,7 @@ Author: Siddhesh Poyarekar Date: Tue Mar 26 20:24:04 2013 +0530 Use integral constants - + The compiler is smart enough to convert those into double for powerpc, but if we put them as doubles, it adds overhead by performing those operations in floating point mode. @@ -186,14 +186,14 @@ Author: Joseph Myers Date: Thu May 21 23:05:45 2015 +0000 Fix sysdeps/ieee754/dbl-64/mpa.c for -Wuninitialized. - + If you remove the "override CFLAGS += -Wno-uninitialized" in math/Makefile, one of the errors you get is: - + ../sysdeps/ieee754/dbl-64/mpa.c: In function '__mp_dbl.part.0': ../sysdeps/ieee754/dbl-64/mpa.c:183:5: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized] c *= X[0]; - + The problem is that the p < 5 case initializes c if p is 1, 2, 3 or 4 but not otherwise, and in fact p is positive for all calls to this function so the uninitialized case can't actually occur. This patch @@ -229,18 +229,18 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c /* denorm */ /* mp_dbl */ @@ -44,479 +42,868 @@ - + #include "endian.h" #include "mpa.h" -#include "mpa2.h" -#include /* For MIN() */ +#include +#include - + #ifndef SECTION # define SECTION #endif - + +#ifndef NO__CONST +/* TODO: With only a partial backport of the constant cleanup from + upstream we limit the definition of these two constants to @@ -278,7 +278,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + } return 0; } - + - -/* acr() compares the absolute values of two multiple precision numbers */ +/* Compare the absolute values of two multiple precision numbers. */ @@ -304,7 +304,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +__acr (const mp_no *x, const mp_no *y, int p) +{ + long i; - + -#if 0 -/* cr() compares the values of two multiple precision numbers */ -static int __cr(const mp_no *x, const mp_no *y, int p) { @@ -332,11 +332,11 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + else + i = mcr (x, y, p); + } - + return i; } #endif - + - #ifndef NO___CPY -/* Copy a multiple precision number. Set *y=*x. x=y is permissible. */ @@ -354,7 +354,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Y[i] = X[i]; } #endif - + +#ifndef NO___MP_DBL +/* Convert a multiple precision number *X into a double precision + number *Y, normalized case (|x| >= 2**(-1022))). X has precision @@ -384,7 +384,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + a *= 2; + z[1] *= 2; + } - + -#if 0 -/* Copy a multiple precision number x of precision m into a */ -/* multiple precision number y of precision n. In case n>m, */ @@ -409,10 +409,10 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + z[i] = r; + z[i - 1] += d; + } - + + u = ALIGN_DOWN_TO (z[3], TWO19); + v = z[3] - u; - + -#ifndef NO___MP_DBL -/* Convert a multiple precision number *x into a double precision */ -/* number *y, normalized case (|x| >= 2**(-1022))) */ @@ -468,30 +468,30 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + } + else + z[3] += 1; - } + } - } - else z[3] += ONE; - } - + - c = (z[1] + R *(z[2] + R * z[3]))/a; - } + c = (z[1] + R * (z[2] + R * z[3])) / a; + } - + c *= X[0]; - + - for (i=1; iEX; i--) c *= RADIXI; + for (i = 1; i < EX; i++) + c *= RADIX; + for (i = 1; i > EX; i--) + c *= RADIXI; - + *y = c; -#undef R +# undef R } - + -/* Convert a multiple precision number *x into a double precision */ -/* number *y, denormalized case (|x| < 2**(-1022))) */ -static void denorm(const mp_no *x, double *y, int p) @@ -516,7 +516,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + *y = 0; + return; + } - + -#define R radixi.d - if (EX<-44 || (EX==-44 && X[1] -42) norm(x,y,p); - else if (EX==-42 && X[1]>=TWO10) norm(x,y,p); - else denorm(x,y,p); @@ -659,7 +659,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +# undef R } -#endif - + +/* Convert multiple precision number *X into double precision number *Y. The + result is correctly rounded to the nearest/even. */ +void @@ -670,7 +670,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + *y = 0; + return; + } - + -/* dbl_mp() converts a double precision number x into a multiple precision */ -/* number *y. If the precision p is too small the result is truncated. x is */ -/* left unchanged. */ @@ -680,7 +680,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + denorm (x, y, p); +} +#endif - + +/* Get the multiple precision equivalent of X into *Y. If the precision is too + small, the result is truncated. */ void @@ -690,7 +690,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +{ + long i, n; + long p2 = p; - + - int i,n; - double u; + /* Sign. */ @@ -706,7 +706,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Y[0] = -1; + x = -x; + } - + - /* Sign */ - if (x == ZERO) {Y[0] = ZERO; return; } - else if (x > ZERO) Y[0] = ONE; @@ -739,7 +739,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + for (; i <= p2; i++) + Y[i] = 0; } - + - -/* add_magnitudes() adds the magnitudes of *x & *y assuming that */ -/* abs(*x) >= abs(*y) > 0. */ @@ -761,9 +761,9 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + long i, j, k; + long p2 = p; + mantissa_t zk; - + EZ = EX; - + - i=p; j=p+ EY - EX; k=p+1; + i = p2; + j = p2 + EY - EX; @@ -774,7 +774,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + __cpy (x, z, p); + return; + } - + - if (j<1) - {__cpy(x,z,p); return; } - else Z[k] = ZERO; @@ -802,7 +802,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c - else EZ += ONE; -} + zk = 0; - + + for (; j > 0; i--, j--) + { + zk += X[i] + Y[j]; @@ -817,7 +817,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + zk = 0; + } + } - + -/* sub_magnitudes() subtracts the magnitudes of *x & *y assuming that */ -/* abs(*x) > abs(*y) > 0. */ -/* The sign of the difference *z is undefined. x&y may overlap but not x&z */ @@ -837,7 +837,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + zk = 0; + } + } - + + if (zk == 0) + { + for (i = 1; i <= p2; i++) @@ -864,7 +864,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + long i, j, k; + long p2 = p; + mantissa_t zk; - + EZ = EX; + i = p2; + j = p2 + EY - EX; @@ -886,7 +886,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + } + else + zk = Z[k + 1] = 0; - + - if (EX == EY) { - i=j=k=p; - Z[k] = Z[k+1] = ZERO; } @@ -936,7 +936,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + zk = 0; + } + } - + - for (i=1; Z[i] == ZERO; i++) ; + /* We're done with digits from Y, so it's just digits in X. */ + for (; i > 0; i--) @@ -966,7 +966,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + for (; k <= p2; ) + Z[k++] = 0; } - + - -/* Add two multiple precision numbers. Set *z = *x + *y. x&y may overlap */ -/* but not x&z or y&z. One guard digit is used. The error is less than */ @@ -982,7 +982,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +__add (const mp_no *x, const mp_no *y, mp_no *z, int p) +{ int n; - + - if (X[0] == ZERO) {__cpy(y,z,p); return; } - else if (Y[0] == ZERO) {__cpy(x,z,p); return; } + if (X[0] == 0) @@ -995,7 +995,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + __cpy (x, z, p); + return; + } - + - if (X[0] == Y[0]) { - if (__acr(x,y,p) > 0) {add_magnitudes(x,y,z,p); Z[0] = X[0]; } - else {add_magnitudes(y,x,z,p); Z[0] = Y[0]; } @@ -1034,7 +1034,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Z[0] = 0; + } } - + +/* Subtract *Y from *X and return the result in *Z. X and Y may overlap but + not X and Z or Y and Z. One guard digit is used. The error is less than + one ULP. */ @@ -1055,7 +1055,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + __cpy (x, z, p); + return; + } - + -/* Subtract two multiple precision numbers. *z is set to *x - *y. x&y may */ -/* overlap but not x&z or y&z. One guard digit is used. The error is */ -/* less than one ulp. *x & *y are left unchanged. */ @@ -1088,7 +1088,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Z[0] = 0; + } +} - + +#ifndef NO__MUL +/* Multiply *X and *Y and store result in *Z. X and Y may overlap but not X + and Z or Y and Z. For P in [1, 2, 3], the exact result is truncated to P @@ -1110,7 +1110,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Z[0] = 0; + return; + } - + - int n; + /* We need not iterate through all X's and Y's since it's pointless to + multiply zeroes. Here, both are zero... */ @@ -1169,13 +1169,13 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + } + while (i < k) + diag[i++] = d; - + - if (X[0] == ZERO) {__cpy(y,z,p); Z[0] = -Z[0]; return; } - else if (Y[0] == ZERO) {__cpy(x,z,p); return; } + while (k > p2) + { + long lim = k / 2; - + - if (X[0] != Y[0]) { - if (__acr(x,y,p) > 0) {add_magnitudes(x,y,z,p); Z[0] = X[0]; } - else {add_magnitudes(y,x,z,p); Z[0] = -Y[0]; } @@ -1190,23 +1190,23 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + /* We want to add this only once, but since we subtract it in the sum + of products above, we add twice. */ + zk += 2 * X[lim] * (mantissa_store_t) Y[lim]; - + + for (i = k - p2, j = p2; i < j; i++, j--) + zk += (X[i] + X[j]) * (mantissa_store_t) (Y[i] + Y[j]); - + -/* Multiply two multiple precision numbers. *z is set to *x * *y. x&y */ -/* may overlap but not x&z or y&z. In case p=1,2,3 the exact result is */ -/* truncated to p digits. In case p>3 the error is bounded by 1.001 ulp. */ -/* *x & *y are left unchanged. */ + zk -= diag[k - 1]; - + -void -SECTION -__mul(const mp_no *x, const mp_no *y, mp_no *z, int p) { + DIV_RADIX (zk, Z[k]); + k--; + } - + - int i, i1, i2, j, k, k2; - double u; + /* The real deal. Mantissa digit Z[k] is the sum of all X[i] * Y[j] where i @@ -1230,7 +1230,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + /* We want to add this only once, but since we subtract it in the sum + of products above, we add twice. */ + zk += 2 * X[lim] * (mantissa_store_t) Y[lim]; - + - /* Is z=0? */ - if (X[0]*Y[0]==ZERO) - { Z[0]=ZERO; return; } @@ -1277,7 +1277,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + Z[i] = Z[i + 1]; + e--; + } - + + EZ = e; Z[0] = X[0] * Y[0]; } @@ -1294,14 +1294,14 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +{ + long i, j, k, ip; + mantissa_store_t yk; - + + /* Is z=0? */ + if (__glibc_unlikely (X[0] == 0)) + { + Y[0] = 0; + return; + } - + -/* Invert a multiple precision number. Set *y = 1 / *x. */ -/* Relative error bound = 1.001*r**(1-p) for p=2, 1.063*r**(1-p) for p=3, */ -/* 2.001*r**(1-p) for p>3. */ @@ -1311,7 +1311,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + for (ip = p; ip > 0; ip--) + if (X[ip] != 0) + break; - + -static -SECTION -void __inv(const mp_no *x, mp_no *y, int p) { @@ -1440,13 +1440,13 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c + __mul (&w, &z, y, p); + } } - + +/* Divide *X by *Y and store result in *Z. X and Y may overlap but not X and Z + or Y and Z. Relative error bound: + - For P = 2: 2.001 * R ^ (1 - P) + - For P = 3: 2.063 * R ^ (1 - P) + - For P > 3: 3.001 * R ^ (1 - P) - + -/* Divide one multiple precision number by another.Set *z = *x / *y. *x & *y */ -/* are left unchanged. x&y may overlap but not x&z or y&z. */ -/* Relative error bound = 2.001*r**(1-p) for p=2, 2.063*r**(1-p) for p=3 */ @@ -1460,7 +1460,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.c +__dvd (const mp_no *x, const mp_no *y, mp_no *z, int p) +{ mp_no w; - + - if (X[0] == ZERO) Z[0] = ZERO; - else {__inv(y,&w,p); __mul(x,&w,z,p);} + if (X[0] == 0) @@ -1502,9 +1502,9 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.h /* Arithmetic functions for multiple precision numbers. */ /* Common types and definition */ /************************************************************************/ - + +#include - + -typedef struct {/* This structure holds the details of a multi-precision */ - int e; /* floating point number, x: d[0] holds its sign (-1,0 or 1) */ - double d[40]; /* e holds its exponent (...,-2,-1,0,1,2,...) and */ @@ -1519,7 +1519,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.h - /* of a zero. */ +/* The mp_no structure holds the details of a multi-precision floating point + number. - + -typedef union { int i[2]; double d; } number; + - The radix of the number (R) is 2 ^ 24. + @@ -1556,13 +1556,13 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.h + define __mpone or __mptwo here for other code to use. */ +/* extern const mp_no __mpone; +extern const mp_no __mptwo; */ - + #define X x->d #define Y y->d @@ -63,21 +85,73 @@ typedef union { int i[2]; double d; } nu - + #define ABS(x) ((x) < 0 ? -(x) : (x)) - + -int __acr(const mp_no *, const mp_no *, int); -// int __cr(const mp_no *, const mp_no *, int); -void __cpy(const mp_no *, mp_no *, int); @@ -1607,7 +1607,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpa.h +void __mul (const mp_no *, const mp_no *, mp_no *, int); +void __sqr (const mp_no *, mp_no *, int); +void __dvd (const mp_no *, const mp_no *, mp_no *, int); - + extern void __mpatan (mp_no *, mp_no *, int); extern void __mpatan2 (mp_no *, mp_no *, mp_no *, int); extern void __mpsqrt (mp_no *, mp_no *, int); @@ -1666,10 +1666,10 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpexp.c + m=0; a=1; for (i=n-1; i>0; i--,n--) { if (m1np[i][p]+m2>0) break; } } - + @@ -84,8 +84,8 @@ __mpexp(mp_no *x, mp_no *y, int p) { __mul(x,&mpt1,&mps,p); - + /* Evaluate the polynomial. Put result in mpt2 */ - mpone.e=1; mpone.d[0]=ONE; mpone.d[1]=ONE; - mpk.e = 1; mpk.d[0] = ONE; mpk.d[1]=__mpexp_nn[n].d; @@ -1679,7 +1679,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpexp.c __add(&mpone,&mpt1,&mpak,p); for (k=n-1; k>1; k--) { @@ -99,9 +99,9 @@ __mpexp(mp_no *x, mp_no *y, int p) { - + /* Raise polynomial value to the power of 2**m. Put result in y */ for (k=0,j=0; k -42) norm(x,y,p); @@ -2037,7 +2037,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + --k; + } + Z[k] = zk; - + - long i,n; - long p2 = p; - double u; @@ -2049,7 +2049,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + Z[i] = Z[i + 1]; + e--; + } - + - /* Sign */ - if (x == ZERO) {Y[0] = ZERO; return; } - else if (x > ZERO) Y[0] = ONE; @@ -2070,7 +2070,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + EZ = e; + Z[0] = X[0] * Y[0]; } - + +/* Square *X and store result in *Y. X and Y may not overlap. For P in + [1, 2, 3], the exact result is truncated to P digits. In case P > 3 the + error is bounded by 1.001 ULP. This is a faster special case of @@ -2080,7 +2080,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c +{ + long i, j, k, ip; + double u, yk; - + -/* add_magnitudes() adds the magnitudes of *x & *y assuming that */ -/* abs(*x) >= abs(*y) > 0. */ -/* The sign of the sum *z is undefined. x&y may overlap but not x&z or y&z. */ @@ -2092,25 +2092,25 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + Y[0] = 0; + return; + } - + -static void add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { + /* We need not iterate through all X's since it's pointless to + multiply zeroes. */ + for (ip = p; ip > 0; ip--) + if (X[ip] != 0) + break; - + - long i,j,k; - long p2 = p; + k = (__glibc_unlikely (p < 3)) ? p + p : p + 3; - + - EZ = EX; + while (k > 2 * ip + 1) + Y[k--] = 0; - + - i=p2; j=p2+ EY - EX; k=p2+1; + yk = 0; - + - if (j<1) - {__cpy(x,z,p); return; } - else Z[k] = ZERO; @@ -2141,13 +2141,13 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + { + double yk2 = 0.0; + long lim = k / 2; - + + if (k % 2 == 0) + { + yk += X[lim] * X[lim]; + lim--; + } - + -/* sub_magnitudes() subtracts the magnitudes of *x & *y assuming that */ -/* abs(*x) > abs(*y) > 0. */ -/* The sign of the difference *z is undefined. x&y may overlap but not x&z */ @@ -2155,11 +2155,11 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c -/* *x & *y are left unchanged. */ + /* In __mul, this loop (and the one within the next while loop) run + between a range to calculate the mantissa as follows: - + -static void sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { + Z[k] = X[k] * Y[n] + X[k+1] * Y[n-1] ... + X[n-1] * Y[k+1] + + X[n] * Y[k] - + - long i,j,k; - long p2 = p; + For X == Y, we can get away with summing halfway and doubling the @@ -2167,10 +2167,10 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + to be added separately (above). */ + for (i = k - p, j = p; i <= lim; i++, j--) + yk2 += X[i] * X[j]; - + - EZ = EX; + yk += 2.0 * yk2; - + - if (EX == EY) { - i=j=k=p2; - Z[k] = Z[k+1] = ZERO; } @@ -2274,7 +2274,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c -/* may overlap but not x&z or y&z. In case p=1,2,3 the exact result is */ -/* truncated to p digits. In case p>3 the error is bounded by 1.001 ulp. */ -/* *x & *y are left unchanged. */ - + -void __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) { - - long i, i1, i2, j, k, k2; @@ -2308,7 +2308,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c - zk2 = zero.d; - /* Do two multiply/adds per loop iteration, using independent - accumulators; zk and zk2. */ -- for (i=i1,j=i2-1; id[i]*y->d[j]; - zk2 += x->d[i+1]*y->d[j-1]; @@ -2319,7 +2319,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/power4/fpu/mpa.c + { + yk += X[lim] * X[lim]; + lim--; - } + } - zk += zk2; /* final sum. */ - } - else @@ -2429,7 +2429,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/atnat.h @@ -138,8 +138,6 @@ #endif #endif - + -#define ZERO zero.d -#define ONE one.d #define A a.d @@ -2441,7 +2441,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/atnat.h #define U8 u8.d -#define TWO8 two8.d -#define TWO52 two52.d - + #endif Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/atnat2.h =================================================================== @@ -2450,7 +2450,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/atnat2.h @@ -174,11 +174,4 @@ #endif #endif - + -#define ZERO zero.d -#define MZERO mzero.d -#define ONE one.d @@ -2563,7 +2563,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpatan.h --- glibc-2.17-c758a686.orig/sysdeps/ieee754/dbl-64/mpatan.h +++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpatan.h @@ -177,6 +177,3 @@ __atan_twonm1[33] = { - + #endif #endif - @@ -2576,15 +2576,15 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpatan2.c @@ -49,18 +49,16 @@ void SECTION __mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) { - + - static const double ZERO = 0.0, ONE = 1.0; - mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; mp_no mpt1,mpt2,mpt3; - - + + - if (X[0] <= ZERO) { - mpone.e = 1; mpone.d[0] = mpone.d[1] = ONE; + if (X[0] <= 0) { @@ -2602,7 +2602,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpexp.h @@ -159,11 +159,4 @@ extern const number __mpexp_half attribu #endif #endif - + -#define RADIX __mpexp_radix.d -#define RADIXI __mpexp_radixi.d -#define ZERO __mpexp_zero.d @@ -2616,9 +2616,9 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpsqrt.h --- glibc-2.17-c758a686.orig/sysdeps/ieee754/dbl-64/mpsqrt.h +++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpsqrt.h @@ -51,7 +51,4 @@ extern const int __mpsqrt_mp[33] attribu - 4,4,4,4,4,4,4,4,4}; + 4,4,4,4,4,4,4,4,4}; #endif - + -#define ONE __mpsqrt_one.d -#define HALFRAD __mpsqrt_halfrad.d - @@ -2630,12 +2630,12 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mptan.c @@ -47,8 +47,6 @@ void SECTION __mptan(double x, mp_no *mpy, int p) { - + - static const double MONE = -1.0; - int n; mp_no mpw, mpc, mps; - + @@ -56,7 +54,7 @@ __mptan(double x, mp_no *mpy, int p) { __c32(&mpw, &mpc, &mps, p); /* computing sin(x) and cos(x) */ if (n) /* second or fourth quarter of unit circle */ @@ -2644,7 +2644,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mptan.c + mpy->d[0] *= -1; } /* tan is negative in this area */ else __dvd(&mps,&mpc,mpy,p); - + Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/ulog.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/ieee754/dbl-64/ulog.h @@ -2652,7 +2652,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/ulog.h @@ -181,10 +181,6 @@ #endif #endif - + -#define ZERO zero.d -#define ONE one.d -#define HALF half.d @@ -2667,7 +2667,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/utan.h @@ -270,10 +270,4 @@ #endif #endif - + - -#define ZERO zero.d -#define ONE one.d @@ -2804,16 +2804,16 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/e_atan2.c - if ((ux&0x80000000)==0x00000000) return MZERO; + if ((ux&0x80000000)==0x00000000) return -0.0; else return mopi.d;} } - + /* x=+-0 */ - if (x==ZERO) { + if (x==0) { if ((uy&0x80000000)==0x00000000) return hpi.d; else return mhpi.d; } - + @@ -118,8 +118,8 @@ __ieee754_atan2(double y,double x) { else if (uy==0xfff00000) { - if (dy==0x00000000) return mqpi.d; } + if (dy==0x00000000) return mqpi.d; } else { - if ((uy&0x80000000)==0x00000000) return ZERO; - else return MZERO; } @@ -2824,7 +2824,7 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/e_atan2.c else if (ux==0xfff00000) { @@ -141,14 +141,14 @@ __ieee754_atan2(double y,double x) { if (dy==0x00000000) return mhpi.d; } - + /* either x/y or y/x is very close to zero */ - ax = (xZERO) ? opi.d : mopi.d); } } + else { return ((y>0) ? opi.d : mopi.d); } } - + /* if either x or y is extremely close to zero, scale abs(x), abs(y). */ if (axZERO) { + if (x>0) { - + /* (i) x>0, abs(y)< abs(x): atan(ay/ax) */ if (ay U03, 1)) { goto case_03; } - - + + @@ -113,25 +113,25 @@ __ieee754_log(double x) { - w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d)))))))); + w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d)))))))); EMULV(w,a,s2,ss2,t1,t2,t3,t4,t5) ADD2(d10.d,dd10.d,s2,ss2,s3,ss3,t1,t2) - MUL2(w,ZERO,s3,ss3,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8) @@ -2981,39 +2981,39 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/e_log.c + MUL2(w,0,s3,ss3,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8) + MUL2(w,0,s2,ss2,s3,ss3,t1,t2,t3,t4,t5,t6,t7,t8) + ADD2(w,0, s3,ss3, b, bb,t1,t2) - + /* End stage II, case abs(x-1) < 0.03 */ if ((y=b+(bb+b*E4)) == b+(bb-b*E4)) return y; @@ -155,7 +155,7 @@ __ieee754_log(double x) { j = (num.i[HIGH_HALF] & 0x000fffff) >> 4; - + /* Compute w=(u-ui*vj)/(ui*vj) */ - p0=(ONE+(i-75)*DEL_U)*(ONE+(j-180)*DEL_V); + p0=(1+(i-75)*DEL_U)*(1+(j-180)*DEL_V); q=u-p0; r0=Iu[i].d*Iv[j].d; w=q*r0; - + /* Evaluate polynomial I */ @@ -178,11 +178,11 @@ __ieee754_log(double x) { - + /* Improve the accuracy of r0 */ EMULV(p0,r0,sa,sb,t1,t2,t3,t4,t5) - t=r0*((ONE-sa)-sb); + t=r0*((1-sa)-sb); EADD(r0,t,ra,rb) - + /* Compute w */ - MUL2(q,ZERO,ra,rb,w,ww,t1,t2,t3,t4,t5,t6,t7,t8) + MUL2(q,0,ra,rb,w,ww,t1,t2,t3,t4,t5,t6,t7,t8) - + EADD(A,B0,a0,aa0) - + Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/s_atan.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/ieee754/dbl-64/s_atan.c +++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/s_atan.c @@ -82,7 +82,7 @@ double atan(double x) { return x+x; - + /* Regular values of x, including denormals +-0 and +-INF */ - u = (x= 1/2 */ if ((y=t1+(yy-u3)) == t1+(yy+u3)) return __signArctan(x,y); - + - DIV2(ONE,ZERO,u,ZERO,w,ww,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1,0,u,0,w,ww,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) t1=w-hij[i][0].d; EADD(t1,ww,z,zz) s1=z*(hij[i][11].d+z*(hij[i][12].d+z*(hij[i][13].d+ - z*(hij[i][14].d+z* hij[i][15].d)))); + z*(hij[i][14].d+z* hij[i][15].d)))); - ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2) + ADD2(hij[i][9].d,hij[i][10].d,s1,0,s2,ss2,t1,t2) MUL2(z,zz,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -3093,23 +3093,23 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/s_atan.c if (u__atan_xm[m].d) break;} + {if (dx>__atan_xm[m].d) break;} } mpone.e = mptwo.e = mptwoim1.e = 1; - mpone.d[0] = mpone.d[1] = mptwo.d[0] = mptwoim1.d[0] = ONE; - mptwo.d[1] = TWO; + mpone.d[0] = mpone.d[1] = mptwo.d[0] = mptwoim1.d[0] = 1; + mptwo.d[1] = 2; - - /* Reduce x m times */ + + /* Reduce x m times */ __mul(x,x,&mpsm,p); @@ -92,7 +92,7 @@ __mpatan(mp_no *x, mp_no *y, int p) { n=__atan_np[p]; mptwoim1.d[1] = __atan_twonm1[p].d; @@ -3251,12 +3251,12 @@ Index: glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpsqrt.c +++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/mpsqrt.c @@ -62,8 +62,8 @@ __mpsqrt(mp_no *x, mp_no *y, int p) { mp_no mpxn,mpz,mpu,mpt1,mpt2; - + /* Prepare multi-precision 1/2 and 3/2 */ - mphalf.e =0; mphalf.d[0] =ONE; mphalf.d[1] =HALFRAD; - mp3halfs.e=1; mp3halfs.d[0]=ONE; mp3halfs.d[1]=ONE; mp3halfs.d[2]=HALFRAD; + mphalf.e =0; mphalf.d[0] =1; mphalf.d[1] =HALFRAD; + mp3halfs.e=1; mp3halfs.d[0]=1; mp3halfs.d[1]=1; mp3halfs.d[2]=HALFRAD; - + ey=EX/2; __cpy(x,&mpxn,p); mpxn.e -= (ey+ey); __mp_dbl(&mpxn,&dx,p); dy=fastiroot(dx); __dbl_mp(dy,&mpu,p); diff --git a/SOURCES/glibc-rh1413638-2.patch b/SOURCES/glibc-rh1413638-2.patch index 7815491b..7343462e 100644 --- a/SOURCES/glibc-rh1413638-2.patch +++ b/SOURCES/glibc-rh1413638-2.patch @@ -3,7 +3,7 @@ Author: Adhemerval Zanella Date: Tue Mar 10 09:38:54 2015 -0400 powerpc: Fix incorrect results for pow when using FMA - + This patch adds no FMA generation for e_pow to avoid precision issues for powerpc. This fixes BZ#18104. diff --git a/SOURCES/glibc-rh1417205.patch b/SOURCES/glibc-rh1417205.patch index 04a9718a..ff3393b4 100644 --- a/SOURCES/glibc-rh1417205.patch +++ b/SOURCES/glibc-rh1417205.patch @@ -3,7 +3,7 @@ Author: Andreas Jaeger Date: Fri May 3 20:51:27 2013 +0200 Sync with Linux 3.9 - + * sysdeps/gnu/netinet/tcp.h (TCP_TIMESTAMP): New value, from Linux 3.9. * sysdeps/unix/sysv/linux/bits/socket.h (PF_VSOCK, AF_VSOCK): @@ -19,7 +19,7 @@ Index: b/sysdeps/gnu/netinet/tcp.h #define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ #define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ +#define TCP_TIMESTAMP 24 /* TCP time stamp */ - + #ifdef __USE_MISC # include Index: b/sysdeps/unix/sysv/linux/bits/socket.h @@ -33,7 +33,7 @@ Index: b/sysdeps/unix/sysv/linux/bits/socket.h -#define PF_MAX 40 /* For now.. */ +#define PF_VSOCK 40 /* vSockets. */ +#define PF_MAX 41 /* For now.. */ - + /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -124,6 +125,7 @@ typedef __socklen_t socklen_t; @@ -42,5 +42,5 @@ Index: b/sysdeps/unix/sysv/linux/bits/socket.h #define AF_NFC PF_NFC +#define AF_VSOCK PF_VSOCK #define AF_MAX PF_MAX - + /* Socket level values. Others are defined in the appropriate headers. diff --git a/SOURCES/glibc-rh1418978-0.patch b/SOURCES/glibc-rh1418978-0.patch index 7ad7a91b..97ffe1d1 100644 --- a/SOURCES/glibc-rh1418978-0.patch +++ b/SOURCES/glibc-rh1418978-0.patch @@ -15,7 +15,7 @@ index 1673eea7f2667aae..948c46420193051d 100644 @@ -384,6 +384,9 @@ LDFLAGS.so += $(hashstyle-LDFLAGS) LDFLAGS-rtld += $(hashstyle-LDFLAGS) endif - + +# Additional libraries to link into every test. +link-extra-libs-tests = $(libsupport) + @@ -34,16 +34,16 @@ index 1673eea7f2667aae..948c46420193051d 100644 @@ -732,7 +735,7 @@ libio-include = -I$(..)libio # List of non-library modules that we build. built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \ - libSegFault libpcprofile librpcsvc locale-programs \ + libSegFault libpcprofile librpcsvc locale-programs \ - memusagestat nonlib nscd extramodules libnldbl + memusagestat nonlib nscd extramodules libnldbl libsupport - + in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \ - $(libof-$( Date: Mon Jan 8 14:33:17 2018 +0100 resolv: Support binary labels in test framework - + The old implementation based on hsearch_r used an ad-hoc C string encoding and produced an incorrect format on the wire for domain names which contained bytes which needed escaping when printed. - + This commit switches to ns_name_pton for the wire format conversion (now that we have separate tests for it) and uses a tsearch tree with a suitable comparison function to locate compression targets. diff --git a/SOURCES/glibc-rh1418978-2-1.patch b/SOURCES/glibc-rh1418978-2-1.patch index 56896d8d..5ed2ebab 100644 --- a/SOURCES/glibc-rh1418978-2-1.patch +++ b/SOURCES/glibc-rh1418978-2-1.patch @@ -13,6 +13,6 @@ Index: b/nptl/tst-oddstacklimit.c #include #include +#include - + /* This sets the stack resource limit to 1023kb, which is not a multiple of the page size since every architecture's page size is > 1k. */ diff --git a/SOURCES/glibc-rh1418978-2-2.patch b/SOURCES/glibc-rh1418978-2-2.patch index 0b42b59e..720cc650 100644 --- a/SOURCES/glibc-rh1418978-2-2.patch +++ b/SOURCES/glibc-rh1418978-2-2.patch @@ -10,9 +10,9 @@ Index: b/sysdeps/generic/get-rounding-mode.h +++ b/sysdeps/generic/get-rounding-mode.h @@ -20,6 +20,7 @@ #define _GET_ROUNDING_MODE_H 1 - + #include +#include - + /* Define values for FE_* modes not defined for this architecture. */ #ifdef FE_DOWNWARD diff --git a/SOURCES/glibc-rh1418978-2-4.patch b/SOURCES/glibc-rh1418978-2-4.patch index 618a0c11..882ea307 100644 --- a/SOURCES/glibc-rh1418978-2-4.patch +++ b/SOURCES/glibc-rh1418978-2-4.patch @@ -9,7 +9,7 @@ Index: b/nscd/nscd-client.h --- a/nscd/nscd-client.h +++ b/nscd/nscd-client.h @@ -24,6 +24,7 @@ - + #include #include +#include diff --git a/SOURCES/glibc-rh1418978-2-5.patch b/SOURCES/glibc-rh1418978-2-5.patch index a089dbcc..dd11eb84 100644 --- a/SOURCES/glibc-rh1418978-2-5.patch +++ b/SOURCES/glibc-rh1418978-2-5.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Mon Feb 18 18:17:05 2013 +0530 Fix build warnings in some test cases - + Include stdlib.h to get declaration of exit(3) Index: b/misc/tst-pselect.c @@ -15,8 +15,8 @@ Index: b/misc/tst-pselect.c #include #include +#include - - + + static volatile int handler_called; Index: b/nptl/sysdeps/pthread/tst-timer.c =================================================================== @@ -27,8 +27,8 @@ Index: b/nptl/sysdeps/pthread/tst-timer.c #include #include +#include - - + + static void Index: b/nptl/tst-barrier4.c =================================================================== @@ -39,8 +39,8 @@ Index: b/nptl/tst-barrier4.c #include #include +#include - - + + static pthread_barrier_t b1; Index: b/nptl/tst-robust7.c =================================================================== @@ -51,6 +51,6 @@ Index: b/nptl/tst-robust7.c #include #include +#include - - + + static pthread_barrier_t b; diff --git a/SOURCES/glibc-rh1418978-2-6.patch b/SOURCES/glibc-rh1418978-2-6.patch index f4e935ec..34095c3c 100644 --- a/SOURCES/glibc-rh1418978-2-6.patch +++ b/SOURCES/glibc-rh1418978-2-6.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Mon Sep 8 13:49:36 2014 +0200 Turn on -Werror=implicit-function-declaration - + GCC 4.4, the minimum compiler version, supports this option. Unlike other warnings, -Wimplicit-function-declaration warnings should be independent of compiler versions, so this change should not cause @@ -19,6 +19,6 @@ Index: b/Makeconfig endif -+gccwarn-c = -Wstrict-prototypes ++gccwarn-c = -Wstrict-prototypes -Werror=implicit-function-declaration - + # We do not depend on the address of constants in different files to be # actually different, so allow the compiler to merge them all. diff --git a/SOURCES/glibc-rh1418978-3-1.patch b/SOURCES/glibc-rh1418978-3-1.patch index 9cc535d2..9997ad33 100644 --- a/SOURCES/glibc-rh1418978-3-1.patch +++ b/SOURCES/glibc-rh1418978-3-1.patch @@ -3,18 +3,18 @@ Author: Will Newton Date: Fri Apr 11 15:21:23 2014 +0100 test-skeleton.c: Use stdout for error messages - + At the moment the test skeleton uses a mixture of stdout and stderr for error message output. Using stdout for all test output keeps all output correctly ordered and properly redirected to the output file. The suggestion to use stdout is also made on the wiki: - + https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case - + ChangeLog: - + 2014-06-23 Will Newton - + * test-skeleton.c (signal_handler): Use printf and %m rather than perror. Use printf rather than fprintf to stderr. Use puts rather than fputs to stderr. @@ -32,10 +32,10 @@ Index: b/test-skeleton.c + printf ("Failed to kill test process: %m\n"); exit (1); } - + @@ -209,16 +209,16 @@ signal_handler (int sig __attribute__ (( #endif - + if (killed == 0 || (WIFSIGNALED (status) && WTERMSIG (status) == SIGKILL)) - fputs ("Timed out: killed the child process\n", stderr); + puts ("Timed out: killed the child process"); @@ -54,30 +54,30 @@ Index: b/test-skeleton.c - WEXITSTATUS (status)); + printf ("Timed out: killed the child process but it exited %d\n", + WEXITSTATUS (status)); - + /* Exit with an error. */ exit (1); @@ -308,7 +308,7 @@ main (int argc, char *argv[]) - + if (chdir (test_dir) < 0) - { + { - perror ("chdir"); + printf ("chdir: %m\n"); - exit (1); - } + exit (1); + } } @@ -367,10 +367,10 @@ main (int argc, char *argv[]) - data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT, - data_limit.rlim_max); - if (setrlimit (RLIMIT_DATA, &data_limit) < 0) + data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT, + data_limit.rlim_max); + if (setrlimit (RLIMIT_DATA, &data_limit) < 0) - perror ("setrlimit: RLIMIT_DATA"); + printf ("setrlimit: RLIMIT_DATA: %m\n"); - } + } else - perror ("getrlimit: RLIMIT_DATA"); + printf ("getrlimit: RLIMIT_DATA: %m\n"); #endif - + /* We put the test process in its own pgrp so that if it bogusly @@ -382,7 +382,7 @@ main (int argc, char *argv[]) } @@ -87,17 +87,17 @@ Index: b/test-skeleton.c + printf ("Cannot fork test program: %m\n"); exit (1); } - + @@ -420,18 +420,16 @@ main (int argc, char *argv[]) if (EXPECTED_SIGNAL != 0) - { - if (WTERMSIG (status) == 0) + { + if (WTERMSIG (status) == 0) - fprintf (stderr, - "Expected signal '%s' from child, got none\n", - strsignal (EXPECTED_SIGNAL)); + printf ("Expected signal '%s' from child, got none\n", + strsignal (EXPECTED_SIGNAL)); - else + else - fprintf (stderr, - "Incorrect signal from child: got `%s', need `%s'\n", - strsignal (WTERMSIG (status)), @@ -105,7 +105,7 @@ Index: b/test-skeleton.c + printf ("Incorrect signal from child: got `%s', need `%s'\n", + strsignal (WTERMSIG (status)), + strsignal (EXPECTED_SIGNAL)); - } + } else - fprintf (stderr, "Didn't expect signal from child: got `%s'\n", - strsignal (WTERMSIG (status))); @@ -113,7 +113,7 @@ Index: b/test-skeleton.c + strsignal (WTERMSIG (status))); exit (1); } - + @@ -441,8 +439,8 @@ main (int argc, char *argv[]) #else if (WEXITSTATUS (status) != EXPECTED_STATUS) @@ -124,3 +124,4 @@ Index: b/test-skeleton.c + EXPECTED_STATUS, WEXITSTATUS (status)); exit (1); } + diff --git a/SOURCES/glibc-rh1418978-3-2.patch b/SOURCES/glibc-rh1418978-3-2.patch index f64c37c6..f85c01a1 100644 --- a/SOURCES/glibc-rh1418978-3-2.patch +++ b/SOURCES/glibc-rh1418978-3-2.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Mon Mar 7 13:48:47 2016 +0100 test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648] - + With older kernels, it is mostly ineffective because it causes malloc to switch from sbrk to mmap (potentially invalidating malloc testing compared to what real appliations do). With newer kernels which @@ -18,7 +18,7 @@ Index: b/test-skeleton.c @@ -356,23 +356,6 @@ main (int argc, char *argv[]) setrlimit (RLIMIT_CORE, &core_limit); #endif - + -#ifdef RLIMIT_DATA - /* Try to avoid eating all memory if a test leaks. */ - struct rlimit data_limit; @@ -37,5 +37,5 @@ Index: b/test-skeleton.c -#endif - /* We put the test process in its own pgrp so that if it bogusly - generates any job control signals, they won't hit the whole build. */ + generates any job control signals, they won't hit the whole build. */ setpgid (0, 0); diff --git a/SOURCES/glibc-rh1418978-max_align_t.patch b/SOURCES/glibc-rh1418978-max_align_t.patch index abdfa1ce..371b82c9 100644 --- a/SOURCES/glibc-rh1418978-max_align_t.patch +++ b/SOURCES/glibc-rh1418978-max_align_t.patch @@ -14,8 +14,8 @@ Index: glibc-2.17-c758a686/include/sys/cdefs.h --- glibc-2.17-c758a686.orig/include/sys/cdefs.h +++ glibc-2.17-c758a686/include/sys/cdefs.h @@ -15,6 +15,18 @@ rtld_hidden_proto (__chk_fail) - - + + # define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__))) + +/* This mirrors the C11/C++11 max_align_t type provided by GCC, but it @@ -30,7 +30,7 @@ Index: glibc-2.17-c758a686/include/sys/cdefs.h +#endif /* __STDC_VERSION__ < 201112 && __cplusplus < 201103L */ + #endif - + #endif Index: glibc-2.17-c758a686/malloc/tst-malloc-thread-fail.c =================================================================== @@ -50,7 +50,7 @@ Index: glibc-2.17-c758a686/malloc/tst-malloc-thread-fail.c - long long ll __attribute__ ((__aligned__ (__alignof__ (long long)))); - long double ld __attribute__ ((__aligned__ (__alignof__ (long double)))); -} libc_max_align_t; - + /* Wrapper for calloc with an optimization barrier. */ static void * @@ -93,7 +83,7 @@ allocate_1 (void) diff --git a/SOURCES/glibc-rh1418997.patch b/SOURCES/glibc-rh1418997.patch index 9ddda79d..973029df 100644 --- a/SOURCES/glibc-rh1418997.patch +++ b/SOURCES/glibc-rh1418997.patch @@ -3,23 +3,23 @@ Author: Joseph Myers Date: Tue Oct 25 15:54:16 2016 +0000 Fix cmpli usage in power6 memset. - + Building glibc for powerpc64 with recent (2.27.51.20161012) binutils, with multi-arch enabled, I get the error: - + ../sysdeps/powerpc/powerpc64/power6/memset.S: Assembler messages: ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (5 is not between 0 and 1) ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (128 is not between 0 and 31) ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: missing operand - + Indeed, cmpli is documented as a four-operand instruction, and looking at nearby code it seems likely cmpldi was intended. This patch fixes this powerpc64 code accordingly, and makes a corresponding change to the powerpc32 code. - + Tested for powerpc, powerpc64 and powerpc64le by Tulio Magno Quites Machado Filho - + * sysdeps/powerpc/powerpc32/power6/memset.S (memset): Use cmplwi instead of cmpli. * sysdeps/powerpc/powerpc64/power6/memset.S (memset): Use cmpldi @@ -34,9 +34,9 @@ diff -rup a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc3 L(cacheAligned512): - cmpli cr1,rLEN,128 + cmplwi cr1,rLEN,128 - blt cr1,L(cacheAligned1) - dcbz 0,rMEMP - addi rLEN,rLEN,-128 + blt cr1,L(cacheAligned1) + dcbz 0,rMEMP + addi rLEN,rLEN,-128 diff -rup a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S --- a/sysdeps/powerpc/powerpc64/power6/memset.S 2017-03-06 13:52:22.000000000 -0500 +++ b/sysdeps/powerpc/powerpc64/power6/memset.S 2017-03-06 13:54:35.824216755 -0500 @@ -46,6 +46,6 @@ diff -rup a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc6 L(cacheAligned512): - cmpli cr1,rLEN,128 + cmpldi cr1,rLEN,128 - blt cr1,L(cacheAligned1) - dcbz 0,rMEMP - addi rLEN,rLEN,-128 + blt cr1,L(cacheAligned1) + dcbz 0,rMEMP + addi rLEN,rLEN,-128 diff --git a/SOURCES/glibc-rh1421155.patch b/SOURCES/glibc-rh1421155.patch index 2ca4f0cd..08e0b1fe 100644 --- a/SOURCES/glibc-rh1421155.patch +++ b/SOURCES/glibc-rh1421155.patch @@ -5,7 +5,7 @@ Author: H.J. Lu Date: Mon Mar 16 14:58:43 2015 -0700 Preserve bound registers in _dl_runtime_resolve - + We need to add a BND prefix before indirect branch at the end of _dl_runtime_resolve to preserve bound registers. @@ -14,7 +14,7 @@ Author: H.J. Lu Date: Tue Jul 7 05:23:24 2015 -0700 Add and use sysdeps/i386/link-defines.sym - + Define macros for fields in La_i86_regs and La_i86_retval and use them in dl-trampoline.S, instead of hardcoded values. @@ -23,7 +23,7 @@ Author: Igor Zamyatin Date: Thu Jul 9 06:50:12 2015 -0700 Preserve bound registers for pointer pass/return - + We need to save/restore bound registers and add a BND prefix before branches in _dl_runtime_profile so that bound registers for pointer pass and return are preserved when LD_AUDIT is used. @@ -34,14 +34,14 @@ Author: H.J. Lu Date: Tue Aug 25 04:33:54 2015 -0700 Save and restore vector registers in x86-64 ld.so - + This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve and _dl_runtime_profile, which save and restore the first 8 vector registers used for parameter passing. elf_machine_runtime_setup selects the proper _dl_runtime_resolve or _dl_runtime_profile based on _dl_x86_cpu_features. It avoids race condition caused by FOREIGN_CALL macros, which are only used for x86-64. - + Performance impact of saving and restoring 8 vector registers are negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when ld.so is optimized with SSE2. @@ -51,23 +51,23 @@ Author: H.J. Lu Date: Tue Sep 6 08:50:55 2016 -0700 X86-64: Add _dl_runtime_resolve_avx[512]_{opt|slow} [BZ #20508] - + There is transition penalty when SSE instructions are mixed with 256-bit AVX or 512-bit AVX512 load instructions. Since _dl_runtime_resolve_avx and _dl_runtime_profile_avx512 save/restore 256-bit YMM/512-bit ZMM registers, there is transition penalty when SSE instructions are used with lazy binding on AVX and AVX512 processors. - + To avoid SSE transition penalty, if only the lower 128 bits of the first 8 vector registers are non-zero, we can preserve %xmm0 - %xmm7 registers with the zero upper bits. - + For AVX and AVX512 processors which support XGETBV with ECX == 1, we can use XGETBV with ECX == 1 to check if the upper 128 bits of YMM registers or the upper 256 bits of ZMM registers are zero. We can restore only the non-zero portion of vector registers with AVX/AVX512 load instructions which will zero-extend upper bits of vector registers. - + This patch adds _dl_runtime_resolve_sse_vex which saves and restores XMM registers with 128-bit AVX store/load instructions. It is used to preserve YMM/ZMM registers when only the lower 128 bits are non-zero. @@ -77,7 +77,7 @@ Date: Tue Sep 6 08:50:55 2016 -0700 This avoids SSE transition penalty caused by _dl_runtime_resolve_avx and _dl_runtime_profile_avx512 when only the lower 128 bits of vector registers are used. - + _dl_runtime_resolve_avx_slow is added and used for AVX processors which don't support XGETBV with ECX == 1. Since there is no SSE transition penalty on AVX512 processors which don't support XGETBV with ECX == 1, @@ -88,7 +88,7 @@ Author: H.J. Lu Date: Thu Feb 9 12:19:44 2017 -0800 x86-64: Verify that _dl_runtime_resolve preserves vector registers - + On x86-64, _dl_runtime_resolve must preserve the first 8 vector registers. Add 3 _dl_runtime_resolve tests to verify that SSE, AVX and AVX512 registers are preserved. @@ -98,22 +98,22 @@ Author: H.J. Lu Date: Tue Mar 21 10:59:31 2017 -0700 x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258] - + On Skylake server, _dl_runtime_resolve_avx512_opt is used to preserve the first 8 vector registers. The code layout is - + if only %xmm0 - %xmm7 registers are used preserve %xmm0 - %xmm7 registers if only %ymm0 - %ymm7 registers are used preserve %ymm0 - %ymm7 registers preserve %zmm0 - %zmm7 registers - + Branch predication always executes the fallthrough code path to preserve %zmm0 - %zmm7 registers speculatively, even though only %xmm0 - %xmm7 registers are used. This leads to lower CPU frequency on Skylake server. This patch changes the fallthrough code path to preserve %xmm0 - %xmm7 registers instead: - + if whole %zmm0 - %zmm7 registers are used preserve %zmm0 - %zmm7 registers if only %ymm0 - %ymm7 registers are used @@ -121,7 +121,7 @@ Date: Tue Mar 21 10:59:31 2017 -0700 preserve %xmm0 - %xmm7 registers Tested on Skylake server. - + [BZ #21258] * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve_opt): Define only if _dl_runtime_resolve is defined to @@ -138,7 +138,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/x86_64/tcb-offsets.sym PRIVATE_FUTEX offsetof (tcbhead_t, private_futex) #endif -RTLD_SAVESPACE_SSE offsetof (tcbhead_t, rtld_savespace_sse) - + -- Not strictly offsets, but these values are also used in the TCB. TCB_CANCELSTATE_BITMASK CANCELSTATE_BITMASK Index: glibc-2.17-c758a686/nptl/sysdeps/x86_64/tls.h @@ -159,13 +159,13 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/x86_64/tls.h + /* Must be kept even if it is no longer used by glibc since programs, + like AddressSanitizer, depend on the size of tcbhead_t. */ + __128bits __glibc_unused2[8][4] __attribute__ ((aligned (32))); - + void *__padding[8]; } tcbhead_t; @@ -380,41 +381,6 @@ typedef struct # define THREAD_GSCOPE_WAIT() \ GL(dl_wait_lookup_done) () - + - -# ifdef SHARED -/* Defined in dl-trampoline.S. */ @@ -202,7 +202,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/x86_64/tls.h - - #endif /* __ASSEMBLER__ */ - + #endif /* tls.h */ Index: glibc-2.17-c758a686/sysdeps/i386/Makefile =================================================================== @@ -223,7 +223,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/configure @@ -179,5 +179,32 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5 $as_echo "$libc_cv_cc_novzeroupper" >&6; } - + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel MPX support" >&5 +$as_echo_n "checking for Intel MPX support... " >&6; } +if ${libc_cv_asm_mpx+:} false; then : @@ -252,15 +252,15 @@ Index: glibc-2.17-c758a686/sysdeps/i386/configure +fi + $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - + Index: glibc-2.17-c758a686/sysdeps/i386/configure.in =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/i386/configure.in +++ glibc-2.17-c758a686/sysdeps/i386/configure.in @@ -53,6 +53,21 @@ LIBC_TRY_CC_OPTION([-mno-vzeroupper], - [libc_cv_cc_novzeroupper=no]) + [libc_cv_cc_novzeroupper=no]) ]) - + +dnl Check whether asm supports Intel MPX +AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl +cat > conftest.s <<\EOF @@ -285,7 +285,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S +++ glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S @@ -17,6 +17,13 @@ . */ - + #include +#include + @@ -294,13 +294,13 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S +#else +# define PRESERVE_BND_REGS_PREFIX .byte 0xf2 +#endif - - .text - .globl _dl_runtime_resolve + + .text + .globl _dl_runtime_resolve @@ -161,24 +168,47 @@ _dl_runtime_profile: - +4 free - %esp free - */ + +4 free + %esp free + */ - subl $20, %esp - cfi_adjust_cfa_offset (20) - movl %eax, (%esp) @@ -324,8 +324,8 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S + .byte 0x66,0x0f,0x1b,0x44,0x24,LRV_BND0_OFFSET + .byte 0x66,0x0f,0x1b,0x4c,0x24,LRV_BND1_OFFSET +#endif - pushl %esp - cfi_adjust_cfa_offset (4) + pushl %esp + cfi_adjust_cfa_offset (4) - leal 36(%esp), %ecx - movl 56(%esp), %eax - movl 60(%esp), %edx @@ -335,7 +335,7 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S + movl (LRV_SIZE + 4 + LR_SIZE)(%esp), %eax + # PLT1 + movl (LRV_SIZE + 4 + LR_SIZE + 4)(%esp), %edx - call _dl_call_pltexit + call _dl_call_pltexit - movl (%esp), %eax - movl 4(%esp), %edx - fldt 20(%esp) @@ -357,9 +357,9 @@ Index: glibc-2.17-c758a686/sysdeps/i386/dl-trampoline.S + addl $(LRV_SIZE + 4 + LR_SIZE + 4), %esp + cfi_adjust_cfa_offset (-(LRV_SIZE + 4 + LR_SIZE + 4)) + PRESERVE_BND_REGS_PREFIX - ret - cfi_endproc - .size _dl_runtime_profile, .-_dl_runtime_profile + ret + cfi_endproc + .size _dl_runtime_profile, .-_dl_runtime_profile Index: glibc-2.17-c758a686/sysdeps/i386/link-defines.sym =================================================================== --- /dev/null @@ -396,16 +396,16 @@ Index: glibc-2.17-c758a686/sysdeps/x86/bits/link.h + uint64_t lrv_bnd0; + uint64_t lrv_bnd1; } La_i86_retval; - - + + Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86/cpu-features.c +++ glibc-2.17-c758a686/sysdeps/x86/cpu-features.c @@ -130,6 +130,20 @@ init_cpu_features (struct cpu_features * - break; - } - } + break; + } + } + + /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow. + If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt. */ @@ -434,9 +434,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h +#define bit_Use_dl_runtime_resolve_opt (1 << 20) +#define bit_Use_dl_runtime_resolve_slow (1 << 21) + - + /* CPUID Feature flags. */ - + @@ -95,6 +98,9 @@ # define index_AVX512DQ_Usable FEATURE_INDEX_1*FEATURE_SIZE # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1*FEATURE_SIZE @@ -444,7 +444,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h +# define index_Use_dl_runtime_resolve_opt FEATURE_INDEX_1*FEATURE_SIZE +# define index_Use_dl_runtime_resolve_slow FEATURE_INDEX_1*FEATURE_SIZE + - + # if defined (_LIBC) && !IS_IN (nonlib) # ifdef __x86_64__ @@ -273,6 +279,8 @@ extern const struct cpu_features *__get_ @@ -453,9 +453,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h # define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1 +# define index_Use_dl_runtime_resolve_opt FEATURE_INDEX_1 +# define index_Use_dl_runtime_resolve_slow FEATURE_INDEX_1 - + #endif /* !__ASSEMBLER__ */ - + Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/Makefile @@ -463,7 +463,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile @@ -21,6 +21,11 @@ endif ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc - + +tests += ifuncmain8 +modules-names += ifuncmod8 + @@ -471,11 +471,11 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile + tests += tst-quad1 tst-quad2 modules-names += tst-quadmod1 tst-quadmod2 - + @@ -34,18 +39,32 @@ tests-pie += $(quad-pie-test) $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o - + +tests += tst-sse tst-avx tst-avx512 +test-extras += tst-avx-aux tst-avx512-aux +extra-test-objs += tst-avx-aux.o tst-avx512-aux.o @@ -484,11 +484,11 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile -modules-names += tst-auditmod10a tst-auditmod10b +modules-names += tst-auditmod10a tst-auditmod10b \ + tst-ssemod tst-avxmod tst-avx512mod - + $(objpfx)tst-audit10: $(objpfx)tst-auditmod10a.so $(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so - + +$(objpfx)tst-sse: $(objpfx)tst-ssemod.so +$(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so +$(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so @@ -505,7 +505,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/Makefile +CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS) endif endif - + Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/dl-machine.h @@ -525,13 +525,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h + extern void _dl_runtime_profile_sse (ElfW(Word)) attribute_hidden; + extern void _dl_runtime_profile_avx (ElfW(Word)) attribute_hidden; + extern void _dl_runtime_profile_avx512 (ElfW(Word)) attribute_hidden; - + if (l->l_info[DT_JMPREL] && lazy) { @@ -95,7 +102,12 @@ elf_machine_runtime_setup (struct link_m - end in this function. */ + end in this function. */ if (__builtin_expect (profile, 0)) - { + { - *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_profile; + if (HAS_ARCH_FEATURE (AVX512F_Usable)) + *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_profile_avx512; @@ -539,12 +539,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h + *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_profile_avx; + else + *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_profile_sse; - - if (GLRO(dl_profile) != NULL - && _dl_name_match_p (GLRO(dl_profile), l)) + + if (GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), l)) @@ -104,9 +116,34 @@ elf_machine_runtime_setup (struct link_m - GL(dl_profile_map) = l; - } + GL(dl_profile_map) = l; + } else - /* This function will get called to fix up the GOT entry indicated by - the offset on the stack, and then jump to the resolved address. */ @@ -578,19 +578,19 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h + *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse; + } } - + if (l->l_info[ADDRIDX (DT_TLSDESC_GOT)] && lazy) Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/dl-trampoline.S +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S @@ -18,28 +18,52 @@ - + #include #include +#include #include - + -#if (RTLD_SAVESPACE_SSE % 32) != 0 -# error RTLD_SAVESPACE_SSE must be aligned to 32 bytes +#ifndef DL_STACK_ALIGNMENT @@ -605,7 +605,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S + on modern processors if stack is 16-byte aligned. */ +# define DL_STACK_ALIGNMENT 8 #endif - + +#ifndef DL_RUNIME_UNALIGNED_VEC_SIZE +/* The maximum size of unaligned vector load and store. */ +# define DL_RUNIME_UNALIGNED_VEC_SIZE 16 @@ -649,7 +649,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S @@ -48,376 +72,71 @@ #define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8) #define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8) - + - .text - .globl _dl_runtime_resolve - .type _dl_runtime_resolve, @function @@ -1099,12 +1099,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +/* PLT trampolines. x86-64 version. + Copyright (C) 2009-2015 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 @@ -17,16 +16,355 @@ License along with the GNU C Library; if not, see . */ - + -#ifdef RESTORE_AVX +#undef REGISTER_SAVE_AREA_RAW +#ifdef __ILP32__ @@ -1446,7 +1446,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# endif + +# ifdef RESTORE_AVX - /* This is to support AVX audit modules. */ + /* This is to support AVX audit modules. */ - VMOV %VEC(0), (LR_VECTOR_OFFSET)(%rsp) - VMOV %VEC(1), (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) - VMOV %VEC(2), (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) @@ -1463,22 +1463,22 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h + VMOVA %VEC(5), (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) + VMOVA %VEC(6), (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) + VMOVA %VEC(7), (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) - - /* Save xmm0-xmm7 registers to detect if any of them are - changed by audit module. */ + + /* Save xmm0-xmm7 registers to detect if any of them are + changed by audit module. */ @@ -38,7 +376,7 @@ - vmovdqa %xmm5, (LR_SIZE + XMM_SIZE*5)(%rsp) - vmovdqa %xmm6, (LR_SIZE + XMM_SIZE*6)(%rsp) - vmovdqa %xmm7, (LR_SIZE + XMM_SIZE*7)(%rsp) + vmovdqa %xmm5, (LR_SIZE + XMM_SIZE*5)(%rsp) + vmovdqa %xmm6, (LR_SIZE + XMM_SIZE*6)(%rsp) + vmovdqa %xmm7, (LR_SIZE + XMM_SIZE*7)(%rsp) -#endif +# endif - - mov %RSP_LP, %RCX_LP # La_x86_64_regs pointer to %rcx. - mov 48(%rbx), %RDX_LP # Load return address if needed. + + mov %RSP_LP, %RCX_LP # La_x86_64_regs pointer to %rcx. + mov 48(%rbx), %RDX_LP # Load return address if needed. @@ -63,21 +401,7 @@ - movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6 - movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7 - + movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6 + movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7 + -#ifndef __ILP32__ -# ifdef HAVE_MPX_SUPPORT - bndmov (LR_BND_OFFSET)(%rsp), %bnd0 # Restore bound @@ -1495,80 +1495,80 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h - -#ifdef RESTORE_AVX +# ifdef RESTORE_AVX - /* Check if any xmm0-xmm7 registers are changed by audit - module. */ - vpcmpeqq (LR_SIZE)(%rsp), %xmm0, %xmm8 + /* Check if any xmm0-xmm7 registers are changed by audit + module. */ + vpcmpeqq (LR_SIZE)(%rsp), %xmm0, %xmm8 @@ -86,7 +410,7 @@ - je 2f - vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET)(%rsp), %VEC(0) +2: VMOVA (LR_VECTOR_OFFSET)(%rsp), %VEC(0) - vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp) - + vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm8 @@ -95,7 +419,7 @@ - je 2f - vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %VEC(1) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %VEC(1) - vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp) - + vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*2)(%rsp), %xmm2, %xmm8 @@ -104,7 +428,7 @@ - je 2f - vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %VEC(2) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %VEC(2) - vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp) - + vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*3)(%rsp), %xmm3, %xmm8 @@ -113,7 +437,7 @@ - je 2f - vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %VEC(3) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %VEC(3) - vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp) - + vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*4)(%rsp), %xmm4, %xmm8 @@ -122,7 +446,7 @@ - je 2f - vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %VEC(4) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %VEC(4) - vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp) - + vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*5)(%rsp), %xmm5, %xmm8 @@ -131,7 +455,7 @@ - je 2f - vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %VEC(5) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %VEC(5) - vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp) - + vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*6)(%rsp), %xmm6, %xmm8 @@ -140,7 +464,7 @@ - je 2f - vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %VEC(6) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %VEC(6) - vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) - + vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) + 1: vpcmpeqq (LR_SIZE + XMM_SIZE*7)(%rsp), %xmm7, %xmm8 @@ -149,13 +473,29 @@ - je 2f - vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) - jmp 1f + je 2f + vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) + jmp 1f -2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %VEC(7) +2: VMOVA (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %VEC(7) - vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) - + vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) + 1: -#endif +# endif @@ -1587,35 +1587,35 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# endif +# endif + - mov 16(%rbx), %R10_LP # Anything in framesize? - test %R10_LP, %R10_LP + mov 16(%rbx), %R10_LP # Anything in framesize? + test %R10_LP, %R10_LP + PRESERVE_BND_REGS_PREFIX - jns 3f - - /* There's nothing in the frame size, so there + jns 3f + + /* There's nothing in the frame size, so there @@ -166,14 +506,15 @@ - movq LR_RSI_OFFSET(%rsp), %rsi - movq LR_RDI_OFFSET(%rsp), %rdi - + movq LR_RSI_OFFSET(%rsp), %rsi + movq LR_RDI_OFFSET(%rsp), %rdi + - movq %rbx, %rsp + mov %RBX_LP, %RSP_LP - movq (%rsp), %rbx + movq (%rsp), %rbx - cfi_restore(rbx) + cfi_restore(%rbx) - cfi_def_cfa_register(%rsp) - + cfi_def_cfa_register(%rsp) + - addq $48, %rsp # Adjust the stack to the return value + add $48, %RSP_LP # Adjust the stack to the return value - # (eats the reloc index and link_map) - cfi_adjust_cfa_offset(-48) + # (eats the reloc index and link_map) + cfi_adjust_cfa_offset(-48) + PRESERVE_BND_REGS_PREFIX - jmp *%r11 # Jump to function address. - + jmp *%r11 # Jump to function address. + 3: @@ -186,13 +527,13 @@ - temporary buffer of the size specified by the 'framesize' - returned from _dl_profile_fixup */ - + temporary buffer of the size specified by the 'framesize' + returned from _dl_profile_fixup */ + - leaq LR_RSP_OFFSET(%rbx), %rsi # stack - addq $8, %r10 - andq $0xfffffffffffffff0, %r10 @@ -1630,28 +1630,28 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h + sub %R10_LP, %RSP_LP + mov %RSP_LP, %RDI_LP + shr $3, %RCX_LP - rep - movsq - + rep + movsq + @@ -200,23 +541,24 @@ - movq 32(%rdi), %rsi - movq 40(%rdi), %rdi - + movq 32(%rdi), %rsi + movq 40(%rdi), %rdi + + PRESERVE_BND_REGS_PREFIX - call *%r11 - + call *%r11 + - mov 24(%rbx), %rsp # Drop the copied stack content + mov 24(%rbx), %RSP_LP # Drop the copied stack content - - /* Now we have to prepare the La_x86_64_retval structure for the - _dl_call_pltexit. The La_x86_64_regs is being pointed by rsp now, - so we just need to allocate the sizeof(La_x86_64_retval) space on - the stack, since the alignment has already been taken care of. */ + + /* Now we have to prepare the La_x86_64_retval structure for the + _dl_call_pltexit. The La_x86_64_regs is being pointed by rsp now, + so we just need to allocate the sizeof(La_x86_64_retval) space on + the stack, since the alignment has already been taken care of. */ -#ifdef RESTORE_AVX +# ifdef RESTORE_AVX - /* sizeof(La_x86_64_retval). Need extra space for 2 SSE - registers to detect if xmm0/xmm1 registers are changed - by audit module. */ + /* sizeof(La_x86_64_retval). Need extra space for 2 SSE + registers to detect if xmm0/xmm1 registers are changed + by audit module. */ - subq $(LRV_SIZE + XMM_SIZE*2), %rsp -#else - subq $LRV_SIZE, %rsp # sizeof(La_x86_64_retval) @@ -1662,69 +1662,69 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h + sub $LRV_SIZE, %RSP_LP # sizeof(La_x86_64_retval) +# endif + mov %RSP_LP, %RCX_LP # La_x86_64_retval argument to %rcx. - - /* Fill in the La_x86_64_retval structure. */ - movq %rax, LRV_RAX_OFFSET(%rcx) + + /* Fill in the La_x86_64_retval structure. */ + movq %rax, LRV_RAX_OFFSET(%rcx) @@ -225,26 +567,26 @@ - movaps %xmm0, LRV_XMM0_OFFSET(%rcx) - movaps %xmm1, LRV_XMM1_OFFSET(%rcx) - + movaps %xmm0, LRV_XMM0_OFFSET(%rcx) + movaps %xmm1, LRV_XMM1_OFFSET(%rcx) + -#ifdef RESTORE_AVX +# ifdef RESTORE_AVX - /* This is to support AVX audit modules. */ + /* This is to support AVX audit modules. */ - VMOV %VEC(0), LRV_VECTOR0_OFFSET(%rcx) - VMOV %VEC(1), LRV_VECTOR1_OFFSET(%rcx) + VMOVA %VEC(0), LRV_VECTOR0_OFFSET(%rcx) + VMOVA %VEC(1), LRV_VECTOR1_OFFSET(%rcx) - - /* Save xmm0/xmm1 registers to detect if they are changed - by audit module. */ - vmovdqa %xmm0, (LRV_SIZE)(%rcx) - vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx) + + /* Save xmm0/xmm1 registers to detect if they are changed + by audit module. */ + vmovdqa %xmm0, (LRV_SIZE)(%rcx) + vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx) -#endif +# endif - + -#ifndef __ILP32__ -# ifdef HAVE_MPX_SUPPORT +# ifndef __ILP32__ +# ifdef HAVE_MPX_SUPPORT - bndmov %bnd0, LRV_BND0_OFFSET(%rcx) # Preserve returned bounds. - bndmov %bnd1, LRV_BND1_OFFSET(%rcx) + bndmov %bnd0, LRV_BND0_OFFSET(%rcx) # Preserve returned bounds. + bndmov %bnd1, LRV_BND1_OFFSET(%rcx) -# else +# else - .byte 0x66,0x0f,0x1b,0x81;.long (LRV_BND0_OFFSET) - .byte 0x66,0x0f,0x1b,0x89;.long (LRV_BND1_OFFSET) + .byte 0x66,0x0f,0x1b,0x81;.long (LRV_BND0_OFFSET) + .byte 0x66,0x0f,0x1b,0x89;.long (LRV_BND1_OFFSET) +# endif # endif -#endif - - fstpt LRV_ST0_OFFSET(%rcx) - fstpt LRV_ST1_OFFSET(%rcx) + + fstpt LRV_ST0_OFFSET(%rcx) + fstpt LRV_ST1_OFFSET(%rcx) @@ -261,49 +603,47 @@ - movaps LRV_XMM0_OFFSET(%rsp), %xmm0 - movaps LRV_XMM1_OFFSET(%rsp), %xmm1 - + movaps LRV_XMM0_OFFSET(%rsp), %xmm0 + movaps LRV_XMM1_OFFSET(%rsp), %xmm1 + -#ifdef RESTORE_AVX +# ifdef RESTORE_AVX - /* Check if xmm0/xmm1 registers are changed by audit module. */ - vpcmpeqq (LRV_SIZE)(%rsp), %xmm0, %xmm2 - vpmovmskb %xmm2, %esi - cmpl $0xffff, %esi - jne 1f + /* Check if xmm0/xmm1 registers are changed by audit module. */ + vpcmpeqq (LRV_SIZE)(%rsp), %xmm0, %xmm2 + vpmovmskb %xmm2, %esi + cmpl $0xffff, %esi + jne 1f - VMOV LRV_VECTOR0_OFFSET(%rsp), %VEC(0) + VMOVA LRV_VECTOR0_OFFSET(%rsp), %VEC(0) - + 1: vpcmpeqq (LRV_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm2 - vpmovmskb %xmm2, %esi - cmpl $0xffff, %esi - jne 1f + vpmovmskb %xmm2, %esi + cmpl $0xffff, %esi + jne 1f - VMOV LRV_VECTOR1_OFFSET(%rsp), %VEC(1) + VMOVA LRV_VECTOR1_OFFSET(%rsp), %VEC(1) - + 1: -#endif +# endif - + -#ifndef __ILP32__ -# ifdef HAVE_MPX_SUPPORT - bndmov LRV_BND0_OFFSET(%rcx), %bnd0 # Restore bound registers. @@ -1742,24 +1742,24 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# endif # endif -#endif - - fldt LRV_ST1_OFFSET(%rsp) - fldt LRV_ST0_OFFSET(%rsp) - + + fldt LRV_ST1_OFFSET(%rsp) + fldt LRV_ST0_OFFSET(%rsp) + - movq %rbx, %rsp + mov %RBX_LP, %RSP_LP - movq (%rsp), %rbx + movq (%rsp), %rbx - cfi_restore(rbx) + cfi_restore(%rbx) - cfi_def_cfa_register(%rsp) - + cfi_def_cfa_register(%rsp) + - addq $48, %rsp # Adjust the stack to the return value + add $48, %RSP_LP # Adjust the stack to the return value - # (eats the reloc index and link_map) - cfi_adjust_cfa_offset(-48) + # (eats the reloc index and link_map) + cfi_adjust_cfa_offset(-48) + PRESERVE_BND_REGS_PREFIX - retq - + retq + -#ifdef MORE_CODE - cfi_adjust_cfa_offset(48) - cfi_rel_offset(%rbx, 0) diff --git a/SOURCES/glibc-rh1435615.patch b/SOURCES/glibc-rh1435615.patch index 67fdb903..558196df 100644 --- a/SOURCES/glibc-rh1435615.patch +++ b/SOURCES/glibc-rh1435615.patch @@ -24,3 +24,4 @@ diff -rup a/nscd/netgroupcache.c b/nscd/netgroupcache.c + pthread_rwlock_unlock (&db->lock); return timeout; } + diff --git a/SOURCES/glibc-rh1439165.patch b/SOURCES/glibc-rh1439165.patch index 35566006..bb2ee651 100644 --- a/SOURCES/glibc-rh1439165.patch +++ b/SOURCES/glibc-rh1439165.patch @@ -32,9 +32,9 @@ index 366b1d7..95cff0e 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -39,75 +39,46 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ - + tests += tst-clone - + -# Generate the list of SYS_* macros for the system calls (__NR_* macros). - -# If there is more than one syscall list for different architecture @@ -63,7 +63,7 @@ index 366b1d7..95cff0e 100644 +$(objpfx)bits/syscall.h: \ + ../sysdeps/unix/sysv/linux/gen-syscall-h.awk \ + ../sysdeps/unix/sysv/linux/syscall-names.list - $(make-target-directory) + $(make-target-directory) - { \ - echo '/* Generated at libc build time from kernel syscall list. */';\ - echo ''; \ @@ -143,7 +143,7 @@ index 366b1d7..95cff0e 100644 + $(BASH) $^ > $@ + +endif # $(subdir) == misc - + ifeq ($(subdir),time) sysdep_headers += sys/timex.h bits/timex.h diff --git a/sysdeps/unix/sysv/linux/filter-nr-syscalls.awk b/sysdeps/unix/sysv/linux/filter-nr-syscalls.awk diff --git a/SOURCES/glibc-rh1440250.patch b/SOURCES/glibc-rh1440250.patch index 7ba09c95..e4576fa0 100644 --- a/SOURCES/glibc-rh1440250.patch +++ b/SOURCES/glibc-rh1440250.patch @@ -65,20 +65,20 @@ diff -Nrup a/elf/Makefile b/elf/Makefile @@ -915,7 +915,7 @@ $(objpfx)tst-pie1: $(objpfx)tst-piemod1. ifeq (yes,$(build-shared)) tests: $(objpfx)check-textrel.out $(objpfx)check-execstack.out - + -all-built-dso := $(common-objpfx)libc.so \ +all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \ - $(filter-out $(common-objpfx)linkobj/libc.so, \ - $(sort $(wildcard $(addprefix $(common-objpfx), \ - */lib*.so \ + $(filter-out $(common-objpfx)linkobj/libc.so, \ + $(sort $(wildcard $(addprefix $(common-objpfx), \ + */lib*.so \ @@ -974,6 +974,7 @@ tests: $(objpfx)check-localplt.out - + localplt-built-dso := $(addprefix $(common-objpfx),\ - libc.so \ + libc.so \ + elf/ld.so \ - math/libm.so \ - rt/librt.so \ - dlfcn/libdl.so \ + math/libm.so \ + rt/librt.so \ + dlfcn/libdl.so \ diff -Nrup a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data --- a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data 2017-10-22 09:16:01.379402341 -0400 +++ b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data 2017-10-22 09:16:39.217285466 -0400 @@ -117,10 +117,10 @@ diff -Nrup a/scripts/check-localplt.awk b/scripts/check-localplt.awk +# libfoo.so. # The second file argument is - and this (stdin) receives the output # of the check-localplt program. - + @@ -14,7 +21,10 @@ BEGIN { result = 0 } FILENAME != "-" && /^#/ { next } - + FILENAME != "-" { - if (NF != 2 && !(NF == 3 && $3 == "?")) { + if (NF == 5 && $3 == "+" && ($4 == "RELA" || $4 == "REL")) { @@ -133,14 +133,14 @@ diff -Nrup a/scripts/check-localplt.awk b/scripts/check-localplt.awk @@ -23,7 +33,7 @@ FILENAME != "-" { next; } - + -NF != 2 { +NF != 2 && !(NF == 4 && ($3 == "RELA" || $3 == "REL")) { print "Unexpected output from check-localplt:", $0 > "/dev/stderr"; result = 2; next @@ -31,7 +41,23 @@ NF != 2 { - + { key = $1 " " $2 - if (key in accept) { @@ -167,7 +167,7 @@ diff -Nrup a/scripts/check-localplt.awk b/scripts/check-localplt.awk @@ -49,5 +75,11 @@ END { } } - + + for (key in accept_type) { + # It's mandatory. + print "Missing required PLT or " accept_reloc[key] " reference:", key; @@ -181,7 +181,7 @@ diff -Nrup a/scripts/localplt.awk b/scripts/localplt.awk +++ b/scripts/localplt.awk 2017-10-22 09:16:39.218285463 -0400 @@ -7,12 +7,14 @@ BEGIN { result = 0 } - + FILENAME != lastfile { - if (lastfile && jmprel_offset == 0) { + if (lastfile && jmprel_offset == 0 && rela_offset == 0 && rel_offset == 0) { @@ -194,10 +194,10 @@ diff -Nrup a/scripts/localplt.awk b/scripts/localplt.awk + rel_offset = 0; delete section_offset_by_address; } - + @@ -32,9 +34,39 @@ $1 == "Offset" && $2 == "Info" { in_relo NF == 0 { in_relocs = 0 } - + in_relocs && relocs_offset == jmprel_offset && NF >= 5 { - symval = strtonum("0x" $4); - if (symval != 0) @@ -236,12 +236,12 @@ diff -Nrup a/scripts/localplt.awk b/scripts/localplt.awk + print whatfile, gensub(/@.*/, "", "g", $5), "REL", $3 + } } - + in_relocs { next } @@ -56,4 +88,25 @@ $2 == "(JMPREL)" { next } - + +$2 == "(RELA)" { + rela_addr = strtonum($3); + if (rela_addr in section_offset_by_address) { diff --git a/SOURCES/glibc-rh1443236.patch b/SOURCES/glibc-rh1443236.patch index 6a4949d3..cc5a4f98 100644 --- a/SOURCES/glibc-rh1443236.patch +++ b/SOURCES/glibc-rh1443236.patch @@ -16,16 +16,17 @@ index 73174aa..41b91fc 100644 +++ b/elf/dl-load.c @@ -1889,9 +1889,9 @@ open_path (const char *name, size_t namelen, int mode, if (sps->malloced) - free (sps->dirs); - + free (sps->dirs); + - /* rtld_search_dirs is attribute_relro, therefore avoid writing - into it. */ - if (sps != &rtld_search_dirs) + /* rtld_search_dirs and env_path_list are attribute_relro, therefore + avoid writing into it. */ + if (sps != &rtld_search_dirs && sps != &env_path_list) - sps->dirs = (void *) -1; + sps->dirs = (void *) -1; } - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1445644.patch b/SOURCES/glibc-rh1445644.patch index 40d7574a..0f9b667d 100644 --- a/SOURCES/glibc-rh1445644.patch +++ b/SOURCES/glibc-rh1445644.patch @@ -3,16 +3,16 @@ Author: H.J. Lu Date: Fri Mar 6 04:55:56 2015 -0800 Replace __attribute__((visibility("protected"))) - + With copy relocation, address of protected data defined in the shared library may be external. Compiler shouldn't asssume protected data will be local. But due to - + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 - + __attribute__((visibility("protected"))) doesn't work correctly, we need to use asm (".protected xxx") instead. - + * elf/ifuncdep2.c (global): Replace __attribute__((visibility("protected"))) with asm (".protected global"). @@ -24,9 +24,9 @@ Index: b/elf/ifuncdep2.c --- a/elf/ifuncdep2.c +++ b/elf/ifuncdep2.c @@ -2,7 +2,13 @@ - + #include "ifunc-sel.h" - + -int global __attribute__ ((visibility ("protected"))) = -1; +int global = -1; +/* Can't use __attribute__((visibility("protected"))) until the GCC bug: @@ -35,7 +35,7 @@ Index: b/elf/ifuncdep2.c + + is fixed. */ +asm (".protected global"); - + static int one (void) Index: b/elf/ifuncmod1.c @@ -45,7 +45,7 @@ Index: b/elf/ifuncmod1.c @@ -6,7 +6,13 @@ */ #include "ifunc-sel.h" - + -int global __attribute__ ((visibility ("protected"))) = -1; +int global = -1; +/* Can't use __attribute__((visibility("protected"))) until the GCC bug: @@ -54,7 +54,7 @@ Index: b/elf/ifuncmod1.c + + is fixed. */ +asm (".protected global"); - + static int one (void) Index: b/elf/ifuncmod5.c @@ -64,7 +64,7 @@ Index: b/elf/ifuncmod5.c @@ -1,7 +1,13 @@ /* Test STT_GNU_IFUNC symbols without direct function call. */ #include "ifunc-sel.h" - + -int global __attribute__ ((visibility ("protected"))) = -1; +int global = -1; +/* Can't use __attribute__((visibility("protected"))) until the GCC bug: @@ -73,6 +73,6 @@ Index: b/elf/ifuncmod5.c + + is fixed. */ +asm (".protected global"); - + static int one (void) diff --git a/SOURCES/glibc-rh1445781-1.patch b/SOURCES/glibc-rh1445781-1.patch index 6b7aa387..7a758372 100644 --- a/SOURCES/glibc-rh1445781-1.patch +++ b/SOURCES/glibc-rh1445781-1.patch @@ -3,29 +3,29 @@ Author: H.J. Lu Date: Fri May 22 17:46:42 2015 -0700 Don't issue an error if DT_PLTRELSZ is missing - + A shared object doesn't need PLT if there are no PLT relocations. It shouldn't be an error if DT_PLTRELSZ is missing. - - [BZ #18410] - * elf/dl-reloc.c (_dl_relocate_object): Don't issue an error - for missing DT_PLTRELSZ. + + [BZ #18410] + * elf/dl-reloc.c (_dl_relocate_object): Don't issue an error + for missing DT_PLTRELSZ. diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c --- a/elf/dl-reloc.c 2017-10-04 16:42:16.000000000 -0400 +++ b/elf/dl-reloc.c 2017-10-05 17:44:14.486358084 -0400 @@ -259,21 +259,13 @@ _dl_relocate_object (struct link_map *l, ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc); - + #ifndef PROF - if (__builtin_expect (consider_profiling, 0)) + if (__builtin_expect (consider_profiling, 0) + && l->l_info[DT_PLTRELSZ] != NULL) { - /* Allocate the array which will contain the already found - relocations. If the shared object lacks a PLT (for example - if it only contains lead function) the l_info[DT_PLTRELSZ] - will be NULL. */ + /* Allocate the array which will contain the already found + relocations. If the shared object lacks a PLT (for example + if it only contains lead function) the l_info[DT_PLTRELSZ] + will be NULL. */ - if (l->l_info[DT_PLTRELSZ] == NULL) - { - errstring = N_("%s: no PLTREL found in object %s\n"); @@ -35,15 +35,15 @@ diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c - l->l_name); - } - - size_t sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA - ? sizeof (ElfW(Rela)) - : sizeof (ElfW(Rel)); + size_t sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA + ? sizeof (ElfW(Rela)) + : sizeof (ElfW(Rel)); @@ -284,7 +276,7 @@ _dl_relocate_object (struct link_map *l, - { - errstring = N_("\ + { + errstring = N_("\ %s: out of memory to store relocation results for %s\n"); - goto fatal; + _dl_fatal_printf (errstring, rtld_progname, l->l_name); - } + } } #endif diff --git a/SOURCES/glibc-rh1445781-2.patch b/SOURCES/glibc-rh1445781-2.patch index d9d938c7..2979f9d3 100644 --- a/SOURCES/glibc-rh1445781-2.patch +++ b/SOURCES/glibc-rh1445781-2.patch @@ -3,18 +3,18 @@ Author: H.J. Lu Date: Thu May 28 05:06:27 2015 -0700 Make sure that calloc is called at least once - + PLT relocations aren't required when -z now used. - - - [BZ #18422] - * Makefile ($(objpfx)tst-audit2): Depend on $(libdl). - ($(objpfx)tst-audit2.out): Also depend on - $(objpfx)tst-auditmod9b.so. - * elf/tst-audit2.c: Include . - (calloc_called): New. - (calloc): Allow to be called more than once. - (do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so. + + + [BZ #18422] + * Makefile ($(objpfx)tst-audit2): Depend on $(libdl). + ($(objpfx)tst-audit2.out): Also depend on + $(objpfx)tst-auditmod9b.so. + * elf/tst-audit2.c: Include . + (calloc_called): New. + (calloc): Allow to be called more than once. + (do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so. diff -rup a/elf/Makefile b/elf/Makefile --- a/elf/Makefile 2017-10-04 16:42:22.000000000 -0400 @@ -22,12 +22,12 @@ diff -rup a/elf/Makefile b/elf/Makefile @@ -1020,7 +1020,8 @@ $(objpfx)tst-dlmopen3.out: $(objpfx)tst- $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so - + -$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so +$(objpfx)tst-audit2: $(libdl) +$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so - + $(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so diff -rup a/elf/tst-audit2.c b/elf/tst-audit2.c --- a/elf/tst-audit2.c 2017-10-04 16:42:18.000000000 -0400 @@ -37,19 +37,19 @@ diff -rup a/elf/tst-audit2.c b/elf/tst-audit2.c #include #include +#include - + #define MAGIC1 0xabcdef72 #define MAGIC2 0xd8675309 static __thread unsigned int magic[] = { MAGIC1, MAGIC2 }; +static __thread int calloc_called; - + #undef calloc - + /* This calloc definition will be called by the dynamic linker itself. - We test that it has initialized our TLS block by the time it does so. */ + We test that interposed calloc is called by the dynamic loader, and + that TLS is fully initialized by then. */ - + void * calloc (size_t n, size_t m) { @@ -71,7 +71,7 @@ diff -rup a/elf/tst-audit2.c b/elf/tst-audit2.c } - magic[0] = MAGIC2; - magic[1] = MAGIC1; - + n *= m; void *ptr = malloc (n); @@ -34,6 +43,11 @@ calloc (size_t n, size_t m) diff --git a/SOURCES/glibc-rh1447556.patch b/SOURCES/glibc-rh1447556.patch index 0429e2dd..e042c959 100644 --- a/SOURCES/glibc-rh1447556.patch +++ b/SOURCES/glibc-rh1447556.patch @@ -15,7 +15,7 @@ diff -rup a/malloc/malloc.c b/malloc/malloc.c --- a/malloc/malloc.c 2017-08-01 18:11:00.000000000 -0400 +++ b/malloc/malloc.c 2017-08-01 18:13:07.907438098 -0400 @@ -1429,6 +1429,8 @@ typedef struct malloc_chunk* mbinptr; - + /* Take a chunk off a bin list */ #define unlink(AV, P, BK, FD) { \ + if (__builtin_expect (chunksize(P) != next_chunk(P)->prev_size, 0)) \ diff --git a/SOURCES/glibc-rh1448822.patch b/SOURCES/glibc-rh1448822.patch index ddbf6268..a7e211b1 100644 --- a/SOURCES/glibc-rh1448822.patch +++ b/SOURCES/glibc-rh1448822.patch @@ -14,6 +14,6 @@ index 7805ce7e012256ea..561587ed3c620628 100644 # define CLOCK_BOOTTIME_ALARM 9 +/* Like CLOCK_REALTIME but in International Atomic Time. */ +# define CLOCK_TAI 11 - + /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 diff --git a/SOURCES/glibc-rh1452721-1.patch b/SOURCES/glibc-rh1452721-1.patch index 579a1d4d..95e615a7 100644 --- a/SOURCES/glibc-rh1452721-1.patch +++ b/SOURCES/glibc-rh1452721-1.patch @@ -12,12 +12,12 @@ Index: glibc-2.17-c758a686/elf/rtld.c --- glibc-2.17-c758a686.orig/elf/rtld.c +++ glibc-2.17-c758a686/elf/rtld.c @@ -2580,7 +2701,8 @@ process_envvars (enum mode *modep) - - case 12: - /* The library search path. */ + + case 12: + /* The library search path. */ - if (memcmp (envline, "LIBRARY_PATH", 12) == 0) + if (!__libc_enable_secure + && memcmp (envline, "LIBRARY_PATH", 12) == 0) - { - library_path = &envline[13]; - break; + { + library_path = &envline[13]; + break; diff --git a/SOURCES/glibc-rh1452721-2.patch b/SOURCES/glibc-rh1452721-2.patch index 22a78521..ca74956a 100644 --- a/SOURCES/glibc-rh1452721-2.patch +++ b/SOURCES/glibc-rh1452721-2.patch @@ -11,7 +11,7 @@ Index: b/elf/rtld.c @@ -99,6 +99,22 @@ uintptr_t __pointer_chk_guard_local strong_alias (__pointer_chk_guard_local, __pointer_chk_guard) #endif - + +/* Check that AT_SECURE=0, or that the passed name does not contain + directories and is not overly long. Reject empty names + unconditionally. */ @@ -28,13 +28,13 @@ Index: b/elf/rtld.c + } + return *p != '\0'; +} - + /* List of auditing DSOs. */ static struct audit_list @@ -880,6 +896,44 @@ static const char *preloadlist attribute /* Nonzero if information about versions has to be printed. */ static int version_info attribute_relro; - + +/* The LD_PRELOAD environment variable gives list of libraries + separated by white space or colons that are loaded before the + executable's dependencies and prepended to the global scope list. @@ -75,9 +75,9 @@ Index: b/elf/rtld.c + static void dl_main (const ElfW(Phdr) *phdr, - ElfW(Word) phnum, + ElfW(Word) phnum, @@ -1611,23 +1665,8 @@ ERROR: ld.so: object '%s' cannot be load - + if (__builtin_expect (preloadlist != NULL, 0)) { - /* The LD_PRELOAD environment variable gives list of libraries diff --git a/SOURCES/glibc-rh1452721-3.patch b/SOURCES/glibc-rh1452721-3.patch index d0ad5d32..135ee523 100644 --- a/SOURCES/glibc-rh1452721-3.patch +++ b/SOURCES/glibc-rh1452721-3.patch @@ -13,7 +13,7 @@ Index: b/elf/rtld.c @@ -116,13 +116,91 @@ dso_name_valid_for_suid (const char *p) return *p != '\0'; } - + -/* List of auditing DSOs. */ +/* LD_AUDIT variable contents. Must be processed before the + audit_list below. */ @@ -26,7 +26,7 @@ Index: b/elf/rtld.c const char *name; struct audit_list *next; } *audit_list; - + +/* Iterator for audit_list_string followed by audit_list. */ +struct audit_list_iter +{ @@ -105,7 +105,7 @@ Index: b/elf/rtld.c must not be initialized to nonzero, because the unused dynamic @@ -1441,11 +1519,13 @@ of this helper program; chances are you GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid (); - + /* If we have auditing DSOs to load, do it now. */ - if (__builtin_expect (audit_list != NULL, 0)) + bool need_security_init = true; @@ -117,58 +117,58 @@ Index: b/elf/rtld.c - struct audit_list *al = audit_list->next; + struct audit_list_iter al_iter; + audit_list_iter_init (&al_iter); - + /* Since we start using the auditing DSOs right away we need to - initialize the data structures now. */ + initialize the data structures now. */ @@ -1456,9 +1536,14 @@ of this helper program; chances are you - use different values (especially the pointer guard) and will - fail later on. */ + use different values (especially the pointer guard) and will + fail later on. */ security_init (); + need_security_init = false; - + - do + while (true) - { + { + const char *name = audit_list_iter_next (&al_iter); + if (name == NULL) + break; + - int tls_idx = GL(dl_tls_max_dtv_idx); - - /* Now it is time to determine the layout of the static TLS + int tls_idx = GL(dl_tls_max_dtv_idx); + + /* Now it is time to determine the layout of the static TLS @@ -1467,7 +1552,7 @@ of this helper program; chances are you - no DF_STATIC_TLS bit is set. The reason is that we know - glibc will use the static model. */ - struct dlmopen_args dlmargs; + no DF_STATIC_TLS bit is set. The reason is that we know + glibc will use the static model. */ + struct dlmopen_args dlmargs; - dlmargs.fname = al->name; + dlmargs.fname = name; - dlmargs.map = NULL; - - const char *objname; + dlmargs.map = NULL; + + const char *objname; @@ -1480,7 +1565,7 @@ of this helper program; chances are you - not_loaded: - _dl_error_printf ("\ + not_loaded: + _dl_error_printf ("\ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", - al->name, err_str); + name, err_str); - if (malloced) - free ((char *) err_str); - } + if (malloced) + free ((char *) err_str); + } @@ -1584,10 +1669,7 @@ ERROR: ld.so: object '%s' cannot be load - goto not_loaded; - } - } + goto not_loaded; + } + } - - al = al->next; - } + } - while (al != audit_list->next); - + /* If we have any auditing modules, announce that we already - have two objects loaded. */ + have two objects loaded. */ @@ -1851,7 +1933,7 @@ ERROR: ld.so: object '%s' cannot be load if (tcbp == NULL) tcbp = init_tls (); - + - if (__builtin_expect (audit_list == NULL, 1)) + if (need_security_init) /* Initialize security features. But only if we have not done it @@ -176,21 +176,21 @@ Index: b/elf/rtld.c security_init (); @@ -2495,9 +2577,7 @@ process_dl_audit (char *str) char *p; - + while ((p = (strsep) (&str, ":")) != NULL) - if (p[0] != '\0' - && (__builtin_expect (! INTUSE(__libc_enable_secure), 1) - || strchr (p, '/') == NULL)) + if (dso_name_valid_for_suid (p)) { - /* This is using the local malloc, not the system malloc. The - memory can never be freed. */ + /* This is using the local malloc, not the system malloc. The + memory can never be freed. */ @@ -2561,7 +2641,7 @@ process_envvars (enum mode *modep) - break; - } - if (memcmp (envline, "AUDIT", 5) == 0) + break; + } + if (memcmp (envline, "AUDIT", 5) == 0) - process_dl_audit (&envline[6]); + audit_list_string = &envline[6]; - break; - - case 7: + break; + + case 7: diff --git a/SOURCES/glibc-rh1452721-4.patch b/SOURCES/glibc-rh1452721-4.patch index 09446fb6..5b4d5ea9 100644 --- a/SOURCES/glibc-rh1452721-4.patch +++ b/SOURCES/glibc-rh1452721-4.patch @@ -5,16 +5,16 @@ Author: Siddhesh Poyarekar Date: Tue Mar 7 20:52:04 2017 +0530 Ignore and remove LD_HWCAP_MASK for AT_SECURE programs (bug #21209) - + The LD_HWCAP_MASK environment variable may alter the selection of function variants for some architectures. For AT_SECURE process it means that if an outdated routine has a bug that would otherwise not affect newer platforms by default, LD_HWCAP_MASK will allow that bug to be exploited. - + To be on the safe side, ignore and disable LD_HWCAP_MASK for setuid binaries. - + [BZ #21209] * elf/rtld.c (process_envvars): Ignore LD_HWCAP_MASK for AT_SECURE processes. @@ -28,15 +28,15 @@ Index: b/elf/rtld.c --- a/elf/rtld.c +++ b/elf/rtld.c @@ -2688,7 +2688,8 @@ process_envvars (enum mode *modep) - - case 10: - /* Mask for the important hardware capabilities. */ + + case 10: + /* Mask for the important hardware capabilities. */ - if (memcmp (envline, "HWCAP_MASK", 10) == 0) + if (!__libc_enable_secure + && memcmp (envline, "HWCAP_MASK", 10) == 0) - GLRO(dl_hwcap_mask) = __strtoul_internal (&envline[11], NULL, - 0, 0); - break; + GLRO(dl_hwcap_mask) = __strtoul_internal (&envline[11], NULL, + 0, 0); + break; Index: b/sysdeps/generic/unsecvars.h =================================================================== --- a/sysdeps/generic/unsecvars.h diff --git a/SOURCES/glibc-rh1457177-1.patch b/SOURCES/glibc-rh1457177-1.patch index 780964f3..eba9b41e 100644 --- a/SOURCES/glibc-rh1457177-1.patch +++ b/SOURCES/glibc-rh1457177-1.patch @@ -3,16 +3,16 @@ Author: Adhemerval Zanella Date: Wed Jan 8 05:10:41 2014 -0600 PowerPC: remove wrong truncl implementation for PowerPC64 - + The truncl assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_truncl.S) returns wrong results for some inputs where first double is a exact integer and the precision is determined by second long double. - + Checking on implementation comments and history, I am very confident the assembly implementation was based on a version before commit 5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in long double (ldbl-128ibm) rounding functions in glibc-2.4). - + By just removing the implementation and make the build select sysdeps/ieee754/ldbl-128ibm/s_truncl.c instead it fixes tgammal issues regarding wrong result sign. @@ -24,7 +24,7 @@ Index: b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c @@ -17,9 +17,6 @@ License along with the GNU C Library; if not, see . */ - + -/* This has been coded in assembler because GCC makes such a mess of it - when it's coded in C. */ - @@ -117,7 +117,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_truncl.S - beqlr- cr0 - mtfsfi 7,1 /* Set rounding mode toward 0. */ - fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- +- - bng- cr6,.L6 /* if (x > 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ @@ -136,7 +136,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_truncl.S -.L6: /* if (x < 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- fadd fp8,fp8,fp8 /* tau++; Make tau even */ +- fadd fp8,fp8,fp8 /* tau++; Make tau even */ - bnl cr5,.L7 /* if (x_low < 0.0) */ - fmr fp3,fp1 - fmr fp4,fp2 diff --git a/SOURCES/glibc-rh1457177-2.patch b/SOURCES/glibc-rh1457177-2.patch index 0b9722b2..bd41b69b 100644 --- a/SOURCES/glibc-rh1457177-2.patch +++ b/SOURCES/glibc-rh1457177-2.patch @@ -5,19 +5,19 @@ Author: Adhemerval Zanella Date: Fri Mar 14 07:35:43 2014 -0500 PowerPC: remove wrong ceill implementation for PowerPC64 - + The ceill assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_ceill.S) returns wrong results for some inputs where first double is a exact integer and the precision is determined by second long double. - + Checking on implementation comments and history, I am very confident the assembly implementation was based on a version before commit 5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in long double (ldbl-128ibm) rounding functions in glibc-2.4). - + By just removing the implementation and make the build select sysdeps/ieee754/ldbl-128ibm/s_ceill.c instead fixes the failing math. - + Fixes BZ#16701. Index: b/math/libm-test.inc @@ -27,7 +27,7 @@ Index: b/math/libm-test.inc @@ -2241,6 +2241,15 @@ ceil_test (void) TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L); TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L); - + + /* Check cases where first double is a exact integer higher than 2^52 and + the precision is determined by second long double for IBM long double. */ + TEST_f_f (ceil, 34503599627370498.515625L, 34503599627370499.0L); @@ -116,7 +116,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_ceill.S - mtfsf 0x01,fp11 /* restore previous rounding mode. */ - fnabs fp1,fp1 /* if (x == 0.0) */ - blr /* x = -0.0; */ -- +- -/* The high double is > TWO52 so we need to round the low double and - perhaps the high double. In this case we have to round the low - double and handle any adjustment to the high double that may be @@ -140,7 +140,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_ceill.S - beqlr- cr0 - mtfsfi 7,2 /* Set rounding mode toward +inf. */ - fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- +- - bng- cr6,.L6 /* if (x > 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ @@ -157,7 +157,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_ceill.S - b .L9 -.L6: /* if (x < 0.0) */ - fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ - bnl cr5,.L7 /* if (x_low < 0.0) */ - fmr fp3,fp1 - fmr fp4,fp2 diff --git a/SOURCES/glibc-rh1457177-3.patch b/SOURCES/glibc-rh1457177-3.patch index 41c10375..535be75c 100644 --- a/SOURCES/glibc-rh1457177-3.patch +++ b/SOURCES/glibc-rh1457177-3.patch @@ -5,21 +5,21 @@ Author: Adhemerval Zanella Date: Fri Mar 14 12:27:52 2014 -0500 PowerPC: remove wrong nearbyintl implementation for PPC64 - + The nearbyintl assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S) returns wrong results for some inputs where first double is a exact integer and the precision is determined by second long double. - + Checking on implementation comments and history, I am very confident the assembly implementation was based on a version before commit 5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in long double (ldbl-128ibm) rounding functions in glibc-2.4). - + By just removing the implementation and make the build select sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c instead fixes the failing math. - + Fixes BZ#16706. Index: b/math/libm-test.inc @@ -40,7 +40,7 @@ Index: b/math/libm-test.inc + TEST_f_f (nearbyint, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L); +# endif +#endif - + END (nearbyint); } Index: b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S diff --git a/SOURCES/glibc-rh1457177-4.patch b/SOURCES/glibc-rh1457177-4.patch index b2b65ed2..f4d731d8 100644 --- a/SOURCES/glibc-rh1457177-4.patch +++ b/SOURCES/glibc-rh1457177-4.patch @@ -5,20 +5,20 @@ Author: Adhemerval Zanella Date: Fri Mar 14 12:49:45 2014 -0500 PowerPC: remove wrong roundl implementation for PowerPC64 - + The roundl assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_roundl.S) returns wrong results for some inputs where first double is a exact integer and the precision is determined by second long double. - + Checking on implementation comments and history, I am very confident the assembly implementation was based on a version before commit 5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in long double (ldbl-128ibm) rounding functions in glibc-2.4). - + By just removing the implementation and make the build select sysdeps/ieee754/ldbl-128ibm/s_roundl.c instead fixes the failing math. - + This fixes 16707. Index: b/math/libm-test.inc @@ -28,7 +28,7 @@ Index: b/math/libm-test.inc @@ -9268,6 +9268,15 @@ round_test (void) TEST_f_f (round, -72057594037927936.75L, -72057594037927937.0L); TEST_f_f (round, -72057594037927937.5L, -72057594037927938.0L); - + + /* Check cases where first double is a exact integer higher than 2^52 and + the precision is determined by second long double for IBM long double. */ + TEST_f_f (round, 34503599627370498.515625L, 34503599627370499.0L); @@ -139,7 +139,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_roundl.S - beqlr- cr0 - mtfsfi 7,1 /* Set rounding mode toward 0. */ - fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- +- - bng- cr6,.L6 /* if (x > 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ @@ -157,7 +157,7 @@ Index: b/sysdeps/powerpc/powerpc64/fpu/s_roundl.S - b .L9 -.L6: /* if (x < 0.0) */ - fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ - bnl cr5,.L7 /* if (x_low < 0.0) */ - fmr fp3,fp1 - fmr fp4,fp2 diff --git a/SOURCES/glibc-rh1463692-1.patch b/SOURCES/glibc-rh1463692-1.patch index 171bc857..a75d5e1b 100644 --- a/SOURCES/glibc-rh1463692-1.patch +++ b/SOURCES/glibc-rh1463692-1.patch @@ -18,7 +18,7 @@ index 77c494d..6590e5d 100644 @@ -85,6 +85,14 @@ __copy_grp (const struct group srcgrp, const size_t buflen, } members[i] = NULL; - + + /* Align for pointers. We can't simply align C because we need to + align destbuf[c]. */ + if ((((uintptr_t)destbuf + c) & (__alignof__(char **) - 1)) != 0) @@ -33,7 +33,7 @@ index 77c494d..6590e5d 100644 @@ -168,6 +176,14 @@ __merge_grp (struct group *savedgrp, char *savedbuf, char *savedend, /* Add the NULL-terminator. */ members[savedmemcount + memcount] = NULL; - + + /* Align for pointers. We can't simply align C because we need to + align savedbuf[c]. */ + if ((((uintptr_t)savedbuf + c) & (__alignof__(char **) - 1)) != 0) @@ -45,5 +45,6 @@ index 77c494d..6590e5d 100644 /* Copy the member array back into the buffer after the member list and free the member array. */ savedgrp->gr_mem = (char **) &savedbuf[c]; --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1463692-2.patch b/SOURCES/glibc-rh1463692-2.patch index f5197db4..b3cbb406 100644 --- a/SOURCES/glibc-rh1463692-2.patch +++ b/SOURCES/glibc-rh1463692-2.patch @@ -15,13 +15,14 @@ index 6590e5d..035e7a6 100644 --- a/grp/grp-merge.c +++ b/grp/grp-merge.c @@ -137,7 +137,7 @@ __merge_grp (struct group *savedgrp, char *savedbuf, char *savedend, - + /* Get the count of group members from the last sizeof (size_t) bytes in the mergegrp buffer. */ - savedmemcount = (size_t) *(savedend - sizeof (size_t)); + savedmemcount = *(size_t *) (savedend - sizeof (size_t)); - + /* Get the count of new members to add. */ for (memcount = 0; mergegrp->gr_mem[memcount]; memcount++) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh1468807.patch b/SOURCES/glibc-rh1468807.patch index 42ca09f7..f8d75fb6 100644 --- a/SOURCES/glibc-rh1468807.patch +++ b/SOURCES/glibc-rh1468807.patch @@ -5,21 +5,21 @@ Author: H.J. Lu Date: Thu Jul 6 04:43:06 2017 -0700 x86-64: Align the stack in __tls_get_addr [BZ #21609] - + This change forces realignment of the stack pointer in __tls_get_addr, so that binaries compiled by GCCs older than GCC 4.9: - + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 - + continue to work even if vector instructions are used in glibc which require the ABI stack realignment. - + __tls_get_addr_slow is added to handle the slow paths in the default implementation of__tls_get_addr in elf/dl-tls.c. The new __tls_get_addr calls __tls_get_addr_slow after realigning the stack. Internal calls within ld.so go directly to the default implementation of __tls_get_addr because they do not need stack realignment. - + [BZ #21609] * sysdeps/x86_64/Makefile (sysdep-dl-routines): Add tls_get_addr. (gen-as-const-headers): Add rtld-offsets.sym. @@ -40,16 +40,16 @@ index 6c03a89fb3ea3063..c6766bb2b443a28a 100644 +++ b/sysdeps/x86_64/Makefile @@ -19,7 +19,7 @@ gen-as-const-headers += locale-defines.sym endif - + ifeq ($(subdir),elf) -sysdep-dl-routines += tlsdesc dl-tlsdesc +sysdep-dl-routines += tlsdesc dl-tlsdesc tls_get_addr - + tests += ifuncmain8 modules-names += ifuncmod8 @@ -69,5 +69,5 @@ endif endif - + ifeq ($(subdir),csu) -gen-as-const-headers += tlsdesc.sym +gen-as-const-headers += tlsdesc.sym rtld-offsets.sym @@ -120,16 +120,16 @@ index 56162ee64a4aae7d..0b4a6b3b634a83f4 100644 @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see . */ - + +#ifndef _X86_64_DL_TLS_H +#define _X86_64_DL_TLS_H + +#include - + /* Type used for the representation of TLS information in the GOT. */ typedef struct dl_tls_index @@ -29,3 +33,5 @@ extern void *__tls_get_addr (tls_index *ti); - + /* Value used for dtv entries for which the allocation is delayed. */ #define TLS_DTV_UNALLOCATED ((void *) -1l) + diff --git a/SOURCES/glibc-rh1498566.patch b/SOURCES/glibc-rh1498566.patch index e1c88629..81fb166a 100644 --- a/SOURCES/glibc-rh1498566.patch +++ b/SOURCES/glibc-rh1498566.patch @@ -7,20 +7,20 @@ Author: Stefan Liebler Date: Thu Mar 3 08:24:18 2016 +0100 S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682] - + Beginning with Linux 4.3, the kernel headers contain direct system call numbers __NR_socket etc. on s390x. On older kernels, the socket-multiplexer syscall __NR_socketcall was used. - + To enable these new syscalls, the patch "S390: Call direct system calls for socket operations." (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5) was applied upstream. - + If glibc 2.23 is configured with --enable-kernel=4.3 and newer, the direct socket syscalls are used. For older kernels, the socket-multiplexer syscall is used instead. - + In glibc 2.22 and earlier, this patch is not applied. If you build glibc on a kernel < 4.3, the socket-multiplexer syscall is used. But if you build glibc on kernel >= 4.3, the @@ -31,7 +31,7 @@ Date: Thu Mar 3 08:24:18 2016 +0100 (https://sourceware.org/bugzilla/show_bug.cgi?id=19682) The configure switch --enable-kernel does not influence this behaviour on older glibc-releases. - + The solution is to remove the direct socket-syscalls in sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (this patch) on older glibc-releases as it was done by the diff --git a/SOURCES/glibc-rh1498925-1.patch b/SOURCES/glibc-rh1498925-1.patch index 3e003907..053ed030 100644 --- a/SOURCES/glibc-rh1498925-1.patch +++ b/SOURCES/glibc-rh1498925-1.patch @@ -3,7 +3,7 @@ Author: Adhemerval Zanella Date: Wed Jun 25 11:54:31 2014 -0500 PowerPC: Align power7 memcpy using VSX to quadword - + This patch changes power7 memcpy to use VSX instructions only when memory is aligned to quardword. It is to avoid unaligned kernel traps on non-cacheable memory (for instance, memory-mapped I/O). @@ -13,24 +13,24 @@ index 52c2a6b..e540fea 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcpy.S +++ b/sysdeps/powerpc/powerpc32/power7/memcpy.S @@ -38,8 +38,8 @@ EALIGN (memcpy, 5, 0) - ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move - code. */ - + ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move + code. */ + - andi. 11,3,7 /* Check alignment of DST. */ - clrlwi 10,4,29 /* Check alignment of SRC. */ + andi. 11,3,15 /* Check alignment of DST. */ + clrlwi 10,4,28 /* Check alignment of SRC. */ - cmplw cr6,10,11 /* SRC and DST alignments match? */ - mr 12,4 - mr 31,5 + cmplw cr6,10,11 /* SRC and DST alignments match? */ + mr 12,4 + mr 31,5 diff --git a/sysdeps/powerpc/powerpc64/power7/memcpy.S b/sysdeps/powerpc/powerpc64/power7/memcpy.S index bbfd381..58d9b12 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcpy.S +++ b/sysdeps/powerpc/powerpc64/power7/memcpy.S @@ -36,16 +36,11 @@ EALIGN (memcpy, 5, 0) - ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move - code. */ - + ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move + code. */ + -#ifdef __LITTLE_ENDIAN__ -/* In little-endian mode, power7 takes an alignment trap on any lxvd2x - or stxvd2x crossing a 32-byte boundary, so ensure the aligned_copy @@ -38,52 +38,52 @@ index bbfd381..58d9b12 100644 +/* Align copies using VSX instructions to quadword. It is to avoid alignment + traps when memcpy is used on non-cacheable memory (for instance, memory + mapped I/O). */ - andi. 10,3,15 - clrldi 11,4,60 + andi. 10,3,15 + clrldi 11,4,60 -#else - andi. 10,3,7 /* Check alignment of DST. */ - clrldi 11,4,61 /* Check alignment of SRC. */ -#endif - cmpld cr6,10,11 /* SRC and DST alignments match? */ - - mr dst,3 + cmpld cr6,10,11 /* SRC and DST alignments match? */ + + mr dst,3 @@ -53,13 +48,9 @@ EALIGN (memcpy, 5, 0) - beq L(aligned_copy) - - mtocrf 0x01,0 + beq L(aligned_copy) + + mtocrf 0x01,0 -#ifdef __LITTLE_ENDIAN__ - clrldi 0,0,60 + clrldi 0,0,60 -#else - clrldi 0,0,61 -#endif - + -/* Get the DST and SRC aligned to 8 bytes (16 for little-endian). */ +/* Get the DST and SRC aligned to 16 bytes. */ 1: - bf 31,2f - lbz 6,0(src) + bf 31,2f + lbz 6,0(src) @@ -79,14 +70,12 @@ EALIGN (memcpy, 5, 0) - stw 6,0(dst) - addi dst,dst,4 + stw 6,0(dst) + addi dst,dst,4 8: -#ifdef __LITTLE_ENDIAN__ - bf 28,16f - ld 6,0(src) - addi src,src,8 - std 6,0(dst) - addi dst,dst,8 + bf 28,16f + ld 6,0(src) + addi src,src,8 + std 6,0(dst) + addi dst,dst,8 16: -#endif - subf cnt,0,cnt - + subf cnt,0,cnt + /* Main aligned copy loop. Copies 128 bytes at a time. */ @@ -298,9 +287,6 @@ L(copy_LE_8): - .align 4 + .align 4 L(copy_GE_32_unaligned): - clrldi 0,0,60 /* Number of bytes until the 1st dst quadword. */ + clrldi 0,0,60 /* Number of bytes until the 1st dst quadword. */ -#ifndef __LITTLE_ENDIAN__ - andi. 10,3,15 /* Check alignment of DST (against quadwords). */ -#endif - srdi 9,cnt,4 /* Number of full quadwords remaining. */ - - beq L(copy_GE_32_unaligned_cont) + srdi 9,cnt,4 /* Number of full quadwords remaining. */ + + beq L(copy_GE_32_unaligned_cont) diff --git a/SOURCES/glibc-rh1498925-2.patch b/SOURCES/glibc-rh1498925-2.patch index 09bab3d4..2455f562 100644 --- a/SOURCES/glibc-rh1498925-2.patch +++ b/SOURCES/glibc-rh1498925-2.patch @@ -6,18 +6,18 @@ Author: Rajalakshmi Srinivasaraghavan Date: Wed Oct 25 13:13:53 2017 -0200 powerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmove - + POWER9 DD2.1 and earlier has an issue where some cache inhibited vector load traps to the kernel, causing a performance degradation. To handle this in memcpy and memmove, lvx/stvx is used for aligned addresses instead of lxvd2x/stxvd2x. - + Reference: https://patchwork.ozlabs.org/patch/814059/ - + * sysdeps/powerpc/powerpc64/power7/memcpy.S: Replace lxvd2x/stxvd2x with lvx/stvx. * sysdeps/powerpc/powerpc64/power7/memmove.S: Likewise. - + Reviewed-by: Tulio Magno Quites Machado Filho Reviewed-by: Adhemerval Zanella @@ -26,19 +26,19 @@ index 1ccbc2e..a7cdf8b 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcpy.S +++ b/sysdeps/powerpc/powerpc64/power7/memcpy.S @@ -91,63 +91,63 @@ L(aligned_copy): - srdi 12,cnt,7 - cmpdi 12,0 - beq L(aligned_tail) + srdi 12,cnt,7 + cmpdi 12,0 + beq L(aligned_tail) - lxvd2x 6,0,src - lxvd2x 7,src,6 + lvx 6,0,src + lvx 7,src,6 - mtctr 12 - b L(aligned_128loop) - - .align 4 + mtctr 12 + b L(aligned_128loop) + + .align 4 L(aligned_128head): - /* for the 2nd + iteration of this loop. */ + /* for the 2nd + iteration of this loop. */ - lxvd2x 6,0,src - lxvd2x 7,src,6 + lvx 6,0,src @@ -50,7 +50,7 @@ index 1ccbc2e..a7cdf8b 100644 + lvx 8,src,7 + lvx 9,src,8 + stvx 6,0,dst - addi src,src,64 + addi src,src,64 - stxvd2x 7,dst,6 - stxvd2x 8,dst,7 - stxvd2x 9,dst,8 @@ -61,12 +61,12 @@ index 1ccbc2e..a7cdf8b 100644 + stvx 9,dst,8 + lvx 6,0,src + lvx 7,src,6 - addi dst,dst,64 + addi dst,dst,64 - lxvd2x 8,src,7 - lxvd2x 9,src,8 + lvx 8,src,7 + lvx 9,src,8 - addi src,src,64 + addi src,src,64 - stxvd2x 6,0,dst - stxvd2x 7,dst,6 - stxvd2x 8,dst,7 @@ -75,12 +75,12 @@ index 1ccbc2e..a7cdf8b 100644 + stvx 7,dst,6 + stvx 8,dst,7 + stvx 9,dst,8 - addi dst,dst,64 - bdnz L(aligned_128head) - + addi dst,dst,64 + bdnz L(aligned_128head) + L(aligned_tail): - mtocrf 0x01,cnt - bf 25,32f + mtocrf 0x01,cnt + bf 25,32f - lxvd2x 6,0,src - lxvd2x 7,src,6 - lxvd2x 8,src,7 @@ -89,7 +89,7 @@ index 1ccbc2e..a7cdf8b 100644 + lvx 7,src,6 + lvx 8,src,7 + lvx 9,src,8 - addi src,src,64 + addi src,src,64 - stxvd2x 6,0,dst - stxvd2x 7,dst,6 - stxvd2x 8,dst,7 @@ -98,26 +98,26 @@ index 1ccbc2e..a7cdf8b 100644 + stvx 7,dst,6 + stvx 8,dst,7 + stvx 9,dst,8 - addi dst,dst,64 + addi dst,dst,64 32: - bf 26,16f + bf 26,16f - lxvd2x 6,0,src - lxvd2x 7,src,6 + lvx 6,0,src + lvx 7,src,6 - addi src,src,32 + addi src,src,32 - stxvd2x 6,0,dst - stxvd2x 7,dst,6 + stvx 6,0,dst + stvx 7,dst,6 - addi dst,dst,32 + addi dst,dst,32 16: - bf 27,8f + bf 27,8f - lxvd2x 6,0,src + lvx 6,0,src - addi src,src,16 + addi src,src,16 - stxvd2x 6,0,dst + stvx 6,0,dst - addi dst,dst,16 + addi dst,dst,16 8: - bf 28,4f + bf 28,4f diff --git a/SOURCES/glibc-rh1500908.patch b/SOURCES/glibc-rh1500908.patch index c9f0a7a2..6ad677b3 100644 --- a/SOURCES/glibc-rh1500908.patch +++ b/SOURCES/glibc-rh1500908.patch @@ -5,7 +5,7 @@ Author: Szabolcs Nagy Date: Wed Jun 21 13:47:07 2017 +0100 [AArch64] Use hidden __GI__dl_argv in rtld startup code - + We rely on the symbol being locally defined so using extern symbol is not correct and the linker may complain about the relocations. @@ -16,13 +16,13 @@ index 0e76ca8f146905ef..40b0587ba42cd59e 100644 --- a/ports/sysdeps/aarch64/dl-machine.h +++ b/ports/sysdeps/aarch64/dl-machine.h @@ -169,8 +169,8 @@ _dl_start_user: \n\ - cmp x0, #0 \n\ - bne 1b \n\ - // Update _dl_argv \n\ + cmp x0, #0 \n\ + bne 1b \n\ + // Update _dl_argv \n\ - adrp x3, _dl_argv \n\ - str x2, [x3, #:lo12:_dl_argv] \n\ + adrp x3, _dl_argv_internal \n\ + str x2, [x3, #:lo12:_dl_argv_internal] \n\ .L_done_stack_adjust: \n\ - // compute envp \n\ - add x3, x2, x1, lsl #3 \n\ + // compute envp \n\ + add x3, x2, x1, lsl #3 \n\ diff --git a/SOURCES/glibc-rh1503854-1.patch b/SOURCES/glibc-rh1503854-1.patch index 7ee6abc2..5ea0b913 100644 --- a/SOURCES/glibc-rh1503854-1.patch +++ b/SOURCES/glibc-rh1503854-1.patch @@ -3,7 +3,7 @@ Author: Carlos Eduardo Seo Date: Mon Dec 28 16:36:46 2015 -0200 powerpc: Fix dl-procinfo HWCAP - + HWCAP-related code should had been updated when the 32 bits of HWCAP were used. This patch updates the code in dl-procinfo.h to loop through all the 32 bits in HWCAP and updates _dl_powerpc_cap_flags accordingly. @@ -34,7 +34,7 @@ index bce3a49..2187c5e 100644 @@ -22,9 +22,6 @@ #include #include /* This defines the PPC_FEATURE[2]_* macros. */ - + -/* There are 28 bits used, but they are bits 4..31. */ -#define _DL_HWCAP_FIRST 4 - @@ -48,7 +48,7 @@ index bce3a49..2187c5e 100644 - return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST]; + return GLRO(dl_powerpc_cap_flags)[idx]; } - + static inline const char * @@ -82,7 +79,7 @@ static inline int __attribute__ ((unused)) @@ -62,7 +62,7 @@ index bce3a49..2187c5e 100644 @@ -180,7 +177,7 @@ _dl_procinfo (unsigned int type, unsigned long int word) case AT_HWCAP: _dl_printf ("AT_HWCAP: "); - + - for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i) + for (int i = 0; i <= _DL_HWCAP_LAST; ++i) if (word & (1 << i)) diff --git a/SOURCES/glibc-rh1503854-2.patch b/SOURCES/glibc-rh1503854-2.patch index 165fe91d..255d05a7 100644 --- a/SOURCES/glibc-rh1503854-2.patch +++ b/SOURCES/glibc-rh1503854-2.patch @@ -3,14 +3,14 @@ Author: Tulio Magno Quites Machado Filho Date: Fri Jun 23 09:10:32 2017 -0300 powerpc: Update AT_HWCAP[2] bits - + Linux commit ID a4700a26107241cc7b9ac8528b2c6714ff99983d reserved 2 more bits for the instructions darn (Deliver a Random Number) and scv (System Call Vectored). - + Linux commit ID 6997e57d693b07289694239e52a10d2f02c3a46f reserved another bit for internal usage. - + * sysdeps/powerpc/bits/hwcap.h: Add PPC_FEATURE2_DARN and PPC_FEATURE2_SCV. * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add scv @@ -27,11 +27,11 @@ index c9daeed..dfc71c2 100644 +/* Reserved by the kernel. 0x00000004 Do not use. */ #define PPC_FEATURE_TRUE_LE 0x00000002 #define PPC_FEATURE_PPC_LE 0x00000001 - + @@ -69,3 +70,5 @@ #define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.0 */ #define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float - 128-bit */ + 128-bit */ +#define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ +#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c diff --git a/SOURCES/glibc-rh1503854-3.patch b/SOURCES/glibc-rh1503854-3.patch index 831ced36..d1408ea8 100644 --- a/SOURCES/glibc-rh1503854-3.patch +++ b/SOURCES/glibc-rh1503854-3.patch @@ -3,16 +3,16 @@ Author: Tulio Magno Quites Machado Filho Date: Fri Nov 17 21:15:15 2017 -0200 powerpc: Update AT_HWCAP2 bits - + Linux commit ID cba6ac4869e45cc93ac5497024d1d49576e82666 reserved a new bit for a scenario where transactional memory is available, but the suspended state is disabled. - + * sysdeps/powerpc/bits/hwcap.h (PPC_FEATURE2_HTM_NO_SUSPEND): New macro. * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add htm-no-suspend. - + Signed-off-by: Tulio Magno Quites Machado Filho diff --git a/sysdeps/powerpc/bits/hwcap.h b/sysdeps/powerpc/bits/hwcap.h @@ -20,7 +20,7 @@ index dfc71c2..0668ca0 100644 --- a/sysdeps/powerpc/bits/hwcap.h +++ b/sysdeps/powerpc/bits/hwcap.h @@ -72,3 +72,5 @@ - 128-bit */ + 128-bit */ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ +#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended diff --git a/SOURCES/glibc-rh1504809-1.patch b/SOURCES/glibc-rh1504809-1.patch index cc635e90..e66242d0 100644 --- a/SOURCES/glibc-rh1504809-1.patch +++ b/SOURCES/glibc-rh1504809-1.patch @@ -9,11 +9,11 @@ index 87d4f1bd2a7ef5a0..15cf3d5cccab0ee0 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -826,7 +826,7 @@ glob (pattern, flags, errfunc, pglob) - *p = '\0'; - } - else + *p = '\0'; + } + else - *((char *) mempcpy (newp, dirname + 1, end_name - dirname)) + *((char *) mempcpy (newp, dirname + 1, end_name - dirname - 1)) - = '\0'; - user_name = newp; - } + = '\0'; + user_name = newp; + } diff --git a/SOURCES/glibc-rh1504809-2.patch b/SOURCES/glibc-rh1504809-2.patch index ff6753d3..7970ff13 100644 --- a/SOURCES/glibc-rh1504809-2.patch +++ b/SOURCES/glibc-rh1504809-2.patch @@ -11,16 +11,16 @@ index 15cf3d5cccab0ee0..e09314712d68c1b8 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -806,11 +806,11 @@ glob (pattern, flags, errfunc, pglob) - char *p = mempcpy (newp, dirname + 1, - unescape - dirname - 1); - char *q = unescape; + char *p = mempcpy (newp, dirname + 1, + unescape - dirname - 1); + char *q = unescape; - while (*q != '\0') + while (q != end_name) - { - if (*q == '\\') - { + { + if (*q == '\\') + { - if (q[1] == '\0') + if (q + 1 == end_name) - { - /* "~fo\\o\\" unescape to user_name "foo\\", - but "~fo\\o\\/" unescape to user_name + { + /* "~fo\\o\\" unescape to user_name "foo\\", + but "~fo\\o\\/" unescape to user_name diff --git a/SOURCES/glibc-rh1504969.patch b/SOURCES/glibc-rh1504969.patch index 2cf639d3..854892c9 100644 --- a/SOURCES/glibc-rh1504969.patch +++ b/SOURCES/glibc-rh1504969.patch @@ -6,29 +6,29 @@ Author: H.J. Lu Date: Fri Oct 20 11:00:08 2017 -0700 x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265] - + In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector, mask and bound registers. It simplifies _dl_runtime_resolve and supports different calling conventions. ld.so code size is reduced by more than 1 KB. However, use fxsave/xsave/xsavec takes a little bit more cycles than saving and restoring vector and bound registers individually. - + Latency for _dl_runtime_resolve to lookup the function, foo, from one shared library plus libc.so: - + Before After Change - + Westmere (SSE)/fxsave 345 866 151% IvyBridge (AVX)/xsave 420 643 53% Haswell (AVX)/xsave 713 1252 75% Skylake (AVX+MPX)/xsavec 559 719 28% Skylake (AVX512+MPX)/xsavec 145 272 87% Ryzen (AVX)/xsavec 280 553 97% - + This is the worst case where portion of time spent for saving and restoring registers is bigger than majority of cases. With smaller _dl_runtime_resolve code size, overall performance impact is negligible. - + On IvyBridge, differences in build and test time of binutils with lazy binding GCC and binutils are noises. On Westmere, differences in bootstrap and "makc check" time of GCC 7 with lazy binding GCC and @@ -39,10 +39,10 @@ Author: H.J. Lu Date: Fri Aug 26 08:57:42 2016 -0700 X86-64: Correct CFA in _dl_runtime_resolve - + When stack is re-aligned in _dl_runtime_resolve, there is no need to adjust CFA when allocating register save area on stack. - + * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve): Don't adjust CFA when allocating register save area on re-aligned stack. @@ -58,7 +58,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features-offsets.sym +++ glibc-2.17-c758a686/sysdeps/x86/cpu-features-offsets.sym @@ -5,3 +5,5 @@ #define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem) - + RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET rtld_global_ro_offsetof (_dl_x86_cpu_features) + +XSAVE_STATE_SIZE_OFFSET offsetof (struct cpu_features, xsave_state_size) @@ -67,17 +67,17 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c --- glibc-2.17-c758a686.orig/sysdeps/x86/cpu-features.c +++ glibc-2.17-c758a686/sysdeps/x86/cpu-features.c @@ -18,6 +18,7 @@ - + #include #include +#include - + static inline void get_common_indeces (struct cpu_features *cpu_features, @@ -148,20 +149,6 @@ init_cpu_features (struct cpu_features * - break; - } - } + break; + } + } - - /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow. - If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt. */ @@ -96,9 +96,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c /* This spells out "AuthenticAMD". */ else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65) @@ -244,6 +231,71 @@ init_cpu_features (struct cpu_features * - if (HAS_CPU_FEATURE (FMA4)) - cpu_features->feature[index_FMA4_Usable] |= bit_FMA4_Usable; - } + if (HAS_CPU_FEATURE (FMA4)) + cpu_features->feature[index_FMA4_Usable] |= bit_FMA4_Usable; + } + + /* For _dl_runtime_resolve, set xsave_state_size to xsave area + size + integer register save size and align it to 64 bytes. */ @@ -165,7 +165,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c + } + } } - + cpu_features->family = family; Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h =================================================================== @@ -178,13 +178,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h -#define bit_Use_dl_runtime_resolve_opt (1 << 20) -#define bit_Use_dl_runtime_resolve_slow (1 << 21) +#define bit_XSAVEC_Usable (1 << 18) - - + + /* CPUID Feature flags. */ @@ -70,10 +69,20 @@ /* The current maximum size of the feature integer bit array. */ #define FEATURE_INDEX_MAX 1 - + +/* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need + space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be + aligned to 16 bytes for fxsave and 64 bytes for xsave. */ @@ -195,11 +195,11 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h + ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7)) + #ifdef __ASSEMBLER__ - + # include # include +# include - + # define index_SSE2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET # define index_SSSE3 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET @@ -98,8 +107,6 @@ @@ -208,8 +208,8 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h # define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE -# define index_Use_dl_runtime_resolve_opt FEATURE_INDEX_1*FEATURE_SIZE -# define index_Use_dl_runtime_resolve_slow FEATURE_INDEX_1*FEATURE_SIZE - - + + # if defined (_LIBC) && !IS_IN (nonlib) @@ -214,6 +221,12 @@ struct cpu_features } cpuid[COMMON_CPUID_INDEX_MAX]; @@ -223,7 +223,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h + unsigned long int xsave_state_size; unsigned int feature[FEATURE_INDEX_MAX]; }; - + @@ -279,8 +292,7 @@ extern const struct cpu_features *__get_ # define index_AVX512DQ_Usable FEATURE_INDEX_1 # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1 @@ -231,9 +231,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.h -# define index_Use_dl_runtime_resolve_opt FEATURE_INDEX_1 -# define index_Use_dl_runtime_resolve_slow FEATURE_INDEX_1 +# define index_XSAVEC_Usable FEATURE_INDEX_1 - + #endif /* !__ASSEMBLER__ */ - + Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/dl-machine.h @@ -255,9 +255,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h extern void _dl_runtime_profile_avx (ElfW(Word)) attribute_hidden; extern void _dl_runtime_profile_avx512 (ElfW(Word)) attribute_hidden; @@ -120,29 +117,14 @@ elf_machine_runtime_setup (struct link_m - /* This function will get called to fix up the GOT entry - indicated by the offset on the stack, and then jump to - the resolved address. */ + /* This function will get called to fix up the GOT entry + indicated by the offset on the stack, and then jump to + the resolved address. */ - if (HAS_ARCH_FEATURE (AVX512F_Usable)) - { - if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt)) @@ -284,13 +284,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-machine.h + = (HAS_ARCH_FEATURE (XSAVEC_Usable) + ? (ElfW(Addr)) &_dl_runtime_resolve_xsavec + : (ElfW(Addr)) &_dl_runtime_resolve_xsave); - else + else - *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse; + *(ElfW(Addr) *) (got + 2) + = (ElfW(Addr)) &_dl_runtime_resolve_fxsave; - } + } } - + Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/x86_64/dl-trampoline.S @@ -298,7 +298,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S @@ -34,37 +34,24 @@ # define DL_STACK_ALIGNMENT 8 #endif - + -#ifndef DL_RUNIME_UNALIGNED_VEC_SIZE -/* The maximum size of unaligned vector load and store. */ -# define DL_RUNIME_UNALIGNED_VEC_SIZE 16 @@ -316,7 +316,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S +#define DL_RUNTIME_RESOLVE_REALIGN_STACK \ + (STATE_SAVE_ALIGNMENT > DL_STACK_ALIGNMENT \ + || 16 > DL_STACK_ALIGNMENT) - + /* Area on stack to save and restore registers used for parameter passing when calling _dl_fixup. */ #ifdef __ILP32__ @@ -342,7 +342,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S @@ -72,71 +59,60 @@ #define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8) #define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8) - + +#define RESTORE_AVX + #define VEC_SIZE 64 @@ -363,7 +363,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S -#undef VMOV #undef VMOVA #undef VEC_SIZE - + #define VEC_SIZE 32 #define VMOVA vmovdqa -#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT @@ -383,7 +383,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S -#undef VMOV #undef VMOVA #undef VEC_SIZE - + /* movaps/movups is 1-byte shorter. */ #define VEC_SIZE 16 #define VMOVA movaps @@ -403,7 +403,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S +#undef VEC #undef VMOVA +#undef VEC_SIZE - + -/* Used by _dl_runtime_resolve_avx_opt/_dl_runtime_resolve_avx512_opt - to preserve the full vector registers with zero upper bits. */ -#define VMOVA vmovdqa @@ -444,7 +444,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h @@ -16,140 +16,47 @@ License along with the GNU C Library; if not, see . */ - + -#undef REGISTER_SAVE_AREA_RAW -#ifdef __ILP32__ -/* X32 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as VEC0 to @@ -457,7 +457,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h -#endif + .text +#ifdef _dl_runtime_resolve - + -#undef REGISTER_SAVE_AREA -#undef LOCAL_STORAGE_AREA -#undef BASE @@ -485,7 +485,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# error STATE_SAVE_ALIGNMENT must be multples of 16 # endif -#endif - + - .text -#ifdef _dl_runtime_resolve_opt -/* Use the smallest vector registers to preserve the full YMM/ZMM @@ -529,7 +529,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# if (STATE_SAVE_OFFSET % STATE_SAVE_ALIGNMENT) != 0 +# error STATE_SAVE_OFFSET must be multples of STATE_SAVE_ALIGNMENT # endif - + -/* Use XGETBV with ECX == 1 to check which bits in vector registers are - non-zero and only preserve the non-zero lower bits with zero upper - bits. */ @@ -613,13 +613,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h - .size _dl_runtime_resolve_opt, .-_dl_runtime_resolve_opt -#endif + - .globl _dl_runtime_resolve - .hidden _dl_runtime_resolve - .type _dl_runtime_resolve, @function + .globl _dl_runtime_resolve + .hidden _dl_runtime_resolve + .type _dl_runtime_resolve, @function @@ -157,19 +64,30 @@ _dl_runtime_resolve_opt: - cfi_startproc + cfi_startproc _dl_runtime_resolve: - cfi_adjust_cfa_offset(16) # Incorporate PLT + cfi_adjust_cfa_offset(16) # Incorporate PLT -#if DL_RUNIME_RESOLVE_REALIGN_STACK -# if LOCAL_STORAGE_AREA != 8 -# error LOCAL_STORAGE_AREA must be 8 @@ -628,19 +628,19 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h +# if LOCAL_STORAGE_AREA != 8 +# error LOCAL_STORAGE_AREA must be 8 +# endif - pushq %rbx # push subtracts stack by 8. - cfi_adjust_cfa_offset(8) - cfi_rel_offset(%rbx, 0) - mov %RSP_LP, %RBX_LP - cfi_def_cfa_register(%rbx) + pushq %rbx # push subtracts stack by 8. + cfi_adjust_cfa_offset(8) + cfi_rel_offset(%rbx, 0) + mov %RSP_LP, %RBX_LP + cfi_def_cfa_register(%rbx) - and $-VEC_SIZE, %RSP_LP -#endif + and $-STATE_SAVE_ALIGNMENT, %RSP_LP +# endif +# ifdef REGISTER_SAVE_AREA - sub $REGISTER_SAVE_AREA, %RSP_LP + sub $REGISTER_SAVE_AREA, %RSP_LP +# if !DL_RUNTIME_RESOLVE_REALIGN_STACK - cfi_adjust_cfa_offset(REGISTER_SAVE_AREA) + cfi_adjust_cfa_offset(REGISTER_SAVE_AREA) +# endif +# else + # Allocate stack space of the required size to save the state. @@ -650,13 +650,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h + sub _dl_x86_cpu_features+XSAVE_STATE_SIZE_OFFSET(%rip), %RSP_LP +# endif +# endif - # Preserve registers otherwise clobbered. - movq %rax, REGISTER_SAVE_RAX(%rsp) - movq %rcx, REGISTER_SAVE_RCX(%rsp) + # Preserve registers otherwise clobbered. + movq %rax, REGISTER_SAVE_RAX(%rsp) + movq %rcx, REGISTER_SAVE_RCX(%rsp) @@ -178,59 +96,48 @@ _dl_runtime_resolve: - movq %rdi, REGISTER_SAVE_RDI(%rsp) - movq %r8, REGISTER_SAVE_R8(%rsp) - movq %r9, REGISTER_SAVE_R9(%rsp) + movq %rdi, REGISTER_SAVE_RDI(%rsp) + movq %r8, REGISTER_SAVE_R8(%rsp) + movq %r9, REGISTER_SAVE_R9(%rsp) - VMOV %VEC(0), (REGISTER_SAVE_VEC_OFF)(%rsp) - VMOV %VEC(1), (REGISTER_SAVE_VEC_OFF + VEC_SIZE)(%rsp) - VMOV %VEC(2), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 2)(%rsp) @@ -708,12 +708,12 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h - .byte 0x66,0x0f,0x1b,0x5c,0x24,REGISTER_SAVE_BND3 # endif -#endif - # Copy args pushed by PLT in register. - # %rdi: link_map, %rsi: reloc_index - mov (LOCAL_STORAGE_AREA + 8)(%BASE), %RSI_LP - mov LOCAL_STORAGE_AREA(%BASE), %RDI_LP - call _dl_fixup # Call resolver. - mov %RAX_LP, %R11_LP # Save return value + # Copy args pushed by PLT in register. + # %rdi: link_map, %rsi: reloc_index + mov (LOCAL_STORAGE_AREA + 8)(%BASE), %RSI_LP + mov LOCAL_STORAGE_AREA(%BASE), %RDI_LP + call _dl_fixup # Call resolver. + mov %RAX_LP, %R11_LP # Save return value -#ifndef __ILP32__ - # Restore bound registers. These are nops if Intel MPX isn't - # avaiable or disabled. @@ -740,13 +740,13 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h # endif -#endif - # Get register content back. - movq REGISTER_SAVE_R9(%rsp), %r9 - movq REGISTER_SAVE_R8(%rsp), %r8 - movq REGISTER_SAVE_RDI(%rsp), %rdi + movq REGISTER_SAVE_R9(%rsp), %r9 + movq REGISTER_SAVE_R8(%rsp), %r8 + movq REGISTER_SAVE_RDI(%rsp), %rdi @@ -238,20 +145,12 @@ _dl_runtime_resolve: - movq REGISTER_SAVE_RDX(%rsp), %rdx - movq REGISTER_SAVE_RCX(%rsp), %rcx - movq REGISTER_SAVE_RAX(%rsp), %rax + movq REGISTER_SAVE_RDX(%rsp), %rdx + movq REGISTER_SAVE_RCX(%rsp), %rcx + movq REGISTER_SAVE_RAX(%rsp), %rax - VMOV (REGISTER_SAVE_VEC_OFF)(%rsp), %VEC(0) - VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE)(%rsp), %VEC(1) - VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 2)(%rsp), %VEC(2) @@ -757,22 +757,22 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h - VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 7)(%rsp), %VEC(7) -#if DL_RUNIME_RESOLVE_REALIGN_STACK +# if DL_RUNTIME_RESOLVE_REALIGN_STACK - mov %RBX_LP, %RSP_LP - cfi_def_cfa_register(%rsp) - movq (%rsp), %rbx - cfi_restore(%rbx) + mov %RBX_LP, %RSP_LP + cfi_def_cfa_register(%rsp) + movq (%rsp), %rbx + cfi_restore(%rbx) -#endif +# endif - # Adjust stack(PLT did 2 pushes) - add $(LOCAL_STORAGE_AREA + 16), %RSP_LP - cfi_adjust_cfa_offset(-(LOCAL_STORAGE_AREA + 16)) + # Adjust stack(PLT did 2 pushes) + add $(LOCAL_STORAGE_AREA + 16), %RSP_LP + cfi_adjust_cfa_offset(-(LOCAL_STORAGE_AREA + 16)) @@ -260,11 +159,9 @@ _dl_runtime_resolve: - jmp *%r11 # Jump to function address. - cfi_endproc - .size _dl_runtime_resolve, .-_dl_runtime_resolve + jmp *%r11 # Jump to function address. + cfi_endproc + .size _dl_runtime_resolve, .-_dl_runtime_resolve +#endif - - + + -/* To preserve %xmm0 - %xmm7 registers, dl-trampoline.h is included - twice, for _dl_runtime_resolve_sse and _dl_runtime_resolve_sse_vex. - But we don't need another _dl_runtime_profile for XMM registers. */ diff --git a/SOURCES/glibc-rh1523119-compat-symbols.patch b/SOURCES/glibc-rh1523119-compat-symbols.patch index af15096c..f7d9ba6a 100644 --- a/SOURCES/glibc-rh1523119-compat-symbols.patch +++ b/SOURCES/glibc-rh1523119-compat-symbols.patch @@ -33,11 +33,11 @@ index 9f2d3c3bd442bb38..5ab02c79c72eb1ac 100644 #include #include +#include - + int res_init (void) @@ -80,7 +81,34 @@ res_init (void) - + return __res_vinit (&_res, 1); } - @@ -71,7 +71,7 @@ index 9f2d3c3bd442bb38..5ab02c79c72eb1ac 100644 + /* This needs to be after the use of _res in res_init, above. */ #undef _res - + diff --git a/resolv/res_query.c b/resolv/res_query.c index ebbe5a6a4ed86abe..24fefb561e7f1f5e 100644 --- a/resolv/res_query.c @@ -79,7 +79,7 @@ index ebbe5a6a4ed86abe..24fefb561e7f1f5e 100644 @@ -705,6 +705,96 @@ hostalias (const char *name) (__resolv_context_get (), name, abuf, sizeof (abuf)); } - + +#ifdef SHARED +/* Compatibiliaty functions to support old nss_dns modules. */ + diff --git a/SOURCES/glibc-rh1527904-1.patch b/SOURCES/glibc-rh1527904-1.patch index 2fc1cf5c..1e0008fb 100644 --- a/SOURCES/glibc-rh1527904-1.patch +++ b/SOURCES/glibc-rh1527904-1.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Thu Jan 11 13:13:14 2018 +0100 nptl: Add tst-minstack-cancel, tst-minstack-exit [BZ #22636] - + I verified that without the guard accounting change in commit 630f4cc3aa019ede55976ea561f1a7af2f068639 (Fix stack guard size accounting) and RTLD_NOW for libgcc_s introduced by commit @@ -12,7 +12,7 @@ Date: Thu Jan 11 13:13:14 2018 +0100 an AVX-512F machine. tst-minstack-exit still passes, and either of the mentioned commit by itself frees sufficient stack space to make tst-minstack-cancel pass, too. - + Reviewed-by: Carlos O'Donell Index: glibc-2.17-c758a686/nptl/Makefile @@ -20,15 +20,15 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -267,7 +267,8 @@ tests = tst-typesizes \ - tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ - tst-getpid1 tst-getpid2 tst-getpid3 \ - tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ + tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ + tst-getpid1 tst-getpid2 tst-getpid3 \ + tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ - tst-mutex-errorcheck + tst-mutex-errorcheck \ + tst-minstack-cancel tst-minstack-exit xtests = tst-setuid1 tst-setuid1-static tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit - + Index: glibc-2.17-c758a686/nptl/tst-minstack-cancel.c =================================================================== --- /dev/null diff --git a/SOURCES/glibc-rh1527904-2.patch b/SOURCES/glibc-rh1527904-2.patch index 31be77b9..d24ade1c 100644 --- a/SOURCES/glibc-rh1527904-2.patch +++ b/SOURCES/glibc-rh1527904-2.patch @@ -18,28 +18,28 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -198,6 +198,7 @@ CFLAGS-send.c = -fexceptions -fasynchron - + CFLAGS-pt-system.c = -fexceptions - + +CFLAGS-tst-minstack-throw.cc = -std=gnu++11 - + tests = tst-typesizes \ - tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ + tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ @@ -268,7 +269,7 @@ tests = tst-typesizes \ - tst-getpid1 tst-getpid2 tst-getpid3 \ - tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ - tst-mutex-errorcheck \ + tst-getpid1 tst-getpid2 tst-getpid3 \ + tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ + tst-mutex-errorcheck \ - tst-minstack-cancel tst-minstack-exit + tst-minstack-cancel tst-minstack-exit tst-minstack-throw xtests = tst-setuid1 tst-setuid1-static tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit - + @@ -527,6 +528,7 @@ $(objpfx)tst-_res1: $(objpfx)tst-_res1mo - + LDLIBS-tst-cancel24 = $(no-as-needed) -lstdc++ LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24) +LDLIBS-tst-minstack-throw = -lstdc++ - + extra-B-pthread.so = -B$(common-objpfx)nptl/ $(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs)) Index: glibc-2.17-c758a686/nptl/tst-minstack-throw.cc diff --git a/SOURCES/glibc-rh1527904-3.patch b/SOURCES/glibc-rh1527904-3.patch index 66d21040..20689c35 100644 --- a/SOURCES/glibc-rh1527904-3.patch +++ b/SOURCES/glibc-rh1527904-3.patch @@ -3,19 +3,19 @@ Author: Szabolcs Nagy Date: Wed Dec 6 13:05:50 2017 +0000 [BZ #22637] Fix stack guard size accounting - + Previously if user requested S stack and G guard when creating a thread, the total mapping was S and the actual available stack was S - G - static_tls, which is not what the user requested. - + This patch fixes the guard size accounting by pretending the user requested S+G stack. This way all later logic works out except when reporting the user requested stack size (pthread_getattr_np) or when computing the minimal stack size (__pthread_get_minstack). - + Normally this will increase thread stack allocations by one page. TLS accounting is not affected, that will require a separate fix. - + [BZ #22637] * nptl/descr.h (stackblock, stackblock_size): Update comments. * nptl/allocatestack.c (allocate_stack): Add guardsize to stacksize. @@ -29,15 +29,15 @@ Index: glibc-2.17-c758a686/nptl/allocatestack.c +++ glibc-2.17-c758a686/nptl/allocatestack.c @@ -470,6 +470,10 @@ allocate_stack (const struct pthread_att /* Make sure the size of the stack is enough for the guard and - eventually the thread descriptor. */ + eventually the thread descriptor. */ guardsize = (attr->guardsize + pagesize_m1) & ~pagesize_m1; + if (guardsize < attr->guardsize || size + guardsize < guardsize) + /* Arithmetic overflow. */ + return EINVAL; + size += guardsize; if (__builtin_expect (size < ((guardsize + __static_tls_size - + MINIMAL_REST_STACK + pagesize_m1) - & ~pagesize_m1), + + MINIMAL_REST_STACK + pagesize_m1) + & ~pagesize_m1), Index: glibc-2.17-c758a686/nptl/descr.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/descr.h @@ -45,7 +45,7 @@ Index: glibc-2.17-c758a686/nptl/descr.h @@ -366,9 +366,9 @@ struct pthread struct _Unwind_Exception exc; #endif - + - /* If nonzero pointer to area allocated for the stack and its - size. */ + /* If nonzero, pointer to the area allocated for the stack and guard. */ diff --git a/SOURCES/glibc-rh1527904-4.patch b/SOURCES/glibc-rh1527904-4.patch index b718b3ef..ae3572b2 100644 --- a/SOURCES/glibc-rh1527904-4.patch +++ b/SOURCES/glibc-rh1527904-4.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Thu Jan 11 13:13:28 2018 +0100 csu: Update __libgcc_s_init comment - + Reviewed-by: Carlos O'Donell commit f993b8754080ac7572b692870e926d8b493db16c @@ -11,12 +11,12 @@ Author: Florian Weimer Date: Wed Jan 10 13:18:04 2018 +0100 nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636] - + Disabling lazy binding reduces stack usage during unwinding. - + Note that RTLD_NOW only makes a difference if libgcc.so has not already been loaded, so this is only a partial fix. - + Reviewed-by: Adhemerval Zanella Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c @@ -26,10 +26,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c @@ -51,7 +51,7 @@ pthread_cancel_init (void) return; } - + - handle = __libc_dlopen (LIBGCC_S_SO); + handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN); - + if (handle == NULL || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL Index: glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c @@ -39,20 +39,20 @@ Index: glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c @@ -35,12 +35,17 @@ init (void) void *resume, *personality; void *handle; - + - handle = __libc_dlopen (LIBGCC_S_SO); + /* Use RTLD_NOW here for consistency with pthread_cancel_init. + RTLD_NOW will rarely make a difference here because unwinding is + already in progress, so libgcc_s.so has already been loaded if + its unwinder is used. */ + handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN); - + if (handle == NULL || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL) - __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n"); + __libc_fatal (LIBGCC_S_SO + " must be installed for unwinding to work\n"); - + libgcc_s_resume = resume; libgcc_s_personality = personality; diff --git a/SOURCES/glibc-rh1529982.patch b/SOURCES/glibc-rh1529982.patch index 104c1dcc..31b8011b 100644 --- a/SOURCES/glibc-rh1529982.patch +++ b/SOURCES/glibc-rh1529982.patch @@ -6,12 +6,12 @@ Author: Florian Weimer Date: Mon Jan 8 14:57:25 2018 +0100 nptl: Add test for callee-saved register restore in pthread_exit - + GCC PR 83641 results in a miscompilation of libpthread, which causes pthread_exit not to restore callee-saved registers before running destructors for objects on the stack. This test detects this situation: - + info: unsigned int, direct pthread_exit call tst-thread-exit-clobber.cc:80: numeric comparison failure left: 4148288912 (0xf741dd90); from: value @@ -27,28 +27,28 @@ Index: glibc-2.17-c758a686/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -199,6 +199,7 @@ CFLAGS-send.c = -fexceptions -fasynchron CFLAGS-pt-system.c = -fexceptions - + CFLAGS-tst-minstack-throw.cc = -std=gnu++11 +CFLAGS-tst-thread-exit-clobber.o = -std=gnu++11 - + tests = tst-typesizes \ - tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ + tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ @@ -269,7 +270,8 @@ tests = tst-typesizes \ - tst-getpid1 tst-getpid2 tst-getpid3 \ - tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ - tst-mutex-errorcheck \ + tst-getpid1 tst-getpid2 tst-getpid3 \ + tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ + tst-mutex-errorcheck \ - tst-minstack-cancel tst-minstack-exit tst-minstack-throw + tst-minstack-cancel tst-minstack-exit tst-minstack-throw \ + tst-thread-exit-clobber xtests = tst-setuid1 tst-setuid1-static tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit - + @@ -529,6 +531,7 @@ $(objpfx)tst-_res1: $(objpfx)tst-_res1mo LDLIBS-tst-cancel24 = $(no-as-needed) -lstdc++ LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24) LDLIBS-tst-minstack-throw = -lstdc++ +LDLIBS-tst-thread-exit-clobber = -lstdc++ - + extra-B-pthread.so = -B$(common-objpfx)nptl/ $(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs)) Index: glibc-2.17-c758a686/nptl/tst-thread-exit-clobber.cc diff --git a/SOURCES/glibc-rh1534635.patch b/SOURCES/glibc-rh1534635.patch index cf0be04a..7f96227b 100644 --- a/SOURCES/glibc-rh1534635.patch +++ b/SOURCES/glibc-rh1534635.patch @@ -3,23 +3,23 @@ Author: Dmitry V. Levin Date: Sun Jan 7 02:03:41 2018 +0000 linux: make getcwd(3) fail if it cannot obtain an absolute path [BZ #22679] - + Currently getcwd(3) can succeed without returning an absolute path because the underlying getcwd syscall, starting with linux commit v2.6.36-rc1~96^2~2, may succeed without returning an absolute path. - + This is a conformance issue because "The getcwd() function shall place an absolute pathname of the current working directory in the array pointed to by buf, and return buf". - + This is also a security issue because a non-absolute path returned by getcwd(3) causes a buffer underflow in realpath(3). - + Fix this by checking the path returned by getcwd syscall and falling back to generic_getcwd if the path is not absolute, effectively making getcwd(3) fail with ENOENT. The error code is chosen for consistency with the case when the current directory is unlinked. - + [BZ #22679] CVE-2018-1000001 * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Fall back to @@ -32,15 +32,15 @@ Index: glibc-2.17-c758a686/io/Makefile --- glibc-2.17-c758a686.orig/io/Makefile +++ glibc-2.17-c758a686/io/Makefile @@ -70,7 +70,8 @@ tests := test-utime test-stat test-stat - tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \ - tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \ - tst-posix_fallocate \ + tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \ + tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \ + tst-posix_fallocate \ - tst-open-tmpfile + tst-open-tmpfile \ + tst-getcwd-abspath - + include ../Rules - + Index: glibc-2.17-c758a686/io/tst-getcwd-abspath.c =================================================================== --- /dev/null @@ -118,7 +118,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/getcwd.c +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/getcwd.c @@ -79,7 +79,7 @@ __getcwd (char *buf, size_t size) int retval; - + retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size); - if (retval >= 0) + if (retval >= 0 && path[0] == '/') @@ -128,7 +128,7 @@ Index: glibc-2.17-c758a686/sysdeps/unix/sysv/linux/getcwd.c @@ -95,10 +95,10 @@ __getcwd (char *buf, size_t size) return buf; } - + - /* The system call cannot handle paths longer than a page. - Neither can the magic symlink in /proc/self. Just use the + /* The system call either cannot handle paths longer than a page diff --git a/SOURCES/glibc-rh677316-RES_USE_INET6.patch b/SOURCES/glibc-rh677316-RES_USE_INET6.patch index 686e279d..a72b87e0 100644 --- a/SOURCES/glibc-rh677316-RES_USE_INET6.patch +++ b/SOURCES/glibc-rh677316-RES_USE_INET6.patch @@ -27,36 +27,36 @@ index d79b0bd9c79173c8..fa2d79e7b69da57b 100644 #include @@ -232,8 +232,8 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen, __libc_lock_lock (lock); - + status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop, - ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 )); + (res_use_inet6 () ? AF_INET6 : AF_INET), + (res_use_inet6 () ? AI_V4MAPPED : 0 )); - + __libc_lock_unlock (lock); - + @@ -345,7 +345,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host, - + return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop, - h_errnop, + h_errnop, - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); + (res_use_inet6 () ? AI_V4MAPPED : 0)); } - - + + @@ -353,7 +353,7 @@ enum nss_status _nss_nis_gethostbyname_r (const char *name, struct hostent *host, char *buffer, - size_t buflen, int *errnop, int *h_errnop) + size_t buflen, int *errnop, int *h_errnop) { - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) { enum nss_status status; - + @@ -427,9 +427,8 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af, free (result); - + int parse_res = parse_line (p, host, data, buflen, errnop, af, - ((_res.options & RES_USE_INET6) - ? AI_V4MAPPED : 0)); @@ -65,55 +65,55 @@ index d79b0bd9c79173c8..fa2d79e7b69da57b 100644 + if (__glibc_unlikely (parse_res < 1)) { if (parse_res == -1) - { + { diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c index 772d71097d6a2442..fb7461579b5408c9 100644 --- a/nis/nss_nisplus/nisplus-hosts.c +++ b/nis/nss_nisplus/nisplus-hosts.c @@ -43,6 +43,7 @@ static u_long tablename_len; - (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len) - + (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len) + /* Get implementation for some internal functions. */ +#include #include - - + + @@ -321,7 +322,7 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, - } - } - + } + } + - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) - parse_res = _nss_nisplus_parse_hostent (result, AF_INET6, host, buffer, - buflen, errnop, AI_V4MAPPED); + parse_res = _nss_nisplus_parse_hostent (result, AF_INET6, host, buffer, + buflen, errnop, AI_V4MAPPED); else @@ -488,7 +489,7 @@ _nss_nisplus_gethostbyname2_r (const char *name, int af, struct hostent *host, - + return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop, - herrnop, + herrnop, - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); + (res_use_inet6 () ? AI_V4MAPPED : 0)); } - - + + @@ -497,7 +498,7 @@ _nss_nisplus_gethostbyname_r (const char *name, struct hostent *host, - char *buffer, size_t buflen, int *errnop, - int *h_errnop) + char *buffer, size_t buflen, int *errnop, + int *h_errnop) { - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) { enum nss_status status; - + @@ -558,7 +559,7 @@ _nss_nisplus_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af, - + parse_res = _nss_nisplus_parse_hostent (result, af, host, - buffer, buflen, errnop, + buffer, buflen, errnop, - ((_res.options & RES_USE_INET6) + (res_use_inet6 () - ? AI_V4MAPPED : 0)); + ? AI_V4MAPPED : 0)); nis_freeresult (result); - + diff --git a/nscd/aicache.c b/nscd/aicache.c index abab042757920811..0ee25247cd464940 100644 --- a/nscd/aicache.c @@ -124,7 +124,7 @@ index abab042757920811..0ee25247cd464940 100644 #include +#include #include - + #include "dbg_log.h" @@ -112,7 +113,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, IPv6 addresses. Currently this is decided by setting the @@ -132,16 +132,16 @@ index abab042757920811..0ee25247cd464940 100644 int old_res_options = _res.options; - _res.options &= ~RES_USE_INET6; + _res.options &= ~DEPRECATED_RES_USE_INET6; - + size_t tmpbuf6len = 1024; char *tmpbuf6 = alloca (tmpbuf6len); @@ -537,7 +538,7 @@ next_nip: } - + out: - _res.options |= old_res_options & RES_USE_INET6; + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; - + if (dataset != NULL && !alloca_used) { diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c @@ -150,7 +150,7 @@ index d64ad2e7b6c9e58b..41488ed6c033ffcd 100644 +++ b/nscd/nscd_gethst_r.c @@ -17,7 +17,7 @@ . */ - + #include -#include +#include @@ -160,12 +160,12 @@ index d64ad2e7b6c9e58b..41488ed6c033ffcd 100644 @@ -41,7 +41,7 @@ __nscd_gethostbyname_r (const char *name, struct hostent *resultbuf, { request_type reqtype; - + - reqtype = (_res.options & RES_USE_INET6) ? GETHOSTBYNAMEv6 : GETHOSTBYNAME; + reqtype = res_use_inet6 () ? GETHOSTBYNAMEv6 : GETHOSTBYNAME; - + return nscd_gethst_r (name, strlen (name) + 1, reqtype, resultbuf, - buffer, buflen, result, h_errnop); + buffer, buflen, result, h_errnop); diff --git a/nss/digits_dots.c b/nss/digits_dots.c index ee530c69610d5393..7a2b57bdebe03408 100644 --- a/nss/digits_dots.c @@ -180,32 +180,32 @@ index ee530c69610d5393..7a2b57bdebe03408 100644 #include #include "nsswitch.h" @@ -80,7 +80,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - break; - - default: + break; + + default: - af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET; + af = res_use_inet6 () ? AF_INET6 : AF_INET; - addr_size = af == AF_INET6 ? IN6ADDRSZ : INADDRSZ; - break; - } + addr_size = af == AF_INET6 ? IN6ADDRSZ : INADDRSZ; + break; + } @@ -167,7 +167,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - (*h_addr_ptrs)[0] = (char *) host_addr; - (*h_addr_ptrs)[1] = NULL; - resbuf->h_addr_list = *h_addr_ptrs; + (*h_addr_ptrs)[0] = (char *) host_addr; + (*h_addr_ptrs)[1] = NULL; + resbuf->h_addr_list = *h_addr_ptrs; - if (af == AF_INET && (_res.options & RES_USE_INET6)) + if (af == AF_INET && res_use_inet6 ()) - { - /* We need to change the IP v4 address into the - IP v6 address. */ + { + /* We need to change the IP v4 address into the + IP v6 address. */ @@ -211,7 +211,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - switch (af) - { - default: + switch (af) + { + default: - af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET; + af = res_use_inet6 () ? AF_INET6 : AF_INET; - if (af == AF_INET6) - { - addr_size = IN6ADDRSZ; + if (af == AF_INET6) + { + addr_size = IN6ADDRSZ; diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c index 6c06b89dc179fd9a..b25ebe5ed19bdded 100644 --- a/nss/nss_files/files-hosts.c @@ -216,12 +216,12 @@ index 6c06b89dc179fd9a..b25ebe5ed19bdded 100644 #include -#include +#include - - + + /* Get implementation for some internal functions. */ @@ -98,8 +98,8 @@ LINE_PARSER }) - + #define EXTRA_ARGS_VALUE \ - , ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), \ - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0) @@ -229,31 +229,31 @@ index 6c06b89dc179fd9a..b25ebe5ed19bdded 100644 + (res_use_inet6 () ? AI_V4MAPPED : 0) #include "files-XXX.c" #undef EXTRA_ARGS_VALUE - + @@ -133,7 +133,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result, { /* XXX Is using _res to determine whether we want to convert IPv4 addresses to IPv6 addresses really the right thing to do? */ - int flags = ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0); + int flags = (res_use_inet6 () ? AI_V4MAPPED : 0); - + /* Tell getent function that we have repositioned the file pointer. */ last_use = getby; @@ -358,7 +358,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result, - char *buffer, size_t buflen, int *errnop, - int *herrnop) + char *buffer, size_t buflen, int *errnop, + int *herrnop) { - int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET); + int af = (res_use_inet6 () ? AF_INET6 : AF_INET); - + return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen, - errnop, herrnop, NULL, NULL); + errnop, herrnop, NULL, NULL); diff --git a/resolv/README b/resolv/README index 416205da77a15564..1a70bbb1dc615ac9 100644 --- a/resolv/README +++ b/resolv/README @@ -84,11 +84,7 @@ code: - + * In Multi-threaded that manipulate the _res structure, calls to functions like `gethostbyname' in threads other than the "main" - thread won't be influenced by the those changes anymore. So if you @@ -262,7 +262,7 @@ index 416205da77a15564..1a70bbb1dc615ac9 100644 - _res structure will affect the thread in which you do so instead of - the "main" thread. + thread won't be influenced by the those changes anymore. - + We recommend to use the new thread-safe interfaces in new code, since the traditional interfaces have been deprecated by the BIND folks. diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c @@ -270,32 +270,32 @@ index 774d575dd1ce22af..7fc154db5d3130a3 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -82,7 +82,8 @@ - + #include "nsswitch.h" - + -/* Get implementation for some internal functions. */ +/* Get implementeation for some internal functions. */ +#include #include #include - + @@ -221,7 +222,7 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, /* If we are looking for an IPv6 address and mapping is enabled - by having the RES_USE_INET6 bit in _res.options set, we try - another lookup. */ + by having the RES_USE_INET6 bit in _res.options set, we try + another lookup. */ - if (af == AF_INET6 && (_res.options & RES_USE_INET6)) + if (af == AF_INET6 && res_use_inet6 ()) - n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer - ? MAXPACKET : 1024, &host_buffer.ptr, + n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, + host_buffer.buf != orig_host_buffer + ? MAXPACKET : 1024, &host_buffer.ptr, @@ -266,7 +267,7 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result, { enum nss_status status = NSS_STATUS_NOTFOUND; - + - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) status = _nss_dns_gethostbyname3_r (name, AF_INET6, result, buffer, - buflen, errnop, h_errnop, NULL, NULL); + buflen, errnop, h_errnop, NULL, NULL); if (status == NSS_STATUS_NOTFOUND) @@ -519,17 +520,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, memcpy (host_data->host_addr, addr, len); @@ -329,20 +329,20 @@ index 3daa44e273db5a41..6549e4ba5ee77f93 100644 #include #include @@ -582,7 +582,7 @@ p_option(u_long option) { - case RES_DNSRCH: return "dnsrch"; - case RES_INSECURE1: return "insecure1"; - case RES_INSECURE2: return "insecure2"; + case RES_DNSRCH: return "dnsrch"; + case RES_INSECURE1: return "insecure1"; + case RES_INSECURE2: return "insecure2"; - case RES_USE_INET6: return "inet6"; + case DEPRECATED_RES_USE_INET6: return "inet6"; - case RES_ROTATE: return "rotate"; - case RES_NOCHECKNAME: return "no-check-names"; - case RES_USEBSTRING: return "ip6-bytstring"; + case RES_ROTATE: return "rotate"; + case RES_NOCHECKNAME: return "no-check-names"; + case RES_USEBSTRING: return "ip6-bytstring"; diff --git a/resolv/res_init.c b/resolv/res_init.c index 2e3d0f746e855aff..0ed74e0520131418 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -71,7 +71,7 @@ static const char rcsid[] = "$BINDId: res_init.c,v 8.16 2000/05/09 07:10:12 vixi - + #include #include -#include @@ -351,14 +351,14 @@ index 2e3d0f746e855aff..0ed74e0520131418 100644 #include #include @@ -530,7 +530,7 @@ res_setoptions(res_state statp, const char *options, const char *source) { - unsigned long int flag; - } options[] = { + unsigned long int flag; + } options[] = { #define STRnLEN(str) str, sizeof (str) - 1 - { STRnLEN ("inet6"), 0, RES_USE_INET6 }, + { STRnLEN ("inet6"), 0, DEPRECATED_RES_USE_INET6 }, - { STRnLEN ("ip6-bytestring"), 0, RES_USEBSTRING }, - { STRnLEN ("no-ip6-dotint"), 0, RES_NOIP6DOTINT }, - { STRnLEN ("ip6-dotint"), 1, ~RES_NOIP6DOTINT }, + { STRnLEN ("ip6-bytestring"), 0, RES_USEBSTRING }, + { STRnLEN ("no-ip6-dotint"), 0, RES_NOIP6DOTINT }, + { STRnLEN ("ip6-dotint"), 1, ~RES_NOIP6DOTINT }, diff --git a/resolv/resolv-internal.h b/resolv/resolv-internal.h new file mode 100644 index 0000000000000000..269758c416544cb4 @@ -415,47 +415,47 @@ index a678d8d7e8b23d1d..7a6cf71c170ec42f 100644 #include @@ -222,7 +222,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, if (herrno == NETDB_INTERNAL) \ - { \ - __set_h_errno (herrno); \ + { \ + __set_h_errno (herrno); \ - _res.options |= old_res_options & RES_USE_INET6; \ + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; \ - result = -EAI_SYSTEM; \ - goto free_and_return; \ - } \ + result = -EAI_SYSTEM; \ + goto free_and_return; \ + } \ @@ -839,7 +839,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - addresses to IPv6 addresses. Currently this is decided - by setting the RES_USE_INET6 bit in _res.options. */ - old_res_options = _res.options; + addresses to IPv6 addresses. Currently this is decided + by setting the RES_USE_INET6 bit in _res.options. */ + old_res_options = _res.options; - _res.options &= ~RES_USE_INET6; + _res.options &= ~DEPRECATED_RES_USE_INET6; - - size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple); - malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen); + + size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple); + malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen); @@ -900,7 +900,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - 2 * tmpbuflen); - if (newp == NULL) - { + 2 * tmpbuflen); + if (newp == NULL) + { - _res.options |= old_res_options & RES_USE_INET6; + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; - result = -EAI_MEMORY; - goto free_and_return; - } + result = -EAI_MEMORY; + goto free_and_return; + } @@ -1021,7 +1021,8 @@ gaih_inet (const char *name, const struct gaih_service *service, - if (canonbuf == NULL) - { - _res.options + if (canonbuf == NULL) + { + _res.options - |= old_res_options & RES_USE_INET6; + |= old_res_options + & DEPRECATED_RES_USE_INET6; - result = -EAI_MEMORY; - goto free_and_return; - } + result = -EAI_MEMORY; + goto free_and_return; + } @@ -1082,7 +1083,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - nip = nip->next; - } - + nip = nip->next; + } + - _res.options |= old_res_options & RES_USE_INET6; + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; - - if (h_errno == NETDB_INTERNAL) - { + + if (h_errno == NETDB_INTERNAL) + { diff --git a/SOURCES/glibc-rh677316-alloc_buffer.patch b/SOURCES/glibc-rh677316-alloc_buffer.patch index 837f88c6..743598fb 100644 --- a/SOURCES/glibc-rh677316-alloc_buffer.patch +++ b/SOURCES/glibc-rh677316-alloc_buffer.patch @@ -390,13 +390,13 @@ index 63fc3291dcc4077a..db4b1f921d56da32 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -37,6 +37,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-dynarray \ - tst-dynarray-fail \ - tst-dynarray-at-fail \ + tst-dynarray \ + tst-dynarray-fail \ + tst-dynarray-at-fail \ + tst-alloc_buffer \ - + tests-static := \ - tst-interpose-static-nothread \ + tst-interpose-static-nothread \ @@ -55,6 +56,11 @@ routines = malloc morecore mcheck mtrace obstack \ dynarray_finalize \ dynarray_resize \ @@ -406,8 +406,8 @@ index 63fc3291dcc4077a..db4b1f921d56da32 100644 + alloc_buffer_copy_bytes \ + alloc_buffer_copy_string \ + alloc_buffer_create_failure \ - - + + install-lib := libmcheck.a diff --git a/malloc/Versions b/malloc/Versions index 16f9dab418a4e3f6..0b7b690bbbdd1c2c 100644 diff --git a/SOURCES/glibc-rh677316-check_mul_overflow_size_t.patch b/SOURCES/glibc-rh677316-check_mul_overflow_size_t.patch index 3edbb380..6d407f8f 100644 --- a/SOURCES/glibc-rh677316-check_mul_overflow_size_t.patch +++ b/SOURCES/glibc-rh677316-check_mul_overflow_size_t.patch @@ -13,7 +13,7 @@ index b830d3f58fe74ca3..6ffa091ba3292901 100644 @@ -28,5 +28,24 @@ void __malloc_fork_unlock_parent (void) internal_function attribute_hidden; /* Called in the child process after a fork. */ void __malloc_fork_unlock_child (void) internal_function attribute_hidden; - + +/* Set *RESULT to LEFT * RIGHT. Return true if the multiplication + overflowed. */ +static inline bool @@ -33,5 +33,5 @@ index b830d3f58fe74ca3..6ffa091ba3292901 100644 + return false; +#endif +} - + #endif /* _MALLOC_PRIVATE_H */ diff --git a/SOURCES/glibc-rh677316-dynarray.patch b/SOURCES/glibc-rh677316-dynarray.patch index cd3ee944..a1c17695 100644 --- a/SOURCES/glibc-rh677316-dynarray.patch +++ b/SOURCES/glibc-rh677316-dynarray.patch @@ -5,7 +5,7 @@ Author: Florian Weimer Date: Wed Sep 6 11:25:14 2017 +0200 __libc_dynarray_emplace_enlarge: Add missing else - + Before, arrays of small elements received a starting allocation size of 8, not 16. @@ -14,7 +14,7 @@ Author: Florian Weimer Date: Wed Aug 30 20:10:56 2017 +0200 dynarray: Set errno on overflow-induced allocation failure - + This allows the caller to return directly on such an error, with an appropriate errno value. @@ -38,7 +38,7 @@ Author: Florian Weimer Date: Fri Jun 9 14:08:57 2017 +0200 malloc: Remove tst-dynarray, tst-dynarray-fail from test-srcs - + They are already covered through the tests variable. commit 91b6eb1140eda6bab324821ee3785e5d0ca155b8 @@ -63,19 +63,19 @@ index 38aa9e0993d4880c..63fc3291dcc4077a 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -34,6 +34,9 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-interpose-static-nothread \ - tst-interpose-static-thread \ - tst-scratch_buffer \ + tst-interpose-static-nothread \ + tst-interpose-static-thread \ + tst-scratch_buffer \ + tst-dynarray \ + tst-dynarray-fail \ + tst-dynarray-at-fail \ - + tests-static := \ - tst-interpose-static-nothread \ + tst-interpose-static-nothread \ @@ -41,10 +44,17 @@ tests-static := \ - + test-srcs = tst-mtrace - + +generated += tst-dynarray-mem tst-dynarray-fail-mem + routines = malloc morecore mcheck mtrace obstack \ @@ -87,8 +87,8 @@ index 38aa9e0993d4880c..63fc3291dcc4077a 100644 + dynarray_finalize \ + dynarray_resize \ + dynarray_resize_clear \ - - + + install-lib := libmcheck.a @@ -143,8 +153,7 @@ ifeq ($(run-built-tests),yes) ifeq (yes,$(build-shared)) diff --git a/SOURCES/glibc-rh677316-fgets_unlocked.patch b/SOURCES/glibc-rh677316-fgets_unlocked.patch index 802d9554..b34f1e6e 100644 --- a/SOURCES/glibc-rh677316-fgets_unlocked.patch +++ b/SOURCES/glibc-rh677316-fgets_unlocked.patch @@ -27,7 +27,7 @@ index 984cb86103b13c0f..3621f1c00ec9ea4d 100644 +++ b/libio/iofgets.c @@ -73,6 +73,8 @@ _IO_fgets (buf, n, fp) weak_alias (_IO_fgets, fgets) - + # ifndef _IO_MTSAFE_IO +strong_alias (_IO_fgets, __fgets_unlocked) +libc_hidden_def (__fgets_unlocked) @@ -40,7 +40,7 @@ index e524943a54ba107a..e2cf6373b8178097 100644 +++ b/libio/iofgets_u.c @@ -28,7 +28,7 @@ #include - + char * -fgets_unlocked (buf, n, fp) +__fgets_unlocked (buf, n, fp) @@ -60,24 +60,24 @@ index 22285f39f33bf26c..9082b1a7ab29a9f9 100644 --- a/sysdeps/unix/sysv/linux/getsysstats.c +++ b/sysdeps/unix/sysv/linux/getsysstats.c @@ -304,7 +304,7 @@ phys_pages_info (const char *format) - string "processor". We don't have to fear extremely long - lines since the kernel will not generate them. 8192 - bytes are really enough. */ + string "processor". We don't have to fear extremely long + lines since the kernel will not generate them. 8192 + bytes are really enough. */ - while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL) + while (__fgets_unlocked (buffer, sizeof buffer, fp) != NULL) - if (sscanf (buffer, format, &result) == 1) - { - result /= (__getpagesize () / 1024); + if (sscanf (buffer, format, &result) == 1) + { + result /= (__getpagesize () / 1024); diff --git a/sysdeps/unix/sysv/linux/sparc/getsysstats.c b/sysdeps/unix/sysv/linux/sparc/getsysstats.c index 57d9b95223c6ab33..ceb8a2ba1f9cc9d5 100644 --- a/sysdeps/unix/sysv/linux/sparc/getsysstats.c +++ b/sysdeps/unix/sysv/linux/sparc/getsysstats.c @@ -46,7 +46,7 @@ - probed cpus. We don't have to fear extremely long lines since \ - the kernel will not generate them. 8192 bytes are really \ - enough. */ \ + probed cpus. We don't have to fear extremely long lines since \ + the kernel will not generate them. 8192 bytes are really \ + enough. */ \ - while (fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \ + while (__fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \ - if (sscanf (buffer, "ncpus probed : %d", &(RESULT)) == 1) \ - break; \ + if (sscanf (buffer, "ncpus probed : %d", &(RESULT)) == 1) \ + break; \ } \ diff --git a/SOURCES/glibc-rh677316-h_errno.patch b/SOURCES/glibc-rh677316-h_errno.patch index a47adf84..f7fc8a6b 100644 --- a/SOURCES/glibc-rh677316-h_errno.patch +++ b/SOURCES/glibc-rh677316-h_errno.patch @@ -29,7 +29,7 @@ index 1802d0e00563839a..0cd84445190728b3 100644 @@ -24,7 +24,7 @@ /* We need to have the error status variable of the resolver accessible in the libc. */ - + -__thread int h_errno; -extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno"))) +__thread int __h_errno; @@ -41,13 +41,13 @@ index c0488e4f6754873f..5056e3df88211123 100644 --- a/nptl/herrno.c +++ b/nptl/herrno.c @@ -23,12 +23,12 @@ - + /* We need to have the error status variable of the resolver accessible in the libc. */ -extern __thread int h_errno; +extern __thread int __h_errno; - - + + /* When threaded, h_errno may be a per-thread variable. */ int * __h_errno_location (void) @@ -62,9 +62,9 @@ index 93faf1e2f5faac79..152ef3f68f9a8b48 100644 @@ -26,7 +26,7 @@ libc { GLIBC_PRIVATE { __gai_sigqueue; - + - h_errno; __resp; + __h_errno; __resp; - + __res_maybe_init; __res_iclose; } diff --git a/SOURCES/glibc-rh677316-hesiod.patch b/SOURCES/glibc-rh677316-hesiod.patch index c8d1a32a..7deaba84 100644 --- a/SOURCES/glibc-rh677316-hesiod.patch +++ b/SOURCES/glibc-rh677316-hesiod.patch @@ -23,23 +23,23 @@ index 5aeb86eaf8971535..3c967441e17240b4 100644 -# Copyright (C) 1997, 1998, 2000, 2001, 2012 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 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 @@ -20,13 +20,15 @@ # subdir := hesiod - + +include ../Makeconfig + extra-libs := libnss_hesiod extra-libs-others = $(extra-libs) - + subdir-dirs = nss_hesiod vpath %.c nss_hesiod - + -libnss_hesiod-routines := hesiod hesiod-grp hesiod-init hesiod-proto \ +libnss_hesiod-routines := hesiod hesiod-grp hesiod-proto \ - hesiod-pwd hesiod-service + hesiod-pwd hesiod-service # Build only shared library libnss_hesiod-inhibit-o = $(filter-out .os,$(object-suffixes)) diff --git a/hesiod/hesiod.c b/hesiod/hesiod.c @@ -66,19 +66,19 @@ index 657dabebc144db7d..9b54d1cb6b18f0e5 100644 + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ - + /* * Copyright (c) 1996,1999 by Internet Software Consortium. @@ -46,24 +59,14 @@ static const char rcsid[] = "$BINDId: hesiod.c,v 1.21 2000/02/28 14:51:08 vixie - + #include "hesiod.h" #include "hesiod_p.h" -#undef DEF_RHS - + #define _PATH_HESIOD_CONF "/etc/hesiod.conf" - + /* Forward */ - + -int hesiod_init(void **context); -void hesiod_end(void *context); -char * hesiod_to_bind(void *context, const char *name, @@ -89,23 +89,23 @@ index 657dabebc144db7d..9b54d1cb6b18f0e5 100644 - static int parse_config_file(struct hesiod_p *ctx, const char *filename); static char ** get_txt_records(struct hesiod_p *ctx, int class, - const char *name); + const char *name); -static int init(struct hesiod_p *ctx); - + /* Public */ - + @@ -82,7 +85,6 @@ hesiod_init(void **context) { - - ctx->LHS = NULL; - ctx->RHS = NULL; + + ctx->LHS = NULL; + ctx->RHS = NULL; - ctx->res = NULL; - /* Set default query classes. */ - ctx->classes[0] = C_IN; - ctx->classes[1] = C_HS; + /* Set default query classes. */ + ctx->classes[0] = C_IN; + ctx->classes[1] = C_HS; @@ -91,19 +93,7 @@ hesiod_init(void **context) { - if (!configname) - configname = _PATH_HESIOD_CONF; - if (parse_config_file(ctx, configname) < 0) { + if (!configname) + configname = _PATH_HESIOD_CONF; + if (parse_config_file(ctx, configname) < 0) { -#ifdef DEF_RHS - /* - * Use compiled in defaults. @@ -117,75 +117,75 @@ index 657dabebc144db7d..9b54d1cb6b18f0e5 100644 - strcpy(ctx->LHS, DEF_LHS); - strcpy(ctx->RHS, DEF_RHS); -#else - goto cleanup; + goto cleanup; -#endif - } - /* - * The default RHS can be overridden by an environment + } + /* + * The default RHS can be overridden by an environment @@ -131,11 +121,6 @@ hesiod_init(void **context) { - goto cleanup; - } - + goto cleanup; + } + -#if 0 - if (res_ninit(ctx->res) < 0) - goto cleanup; -#endif - - *context = ctx; - return (0); - + *context = ctx; + return (0); + @@ -152,12 +137,8 @@ hesiod_end(void *context) { - struct hesiod_p *ctx = (struct hesiod_p *) context; - int save_errno = errno; - + struct hesiod_p *ctx = (struct hesiod_p *) context; + int save_errno = errno; + - if (ctx->res) - res_nclose(ctx->res); - free(ctx->RHS); - free(ctx->LHS); + free(ctx->RHS); + free(ctx->LHS); - if (ctx->res && ctx->free_res) - (*ctx->free_res)(ctx->res); - free(ctx); - __set_errno(save_errno); + free(ctx); + __set_errno(save_errno); } @@ -232,10 +213,6 @@ hesiod_resolve(void *context, const char *name, const char *type) { - - if (bindname == NULL) - return (NULL); + + if (bindname == NULL) + return (NULL); - if (init(ctx) == -1) { - free(bindname); - return (NULL); - } - - retvec = get_txt_records(ctx, ctx->classes[0], bindname); - + + retvec = get_txt_records(ctx, ctx->classes[0], bindname); + @@ -365,13 +342,13 @@ get_txt_records(struct hesiod_p *ctx, int class, const char *name) { - /* - * Construct the query and send it. - */ + /* + * Construct the query and send it. + */ - n = res_nmkquery(ctx->res, QUERY, name, class, T_TXT, NULL, 0, + n = res_mkquery(QUERY, name, class, T_TXT, NULL, 0, - NULL, qbuf, MAX_HESRESP); - if (n < 0) { - __set_errno(EMSGSIZE); - return (NULL); - } + NULL, qbuf, MAX_HESRESP); + if (n < 0) { + __set_errno(EMSGSIZE); + return (NULL); + } - n = res_nsend(ctx->res, qbuf, n, abuf, MAX_HESRESP); + n = res_send(qbuf, n, abuf, MAX_HESRESP); - if (n < 0) { - __set_errno(ECONNREFUSED); - return (NULL); + if (n < 0) { + __set_errno(ECONNREFUSED); + return (NULL); @@ -421,7 +398,7 @@ get_txt_records(struct hesiod_p *ctx, int class, const char *name) { - cp += INT16SZ + INT32SZ; /* skip the ttl, too */ - rr.dlen = ns_get16(cp); - cp += INT16SZ; + cp += INT16SZ + INT32SZ; /* skip the ttl, too */ + rr.dlen = ns_get16(cp); + cp += INT16SZ; - if (cp + rr.dlen > eom) { + if (rr.dlen == 0 || cp + rr.dlen > eom) { - __set_errno(EMSGSIZE); - goto cleanup; - } + __set_errno(EMSGSIZE); + goto cleanup; + } @@ -464,44 +441,3 @@ get_txt_records(struct hesiod_p *ctx, int class, const char *name) { - free(list); - return (NULL); + free(list); + return (NULL); } - -struct __res_state * @@ -256,14 +256,14 @@ index 82fce30764e15071..2cb640a7df668cab 100644 @@ -19,22 +36,15 @@ * This file is primarily maintained by and . */ - + -/* - * $BINDId: hesiod.h,v 1.7 1999/01/08 19:22:45 vixie Exp $ - */ - #ifndef _HESIOD_H_INCLUDED #define _HESIOD_H_INCLUDED - + -int hesiod_init (void **context); -void hesiod_end (void *context); +int hesiod_init (void **context) attribute_hidden; @@ -279,7 +279,7 @@ index 82fce30764e15071..2cb640a7df668cab 100644 - void (*)(void *)); + const char *type) attribute_hidden; +void hesiod_free_list (void *context, char **list) attribute_hidden; - + #endif /*_HESIOD_H_INCLUDED*/ diff --git a/hesiod/hesiod_p.h b/hesiod/hesiod_p.h index 5010d71bc91879c4..7ed70158d9ffc5cc 100644 @@ -308,7 +308,7 @@ index 5010d71bc91879c4..7ed70158d9ffc5cc 100644 * @@ -20,27 +37,17 @@ */ - + /* - * $BINDId: hesiod_p.h,v 1.9 1999/01/08 19:24:39 vixie Exp $ - */ @@ -316,24 +316,24 @@ index 5010d71bc91879c4..7ed70158d9ffc5cc 100644 -/* * hesiod_p.h -- private definitions for the hesiod library */ - + #ifndef _HESIOD_P_H_INCLUDED #define _HESIOD_P_H_INCLUDED - + -#define DEF_RHS ".Athena.MIT.EDU" /* Defaults if HESIOD_CONF */ #define DEF_LHS ".ns" /* file is not */ - /* present. */ + /* present. */ struct hesiod_p { - char * LHS; /* normally ".ns" */ - char * RHS; /* AKA the default hesiod domain */ + char * LHS; /* normally ".ns" */ + char * RHS; /* AKA the default hesiod domain */ - struct __res_state * res; /* resolver context */ - void (*free_res)(void *); - void (*res_set)(struct hesiod_p *, struct __res_state *, - void (*)(void *)); - struct __res_state * (*res_get)(struct hesiod_p *); - int classes[2]; /* The class search order. */ + int classes[2]; /* The class search order. */ }; - + diff --git a/hesiod/nss_hesiod/hesiod-grp.c b/hesiod/nss_hesiod/hesiod-grp.c index 5c14554ce9fd647e..a04f5309453047e2 100644 --- a/hesiod/nss_hesiod/hesiod-grp.c @@ -343,11 +343,11 @@ index 5c14554ce9fd647e..a04f5309453047e2 100644 +/* Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. - + @@ -26,8 +26,6 @@ #include #include - + -#include "nss_hesiod.h" - /* Get the declaration of the parser function. */ @@ -356,27 +356,27 @@ index 5c14554ce9fd647e..a04f5309453047e2 100644 @@ -58,8 +56,7 @@ lookup (const char *name, const char *type, struct group *grp, size_t len; int olderr = errno; - + - context = _nss_hesiod_init (); - if (context == NULL) + if (hesiod_init (&context) < 0) return NSS_STATUS_UNAVAIL; - + list = hesiod_resolve (context, name, type); @@ -179,8 +176,7 @@ _nss_hesiod_initgroups_dyn (const char *user, gid_t group, long int *start, gid_t *groups = *groupsp; int save_errno; - + - context = _nss_hesiod_init (); - if (context == NULL) + if (hesiod_init (&context) < 0) return NSS_STATUS_UNAVAIL; - + list = hesiod_resolve (context, user, "grplist"); @@ -191,33 +187,6 @@ _nss_hesiod_initgroups_dyn (const char *user, gid_t group, long int *start, return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL; } - + - if (!internal_gid_in_list (groups, group, *start)) - { - if (__builtin_expect (*start == *size, 0)) @@ -405,17 +405,17 @@ index 5c14554ce9fd647e..a04f5309453047e2 100644 - } - save_errno = errno; - + p = *list; @@ -254,7 +223,7 @@ _nss_hesiod_initgroups_dyn (const char *user, gid_t group, long int *start, - if (status == NSS_STATUS_SUCCESS - && !internal_gid_in_list (groups, group, *start)) - { + if (status == NSS_STATUS_SUCCESS + && !internal_gid_in_list (groups, group, *start)) + { - if (__builtin_expect (*start == *size, 0)) + if (__glibc_unlikely (*start == *size)) - { - /* Need a bigger buffer. */ - gid_t *newgroups; + { + /* Need a bigger buffer. */ + gid_t *newgroups; diff --git a/hesiod/nss_hesiod/hesiod-init.c b/hesiod/nss_hesiod/hesiod-init.c deleted file mode 100644 index 964987d0755425b5..0000000000000000 @@ -469,11 +469,11 @@ index 7ea38bc24fbff3ca..6af32aad35edfc0a 100644 +/* Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. - + @@ -25,8 +25,6 @@ #include #include - + -#include "nss_hesiod.h" - /* Declare a parser for Hesiod protocol entries. Although the format @@ -482,12 +482,12 @@ index 7ea38bc24fbff3ca..6af32aad35edfc0a 100644 @@ -68,8 +66,7 @@ lookup (const char *name, const char *type, struct protoent *proto, int found; int olderr = errno; - + - context = _nss_hesiod_init (); - if (context == NULL) + if (hesiod_init (&context) < 0) return NSS_STATUS_UNAVAIL; - + list = hesiod_resolve (context, name, type); diff --git a/hesiod/nss_hesiod/hesiod-pwd.c b/hesiod/nss_hesiod/hesiod-pwd.c index 929cbce80e238a67..8309af245d3f0268 100644 @@ -498,11 +498,11 @@ index 929cbce80e238a67..8309af245d3f0268 100644 +/* Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. - + @@ -24,8 +24,6 @@ #include #include - + -#include "nss_hesiod.h" - /* Get the declaration of the parser function. */ @@ -511,12 +511,12 @@ index 929cbce80e238a67..8309af245d3f0268 100644 @@ -56,8 +54,7 @@ lookup (const char *name, const char *type, struct passwd *pwd, size_t len; int olderr = errno; - + - context = _nss_hesiod_init (); - if (context == NULL) + if (hesiod_init (&context) < 0) return NSS_STATUS_UNAVAIL; - + list = hesiod_resolve (context, name, type); diff --git a/hesiod/nss_hesiod/hesiod-service.c b/hesiod/nss_hesiod/hesiod-service.c index 28bd31a70f31c89c..1942188517d94508 100644 @@ -527,25 +527,25 @@ index 28bd31a70f31c89c..1942188517d94508 100644 +/* Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. - + @@ -25,8 +25,6 @@ #include #include - + -#include "nss_hesiod.h" - /* Hesiod uses a format for service entries that differs from the traditional format. We therefore declare our own parser. */ - + @@ -69,8 +67,7 @@ lookup (const char *name, const char *type, const char *protocol, int found; int olderr = errno; - + - context = _nss_hesiod_init (); - if (context == NULL) + if (hesiod_init (&context) < 0) return NSS_STATUS_UNAVAIL; - + list = hesiod_resolve (context, name, type); diff --git a/hesiod/nss_hesiod/nss_hesiod.h b/hesiod/nss_hesiod/nss_hesiod.h deleted file mode 100644 diff --git a/SOURCES/glibc-rh677316-in6addr_any.patch b/SOURCES/glibc-rh677316-in6addr_any.patch index 8b6ccecf..47880be6 100644 --- a/SOURCES/glibc-rh677316-in6addr_any.patch +++ b/SOURCES/glibc-rh677316-in6addr_any.patch @@ -23,7 +23,7 @@ index 6fb5c86de999ba82..5e377469e782a5b1 100644 +extern __typeof (in6addr_any) __in6addr_any; +libc_hidden_proto (__in6addr_any) #endif - + #endif diff --git a/inet/gethstbyad_r.c b/inet/gethstbyad_r.c index d8e4988a312a0799..5ae854b4f91e72ad 100644 @@ -35,7 +35,7 @@ index d8e4988a312a0799..5ae854b4f91e72ad 100644 if (len == sizeof (struct in6_addr) \ - && __builtin_expect (memcmp (&in6addr_any, addr, \ + && __builtin_expect (memcmp (&__in6addr_any, addr, \ - sizeof (struct in6_addr)), 1) == 0) \ + sizeof (struct in6_addr)), 1) == 0) \ { \ *h_errnop = HOST_NOT_FOUND; \ diff --git a/inet/in6_addr.c b/inet/in6_addr.c @@ -43,9 +43,9 @@ index 558b375e46dc62dc..03fbb85803e3d0b7 100644 --- a/inet/in6_addr.c +++ b/inet/in6_addr.c @@ -18,9 +18,13 @@ - + #include - + -const struct in6_addr in6addr_any = +const struct in6_addr __in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; diff --git a/SOURCES/glibc-rh677316-inet_pton-zeros.patch b/SOURCES/glibc-rh677316-inet_pton-zeros.patch index 382b6bed..c56dfb74 100644 --- a/SOURCES/glibc-rh677316-inet_pton-zeros.patch +++ b/SOURCES/glibc-rh677316-inet_pton-zeros.patch @@ -5,7 +5,7 @@ Author: Florian Weimer Date: Fri Jun 23 22:51:00 2017 +0200 inet_pton: Reject IPv6 addresses with many leading zeros [BZ #16637] - + 2001:db8:00001::f is not a valid IPv6 address according to RFC 2373. We do not want this behavioral change in Red Hat Enterprise Linux 7. @@ -23,11 +23,11 @@ index 16ee33e0c0dfb015..b95da47c17ef8afc 100644 - size_t xdigits_seen; /* Number of hex digits since colon. */ + int ch, saw_xdigit; unsigned int val; - + tp = memset (tmp, '\0', NS_IN6ADDRSZ); @@ -163,7 +162,7 @@ inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) } - + curtok = src; - xdigits_seen = 0; + saw_xdigit = 0; @@ -37,49 +37,49 @@ index 16ee33e0c0dfb015..b95da47c17ef8afc 100644 @@ -171,19 +170,17 @@ inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) int digit = hex_digit_value (ch); if (digit >= 0) - { + { - if (xdigits_seen == 4) - return 0; - val <<= 4; - val |= digit; - if (val > 0xffff) - return 0; + val <<= 4; + val |= digit; + if (val > 0xffff) + return 0; - ++xdigits_seen; + saw_xdigit = 1; - continue; - } + continue; + } if (ch == ':') - { - curtok = src; + { + curtok = src; - if (xdigits_seen == 0) + if (!saw_xdigit) - { - if (colonp) - return 0; + { + if (colonp) + return 0; @@ -196,7 +193,7 @@ inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) - return 0; - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; + return 0; + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; - xdigits_seen = 0; + saw_xdigit = 0; - val = 0; - continue; - } + val = 0; + continue; + } @@ -204,12 +201,12 @@ inet_pton6 (const char *src, const char *src_endp, unsigned char *dst) && inet_pton4 (curtok, src_endp, tp) > 0) - { - tp += NS_INADDRSZ; + { + tp += NS_INADDRSZ; - xdigits_seen = 0; + saw_xdigit = 0; - break; /* '\0' was seen by inet_pton4. */ - } + break; /* '\0' was seen by inet_pton4. */ + } return 0; } - if (xdigits_seen > 0) + if (saw_xdigit) { if (tp + NS_INT16SZ > endp) - return 0; + return 0; diff --git a/resolv/tst-inet_pton.c b/resolv/tst-inet_pton.c index 4bb9f8119378b467..7fffb24cdf9eb1f4 100644 --- a/resolv/tst-inet_pton.c diff --git a/SOURCES/glibc-rh677316-inet_pton.patch b/SOURCES/glibc-rh677316-inet_pton.patch index 646dc37d..150ce20f 100644 --- a/SOURCES/glibc-rh677316-inet_pton.patch +++ b/SOURCES/glibc-rh677316-inet_pton.patch @@ -39,7 +39,7 @@ index 1d862260c7e83977..6c4cbc96c3733a01 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -4,9 +4,13 @@ - + #ifndef _ISOMAC libc_hidden_proto (if_nametoindex) +extern __typeof (if_nametoindex) __if_nametoindex; @@ -50,31 +50,31 @@ index 1d862260c7e83977..6c4cbc96c3733a01 100644 +extern __typeof (if_freenameindex) __if_freenameindex; +libc_hidden_proto (__if_freenameindex) #endif - + #endif diff --git a/inet/Makefile b/inet/Makefile index 768df21b92534a31..4abf2ddf6dfff327 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -45,7 +45,7 @@ routines := htonl htons \ - in6_addr getnameinfo if_index ifaddrs inet6_option \ - getipv4sourcefilter setipv4sourcefilter \ - getsourcefilter setsourcefilter inet6_opt inet6_rth \ + in6_addr getnameinfo if_index ifaddrs inet6_option \ + getipv4sourcefilter setipv4sourcefilter \ + getsourcefilter setsourcefilter inet6_opt inet6_rth \ - deadline + inet6_scopeid_pton deadline - + aux := check_pf check_native ifreq - + @@ -57,6 +57,10 @@ tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \ # internal functions. tests-static += tst-deadline - + +# tst-inet6_scopeid_pton also needs internal functions but does not +# need to be linked statically. +tests += tst-inet6_scopeid_pton + include ../Rules - + ifeq ($(have-thread-library),yes) diff --git a/inet/Versions b/inet/Versions index 06507199a92b3c51..157559c44442259e 100644 @@ -97,11 +97,11 @@ index 3d706766be62b91b..4604e0a35b890471 100644 -/* Copyright (C) 1997,98,99,2000,02 Free Software Foundation, Inc. +/* Copyright (C) 1997-2017 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 @@ -20,44 +20,41 @@ #include - + unsigned int -if_nametoindex (const char *ifname) +__if_nametoindex (const char *ifname) @@ -114,7 +114,7 @@ index 3d706766be62b91b..4604e0a35b890471 100644 +weak_alias (__if_nametoindex, if_nametoindex) +libc_hidden_weak (if_nametoindex) stub_warning (if_nametoindex) - + char * -if_indextoname (unsigned int ifindex, char *ifname) +__if_indextoname (unsigned int ifindex, char *ifname) @@ -126,7 +126,7 @@ index 3d706766be62b91b..4604e0a35b890471 100644 +weak_alias (__if_indextoname, if_indextoname) +libc_hidden_weak (if_indextoname) stub_warning (if_indextoname) - + void -if_freenameindex (struct if_nameindex *ifn) +__if_freenameindex (struct if_nameindex *ifn) @@ -136,7 +136,7 @@ index 3d706766be62b91b..4604e0a35b890471 100644 +weak_alias (__if_freenameindex, if_freenameindex) +libc_hidden_weak (if_freenameindex) stub_warning (if_freenameindex) - + struct if_nameindex * -if_nameindex (void) +__if_nameindex (void) @@ -235,7 +235,7 @@ index d8d92da768b2ede0..88faef74cf50b722 100644 @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ @@ -251,11 +251,11 @@ index d8d92da768b2ede0..88faef74cf50b722 100644 - in_addr_t net, host; +__inet_makeaddr (in_addr_t net, in_addr_t host) { - struct in_addr in; - + struct in_addr in; + @@ -56,4 +51,5 @@ inet_makeaddr(net, host) - in.s_addr = htonl(in.s_addr); - return in; + in.s_addr = htonl(in.s_addr); + return in; } -libc_hidden_def (inet_makeaddr) +libc_hidden_def (__inet_makeaddr) @@ -267,18 +267,18 @@ index 58349f54ea126698..6c666752493811be 100644 @@ -19,10 +19,15 @@ #ifndef _NET_INTERNAL_H #define _NET_INTERNAL_H 1 - + +#include #include #include #include - + +int __inet6_scopeid_pton (const struct in6_addr *address, + const char *scope, uint32_t *result); +libc_hidden_proto (__inet6_scopeid_pton) + /* Deadline handling for enforcing timeouts. - + Code should call __deadline_current_time to obtain the current time diff --git a/inet/tst-inet6_scopeid_pton.c b/inet/tst-inet6_scopeid_pton.c new file mode 100644 @@ -522,12 +522,12 @@ index a86646d4ef61b77d..3f525bcc75ee83ae 100644 +++ b/resolv/Makefile @@ -29,7 +29,7 @@ headers := resolv.h \ routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \ - res_hconf res_libc res-state - + res_hconf res_libc res-state + -tests = tst-aton tst-leaks tst-inet_ntop +tests = tst-aton tst-leaks tst-inet_ntop tst-inet_pton xtests = tst-leaks2 - + generate := mtrace-tst-leaks tst-leaks.mtrace tst-leaks2.mtrace diff --git a/resolv/Versions b/resolv/Versions index 152ef3f68f9a8b48..24b07ef770ed3915 100644 @@ -535,12 +535,12 @@ index 152ef3f68f9a8b48..24b07ef770ed3915 100644 +++ b/resolv/Versions @@ -29,6 +29,7 @@ libc { __h_errno; __resp; - + __res_maybe_init; __res_iclose; + __inet_pton_length; } } - + diff --git a/resolv/inet_pton.c b/resolv/inet_pton.c index c507013e4ea9a90b..16ee33e0c0dfb015 100644 --- a/resolv/inet_pton.c @@ -569,7 +569,7 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 @@ -15,207 +32,203 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: inet_pton.c,v 1.7 1999/10/13 16:39:28 vixie Exp $"; -#endif /* LIBC_SCCS and not lint */ @@ -588,14 +588,14 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 +#include +#include +#include - + -/* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. - */ +static int inet_pton4 (const char *src, const char *src_end, u_char *dst); +static int inet_pton6 (const char *src, const char *src_end, u_char *dst); - + -static int inet_pton4 (const char *src, u_char *dst) internal_function; -static int inet_pton6 (const char *src, u_char *dst) internal_function; - @@ -749,7 +749,7 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 + memcpy (dst, tmp, NS_INADDRSZ); + return 1; } - + -/* int - * inet_pton6(src, dst) - * convert presentation level address to network order binary form. @@ -878,7 +878,7 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 + return 0; + ++xdigits_seen; + continue; - } + } - if (saw_xdigit) { - if (tp + NS_INT16SZ > endp) - return (0); @@ -903,7 +903,7 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 + xdigits_seen = 0; + val = 0; + continue; - } + } - if (colonp != NULL) { - /* - * Since some memmove()'s erroneously fail to handle @@ -925,7 +925,7 @@ index c507013e4ea9a90b..16ee33e0c0dfb015 100644 + tp += NS_INADDRSZ; + xdigits_seen = 0; + break; /* '\0' was seen by inet_pton4. */ - } + } - if (tp != endp) - return (0); - memcpy(dst, tmp, NS_IN6ADDRSZ); @@ -962,7 +962,7 @@ index 269758c416544cb4..a9f5659dbbacb477 100644 @@ -32,4 +32,13 @@ res_use_inet6 (void) return _res.options & DEPRECATED_RES_USE_INET6; } - + +/* Convert from presentation format (which usually means ASCII + printable) to network format (which is usually some kind of binary + format). The input is in the range [SRC, SRC + SRCLEN). The @@ -1524,7 +1524,7 @@ index cf336839259b24b6..8ba5eae7818b49cd 100644 -/* Copyright (C) 1997-2012 Free Software Foundation, Inc. +/* Copyright (C) 1997-2017 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 @@ -24,15 +24,14 @@ #include @@ -1534,10 +1534,10 @@ index cf336839259b24b6..8ba5eae7818b49cd 100644 +#include #include -#include - + #include "netlinkaccess.h" - - + + unsigned int -if_nametoindex (const char *ifname) +__if_nametoindex (const char *ifname) @@ -1552,8 +1552,8 @@ index cf336839259b24b6..8ba5eae7818b49cd 100644 +libc_hidden_def (__if_nametoindex) +weak_alias (__if_nametoindex, if_nametoindex) +libc_hidden_weak (if_nametoindex) - - + + void -if_freenameindex (struct if_nameindex *ifn) +__if_freenameindex (struct if_nameindex *ifn) @@ -1568,21 +1568,21 @@ index cf336839259b24b6..8ba5eae7818b49cd 100644 +libc_hidden_def (__if_freenameindex) +weak_alias (__if_freenameindex, if_freenameindex) +libc_hidden_weak (if_freenameindex) - - + + static struct if_nameindex * @@ -163,7 +166,7 @@ if_nameindex_netlink (void) - if (idx[nifs].if_name == NULL) - { - idx[nifs].if_index = 0; + if (idx[nifs].if_name == NULL) + { + idx[nifs].if_index = 0; - if_freenameindex (idx); + __if_freenameindex (idx); - idx = NULL; - goto nomem; - } + idx = NULL; + goto nomem; + } @@ -190,7 +193,7 @@ if_nameindex_netlink (void) - - + + struct if_nameindex * -if_nameindex (void) +__if_nameindex (void) @@ -1596,8 +1596,8 @@ index cf336839259b24b6..8ba5eae7818b49cd 100644 -libc_hidden_def (if_nameindex) +weak_alias (__if_nameindex, if_nameindex) +libc_hidden_weak (if_nameindex) - - + + char * -if_indextoname (unsigned int ifindex, char *ifname) +__if_indextoname (unsigned int ifindex, char *ifname) diff --git a/SOURCES/glibc-rh677316-legacy.patch b/SOURCES/glibc-rh677316-legacy.patch index 1d807c2e..7c094d3a 100644 --- a/SOURCES/glibc-rh677316-legacy.patch +++ b/SOURCES/glibc-rh677316-legacy.patch @@ -7,28 +7,28 @@ index 919b86e2b37dc150..e175229913b5f644 100644 --- a/resolv/res_debug.c +++ b/resolv/res_debug.c @@ -597,7 +597,9 @@ p_option(u_long option) { - switch (option) { - case RES_INIT: return "init"; - case RES_DEBUG: return "debug"; + switch (option) { + case RES_INIT: return "init"; + case RES_DEBUG: return "debug"; - case RES_USEVC: return "use-vc"; + case RES_AAONLY: return "aaonly(unimpl)"; + case RES_USEVC: return "usevc"; + case RES_PRIMARY: return "primry(unimpl)"; - case RES_IGNTC: return "igntc"; - case RES_RECURSE: return "recurs"; - case RES_DEFNAMES: return "defnam"; + case RES_IGNTC: return "igntc"; + case RES_RECURSE: return "recurs"; + case RES_DEFNAMES: return "defnam"; @@ -608,6 +610,11 @@ p_option(u_long option) { - case RES_NOALIASES: return "noaliases"; - case DEPRECATED_RES_USE_INET6: return "inet6"; - case RES_ROTATE: return "rotate"; + case RES_NOALIASES: return "noaliases"; + case DEPRECATED_RES_USE_INET6: return "inet6"; + case RES_ROTATE: return "rotate"; + case RES_NOCHECKNAME: return "no-check-names"; + case RES_KEEPTSIG: return "keeptsig(unimpl)"; + case RES_BLAST: return "blast"; + case RES_USEBSTRING: return "ip6-bytstring"; + case RES_NOIP6DOTINT: return "no-ip6-dotint"; - case RES_USE_EDNS0: return "edns0"; - case RES_SNGLKUP: return "single-request"; - case RES_SNGLKUPREOP: return "single-request-reopen"; + case RES_USE_EDNS0: return "edns0"; + case RES_SNGLKUP: return "single-request"; + case RES_SNGLKUPREOP: return "single-request-reopen"; diff --git a/resolv/res_init.c b/resolv/res_init.c index 4e1f9fe8dea93e8a..c29bc4e9b99b6bee 100644 --- a/resolv/res_init.c diff --git a/SOURCES/glibc-rh677316-mtrace.patch b/SOURCES/glibc-rh677316-mtrace.patch index c5bffed5..5ca9c5e3 100644 --- a/SOURCES/glibc-rh677316-mtrace.patch +++ b/SOURCES/glibc-rh677316-mtrace.patch @@ -9,11 +9,11 @@ index adf61c73737160fb..c48e227e9fee8521 100644 --- a/malloc/mtrace.pl +++ b/malloc/mtrace.pl @@ -167,7 +167,7 @@ while () { - printf ("+ %#0@XXX@x Alloc %d duplicate: %s %s\n", - hex($allocaddr), $nr, &location($addrwas{$allocaddr}), - $where); + printf ("+ %#0@XXX@x Alloc %d duplicate: %s %s\n", + hex($allocaddr), $nr, &location($addrwas{$allocaddr}), + $where); - } else { + } elsif ($allocaddr =~ /^0x/) { - $allocated{$allocaddr}=$howmuch; - $addrwas{$allocaddr}=$where; - } + $allocated{$allocaddr}=$howmuch; + $addrwas{$allocaddr}=$where; + } diff --git a/SOURCES/glibc-rh677316-netdb-reentrant.patch b/SOURCES/glibc-rh677316-netdb-reentrant.patch index 74b3df92..80be97f7 100644 --- a/SOURCES/glibc-rh677316-netdb-reentrant.patch +++ b/SOURCES/glibc-rh677316-netdb-reentrant.patch @@ -35,3 +35,4 @@ index 3b24747fd5df6562..b6d7b90bbf8abd2e 100644 +extern __thread int h_errno attribute_tls_model_ie; # endif /* IS_IN_LIB */ # define __set_h_errno(x) (h_errno = (x)) + diff --git a/SOURCES/glibc-rh677316-qsort_r.patch b/SOURCES/glibc-rh677316-qsort_r.patch index ed523b2a..7d50d673 100644 --- a/SOURCES/glibc-rh677316-qsort_r.patch +++ b/SOURCES/glibc-rh677316-qsort_r.patch @@ -17,7 +17,7 @@ index c20ce9da58bd2cdf..152c12fe9cb41509 100644 +libc_hidden_proto (__qsort_r) libc_hidden_proto (lrand48_r) libc_hidden_proto (wctomb) - + diff --git a/nscd/gai.c b/nscd/gai.c index 060933293838c4ee..018b449339813df5 100644 --- a/nscd/gai.c @@ -29,7 +29,7 @@ index 060933293838c4ee..018b449339813df5 100644 +#define __qsort_r qsort_r /* nscd uses 1MB or 2MB thread stacks. */ #define __libc_use_alloca(size) (size <= __MAX_ALLOCA_CUTOFF) - + diff --git a/posix/tst-rfc3484-2.c b/posix/tst-rfc3484-2.c index a37be36e6ad5a279..afd4b2959fc830f0 100644 --- a/posix/tst-rfc3484-2.c @@ -39,7 +39,7 @@ index a37be36e6ad5a279..afd4b2959fc830f0 100644 #define __gethostbyaddr_r gethostbyaddr_r #define __gethostbyname2_r gethostbyname2_r +#define __qsort_r qsort_r - + void attribute_hidden diff --git a/posix/tst-rfc3484-3.c b/posix/tst-rfc3484-3.c @@ -51,7 +51,7 @@ index 493e76015c74be9e..92efecd242a0baa3 100644 #define __gethostbyaddr_r gethostbyaddr_r #define __gethostbyname2_r gethostbyname2_r +#define __qsort_r qsort_r - + void attribute_hidden diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c @@ -63,7 +63,7 @@ index db3ae1b7bb86406a..8e886d987fd42b1d 100644 #define __gethostbyaddr_r gethostbyaddr_r #define __gethostbyname2_r gethostbyname2_r +#define __qsort_r qsort_r - + void attribute_hidden diff --git a/stdlib/msort.c b/stdlib/msort.c @@ -71,8 +71,8 @@ index e419734cd634ba5c..6f4b846b05fea8b9 100644 --- a/stdlib/msort.c +++ b/stdlib/msort.c @@ -162,7 +162,7 @@ msort_with_tmp (const struct msort_param *p, void *b, size_t n) - - + + void -qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg) +__qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg) @@ -86,8 +86,8 @@ index e419734cd634ba5c..6f4b846b05fea8b9 100644 -libc_hidden_def (qsort_r) +libc_hidden_def (__qsort_r) +weak_alias (__qsort_r, qsort_r) - - + + void qsort (void *b, size_t n, size_t s, __compar_fn_t cmp) { @@ -100,16 +100,16 @@ index b1c72fda9d2aa365..a678d8d7e8b23d1d 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -2639,11 +2639,11 @@ getaddrinfo (const char *name, const char *service, - __libc_lock_lock (lock); - if (__libc_once_get (old_once) && gaiconf_reload_flag) - gaiconf_reload (); + __libc_lock_lock (lock); + if (__libc_once_get (old_once) && gaiconf_reload_flag) + gaiconf_reload (); - qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src); + __qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src); - __libc_lock_unlock (lock); - } + __libc_lock_unlock (lock); + } else - qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src); + __qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src); - + /* Queue the results up as they come out of sorting. */ q = p = results[order[0]].dest_addr; diff --git a/SOURCES/glibc-rh677316-resolv.patch b/SOURCES/glibc-rh677316-resolv.patch index 9a44a446..250fa6d6 100644 --- a/SOURCES/glibc-rh677316-resolv.patch +++ b/SOURCES/glibc-rh677316-resolv.patch @@ -11,7 +11,7 @@ Author: Florian Weimer Date: Wed Sep 6 15:47:27 2017 +0200 resolv: __resolv_conf_attach must not free passed conf object [BZ #22096] - + (cherry picked from commit a83047308196e3e54716a39dd85c0a08b198d6bd) The following files are rebased completely: @@ -116,18 +116,18 @@ index 57f7457848bc1700..7a8290e1f26070e0 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -2,6 +2,8 @@ - + #include - + +# ifndef _ISOMAC + /* If the machine allows unaligned access we can do better than using the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the installed header. */ @@ -47,8 +49,11 @@ extern const struct _ns_flagdata _ns_flagdata[] attribute_hidden; - + #endif - + -extern u_int __ns_get16 (const u_char *) __THROW; -extern u_long __ns_get32 (const u_char *) __THROW; +extern unsigned int __ns_get16 (const unsigned char *) __THROW; @@ -135,13 +135,13 @@ index 57f7457848bc1700..7a8290e1f26070e0 100644 +int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW; +int __ns_name_unpack (const unsigned char *, const unsigned char *, + const unsigned char *, unsigned char *, size_t) __THROW; - + #define ns_msg_getflag(handle, flag) \ (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift) @@ -74,4 +79,5 @@ libresolv_hidden_proto (ns_samename) libresolv_hidden_proto (ns_makecanon) libresolv_hidden_proto (ns_format_ttl) - + +# endif /* !_ISOMAC */ #endif diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h @@ -151,12 +151,12 @@ index 2e735ede4c0e922b..f7d0e043c6eedc88 100644 @@ -1,8 +1,11 @@ #ifndef _ARPA_NAMESER_COMPAT_ #include - + -/* Picksome unused number to represent lookups of IPv4 and IPv6 (i.e., - T_A and T_AAAA). */ -#define T_UNSPEC 62321 +# ifndef _ISOMAC - + +/* The number is outside the 16-bit RR type range and is used + internally by the implementation. */ +#define T_QUERY_A_AND_AAAA 439963904 @@ -169,7 +169,7 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 +++ b/include/resolv.h @@ -1,68 +1,45 @@ #ifndef _RESOLV_H_ - + -#define RES_SET_H_ERRNO(r,x) \ +# ifndef _ISOMAC +# include @@ -181,13 +181,13 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 } \ while (0) +# endif - + -#include #include - + -#ifdef _RESOLV_H_ +# if defined _RESOLV_H_ && !defined _ISOMAC - + -# ifdef _LIBC_REENTRANT -# include -# undef _res @@ -207,7 +207,7 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 +extern __thread struct __res_state *__resp attribute_tls_model_ie; +# undef _res +# define _res (*__resp) - + /* Now define the internal interfaces. */ -extern int __res_vinit (res_state, int); -extern int __res_maybe_init (res_state, int); @@ -227,7 +227,7 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 +extern uint32_t _getlong (const unsigned char *__src); +extern uint16_t _getshort (const unsigned char *__src); extern int res_ourserver_p (const res_state __statp, - const struct sockaddr_in6 *__inp); + const struct sockaddr_in6 *__inp); extern void __res_iclose (res_state statp, bool free_addr); -extern int __res_nopt(res_state statp, int n0, u_char *buf, int buflen, - int anslen); @@ -237,7 +237,7 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 libc_hidden_proto (__res_iclose) libc_hidden_proto (__res_randomid) libc_hidden_proto (__res_state) - + -int __libc_res_nquery (res_state, const char *, int, int, u_char *, int, - u_char **, u_char **, int *, int *, int *); -int __libc_res_nsearch (res_state, const char *, int, int, u_char *, int, @@ -268,7 +268,7 @@ index e1e3caa2a2ecb6ea..634f5525fe9d357a 100644 -libresolv_hidden_proto (__res_nopt) libresolv_hidden_proto (__dn_count_labels) libresolv_hidden_proto (__p_secstodate) - + -extern const char *_res_opcodes[]; -libresolv_hidden_proto (_res_opcodes) - @@ -285,14 +285,14 @@ index 5ae854b4f91e72ad..6b5c13105059dd35 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -18,7 +18,7 @@ - + #include #include - +#include - + #define LOOKUP_TYPE struct hostent #define FUNCTION_NAME gethostbyaddr @@ -27,7 +27,6 @@ @@ -312,14 +312,14 @@ index 48e4946f29145bef..580ba6d1cfbd63ec 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -22,7 +22,7 @@ #include #include #include - +#include - + #define LOOKUP_TYPE struct hostent #define FUNCTION_NAME gethostbyname2 @@ -30,7 +30,7 @@ @@ -340,14 +340,14 @@ index 49e7028a1fe71a09..8f464b5ff1914b86 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -22,7 +22,7 @@ #include #include #include - +#include - + #define LOOKUP_TYPE struct hostent #define FUNCTION_NAME gethostbyname @@ -30,7 +30,7 @@ @@ -369,7 +369,7 @@ index 0ee25247cd464940..a3de792cc429b546 100644 + Copyright (C) 2004-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2004. - + @@ -26,7 +26,8 @@ #include #include @@ -377,21 +377,21 @@ index 0ee25247cd464940..a3de792cc429b546 100644 -#include +#include +#include - + #include "dbg_log.h" #include "nscd.h" @@ -78,7 +79,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, char strdata[0]; } *dataset = NULL; - + - if (__builtin_expect (debug_level > 0, 0)) + if (__glibc_unlikely (debug_level > 0)) { if (he == NULL) - dbg_log (_("Haven't found \"%s\" in hosts cache!"), (char *) key); + dbg_log (_("Haven't found \"%s\" in hosts cache!"), (char *) key); @@ -87,34 +88,29 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, } - + static service_user *hosts_database; - service_user *nip = NULL; + service_user *nip; @@ -399,7 +399,7 @@ index 0ee25247cd464940..a3de792cc429b546 100644 int rc6 = 0; int rc4 = 0; int herrno = 0; - + - if (hosts_database != NULL) - { - nip = hosts_database; @@ -428,7 +428,7 @@ index 0ee25247cd464940..a3de792cc429b546 100644 + bool enable_inet6 = __resolv_context_disable_inet6 (ctx); + if (ctx == NULL) no_more = 1; - + - /* If we are looking for both IPv4 and IPv6 address we don't want - the lookup functions to automatically promote IPv4 addresses to - IPv6 addresses. Currently this is decided by setting the @@ -440,22 +440,22 @@ index 0ee25247cd464940..a3de792cc429b546 100644 char *tmpbuf6 = alloca (tmpbuf6len); size_t tmpbuf4len = 0; @@ -431,7 +427,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, - struct dataset *newp - = (struct dataset *) mempool_alloc (db, total + req->key_len, - 1); + struct dataset *newp + = (struct dataset *) mempool_alloc (db, total + req->key_len, + 1); - if (__builtin_expect (newp != NULL, 1)) + if (__glibc_likely (newp != NULL)) - { - /* Adjust pointer into the memory block. */ - key_copy = (char *) newp + (key_copy - (char *) dataset); + { + /* Adjust pointer into the memory block. */ + key_copy = (char *) newp + (key_copy - (char *) dataset); @@ -538,7 +534,8 @@ next_nip: } - + out: - _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; + __resolv_context_enable_inet6 (ctx, enable_inet6); + __resolv_context_put (ctx); - + if (dataset != NULL && !alloca_used) { diff --git a/nscd/gethstbyad_r.c b/nscd/gethstbyad_r.c @@ -467,13 +467,13 @@ index c0988b862da3ef03..842ced2ec64048ea 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -28,7 +28,6 @@ #define EXTRA_VARIABLES , ttlp #define NEED_H_ERRNO 1 #define NEED__RES 1 -#define NEED__RES_HCONF 1 - + /* We are nscd, so we don't want to be talking to ourselves. */ #undef USE_NSCD diff --git a/nscd/gethstbynm3_r.c b/nscd/gethstbynm3_r.c @@ -485,14 +485,14 @@ index a7d25548a8ef3f36..2ab75e469eca1589 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -32,7 +32,7 @@ #define ADD_VARIABLES name, af #define EXTRA_VARIABLES , ttlp, canonp #define NEED_H_ERRNO 1 -#define NEED__RES_HCONF 1 +#define NEED__RES 1 - + #define HANDLE_DIGITS_DOTS 1 #define HAVE_LOOKUP_BUFFER 1 diff --git a/nss/Makefile b/nss/Makefile @@ -501,15 +501,15 @@ index 4d6a9ef83b885d7c..dda1e5e51b7a3ea3 100644 +++ b/nss/Makefile @@ -39,7 +39,7 @@ makedb-modules = xmalloc hash-string extra-objs += $(makedb-modules:=.o) - + tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent \ - test-digits-dots + test-digits-dots tst-nss-files-hosts-erange xtests = bug-erange - + include ../Makeconfig @@ -115,3 +115,5 @@ $(objpfx)/libnss_test1.so$(libnss_test1.so-version): $(objpfx)/libnss_test1.so - $(make-link) + $(make-link) endif $(objpfx)tst-nss-test1.out: $(objpfx)/libnss_test1.so$(libnss_test1.so-version) + @@ -523,7 +523,7 @@ index 7a2b57bdebe03408..0c1fa97e3977a81e 100644 +/* Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by H.J. Lu , 1997. - + @@ -23,6 +23,7 @@ #include #include @@ -533,8 +533,8 @@ index 7a2b57bdebe03408..0c1fa97e3977a81e 100644 #include #include "nsswitch.h" @@ -38,11 +39,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - size_t buflen, struct hostent **result, - enum nss_status *status, int af, int *h_errnop) + size_t buflen, struct hostent **result, + enum nss_status *status, int af, int *h_errnop) { - int save; - @@ -545,9 +545,9 @@ index 7a2b57bdebe03408..0c1fa97e3977a81e 100644 + if (ctx == NULL) { if (h_errnop) - *h_errnop = NETDB_INTERNAL; + *h_errnop = NETDB_INTERNAL; @@ -52,6 +52,21 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf, - *result = NULL; + *result = NULL; return -1; } + int ret = __nss_hostname_digits_dots_context @@ -565,7 +565,7 @@ index 7a2b57bdebe03408..0c1fa97e3977a81e 100644 + enum nss_status *status, int af, int *h_errnop) +{ + int save; - + /* * disallow names consisting only of digits/dots, unless diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c @@ -576,21 +576,21 @@ index c308a70b93ba8a77..a439b816f70aa2e7 100644 -/* Copyright (C) 1996-2001,2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1996-2017 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 @@ -17,7 +17,7 @@ - + #include #include -#include +#include #include #include - + @@ -47,6 +47,11 @@ |* *| \*******************************************************************/ - + + +#ifdef HANDLE_DIGITS_DOTS +# include @@ -602,7 +602,7 @@ index c308a70b93ba8a77..a439b816f70aa2e7 100644 @@ -93,6 +98,19 @@ FUNCTION_NAME (ADD_PARAMS) int h_errno_tmp = 0; #endif - + +#ifdef HANDLE_DIGITS_DOTS + /* Wrap both __nss_hostname_digits_dots and the actual lookup + function call in the same context. */ @@ -618,7 +618,7 @@ index c308a70b93ba8a77..a439b816f70aa2e7 100644 + /* Get lock. */ __libc_lock_lock (lock); - + @@ -105,9 +123,9 @@ FUNCTION_NAME (ADD_PARAMS) #ifdef HANDLE_DIGITS_DOTS if (buffer != NULL) @@ -629,13 +629,13 @@ index c308a70b93ba8a77..a439b816f70aa2e7 100644 + if (__nss_hostname_digits_dots_context + (res_ctx, name, &resbuf, &buffer, &buffer_size, 0, &result, NULL, + AF_VAL, H_ERRNO_VAR_P)) - goto done; + goto done; } #endif @@ -143,6 +161,10 @@ done: /* Release lock. */ __libc_lock_unlock (lock); - + +#ifdef HANDLE_DIGITS_DOTS + __resolv_context_put (res_ctx); +#endif @@ -652,7 +652,7 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. - + @@ -25,11 +25,8 @@ #ifdef USE_NSCD # include @@ -679,7 +679,7 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 @@ -216,6 +212,18 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, bool any_service = false; #endif - + +#ifdef NEED__RES + /* The HANDLE_DIGITS_DOTS case below already needs the resolver + configuration, so this has to happen early. */ @@ -696,7 +696,7 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 PREPROCESS; #endif @@ -226,6 +234,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, - H_ERRNO_VAR_P)) + H_ERRNO_VAR_P)) { case -1: +# ifdef NEED__RES @@ -707,7 +707,7 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 #ifdef NEED_H_ERRNO @@ -245,7 +256,12 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen, result - H_ERRNO_VAR); + H_ERRNO_VAR); if (nscd_status >= 0) - return nscd_status; + { @@ -718,11 +718,11 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 + } } #endif - + @@ -263,21 +279,6 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, - } + } else - { + { -#ifdef NEED__RES - /* The resolver code will really be used so we have to - initialize it. */ @@ -738,13 +738,13 @@ index 1b457897517fdfb8..bce80e05dd2d1764 100644 - _res_hconf_init (); -#endif /* need _res_hconf */ - - void *tmp_ptr = fct.l; + void *tmp_ptr = fct.l; #ifdef PTR_MANGLE - PTR_MANGLE (tmp_ptr); + PTR_MANGLE (tmp_ptr); @@ -406,6 +407,12 @@ done: POSTPROCESS; #endif - + +#ifdef NEED__RES + /* This has to happen late because the POSTPROCESS stage above might + need the resolver context. */ @@ -762,20 +762,20 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 -/* Copyright (C) 2000, 2002, 2004, 2007, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2000-2017 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 @@ -18,6 +18,7 @@ #include #include #include "nsswitch.h" +#include - + /* Set up NIP to run through the services. If ALL is zero, use NIP's current location if it's not nil. Return nonzero if there are no @@ -59,10 +60,15 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct, } fct; int no_more; - + - if (res && __res_maybe_init (&_res, 0) == -1) + struct resolv_context *res_ctx = NULL; + if (res) @@ -789,12 +789,12 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 + return; + } } - + /* Cycle through the services and run their `setXXent' functions until @@ -95,6 +101,8 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct, - *last_nip = *nip; + *last_nip = *nip; } - + + __resolv_context_put (res_ctx); + if (stayopen_tmp) @@ -803,7 +803,7 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 @@ -112,10 +120,15 @@ __nss_endent (const char *func_name, db_lookup_function lookup_fct, } fct; int no_more; - + - if (res && __res_maybe_init (&_res, 0) == -1) + struct resolv_context *res_ctx = NULL; + if (res) @@ -817,7 +817,7 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 + return; + } } - + /* Cycle through all the services and run their endXXent functions. */ @@ -132,6 +145,8 @@ __nss_endent (const char *func_name, db_lookup_function lookup_fct, no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, 0, 1); @@ -826,12 +826,12 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 + + __resolv_context_put (res_ctx); } - - + + @@ -152,11 +167,16 @@ __nss_getent_r (const char *getent_func_name, int no_more; enum nss_status status; - + - if (res && __res_maybe_init (&_res, 0) == -1) + struct resolv_context *res_ctx = NULL; + if (res) @@ -847,17 +847,17 @@ index 25e952f5317e6999..d85065b6cc05dbcb 100644 + return errno; + } } - + /* Initialize status to return if no more functions are found. */ @@ -227,6 +247,8 @@ __nss_getent_r (const char *getent_func_name, while (! no_more && status != NSS_STATUS_SUCCESS); } - + + __resolv_context_put (res_ctx); + *result = status == NSS_STATUS_SUCCESS ? resbuf : NULL; return (status == NSS_STATUS_SUCCESS ? 0 - : status != NSS_STATUS_TRYAGAIN ? ENOENT + : status != NSS_STATUS_TRYAGAIN ? ENOENT diff --git a/nss/nsswitch.h b/nss/nsswitch.h index 23a77747555fab53..bd3fbcb08250c61c 100644 --- a/nss/nsswitch.h @@ -866,12 +866,12 @@ index 23a77747555fab53..bd3fbcb08250c61c 100644 -/* Copyright (C) 1996-2012 Free Software Foundation, Inc. +/* Copyright (C) 1996-2017 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 @@ -197,7 +197,17 @@ extern int __nss_getent_r (const char *getent_func_name, extern void *__nss_getent (getent_r_function func, - void **resbuf, char **buffer, size_t buflen, - size_t *buffer_size, int *h_errnop); + void **resbuf, char **buffer, size_t buflen, + size_t *buffer_size, int *h_errnop); +struct resolv_context; struct hostent; +extern int __nss_hostname_digits_dots_context (struct resolv_context *, @@ -884,8 +884,8 @@ index 23a77747555fab53..bd3fbcb08250c61c 100644 + enum nss_status *status, int af, + int *h_errnop) attribute_hidden; extern int __nss_hostname_digits_dots (const char *name, - struct hostent *resbuf, char **buffer, - size_t *buffer_size, size_t buflen, + struct hostent *resbuf, char **buffer, + size_t *buffer_size, size_t buflen, diff --git a/nss/tst-nss-files-hosts-erange.c b/nss/tst-nss-files-hosts-erange.c new file mode 100644 index 0000000000000000..beb7aa9fa0b5926f @@ -1017,33 +1017,33 @@ index 3f525bcc75ee83ae..1124897ce5f9610b 100644 -# Free Software Foundation, Inc. +# Copyright (C) 1994-2017 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 @@ -21,33 +20,73 @@ # subdir := resolv - + +include ../Makeconfig + headers := resolv.h \ - netdb.h bits/netdb.h \ - arpa/nameser.h arpa/nameser_compat.h \ - sys/bitypes.h - + netdb.h bits/netdb.h \ + arpa/nameser.h arpa/nameser_compat.h \ + sys/bitypes.h + routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \ - res_hconf res_libc res-state + res_hconf res_libc res-state res_randomid res-close \ + resolv_context resolv_conf - + -tests = tst-aton tst-leaks tst-inet_ntop tst-inet_pton +tests = tst-aton tst-leaks tst-inet_ntop xtests = tst-leaks2 - + -generate := mtrace-tst-leaks tst-leaks.mtrace tst-leaks2.mtrace - -include ../Makeconfig +generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace - + extra-libs := libresolv libnss_dns ifeq ($(have-thread-library),yes) extra-libs += libanl @@ -1092,19 +1092,19 @@ index 3f525bcc75ee83ae..1124897ce5f9610b 100644 extra-libs-others = $(extra-libs) -libresolv-routines := gethnamaddr res_comp res_debug \ +libresolv-routines := res_comp res_debug \ - res_data res_mkquery res_query res_send \ - inet_net_ntop inet_net_pton inet_neta base64 \ - ns_parse ns_name ns_netint ns_ttl ns_print \ + res_data res_mkquery res_query res_send \ + inet_net_ntop inet_net_pton inet_neta base64 \ + ns_parse ns_name ns_netint ns_ttl ns_print \ - ns_samedomain ns_date + ns_samedomain ns_date \ + compat-hooks compat-gethnamaddr - + libanl-routines := gai_cancel gai_error gai_misc gai_notify gai_suspend \ - getaddrinfo_a + getaddrinfo_a @@ -66,29 +105,23 @@ ifeq (yesyes,$(build-shared)$(have-thread-library)) tests: $(objpfx)ga_test endif - + -generated := mtrace-tst-leaks tst-leaks.mtrace \ - mtrace-tst-leaks2 tst-leaks2.mtrace +ifeq (,$(filter sunrpc,$(subdirs))) @@ -1113,19 +1113,19 @@ index 3f525bcc75ee83ae..1124897ce5f9610b 100644 +# If that's not going to happen, install our dummy file. +headers += rpc/netdb.h +endif - + -include ../Rules +generated += mtrace-tst-leaks.out tst-leaks.mtrace \ + mtrace-tst-leaks2.out tst-leaks2.mtrace \ + mtrace-tst-resolv-res_ninit.out tst-resolv-res_ninit.mtrace \ - + -CPPFLAGS += -Dgethostbyname=res_gethostbyname \ - -Dgethostbyname2=res_gethostbyname2 \ - -Dgethostbyaddr=res_gethostbyaddr \ - -Dgetnetbyname=res_getnetbyname \ - -Dgetnetbyaddr=res_getnetbyaddr +include ../Rules - + -ifeq (yes,$(have-ssp)) -CFLAGS-libresolv += -fstack-protector -endif @@ -1135,26 +1135,26 @@ index 3f525bcc75ee83ae..1124897ce5f9610b 100644 - +CFLAGS-libnss_dns += -fstack-protector-strong CFLAGS-res_hconf.c = -fexceptions - + -# The BIND code elicits some harmless warnings. -+cflags += -Wno-strict-prototypes -Wno-write-strings - # The DNS NSS modules needs the resolver. $(objpfx)libnss_dns.so: $(objpfx)libresolv.so - + @@ -104,17 +137,45 @@ $(objpfx)tst-leaks: $(objpfx)libresolv.so tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out - $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ + $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ -ifeq ($(run-built-tests),yes) -ifneq (no,$(PERL)) -tests: $(objpfx)mtrace-tst-leaks -endif -endif - + tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace $(objpfx)mtrace-tst-leaks2: $(objpfx)tst-leaks2.out - $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@ + $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@ -ifeq ($(run-built-tests),yes) + +tst-resolv-res_ninit-ENV = MALLOC_TRACE=$(objpfx)tst-resolv-res_ninit.mtrace @@ -1202,21 +1202,21 @@ index 1a70bbb1dc615ac9..514e9bb617e710f1 100644 @@ -18,10 +18,6 @@ Differences The resolver in the GNU C Library still differs from what's in BIND 8.2.3-T5B: - + -* The resolver in glibc strictly adheres to the recommendations in RFC - 1535. BIND 8.2.3-T5B seems to relax those rules a bit (see the code - that's wrapped in `#ifndef RFC1535'). - * The RES_DEBUG option (`options debug' in /etc/resolv.conf) has been disabled. - + @@ -62,7 +58,7 @@ the `gethostby*' family of functions, which means that for example traditional resolver interfaces however, continue to use a single resolver state and are therefore still thread-unsafe. The resolver state is the same resolver state that is used for the initial ("main") --thread. +-thread. +thread. - + This has the following consequences for existing binaries and source code: @@ -118,7 +114,6 @@ src/lib/resolv/ @@ -1229,14 +1229,14 @@ index 1a70bbb1dc615ac9..514e9bb617e710f1 100644 res_query.c @@ -145,8 +140,7 @@ src/lib/isc/ base64.c - + Some of these files have been optimised a bit, and adaptations have -been made to make them fit in with the rest of glibc. The more -non-obvious changes are wrapped in something like `#ifdef _LIBC'. +been made to make them fit in with the rest of glibc. - + res_libc.c is home-brewn, although parts of it are taken from res_data.c. - + diff --git a/resolv/Versions b/resolv/Versions index 24b07ef770ed3915..b05778d9654aa0f2 100644 --- a/resolv/Versions @@ -1248,9 +1248,9 @@ index 24b07ef770ed3915..b05778d9654aa0f2 100644 GLIBC_2.0 { _res; @@ -28,8 +26,12 @@ libc { - + __h_errno; __resp; - + - __res_maybe_init; __res_iclose; + __res_iclose; __inet_pton_length; @@ -1260,7 +1260,7 @@ index 24b07ef770ed3915..b05778d9654aa0f2 100644 + __resolv_context_put; } } - + @@ -81,7 +83,9 @@ libresolv { # Needed in libnss_dns. __ns_name_unpack; __ns_name_ntop; @@ -1271,9 +1271,9 @@ index 24b07ef770ed3915..b05778d9654aa0f2 100644 + __res_context_hostalias; } } - + @@ -98,6 +102,6 @@ libnss_dns { - + libanl { GLIBC_2.2.3 { - getaddrinfo_a; gai_cancel; gai_error; gai_suspend; @@ -1287,14 +1287,14 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 @@ -45,34 +45,13 @@ * SOFTWARE. */ - + -/* - * $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $ - */ - #ifndef _ARPA_NAMESER_H_ #define _ARPA_NAMESER_H_ - + -/*! \file */ - -#define BIND_4_COMPAT @@ -1308,7 +1308,7 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 -#include +#include +#include - + -/*% - * Revision information. This is the release date in YYYYMMDD format. - * It can change every day so the right thing to do with it is use it @@ -1351,7 +1351,7 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + int _rrnum; + const unsigned char *_msg_ptr; } ns_msg; - + /* Private data structure - do not use from outside library. */ @@ -136,12 +115,12 @@ extern const struct _ns_flagdata _ns_flagdata[]; * This is a parsed record. It is caller allocated and has no dynamic data. @@ -1370,7 +1370,7 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + uint16_t rdlength; + const unsigned char * rdata; } ns_rr; - + /* Accessor macros - this is part of the public interface. */ @@ -249,71 +228,97 @@ typedef struct ns_tcp_tsig_state ns_tcp_tsig_state; /*% @@ -1532,13 +1532,13 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + + ns_t_max = 65536 + } ns_type; - + /*% * Values for class field @@ -330,15 +335,7 @@ typedef enum __ns_class { - ns_c_max = 65536 + ns_c_max = 65536 } ns_class; - + -/* DNSSEC constants. */ - -typedef enum __ns_key_types { @@ -1550,12 +1550,12 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 - +/* Certificate type values in CERT resource records. */ typedef enum __ns_cert_types { - cert_t_pkix = 1, /*%< PKIX (X.509v3) */ - cert_t_spki = 2, /*%< SPKI */ + cert_t_pkix = 1, /*%< PKIX (X.509v3) */ + cert_t_spki = 2, /*%< SPKI */ @@ -347,82 +344,6 @@ typedef enum __ns_cert_types { - cert_t_oid = 254 /*%< OID private type */ + cert_t_oid = 254 /*%< OID private type */ } ns_cert_types; - + -/* Flags field of the KEY RR rdata. */ -#define NS_KEY_TYPEMASK 0xC000 /*%< Mask for "type" bits */ -#define NS_KEY_TYPE_AUTH_CONF 0x0000 /*%< Key usable for both */ @@ -1645,10 +1645,10 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + const unsigned char *t_cp = (const unsigned char *)(cp); \ + (s) = ((uint16_t)t_cp[0] << 8) \ + | ((uint16_t)t_cp[1]) \ - ; \ - (cp) += NS_INT16SZ; \ + ; \ + (cp) += NS_INT16SZ; \ } while (0) - + #define NS_GET32(l, cp) do { \ - register const u_char *t_cp = (const u_char *)(cp); \ - (l) = ((u_int32_t)t_cp[0] << 24) \ @@ -1660,30 +1660,30 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + | ((uint32_t)t_cp[1] << 16) \ + | ((uint32_t)t_cp[2] << 8) \ + | ((uint32_t)t_cp[3]) \ - ; \ - (cp) += NS_INT32SZ; \ + ; \ + (cp) += NS_INT32SZ; \ } while (0) - + #define NS_PUT16(s, cp) do { \ - register u_int16_t t_s = (u_int16_t)(s); \ - register u_char *t_cp = (u_char *)(cp); \ + uint16_t t_s = (uint16_t)(s); \ + unsigned char *t_cp = (unsigned char *)(cp); \ - *t_cp++ = t_s >> 8; \ - *t_cp = t_s; \ - (cp) += NS_INT16SZ; \ + *t_cp++ = t_s >> 8; \ + *t_cp = t_s; \ + (cp) += NS_INT16SZ; \ } while (0) - + #define NS_PUT32(l, cp) do { \ - register u_int32_t t_l = (u_int32_t)(l); \ - register u_char *t_cp = (u_char *)(cp); \ + uint32_t t_l = (uint32_t)(l); \ + unsigned char *t_cp = (unsigned char *)(cp); \ - *t_cp++ = t_l >> 24; \ - *t_cp++ = t_l >> 16; \ - *t_cp++ = t_l >> 8; \ + *t_cp++ = t_l >> 24; \ + *t_cp++ = t_l >> 16; \ + *t_cp++ = t_l >> 8; \ @@ -470,66 +391,53 @@ typedef enum __ns_cert_types { - + __BEGIN_DECLS int ns_msg_getflag (ns_msg, int) __THROW; -u_int ns_get16 (const u_char *) __THROW; @@ -1702,7 +1702,7 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 + ns_sect, int) __THROW; int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW; int ns_sprintrr (const ns_msg *, const ns_rr *, - const char *, const char *, char *, size_t) + const char *, const char *, char *, size_t) __THROW; -int ns_sprintrrf (const u_char *, size_t, const char *, - ns_class, ns_type, u_long, const u_char *, @@ -1777,11 +1777,11 @@ index 6a2c8376bd6565cb..a99d5ec508592486 100644 int ns_makecanon (const char *, char *, size_t) __THROW; int ns_samename (const char *, const char *) __THROW; __END_DECLS - + -#ifdef BIND_4_COMPAT #include -#endif - + #endif /* !_ARPA_NAMESER_H_ */ /*! \file */ diff --git a/resolv/arpa/nameser_compat.h b/resolv/arpa/nameser_compat.h @@ -1791,7 +1791,7 @@ index d59c9e41b3a5c45c..f1c390f3b918b547 100644 @@ -26,16 +26,9 @@ * SUCH DAMAGE. */ - + -/*% - * from nameser.h 8.1 (Berkeley) 6/2/93 - * $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $ @@ -1799,34 +1799,34 @@ index d59c9e41b3a5c45c..f1c390f3b918b547 100644 - #ifndef _ARPA_NAMESER_COMPAT_ #define _ARPA_NAMESER_COMPAT_ - + -#define __BIND 19950621 /*%< (DEAD) interface version stamp. */ - #include - + /*% @@ -47,7 +40,7 @@ - + typedef struct { - unsigned id :16; /*%< query identification number */ + unsigned id :16; /*%< query identification number */ -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN - /* fields in third byte */ - unsigned qr: 1; /*%< response flag */ - unsigned opcode: 4; /*%< purpose of message */ + /* fields in third byte */ + unsigned qr: 1; /*%< response flag */ + unsigned opcode: 4; /*%< purpose of message */ @@ -61,7 +54,7 @@ typedef struct { - unsigned cd: 1; /*%< checking disabled by resolver */ - unsigned rcode :4; /*%< response code */ + unsigned cd: 1; /*%< checking disabled by resolver */ + unsigned rcode :4; /*%< response code */ #endif -#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN +#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN - /* fields in third byte */ - unsigned rd :1; /*%< recursion desired */ - unsigned tc :1; /*%< truncated message */ + /* fields in third byte */ + unsigned rd :1; /*%< recursion desired */ + unsigned tc :1; /*%< truncated message */ @@ -127,49 +120,90 @@ typedef struct { #define DELETE ns_uop_delete #define ADD ns_uop_add - + -#define T_A ns_t_a -#define T_NS ns_t_ns -#define T_MD ns_t_md @@ -1954,7 +1954,7 @@ index d59c9e41b3a5c45c..f1c390f3b918b547 100644 +#define T_AVC ns_t_avc +#define T_TA ns_t_ta +#define T_DLV ns_t_dlv - + #define C_IN ns_c_in #define C_CHAOS ns_c_chaos diff --git a/resolv/base64.c b/resolv/base64.c @@ -1964,7 +1964,7 @@ index ea584ed357f02a66..fedc086b0c1b28a0 100644 @@ -40,10 +40,6 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ - + -#if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $"; -#endif /* not lint */ @@ -1974,7 +1974,7 @@ index ea584ed357f02a66..fedc086b0c1b28a0 100644 #include @@ -195,10 +191,7 @@ libresolv_hidden_def (b64_ntop) */ - + int -b64_pton(src, target, targsize) - char const *src; @@ -1982,8 +1982,8 @@ index ea584ed357f02a66..fedc086b0c1b28a0 100644 - size_t targsize; +b64_pton (char const *src, u_char *target, size_t targsize) { - int tarindex, state, ch; - char *pos; + int tarindex, state, ch; + char *pos; diff --git a/resolv/gethnamaddr.c b/resolv/compat-gethnamaddr.c similarity index 74% rename from resolv/gethnamaddr.c @@ -1994,7 +1994,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 @@ -49,54 +49,32 @@ * --Copyright-- */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ @@ -2048,7 +2048,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 -#else -# include "../conf/portability.h" -#endif - + -#if defined(USE_OPTIONS_H) -# include <../conf/options.h> -#endif @@ -2066,23 +2066,23 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - "gethostby*.getanswer: asked for \"%s\", got \"%s\""; +# define MAXALIASES 35 +# define MAXADDRS 35 - + static char *h_addr_ptrs[MAXADDRS + 1]; - + @@ -107,24 +85,25 @@ static u_char host_addr[16]; /* IPv4 or IPv6 */ static FILE *hostf = NULL; static int stayopen = 0; - + +static struct hostent *res_gethostbyname2_context (struct resolv_context *, + const char *name, int af); + static void map_v4v6_address (const char *src, char *dst) __THROW; static void map_v4v6_hostent (struct hostent *hp, char **bp, int *len) __THROW; - + -#ifdef RESOLVSORT extern void addrsort (char **, int) __THROW; -#endif - + -#if PACKETSZ > 65536 -#define MAXPACKET PACKETSZ -#else @@ -2093,7 +2093,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 +# else +# define MAXPACKET 65536 +# endif - + /* As per RFC 1034 and 1035 a host name cannot exceed 255 octets in length. */ -#ifdef MAXHOSTNAMELEN -# undef MAXHOSTNAMELEN @@ -2103,19 +2103,19 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 +# undef MAXHOSTNAMELEN +# endif +# define MAXHOSTNAMELEN 256 - + typedef union { HEADER hdr; @@ -136,15 +115,13 @@ typedef union { char ac; } align; - + -#ifndef h_errno +# ifndef h_errno extern int h_errno; -#endif +# endif - + -#ifdef DEBUG +# ifdef DEBUG static void @@ -2124,11 +2124,11 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - int num; +Dprintf (char *msg, int num) { - if (_res.options & RES_DEBUG) { - int save = errno; + if (_res.options & RES_DEBUG) { + int save = errno; @@ -153,11 +130,11 @@ Dprintf(msg, num) - __set_errno (save); - } + __set_errno (save); + } } -#else -# define Dprintf(msg, num) /*nada*/ @@ -2136,21 +2136,21 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 +# else +# define Dprintf(msg, num) /*nada*/ +# endif - + -#define BOUNDED_INCR(x) \ +# define BOUNDED_INCR(x) \ - do { \ - cp += x; \ - if (cp > eom) { \ + do { \ + cp += x; \ + if (cp > eom) { \ @@ -166,7 +143,7 @@ Dprintf(msg, num) - } \ - } while (0) - + } \ + } while (0) + -#define BOUNDS_CHECK(ptr, count) \ +# define BOUNDS_CHECK(ptr, count) \ - do { \ - if ((ptr) + (count) > eom) { \ - __set_h_errno (NO_RECOVERY); \ + do { \ + if ((ptr) + (count) > eom) { \ + __set_h_errno (NO_RECOVERY); \ @@ -178,9 +155,9 @@ Dprintf(msg, num) static struct hostent * getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) @@ -2161,42 +2161,42 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 + const HEADER *hp; + const u_char *cp; + int n; - const u_char *eom, *erdata; - char *bp, **ap, **hap; - int type, class, buflen, ancount, qdcount; + const u_char *eom, *erdata; + char *bp, **ap, **hap; + int type, class, buflen, ancount, qdcount; @@ -332,20 +309,12 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - * uses many different types in responses that do not - * match QTYPE. - */ + * uses many different types in responses that do not + * match QTYPE. + */ - if ((_res.options & RES_USE_DNSSEC) == 0) { - syslog(LOG_NOTICE|LOG_AUTH, - "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", - qname, p_class(C_IN), p_type(qtype), - p_type(type)); - } - cp += n; - continue; /* XXX - had_error++ ? */ - } - switch (type) { - case T_PTR: - if (strcasecmp(tname, bp) != 0) { + cp += n; + continue; /* XXX - had_error++ ? */ + } + switch (type) { + case T_PTR: + if (strcasecmp(tname, bp) != 0) { - syslog(LOG_NOTICE|LOG_AUTH, - AskedForGot, qname, bp); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } @@ -354,7 +323,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - had_error++; - break; - } + had_error++; + break; + } -#if MULTI_PTRS_ARE_ALIASES - cp += n; - if (cp != erdata) { - __set_h_errno (NO_RECOVERY); + cp += n; + if (cp != erdata) { + __set_h_errno (NO_RECOVERY); @@ -376,26 +344,9 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - buflen -= n; - } - break; + buflen -= n; + } + break; -#else - host.h_name = bp; - if (_res.options & RES_USE_INET6) { @@ -2212,57 +2212,57 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - __set_h_errno (NETDB_SUCCESS); - return (&host); -#endif - case T_A: - case T_AAAA: - if (strcasecmp(host.h_name, bp) != 0) { + case T_A: + case T_AAAA: + if (strcasecmp(host.h_name, bp) != 0) { - syslog(LOG_NOTICE|LOG_AUTH, - AskedForGot, host.h_name, bp); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } @@ -404,7 +355,7 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - continue; - } - if (!haveanswer) { + continue; + } + if (!haveanswer) { - register int nn; + int nn; - - host.h_name = bp; - nn = strlen(bp) + 1; /* for the \0 */ + + host.h_name = bp; + nn = strlen(bp) + 1; /* for the \0 */ @@ -449,7 +400,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - if (haveanswer) { - *ap = NULL; - *hap = NULL; + if (haveanswer) { + *ap = NULL; + *hap = NULL; -# if defined(RESOLVSORT) - /* - * Note: we sort even if host can take only one address - * in its return structures - should give it the "best" + /* + * Note: we sort even if host can take only one address + * in its return structures - should give it the "best" @@ -457,7 +407,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - */ - if (_res.nsort && haveanswer > 1 && qtype == T_A) - addrsort(h_addr_ptrs, haveanswer); + */ + if (_res.nsort && haveanswer > 1 && qtype == T_A) + addrsort(h_addr_ptrs, haveanswer); -# endif /*RESOLVSORT*/ - if (!host.h_name) { - n = strlen(qname) + 1; /* for the \0 */ - if (n > buflen || n >= MAXHOSTNAMELEN) + if (!host.h_name) { + n = strlen(qname) + 1; /* for the \0 */ + if (n > buflen || n >= MAXHOSTNAMELEN) @@ -467,7 +416,7 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - bp += n; - buflen -= n; - } + bp += n; + buflen -= n; + } - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) - map_v4v6_hostent(&host, &bp, &buflen); - __set_h_errno (NETDB_SUCCESS); - return (&host); + map_v4v6_hostent(&host, &bp, &buflen); + __set_h_errno (NETDB_SUCCESS); + return (&host); @@ -477,31 +426,37 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) - return (NULL); + return (NULL); } - + -extern struct hostent *gethostbyname2(const char *name, int af); -libresolv_hidden_proto (gethostbyname2) +extern struct hostent *res_gethostbyname2(const char *name, int af); +libresolv_hidden_proto (res_gethostbyname2) - + struct hostent * -gethostbyname(name) - const char *name; @@ -2292,7 +2292,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 + { + __resolv_context_put (ctx); + return hp; - } + } - return (gethostbyname2(name, AF_INET)); + } + struct hostent *hp = res_gethostbyname2_context (ctx, name, AF_INET); @@ -2300,7 +2300,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 + return hp; } +compat_symbol (libresolv, res_gethostbyname, res_gethostbyname, GLIBC_2_0); - + -struct hostent * -gethostbyname2(name, af) - const char *name; @@ -2309,66 +2309,66 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 +res_gethostbyname2_context (struct resolv_context *ctx, + const char *name, int af) { - union - { + union + { @@ -509,16 +464,11 @@ gethostbyname2(name, af) - u_char *ptr; - } buf; - querybuf *origbuf; + u_char *ptr; + } buf; + querybuf *origbuf; - register const char *cp; + const char *cp; - char *bp; - int n, size, type, len; - struct hostent *ret; - + char *bp; + int n, size, type, len; + struct hostent *ret; + - if (__res_maybe_init (&_res, 0) == -1) { - __set_h_errno (NETDB_INTERNAL); - return (NULL); - } - - switch (af) { - case AF_INET: - size = INADDRSZ; + switch (af) { + case AF_INET: + size = INADDRSZ; @@ -542,8 +492,10 @@ gethostbyname2(name, af) - * this is also done in res_query() since we are not the only - * function that looks up host names. - */ + * this is also done in res_query() since we are not the only + * function that looks up host names. + */ - if (!strchr(name, '.') && (cp = __hostalias(name))) - name = cp; + char abuf[MAXDNAME]; + if (strchr (name, '.') != NULL + && (cp = __res_context_hostalias (ctx, name, abuf, sizeof (abuf)))) + name = cp; - - /* - * disallow names consisting only of digits/dots, unless + + /* + * disallow names consisting only of digits/dots, unless @@ -573,7 +525,7 @@ gethostbyname2(name, af) - h_addr_ptrs[0] = (char *)host_addr; - h_addr_ptrs[1] = NULL; - host.h_addr_list = h_addr_ptrs; + h_addr_ptrs[0] = (char *)host_addr; + h_addr_ptrs[1] = NULL; + host.h_addr_list = h_addr_ptrs; - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) - map_v4v6_hostent(&host, &bp, &len); - __set_h_errno (NETDB_SUCCESS); - return (&host); + map_v4v6_hostent(&host, &bp, &len); + __set_h_errno (NETDB_SUCCESS); + return (&host); @@ -615,8 +567,9 @@ gethostbyname2(name, af) - - buf.buf = origbuf = (querybuf *) alloca (1024); - + + buf.buf = origbuf = (querybuf *) alloca (1024); + - if ((n = __libc_res_nsearch(&_res, name, C_IN, type, buf.buf->buf, 1024, - &buf.ptr, NULL, NULL, NULL, NULL)) < 0) { + if ((n = __res_context_search + (ctx, name, C_IN, type, buf.buf->buf, 1024, + &buf.ptr, NULL, NULL, NULL, NULL)) < 0) { - if (buf.buf != origbuf) - free (buf.buf); - Dprintf("res_nsearch failed (%d)\n", n); + if (buf.buf != origbuf) + free (buf.buf); + Dprintf("res_nsearch failed (%d)\n", n); @@ -629,13 +582,26 @@ gethostbyname2(name, af) - free (buf.buf); - return ret; + free (buf.buf); + return ret; } -libresolv_hidden_def (gethostbyname2) - + struct hostent * -gethostbyaddr(addr, len, af) - const void *addr; @@ -2393,15 +2393,15 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 +res_gethostbyaddr_context (struct resolv_context *ctx, + const void *addr, socklen_t len, int af) { - const u_char *uaddr = (const u_char *)addr; - static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff }; + const u_char *uaddr = (const u_char *)addr; + static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff }; @@ -648,22 +614,12 @@ gethostbyaddr(addr, len, af) - u_char *ptr; - } buf; - querybuf *orig_buf; + u_char *ptr; + } buf; + querybuf *orig_buf; - register struct hostent *hp; + struct hostent *hp; - char qbuf[MAXDNAME+1], *qp = NULL; + char qbuf[MAXDNAME+1], *qp = NULL; -#ifdef SUNSECURITY - register struct hostent *rhp; - char **haddr; @@ -2414,31 +2414,31 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - return (NULL); - } + - if (af == AF_INET6 && len == IN6ADDRSZ && + if (af == AF_INET6 && len == IN6ADDRSZ && - (!bcmp(uaddr, mapped, sizeof mapped) || - !bcmp(uaddr, tunnelled, sizeof tunnelled))) { + (!memcmp(uaddr, mapped, sizeof mapped) || + !memcmp(uaddr, tunnelled, sizeof tunnelled))) { - /* Unmap. */ - addr += sizeof mapped; - uaddr += sizeof mapped; + /* Unmap. */ + addr += sizeof mapped; + uaddr += sizeof mapped; @@ -698,9 +654,9 @@ gethostbyaddr(addr, len, af) - case AF_INET6: - qp = qbuf; - for (n = IN6ADDRSZ - 1; n >= 0; n--) { + case AF_INET6: + qp = qbuf; + for (n = IN6ADDRSZ - 1; n >= 0; n--) { - qp += SPRINTF((qp, "%x.%x.", - uaddr[n] & 0xf, - (uaddr[n] >> 4) & 0xf)); + qp += sprintf(qp, "%x.%x.", + uaddr[n] & 0xf, + (uaddr[n] >> 4) & 0xf); - } - strcpy(qp, "ip6.arpa"); - break; + } + strcpy(qp, "ip6.arpa"); + break; @@ -710,14 +666,8 @@ gethostbyaddr(addr, len, af) - - buf.buf = orig_buf = (querybuf *) alloca (1024); - + + buf.buf = orig_buf = (querybuf *) alloca (1024); + - n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, 1024, - &buf.ptr, NULL, NULL, NULL, NULL); - if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) { @@ -2449,13 +2449,13 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - } + n = __res_context_query (ctx, qbuf, C_IN, T_PTR, buf.buf->buf, 1024, + &buf.ptr, NULL, NULL, NULL, NULL); - if (n < 0) { - if (buf.buf != orig_buf) - free (buf.buf); + if (n < 0) { + if (buf.buf != orig_buf) + free (buf.buf); @@ -731,44 +681,12 @@ gethostbyaddr(addr, len, af) - free (buf.buf); - if (!hp) - return (NULL); /* h_errno was set by getanswer() */ + free (buf.buf); + if (!hp) + return (NULL); /* h_errno was set by getanswer() */ -#ifdef SUNSECURITY - if (af == AF_INET) { - /* @@ -2488,20 +2488,20 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - } - } -#endif /*SUNSECURITY*/ - hp->h_addrtype = af; - hp->h_length = len; - memmove(host_addr, addr, len); - h_addr_ptrs[0] = (char *)host_addr; - h_addr_ptrs[1] = NULL; + hp->h_addrtype = af; + hp->h_length = len; + memmove(host_addr, addr, len); + h_addr_ptrs[0] = (char *)host_addr; + h_addr_ptrs[1] = NULL; - if (af == AF_INET && (_res.options & RES_USE_INET6)) { + if (af == AF_INET && res_use_inet6 ()) { - map_v4v6_address((char*)host_addr, (char*)host_addr); - hp->h_addrtype = AF_INET6; - hp->h_length = IN6ADDRSZ; + map_v4v6_address((char*)host_addr, (char*)host_addr); + hp->h_addrtype = AF_INET6; + hp->h_length = IN6ADDRSZ; @@ -777,9 +695,23 @@ gethostbyaddr(addr, len, af) - return (hp); + return (hp); } - + +struct hostent * +res_gethostbyaddr (const void *addr, socklen_t len, int af) +{ @@ -2522,66 +2522,66 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - int f; +_sethtent (int f) { - if (!hostf) - hostf = fopen(_PATH_HOSTS, "rce" ); + if (!hostf) + hostf = fopen(_PATH_HOSTS, "rce" ); @@ -788,9 +720,10 @@ _sethtent(f) - stayopen = f; + stayopen = f; } libresolv_hidden_def (_sethtent) +compat_symbol (libresolv, _sethtent, _sethtent, GLIBC_2_0); - + -void -_endhtent() +static void +_endhtent (void) { - if (hostf && !stayopen) { - (void) fclose(hostf); + if (hostf && !stayopen) { + (void) fclose(hostf); @@ -799,10 +732,10 @@ _endhtent() } - + struct hostent * -_gethtent() +_gethtent (void) { - char *p; + char *p; - register char *cp, **q; + char *cp, **q; - int af, len; - - if (!hostf && !(hostf = fopen(_PATH_HOSTS, "rce" ))) { + int af, len; + + if (!hostf && !(hostf = fopen(_PATH_HOSTS, "rce" ))) { @@ -826,7 +759,7 @@ _gethtent() - af = AF_INET6; - len = IN6ADDRSZ; - } else if (inet_pton(AF_INET, p, host_addr) > 0) { + af = AF_INET6; + len = IN6ADDRSZ; + } else if (inet_pton(AF_INET, p, host_addr) > 0) { - if (_res.options & RES_USE_INET6) { + if (res_use_inet6 ()) { - map_v4v6_address((char*)host_addr, (char*)host_addr); - af = AF_INET6; - len = IN6ADDRSZ; + map_v4v6_address((char*)host_addr, (char*)host_addr); + af = AF_INET6; + len = IN6ADDRSZ; @@ -863,28 +796,27 @@ _gethtent() - return (&host); + return (&host); } libresolv_hidden_def (_gethtent) +compat_symbol (libresolv, _gethtent, _gethtent, GLIBC_2_0); - + struct hostent * -_gethtbyname(name) - const char *name; +_gethtbyname (const char *name) { - struct hostent *hp; - + struct hostent *hp; + - if (_res.options & RES_USE_INET6) { + if (res_use_inet6 ()) { - hp = _gethtbyname2(name, AF_INET6); - if (hp) - return (hp); - } - return (_gethtbyname2(name, AF_INET)); + hp = _gethtbyname2(name, AF_INET6); + if (hp) + return (hp); + } + return (_gethtbyname2(name, AF_INET)); } +compat_symbol (libresolv, _gethtbyname, _gethtbyname, GLIBC_2_0); - + struct hostent * -_gethtbyname2(name, af) - const char *name; @@ -2592,15 +2592,15 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - register char **cp; + struct hostent *p; + char **cp; - - _sethtent(0); - while ((p = _gethtent())) { + + _sethtent(0); + while ((p = _gethtent())) { @@ -901,28 +833,25 @@ _gethtbyname2(name, af) - return (p); + return (p); } libresolv_hidden_def (_gethtbyname2) +compat_symbol (libresolv, _gethtbyname2, _gethtbyname2, GLIBC_2_0); - + struct hostent * -_gethtbyaddr(addr, len, af) - const char *addr; @@ -2610,29 +2610,29 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 { - register struct hostent *p; + struct hostent *p; - - _sethtent(0); - while ((p = _gethtent())) + + _sethtent(0); + while ((p = _gethtent())) - if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len)) + if (p->h_addrtype == af && !memcmp(p->h_addr, addr, len)) - break; - _endhtent(); - return (p); + break; + _endhtent(); + return (p); } libresolv_hidden_def (_gethtbyaddr) +compat_symbol (libresolv, _gethtbyaddr, _gethtbyaddr, GLIBC_2_0); - + static void -map_v4v6_address(src, dst) - const char *src; - char *dst; +map_v4v6_address (const char *src, char *dst) { - u_char *p = (u_char *)dst; - char tmp[INADDRSZ]; + u_char *p = (u_char *)dst; + char tmp[INADDRSZ]; @@ -940,10 +869,7 @@ map_v4v6_address(src, dst) } - + static void -map_v4v6_hostent(hp, bpp, lenp) - struct hostent *hp; @@ -2640,12 +2640,12 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - int *lenp; +map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp) { - char **ap; - + char **ap; + @@ -968,11 +894,8 @@ map_v4v6_hostent(hp, bpp, lenp) - } + } } - + -#ifdef RESOLVSORT extern void -addrsort(ap, num) @@ -2653,11 +2653,11 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 - int num; +addrsort (char **ap, int num) { - int i, j; - char **p; + int i, j; + char **p; @@ -1011,55 +934,5 @@ addrsort(ap, num) - needsort++; - } + needsort++; + } } -#endif - @@ -2697,7 +2697,7 @@ index bea3ec588cf60991..259378b2be2d5f63 100644 -{ - return (_gethtent()); -} - + -void -dns_service() -{ @@ -2781,7 +2781,7 @@ index 0aaf29f9db724bb3..b3df236bc95d67df 100644 @@ -44,11 +44,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: herror.c,v 8.11 1999/10/13 16:39:39 vixie Exp $"; @@ -2791,21 +2791,21 @@ index 0aaf29f9db724bb3..b3df236bc95d67df 100644 #include #include @@ -85,14 +80,14 @@ herror(const char *s) { - v->iov_base = (/*noconst*/ char *)s; - v->iov_len = strlen(s); - v++; + v->iov_base = (/*noconst*/ char *)s; + v->iov_len = strlen(s); + v++; - v->iov_base = ": "; + v->iov_base = (char *) ": "; - v->iov_len = 2; - v++; - } - v->iov_base = (char *)hstrerror(h_errno); - v->iov_len = strlen(v->iov_base); - v++; + v->iov_len = 2; + v++; + } + v->iov_base = (char *)hstrerror(h_errno); + v->iov_len = strlen(v->iov_base); + v++; - v->iov_base = "\n"; + v->iov_base = (char *) "\n"; - v->iov_len = 1; - writev_not_cancel_no_status(STDERR_FILENO, iov, (v - iov) + 1); + v->iov_len = 1; + writev_not_cancel_no_status(STDERR_FILENO, iov, (v - iov) + 1); } diff --git a/resolv/inet_addr.c b/resolv/inet_addr.c index 144b87a74c1aef62..022f7ea0841b6bae 100644 @@ -2814,7 +2814,7 @@ index 144b87a74c1aef62..022f7ea0841b6bae 100644 @@ -64,11 +64,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; -static const char rcsid[] = "$BINDId: inet_addr.c,v 8.11 1999/10/13 16:39:25 vixie Exp $"; @@ -2822,11 +2822,11 @@ index 144b87a74c1aef62..022f7ea0841b6bae 100644 - #include #include - + @@ -77,26 +72,25 @@ static const char rcsid[] = "$BINDId: inet_addr.c,v 8.11 1999/10/13 16:39:25 vix - + #include - + -#ifdef _LIBC -# include -# include @@ -2839,7 +2839,7 @@ index 144b87a74c1aef62..022f7ea0841b6bae 100644 +#include +#include +#include - + /* * Ascii internet address interpretation routine. * The value returned is in network order. @@ -2847,49 +2847,49 @@ index 144b87a74c1aef62..022f7ea0841b6bae 100644 in_addr_t -inet_addr(const char *cp) { +__inet_addr(const char *cp) { - struct in_addr val; - - if (__inet_aton(cp, &val)) - return (val.s_addr); - return (INADDR_NONE); + struct in_addr val; + + if (__inet_aton(cp, &val)) + return (val.s_addr); + return (INADDR_NONE); } +weak_alias (__inet_addr, inet_addr) - + /* * Check whether "cp" is a valid ascii representation @@ -110,9 +104,6 @@ __inet_aton(const char *cp, struct in_addr *addr) { - static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff }; - in_addr_t val; + static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff }; + in_addr_t val; -#ifndef _LIBC - int base; -#endif - char c; - union iaddr { - uint8_t bytes[4]; + char c; + union iaddr { + uint8_t bytes[4]; @@ -121,10 +112,8 @@ __inet_aton(const char *cp, struct in_addr *addr) - uint8_t *pp = res.bytes; - int digit; - + uint8_t *pp = res.bytes; + int digit; + -#ifdef _LIBC - int saved_errno = errno; - __set_errno (0); + int saved_errno = errno; + __set_errno (0); -#endif - - res.word = 0; - + + res.word = 0; + @@ -137,7 +126,6 @@ __inet_aton(const char *cp, struct in_addr *addr) - */ - if (!isdigit(c)) - goto ret_0; + */ + if (!isdigit(c)) + goto ret_0; -#ifdef _LIBC - { - char *endp; - unsigned long ul = strtoul (cp, (char **) &endp, 0); + { + char *endp; + unsigned long ul = strtoul (cp, (char **) &endp, 0); @@ -150,33 +138,6 @@ __inet_aton(const char *cp, struct in_addr *addr) - cp = endp; - } - c = *cp; + cp = endp; + } + c = *cp; -#else - val = 0; base = 10; digit = 0; - if (c == '0') { @@ -2917,23 +2917,23 @@ index 144b87a74c1aef62..022f7ea0841b6bae 100644 - break; - } -#endif - if (c == '.') { - /* - * Internet format: + if (c == '.') { + /* + * Internet format: @@ -210,15 +171,11 @@ __inet_aton(const char *cp, struct in_addr *addr) - if (addr != NULL) - addr->s_addr = res.word | htonl (val); - + if (addr != NULL) + addr->s_addr = res.word | htonl (val); + -#ifdef _LIBC - __set_errno (saved_errno); + __set_errno (saved_errno); -#endif - return (1); - + return (1); + ret_0: -#ifdef _LIBC - __set_errno (saved_errno); + __set_errno (saved_errno); -#endif - return (0); + return (0); } weak_alias (__inet_aton, inet_aton) diff --git a/resolv/inet_net_ntop.c b/resolv/inet_net_ntop.c @@ -2943,7 +2943,7 @@ index e50c6a049b875555..aaa78f664b5bc261 100644 @@ -15,10 +15,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: inet_net_ntop.c,v 1.6 1999/01/08 19:23:42 vixie Exp $"; -#endif @@ -2963,8 +2963,8 @@ index e50c6a049b875555..aaa78f664b5bc261 100644 - size_t size; +inet_net_ntop (int af, const void *src, int bits, char *dst, size_t size) { - switch (af) { - case AF_INET: + switch (af) { + case AF_INET: @@ -79,11 +70,7 @@ inet_net_ntop(af, src, bits, dst, size) * Paul Vixie (ISC), July 1996 */ @@ -2976,8 +2976,8 @@ index e50c6a049b875555..aaa78f664b5bc261 100644 - size_t size; +inet_net_ntop_ipv4 (const u_char *src, int bits, char *dst, size_t size) { - char *odst = dst; - char *t; + char *odst = dst; + char *t; diff --git a/resolv/inet_net_pton.c b/resolv/inet_net_pton.c index 14916f83f840bcef..aab9b7b58228bb2d 100644 --- a/resolv/inet_net_pton.c @@ -2985,7 +2985,7 @@ index 14916f83f840bcef..aab9b7b58228bb2d 100644 @@ -15,10 +15,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: inet_net_pton.c,v 1.11 1999/01/08 19:23:44 vixie Exp $"; -#endif @@ -3004,8 +3004,8 @@ index 14916f83f840bcef..aab9b7b58228bb2d 100644 - size_t size; +inet_net_pton (int af, const char *src, void *dst, size_t size) { - switch (af) { - case AF_INET: + switch (af) { + case AF_INET: @@ -86,10 +78,7 @@ inet_net_pton(af, src, dst, size) * Paul Vixie (ISC), June 1996 */ @@ -3016,8 +3016,8 @@ index 14916f83f840bcef..aab9b7b58228bb2d 100644 - size_t size; +inet_net_pton_ipv4 (const char *src, u_char *dst, size_t size) { - static const char xdigits[] = "0123456789abcdef"; - int n, ch, tmp, dirty, bits; + static const char xdigits[] = "0123456789abcdef"; + int n, ch, tmp, dirty, bits; diff --git a/resolv/inet_neta.c b/resolv/inet_neta.c index 349e6bd8802b21fb..348ff4784f412bc0 100644 --- a/resolv/inet_neta.c @@ -3025,7 +3025,7 @@ index 349e6bd8802b21fb..348ff4784f412bc0 100644 @@ -15,10 +15,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: inet_neta.c,v 1.6 1999/01/08 19:23:45 vixie Exp $"; -#endif @@ -3043,8 +3043,8 @@ index 349e6bd8802b21fb..348ff4784f412bc0 100644 - size_t size; +inet_neta (u_int32_t src, char *dst, size_t size) { - char *odst = dst; - char *tp; + char *odst = dst; + char *tp; diff --git a/resolv/inet_ntop.c b/resolv/inet_ntop.c index 6e89f2d0589ad013..01c45ce8b79bec56 100644 --- a/resolv/inet_ntop.c @@ -3052,7 +3052,7 @@ index 6e89f2d0589ad013..01c45ce8b79bec56 100644 @@ -15,10 +15,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: inet_ntop.c,v 1.8 1999/10/13 16:39:28 vixie Exp $"; -#endif /* LIBC_SCCS and not lint */ @@ -3071,8 +3071,8 @@ index 6e89f2d0589ad013..01c45ce8b79bec56 100644 - socklen_t size; +inet_ntop (int af, const void *src, char *dst, socklen_t size) { - switch (af) { - case AF_INET: + switch (af) { + case AF_INET: @@ -88,10 +80,7 @@ libc_hidden_def (inet_ntop) */ static const char * @@ -3083,8 +3083,8 @@ index 6e89f2d0589ad013..01c45ce8b79bec56 100644 - socklen_t size; +inet_ntop4 (const u_char *src, char *dst, socklen_t size) { - static const char fmt[] = "%u.%u.%u.%u"; - char tmp[sizeof "255.255.255.255"]; + static const char fmt[] = "%u.%u.%u.%u"; + char tmp[sizeof "255.255.255.255"]; @@ -111,10 +100,7 @@ inet_ntop4(src, dst, size) */ static const char * @@ -3095,8 +3095,8 @@ index 6e89f2d0589ad013..01c45ce8b79bec56 100644 - socklen_t size; +inet_ntop6 (const u_char *src, char *dst, socklen_t size) { - /* - * Note that int32_t and int16_t need only be "at least" large enough + /* + * Note that int32_t and int16_t need only be "at least" large enough diff --git a/resolv/ns_date.c b/resolv/ns_date.c index 9801ac46d40b501c..31cef74c928013e8 100644 --- a/resolv/ns_date.c @@ -3104,13 +3104,13 @@ index 9801ac46d40b501c..31cef74c928013e8 100644 @@ -15,10 +15,6 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$Id$"; -#endif - /* Import. */ - + #include diff --git a/resolv/ns_name.c b/resolv/ns_name.c index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 @@ -3119,25 +3119,25 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 @@ -15,10 +15,6 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_name.c,v 8.15 2000/03/30 22:53:46 vixie Exp $"; -#endif - #include - + #include @@ -33,32 +29,10 @@ static const char rcsid[] = "$BINDId: ns_name.c,v 8.15 2000/03/30 22:53:46 vixie - + # define SPRINTF(x) ((size_t)sprintf x) - + -#define NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */ -#define DNS_LABELTYPE_BITSTRING 0x41 - /* Data. */ - + static const char digits[] = "0123456789"; - + -static const char digitvalue[256] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16*/ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*32*/ @@ -3158,25 +3158,25 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 -}; - /* Forward. */ - + static int special(int); @@ -66,12 +40,7 @@ static int printable(int); static int dn_find(const u_char *, const u_char *, - const u_char * const *, - const u_char * const *); + const u_char * const *, + const u_char * const *); -static int encode_bitstring(const char **, const char *, - unsigned char **, unsigned char **, - unsigned const char *); static int labellen(const u_char *); -static int decode_bitstring(const unsigned char **, - char *, const char *); - + /* Public. */ - + @@ -119,22 +88,6 @@ ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) - __set_errno (EMSGSIZE); - return (-1); - } + __set_errno (EMSGSIZE); + return (-1); + } - if ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) { - int m; - @@ -3193,12 +3193,12 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 - dn += m; - continue; - } - for ((void)NULL; l > 0; l--) { - c = *cp++; - if (special(c)) { + for ((void)NULL; l > 0; l--) { + c = *cp++; + if (special(c)) { @@ -180,7 +133,7 @@ libresolv_hidden_def (ns_name_ntop) strong_alias (ns_name_ntop, __ns_name_ntop) - + /*% - * Convert a ascii string into an encoded domain name as per RFC1035. + * Convert an ascii string into an encoded domain name as per RFC1035. @@ -3208,16 +3208,16 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 @@ -196,7 +149,7 @@ int ns_name_pton(const char *src, u_char *dst, size_t dstsiz) { - u_char *label, *bp, *eom; + u_char *label, *bp, *eom; - int c, n, escaped, e = 0; + int c, n, escaped; - char *cp; - - escaped = 0; + char *cp; + + escaped = 0; @@ -206,28 +159,7 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz) - - while ((c = *src++) != 0) { - if (escaped) { + + while ((c = *src++) != 0) { + if (escaped) { - if (c == '[') { /*%< start a bit string label */ - if ((cp = strchr(src, ']')) == NULL) { - __set_errno (EINVAL); @@ -3241,46 +3241,46 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 - } - else if ((cp = strchr(digits, c)) != NULL) { + if ((cp = strchr(digits, c)) != NULL) { - n = (cp - digits) * 100; - if ((c = *src++) == 0 || - (cp = strchr(digits, c)) == NULL) { + n = (cp - digits) * 100; + if ((c = *src++) == 0 || + (cp = strchr(digits, c)) == NULL) { @@ -295,7 +227,6 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz) - __set_errno (EMSGSIZE); - return (-1); - } + __set_errno (EMSGSIZE); + return (-1); + } - done: - if (label >= eom) { - __set_errno (EMSGSIZE); - return (-1); + if (label >= eom) { + __set_errno (EMSGSIZE); + return (-1); @@ -398,7 +329,6 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src, - /* Check for indirection. */ - switch (n & NS_CMPRSFLGS) { - case 0: + /* Check for indirection. */ + switch (n & NS_CMPRSFLGS) { + case 0: - case NS_TYPE_ELT: - /* Limit checks. */ - if ((l = labellen(srcp - 1)) < 0) { - __set_errno (EMSGSIZE); + /* Limit checks. */ + if ((l = labellen(srcp - 1)) < 0) { + __set_errno (EMSGSIZE); @@ -545,7 +475,7 @@ ns_name_pack(const u_char *src, u_char *dst, int dstsiz, - goto cleanup; - } - n = labellen(srcp); + goto cleanup; + } + n = labellen(srcp); - if (dstp + 1 + n >= eob) { + if (n + 1 > eob - dstp) { - goto cleanup; - } - memcpy(dstp, srcp, n + 1); + goto cleanup; + } + memcpy(dstp, srcp, n + 1); @@ -643,7 +573,6 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) { - const u_char *cp; - u_int n; + const u_char *cp; + u_int n; - int l; - - cp = *ptrptr; - while (cp < eom && (n = *cp++) != 0) { + + cp = *ptrptr; + while (cp < eom && (n = *cp++) != 0) { @@ -652,13 +581,6 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) - case 0: /*%< normal case, n == len */ - cp += n; - continue; + case 0: /*%< normal case, n == len */ + cp += n; + continue; - case NS_TYPE_ELT: /*%< EDNS0 extended label */ - if ((l = labellen(cp - 1)) < 0) { - __set_errno (EMSGSIZE); @@ -3288,11 +3288,11 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 - } - cp += l; - continue; - case NS_CMPRSFLGS: /*%< indirection */ - cp++; - break; + case NS_CMPRSFLGS: /*%< indirection */ + cp++; + break; @@ -681,7 +603,7 @@ libresolv_hidden_def (ns_name_skip) - + /*% * Thinking in noninternationalized USASCII (per the DNS spec), - * is this characted special ("in need of quoting") ? @@ -3301,9 +3301,9 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 * return: *\li boolean. @@ -795,180 +717,14 @@ dn_find(const u_char *domain, const u_char *msg, - return (-1); + return (-1); } - + +/* Return the length of the encoded label starting at LP, or -1 for + compression references and extended label types. */ static int @@ -3485,7 +3485,7 @@ index adf64bbd9ac8e503..08a75e2fe0b4edd6 100644 + return *lp; + return -1; } - + /*! \file */ diff --git a/resolv/ns_netint.c b/resolv/ns_netint.c index 4318f18879d774dd..6a365a3b8c37e21a 100644 @@ -3494,13 +3494,13 @@ index 4318f18879d774dd..6a365a3b8c37e21a 100644 @@ -15,10 +15,6 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_netint.c,v 8.4 1999/10/13 16:39:35 vixie Exp $"; -#endif - /* Import. */ - + #include diff --git a/resolv/ns_parse.c b/resolv/ns_parse.c index 712469be1d88c58a..863b20a9f7fd902b 100644 @@ -3509,13 +3509,13 @@ index 712469be1d88c58a..863b20a9f7fd902b 100644 @@ -15,10 +15,6 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_parse.c,v 8.13 1999/10/13 16:39:35 vixie Exp $"; -#endif - /* Import. */ - + #include diff --git a/resolv/ns_print.c b/resolv/ns_print.c index 36d39784a5bfce1b..f55680c311bd015b 100644 @@ -3524,27 +3524,27 @@ index 36d39784a5bfce1b..f55680c311bd015b 100644 @@ -16,10 +16,6 @@ * SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_print.c,v 8.18 2000/02/29 05:48:12 vixie Exp $"; -#endif - /* Import. */ - + #include @@ -51,8 +47,6 @@ static int addstr(const char *src, size_t len, static int addtab(size_t len, size_t target, int spaced, - char **buf, size_t *buflen); - + char **buf, size_t *buflen); + -static u_int16_t dst_s_dns_key_id(const u_char *, const int); - /* Macros. */ - + #define T(x) \ @@ -440,124 +434,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen, - break; - } - + break; + } + - case ns_t_key: { - char base64_key[NS_MD5RSA_MAX_BASE64]; - u_int keyflags, protocol, algorithm, key_id; @@ -3663,12 +3663,12 @@ index 36d39784a5bfce1b..f55680c311bd015b 100644 - break; - } - - case ns_t_cert: { - u_int c_type, key_tag, alg; - int n; + case ns_t_cert: { + u_int c_type, key_tag, alg; + int n; @@ -891,81 +767,3 @@ addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) { - } - return (spaced); + } + return (spaced); } - -/* DST algorithm codes */ @@ -3755,7 +3755,7 @@ index 44b843a74b342d61..5d1bf39fc7280d3b 100644 @@ -16,10 +16,6 @@ * SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_samedomain.c,v 8.9 1999/10/15 21:06:51 vixie Exp $"; -#endif @@ -3779,13 +3779,13 @@ index d4c98bcf3ae2757d..079948790b94b05e 100644 @@ -16,10 +16,6 @@ * SOFTWARE. */ - + -#if !defined(_LIBC) && !defined(lint) -static const char rcsid[] = "$BINDId: ns_ttl.c,v 8.8 1999/10/13 16:39:36 vixie Exp $"; -#endif - /* Import. */ - + #include diff --git a/resolv/nsap_addr.c b/resolv/nsap_addr.c index 7041e5282ebae4ed..9a1d3f7fdc960e54 100644 @@ -3794,7 +3794,7 @@ index 7041e5282ebae4ed..9a1d3f7fdc960e54 100644 @@ -15,10 +15,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: nsap_addr.c,v 8.10 1999/10/13 16:39:28 vixie Exp $"; -#endif /* LIBC_SCCS and not lint */ @@ -3811,7 +3811,7 @@ index 7f735f51ffb69f19..7a5c39dc20f6ebb8 100644 +/* Copyright (C) 2004-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2004. - + @@ -20,9 +20,11 @@ #include #include @@ -3822,13 +3822,13 @@ index 7f735f51ffb69f19..7a5c39dc20f6ebb8 100644 - +#include +#include - + #if PACKETSZ > 65536 # define MAXPACKET PACKETSZ @@ -57,11 +59,19 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen, } ansp = { .ptr = buf }; enum nss_status status = NSS_STATUS_UNAVAIL; - + + struct resolv_context *ctx = __resolv_context_get (); + if (ctx == NULL) + { @@ -3846,28 +3846,28 @@ index 7f735f51ffb69f19..7a5c39dc20f6ebb8 100644 + buf, sizeof (buf), &ansp.ptr, NULL, NULL, + NULL, NULL); if (r > 0) - { - /* We need to decode the response. Just one question record. + { + /* We need to decode the response. Just one question record. @@ -102,6 +112,11 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen, - - ptr += s; - + + ptr += s; + + /* Check that there are enough bytes for the RR + metadata. */ + if (endptr - ptr < 10) + goto unavail; + - /* Check whether type and class match. */ - uint_fast16_t type; - NS_GET16 (type, ptr); + /* Check whether type and class match. */ + uint_fast16_t type; + NS_GET16 (type, ptr); @@ -136,13 +151,25 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen, - if (__ns_get16 (ptr) != ns_c_in) - goto unavail; - + if (__ns_get16 (ptr) != ns_c_in) + goto unavail; + - /* Also skip over the TTL. */ + /* Also skip over class and TTL. */ - ptr += sizeof (uint16_t) + sizeof (uint32_t); - + ptr += sizeof (uint16_t) + sizeof (uint32_t); + - /* Skip over the data length and data. */ - ptr += sizeof (uint16_t) + __ns_get16 (ptr); + /* Skip over RDATA length and RDATA itself. */ @@ -3877,8 +3877,8 @@ index 7f735f51ffb69f19..7a5c39dc20f6ebb8 100644 + if (endptr - ptr < rdatalen) + goto unavail; + ptr += rdatalen; - } - } + } + } + + /* Restore original buffer before retry. */ + if (ansp.ptr != buf) @@ -3887,10 +3887,10 @@ index 7f735f51ffb69f19..7a5c39dc20f6ebb8 100644 + ansp.ptr = buf; + } } - + out: @@ -150,6 +177,6 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen, - + if (ansp.ptr != buf) free (ansp.ptr); - @@ -3906,26 +3906,26 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Extended from original form by Ulrich Drepper , 1996. - + @@ -78,12 +78,13 @@ #include #include #include -#include - + #include "nsswitch.h" +#include - + /* Get implementeation for some internal functions. */ #include +#include #include #include - + @@ -100,10 +101,6 @@ #endif #define MAXHOSTNAMELEN 256 - + -static const char AskedForGot[] = "\ -gethostby*.getanswer: asked for \"%s\", got \"%s\""; - @@ -3936,7 +3936,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 @@ -111,14 +108,8 @@ typedef union querybuf u_char buf[MAXPACKET]; } querybuf; - + -/* These functions are defined in res_comp.c. */ -#define NS_MAXCDNAME 255 /* maximum compressed domain name */ -extern int __ns_name_ntop (const u_char *, char *, size_t); @@ -3947,13 +3947,13 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 -static enum nss_status getanswer_r (const querybuf *answer, int anslen, +static enum nss_status getanswer_r (struct resolv_context *ctx, + const querybuf *answer, int anslen, - const char *qname, int qtype, - struct hostent *result, char *buffer, - size_t buflen, int *errnop, int *h_errnop, + const char *qname, int qtype, + struct hostent *result, char *buffer, + size_t buflen, int *errnop, int *h_errnop, @@ -132,19 +123,55 @@ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1, - int *errnop, int *h_errnop, - int32_t *ttlp); - + int *errnop, int *h_errnop, + int32_t *ttlp); + -extern enum nss_status _nss_dns_gethostbyname3_r (const char *name, int af, - struct hostent *result, - char *buffer, size_t buflen, @@ -3985,11 +3985,11 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + } +} + - + enum nss_status _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, - char *buffer, size_t buflen, int *errnop, - int *h_errnop, int32_t *ttlp, char **canonp) + char *buffer, size_t buflen, int *errnop, + int *h_errnop, int32_t *ttlp, char **canonp) { + struct resolv_context *ctx = __resolv_context_get (); + if (ctx == NULL) @@ -4016,7 +4016,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 @@ -158,9 +185,6 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, int olderr = errno; enum nss_status status; - + - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; - @@ -4030,9 +4030,9 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - && (cp = res_hostalias (&_res, name, tmp, sizeof (tmp))) != NULL) + && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL) name = cp; - + host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024); - + - n = __libc_res_nsearch (&_res, name, C_IN, type, host_buffer.buf->buf, - 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); + n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf, @@ -4041,8 +4041,8 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 { switch (errno) @@ -223,10 +247,10 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, - by having the RES_USE_INET6 bit in _res.options set, we try - another lookup. */ + by having the RES_USE_INET6 bit in _res.options set, we try + another lookup. */ if (af == AF_INET6 && res_use_inet6 ()) - n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer @@ -4052,13 +4052,13 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + host_buffer.buf != orig_host_buffer + ? MAXPACKET : 1024, &host_buffer.ptr, + NULL, NULL, NULL, NULL); - + if (n < 0) - { + { @@ -241,14 +265,13 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, result->h_length = INADDRSZ; } - + - status = getanswer_r (host_buffer.buf, n, name, type, result, buffer, buflen, - errnop, h_errnop, map, ttlp, canonp); + status = getanswer_r @@ -4070,12 +4070,12 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 } -hidden_def (_nss_dns_gethostbyname3_r) - - + enum nss_status _nss_dns_gethostbyname2_r (const char *name, int af, struct hostent *result, @@ -265,15 +288,21 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result, - char *buffer, size_t buflen, int *errnop, - int *h_errnop) + char *buffer, size_t buflen, int *errnop, + int *h_errnop) { + struct resolv_context *ctx = __resolv_context_get (); + if (ctx == NULL) @@ -4100,10 +4100,10 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + __resolv_context_put (ctx); return status; } - + @@ -283,8 +312,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, - char *buffer, size_t buflen, int *errnop, - int *herrnop, int32_t *ttlp) + char *buffer, size_t buflen, int *errnop, + int *herrnop, int32_t *ttlp) { - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; @@ -4114,7 +4114,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + *herrnop = NETDB_INTERNAL; + return NSS_STATUS_UNAVAIL; + } - + /* * if there aren't any dots, it could be a user-level alias. @@ -294,7 +328,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, @@ -4124,10 +4124,10 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - const char *cp = res_hostalias (&_res, name, tmp, NS_MAXDNAME); + const char *cp = __res_context_hostalias (ctx, name, tmp, NS_MAXDNAME); if (cp != NULL) - name = cp; + name = cp; } @@ -313,9 +347,9 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, - + int olderr = errno; enum nss_status status; - int n = __libc_res_nsearch (&_res, name, C_IN, T_UNSPEC, @@ -4142,24 +4142,24 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 @@ -358,6 +392,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, if (host_buffer.buf != orig_host_buffer) free (host_buffer.buf); - + + __resolv_context_put (ctx); return status; } - + @@ -401,7 +436,7 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, buffer += pad; buflen = buflen > pad ? buflen - pad : 0; - + - if (__builtin_expect (buflen < sizeof (struct host_data), 0)) + if (__glibc_unlikely (buflen < sizeof (struct host_data))) { *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; @@ -410,8 +445,13 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, - + host_data = (struct host_data *) buffer; - + - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; + struct resolv_context *ctx = __resolv_context_get (); @@ -4169,7 +4169,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + *h_errnop = NETDB_INTERNAL; + return NSS_STATUS_UNAVAIL; + } - + if (af == AF_INET6 && len == IN6ADDRSZ && (memcmp (uaddr, mapped, sizeof mapped) == 0 @@ -436,12 +476,14 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, @@ -4186,9 +4186,9 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + __resolv_context_put (ctx); return NSS_STATUS_UNAVAIL; } - + @@ -454,19 +496,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, - (uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff)); + (uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff)); break; case AF_INET6: - /* Only lookup with the byte string format if the user wants it. */ @@ -4206,11 +4206,11 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - } qp = qbuf; for (n = IN6ADDRSZ - 1; n >= 0; n--) - { + { @@ -483,37 +512,28 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, break; } - + - n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf, - 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); - if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) @@ -4228,11 +4228,11 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 *h_errnop = h_errno; __set_errno (olderr); if (host_buffer.buf != orig_host_buffer) - free (host_buffer.buf); + free (host_buffer.buf); + __resolv_context_put (ctx); return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND; } - + - got_it_already: - status = getanswer_r (host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen, - errnop, h_errnop, 0 /* XXX */, ttlp, NULL); @@ -4252,7 +4252,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + __resolv_context_put (ctx); + return status; + } - + result->h_addrtype = af; result->h_length = len; @@ -521,6 +541,7 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, @@ -4264,9 +4264,9 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 } hidden_def (_nss_dns_gethostbyaddr2_r) @@ -535,26 +556,27 @@ _nss_dns_gethostbyaddr_r (const void *addr, socklen_t len, int af, - errnop, h_errnop, NULL); + errnop, h_errnop, NULL); } - + -#ifdef RESOLVSORT -static void addrsort (char **ap, int num); - @@ -4279,7 +4279,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 short aval[MAX_NR_ADDRS]; int needsort = 0; + size_t nsort = __resolv_context_sort_count (ctx); - + p = ap; if (num > MAX_NR_ADDRS) num = MAX_NR_ADDRS; @@ -4298,19 +4298,19 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + } aval[i] = j; if (needsort == 0 && i > 0 && j < aval[i-1]) - needsort = i; + needsort = i; @@ -579,10 +601,10 @@ addrsort (char **ap, int num) else - break; + break; } -#endif - + static enum nss_status -getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, +getanswer_r (struct resolv_context *ctx, + const querybuf *answer, int anslen, const char *qname, int qtype, - struct hostent *result, char *buffer, size_t buflen, - int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp) + struct hostent *result, char *buffer, size_t buflen, + int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp) { @@ -593,7 +615,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, char *h_addr_ptrs[0]; @@ -4340,18 +4340,18 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 *h_errnop = NO_RECOVERY; return NSS_STATUS_UNAVAIL; @@ -657,7 +679,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - packtmp, sizeof packtmp); + packtmp, sizeof packtmp); if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) { - if (__builtin_expect (errno, 0) == EMSGSIZE) + if (__glibc_unlikely (errno == EMSGSIZE)) - goto too_small; - + goto too_small; + n = -1; @@ -666,13 +688,19 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, if (n > 0 && bp[0] == '.') bp[0] = '\0'; - + - if (__builtin_expect (n < 0 || ((*name_ok) (bp) == 0 && (errno = EBADMSG)), - 0)) + if (__glibc_unlikely (n < 0)) @@ -4368,32 +4368,32 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + return NSS_STATUS_UNAVAIL; + } cp += n + QFIXEDSZ; - + if (qtype == T_A || qtype == T_AAAA) @@ -714,20 +742,20 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - packtmp, sizeof packtmp); + packtmp, sizeof packtmp); if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) - { + { - if (__builtin_expect (errno, 0) == EMSGSIZE) + if (__glibc_unlikely (errno == EMSGSIZE)) - goto too_small; - - n = -1; - } - + goto too_small; + + n = -1; + } + - if (__builtin_expect (n < 0 || (*name_ok) (bp) == 0, 0)) + if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0)) - { - ++had_error; - continue; - } + { + ++had_error; + continue; + } cp += n; /* name */ - + - if (__builtin_expect (cp + 10 > end_of_message, 0)) + if (__glibc_unlikely (cp + 10 > end_of_message)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -741,7 +769,15 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, cp += INT32SZ; /* TTL */ n = __ns_get16 (cp); @@ -4408,67 +4408,67 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + } + + if (__glibc_unlikely (class != C_IN)) - { - /* XXX - debug? syslog? */ - cp += n; + { + /* XXX - debug? syslog? */ + cp += n; @@ -757,7 +793,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1]) - continue; - n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); + if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1]) + continue; + n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); - if (__builtin_expect (n < 0 || (*name_ok) (tbuf) == 0, 0)) + if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -766,7 +802,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - /* Store alias. */ - *ap++ = bp; - n = strlen (bp) + 1; /* For the \0. */ + /* Store alias. */ + *ap++ = bp; + n = strlen (bp) + 1; /* For the \0. */ - if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN) + if (__glibc_unlikely (n >= MAXHOSTNAMELEN)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -775,9 +811,9 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - linebuflen -= n; - /* Get canonical name. */ - n = strlen (tbuf) + 1; /* For the \0. */ + linebuflen -= n; + /* Get canonical name. */ + n = strlen (tbuf) + 1; /* For the \0. */ - if (__builtin_expect (n > linebuflen, 0)) + if (__glibc_unlikely (n > linebuflen)) - goto too_small; + goto too_small; - if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN) + if (__glibc_unlikely (n >= MAXHOSTNAMELEN)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -795,7 +831,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - *ttlp = ttl; - - n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); + *ttlp = ttl; + + n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); - if (__builtin_expect (n < 0 || res_dnok (tbuf) == 0, 0)) + if (__glibc_unlikely (n < 0 || res_dnok (tbuf) == 0)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -803,9 +839,9 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - cp += n; - /* Get canonical name. */ - n = strlen (tbuf) + 1; /* For the \0. */ + cp += n; + /* Get canonical name. */ + n = strlen (tbuf) + 1; /* For the \0. */ - if (__builtin_expect (n > linebuflen, 0)) + if (__glibc_unlikely (n > linebuflen)) - goto too_small; + goto too_small; - if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN) + if (__glibc_unlikely (n >= MAXHOSTNAMELEN)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -818,16 +854,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - + if (type == T_A && qtype == T_AAAA && map) - have_to_map = 1; + have_to_map = 1; - else if (__builtin_expect (type != qtype, 0)) + else if (__glibc_unlikely (type != qtype)) - { + { - /* Log a low priority message if we get an unexpected record, but - skip it if we are using DNSSEC since it uses many different types - in responses that do not match QTYPE. */ @@ -4477,39 +4477,39 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - "gethostby*.getanswer: asked for \"%s %s %s\", " - "got type \"%s\"", - qname, p_class (C_IN), p_type (qtype), p_type (type)); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } @@ -835,9 +863,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, switch (type) - { - case T_PTR: + { + case T_PTR: - if (__builtin_expect (strcasecmp (tname, bp) != 0, 0)) + if (__glibc_unlikely (strcasecmp (tname, bp) != 0)) - { + { - syslog (LOG_NOTICE | LOG_AUTH, AskedForGot, qname, bp); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } @@ -846,65 +873,40 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - packtmp, sizeof packtmp); - if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) - { + packtmp, sizeof packtmp); + if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) + { - if (__builtin_expect (errno, 0) == EMSGSIZE) + if (__glibc_unlikely (errno == EMSGSIZE)) - goto too_small; - - n = -1; - } - + goto too_small; + + n = -1; + } + - if (__builtin_expect (n < 0 || res_hnok (bp) == 0, 0)) + if (__glibc_unlikely (n < 0 || res_hnok (bp) == 0)) - { - ++had_error; - break; - } - if (ttlp != NULL && ttl < *ttlp) - *ttlp = ttl; + { + ++had_error; + break; + } + if (ttlp != NULL && ttl < *ttlp) + *ttlp = ttl; -#if MULTI_PTRS_ARE_ALIASES - cp += n; - if (haveanswer == 0) @@ -4533,7 +4533,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 -#else + /* bind would put multiple PTR records as aliases, but we don't do + that. */ - result->h_name = bp; + result->h_name = bp; - if (have_to_map) - { - n = strlen (bp) + 1; /* for the \0 */ @@ -4547,18 +4547,18 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - if (map_v4v6_hostent (result, &bp, &linebuflen)) - goto too_small; - } - *h_errnop = NETDB_SUCCESS; - return NSS_STATUS_SUCCESS; + *h_errnop = NETDB_SUCCESS; + return NSS_STATUS_SUCCESS; -#endif - case T_A: - case T_AAAA: + case T_A: + case T_AAAA: - if (__builtin_expect (strcasecmp (result->h_name, bp), 0) != 0) + if (__glibc_unlikely (strcasecmp (result->h_name, bp) != 0)) - { + { - syslog (LOG_NOTICE | LOG_AUTH, AskedForGot, result->h_name, bp); - cp += n; - continue; /* XXX - had_error++ ? */ - } + cp += n; + continue; /* XXX - had_error++ ? */ + } + + /* Stop parsing at a record whose length is incorrect. */ + if (n != rrtype_to_rdata_length (type)) @@ -4568,27 +4568,27 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + } + + /* Skip records of the wrong type. */ - if (n != result->h_length) - { - cp += n; + if (n != result->h_length) + { + cp += n; @@ -912,7 +914,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - } - if (!haveanswer) - { + } + if (!haveanswer) + { - register int nn; + int nn; - - /* We compose a single hostent out of the entire chain of - entries, so the TTL of the hostent is essentially the lowest + + /* We compose a single hostent out of the entire chain of + entries, so the TTL of the hostent is essentially the lowest @@ -930,7 +932,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, - linebuflen -= sizeof (align) - ((u_long) bp % sizeof (align)); - bp += sizeof (align) - ((u_long) bp % sizeof (align)); - + linebuflen -= sizeof (align) - ((u_long) bp % sizeof (align)); + bp += sizeof (align) - ((u_long) bp % sizeof (align)); + - if (__builtin_expect (n > linebuflen, 0)) + if (__glibc_unlikely (n > linebuflen)) - goto too_small; - bp = __mempcpy (*hap++ = bp, cp, n); - cp += n; + goto too_small; + bp = __mempcpy (*hap++ = bp, cp, n); + cp += n; @@ -947,15 +949,14 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, { *ap = NULL; @@ -4605,9 +4605,9 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + if (haveanswer > 1 && qtype == T_A + && __resolv_context_sort_count (ctx) > 0) + addrsort (ctx, host_data->h_addr_ptrs, haveanswer); - + if (result->h_name == NULL) - { + { @@ -1001,7 +1002,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, int qdcount = ntohs (hp->qdcount); const u_char *cp = answer->buf + HFIXEDSZ; @@ -4623,13 +4623,13 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 { - if (__builtin_expect (errno, 0) == EMSGSIZE) + if (__glibc_unlikely (errno == EMSGSIZE)) - { - too_small: - *errnop = ERANGE; + { + too_small: + *errnop = ERANGE; @@ -1025,13 +1026,19 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, n = -1; } - + - if (__builtin_expect (n < 0 || (res_hnok (buffer) == 0 - && (errno = EBADMSG)), 0)) + if (__glibc_unlikely (n < 0)) @@ -4646,36 +4646,36 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + return NSS_STATUS_UNAVAIL; + } cp += n + QFIXEDSZ; - + int haveanswer = 0; @@ -1053,12 +1060,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, if (n != -1 && - (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1) - { + (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1) + { - if (__builtin_expect (errno, 0) == EMSGSIZE) + if (__glibc_unlikely (errno == EMSGSIZE)) - goto too_small; - - n = -1; - } + goto too_small; + + n = -1; + } - if (__builtin_expect (n < 0 || res_hnok (buffer) == 0, 0)) + if (__glibc_unlikely (n < 0 || res_hnok (buffer) == 0)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -1072,7 +1079,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - + cp += n; /* name */ - + - if (__builtin_expect (cp + 10 > end_of_message, 0)) + if (__glibc_unlikely (cp + 10 > end_of_message)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -1087,6 +1094,13 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, n = __ns_get16 (cp); cp += INT16SZ; /* len */ - + + if (end_of_message - cp < n) + { + /* RDATA extends beyond the end of the packet. */ @@ -4684,33 +4684,33 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + } + if (class != C_IN) - { - cp += n; + { + cp += n; @@ -1102,7 +1116,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - *ttlp = ttl; - - n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); + *ttlp = ttl; + + n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf); - if (__builtin_expect (n < 0 || res_hnok (tbuf) == 0, 0)) + if (__glibc_unlikely (n < 0 || res_hnok (tbuf) == 0)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -1119,9 +1133,9 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - } - - n = strlen (tbuf) + 1; + } + + n = strlen (tbuf) + 1; - if (__builtin_expect (n > buflen, 0)) + if (__glibc_unlikely (n > buflen)) - goto too_small; + goto too_small; - if (__builtin_expect (n >= MAXHOSTNAMELEN, 0)) + if (__glibc_unlikely (n >= MAXHOSTNAMELEN)) - { - ++had_error; - continue; + { + ++had_error; + continue; @@ -1134,32 +1148,25 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - } - continue; - } + } + continue; + } -#if 1 - // We should not see any types other than those explicitly listed - // below. Some types sent by server seem missing, though. Just @@ -4726,7 +4726,7 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 - { - /* We don't support DNSSEC yet. For now, ignore the record - and send a low priority message to syslog. - + - We also don't expect T_PTR or T_DNAME messages. */ - syslog (LOG_DEBUG | LOG_AUTH, - "getaddrinfo*.gaih_getanswer: got type \"%s\"", @@ -4744,29 +4744,29 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 + else + { + /* Skip unknown records. */ - cp += n; - continue; - } + cp += n; + continue; + } - if (type != T_A && type != T_AAAA) - abort (); - + + assert (type == T_A || type == T_AAAA); if (*pat == NULL) - { - uintptr_t pad = (-(uintptr_t) buffer + { + uintptr_t pad = (-(uintptr_t) buffer @@ -1167,8 +1174,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - buffer += pad; - buflen = buflen > pad ? buflen - pad : 0; - + buffer += pad; + buflen = buflen > pad ? buflen - pad : 0; + - if (__builtin_expect (buflen < sizeof (struct gaih_addrtuple), - 0)) + if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple))) - goto too_small; - - *pat = (struct gaih_addrtuple *) buffer; + goto too_small; + + *pat = (struct gaih_addrtuple *) buffer; @@ -1193,12 +1199,6 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - } - + } + (*pat)->family = type == T_A ? AF_INET : AF_INET6; - if (__builtin_expect ((type == T_A && n != INADDRSZ) - || (type == T_AAAA && n != IN6ADDRSZ), 0)) @@ -4790,30 +4790,30 @@ index 7fc154db5d3130a3..1e85e4f08ffc8600 100644 a more robust implementation. @@ -1297,12 +1297,12 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2, ---------------------------------------------- - + [1] If the first response is a success we return success. - This ignores the state of the second answer and in fact - incorrectly sets errno and h_errno to that of the second + This ignores the state of the second answer and in fact + incorrectly sets errno and h_errno to that of the second - answer. However because the response is a success we ignore - *errnop and *h_errnop (though that means you touched errno on + answer. However because the response is a success we ignore + *errnop and *h_errnop (though that means you touched errno on - success). We are being conservative here and returning the - likely IPv4 response in the first answer as a success. + success). We are being conservative here and returning the + likely IPv4 response in the first answer as a success. - + [2] If the first response is a recoverable TRYAGAIN we return - that instead of looking at the second response. The + that instead of looking at the second response. The @@ -1356,7 +1356,7 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2, if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND) - status = status2; + status = status2; /* Do not return a truncated second response (unless it was - unavoidable e.g. unrecoverable TRYAGAIN). */ + unavoidable e.g. unrecoverable TRYAGAIN). */ if (status == NSS_STATUS_SUCCESS - && (status2 == NSS_STATUS_TRYAGAIN - && *errnop == ERANGE && *h_errnop != NO_RECOVERY)) + && (status2 == NSS_STATUS_TRYAGAIN + && *errnop == ERANGE && *h_errnop != NO_RECOVERY)) diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c index ccf871c8e4cb25e0..f190eb2225d39d16 100644 --- a/resolv/nss_dns/dns-network.c @@ -4824,26 +4824,26 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Extended from original form by Ulrich Drepper , 1996. - + @@ -62,9 +61,14 @@ #include #include #include +#include +#include - + #include "nsswitch.h" #include +#include +#include +#include - + /* Maximum number of aliases we allow. */ #define MAX_NR_ALIASES 48 @@ -91,13 +95,6 @@ typedef union querybuf u_char buf[MAXPACKET]; } querybuf; - + -/* These functions are defined in res_comp.c. */ -#define NS_MAXCDNAME 255 /* maximum compressed domain name */ -extern int __ns_name_ntop (const u_char *, char *, size_t) __THROW; @@ -4853,11 +4853,11 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 - /* Prototypes for local functions. */ static enum nss_status getanswer_r (const querybuf *answer, int anslen, - struct netent *result, char *buffer, + struct netent *result, char *buffer, @@ -120,19 +117,26 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result, int anslen; enum nss_status status; - + - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; + struct resolv_context *ctx = __resolv_context_get (); @@ -4867,9 +4867,9 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 + *herrnop = NETDB_INTERNAL; + return NSS_STATUS_UNAVAIL; + } - + net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - + - anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); + anslen = __res_context_search @@ -4880,23 +4880,23 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 /* Nothing found. */ *errnop = errno; if (net_buffer.buf != orig_net_buffer) - free (net_buffer.buf); + free (net_buffer.buf); + __resolv_context_put (ctx); return (errno == ECONNREFUSED - || errno == EPFNOSUPPORT - || errno == EAFNOSUPPORT) + || errno == EPFNOSUPPORT + || errno == EAFNOSUPPORT) @@ -143,6 +147,7 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result, - errnop, herrnop, BYNAME); + errnop, herrnop, BYNAME); if (net_buffer.buf != orig_net_buffer) free (net_buffer.buf); + __resolv_context_put (ctx); return status; } - + @@ -170,8 +175,13 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result, if (type != AF_INET) return NSS_STATUS_UNAVAIL; - + - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; + struct resolv_context *ctx = __resolv_context_get (); @@ -4906,13 +4906,13 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 + *herrnop = NETDB_INTERNAL; + return NSS_STATUS_UNAVAIL; + } - + net2 = (u_int32_t) net; for (cnt = 4; net2 != 0; net2 >>= 8) @@ -201,8 +211,8 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result, - + net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - + - anslen = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); + anslen = __res_context_query (ctx, qbuf, C_IN, T_PTR, net_buffer.buf->buf, @@ -4923,37 +4923,37 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 @@ -210,6 +220,7 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result, __set_errno (olderr); if (net_buffer.buf != orig_net_buffer) - free (net_buffer.buf); + free (net_buffer.buf); + __resolv_context_put (ctx); return (err == ECONNREFUSED - || err == EPFNOSUPPORT - || err == EAFNOSUPPORT) + || err == EPFNOSUPPORT + || err == EAFNOSUPPORT) @@ -230,13 +241,11 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result, result->n_net = u_net; } - + + __resolv_context_put (ctx); return status; } - - + + -#undef offsetof -#define offsetof(Type, Member) ((size_t) &((Type *) NULL)->Member) - static enum nss_status getanswer_r (const querybuf *answer, int anslen, struct netent *result, - char *buffer, size_t buflen, int *errnop, int *h_errnop, + char *buffer, size_t buflen, int *errnop, int *h_errnop, @@ -265,7 +274,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct net_data); buffer += pad; - + - if (__builtin_expect (buflen < sizeof (*net_data) + pad, 0)) + if (__glibc_unlikely (buflen < sizeof (*net_data) + pad)) { /* The buffer is too small. */ too_small: @@ -326,11 +335,8 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, - + while (--answer_count >= 0 && cp < end_of_message) { - int n = dn_expand (answer->buf, end_of_message, cp, bp, linebuflen); @@ -4964,11 +4964,11 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 + int n = __ns_name_unpack (answer->buf, end_of_message, cp, + packtmp, sizeof packtmp); if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) - { - if (errno == EMSGSIZE) + { + if (errno == EMSGSIZE) @@ -345,10 +351,24 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, if (n < 0 || res_dnok (bp) == 0) - break; + break; cp += n; + + if (end_of_message - cp < 10) @@ -4989,13 +4989,13 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 + __set_h_errno (NO_RECOVERY); + return NSS_STATUS_UNAVAIL; + } - + if (class == C_IN && type == T_PTR) - { + { @@ -370,7 +390,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, - cp += n; - return NSS_STATUS_UNAVAIL; - } + cp += n; + return NSS_STATUS_UNAVAIL; + } - cp += n; + cp += rdatalen; if (alias_pointer + 2 < &net_data->aliases[MAX_NR_ALIASES]) @@ -5004,24 +5004,24 @@ index ccf871c8e4cb25e0..f190eb2225d39d16 100644 @@ -381,6 +401,9 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, ++have_answer; } - } + } + else + /* Skip over unknown record data. */ + cp += rdatalen; } - + if (have_answer) @@ -395,8 +418,8 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, - - case BYNAME: - { + + case BYNAME: + { - char **ap = result->n_aliases++; - while (*ap != NULL) + char **ap; + for (ap = result->n_aliases; *ap != NULL; ++ap) - { - /* Check each alias name for being of the forms: - 4.3.2.1.in-addr.arpa = net 1.2.3.4 + { + /* Check each alias name for being of the forms: + 4.3.2.1.in-addr.arpa = net 1.2.3.4 diff --git a/resolv/res-close.c b/resolv/res-close.c new file mode 100644 index 0000000000000000..21f038c2c77f7375 @@ -5179,7 +5179,7 @@ index 3a2a4d5649c9af3f..4d4245459bfc68ca 100644 -/* Copyright (C) 1996, 97, 98, 2002, 2003, 2011 Free Software Foundation, Inc. +/* Copyright (C) 1996-2017 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 diff --git a/resolv/res_comp.c b/resolv/res_comp.c index c7212fab11deda78..ffb2ed59147d3680 100644 @@ -5188,7 +5188,7 @@ index c7212fab11deda78..ffb2ed59147d3680 100644 @@ -64,11 +64,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: res_comp.c,v 8.15 1999/10/13 16:39:39 vixie Exp $"; @@ -5198,7 +5198,7 @@ index c7212fab11deda78..ffb2ed59147d3680 100644 #include #include @@ -81,7 +76,7 @@ static const char rcsid[] = "$BINDId: res_comp.c,v 8.15 1999/10/13 16:39:39 vixi - + /* * Expand compressed domain name 'comp_dn' to full domain name. - * 'msg' is a pointer to the begining of the message, @@ -5209,7 +5209,7 @@ index c7212fab11deda78..ffb2ed59147d3680 100644 @@ -233,7 +228,6 @@ res_dnok(const char *dn) { } libresolv_hidden_def (res_dnok) - + -#ifdef BIND_4_COMPAT /* * This module must export the following externally-visible symbols: @@ -5224,7 +5224,7 @@ index c7212fab11deda78..ffb2ed59147d3680 100644 -#endif /*__ultrix__*/ -#endif /*BIND_4_COMPAT*/ - + #include diff --git a/resolv/res_data.c b/resolv/res_data.c index 1beea1dc4fb8c2c4..2cafd3805548d8e4 100644 @@ -5255,7 +5255,7 @@ index 1beea1dc4fb8c2c4..2cafd3805548d8e4 100644 @@ -15,322 +33,22 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$BINDId: res_data.c,v 8.17 1999/10/13 17:11:31 vixie Exp $"; -#endif /* LIBC_SCCS and not lint */ @@ -5370,7 +5370,7 @@ index 1beea1dc4fb8c2c4..2cafd3805548d8e4 100644 - return (__res_vinit(&_res, 1)); -} -#endif - + +/* This function belongs to libresolv, which is why it is not included + in res-close.c. */ void @@ -5596,7 +5596,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 @@ -89,11 +89,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: res_debug.c,v 8.34 2000/02/29 05:30:55 vixie Exp $"; @@ -5610,13 +5610,13 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 #include #include +#include - + #ifdef SPRINTF_CHAR # define SPRINTF(x) strlen(sprintf/**/x) @@ -120,6 +116,36 @@ static const char rcsid[] = "$BINDId: res_debug.c,v 8.34 2000/02/29 05:30:55 vix - + extern const char *_res_sectioncodes[] attribute_hidden; - + +/* _res_opcodes was exported by accident as a variable. */ +#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_26) +static const char *res_opcodes[] = @@ -5652,40 +5652,40 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 */ @@ -135,9 +161,7 @@ fp_resstat(const res_state statp, FILE *file) { } - + static void -do_section(const res_state statp, - ns_msg *handle, ns_sect section, - int pflag, FILE *file) +do_section (int pfcode, ns_msg *handle, ns_sect section, int pflag, FILE *file) { - int n, sflag, rrnum; - static int buflen = 2048; + int n, sflag, rrnum; + static int buflen = 2048; @@ -148,8 +172,8 @@ do_section(const res_state statp, - /* - * Print answer records. - */ + /* + * Print answer records. + */ - sflag = (statp->pfcode & pflag); - if (statp->pfcode && !sflag) + sflag = (pfcode & pflag); + if (pfcode && !sflag) - return; - - buf = malloc(buflen); + return; + + buf = malloc(buflen); @@ -166,11 +190,11 @@ do_section(const res_state statp, - fprintf(file, ";; ns_parserr: %s\n", - strerror(errno)); - else if (rrnum > 0 && sflag != 0 && + fprintf(file, ";; ns_parserr: %s\n", + strerror(errno)); + else if (rrnum > 0 && sflag != 0 && - (statp->pfcode & RES_PRF_HEAD1)) + (pfcode & RES_PRF_HEAD1)) - putc('\n', file); - goto cleanup; - } + putc('\n', file); + goto cleanup; + } - if (rrnum == 0 && sflag != 0 && (statp->pfcode & RES_PRF_HEAD1)) + if (rrnum == 0 && sflag != 0 && (pfcode & RES_PRF_HEAD1)) - fprintf(file, ";; %s SECTION:\n", - p_section(section, opcode)); - if (section == ns_s_qd) + fprintf(file, ";; %s SECTION:\n", + p_section(section, opcode)); + if (section == ns_s_qd) @@ -212,11 +236,19 @@ do_section(const res_state statp, * This is intended to be primarily a debugging routine. */ @@ -5693,10 +5693,10 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 -res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) { +fp_nquery (const unsigned char *msg, int len, FILE *file) +{ - ns_msg handle; - int qdcount, ancount, nscount, arcount; - u_int opcode, rcode, id; - + ns_msg handle; + int qdcount, ancount, nscount, arcount; + u_int opcode, rcode, id; + + /* There is no need to initialize _res: If _res is not yet + initialized, _res.pfcode is zero. But initialization will + leave it at zero, too. _res.pfcode is an unsigned long, @@ -5704,48 +5704,48 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + so use that. */ + int pfcode = _res.pfcode; + - if (ns_initparse(msg, len, &handle) < 0) { - fprintf(file, ";; ns_initparse: %s\n", strerror(errno)); - return; + if (ns_initparse(msg, len, &handle) < 0) { + fprintf(file, ";; ns_initparse: %s\n", strerror(errno)); + return; @@ -232,13 +264,13 @@ res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) { - /* - * Print header fields. - */ + /* + * Print header fields. + */ - if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEADX) || rcode) + if ((!pfcode) || (pfcode & RES_PRF_HEADX) || rcode) - fprintf(file, - ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n", + fprintf(file, + ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n", - _res_opcodes[opcode], p_rcode(rcode), id); - if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEADX)) + res_opcodes[opcode], p_rcode(rcode), id); + if ((!pfcode) || (pfcode & RES_PRF_HEADX)) - putc(';', file); + putc(';', file); - if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEAD2)) { + if ((!pfcode) || (pfcode & RES_PRF_HEAD2)) { - fprintf(file, "; flags:"); - if (ns_msg_getflag(handle, ns_f_qr)) - fprintf(file, " qr"); + fprintf(file, "; flags:"); + if (ns_msg_getflag(handle, ns_f_qr)) + fprintf(file, " qr"); @@ -257,7 +289,7 @@ res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) { - if (ns_msg_getflag(handle, ns_f_cd)) - fprintf(file, " cd"); - } + if (ns_msg_getflag(handle, ns_f_cd)) + fprintf(file, " cd"); + } - if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEAD1)) { + if ((!pfcode) || (pfcode & RES_PRF_HEAD1)) { - fprintf(file, "; %s: %d", - p_section(ns_s_qd, opcode), qdcount); - fprintf(file, ", %s: %d", + fprintf(file, "; %s: %d", + p_section(ns_s_qd, opcode), qdcount); + fprintf(file, ", %s: %d", @@ -267,21 +299,35 @@ res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) { - fprintf(file, ", %s: %d", - p_section(ns_s_ar, opcode), arcount); - } + fprintf(file, ", %s: %d", + p_section(ns_s_ar, opcode), arcount); + } - if ((!statp->pfcode) || (statp->pfcode & + if ((!pfcode) || (pfcode & - (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) { - putc('\n',file); - } - /* - * Print the various sections. - */ + (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) { + putc('\n',file); + } + /* + * Print the various sections. + */ - do_section(statp, &handle, ns_s_qd, RES_PRF_QUES, file); - do_section(statp, &handle, ns_s_an, RES_PRF_ANS, file); - do_section(statp, &handle, ns_s_ns, RES_PRF_AUTH, file); @@ -5754,9 +5754,9 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + do_section (pfcode, &handle, ns_s_an, RES_PRF_ANS, file); + do_section (pfcode, &handle, ns_s_ns, RES_PRF_AUTH, file); + do_section (pfcode, &handle, ns_s_ar, RES_PRF_ADD, file); - if (qdcount == 0 && ancount == 0 && - nscount == 0 && arcount == 0) - putc('\n', file); + if (qdcount == 0 && ancount == 0 && + nscount == 0 && arcount == 0) + putc('\n', file); } +libresolv_hidden_def (fp_nquery) + @@ -5772,12 +5772,12 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 +{ + fp_query (msg, stdout); +} - + const u_char * p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) { @@ -307,11 +353,8 @@ p_cdname(const u_char *cp, const u_char *msg, FILE *file) { length supplied). */ - + const u_char * -p_fqnname(cp, msg, msglen, name, namelen) - const u_char *cp, *msg; @@ -5787,8 +5787,8 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 +p_fqnname (const u_char *cp, const u_char *msg, int msglen, char *name, + int namelen) { - int n, newlen; - + int n, newlen; + @@ -350,13 +393,13 @@ p_fqname(const u_char *cp, const u_char *msg, FILE *file) { extern const struct res_sym __p_class_syms[]; libresolv_hidden_proto (__p_class_syms) @@ -5809,7 +5809,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + {C_IN, NULL, NULL} }; libresolv_hidden_data_def (__p_class_syms) - + @@ -364,93 +407,75 @@ libresolv_hidden_data_def (__p_class_syms) * Names of message sections. */ @@ -5825,7 +5825,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + {ns_s_ar, (char *) "ADDITIONAL"}, + {0, NULL, NULL} }; - + const struct res_sym __p_update_section_syms[] attribute_hidden = { - {S_ZONE, "ZONE"}, - {S_PREREQ, "PREREQUISITE"}, @@ -5856,7 +5856,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + {S_ADDT, (char *) "ADDITIONAL"}, + {0, NULL, NULL} }; - + /* - * Names of RR types and qtypes. Types and qtypes are the same, except - * that T_ANY is a qtype but not a type. (You can ask for records of type @@ -5962,7 +5962,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + {0, NULL, NULL} }; libresolv_hidden_data_def (__p_type_syms) - + @@ -458,22 +483,22 @@ libresolv_hidden_data_def (__p_type_syms) * Names of DNS rcodes. */ @@ -6000,7 +6000,7 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 + {ns_r_badtime, (char *) "BADTIME", (char *) "bad time"}, + {0, NULL, NULL} }; - + int @@ -538,7 +563,7 @@ libresolv_hidden_def (p_type) /* @@ -6009,37 +6009,37 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 -const char * +static const char * p_section(int section, int opcode) { - const struct res_sym *symbols; - + const struct res_sym *symbols; + @@ -572,9 +597,7 @@ p_option(u_long option) { - switch (option) { - case RES_INIT: return "init"; - case RES_DEBUG: return "debug"; + switch (option) { + case RES_INIT: return "init"; + case RES_DEBUG: return "debug"; - case RES_AAONLY: return "aaonly(unimpl)"; - case RES_USEVC: return "usevc"; - case RES_PRIMARY: return "primry(unimpl)"; + case RES_USEVC: return "use-vc"; - case RES_IGNTC: return "igntc"; - case RES_RECURSE: return "recurs"; - case RES_DEFNAMES: return "defnam"; + case RES_IGNTC: return "igntc"; + case RES_RECURSE: return "recurs"; + case RES_DEFNAMES: return "defnam"; @@ -582,13 +605,15 @@ p_option(u_long option) { - case RES_DNSRCH: return "dnsrch"; - case RES_INSECURE1: return "insecure1"; - case RES_INSECURE2: return "insecure2"; + case RES_DNSRCH: return "dnsrch"; + case RES_INSECURE1: return "insecure1"; + case RES_INSECURE2: return "insecure2"; + case RES_NOALIASES: return "noaliases"; - case DEPRECATED_RES_USE_INET6: return "inet6"; - case RES_ROTATE: return "rotate"; + case DEPRECATED_RES_USE_INET6: return "inet6"; + case RES_ROTATE: return "rotate"; - case RES_NOCHECKNAME: return "no-check-names"; - case RES_USEBSTRING: return "ip6-bytstring"; - case RES_USE_EDNS0: return "edns0"; + case RES_USE_EDNS0: return "edns0"; + case RES_SNGLKUP: return "single-request"; + case RES_SNGLKUPREOP: return "single-request-reopen"; - case RES_USE_DNSSEC: return "dnssec"; - case RES_NOTLDQUERY: return "no-tld-query"; + case RES_USE_DNSSEC: return "dnssec"; + case RES_NOTLDQUERY: return "no-tld-query"; + case RES_NORELOAD: return "no-reload"; - /* XXX nonreentrant */ - default: sprintf(nbuf, "?0x%lx?", (u_long)option); - return (nbuf); + /* XXX nonreentrant */ + default: sprintf(nbuf, "?0x%lx?", (u_long)option); + return (nbuf); @@ -784,9 +809,7 @@ latlon2ul (const char **latlonstrptr, int *which) /* converts a zone file representation in a string to an RDATA on-the-wire * representation. */ @@ -6049,10 +6049,10 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 - u_char *binary; +loc_aton (const char *ascii, u_char *binary) { - const char *cp, *maxcp; - u_char *bcp; + const char *cp, *maxcp; + u_char *bcp; @@ -895,9 +918,7 @@ loc_aton(ascii, binary) - + /* takes an on-the-wire LOC RR and formats it in a human readable format. */ const char * -loc_ntoa(binary, ascii) @@ -6060,23 +6060,23 @@ index 6549e4ba5ee77f93..919b86e2b37dc150 100644 - char *ascii; +loc_ntoa (const u_char *binary, char *ascii) { - static const char error[] = "?"; - static char tmpbuf[sizeof + static const char error[] = "?"; + static char tmpbuf[sizeof @@ -1041,13 +1062,8 @@ p_secstodate (u_long secs) { - time_t clock = secs; - struct tm *time; - + time_t clock = secs; + struct tm *time; + -#ifdef HAVE_TIME_R - struct tm timebuf; + struct tm timebuf; - - time = gmtime_r(&clock, &timebuf); -#else - time = gmtime(&clock); -#endif + time = __gmtime_r(&clock, &timebuf); - time->tm_year += 1900; - time->tm_mon += 1; - sprintf(output, "%04d%02d%02d%02d%02d%02d", + time->tm_year += 1900; + time->tm_mon += 1; + sprintf(output, "%04d%02d%02d%02d%02d%02d", diff --git a/resolv/res_debug.h b/resolv/res_debug.h deleted file mode 100644 index 4a0aa99ab48f362c..0000000000000000 @@ -6116,7 +6116,7 @@ index 4a0aa99ab48f362c..0000000000000000 - } else {} -#endif - --#endif /* _RES_DEBUG_H_ */ +-#endif /* _RES_DEBUG_H_ */ diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c index 66383deea81cf3eb..8fc06e9abdc084f6 100644 --- a/resolv/res_hconf.c @@ -6127,16 +6127,16 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 +/* Copyright (C) 1993-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger (davidm@azstarnet.com). - + @@ -22,9 +21,6 @@ Though mostly compatibly, the following differences exist compared to the original implementation: - + - - new command "spoof" takes an arguments like RESOLV_SPOOF_CHECK - environment variable (i.e., `off', `nowarn', or `warn'). - - - line comments can appear anywhere (not just at the beginning of - a line) + - line comments can appear anywhere (not just at the beginning of + a line) */ @@ -42,16 +38,20 @@ #include @@ -6152,9 +6152,9 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 +#if IS_IN (libc) +# define fgets_unlocked __fgets_unlocked +#endif - + #define _PATH_HOSTCONF "/etc/host.conf" - + /* Environment vars that all user to override default behavior: */ #define ENV_HOSTCONF "RESOLV_HOST_CONF" -#define ENV_SPOOF "RESOLV_SPOOF_CHECK" @@ -6168,7 +6168,7 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 - CB_arg_spoof, CB_arg_bool }; - + @@ -74,10 +73,7 @@ static const struct cmd { {"order", CB_none, 0}, @@ -6179,10 +6179,10 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 - {"spoofalert", CB_arg_bool, HCONF_FLAG_SPOOFALERT}, {"reorder", CB_arg_bool, HCONF_FLAG_REORDER} }; - + @@ -160,28 +156,6 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args) - - + + static const char * -arg_spoof (const char *fname, int line_num, const char *args) -{ @@ -6210,7 +6210,7 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 { if (__strncasecmp (args, "on", 2) == 0) @@ -257,8 +231,6 @@ parse_line (const char *fname, int line_num, const char *str) - + if (c->cb == CB_arg_trimdomain_list) str = arg_trimdomain_list (fname, line_num, str); - else if (c->cb == CB_arg_spoof) @@ -6221,7 +6221,7 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 @@ -321,10 +293,6 @@ do_init (void) fclose (fp); } - + - envval = getenv (ENV_SPOOF); - if (envval) - arg_spoof (ENV_SPOOF, 1, envval); @@ -6232,16 +6232,16 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 @@ -344,7 +312,8 @@ do_init (void) arg_trimdomain_list (ENV_TRIM_OVERR, 1, envval); } - + - _res_hconf.initialized = 1; + /* See comments on the declaration of _res_hconf. */ + atomic_store_release (&_res_hconf.initialized, 1); } - - + + @@ -360,6 +329,7 @@ _res_hconf_init (void) - - + + #if IS_IN (libc) +# if defined SIOCGIFCONF && defined SIOCGIFNETMASK /* List of known interfaces. */ @@ -6252,7 +6252,7 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 } u; } *ifaddrs); +# endif - + /* Reorder addresses returned in a hostent such that the first address is an address on the local subnet, if there is such an address. @@ -386,9 +357,14 @@ _res_hconf_reorder_addrs (struct hostent *hp) @@ -6270,12 +6270,12 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 + acquired during initialization. Afterwards, a positive num_ifs + value indicates completed initialization. */ __libc_lock_define_initialized (static, lock); - + /* Only reorder if we're supposed to. */ @@ -399,7 +375,10 @@ _res_hconf_reorder_addrs (struct hostent *hp) if (hp->h_addrtype != AF_INET) return; - + - if (num_ifs <= 0) + /* This load synchronizes with the release MO store in the + initialization block below. */ @@ -6286,16 +6286,16 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 int sd, num, i; @@ -409,16 +388,26 @@ _res_hconf_reorder_addrs (struct hostent *hp) /* Initialize interface table. */ - + /* The SIOCGIFNETMASK ioctl will only work on an AF_INET socket. */ - sd = __socket (AF_INET, SOCK_DGRAM, 0); + sd = __socket (AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (sd < 0) - return; - + return; + /* Get lock. */ __libc_lock_lock (lock); - + - /* Recheck, somebody else might have done the work by done. */ - if (num_ifs <= 0) + /* Recheck, somebody else might have done the work by now. No @@ -6304,49 +6304,49 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 + the analysis below. */ + num_ifs_local = atomic_load_relaxed (&num_ifs); + if (num_ifs_local <= 0) - { + { + /* This is the only block which writes to num_ifs. It can + be executed several times (sequentially) if + initialization does not yield any interfaces, and num_ifs + remains zero. However, once we stored a positive value + in num_ifs below, this block cannot be entered again due + to the condition above. */ - int new_num_ifs = 0; - - /* Get a list of interfaces. */ + int new_num_ifs = 0; + + /* Get a list of interfaces. */ @@ -434,18 +423,24 @@ _res_hconf_reorder_addrs (struct hostent *hp) - for (cur_ifr = ifr, i = 0; i < num; - cur_ifr = __if_nextreq (cur_ifr), ++i) - { + for (cur_ifr = ifr, i = 0; i < num; + cur_ifr = __if_nextreq (cur_ifr), ++i) + { + union + { + struct sockaddr sa; + struct sockaddr_in sin; + } ss; + - if (cur_ifr->ifr_addr.sa_family != AF_INET) - continue; - - ifaddrs[new_num_ifs].addrtype = AF_INET; + if (cur_ifr->ifr_addr.sa_family != AF_INET) + continue; + + ifaddrs[new_num_ifs].addrtype = AF_INET; - ifaddrs[new_num_ifs].u.ipv4.addr = - ((struct sockaddr_in *) &cur_ifr->ifr_addr)->sin_addr.s_addr; + ss.sa = cur_ifr->ifr_addr; + ifaddrs[new_num_ifs].u.ipv4.addr = ss.sin.sin_addr.s_addr; - - if (__ioctl (sd, SIOCGIFNETMASK, cur_ifr) < 0) - continue; - + + if (__ioctl (sd, SIOCGIFNETMASK, cur_ifr) < 0) + continue; + - ifaddrs[new_num_ifs].u.ipv4.mask = - ((struct sockaddr_in *) &cur_ifr->ifr_netmask)->sin_addr.s_addr; + ss.sa = cur_ifr->ifr_netmask; + ifaddrs[new_num_ifs].u.ipv4.mask = ss.sin.sin_addr.s_addr; - - /* Now we're committed to this entry. */ - ++new_num_ifs; + + /* Now we're committed to this entry. */ + ++new_num_ifs; @@ -461,7 +456,14 @@ _res_hconf_reorder_addrs (struct hostent *hp) - /* Release lock, preserve error value, and close socket. */ - errno = save; - + /* Release lock, preserve error value, and close socket. */ + errno = save; + - num_ifs = new_num_ifs; + /* Advertise successful initialization if new_num_ifs is + positive (and no updates to ifaddrs are permitted after @@ -6356,20 +6356,20 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 + atomic_store_release (&num_ifs, new_num_ifs); + /* Keep the local copy current, to save another load. */ + num_ifs_local = new_num_ifs; - } - + } + __libc_lock_unlock (lock); @@ -469,15 +471,43 @@ _res_hconf_reorder_addrs (struct hostent *hp) __close (sd); } - + - if (num_ifs == 0) + /* num_ifs_local cannot be negative because the if statement above + covered this case. It can still be zero if we just performed + initialization, but could not find any interfaces. */ + if (num_ifs_local == 0) return; - + + /* The code below accesses ifaddrs, so we need to ensure that the + initialization happens-before this point. + @@ -6399,12 +6399,12 @@ index 66383deea81cf3eb..8fc06e9abdc084f6 100644 for (i = 0; hp->h_addr_list[i]; ++i) { struct in_addr *haddr = (struct in_addr *) hp->h_addr_list[i]; - + - for (j = 0; j < num_ifs; ++j) + for (j = 0; j < num_ifs_local; ++j) - { - u_int32_t if_addr = ifaddrs[j].u.ipv4.addr; - u_int32_t if_netmask = ifaddrs[j].u.ipv4.mask; + { + u_int32_t if_addr = ifaddrs[j].u.ipv4.addr; + u_int32_t if_netmask = ifaddrs[j].u.ipv4.mask; diff --git a/resolv/res_hconf.h b/resolv/res_hconf.h index 90c56eb61a87ba26..209f76a0d6ef8193 100644 --- a/resolv/res_hconf.h @@ -6414,9 +6414,9 @@ index 90c56eb61a87ba26..209f76a0d6ef8193 100644 +/* Copyright (C) 1993-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger (davidm@azstarnet.com). - + @@ -25,6 +25,15 @@ - + struct hconf { + /* We keep the INITIALIZED member only for backwards compatibility. New @@ -6441,7 +6441,7 @@ index 90c56eb61a87ba26..209f76a0d6ef8193 100644 # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */ }; extern struct hconf _res_hconf; - + -extern void _res_hconf_init (void); +extern void _res_hconf_init (void) attribute_hidden; extern void _res_hconf_trim_domain (char *domain); @@ -6476,7 +6476,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 @@ -64,19 +82,16 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; -static const char rcsid[] = "$BINDId: res_init.c,v 8.16 2000/05/09 07:10:12 vixie Exp $"; @@ -6502,10 +6502,10 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 +#include +#include +#include - + -#include +static uint32_t net_mask (struct in_addr); - + -/* Options. Should all be left alone. */ -#define RESOLVSORT -#define RFC1535 @@ -6516,7 +6516,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + return __res_vinit (statp, 0); +} +libc_hidden_def (__res_ninit) - + -static void res_setoptions (res_state, const char *, const char *) - internal_function; +/* Return true if CH separates the netmask in the "sortlist" @@ -6526,7 +6526,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 +{ + return ch == '/' || ch == '&'; +} - + -#ifdef RESOLVSORT -static const char sort_mask_chars[] = "/&"; -#define ISSORTMASK(ch) (strchr(sort_mask_chars, ch) != NULL) @@ -6559,23 +6559,23 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 +struct resolv_conf_parser +{ + char *buffer; /* Temporary buffer for reading lines. */ - + -#if !defined(isascii) /* XXX - could be a function */ -# define isascii(c) (!(c & 0200)) -#endif + struct nameserver_list nameserver_list; /* Nameserver addresses. */ - + -#ifdef _LIBC -unsigned long long int __res_initstamp attribute_hidden; -#endif + char *search_list_store; /* Backing storage for search list entries. */ + struct search_list search_list; /* Points into search_list_store. */ - + -/* - * Resolver state default settings. - */ + struct sort_list sort_list; /* Address preference sorting list. */ - + -/* - * Set up default settings. If the configuration file exist, the values - * there will have precedence. Otherwise, the server address is set to @@ -6605,7 +6605,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + __resolv_conf_attach. */ + struct resolv_conf template; +}; - + - return (__res_vinit(statp, 0)); +/* Return true if *PREINIT contains actual preinitialization. */ +static bool @@ -6619,7 +6619,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 -#ifdef _LIBC -libc_hidden_def (__res_ninit) -#endif - + -/* This function has to be reachable by res_data.c but not publically. */ -int -__res_vinit(res_state statp, int preinit) { @@ -6971,7 +6971,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + } + parser->template.ndots = 1; } - + static void -internal_function -res_setoptions(res_state statp, const char *options, const char *source) { @@ -7068,7 +7068,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + search_list_free (&parser->search_list); + sort_list_free (&parser->sort_list); } - + -#ifdef RESOLVSORT -/* XXX - should really support CIDR which means explicit masks always. */ -static u_int32_t @@ -7095,7 +7095,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + return (struct sockaddr *) sa4; } -#endif - + -u_int -res_randomid(void) { - return 0xffff & __getpid(); @@ -7126,9 +7126,9 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 -#ifdef _LIBC -libc_hidden_def (__res_randomid) -#endif - + +static void res_setoptions (struct resolv_conf_parser *, const char *options); - + -/* - * This routine is for closing the socket if a virtual circuit is used and - * the program wants to close it. This provides support for endhostent() @@ -7457,7 +7457,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + return true; } -libc_hidden_def (__res_iclose) - + -void -res_nclose(res_state statp) +struct resolv_conf * @@ -7550,7 +7550,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 + else + return -1; +} - + - __res_iclose (&_res, true); /* Close any VC sockets. */ +static void +res_setoptions (struct resolv_conf_parser *parser, const char *options) @@ -7628,7 +7628,7 @@ index 0ed74e0520131418..4e1f9fe8dea93e8a 100644 +net_mask (struct in_addr in) +{ + uint32_t i = ntohl (in.s_addr); - + - /* Make sure we do a full re-initialization the next time. */ - _res.options = 0; + if (IN_CLASSA (i)) @@ -7696,7 +7696,7 @@ index 48d3200b7e2cd913..9f2d3c3bd442bb38 100644 - extern int __res_vinit(res_state, int); +#include +#include - + - /* - * These three fields used to be statically initialized. This made - * it hard to use this code in a shared library. It is necessary, @@ -7812,12 +7812,12 @@ index 48d3200b7e2cd913..9f2d3c3bd442bb38 100644 - -#include +struct __res_state _res __attribute__ ((nocommon)); - + #undef __resp __thread struct __res_state *__resp = &_res; extern __thread struct __res_state *__libc_resp __attribute__ ((alias ("__resp"))) attribute_hidden; - + +#include + /* We declare this with compat_symbol so that it's not @@ -7827,7 +7827,7 @@ index 48d3200b7e2cd913..9f2d3c3bd442bb38 100644 +#ifdef SHARED compat_symbol (libc, _res, _res, GLIBC_2_0); #endif - + -#include - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2) @@ -7864,7 +7864,7 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 @@ -64,202 +82,222 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: res_mkquery.c,v 8.12 1999/10/13 16:39:40 vixie Exp $"; @@ -7882,7 +7882,7 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 #include +#include +#include - + -/* Options. Leave them on. */ -/* #define DEBUG */ - @@ -7896,7 +7896,7 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 +#if HP_TIMING_AVAIL +# define RANDOM_BITS(Var) { uint64_t v64; HP_TIMING_NOW (v64); Var = v64; } #endif - + -/* - * Form all types of queries. - * Returns the size of the result or -1. @@ -8119,10 +8119,10 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + return result; } -libresolv_hidden_def (res_nmkquery) - + +/* Form all types of queries. Returns the size of the result or -1 on + error. - + -/* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ -#ifndef T_OPT -#define T_OPT 41 @@ -8132,7 +8132,7 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + class and type. DATA can be NULL; otherwise, it is a pointer to a + domain name which is included in the generated packet (if op == + NS_NOTIFY_OP). BUF must point to the out buffer of BUFLEN bytes. - + + DATALEN and NEWRR_IN are currently ignored. */ int -__res_nopt(res_state statp, @@ -8151,7 +8151,7 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + (__resolv_context_get_override (statp), + op, dname, class, type, data, buf, buflen); +} - + -#ifdef DEBUG - if ((statp->options & RES_DEBUG) != 0U) - printf(";; res_nopt()\n"); @@ -8166,13 +8166,13 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + (__resolv_context_get_preinit (), + op, dname, class, type, data, buf, buflen); +} - + - HEADER *hp = (HEADER *) buf; - u_char *cp = buf + n0; - u_char *ep = buf + buflen; +/* Create an OPT resource record. Return the length of the final + packet, or -1 on error. - + - if ((ep - cp) < 1 + RRFIXEDSZ) - return -1; + STATP must be an initialized resolver state. N0 is the current @@ -8188,18 +8188,18 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + HEADER *hp = (HEADER *) buf; + unsigned char *cp = buf + n0; + unsigned char *ep = buf + buflen; - + - *cp++ = 0; /* "." */ + if ((ep - cp) < 1 + RRFIXEDSZ) + return -1; - + - NS_PUT16(T_OPT, cp); /* TYPE */ - NS_PUT16(MIN(anslen, 0xffff), cp); /* CLASS = UDP payload size */ - *cp++ = NOERROR; /* extended RCODE */ - *cp++ = 0; /* EDNS version */ + /* Add the root label. */ + *cp++ = 0; - + - if (statp->options & RES_USE_DNSSEC) { -#ifdef DEBUG - if (statp->options & RES_DEBUG) @@ -8231,13 +8231,13 @@ index 2bc2d2497fdf5dfa..59fc5ab28c0faa66 100644 + buffer_size = anslen; + NS_PUT16 (buffer_size, cp); + } - + - NS_PUT16(flags, cp); - NS_PUT16(0, cp); /* RDLEN */ - hp->arcount = htons(ntohs(hp->arcount) + 1); + *cp++ = NOERROR; /* Extended RCODE. */ + *cp++ = 0; /* EDNS version. */ - + - return cp - buf; + if (ctx->resp->options & RES_USE_DNSSEC) + flags |= NS_OPT_DNSSEC_OK; @@ -8261,7 +8261,7 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 @@ -64,11 +64,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: res_query.c,v 8.20 2000/02/29 05:39:12 vixie Exp $"; @@ -8283,12 +8283,12 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 -/* Options. Leave them on. */ -/* #undef DEBUG */ +#include - + #if PACKETSZ > 65536 #define MAXPACKET PACKETSZ @@ -95,39 +90,33 @@ static const char rcsid[] = "$BINDId: res_query.c,v 8.20 2000/02/29 05:39:12 vix #define QUERYSIZE (HFIXEDSZ + QFIXEDSZ + MAXCDNAME + 1) - + static int -__libc_res_nquerydomain(res_state statp, const char *name, const char *domain, - int class, int type, u_char *answer, int anslen, @@ -8337,20 +8337,20 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + int *nanswerp2, int *resplen2, int *answerp2_malloced) { + struct __res_state *statp = ctx->resp; - HEADER *hp = (HEADER *) answer; - HEADER *hp2; - int n, use_malloc = 0; + HEADER *hp = (HEADER *) answer; + HEADER *hp2; + int n, use_malloc = 0; - u_int oflags = statp->_flags; - + - size_t bufsize = (type == T_UNSPEC ? 2 : 1) * QUERYSIZE; + size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE; - u_char *buf = alloca (bufsize); - u_char *query1 = buf; - int nquery1 = -1; + u_char *buf = alloca (bufsize); + u_char *query1 = buf; + int nquery1 = -1; @@ -137,21 +126,18 @@ __libc_res_nquery(res_state statp, again: - hp->rcode = NOERROR; /* default */ - + hp->rcode = NOERROR; /* default */ + -#ifdef DEBUG - if (statp->options & RES_DEBUG) - printf(";; res_query(%s, %d, %d)\n", name, class, type); @@ -8358,57 +8358,57 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 - - if (type == T_UNSPEC) + if (type == T_QUERY_A_AND_AAAA) - { + { - n = res_nmkquery(statp, QUERY, name, class, T_A, NULL, 0, NULL, - query1, bufsize); + n = __res_context_mkquery (ctx, QUERY, name, class, T_A, NULL, + query1, bufsize); - if (n > 0) - { + if (n > 0) + { - if ((oflags & RES_F_EDNS0ERR) == 0 - && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) + if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) - { + { - n = __res_nopt(statp, n, query1, bufsize, anslen / 2); + /* Use RESOLV_EDNS_BUFFER_SIZE because the receive + buffer can be reallocated. */ + n = __res_nopt (ctx, n, query1, bufsize, + RESOLV_EDNS_BUFFER_SIZE); - if (n < 0) - goto unspec_nomem; - } + if (n < 0) + goto unspec_nomem; + } @@ -167,13 +153,14 @@ __libc_res_nquery(res_state statp, - } - int nused = n + npad; - query2 = buf + nused; + } + int nused = n + npad; + query2 = buf + nused; - n = res_nmkquery(statp, QUERY, name, class, T_AAAA, NULL, 0, - NULL, query2, bufsize - nused); + n = __res_context_mkquery (ctx, QUERY, name, class, T_AAAA, + NULL, query2, bufsize - nused); - if (n > 0 + if (n > 0 - && (oflags & RES_F_EDNS0ERR) == 0 - && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) + && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) - n = __res_nopt(statp, n, query2, bufsize - nused - n, - anslen / 2); + /* Use RESOLV_EDNS_BUFFER_SIZE because the receive + buffer can be reallocated. */ + n = __res_nopt (ctx, n, query2, bufsize, + RESOLV_EDNS_BUFFER_SIZE); - nquery2 = n; - } - + nquery2 = n; + } + @@ -181,21 +168,29 @@ __libc_res_nquery(res_state statp, - } - else - { + } + else + { - n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL, - query1, bufsize); + n = __res_context_mkquery (ctx, QUERY, name, class, type, NULL, + query1, bufsize); - - if (n > 0 + + if (n > 0 - && (oflags & RES_F_EDNS0ERR) == 0 - && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) + && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0) - n = __res_nopt(statp, n, query1, bufsize, anslen); + { + /* Use RESOLV_EDNS_BUFFER_SIZE if the receive buffer @@ -8420,23 +8420,23 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + advertise = RESOLV_EDNS_BUFFER_SIZE; + n = __res_nopt (ctx, n, query1, bufsize, advertise); + } - - nquery1 = n; - } - + + nquery1 = n; + } + - if (__builtin_expect (n <= 0, 0) && !use_malloc) { + if (__glibc_unlikely (n <= 0) && !use_malloc) { - /* Retry just in case res_nmkquery failed because of too - short buffer. Shouldn't happen. */ + /* Retry just in case res_nmkquery failed because of too + short buffer. Shouldn't happen. */ - bufsize = (type == T_UNSPEC ? 2 : 1) * MAXPACKET; + bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * MAXPACKET; - buf = malloc (bufsize); - if (buf != NULL) { - query1 = buf; + buf = malloc (bufsize); + if (buf != NULL) { + query1 = buf; @@ -203,43 +198,25 @@ __libc_res_nquery(res_state statp, - goto again; - } - } + goto again; + } + } - if (__builtin_expect (n <= 0, 0)) { - /* If the query choked with EDNS0, retry without EDNS0. */ - if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0 @@ -8453,39 +8453,39 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 - printf(";; res_query: mkquery failed\n"); -#endif + if (__glibc_unlikely (n <= 0)) { - RES_SET_H_ERRNO(statp, NO_RECOVERY); - if (use_malloc) - free (buf); - return (n); - } - assert (answerp == NULL || (void *) *answerp == (void *) answer); + RES_SET_H_ERRNO(statp, NO_RECOVERY); + if (use_malloc) + free (buf); + return (n); + } + assert (answerp == NULL || (void *) *answerp == (void *) answer); - n = __libc_res_nsend(statp, query1, nquery1, query2, nquery2, answer, - anslen, answerp, answerp2, nanswerp2, resplen2, - answerp2_malloced); + n = __res_context_send (ctx, query1, nquery1, query2, nquery2, answer, + anslen, answerp, answerp2, nanswerp2, resplen2, + answerp2_malloced); - if (use_malloc) - free (buf); - if (n < 0) { + if (use_malloc) + free (buf); + if (n < 0) { -#ifdef DEBUG - if (statp->options & RES_DEBUG) - printf(";; res_query: send error\n"); -#endif - RES_SET_H_ERRNO(statp, TRY_AGAIN); - return (n); - } - - if (answerp != NULL) + RES_SET_H_ERRNO(statp, TRY_AGAIN); + return (n); + } + + if (answerp != NULL) - /* __libc_res_nsend might have reallocated the buffer. */ + /* __res_context_send might have reallocated the buffer. */ - hp = (HEADER *) *answerp; - - /* We simplify the following tests by assigning HP to HP2 or + hp = (HEADER *) *answerp; + + /* We simplify the following tests by assigning HP to HP2 or @@ -263,15 +240,6 @@ __libc_res_nquery(res_state statp, - - if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0) - && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) { + + if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0) + && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) { -#ifdef DEBUG - if (statp->options & RES_DEBUG) { - printf(";; rcode = %d, ancount=%d\n", hp->rcode, @@ -8495,12 +8495,12 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 - ntohs(hp2->ancount)); - } -#endif - switch (hp->rcode == NOERROR ? hp2->rcode : hp->rcode) { - case NXDOMAIN: - if ((hp->rcode == NOERROR && ntohs (hp->ancount) != 0) + switch (hp->rcode == NOERROR ? hp2->rcode : hp->rcode) { + case NXDOMAIN: + if ((hp->rcode == NOERROR && ntohs (hp->ancount) != 0) @@ -308,7 +276,24 @@ __libc_res_nquery(res_state statp, success: - return (n); + return (n); } -libresolv_hidden_def (__libc_res_nquery) +libresolv_hidden_def (__res_context_query) @@ -8521,12 +8521,12 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + __resolv_context_put (ctx); + return result; +} - + int res_nquery(res_state statp, @@ -317,30 +302,31 @@ res_nquery(res_state statp, - u_char *answer, /* buffer to put answer */ - int anslen) /* size of answer buffer */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer buffer */ { - return __libc_res_nquery(statp, name, class, type, answer, anslen, - NULL, NULL, NULL, NULL, NULL); @@ -8534,7 +8534,7 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (__resolv_context_get_override (statp), name, class, type, answer, anslen); } -libresolv_hidden_def (res_nquery) - + -/* - * Formulate a normal query, send, and retrieve answer in supplied buffer. - * Return the size of the response on success, -1 on error. @@ -8573,13 +8573,13 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 +{ + struct __res_state *statp = ctx->resp; + const char *cp; - HEADER *hp = (HEADER *) answer; - char tmp[NS_MAXDNAME]; - u_int dots; + HEADER *hp = (HEADER *) answer; + char tmp[NS_MAXDNAME]; + u_int dots; @@ -360,16 +346,11 @@ __libc_res_nsearch(res_state statp, - trailing_dot++; - - /* If there aren't any dots, it could be a user-level alias. */ + trailing_dot++; + + /* If there aren't any dots, it could be a user-level alias. */ - if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL) - return (__libc_res_nquery(statp, cp, class, type, answer, - anslen, answerp, answerp2, @@ -8595,13 +8595,13 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + return __res_context_query (ctx, cp, class, type, answer, + anslen, answerp, answerp2, + nanswerp2, resplen2, answerp2_malloced); - - /* - * If there are enough dots in the name, let's just give it a + + /* + * If there are enough dots in the name, let's just give it a @@ -378,10 +359,10 @@ __libc_res_nsearch(res_state statp, - */ - saved_herrno = -1; - if (dots >= statp->ndots || trailing_dot) { + */ + saved_herrno = -1; + if (dots >= statp->ndots || trailing_dot) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2, @@ -8610,13 +8610,13 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + answer, anslen, answerp, + answerp2, nanswerp2, resplen2, + answerp2_malloced); - if (ret > 0 || trailing_dot - /* If the second response is valid then we use that. */ - || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) + if (ret > 0 || trailing_dot + /* If the second response is valid then we use that. */ + || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) @@ -411,20 +392,31 @@ __libc_res_nsearch(res_state statp, - (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) { - int done = 0; - + (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) { + int done = 0; + - for (domain = (const char * const *)statp->dnsrch; - *domain && !done; - domain++) { @@ -8625,8 +8625,8 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (ctx, domain_index); + if (dname == NULL) + break; - searched = 1; - + searched = 1; + - if (domain[0][0] == '\0' || - (domain[0][0] == '.' && domain[0][1] == '\0')) + /* __res_context_querydoman concatenates name @@ -8641,8 +8641,8 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + if (dname[0] == '.') + dname++; + if (dname[0] == '\0') - root_on_list++; - + root_on_list++; + - ret = __libc_res_nquerydomain(statp, name, *domain, - class, type, - answer, anslen, answerp, @@ -8652,19 +8652,19 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (ctx, name, dname, class, type, + answer, anslen, answerp, answerp2, nanswerp2, + resplen2, answerp2_malloced); - if (ret > 0 || (ret == 0 && resplen2 != NULL - && *resplen2 > 0)) - return (ret); + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) + return (ret); @@ -487,15 +479,15 @@ __libc_res_nsearch(res_state statp, - } - - /* + } + + /* - * f the query has not already been tried as is then try it + * If the query has not already been tried as is then try it - * unless RES_NOTLDQUERY is set and there were no dots. - */ - if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0) - && !(tried_as_is || root_on_list)) { + * unless RES_NOTLDQUERY is set and there were no dots. + */ + if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0) + && !(tried_as_is || root_on_list)) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2, @@ -8673,12 +8673,12 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (ctx, name, NULL, class, type, + answer, anslen, answerp, answerp2, nanswerp2, + resplen2, answerp2_malloced); - if (ret > 0 || (ret == 0 && resplen2 != NULL - && *resplen2 > 0)) - return (ret); + if (ret > 0 || (ret == 0 && resplen2 != NULL + && *resplen2 > 0)) + return (ret); @@ -523,7 +515,24 @@ __libc_res_nsearch(res_state statp, - RES_SET_H_ERRNO(statp, TRY_AGAIN); - return (-1); + RES_SET_H_ERRNO(statp, TRY_AGAIN); + return (-1); } -libresolv_hidden_def (__libc_res_nsearch) +libresolv_hidden_def (__res_context_search) @@ -8699,12 +8699,12 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + __resolv_context_put (ctx); + return result; +} - + int res_nsearch(res_state statp, @@ -532,42 +541,35 @@ res_nsearch(res_state statp, - u_char *answer, /* buffer to put answer */ - int anslen) /* size of answer */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { - return __libc_res_nsearch(statp, name, class, type, answer, - anslen, NULL, NULL, NULL, NULL, NULL); @@ -8712,7 +8712,7 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (__resolv_context_get_override (statp), name, class, type, answer, anslen); } -libresolv_hidden_def (res_nsearch) - + -/* - * Perform a call on res_query on the concatenation of name and domain, - * removing a trailing dot from name if domain is NULL. @@ -8748,40 +8748,40 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + int *answerp2_malloced) { + struct __res_state *statp = ctx->resp; - char nbuf[MAXDNAME]; - const char *longname = nbuf; - size_t n, d; - + char nbuf[MAXDNAME]; + const char *longname = nbuf; + size_t n, d; + -#ifdef DEBUG - if (statp->options & RES_DEBUG) - printf(";; res_nquerydomain(%s, %s, %d, %d)\n", - name, domain?domain:"", class, type); -#endif - if (domain == NULL) { + if (domain == NULL) { - /* - * Check for trailing '.'; - * copy without '.' if present. - */ - n = strlen(name); - - /* Decrement N prior to checking it against MAXDNAME + n = strlen(name); + + /* Decrement N prior to checking it against MAXDNAME @@ -578,11 +580,7 @@ __libc_res_nquerydomain(res_state statp, - RES_SET_H_ERRNO(statp, NO_RECOVERY); - return (-1); - } + RES_SET_H_ERRNO(statp, NO_RECOVERY); + return (-1); + } - if (name[n] == '.') { - strncpy(nbuf, name, n); - nbuf[n] = '\0'; - } else - longname = name; + longname = name; - } else { - n = strlen(name); - d = strlen(domain); + } else { + n = strlen(name); + d = strlen(domain); @@ -592,9 +590,28 @@ __libc_res_nquerydomain(res_state statp, - } - sprintf(nbuf, "%s.%s", name, domain); - } + } + sprintf(nbuf, "%s.%s", name, domain); + } - return (__libc_res_nquery(statp, longname, class, type, answer, - anslen, answerp, answerp2, nanswerp2, - resplen2, answerp2_malloced)); @@ -8808,11 +8808,11 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + __resolv_context_put (ctx); + return result; } - + int @@ -605,19 +622,28 @@ res_nquerydomain(res_state statp, - u_char *answer, /* buffer to put answer */ - int anslen) /* size of answer */ + u_char *answer, /* buffer to put answer */ + int anslen) /* size of answer */ { - return __libc_res_nquerydomain(statp, name, domain, class, type, - answer, anslen, NULL, NULL, NULL, NULL, @@ -8830,24 +8830,24 @@ index 57c679d6fca5d9dc..ebbe5a6a4ed86abe 100644 + (__resolv_context_get (), name, domain, class, type, answer, anslen); } -libresolv_hidden_def (res_nquerydomain) - + const char * -res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { +__res_context_hostalias (struct resolv_context *ctx, + const char *name, char *dst, size_t siz) +{ - char *file, *cp1, *cp2; - char buf[BUFSIZ]; - FILE *fp; - + char *file, *cp1, *cp2; + char buf[BUFSIZ]; + FILE *fp; + - if (statp->options & RES_NOALIASES) + if (ctx->resp->options & RES_NOALIASES) - return (NULL); - file = getenv("HOSTALIASES"); - if (file == NULL || (fp = fopen(file, "rce")) == NULL) + return (NULL); + file = getenv("HOSTALIASES"); + if (file == NULL || (fp = fopen(file, "rce")) == NULL) @@ -647,4 +673,43 @@ res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { - fclose(fp); - return (NULL); + fclose(fp); + return (NULL); } -libresolv_hidden_def (res_hostalias) +libresolv_hidden_def (__res_context_hostalias) @@ -8996,12 +8996,12 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 -/* Copyright (C) 2016 Free Software Foundation, Inc. +/* Copyright (C) 2016-2017 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 @@ -81,11 +81,6 @@ * SOFTWARE. */ - + -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixie Exp $"; @@ -9025,13 +9025,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 #include +#include +#include - + #if PACKETSZ > 65536 #define MAXPACKET PACKETSZ @@ -120,14 +117,6 @@ static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixi #define MAXPACKET 65536 #endif - + - -#ifndef __ASSUME_SOCK_CLOEXEC -static int __have_o_nonblock; @@ -9041,72 +9041,72 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - - /* From ev_streams.c. */ - + static inline void @@ -172,7 +161,7 @@ evSubTime(struct timespec *res, const struct timespec *minuend, - } + } } - + -static inline int +static int evCmpTime(struct timespec a, struct timespec b) { - long x = a.tv_sec - b.tv_sec; - + long x = a.tv_sec - b.tv_sec; + @@ -181,7 +170,7 @@ evCmpTime(struct timespec a, struct timespec b) { - return (x < 0L ? (-1) : x > 0L ? (1) : (0)); + return (x < 0L ? (-1) : x > 0L ? (1) : (0)); } - + -static inline void +static void evNowTime(struct timespec *res) { - struct timeval now; - + struct timeval now; + @@ -192,14 +181,11 @@ evNowTime(struct timespec *res) { } - - + + -/* Options. Leave them on. */ -/* #undef DEBUG */ -#include "res_debug.h" - #define EXT(res) ((res)->_u._ext) - + /* Forward. */ - + +static struct sockaddr *get_nsaddr (res_state, unsigned int); static int send_vc(res_state, const u_char *, int, - const u_char *, int, - u_char **, int *, int *, int, u_char **, + const u_char *, int, + u_char **, int *, int *, int, u_char **, @@ -209,11 +195,6 @@ static int send_dg(res_state, const u_char *, int, - u_char **, int *, int *, int, - int *, int *, u_char **, - u_char **, int *, int *, int *); + u_char **, int *, int *, int, + int *, int *, u_char **, + u_char **, int *, int *, int *); -#ifdef DEBUG -static void Aerror(const res_state, FILE *, const char *, int, - const struct sockaddr *); -static void Perror(const res_state, FILE *, const char *, int); -#endif static int sock_eq(struct sockaddr_in6 *, struct sockaddr_in6 *); - + /* Public. */ @@ -237,20 +218,21 @@ res_ourserver_p(const res_state statp, const struct sockaddr_in6 *inp) - in_port_t port = in4p->sin_port; - in_addr_t addr = in4p->sin_addr.s_addr; - + in_port_t port = in4p->sin_port; + in_addr_t addr = in4p->sin_addr.s_addr; + - for (ns = 0; ns < MAXNS; ns++) { + for (ns = 0; ns < statp->nscount; ns++) { - const struct sockaddr_in *srv = + const struct sockaddr_in *srv = - (struct sockaddr_in *)EXT(statp).nsaddrs[ns]; + (struct sockaddr_in *) get_nsaddr (statp, ns); - + - if ((srv != NULL) && (srv->sin_family == AF_INET) && + if ((srv->sin_family == AF_INET) && - (srv->sin_port == port) && - (srv->sin_addr.s_addr == INADDR_ANY || - srv->sin_addr.s_addr == addr)) - return (1); - } - } else if (inp->sin6_family == AF_INET6) { + (srv->sin_port == port) && + (srv->sin_addr.s_addr == INADDR_ANY || + srv->sin_addr.s_addr == addr)) + return (1); + } + } else if (inp->sin6_family == AF_INET6) { - for (ns = 0; ns < MAXNS; ns++) { - const struct sockaddr_in6 *srv = EXT(statp).nsaddrs[ns]; - if ((srv != NULL) && (srv->sin6_family == AF_INET6) && @@ -9114,13 +9114,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + const struct sockaddr_in6 *srv + = (struct sockaddr_in6 *) get_nsaddr (statp, ns); + if ((srv->sin6_family == AF_INET6) && - (srv->sin6_port == inp->sin6_port) && - !(memcmp(&srv->sin6_addr, &in6addr_any, - sizeof (struct in6_addr)) && + (srv->sin6_port == inp->sin6_port) && + !(memcmp(&srv->sin6_addr, &in6addr_any, + sizeof (struct in6_addr)) && @@ -262,6 +244,12 @@ res_ourserver_p(const res_state statp, const struct sockaddr_in6 *inp) - return (0); + return (0); } - + +int +res_isourserver (const struct sockaddr_in *inp) +{ @@ -9133,7 +9133,7 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 @@ -301,6 +289,62 @@ res_nameinquery(const char *name, int type, int class, } libresolv_hidden_def (res_nameinquery) - + +/* Returns a shift value for the name server index. Used to implement + RES_ROTATE. */ +static unsigned int @@ -9195,7 +9195,7 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 * is there a 1:1 mapping of (name,type,class) @@ -357,12 +401,15 @@ res_queriesmatch(const u_char *buf1, const u_char *eom1, libresolv_hidden_def (res_queriesmatch) - + int -__libc_res_nsend(res_state statp, const u_char *buf, int buflen, - const u_char *buf2, int buflen2, @@ -9211,13 +9211,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; + struct __res_state *statp = ctx->resp; + int gotsomewhere, terrno, try, v_circuit, resplen, n; - - if (statp->nscount == 0) { - __set_errno (ESRCH); + + if (statp->nscount == 0) { + __set_errno (ESRCH); @@ -374,24 +421,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - return (-1); - } - + return (-1); + } + -#ifdef USE_HOOKS - if (__builtin_expect (statp->qhook || statp->rhook, 0)) { - if (anssiz < MAXPACKET && ansp) { @@ -9236,44 +9236,44 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - - DprintQ((statp->options & RES_DEBUG) || (statp->pfcode & RES_PRF_QUERY), - (stdout, ";; res_send()\n"), buf, buflen); - v_circuit = ((statp->options & RES_USEVC) - || buflen > PACKETSZ - || buflen2 > PACKETSZ); + v_circuit = ((statp->options & RES_USEVC) + || buflen > PACKETSZ + || buflen2 > PACKETSZ); @@ -402,165 +431,68 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - * If the ns_addr_list in the resolver context has changed, then - * invalidate our cached copy and the associated timing data. - */ + * If the ns_addr_list in the resolver context has changed, then + * invalidate our cached copy and the associated timing data. + */ - if (EXT(statp).nsinit) { + if (EXT(statp).nscount != 0) { - int needclose = 0; - - if (EXT(statp).nscount != statp->nscount) - needclose++; - else + int needclose = 0; + + if (EXT(statp).nscount != statp->nscount) + needclose++; + else - for (ns = 0; ns < MAXNS; ns++) { - unsigned int map = EXT(statp).nsmap[ns]; - if (map < MAXNS + for (unsigned int ns = 0; ns < statp->nscount; ns++) { + if (statp->nsaddr_list[ns].sin_family != 0 - && !sock_eq((struct sockaddr_in6 *) + && !sock_eq((struct sockaddr_in6 *) - &statp->nsaddr_list[map], + &statp->nsaddr_list[ns], - EXT(statp).nsaddrs[ns])) - { - needclose++; - break; - } - } + EXT(statp).nsaddrs[ns])) + { + needclose++; + break; + } + } - if (needclose) + if (needclose) { - __res_iclose(statp, false); + __res_iclose(statp, false); + EXT(statp).nscount = 0; + } - } - - /* - * Maybe initialize our private copy of the ns_addr_list. - */ + } + + /* + * Maybe initialize our private copy of the ns_addr_list. + */ - if (EXT(statp).nsinit == 0) { - unsigned char map[MAXNS]; - @@ -9312,24 +9312,24 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + continue; + if (EXT(statp).nsaddrs[ns] == NULL) + EXT(statp).nsaddrs[ns] = - malloc(sizeof (struct sockaddr_in6)); + malloc(sizeof (struct sockaddr_in6)); - if (EXT(statp).nsaddrs[n] != NULL) { - memset (mempcpy(EXT(statp).nsaddrs[n], + if (EXT(statp).nsaddrs[ns] != NULL) + memset (mempcpy(EXT(statp).nsaddrs[ns], - &statp->nsaddr_list[ns], - sizeof (struct sockaddr_in)), - '\0', - sizeof (struct sockaddr_in6) - - sizeof (struct sockaddr_in)); + &statp->nsaddr_list[ns], + sizeof (struct sockaddr_in)), + '\0', + sizeof (struct sockaddr_in6) + - sizeof (struct sockaddr_in)); - EXT(statp).nssocks[n] = -1; - n++; - } - } + } - EXT(statp).nsinit = 1; + EXT(statp).nscount = statp->nscount; - } - + } + - /* - * Some resolvers want to even out the load on their nameservers. - * Note that RES_BLAST overrides RES_ROTATE. @@ -9363,14 +9363,14 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + /* Name server index offset. Used to implement + RES_ROTATE. */ + unsigned int ns_offset = nameserver_offset (statp); - - /* - * Send request, RETRY times, or until successful. - */ - for (try = 0; try < statp->retry; try++) { + + /* + * Send request, RETRY times, or until successful. + */ + for (try = 0; try < statp->retry; try++) { - for (ns = 0; ns < MAXNS; ns++) + for (unsigned ns_shift = 0; ns_shift < statp->nscount; ns_shift++) - { + { -#ifdef DEBUG - char tmpbuf[40]; -#endif @@ -9380,10 +9380,10 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + unsigned int ns = ns_shift + ns_offset; + if (ns >= statp->nscount) + ns -= statp->nscount; - + - if (nsap == NULL) - goto next_ns; - same_ns: + same_ns: -#ifdef USE_HOOKS - if (__builtin_expect (statp->qhook != NULL, 0)) { - int done = 0, loops = 0; @@ -9429,13 +9429,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - - if (__builtin_expect (v_circuit, 0)) { + if (__glibc_unlikely (v_circuit)) { - /* Use VC; at most one attempt per server. */ - try = statp->retry; - n = send_vc(statp, buf, buflen, buf2, buflen2, + /* Use VC; at most one attempt per server. */ + try = statp->retry; + n = send_vc(statp, buf, buflen, buf2, buflen2, @@ -589,22 +521,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - - resplen = n; - + + resplen = n; + - Dprint((statp->options & RES_DEBUG) || - ((statp->pfcode & RES_PRF_REPLY) && - (statp->pfcode & RES_PRF_HEAD1)), @@ -9452,13 +9452,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - *ansp2, (*resplen2 > *nansp2) ? *nansp2 : *resplen2); - } - - /* - * If we have temporarily opened a virtual circuit, - * or if we haven't been asked to keep a socket open, + /* + * If we have temporarily opened a virtual circuit, + * or if we haven't been asked to keep a socket open, @@ -614,38 +530,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - (statp->options & RES_STAYOPEN) == 0) { - __res_iclose(statp, false); - } + (statp->options & RES_STAYOPEN) == 0) { + __res_iclose(statp, false); + } -#ifdef USE_HOOKS - if (__builtin_expect (statp->rhook, 0)) { - int done = 0, loops = 0; @@ -9491,13 +9491,13 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - - } -#endif - return (resplen); + return (resplen); next_ns: ; - } /*foreach ns*/ + } /*foreach ns*/ @@ -661,17 +545,56 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - return (-1); + return (-1); } - + +/* Common part of res_nsend and res_send. */ +static int +context_send_common (struct resolv_context *ctx, @@ -9534,9 +9534,9 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + (__resolv_context_get (), buf, buflen, ans, anssiz); } -libresolv_hidden_def (res_nsend) - + /* Private */ - + +static struct sockaddr * +get_nsaddr (res_state statp, unsigned int n) +{ @@ -9563,7 +9563,7 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - sent query. This implemetnation should be corrected to honour these + sent query. This implementation should be corrected to honour these options. - + Please also note that for TCP we send both queries over the same @@ -722,7 +645,7 @@ close_and_return_error (res_state statp, int *resplen2) are needed but ANSCP is NULL, then as much of the response as @@ -9572,12 +9572,12 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - packets header feild TC will bet set to 1, indicating a truncated + packets header field TC will bet set to 1, indicating a truncated message and the rest of the socket data will be read and discarded. - + Answers to the query are stored secondly in *ANSP2 up to a max of @@ -765,15 +688,26 @@ send_vc(res_state statp, - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; - HEADER *anhp = (HEADER *) *ansp; + const HEADER *hp = (HEADER *) buf; + const HEADER *hp2 = (HEADER *) buf2; + HEADER *anhp = (HEADER *) *ansp; - struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns]; - int truncating, connreset, resplen, n; + struct sockaddr *nsap = get_nsaddr (statp, ns); @@ -9595,89 +9595,89 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); + int resplen; + DIAG_POP_NEEDS_COMMENT; - struct iovec iov[4]; - u_short len; - u_short len2; - u_char *cp; - + struct iovec iov[4]; + u_short len; + u_short len2; + u_char *cp; + - if (resplen2 != NULL) - *resplen2 = 0; - connreset = 0; + connreset = 0; same_ns: - truncating = 0; + truncating = 0; @@ -785,8 +719,8 @@ send_vc(res_state statp, - - if (getpeername(statp->_vcsock, - (struct sockaddr *)&peer, &size) < 0 || + + if (getpeername(statp->_vcsock, + (struct sockaddr *)&peer, &size) < 0 || - !sock_eq(&peer, nsap)) { - __res_iclose(statp, false); + !sock_eq(&peer, (struct sockaddr_in6 *) nsap)) { + __res_iclose(statp, false); - statp->_flags &= ~RES_F_VC; - } - } + statp->_flags &= ~RES_F_VC; + } + } @@ -795,22 +729,21 @@ send_vc(res_state statp, - if (statp->_vcsock >= 0) - __res_iclose(statp, false); - + if (statp->_vcsock >= 0) + __res_iclose(statp, false); + - statp->_vcsock = socket(nsap->sin6_family, SOCK_STREAM, 0); + statp->_vcsock = socket + (nsap->sa_family, SOCK_STREAM | SOCK_CLOEXEC, 0); - if (statp->_vcsock < 0) { - *terrno = errno; + if (statp->_vcsock < 0) { + *terrno = errno; - Perror(statp, stderr, "socket(vc)", errno); + if (resplen2 != NULL) + *resplen2 = 0; - return (-1); - } - __set_errno (0); + return (-1); + } + __set_errno (0); - if (connect(statp->_vcsock, (struct sockaddr *)nsap, - nsap->sin6_family == AF_INET + if (connect(statp->_vcsock, nsap, + nsap->sa_family == AF_INET - ? sizeof (struct sockaddr_in) - : sizeof (struct sockaddr_in6)) < 0) { - *terrno = errno; + ? sizeof (struct sockaddr_in) + : sizeof (struct sockaddr_in6)) < 0) { + *terrno = errno; - Aerror(statp, stderr, "connect/vc", errno, - (struct sockaddr *) nsap); - __res_iclose(statp, false); - return (0); + return close_and_return_error (statp, resplen2); - } - statp->_flags |= RES_F_VC; - } + } + statp->_flags |= RES_F_VC; + } @@ -832,16 +765,14 @@ send_vc(res_state statp, - } - if (TEMP_FAILURE_RETRY (writev(statp->_vcsock, iov, niov)) != explen) { - *terrno = errno; + } + if (TEMP_FAILURE_RETRY (writev(statp->_vcsock, iov, niov)) != explen) { + *terrno = errno; - Perror(statp, stderr, "write failed", errno); - __res_iclose(statp, false); - return (0); + return close_and_return_error (statp, resplen2); - } - /* - * Receive length & response - */ - int recvresp1 = 0; - /* Skip the second response if there is no second query. + } + /* + * Receive length & response + */ + int recvresp1 = 0; + /* Skip the second response if there is no second query. - To do that we mark the second response as received. */ + To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - uint16_t rlen16; + int recvresp2 = buf2 == NULL; + uint16_t rlen16; read_len: @@ -855,8 +786,6 @@ send_vc(res_state statp, - } - if (n <= 0) { - *terrno = errno; + } + if (n <= 0) { + *terrno = errno; - Perror(statp, stderr, "read failed", errno); - __res_iclose(statp, false); - /* - * A long running process might get its TCP - * connection reset if the remote server was + /* + * A long running process might get its TCP + * connection reset if the remote server was @@ -866,11 +795,13 @@ send_vc(res_state statp, - * instead of failing. We only allow one reset - * per query to prevent looping. - */ + * instead of failing. We only allow one reset + * per query to prevent looping. + */ - if (*terrno == ECONNRESET && !connreset) { - connreset = 1; - goto same_ns; @@ -9690,23 +9690,23 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + goto same_ns; + } + return close_and_return_error (statp, resplen2); - } - int rlen = ntohs (rlen16); - + } + int rlen = ntohs (rlen16); + @@ -895,18 +826,18 @@ send_vc(res_state statp, - *thisresplenp = rlen; - /* Is the answer buffer too small? */ - if (*thisanssizp < rlen) { + *thisresplenp = rlen; + /* Is the answer buffer too small? */ + if (*thisanssizp < rlen) { - /* If the current buffer is non-NULL and it's not - pointing at the static user-supplied buffer then - we can reallocate it. */ + /* If the current buffer is not the the static + user-supplied buffer then we can reallocate + it. */ - if (thisansp != NULL && thisansp != ansp) { - /* Always allocate MAXPACKET, callers expect - this specific size. */ - u_char *newp = malloc (MAXPACKET); + if (thisansp != NULL && thisansp != ansp) { + /* Always allocate MAXPACKET, callers expect + this specific size. */ + u_char *newp = malloc (MAXPACKET); - if (newp == NULL) { - *terrno = ENOMEM; - __res_iclose(statp, false); @@ -9717,65 +9717,65 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + *terrno = ENOMEM; + return close_and_return_error (statp, resplen2); + } - *thisanssizp = MAXPACKET; - *thisansp = newp; - if (thisansp == ansp2) + *thisanssizp = MAXPACKET; + *thisansp = newp; + if (thisansp == ansp2) @@ -917,24 +848,18 @@ send_vc(res_state statp, - read RLEN bytes instead. */ - len = rlen; - } else { + read RLEN bytes instead. */ + len = rlen; + } else { - Dprint(statp->options & RES_DEBUG, - (stdout, ";; response truncated\n") - ); - truncating = 1; - len = *thisanssizp; - } - } else - len = rlen; - + truncating = 1; + len = *thisanssizp; + } + } else + len = rlen; + - if (__builtin_expect (len < HFIXEDSZ, 0)) { + if (__glibc_unlikely (len < HFIXEDSZ)) { - /* - * Undersized message. - */ + /* + * Undersized message. + */ - Dprint(statp->options & RES_DEBUG, - (stdout, ";; undersized: %d\n", len)); - *terrno = EMSGSIZE; + *terrno = EMSGSIZE; - __res_iclose(statp, false); - return (0); + return close_and_return_error (statp, resplen2); - } - - cp = *thisansp; + } + + cp = *thisansp; @@ -942,13 +867,11 @@ send_vc(res_state statp, - cp += n; - len -= n; - } + cp += n; + len -= n; + } - if (__builtin_expect (n <= 0, 0)) { + if (__glibc_unlikely (n <= 0)) { - *terrno = errno; + *terrno = errno; - Perror(statp, stderr, "read(vc)", errno); - __res_iclose(statp, false); - return (0); + return close_and_return_error (statp, resplen2); - } + } - if (__builtin_expect (truncating, 0)) { + if (__glibc_unlikely (truncating)) { - /* - * Flush rest of answer so connection stays in synch. - */ + /* + * Flush rest of answer so connection stays in synch. + */ @@ -966,21 +889,15 @@ send_vc(res_state statp, - } - } - /* + } + } + /* - * If the calling applicating has bailed out of + * If the calling application has bailed out of - * a previous call and failed to arrange to have - * the circuit closed or the server has got - * itself confused, then drop the packet and - * wait for the correct one. - */ - if ((recvresp1 || hp->id != anhp->id) + * a previous call and failed to arrange to have + * the circuit closed or the server has got + * itself confused, then drop the packet and + * wait for the correct one. + */ + if ((recvresp1 || hp->id != anhp->id) - && (recvresp2 || hp2->id != anhp->id)) { - DprintQ((statp->options & RES_DEBUG) || - (statp->pfcode & RES_PRF_REPLY), @@ -9783,22 +9783,22 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - *thisansp, - (rlen > *thisanssizp) ? *thisanssizp: rlen); + && (recvresp2 || hp2->id != anhp->id)) - goto read_len; + goto read_len; - } - - /* Mark which reply we received. */ - if (recvresp1 == 0 && hp->id == anhp->id) + + /* Mark which reply we received. */ + if (recvresp1 == 0 && hp->id == anhp->id) @@ -1002,49 +919,25 @@ static int reopen (res_state statp, int *terrno, int ns) { - if (EXT(statp).nssocks[ns] == -1) { + if (EXT(statp).nssocks[ns] == -1) { - struct sockaddr *nsap - = (struct sockaddr *) EXT(statp).nsaddrs[ns]; + struct sockaddr *nsap = get_nsaddr (statp, ns); - socklen_t slen; - - /* only try IPv6 if IPv6 NS and if not failed before */ - if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) { + socklen_t slen; + + /* only try IPv6 if IPv6 NS and if not failed before */ + if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) { - if (__builtin_expect (__have_o_nonblock >= 0, 1)) { - EXT(statp).nssocks[ns] = - socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK, @@ -9816,10 +9816,10 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + EXT(statp).nssocks[ns] = socket + (PF_INET6, + SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); - if (EXT(statp).nssocks[ns] < 0) - statp->ipv6_unavail = errno == EAFNOSUPPORT; - slen = sizeof (struct sockaddr_in6); - } else if (nsap->sa_family == AF_INET) { + if (EXT(statp).nssocks[ns] < 0) + statp->ipv6_unavail = errno == EAFNOSUPPORT; + slen = sizeof (struct sockaddr_in6); + } else if (nsap->sa_family == AF_INET) { - if (__builtin_expect (__have_o_nonblock >= 0, 1)) { - EXT(statp).nssocks[ns] - = socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, @@ -9837,18 +9837,18 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + EXT(statp).nssocks[ns] = socket + (PF_INET, + SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); - slen = sizeof (struct sockaddr_in); - } - if (EXT(statp).nssocks[ns] < 0) { - *terrno = errno; + slen = sizeof (struct sockaddr_in); + } + if (EXT(statp).nssocks[ns] < 0) { + *terrno = errno; - Perror(statp, stderr, "socket(dg)", errno); - return (-1); - } - + return (-1); + } + @@ -1059,20 +952,19 @@ reopen (res_state statp, int *terrno, int ns) - * error message is received. We can thus detect - * the absence of a nameserver without timing out. - */ + * error message is received. We can thus detect + * the absence of a nameserver without timing out. + */ + /* With GCC 5.3 when compiling with -Os the compiler + emits a warning that slen may be used uninitialized, + but that is never true. Both slen and @@ -9857,12 +9857,12 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 + the call to connect with slen. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); - if (connect(EXT(statp).nssocks[ns], nsap, slen) < 0) { + if (connect(EXT(statp).nssocks[ns], nsap, slen) < 0) { - Aerror(statp, stderr, "connect(dg)", errno, nsap); + DIAG_POP_NEEDS_COMMENT; - __res_iclose(statp, false); - return (0); - } + __res_iclose(statp, false); + return (0); + } - if (__builtin_expect (__have_o_nonblock < 0, 0)) { - /* Make socket non-blocking. */ - int fl = __fcntl (EXT(statp).nssocks[ns], F_GETFL); @@ -9872,9 +9872,9 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - Dprint(statp->options & RES_DEBUG, - (stdout, ";; new DG socket\n")) - } - } - - return 1; + } + + return 1; @@ -1098,7 +990,7 @@ reopen (res_state statp, int *terrno, int ns) are needed but ANSCP is NULL, then as much of the response as possible is read into the buffer, but the results will be truncated. @@ -9882,156 +9882,156 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - packets header feild TC will bet set to 1, indicating a truncated + packets header field TC will bet set to 1, indicating a truncated message, while the rest of the UDP packet is discarded. - + Answers to the query are stored secondly in *ANSP2 up to a max of @@ -1184,7 +1076,7 @@ send_dg(res_state statp, - int nwritten = 0; - int recvresp1 = 0; - /* Skip the second response if there is no second query. + int nwritten = 0; + int recvresp1 = 0; + /* Skip the second response if there is no second query. - To do that we mark the second response as received. */ + To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - pfd[0].fd = EXT(statp).nssocks[ns]; - pfd[0].events = POLLOUT; + int recvresp2 = buf2 == NULL; + pfd[0].fd = EXT(statp).nssocks[ns]; + pfd[0].events = POLLOUT; @@ -1194,7 +1086,6 @@ send_dg(res_state statp, - evNowTime(&now); - if (evCmpTime(finish, now) <= 0) { - poll_err_out: + evNowTime(&now); + if (evCmpTime(finish, now) <= 0) { + poll_err_out: - Perror(statp, stderr, "poll", errno); - return close_and_return_error (statp, resplen2); - } - evSubTime(&timeout, &finish, &now); + return close_and_return_error (statp, resplen2); + } + evSubTime(&timeout, &finish, &now); @@ -1206,12 +1097,11 @@ send_dg(res_state statp, - n = 0; - if (nwritten == 0) - n = __poll (pfd, 1, 0); + n = 0; + if (nwritten == 0) + n = __poll (pfd, 1, 0); - if (__builtin_expect (n == 0, 0)) { + if (__glibc_unlikely (n == 0)) { - n = __poll (pfd, 1, ptimeout); - need_recompute = 1; - } - if (n == 0) { + n = __poll (pfd, 1, ptimeout); + need_recompute = 1; + } + if (n == 0) { - Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n")); - if (resplen > 1 && (recvresp1 || (buf2 != NULL && recvresp2))) - { - /* There are quite a few broken name servers out + if (resplen > 1 && (recvresp1 || (buf2 != NULL && recvresp2))) + { + /* There are quite a few broken name servers out @@ -1283,7 +1173,7 @@ send_dg(res_state statp, - reqs[1].msg_hdr.msg_controllen = 0; - - int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL); + reqs[1].msg_hdr.msg_controllen = 0; + + int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL); - if (__builtin_expect (ndg == 2, 1)) + if (__glibc_likely (ndg == 2)) - { - if (reqs[0].msg_len != buflen - || reqs[1].msg_len != buflen2) + { + if (reqs[0].msg_len != buflen + || reqs[1].msg_len != buflen2) @@ -1299,7 +1189,7 @@ send_dg(res_state statp, - else - { + else + { #ifndef __ASSUME_SENDMMSG - if (__builtin_expect (have_sendmmsg == 0, 0)) + if (__glibc_unlikely (have_sendmmsg == 0)) - { - if (ndg < 0 && errno == ENOSYS) - { + { + if (ndg < 0 && errno == ENOSYS) + { @@ -1311,7 +1201,6 @@ send_dg(res_state statp, #endif - - fail_sendmmsg: + + fail_sendmmsg: - Perror(statp, stderr, "sendmmsg", errno); - return close_and_return_error (statp, resplen2); - } - } + return close_and_return_error (statp, resplen2); + } + } @@ -1329,7 +1218,6 @@ send_dg(res_state statp, - if (sr != (nwritten != 0 ? buflen2 : buflen)) { - if (errno == EINTR || errno == EAGAIN) - goto recompute_resend; + if (sr != (nwritten != 0 ? buflen2 : buflen)) { + if (errno == EINTR || errno == EAGAIN) + goto recompute_resend; - Perror(statp, stderr, "send", errno); - return close_and_return_error (statp, resplen2); - } - just_one: + return close_and_return_error (statp, resplen2); + } + just_one: @@ -1360,14 +1248,16 @@ send_dg(res_state statp, - } - - if (*thisanssizp < MAXPACKET + } + + if (*thisanssizp < MAXPACKET - /* If the current buffer is non-NULL and it's not - pointing at the static user-supplied buffer then - we can reallocate it. */ + /* If the current buffer is not the the static + user-supplied buffer then we can reallocate + it. */ - && (thisansp != NULL && thisansp != ansp) + && (thisansp != NULL && thisansp != ansp) +#ifdef FIONREAD - /* Is the size too small? */ - && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0 - || *thisanssizp < *thisresplenp) + /* Is the size too small? */ + && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0 + || *thisanssizp < *thisresplenp) - ) { +#endif + ) { - /* Always allocate MAXPACKET, callers expect - this specific size. */ - u_char *newp = malloc (MAXPACKET); + /* Always allocate MAXPACKET, callers expect + this specific size. */ + u_char *newp = malloc (MAXPACKET); @@ -1388,34 +1278,24 @@ send_dg(res_state statp, - MSG_TRUNC which is only available on Linux. We - can abstract out the Linux-specific feature in the - future to detect truncation. */ + MSG_TRUNC which is only available on Linux. We + can abstract out the Linux-specific feature in the + future to detect truncation. */ - if (__glibc_unlikely (*thisanssizp < *thisresplenp)) { - Dprint(statp->options & RES_DEBUG, - (stdout, ";; response may be truncated (UDP)\n") - ); - } - - HEADER *anhp = (HEADER *) *thisansp; - socklen_t fromlen = sizeof(struct sockaddr_in6); - assert (sizeof(from) <= fromlen); - *thisresplenp = recvfrom(pfd[0].fd, (char*)*thisansp, - *thisanssizp, 0, - (struct sockaddr *)&from, &fromlen); + HEADER *anhp = (HEADER *) *thisansp; + socklen_t fromlen = sizeof(struct sockaddr_in6); + assert (sizeof(from) <= fromlen); + *thisresplenp = recvfrom(pfd[0].fd, (char*)*thisansp, + *thisanssizp, 0, + (struct sockaddr *)&from, &fromlen); - if (__builtin_expect (*thisresplenp <= 0, 0)) { + if (__glibc_unlikely (*thisresplenp <= 0)) { - if (errno == EINTR || errno == EAGAIN) { - need_recompute = 1; - goto wait; - } + if (errno == EINTR || errno == EAGAIN) { + need_recompute = 1; + goto wait; + } - Perror(statp, stderr, "recvfrom", errno); - return close_and_return_error (statp, resplen2); - } - *gotsomewhere = 1; + return close_and_return_error (statp, resplen2); + } + *gotsomewhere = 1; - if (__builtin_expect (*thisresplenp < HFIXEDSZ, 0)) { + if (__glibc_unlikely (*thisresplenp < HFIXEDSZ)) { - /* - * Undersized message. - */ + /* + * Undersized message. + */ - Dprint(statp->options & RES_DEBUG, - (stdout, ";; undersized: %d\n", - *thisresplenp)); - *terrno = EMSGSIZE; - return close_and_return_error (statp, resplen2); - } + *terrno = EMSGSIZE; + return close_and_return_error (statp, resplen2); + } @@ -1426,12 +1306,6 @@ send_dg(res_state statp, - * XXX - potential security hazard could - * be detected here. - */ + * XXX - potential security hazard could + * be detected here. + */ - DprintQ((statp->options & RES_DEBUG) || - (statp->pfcode & RES_PRF_REPLY), - (stdout, ";; old answer:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - goto wait; - } - if (!(statp->options & RES_INSECURE1) && + goto wait; + } + if (!(statp->options & RES_INSECURE1) && @@ -1441,34 +1315,8 @@ send_dg(res_state statp, - * XXX - potential security hazard could - * be detected here. - */ + * XXX - potential security hazard could + * be detected here. + */ - DprintQ((statp->options & RES_DEBUG) || - (statp->pfcode & RES_PRF_REPLY), - (stdout, ";; not our server:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - goto wait; - } + goto wait; + } -#ifdef RES_USE_EDNS0 - if (anhp->rcode == FORMERR - && (statp->options & RES_USE_EDNS0) != 0U) { @@ -10052,58 +10052,58 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - return close_and_return_error (statp, resplen2); - } -#endif - if (!(statp->options & RES_INSECURE2) - && (recvresp1 || !res_queriesmatch(buf, buf + buflen, - *thisansp, + if (!(statp->options & RES_INSECURE2) + && (recvresp1 || !res_queriesmatch(buf, buf + buflen, + *thisansp, @@ -1483,23 +1331,11 @@ send_dg(res_state statp, - * XXX - potential security hazard could - * be detected here. - */ + * XXX - potential security hazard could + * be detected here. + */ - DprintQ((statp->options & RES_DEBUG) || - (statp->pfcode & RES_PRF_REPLY), - (stdout, ";; wrong query name:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - goto wait; - } - if (anhp->rcode == SERVFAIL || - anhp->rcode == NOTIMP || - anhp->rcode == REFUSED) { + goto wait; + } + if (anhp->rcode == SERVFAIL || + anhp->rcode == NOTIMP || + anhp->rcode == REFUSED) { - DprintQ(statp->options & RES_DEBUG, - (stdout, "server rejected query:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - - next_ns: - if (recvresp1 || (buf2 != NULL && recvresp2)) { - *resplen2 = 0; + next_ns: + if (recvresp1 || (buf2 != NULL && recvresp2)) { + *resplen2 = 0; @@ -1525,11 +1361,6 @@ send_dg(res_state statp, - } - if (anhp->rcode == NOERROR && anhp->ancount == 0 - && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { + } + if (anhp->rcode == NOERROR && anhp->ancount == 0 + && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { - DprintQ(statp->options & RES_DEBUG, - (stdout, "referred query:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - goto next_ns; - } - if (!(statp->options & RES_IGNTC) && anhp->tc) { + goto next_ns; + } + if (!(statp->options & RES_IGNTC) && anhp->tc) { @@ -1537,8 +1368,6 @@ send_dg(res_state statp, - * To get the rest of answer, - * use TCP with same server. - */ + * To get the rest of answer, + * use TCP with same server. + */ - Dprint(statp->options & RES_DEBUG, - (stdout, ";; truncated answer\n")); - *v_circuit = 1; - __res_iclose(statp, false); - // XXX if we have received one reply we could + *v_circuit = 1; + __res_iclose(statp, false); + // XXX if we have received one reply we could @@ -1582,46 +1411,6 @@ send_dg(res_state statp, - } + } } - + -#ifdef DEBUG -static void -Aerror(const res_state statp, FILE *file, const char *string, int error, @@ -10146,7 +10146,7 @@ index 0cb573857583dd93..b396aae03c9eeb6e 100644 - static int sock_eq(struct sockaddr_in6 *a1, struct sockaddr_in6 *a2) { - if (a1->sin6_family == a2->sin6_family) { + if (a1->sin6_family == a2->sin6_family) { diff --git a/resolv/res_use_inet6.h b/resolv/res_use_inet6.h new file mode 100644 index 0000000000000000..8649833072ade9cf @@ -10211,12 +10211,12 @@ index a9f5659dbbacb477..32dc44777e311849 100644 - Copyright (C) 2016 Free Software Foundation, Inc. + Copyright (C) 2016-2017 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 @@ -22,6 +22,12 @@ #include #include - + +/* Resolver flags. Used for _flags in struct __res_state. */ +#define RES_F_VC 0x00000001 /* Socket is TCP. */ +#define RES_F_CONN 0x00000002 /* Socket is connected. */ @@ -10229,7 +10229,7 @@ index a9f5659dbbacb477..32dc44777e311849 100644 @@ -32,6 +38,56 @@ res_use_inet6 (void) return _res.options & DEPRECATED_RES_USE_INET6; } - + +enum + { + /* The advertized EDNS buffer size. The value 1200 is derived @@ -10288,48 +10288,48 @@ index ed15a702bf3bb9e8..7d85cbd011acf669 100644 --- a/resolv/resolv.h +++ b/resolv/resolv.h @@ -123,8 +123,8 @@ struct __res_state { - u_int32_t mask; - } sort_list[MAXRESOLVSORT]; - /* 4 byte hole here on 64-bit architectures. */ + u_int32_t mask; + } sort_list[MAXRESOLVSORT]; + /* 4 byte hole here on 64-bit architectures. */ - res_send_qhook qhook; /* query hook */ - res_send_rhook rhook; /* response hook */ + res_send_qhook __glibc_unused_qhook; + res_send_rhook __glibc_unused_rhook; - int res_h_errno; /* last one set for this context */ - int _vcsock; /* PRIVATE: for res_send VC i/o */ - u_int _flags; /* PRIVATE: see below */ + int res_h_errno; /* last one set for this context */ + int _vcsock; /* PRIVATE: for res_send VC i/o */ + u_int _flags; /* PRIVATE: see below */ @@ -139,10 +139,10 @@ struct __res_state { - u_int16_t nsinit; - struct sockaddr_in6 *nsaddrs[MAXNS]; + u_int16_t nsinit; + struct sockaddr_in6 *nsaddrs[MAXNS]; #ifdef _LIBC - unsigned long long int initstamp + unsigned long long int __glibc_extension_index - __attribute__((packed)); + __attribute__((packed)); #else - unsigned int _initstamp[2]; + unsigned int __glibc_reserved[2]; #endif - } _ext; - } _u; + } _ext; + } _u; @@ -221,6 +221,7 @@ struct res_sym { #define RES_USE_DNSSEC 0x00800000 /* use DNSSEC using OK bit in OPT */ #define RES_NOTLDQUERY 0x01000000 /* Do not look up unqualified name - as a TLD. */ + as a TLD. */ +#define RES_NORELOAD 0x02000000 /* No automatic configuration reload. */ - + #define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT) - + @@ -250,7 +251,6 @@ extern struct __res_state *__res_state(void) __attribute__ ((__const__)); __END_DECLS #define _res (*__res_state()) - + -#ifndef __BIND_NOSTATIC #define fp_nquery __fp_nquery #define fp_query __fp_query #define hostalias __hostalias @@ -265,22 +265,25 @@ __END_DECLS #define res_send __res_send - + __BEGIN_DECLS -void fp_nquery (const u_char *, int, FILE *) __THROW; -void fp_query (const u_char *, FILE *) __THROW; @@ -10360,7 +10360,7 @@ index ed15a702bf3bb9e8..7d85cbd011acf669 100644 + __THROW; __END_DECLS -#endif - + #define b64_ntop __b64_ntop #define b64_pton __b64_pton @@ -298,7 +301,6 @@ __END_DECLS @@ -10483,7 +10483,7 @@ index ed15a702bf3bb9e8..7d85cbd011acf669 100644 + __END_DECLS #endif - + diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c new file mode 100644 index 0000000000000000..e0f296d02e061a89 @@ -11758,8 +11758,8 @@ index 6cb59604961ebd93..08110a007af909ff 100644 #include @@ -43,8 +44,8 @@ static struct tests }; - - + + -int -main (int argc, char *argv[]) +static int @@ -11768,7 +11768,7 @@ index 6cb59604961ebd93..08110a007af909ff 100644 int result = 0; size_t cnt; @@ -71,3 +72,6 @@ main (int argc, char *argv[]) - + return result; } + @@ -12161,12 +12161,12 @@ index 7267c5b4f2f48b8c..f0de06306c20b1c5 100644 @@ -106,7 +106,7 @@ do_test (void) result++; } - -- + +- + return result; } - + diff --git a/resolv/tst-leaks.c b/resolv/tst-leaks.c index 4e47a6a12152adb4..4f6453517fe66a88 100644 --- a/resolv/tst-leaks.c @@ -12176,7 +12176,7 @@ index 4e47a6a12152adb4..4f6453517fe66a88 100644 - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003-2017 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 diff --git a/resolv/tst-leaks2.c b/resolv/tst-leaks2.c index b098e8af5d858d18..5a68a4c6574b66c0 100644 @@ -12187,7 +12187,7 @@ index b098e8af5d858d18..5a68a4c6574b66c0 100644 - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004-2017 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 diff --git a/resolv/tst-ns_name.c b/resolv/tst-ns_name.c new file mode 100644 @@ -13275,14 +13275,14 @@ index 1e7e0e2fa5aa8735..20e5a5a448437840 100644 +++ b/resolv/tst-res_hconf_reorder.c @@ -1,6 +1,6 @@ /* BZ #17977 _res_hconf_reorder_addrs test. - + - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2017 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 @@ -19,6 +19,7 @@ - + #include #include +#include @@ -18124,7 +18124,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + . */ + /* The Inner Net License, Version 2.00 - + The author(s) grant permission for redistribution and use in source and @@ -42,11 +60,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include @@ -18153,13 +18153,13 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 -#include +#include +#include - + #ifdef HAVE_LIBIDN extern int __idna_to_ascii_lz (const char *input, char **output, int flags); @@ -70,13 +92,6 @@ extern int __idna_to_unicode_lzlz (const char *input, char **output, # include #endif - + -#define GAIH_OKIFUNSPEC 0x0100 -#define GAIH_EAI ~(GAIH_OKIFUNSPEC) - @@ -18173,7 +18173,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 @@ -126,14 +141,6 @@ static const struct gaih_typeproto gaih_inet_typeproto[] = { 0, 0, 0, false, "" } }; - + -struct gaih - { - int family; @@ -18186,7 +18186,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 { .ai_flags = AI_DEFAULT, @@ -149,26 +156,26 @@ static const struct addrinfo default_hints = - + static int gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, - const struct addrinfo *req, struct gaih_servtuple *st) @@ -18198,7 +18198,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 struct servent ts; - char *tmpbuf; int r; - + do { - tmpbuf = __alloca (tmpbuflen); @@ -18208,23 +18208,23 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + r = __getservbyname_r (servicename, tp->name, &ts, + tmpbuf->data, tmpbuf->length, &s); if (r != 0 || s == NULL) - { - if (r == ERANGE) + { + if (r == ERANGE) - tmpbuflen *= 2; + { + if (!scratch_buffer_grow (tmpbuf)) + return -EAI_MEMORY; + } - else + else - return GAIH_OKIFUNSPEC | -EAI_SERVICE; + return -EAI_SERVICE; - } + } } while (r); @@ -182,87 +189,114 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, return 0; } - + +/* Convert struct hostent to a list of struct gaih_addrtuple objects. + h_name is not copied, and the struct hostent object must not be + deallocated prematurely. *RESULT must be NULL or a pointer to a @@ -18321,7 +18321,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + || errno != ERANGE) \ + break; \ + if (!scratch_buffer_grow (tmpbuf)) \ - { \ + { \ - __set_h_errno (herrno); \ - _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; \ + __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \ @@ -18337,12 +18337,12 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + { \ + __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \ + __resolv_context_put (res_ctx); \ - result = -EAI_SYSTEM; \ - goto free_and_return; \ - } \ + result = -EAI_SYSTEM; \ + goto free_and_return; \ + } \ - if (herrno == TRY_AGAIN) \ + if (h_errno == TRY_AGAIN) \ - no_data = EAI_AGAIN; \ + no_data = EAI_AGAIN; \ else \ - no_data = herrno == NO_DATA; \ + no_data = h_errno == NO_DATA; \ @@ -18352,7 +18352,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 { \ - for (i = 0; h->h_addr_list[i]; i++) \ + if (!convert_hostent_to_gaih_addrtuple (req, _family, &th, &addrmem)) \ - { \ + { \ - if (*pat == NULL) \ - { \ - *pat = __alloca (sizeof (struct gaih_addrtuple)); \ @@ -18381,28 +18381,28 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + { \ + canonbuf = __strdup (localcanon); \ + if (canonbuf == NULL) \ - { \ + { \ - (*pat)->family = _family; \ - memcpy (addr, h->h_addr_list[i], sizeof(_type)); \ + result = -EAI_SYSTEM; \ + goto free_and_return; \ - } \ + } \ - pat = &((*pat)->next); \ + canon = canonbuf; \ - } \ + } \ - \ - if (localcanon != NULL && canon == NULL) \ - canon = strdupa (localcanon); \ - \ - if (_family == AF_INET6 && i > 0) \ + if (_family == AF_INET6 && *pat != NULL) \ - got_ipv6 = true; \ + got_ipv6 = true; \ } \ } @@ -281,20 +315,44 @@ typedef enum nss_status (*nss_getcanonname_r) int *errnop, int *h_errnop); extern service_user *__nss_hosts_database attribute_hidden; - + +/* This function is called if a canonical name is requested, but if + the service function did not provide it. It tries to obtain the + name using getcanonname_r from the same service NIP. If the name @@ -18425,10 +18425,10 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + } + return __strdup (name); +} - + static int gaih_inet (const char *name, const struct gaih_service *service, - const struct addrinfo *req, struct addrinfo **pai, + const struct addrinfo *req, struct addrinfo **pai, - unsigned int *naddrs) + unsigned int *naddrs, struct scratch_buffer *tmpbuf) { @@ -18444,44 +18444,44 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + /* Reserve stack memory for the scratch buffer in the getaddrinfo + function. */ + size_t alloca_used = sizeof (struct scratch_buffer); - + if (req->ai_protocol || req->ai_socktype) { @@ -310,9 +368,9 @@ gaih_inet (const char *name, const struct gaih_service *service, if (! tp->name[0]) - { - if (req->ai_socktype) + { + if (req->ai_socktype) - return GAIH_OKIFUNSPEC | -EAI_SOCKTYPE; + return -EAI_SOCKTYPE; - else + else - return GAIH_OKIFUNSPEC | -EAI_SERVICE; + return -EAI_SERVICE; - } + } } - + @@ -320,7 +378,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (service != NULL) { if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) - return GAIH_OKIFUNSPEC | -EAI_SERVICE; + return -EAI_SERVICE; - + if (service->num < 0) - { + { @@ -329,7 +387,8 @@ gaih_inet (const char *name, const struct gaih_service *service, - st = (struct gaih_servtuple *) - alloca_account (sizeof (struct gaih_servtuple), alloca_used); - + st = (struct gaih_servtuple *) + alloca_account (sizeof (struct gaih_servtuple), alloca_used); + - if ((rc = gaih_inet_serv (service->name, tp, req, st))) + int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf); + if (__glibc_unlikely (rc != 0)) - return rc; - } - else + return rc; + } + else @@ -354,18 +413,15 @@ gaih_inet (const char *name, const struct gaih_service *service, - alloca_account (sizeof (struct gaih_servtuple), - alloca_used); - + alloca_account (sizeof (struct gaih_servtuple), + alloca_used); + - if ((rc = gaih_inet_serv (service->name, tp, req, newp))) - { - if (rc & GAIH_OKIFUNSPEC) @@ -18491,19 +18491,19 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + if (gaih_inet_serv (service->name, + tp, req, newp, tmpbuf) != 0) + continue; - - *pst = newp; - pst = &(newp->next); - } - if (st == (struct gaih_servtuple *) &nullserv) + + *pst = newp; + pst = &(newp->next); + } + if (st == (struct gaih_servtuple *) &nullserv) - return GAIH_OKIFUNSPEC | -EAI_SERVICE; + return -EAI_SERVICE; - } - } + } + } else @@ -411,13 +467,10 @@ gaih_inet (const char *name, const struct gaih_service *service, } - + bool malloc_name = false; - bool malloc_addrmem = false; struct gaih_addrtuple *addrmem = NULL; @@ -18517,18 +18517,18 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 { at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used); @@ -435,7 +488,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - idn_flags |= IDNA_USE_STD3_ASCII_RULES; - - char *p = NULL; + idn_flags |= IDNA_USE_STD3_ASCII_RULES; + + char *p = NULL; - rc = __idna_to_ascii_lz (name, &p, idn_flags); + int rc = __idna_to_ascii_lz (name, &p, idn_flags); - if (rc != IDNA_SUCCESS) - { - /* No need to jump to free_and_return here. */ + if (rc != IDNA_SUCCESS) + { + /* No need to jump to free_and_return here. */ @@ -480,46 +533,11 @@ gaih_inet (const char *name, const struct gaih_service *service, - { - char *scope_delim = strchr (name, SCOPE_DELIMITER); - int e; + { + char *scope_delim = strchr (name, SCOPE_DELIMITER); + int e; - - { - bool malloc_namebuf = false; @@ -18574,19 +18574,19 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + else + e = __inet_pton_length (AF_INET6, name, scope_delim - name, + at->addr); - if (e > 0) - { - if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) + if (e > 0) + { + if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) @@ -536,31 +554,13 @@ gaih_inet (const char *name, const struct gaih_service *service, - goto free_and_return; - } - + goto free_and_return; + } + - if (scope_delim != NULL) + if (scope_delim != NULL + && __inet6_scopeid_pton ((struct in6_addr *) at->addr, + scope_delim + 1, + &at->scopeid) != 0) - { + { - int try_numericscope = 0; - if (IN6_IS_ADDR_LINKLOCAL (at->addr) - || IN6_IS_ADDR_MC_LINKLOCAL (at->addr)) @@ -18612,43 +18612,43 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - } + result = -EAI_NONAME; + goto free_and_return; - } - - if (req->ai_flags & AI_CANONNAME) + } + + if (req->ai_flags & AI_CANONNAME) @@ -573,51 +573,34 @@ gaih_inet (const char *name, const struct gaih_service *service, - struct gaih_addrtuple **pat = &at; - int no_data = 0; - int no_inet6_data = 0; + struct gaih_addrtuple **pat = &at; + int no_data = 0; + int no_inet6_data = 0; - service_user *nip = NULL; + service_user *nip; - enum nss_status inet6_status = NSS_STATUS_UNAVAIL; - enum nss_status status = NSS_STATUS_UNAVAIL; - int no_more; + enum nss_status inet6_status = NSS_STATUS_UNAVAIL; + enum nss_status status = NSS_STATUS_UNAVAIL; + int no_more; - int old_res_options; + struct resolv_context *res_ctx = NULL; + bool res_enable_inet6 = false; - + - /* If we do not have to look for IPv6 addresses, use - the simple, old functions, which do not support + /* If we do not have to look for IPv6 addresses or the canonical + name, use the simple, old functions, which do not support - IPv6 scope ids, nor retrieving the canonical name. */ + IPv6 scope ids, nor retrieving the canonical name. */ - if (req->ai_family == AF_INET && (req->ai_flags & AI_CANONNAME) == 0) + if (req->ai_family == AF_INET + && (req->ai_flags & AI_CANONNAME) == 0) - { + { - /* Allocate additional room for struct host_data. */ - size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*) - + 16 * sizeof(char)); - assert (tmpbuf == NULL); - tmpbuf = alloca_account (tmpbuflen, alloca_used); - int rc; - struct hostent th; - struct hostent *h; + int rc; + struct hostent th; + struct hostent *h; - int herrno; - - while (1) - { + + while (1) + { - rc = __gethostbyname2_r (name, AF_INET, &th, tmpbuf, - tmpbuflen, &h, &herrno); - if (rc != ERANGE || herrno != NETDB_INTERNAL) @@ -18656,7 +18656,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + tmpbuf->data, tmpbuf->length, + &h, &h_errno); + if (rc != ERANGE || h_errno != NETDB_INTERNAL) - break; + break; - - if (!malloc_tmpbuf - && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) @@ -18665,7 +18665,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - alloca_used); - else + if (!scratch_buffer_grow (tmpbuf)) - { + { - char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, - 2 * tmpbuflen); - if (newp == NULL) @@ -18678,13 +18678,13 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - tmpbuflen = 2 * tmpbuflen; + result = -EAI_MEMORY; + goto free_and_return; - } - } - + } + } + @@ -625,59 +608,34 @@ gaih_inet (const char *name, const struct gaih_service *service, - { - if (h != NULL) - { + { + if (h != NULL) + { - int i; - /* We found data, count the number of addresses. */ - for (i = 0; h->h_addr_list[i]; ++i) @@ -18714,7 +18714,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + /* We found data, convert it. */ + if (!convert_hostent_to_gaih_addrtuple + (req, AF_INET, h, &addrmem)) - { + { - if (*pat == NULL) - { - *pat = addrfree++; @@ -18727,7 +18727,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - pat = &((*pat)->next); + result = -EAI_MEMORY; + goto free_and_return; - } + } + *pat = addrmem; + } + else @@ -18737,10 +18737,10 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + else + result = -EAI_NONAME; + goto free_and_return; - } - } - else - { + } + } + else + { - if (herrno == NETDB_INTERNAL) - { - __set_h_errno (herrno); @@ -18750,28 +18750,28 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + if (h_errno == NETDB_INTERNAL) + result = -EAI_SYSTEM; + else if (h_errno == TRY_AGAIN) - result = -EAI_AGAIN; - else - /* We made requests but they turned out no data. - The name is known, though. */ + result = -EAI_AGAIN; + else + /* We made requests but they turned out no data. + The name is known, though. */ - result = GAIH_OKIFUNSPEC | -EAI_NODATA; + result = -EAI_NODATA; - - goto free_and_return; - } + + goto free_and_return; + } @@ -695,29 +653,18 @@ gaih_inet (const char *name, const struct gaih_service *service, - { - /* Try to use nscd. */ - struct nscd_ai_result *air = NULL; + { + /* Try to use nscd. */ + struct nscd_ai_result *air = NULL; - int herrno; - int err = __nscd_getai (name, &air, &herrno); + int err = __nscd_getai (name, &air, &h_errno); - if (air != NULL) - { - /* Transform into gaih_addrtuple list. */ - bool added_canon = (req->ai_flags & AI_CANONNAME) == 0; - char *addrs = air->addrs; - + if (air != NULL) + { + /* Transform into gaih_addrtuple list. */ + bool added_canon = (req->ai_flags & AI_CANONNAME) == 0; + char *addrs = air->addrs; + - if (__libc_use_alloca (alloca_used - + air->naddrs * sizeof (struct gaih_addrtuple))) - addrmem = alloca_account (air->naddrs @@ -18780,7 +18780,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - else + addrmem = calloc (air->naddrs, sizeof (*addrmem)); + if (addrmem == NULL) - { + { - addrmem = malloc (air->naddrs - * sizeof (struct gaih_addrtuple)); - if (addrmem == NULL) @@ -18791,13 +18791,13 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - malloc_addrmem = true; + result = -EAI_MEMORY; + goto free_and_return; - } - - struct gaih_addrtuple *addrfree = addrmem; + } + + struct gaih_addrtuple *addrfree = addrmem; @@ -748,22 +695,13 @@ gaih_inet (const char *name, const struct gaih_service *service, - (*pat)->name = NULL; - else if (canonbuf == NULL) - { + (*pat)->name = NULL; + else if (canonbuf == NULL) + { - size_t canonlen = strlen (air->canon) + 1; - if ((req->ai_flags & AI_CANONIDN) != 0 - && __libc_use_alloca (alloca_used + canonlen)) @@ -18805,7 +18805,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - else + canonbuf = __strdup (air->canon); + if (canonbuf == NULL) - { + { - canonbuf = malloc (canonlen); - if (canonbuf == NULL) - { @@ -18815,38 +18815,38 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - malloc_canonbuf = true; + result = -EAI_MEMORY; + goto free_and_return; - } + } - canon = (*pat)->name = memcpy (canonbuf, air->canon, - canonlen); + canon = (*pat)->name = canonbuf; - } - - if (air->family[i] == AF_INET + } + + if (air->family[i] == AF_INET @@ -795,7 +733,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - - if (at->family == AF_UNSPEC) - { + + if (at->family == AF_UNSPEC) + { - result = GAIH_OKIFUNSPEC | -EAI_NONAME; + result = -EAI_NONAME; - goto free_and_return; - } - + goto free_and_return; + } + @@ -806,9 +744,9 @@ gaih_inet (const char *name, const struct gaih_service *service, - goto free_and_return; - else if (__nss_not_use_nscd_hosts == 0) - { + goto free_and_return; + else if (__nss_not_use_nscd_hosts == 0) + { - if (herrno == NETDB_INTERNAL && errno == ENOMEM) + if (h_errno == NETDB_INTERNAL && errno == ENOMEM) - result = -EAI_MEMORY; + result = -EAI_MEMORY; - else if (herrno == TRY_AGAIN) + else if (h_errno == TRY_AGAIN) - result = -EAI_AGAIN; - else - result = -EAI_SYSTEM; + result = -EAI_AGAIN; + else + result = -EAI_SYSTEM; @@ -818,44 +756,22 @@ gaih_inet (const char *name, const struct gaih_service *service, - } + } #endif - + - if (__nss_hosts_database != NULL) - { - no_more = 0; @@ -18854,8 +18854,8 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - } - else + if (__nss_hosts_database == NULL) - no_more = __nss_database_lookup ("hosts", NULL, - "dns [!UNAVAIL=return] files", + no_more = __nss_database_lookup ("hosts", NULL, + "dns [!UNAVAIL=return] files", - &nip); - - /* Initialize configurations. */ @@ -18867,9 +18867,9 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + else + no_more = 0; + nip = __nss_hosts_database; - - /* If we are looking for both IPv4 and IPv6 address we don't - want the lookup functions to automatically promote IPv4 + + /* If we are looking for both IPv4 and IPv6 address we don't + want the lookup functions to automatically promote IPv4 - addresses to IPv6 addresses. Currently this is decided - by setting the RES_USE_INET6 bit in _res.options. */ - old_res_options = _res.options; @@ -18896,39 +18896,39 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + res_enable_inet6 = __resolv_context_disable_inet6 (res_ctx); + if (res_ctx == NULL) + no_more = 1; - - while (!no_more) - { + + while (!no_more) + { @@ -869,44 +785,31 @@ gaih_inet (const char *name, const struct gaih_service *service, - - if (fct4 != NULL) - { + + if (fct4 != NULL) + { - int herrno; - - while (1) - { + while (1) + { - rc = 0; - status = DL_CALL_FCT (fct4, (name, pat, tmpbuf, - tmpbuflen, &rc, &herrno, + status = DL_CALL_FCT (fct4, (name, pat, + tmpbuf->data, tmpbuf->length, + &errno, &h_errno, - NULL)); - if (status == NSS_STATUS_SUCCESS) - break; - if (status != NSS_STATUS_TRYAGAIN + NULL)); + if (status == NSS_STATUS_SUCCESS) + break; + if (status != NSS_STATUS_TRYAGAIN - || rc != ERANGE || herrno != NETDB_INTERNAL) + || errno != ERANGE || h_errno != NETDB_INTERNAL) - { + { - if (herrno == TRY_AGAIN) + if (h_errno == TRY_AGAIN) - no_data = EAI_AGAIN; - else + no_data = EAI_AGAIN; + else - no_data = herrno == NO_DATA; + no_data = h_errno == NO_DATA; - break; - } - + break; + } + - if (!malloc_tmpbuf - && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) - tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, @@ -18936,7 +18936,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - alloca_used); - else + if (!scratch_buffer_grow (tmpbuf)) - { + { - char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, - 2 * tmpbuflen); - if (newp == NULL) @@ -18953,13 +18953,13 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + __resolv_context_put (res_ctx); + result = -EAI_MEMORY; + goto free_and_return; - } - } - + } + } + @@ -1000,54 +903,16 @@ gaih_inet (const char *name, const struct gaih_service *service, - if ((req->ai_flags & AI_CANONNAME) != 0 - && canon == NULL) - { + if ((req->ai_flags & AI_CANONNAME) != 0 + && canon == NULL) + { - /* If we need the canonical name, get it - from the same service as the result. */ - nss_getcanonname_r cfct; @@ -18970,7 +18970,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - if (cfct != NULL) + canonbuf = getcanonname (nip, at, name); + if (canonbuf == NULL) - { + { - const size_t max_fqdn_len = 256; - if ((req->ai_flags & AI_CANONIDN) != 0 - && __libc_use_alloca (alloca_used @@ -19014,15 +19014,15 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + __resolv_context_put (res_ctx); + result = -EAI_MEMORY; + goto free_and_return; - } + } + canon = canonbuf; - } - status = NSS_STATUS_SUCCESS; - } + } + status = NSS_STATUS_SUCCESS; + } @@ -1064,13 +929,17 @@ gaih_inet (const char *name, const struct gaih_service *service, - } - else - { + } + else + { + /* Could not locate any of the lookup functions. + The NSS lookup code does not consistently set + errno, so we need to supply our own error @@ -19031,7 +19031,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + service function in the DSO (so it should not + be listed in /etc/nsswitch.conf). Assume the + former, and return EBUSY. */ - status = NSS_STATUS_UNAVAIL; + status = NSS_STATUS_UNAVAIL; - /* Could not load any of the lookup functions. Indicate - an internal error if the failure was due to a system - error other than the file not being found. We use the @@ -19040,49 +19040,49 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - __set_h_errno (NETDB_INTERNAL); + __set_h_errno (NETDB_INTERNAL); + __set_errno (EBUSY); - } - } - + } + } + @@ -1083,11 +952,15 @@ gaih_inet (const char *name, const struct gaih_service *service, - nip = nip->next; - } - + nip = nip->next; + } + - _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; + __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); + __resolv_context_put (res_ctx); - + - if (h_errno == NETDB_INTERNAL) + /* If we have a failure which sets errno, report it using + EAI_SYSTEM. */ + if ((status == NSS_STATUS_TRYAGAIN || status == NSS_STATUS_UNAVAIL) + && h_errno == NETDB_INTERNAL) - { + { - result = GAIH_OKIFUNSPEC | -EAI_SYSTEM; + result = -EAI_SYSTEM; - goto free_and_return; - } - + goto free_and_return; + } + @@ -1099,7 +972,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - else - /* We made requests but they turned out no data. The name - is known, though. */ + else + /* We made requests but they turned out no data. The name + is known, though. */ - result = GAIH_OKIFUNSPEC | -EAI_NODATA; + result = -EAI_NODATA; - - goto free_and_return; - } + + goto free_and_return; + } @@ -1108,7 +981,7 @@ gaih_inet (const char *name, const struct gaih_service *service, process_list: if (at->family == AF_UNSPEC) - { + { - result = GAIH_OKIFUNSPEC | -EAI_NONAME; + result = -EAI_NONAME; - goto free_and_return; - } + goto free_and_return; + } } @@ -1193,12 +1066,13 @@ gaih_inet (const char *name, const struct gaih_service *service, #ifdef HAVE_LIBIDN - make_copy: + make_copy: #endif - if (malloc_canonbuf) - /* We already allocated the string using malloc. */ @@ -19091,13 +19091,13 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + /* We already allocated the string using malloc, but + the buffer is now owned by canon. */ + canonbuf = NULL; - else - { + else + { - canon = strdup (canon); + canon = __strdup (canon); - if (canon == NULL) - { - result = -EAI_MEMORY; + if (canon == NULL) + { + result = -EAI_MEMORY; @@ -1289,12 +1163,8 @@ gaih_inet (const char *name, const struct gaih_service *service, free_and_return: if (malloc_name) @@ -19110,7 +19110,7 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 - free (tmpbuf); + free (addrmem); + free (canonbuf); - + return result; } @@ -2429,13 +2299,17 @@ getaddrinfo (const char *name, const char *service, @@ -19124,72 +19124,73 @@ index 7a6cf71c170ec42f..2c4b6d6793a4c3a9 100644 + scratch_buffer_free (&tmpbuf); + if (last_i != 0) - { - freeaddrinfo (p); - __free_in6ai (in6ai); - + { + freeaddrinfo (p); + __free_in6ai (in6ai); + - return -(last_i & GAIH_EAI); + return -last_i; - } + } while (*end) - { + { @@ -2462,12 +2336,13 @@ getaddrinfo (const char *name, const char *service, struct addrinfo *last = NULL; char *canonname = NULL; bool malloc_results; + size_t alloc_size = nresults * (sizeof (*results) + sizeof (size_t)); - + malloc_results - = !__libc_use_alloca (nresults * (sizeof (*results) + sizeof (size_t))); + = !__libc_use_alloca (alloc_size); if (malloc_results) - { + { - results = malloc (nresults * (sizeof (*results) + sizeof (size_t))); + results = malloc (alloc_size); - if (results == NULL) - { - __free_in6ai (in6ai); + if (results == NULL) + { + __free_in6ai (in6ai); @@ -2475,7 +2350,7 @@ getaddrinfo (const char *name, const char *service, - } - } + } + } else - results = alloca (nresults * (sizeof (*results) + sizeof (size_t))); + results = alloca (alloc_size); order = (size_t *) (results + nresults); - + /* Now we definitely need the interface information. */ @@ -2526,7 +2401,7 @@ getaddrinfo (const char *name, const char *service, - close_retry: - close_not_cancel_no_status (fd); - af = q->ai_family; + close_retry: + close_not_cancel_no_status (fd); + af = q->ai_family; - fd = __socket (af, SOCK_DGRAM, IPPROTO_IP); + fd = __socket (af, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_IP); - } - else - { + } + else + { @@ -2559,7 +2434,7 @@ getaddrinfo (const char *name, const char *service, - tmp.addr[1] = 0; - tmp.addr[2] = htonl (0xffff); - /* Special case for lo interface, the source address -- being possibly different than the interface + tmp.addr[1] = 0; + tmp.addr[2] = htonl (0xffff); + /* Special case for lo interface, the source address +- being possibly different than the interface + being possibly different than the interface - address. */ - if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000) - == 0x7f000000) + address. */ + if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000) + == 0x7f000000) @@ -2633,7 +2508,7 @@ getaddrinfo (const char *name, const char *service, - the information. */ + the information. */ struct sort_result_combo src - = { .results = results, .nresults = nresults }; + = { .results = results, .nresults = nresults }; - if (__builtin_expect (gaiconf_reload_flag_ever_set, 0)) + if (__glibc_unlikely (gaiconf_reload_flag_ever_set)) - { - __libc_lock_define_initialized (static, lock); - + { + __libc_lock_define_initialized (static, lock); + @@ -2667,7 +2542,7 @@ getaddrinfo (const char *name, const char *service, return 0; } - + - return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; + return last_i ? -last_i : EAI_NONAME; } libc_hidden_def (getaddrinfo) + diff --git a/SOURCES/glibc-rh677316-scratch_buffer.patch b/SOURCES/glibc-rh677316-scratch_buffer.patch index 67c60a2f..88c09a43 100644 --- a/SOURCES/glibc-rh677316-scratch_buffer.patch +++ b/SOURCES/glibc-rh677316-scratch_buffer.patch @@ -200,24 +200,24 @@ index 70e3cefa7b06157e..38aa9e0993d4880c 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -33,6 +33,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-interpose-thread \ - tst-interpose-static-nothread \ - tst-interpose-static-thread \ + tst-interpose-thread \ + tst-interpose-static-nothread \ + tst-interpose-static-thread \ + tst-scratch_buffer \ - + tests-static := \ - tst-interpose-static-nothread \ + tst-interpose-static-nothread \ @@ -40,7 +41,11 @@ tests-static := \ - + test-srcs = tst-mtrace - + -routines = malloc morecore mcheck mtrace obstack +routines = malloc morecore mcheck mtrace obstack \ + scratch_buffer_grow \ + scratch_buffer_grow_preserve \ + scratch_buffer_set_array_size \ + - + install-lib := libmcheck.a non-lib.a := libmcheck.a diff --git a/malloc/Versions b/malloc/Versions @@ -225,7 +225,7 @@ index 7ca9bdf25fcafdf2..f3c3d8a0934bdcd3 100644 --- a/malloc/Versions +++ b/malloc/Versions @@ -67,5 +67,10 @@ libc { - + # Internal destructor hook for libpthread. __libc_thread_freeres; + diff --git a/SOURCES/glibc-rh731833-hwcap-2.patch b/SOURCES/glibc-rh731833-hwcap-2.patch index b6ff0924..7f2d6877 100644 --- a/SOURCES/glibc-rh731833-hwcap-2.patch +++ b/SOURCES/glibc-rh731833-hwcap-2.patch @@ -47,11 +47,11 @@ index 6d904ad..0939dcf 100644 +++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h @@ -30,7 +30,7 @@ #define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \ - + PPC_FEATURE_HAS_DFP) - + + PPC_FEATURE_HAS_DFP) + -#define _DL_PLATFORMS_COUNT 13 +#define _DL_PLATFORMS_COUNT 14 - + #define _DL_FIRST_PLATFORM 32 /* Mask to filter out platforms. */ @@ -51,6 +51,7 @@ @@ -59,19 +59,19 @@ index 6d904ad..0939dcf 100644 #define PPC_PLATFORM_PPC464 11 #define PPC_PLATFORM_PPC476 12 +#define PPC_PLATFORM_POWER8 13 - + static inline const char * __attribute__ ((unused)) @@ -111,6 +112,9 @@ _dl_string_platform (const char *str) - case '7': - ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7; - break; + case '7': + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7; + break; + case '8': + ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER8; + break; - default: - return -1; - } + default: + return -1; + } diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power8/Implies glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power8/Implies new file mode 100644 index 0000000..083f3e9 @@ -104,5 +104,6 @@ index 0000000..fad2505 @@ -0,0 +1,2 @@ +powerpc/powerpc64/power8/fpu +powerpc/powerpc64/power8 --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-hwcap-3.patch b/SOURCES/glibc-rh731833-hwcap-3.patch index e8fdde59..14a23fdb 100644 --- a/SOURCES/glibc-rh731833-hwcap-3.patch +++ b/SOURCES/glibc-rh731833-hwcap-3.patch @@ -14,23 +14,24 @@ index b07e6ad..8686fd5 100644 --- glibc-2.17-c758a686/elf/elf.h +++ glibc-2.17-c758a686/elf/elf.h @@ -987,7 +987,7 @@ typedef struct - + /* Some more special a_type values describing the hardware. */ #define AT_PLATFORM 15 /* String identifying platform. */ -#define AT_HWCAP 16 /* Machine dependent hints about +#define AT_HWCAP 16 /* Machine-dependent hints about - processor capabilities. */ - + processor capabilities. */ + /* This entry gives some information about the FPU initialization @@ -1009,6 +1009,9 @@ typedef struct - + #define AT_RANDOM 25 /* Address of 16 random bytes. */ - + +#define AT_HWCAP2 26 /* More machine-dependent hints about + processor capabilities. */ + #define AT_EXECFN 31 /* Filename of executable. */ - + /* Pointer to the global system page used for system calls and other --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-hwcap-4.patch b/SOURCES/glibc-rh731833-hwcap-4.patch index 8290dda5..59fa715e 100644 --- a/SOURCES/glibc-rh731833-hwcap-4.patch +++ b/SOURCES/glibc-rh731833-hwcap-4.patch @@ -31,66 +31,66 @@ index 81e7172..05f53ee 100644 size_t _dl_phnum; uint64_t _dl_hwcap __attribute__ ((nocommon)); +uint64_t _dl_hwcap2 __attribute__ ((nocommon)); - + /* This is not initialized to HWCAP_IMPORTANT, matching the definition of _dl_important_hwcaps, below, where no hwcap strings are ever @@ -212,6 +213,9 @@ _dl_aux_init (ElfW(auxv_t) *av) case AT_HWCAP: - GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; - break; + GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; + break; + case AT_HWCAP2: + GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val; + break; #ifdef NEED_DL_SYSINFO case AT_SYSINFO: - GL(dl_sysinfo) = av->a_un.a_val; + GL(dl_sysinfo) = av->a_un.a_val; diff --git glibc-2.17-c758a686/elf/dl-sysdep.c glibc-2.17-c758a686/elf/dl-sysdep.c index 65a9046..a0d1d04 100644 --- glibc-2.17-c758a686/elf/dl-sysdep.c +++ glibc-2.17-c758a686/elf/dl-sysdep.c @@ -156,6 +156,9 @@ _dl_sysdep_start (void **start_argptr, case AT_HWCAP: - GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; - break; + GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val; + break; + case AT_HWCAP2: + GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val; + break; case AT_CLKTCK: - GLRO(dl_clktck) = av->a_un.a_val; - break; + GLRO(dl_clktck) = av->a_un.a_val; + break; @@ -298,6 +301,7 @@ _dl_show_auxv (void) - [AT_SYSINFO - 2] = { "SYSINFO: 0x", hex }, - [AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex }, - [AT_RANDOM - 2] = { "RANDOM: 0x", hex }, + [AT_SYSINFO - 2] = { "SYSINFO: 0x", hex }, + [AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex }, + [AT_RANDOM - 2] = { "RANDOM: 0x", hex }, + [AT_HWCAP2 - 2] = { "HWCAP2: 0x", hex }, - }; + }; unsigned int idx = (unsigned int) (av->a_type - 2); - + @@ -309,10 +313,10 @@ _dl_show_auxv (void) assert (AT_NULL == 0); assert (AT_IGNORE == 1); - + - if (av->a_type == AT_HWCAP) + if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2) - { + { - /* This is handled special. */ - if (_dl_procinfo (av->a_un.a_val) == 0) + /* These are handled in a special way per platform. */ + if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0) - continue; - } - + continue; + } + diff --git glibc-2.17-c758a686/misc/getauxval.c glibc-2.17-c758a686/misc/getauxval.c index bff4560..1c1882b 100644 --- glibc-2.17-c758a686/misc/getauxval.c +++ glibc-2.17-c758a686/misc/getauxval.c @@ -26,6 +26,8 @@ __getauxval (unsigned long int type) - + if (type == AT_HWCAP) return GLRO(dl_hwcap); + else if (type == AT_HWCAP2) + return GLRO(dl_hwcap2); - + for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++) if (p->a_type == type) diff --git glibc-2.17-c758a686/ports/sysdeps/alpha/dl-procinfo.h glibc-2.17-c758a686/ports/sysdeps/alpha/dl-procinfo.h @@ -99,11 +99,11 @@ index 3db0efb..c3b27b4 100644 +++ glibc-2.17-c758a686/ports/sysdeps/alpha/dl-procinfo.h @@ -51,7 +51,7 @@ _dl_string_platform (const char *str) }; - + /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 - + /* There are no hardware capabilities defined. */ #define _dl_hwcap_string(idx) "" diff --git glibc-2.17-c758a686/ports/sysdeps/mips/dl-procinfo.h glibc-2.17-c758a686/ports/sysdeps/mips/dl-procinfo.h @@ -112,11 +112,11 @@ index d42aea7..8c9f5c2 100644 +++ glibc-2.17-c758a686/ports/sysdeps/mips/dl-procinfo.h @@ -51,7 +51,7 @@ _dl_string_platform (const char *str) }; - + /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 - + /* There are no hardware capabilities defined. */ #define _dl_hwcap_string(idx) "" diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h @@ -124,20 +124,20 @@ index bea7100..c96297b 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h @@ -31,10 +31,14 @@ - + static inline int __attribute__ ((unused)) -_dl_procinfo (int word) +_dl_procinfo (unsigned int type, unsigned long int word) { int i; - + + /* Fallback to unknown output mechanism. */ + if (type == AT_HWCAP2) + return -1; + _dl_printf ("AT_HWCAP: "); - + for (i = 0; i < _DL_HWCAP_COUNT; ++i) diff --git glibc-2.17-c758a686/sysdeps/generic/dl-procinfo.h glibc-2.17-c758a686/sysdeps/generic/dl-procinfo.h index c2bf914..0345717 100644 @@ -145,11 +145,11 @@ index c2bf914..0345717 100644 +++ glibc-2.17-c758a686/sysdeps/generic/dl-procinfo.h @@ -21,7 +21,7 @@ #define _DL_PROCINFO_H 1 - + /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 - + /* There are no hardware capabilities defined. */ #define _dl_hwcap_string(idx) "" diff --git glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h @@ -159,7 +159,7 @@ index c667e34..5635d72 100644 @@ -548,6 +548,10 @@ struct rtld_global_ro EXTERN struct link_map *_dl_sysinfo_map; #endif - + + /* Mask for more hardware capabilities that are available on some + platforms. */ + EXTERN uint64_t _dl_hwcap2; @@ -173,11 +173,11 @@ index 6ecaac2..38e902d 100644 +++ glibc-2.17-c758a686/sysdeps/i386/dl-procinfo.h @@ -61,7 +61,7 @@ enum }; - + /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 - + static inline const char * __attribute__ ((unused)) diff --git glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h @@ -196,19 +196,19 @@ index 0939dcf..7732ed2 100644 + return -1; + _dl_printf ("AT_HWCAP: "); - + for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i) diff --git glibc-2.17-c758a686/sysdeps/s390/dl-procinfo.h glibc-2.17-c758a686/sysdeps/s390/dl-procinfo.h index 97dcf07..26de043 100644 --- glibc-2.17-c758a686/sysdeps/s390/dl-procinfo.h +++ glibc-2.17-c758a686/sysdeps/s390/dl-procinfo.h @@ -56,7 +56,7 @@ enum - | HWCAP_S390_EIMM | HWCAP_S390_DFP) - + | HWCAP_S390_EIMM | HWCAP_S390_DFP) + /* We cannot provide a general printing function. */ -#define _dl_procinfo(word) -1 +#define _dl_procinfo(type, word) -1 - + static inline const char * __attribute__ ((unused)) diff --git glibc-2.17-c758a686/sysdeps/sparc/dl-procinfo.h glibc-2.17-c758a686/sysdeps/sparc/dl-procinfo.h @@ -216,20 +216,20 @@ index 6ae8768..a05d458 100644 --- glibc-2.17-c758a686/sysdeps/sparc/dl-procinfo.h +++ glibc-2.17-c758a686/sysdeps/sparc/dl-procinfo.h @@ -28,10 +28,14 @@ - + static inline int __attribute__ ((unused)) -_dl_procinfo (int word) +_dl_procinfo (unsigned int type, unsigned long int word) { int i; - + + /* Fallback to unknown output mechanism. */ + if (type == AT_HWCAP2) + return -1; + _dl_printf ("AT_HWCAP: "); - + for (i = 0; i < _DL_HWCAP_COUNT; ++i) diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/dl-procinfo.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/i386/dl-procinfo.h index 4c61357..23f4501 100644 @@ -245,13 +245,13 @@ index 4c61357..23f4501 100644 /* This table should match the information from arch/i386/kernel/setup.c in the kernel sources. */ int i; - + + /* Fallback to unknown output mechanism. */ + if (type == AT_HWCAP2) + return -1; + _dl_printf ("AT_HWCAP: "); - + for (i = 0; i < _DL_HWCAP_COUNT; ++i) diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/dl-procinfo.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/dl-procinfo.h index f36ba55..759738e 100644 @@ -267,13 +267,14 @@ index f36ba55..759738e 100644 /* This table should match the information from arch/s390/kernel/setup.c in the kernel sources. */ int i; - + + /* Fallback to unknown output mechanism. */ + if (type == AT_HWCAP2) + return -1; + _dl_printf ("AT_HWCAP: "); - + for (i = 0; i < _DL_HWCAP_COUNT; ++i) --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-hwcap-5.patch b/SOURCES/glibc-rh731833-hwcap-5.patch index 0c3bcbf9..a65b9b9d 100644 --- a/SOURCES/glibc-rh731833-hwcap-5.patch +++ b/SOURCES/glibc-rh731833-hwcap-5.patch @@ -19,7 +19,7 @@ index 7442b67..f75e625 100644 +++ glibc-2.17-c758a686/sysdeps/powerpc/Makefile @@ -17,7 +17,7 @@ endif endif - + ifeq ($(subdir),csu) -# get offset to rtld_global._dl_hwcap +# get offset to rtld_global._dl_hwcap and rtld_global._dl_hwcap2 @@ -36,12 +36,12 @@ index 89e7d8b..0c02fc6 100644 +/* Defines for bits in AT_HWCAP and AT_HWCAP2. + Copyright (C) 2012-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 @@ -20,9 +20,9 @@ # error "Never include directly; use instead." #endif - + -/* - * The following must match the kernels asm/cputable.h. - */ @@ -111,11 +111,11 @@ index 7732ed2..dc3b70e 100644 +++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h @@ -20,11 +20,21 @@ #define _DL_PROCINFO_H 1 - + #include -#include /* This defines the PPC_FEATURE_* macros. */ +#include /* This defines the PPC_FEATURE[2]_* macros. */ - + /* There are 25 bits used, but they are bits 7..31. */ #define _DL_HWCAP_FIRST 7 -#define _DL_HWCAP_COUNT 32 @@ -130,7 +130,7 @@ index 7732ed2..dc3b70e 100644 +/* AT_HWCAP2 features started at bit 31 and decremented as new features were + added. HWCAP2 feature bits start at bit 0. */ +#define _DL_HWCAP2_LAST 31 - + /* These bits influence library search. */ #define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \ @@ -161,18 +171,33 @@ static inline int @@ -185,8 +185,9 @@ index ff4e97f..f5ea5a1 100644 +++ glibc-2.17-c758a686/sysdeps/powerpc/rtld-global-offsets.sym @@ -5,3 +5,4 @@ #define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem) - + RTLD_GLOBAL_RO_DL_HWCAP_OFFSET rtld_global_ro_offsetof (_dl_hwcap) +RTLD_GLOBAL_RO_DL_HWCAP2_OFFSET rtld_global_ro_offsetof (_dl_hwcap2) --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-hwcap.patch b/SOURCES/glibc-rh731833-hwcap.patch index 8abf50d8..6bf860b3 100644 --- a/SOURCES/glibc-rh731833-hwcap.patch +++ b/SOURCES/glibc-rh731833-hwcap.patch @@ -296,12 +296,12 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c glibc-2.17-c758a686 +++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c 2013-08-05 19:10:28.980541623 +0530 @@ -13,7 +13,7 @@ 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 + License along with the GNU C Library. If not, see . */ - + /* This information must be kept in sync with the _DL_HWCAP_COUNT and @@ -67,7 +67,7 @@ PROCINFO_CLASS const char _dl_powerpc_ca #if !defined PROCINFO_DECL && defined SHARED @@ -330,29 +330,29 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686 +++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h 2013-08-05 19:10:28.990541622 +0530 @@ -13,14 +13,14 @@ 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 + License along with the GNU C Library. If not, see . */ - + #ifndef _DL_PROCINFO_H -#define _DL_PROCINFO_H 1 +#define _DL_PROCINFO_H 1 - + #include -#include /* This defines the PPC_FEATURE_* macros. */ +#include /* This defines the PPC_FEATURE_* macros. */ - + /* There are 25 bits used, but they are bits 7..31. */ #define _DL_HWCAP_FIRST 7 @@ -30,12 +30,12 @@ #define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \ - + PPC_FEATURE_HAS_DFP) - + + PPC_FEATURE_HAS_DFP) + -#define _DL_PLATFORMS_COUNT 9 +#define _DL_PLATFORMS_COUNT 13 - + -#define _DL_FIRST_PLATFORM 32 +#define _DL_FIRST_PLATFORM 32 /* Mask to filter out platforms. */ @@ -360,7 +360,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686 - << _DL_FIRST_PLATFORM) +#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \ + << _DL_FIRST_PLATFORM) - + /* Platform bits (relative to _DL_FIRST_PLATFORM). */ #define PPC_PLATFORM_POWER4 0 @@ -47,6 +47,10 @@ @@ -371,22 +371,22 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686 +#define PPC_PLATFORM_PPC440 10 +#define PPC_PLATFORM_PPC464 11 +#define PPC_PLATFORM_PPC476 12 - + static inline const char * __attribute__ ((unused)) @@ -111,7 +115,7 @@ _dl_string_platform (const char *str) - return -1; - } + return -1; + } if (str[1] == '\0') - return ret; + return ret; } else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970], - 3) == 0) + 3) == 0) @@ -127,6 +131,22 @@ _dl_string_platform (const char *str) - GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPCA2] + 3) - == 0) - return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPCA2; + GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPCA2] + 3) + == 0) + return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPCA2; + else if (strcmp (str + 3, + GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC405] + 3) + == 0) @@ -404,5 +404,5 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686 + == 0) + return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC476; } - + return -1; diff --git a/SOURCES/glibc-rh731833-libm-2.patch b/SOURCES/glibc-rh731833-libm-2.patch index cf21a0af..40c16595 100644 --- a/SOURCES/glibc-rh731833-libm-2.patch +++ b/SOURCES/glibc-rh731833-libm-2.patch @@ -508,7 +508,7 @@ index 0000000..d15680e + zk2 = zero.d; + /* Do two multiply/adds per loop iteration, using independent + accumulators; zk and zk2. */ -+ for (i=i1,j=i2-1; id[i]*y->d[j]; + zk2 += x->d[i+1]*y->d[j-1]; @@ -1081,7 +1081,7 @@ index d15680e..0000000 - zk2 = zero.d; - /* Do two multiply/adds per loop iteration, using independent - accumulators; zk and zk2. */ -- for (i=i1,j=i2-1; id[i]*y->d[j]; - zk2 += x->d[i+1]*y->d[j-1]; @@ -1654,7 +1654,7 @@ index d15680e..0000000 - zk2 = zero.d; - /* Do two multiply/adds per loop iteration, using independent - accumulators; zk and zk2. */ -- for (i=i1,j=i2-1; id[i]*y->d[j]; - zk2 += x->d[i+1]*y->d[j-1]; @@ -1736,5 +1736,6 @@ index d15680e..0000000 - else {__inv(y,&w,p); __mul(x,&w,z,p);} - return; -} --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-libm-3.patch b/SOURCES/glibc-rh731833-libm-3.patch index b9d710ae..89fe7a27 100644 --- a/SOURCES/glibc-rh731833-libm-3.patch +++ b/SOURCES/glibc-rh731833-libm-3.patch @@ -29,7 +29,7 @@ index be9ac71..1cce1fc 100644 u.dd[0] = a; @@ -134,7 +134,7 @@ ldbl_pack (double a, double aa) } - + static inline void -ldbl_unpack (long double l, double *a, double *aa) +default_ldbl_unpack (long double l, double *a, double *aa) @@ -39,14 +39,14 @@ index be9ac71..1cce1fc 100644 @@ -142,6 +142,12 @@ ldbl_unpack (long double l, double *a, double *aa) *aa = u.dd[1]; } - + +#ifndef ldbl_pack +# define ldbl_pack default_ldbl_pack +#endif +#ifndef ldbl_unpack +# define ldbl_unpack default_ldbl_unpack +#endif - + /* Convert a finite long double to canonical form. Does not handle +/-Inf properly. */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/Implies glibc-2.17-c758a686/sysdeps/powerpc/Implies @@ -66,10 +66,10 @@ index 6cd6d0b..36378c0 100644 @@ -2,132 +2,12 @@ #error "Never use directly; include instead." #endif - + -#include -#include -- +- -static inline void -ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x) -{ @@ -98,7 +98,7 @@ index 6cd6d0b..36378c0 100644 - lo = lo >> (ediff-53); - } - hi |= (1ULL << 52); -- +- - if ((eldbl.ieee.negative != eldbl.ieee.negative2) - && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL))) - { @@ -128,7 +128,7 @@ index 6cd6d0b..36378c0 100644 - u.ieee.exponent = exp + IBM_EXTENDED_LONG_DOUBLE_BIAS; - u.ieee.exponent2 = exp-53 + IBM_EXTENDED_LONG_DOUBLE_BIAS; - /* Expect 113 bits (112 bits + hidden) right justified in two longs. -- The low order 53 bits (52 + hidden) go into the lower double */ +- The low order 53 bits (52 + hidden) go into the lower double */ - lo = (lo64 >> 7)& ((1ULL << 53) - 1); - hidden2 = (lo64 >> 59) & 1ULL; - /* The high order 53 bits (52 + hidden) go into the upper double */ @@ -148,7 +148,7 @@ index 6cd6d0b..36378c0 100644 - } - /* The hidden bit of the lo mantissa is zero so we need to - normalize the it for the low double. Shift it left until the -- hidden bit is '1' then adjust the 2nd exponent accordingly. */ +- hidden bit is '1' then adjust the 2nd exponent accordingly. */ - - if (sizeof (lo) == sizeof (long)) - lzcount = __builtin_clzl (lo); @@ -186,7 +186,7 @@ index 6cd6d0b..36378c0 100644 - u.ieee.mantissa0 = (hi >> 32) & ((1ULL << 20) - 1); - return u.d; -} -- +- -/* gcc generates disgusting code to pack and unpack long doubles. - This tells gcc that pack/unpack is really a nop. We use fr1/fr2 - because those are the regs used to pass/return a single @@ -203,7 +203,7 @@ index 6cd6d0b..36378c0 100644 register double xh __asm__ ("fr1"); @@ -139,7 +19,7 @@ ldbl_pack (double a, double aa) } - + static inline void -ldbl_unpack (long double l, double *a, double *aa) +ldbl_unpack_ppc (long double l, double *a, double *aa) @@ -213,10 +213,10 @@ index 6cd6d0b..36378c0 100644 @@ -150,40 +30,7 @@ ldbl_unpack (long double l, double *a, double *aa) *aa = xl; } - + +#define ldbl_pack ldbl_pack_ppc +#define ldbl_unpack ldbl_unpack_ppc - + -/* Convert a finite long double to canonical form. - Does not handle +/-Inf properly. */ -static inline void @@ -264,5 +264,6 @@ index ff27cdb..0000000 -ieee754/ldbl-128ibm -# These supply the ABI compatibility for when long double was double. -ieee754/ldbl-opt --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-libm-4.patch b/SOURCES/glibc-rh731833-libm-4.patch index dc37caa4..a5134944 100644 --- a/SOURCES/glibc-rh731833-libm-4.patch +++ b/SOURCES/glibc-rh731833-libm-4.patch @@ -20,10 +20,10 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c glibc-2.17-c758a6 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_llround.c 2013-08-06 17:45:56.719534470 +0530 @@ -17,6 +17,7 @@ . */ - + #include +#include - + /* I think that what this routine is supposed to do is round a value to the nearest integer, with values exactly on the boundary rounded @@ -47,3 +48,6 @@ weak_alias (__llround, llround) @@ -41,7 +41,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/fpu/w_sqrt.c glibc-2.17-c758a686/ #include #include +#include - + double __sqrt (double x) /* wrapper sqrt */ @@ -42,3 +43,6 @@ weak_alias (__sqrt, sqrt) diff --git a/SOURCES/glibc-rh731833-libm-5.patch b/SOURCES/glibc-rh731833-libm-5.patch index e74225bd..3b68ecbf 100644 --- a/SOURCES/glibc-rh731833-libm-5.patch +++ b/SOURCES/glibc-rh731833-libm-5.patch @@ -26,88 +26,89 @@ index 0ab9e6c..c28e7f6 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rint.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rint.S @@ -45,14 +45,14 @@ ENTRY (__rint) - fsub fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ + fsub fp12,fp13,fp13 /* generate 0.0 */ + fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ + fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnllr- cr7 - bng- cr6,.L4 + bnllr cr7 + bng cr6,.L4 - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fabs fp1,fp1 /* if (x == 0.0) */ - blr /* x = 0.0; */ + fadd fp1,fp1,fp13 /* x+= TWO52; */ + fsub fp1,fp1,fp13 /* x-= TWO52; */ + fabs fp1,fp1 /* if (x == 0.0) */ + blr /* x = 0.0; */ .L4: - bnllr- cr6 /* if (x < 0.0) */ + bnllr cr6 /* if (x < 0.0) */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fnabs fp1,fp1 /* if (x == 0.0) */ + fsub fp1,fp1,fp13 /* x-= TWO52; */ + fadd fp1,fp1,fp13 /* x+= TWO52; */ + fnabs fp1,fp1 /* if (x == 0.0) */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rintf.S index ddb47db..69aed9c 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rintf.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_rintf.S @@ -41,14 +41,14 @@ ENTRY (__rintf) - fsubs fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ + fsubs fp12,fp13,fp13 /* generate 0.0 */ + fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ + fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnllr- cr7 - bng- cr6,.L4 + bnllr cr7 + bng cr6,.L4 - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fabs fp1,fp1 /* if (x == 0.0) */ - blr /* x = 0.0; */ + fadds fp1,fp1,fp13 /* x+= TWO23; */ + fsubs fp1,fp1,fp13 /* x-= TWO23; */ + fabs fp1,fp1 /* if (x == 0.0) */ + blr /* x = 0.0; */ .L4: - bnllr- cr6 /* if (x < 0.0) */ + bnllr cr6 /* if (x < 0.0) */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fnabs fp1,fp1 /* if (x == 0.0) */ + fsubs fp1,fp1,fp13 /* x-= TWO23; */ + fadds fp1,fp1,fp13 /* x+= TWO23; */ + fnabs fp1,fp1 /* if (x == 0.0) */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rint.S index db62405..560905a 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rint.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rint.S @@ -34,14 +34,14 @@ EALIGN (__rint, 4, 0) - fsub fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ + fsub fp12,fp13,fp13 /* generate 0.0 */ + fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ + fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnllr- cr7 - bng- cr6,.L4 + bnllr cr7 + bng cr6,.L4 - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fabs fp1,fp1 /* if (x == 0.0) */ - blr /* x = 0.0; */ + fadd fp1,fp1,fp13 /* x+= TWO52; */ + fsub fp1,fp1,fp13 /* x-= TWO52; */ + fabs fp1,fp1 /* if (x == 0.0) */ + blr /* x = 0.0; */ .L4: - bnllr- cr6 /* if (x < 0.0) */ + bnllr cr6 /* if (x < 0.0) */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fnabs fp1,fp1 /* if (x == 0.0) */ + fsub fp1,fp1,fp13 /* x-= TWO52; */ + fadd fp1,fp1,fp13 /* x+= TWO52; */ + fnabs fp1,fp1 /* if (x == 0.0) */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S index 248649d..c120d91 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S @@ -30,14 +30,14 @@ EALIGN (__rintf, 4, 0) - fsubs fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ + fsubs fp12,fp13,fp13 /* generate 0.0 */ + fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ + fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnllr- cr7 - bng- cr6,.L4 + bnllr cr7 + bng cr6,.L4 - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fabs fp1,fp1 /* if (x == 0.0) */ - blr /* x = 0.0; */ + fadds fp1,fp1,fp13 /* x+= TWO23; */ + fsubs fp1,fp1,fp13 /* x-= TWO23; */ + fabs fp1,fp1 /* if (x == 0.0) */ + blr /* x = 0.0; */ .L4: - bnllr- cr6 /* if (x < 0.0) */ + bnllr cr6 /* if (x < 0.0) */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fnabs fp1,fp1 /* if (x == 0.0) */ --- + fsubs fp1,fp1,fp13 /* x-= TWO23; */ + fadds fp1,fp1,fp13 /* x+= TWO23; */ + fnabs fp1,fp1 /* if (x == 0.0) */ +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-libm-7.patch b/SOURCES/glibc-rh731833-libm-7.patch index 825a2df2..e56c20be 100644 --- a/SOURCES/glibc-rh731833-libm-7.patch +++ b/SOURCES/glibc-rh731833-libm-7.patch @@ -25,7 +25,7 @@ index cfadd5c..fc17bea 100644 + (i1) = gh_u1.parts.msw & 0x7fffffff; \ + (i2) = gh_u2.parts.msw & 0x7fffffff; \ } while (0) - + # define TEST_INF_NAN(x, y) \ do { \ - int32_t hx, hy; \ @@ -46,7 +46,7 @@ index 92e824d..77c1b17 100644 + (i1) = gf_u1.word & 0x7fffffff; \ + (i2) = gf_u2.word & 0x7fffffff; \ } while (0) - + # define TEST_INF_NAN(x, y) \ do { \ - int32_t hx, hy; \ @@ -54,5 +54,6 @@ index 92e824d..77c1b17 100644 GET_TWO_FLOAT_WORD(x, y, hx, hy); \ if (hy > hx) { \ uint32_t ht = hx; hx = hy; hy = ht; \ --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-libm.patch b/SOURCES/glibc-rh731833-libm.patch index 6f433e75..0bd51061 100644 --- a/SOURCES/glibc-rh731833-libm.patch +++ b/SOURCES/glibc-rh731833-libm.patch @@ -14,13 +14,14 @@ index 117bd0f..abc78a3 100644 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c @@ -52,7 +52,7 @@ __ieee754_acoshl(long double x) - return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one))); - } else { /* 1 #include "bp-sym.h" - + +/* We do not want .eh_frame info for crt1.o since crt1.o is linked + before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ +#undef cfi_startproc @@ -31,7 +31,7 @@ index 4935e64..2e454c0 100644 + /* These are the various addresses we require. */ #ifdef PIC - .section ".data" + .section ".data" diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/start.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/start.S index d9c92d1..aadaf0f 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/start.S @@ -39,7 +39,7 @@ index d9c92d1..aadaf0f 100644 @@ -37,6 +37,13 @@ #include #include "bp-sym.h" - + +/* We do not want .eh_frame info for crt1.o since crt1.o is linked + before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */ +#undef cfi_startproc @@ -49,6 +49,7 @@ index d9c92d1..aadaf0f 100644 + /* These are the various addresses we require. */ #ifdef PIC - .section ".data.rel.ro.local","aw" --- + .section ".data.rel.ro.local","aw" +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-misc-3.patch b/SOURCES/glibc-rh731833-misc-3.patch index 5d7cb715..46b03fa1 100644 --- a/SOURCES/glibc-rh731833-misc-3.patch +++ b/SOURCES/glibc-rh731833-misc-3.patch @@ -33,9 +33,9 @@ index e4ae630..f7f635e 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h @@ -32,14 +32,16 @@ extern void *__vdso_get_tbfreq; - + extern void *__vdso_getcpu; - + +extern void *__vdso_time; + /* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO @@ -49,7 +49,7 @@ index e4ae630..f7f635e 100644 -#define VDSO_IFUNC_RET(value) value +#define VDSO_IFUNC_RET(value) ((void *) (value)) #endif - + #endif diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c index 5587e2a..3cefd9b 100644 @@ -61,17 +61,17 @@ index 5587e2a..3cefd9b 100644 void *__vdso_getcpu; - +void *__vdso_time; - + static inline void _libc_vdso_platform_setup (void) @@ -44,6 +44,8 @@ _libc_vdso_platform_setup (void) __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615); - + __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); + + __vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615); } - + # define VDSO_SETUP _libc_vdso_platform_setup diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c new file mode 100644 @@ -141,5 +141,6 @@ index 0000000..66b4eb3 +#include + +#endif --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-misc-4.patch b/SOURCES/glibc-rh731833-misc-4.patch index 201cc6a6..0d1ca848 100644 --- a/SOURCES/glibc-rh731833-misc-4.patch +++ b/SOURCES/glibc-rh731833-misc-4.patch @@ -74,7 +74,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/powerpc/sys/platform/ppc.h glibc-2.17-c75 @@ -50,4 +50,66 @@ __ppc_get_timebase (void) #endif } - + +/* The following functions provide hints about the usage of shared processor + resources, as defined in ISA 2.06 and newer. */ + diff --git a/SOURCES/glibc-rh731833-misc-5.patch b/SOURCES/glibc-rh731833-misc-5.patch index d674bb10..ad46fe58 100644 --- a/SOURCES/glibc-rh731833-misc-5.patch +++ b/SOURCES/glibc-rh731833-misc-5.patch @@ -26,5 +26,6 @@ index 4c09eec..611c773 100644 uintptr_t pointer_guard; uintptr_t stack_guard; dtv_t *dtv; --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-misc-6.patch b/SOURCES/glibc-rh731833-misc-6.patch index 9c0783b4..02df7755 100644 --- a/SOURCES/glibc-rh731833-misc-6.patch +++ b/SOURCES/glibc-rh731833-misc-6.patch @@ -21,7 +21,7 @@ index 4ff7e84..cf4de97 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -15,6 +15,12 @@ endif - + ifeq ($(subdir),elf) sysdep_routines += dl-vdso +ifeq ($(build-shared),yes) @@ -31,7 +31,7 @@ index 4ff7e84..cf4de97 100644 +sysdep-rtld-routines += dl-static +endif endif - + ifeq ($(subdir),misc) diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Versions glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/Versions index 289c4fe..9b583fb 100644 @@ -176,5 +176,6 @@ index 0000000..fcedf32 +#define DL_STATIC_INIT(map) _dl_static_init (map) + +#endif /* ldsodefs.h */ --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-misc.patch b/SOURCES/glibc-rh731833-misc.patch index 2e305e6e..d72362df 100644 --- a/SOURCES/glibc-rh731833-misc.patch +++ b/SOURCES/glibc-rh731833-misc.patch @@ -38,12 +38,12 @@ index 6bcb7d5..5587e2a 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c @@ -41,7 +41,7 @@ _libc_vdso_platform_setup (void) - + __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615); - + - __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615); + __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615); - + __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); } diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -51,35 +51,35 @@ index da25c01..fa4116e 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -60,7 +60,8 @@ - \ + \ if (__vdso_##name != NULL) \ { \ - sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args); \ + sc_ret = \ + INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, long int, nr, ##args);\ - if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ - goto out; \ - if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \ + if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ + goto out; \ + if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \ @@ -90,7 +91,8 @@ - \ + \ if (__vdso_##name != NULL) \ { \ - v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args); \ + v_ret = \ + INTERNAL_VSYSCALL_NCS (__vdso_##name, err, long int, nr, ##args); \ - if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \ - || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \ - goto out; \ + if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \ + || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \ + goto out; \ @@ -104,12 +106,12 @@ INTERNAL_SYSCALL (name, err, nr, ##args) # endif - + -# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...) \ +# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...) \ ({ \ - long int sc_ret = ENOSYS; \ + type sc_ret = ENOSYS; \ - \ + \ if (__vdso_##name != NULL) \ - sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args); \ + sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, type, nr, ##args); \ @@ -118,7 +118,7 @@ index da25c01..fa4116e 100644 + __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3), "r" (r4)); \ + rval; \ }) - + # undef INLINE_SYSCALL @@ -191,7 +193,7 @@ register long int r10 __asm__ ("r10"); \ @@ -134,27 +134,27 @@ index 059cf70..b4cdbbb 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -75,7 +75,8 @@ - \ + \ if (__vdso_##name != NULL) \ { \ - sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args); \ + sc_ret = \ + INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, long int, nr, ##args);\ - if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ - goto out; \ - if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \ + if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ + goto out; \ + if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \ @@ -105,7 +106,8 @@ - \ + \ if (__vdso_##name != NULL) \ { \ - v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args); \ + v_ret = \ + INTERNAL_VSYSCALL_NCS (__vdso_##name, err, long int, nr, ##args); \ - if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \ - || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \ - goto out; \ + if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \ + || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \ + goto out; \ @@ -121,12 +123,12 @@ - + /* This version is for internal uses when there is no desire to set errno */ -#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...) \ @@ -162,7 +162,7 @@ index 059cf70..b4cdbbb 100644 ({ \ - long int sc_ret = ENOSYS; \ + type sc_ret = ENOSYS; \ - \ + \ if (__vdso_##name != NULL) \ - sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args); \ + sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, type, nr, ##args); \ @@ -172,7 +172,7 @@ index 059cf70..b4cdbbb 100644 @@ -142,7 +144,7 @@ gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) the negation of the return value in the kernel gets reverted. */ - + -#define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \ +#define INTERNAL_VSYSCALL_NCS(funcptr, err, type, nr, args...) \ ({ \ @@ -204,7 +204,8 @@ index 059cf70..b4cdbbb 100644 + __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3)); \ + rval; \ }) - + #undef INLINE_SYSCALL --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh731833-rtkaio-2.patch b/SOURCES/glibc-rh731833-rtkaio-2.patch index 672a9b99..59c2542d 100644 --- a/SOURCES/glibc-rh731833-rtkaio-2.patch +++ b/SOURCES/glibc-rh731833-rtkaio-2.patch @@ -2,8 +2,8 @@ diff -pruN glibc-2.17-c758a686/rtkaio/sysdeps/unix/sysv/linux/kaio_suspend.c gli --- glibc-2.17-c758a686/rtkaio/sysdeps/unix/sysv/linux/kaio_suspend.c 2011-10-19 16:34:41.000000000 +0530 +++ glibc-2.17-c758a686/rtkaio/sysdeps/unix/sysv/linux/kaio_suspend.c 2013-08-16 10:22:30.457609558 +0530 @@ -59,6 +59,7 @@ struct clparam - - + + static void +__attribute__ ((noinline)) cleanup (void *arg) diff --git a/SOURCES/glibc-rh731833-rtkaio.patch b/SOURCES/glibc-rh731833-rtkaio.patch index 2e3fab72..b805ee92 100644 --- a/SOURCES/glibc-rh731833-rtkaio.patch +++ b/SOURCES/glibc-rh731833-rtkaio.patch @@ -2,23 +2,23 @@ diff -pruN glibc-2.17-c758a686/rtkaio/Makefile glibc-2.17-c758a686/rtkaio/Makefi --- glibc-2.17-c758a686/rtkaio/Makefile 2011-10-19 16:34:41.000000000 +0530 +++ glibc-2.17-c758a686/rtkaio/Makefile 2013-08-13 18:23:21.064888432 +0530 @@ -55,7 +55,7 @@ extra-libs-others := $(extra-libs) - + include $(..)Makeconfig - + -ifeq (yesyes,$(build-shared)$(elf)) +ifeq (yes,$(build-shared)) generated += librt.so$(librt.so-version) - + $(objpfx)librt.so$(librt.so-version): $(objpfx)librtkaio.so; $(make-link) @@ -73,7 +73,7 @@ CPPFLAGS-librtkaio += -DIS_IN_librt=1 -I - + rpath-dirs := $(patsubst rt,rtkaio,$(rpath-dirs)) - + -ifeq (yesyes,$(build-shared)$(elf)) +ifeq (yes,$(build-shared)) others: $(objpfx)librt.so$(librt.so-version) endif - + @@ -81,8 +81,7 @@ endif # This ensures they will load libc.so for needed symbols if loaded by # a statically-linked program that hasn't already loaded it. @@ -26,6 +26,6 @@ diff -pruN glibc-2.17-c758a686/rtkaio/Makefile glibc-2.17-c758a686/rtkaio/Makefi - $(shared-thread-library) \ - $(if $(filter yes,$(elf)), $(elfobjdir)/ld.so) + $(shared-thread-library) $(elfobjdir)/ld.so - + ifeq (yes,$(build-shared)) $(addprefix $(objpfx),$(tests)): $(objpfx)librtkaio.so $(shared-thread-library) diff --git a/SOURCES/glibc-rh731835-0.patch b/SOURCES/glibc-rh731835-0.patch index be90c7ce..602faf7f 100644 --- a/SOURCES/glibc-rh731835-0.patch +++ b/SOURCES/glibc-rh731835-0.patch @@ -3,12 +3,12 @@ Author: Adhemerval Zanella Date: Fri Nov 7 12:25:32 2014 -0500 powerpc: Add the lock elision using HTM - + This patch adds support for lock elision using ISA 2.07 hardware transactional memory instructions for pthread_mutex primitives. Similar to s390 version, the for elision logic defined in 'force-elision.h' is only enabled if ENABLE_LOCK_ELISION is defined. - + Also, the lock elision code should be able to be built even with a compiler that does not provide HTM support with builtins. However I have noted the performance is sub-optimal due scheduling @@ -584,7 +584,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -326,4 +326,28 @@ extern int __lll_timedwait_tid (int *, c __res; \ }) - + +/* Transactional lock elision definitions. */ +extern int __lll_timedlock_elision + (int *futex, short *adapt_count, const struct timespec *timeout, int private) diff --git a/SOURCES/glibc-rh731835-1.patch b/SOURCES/glibc-rh731835-1.patch index d4bfff04..a47d2aad 100644 --- a/SOURCES/glibc-rh731835-1.patch +++ b/SOURCES/glibc-rh731835-1.patch @@ -3,12 +3,12 @@ Author: Adhemerval Zanella Date: Fri Nov 7 12:34:52 2014 -0500 powerpc: abort transaction in syscalls - + Linux kernel powerpc documentation states issuing a syscall inside a transaction is not recommended and may lead to undefined behavior. It also states syscalls does not abort transactoin neither they run in transactional state. - + To avoid side-effects being visible outside transactions, GLIBC with lock elision enabled will issue a transaction abort instruction just before all syscalls if hardware supports hardware transactions. @@ -55,13 +55,13 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/powerpc/tls.h + THREAD_SET_TM_CAPABLE (GLRO (dl_hwcap2) & PPC_FEATURE2_HAS_HTM ? 1 : 0); \ + NULL; \ + }) - + /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ @@ -177,6 +190,13 @@ register void *__thread_register __asm__ - + TLS_PRE_TCB_SIZE))[-1].pointer_guard \ + + TLS_PRE_TCB_SIZE))[-1].pointer_guard \ = THREAD_GET_POINTER_GUARD()) - + +/* tm_capable field in TCB head. */ +# define THREAD_GET_TM_CAPABLE() \ + (((tcbhead_t *) ((char *) __thread_register \ @@ -79,7 +79,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/sysdep.h @@ -89,7 +89,23 @@ GOT_LABEL: ; \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(name) - + +#if ! IS_IN(rtld) && defined (ENABLE_LOCK_ELISION) +# define ABORT_TRANSACTION \ + cmpwi 2,0; \ @@ -99,7 +99,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/sysdep.h + ABORT_TRANSACTION \ li 0,syscall; \ sc - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/sysdep.h @@ -107,7 +107,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h @@ -283,7 +283,23 @@ LT_LABELSUFFIX(name,_name_end): ; \ TRACEBACK_MASK(name,mask) \ END_2(name) - + +#if !IS_IN(rtld) && defined (ENABLE_LOCK_ELISION) +# define ABORT_TRANSACTION \ + cmpdi 13,0; \ @@ -127,7 +127,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h + ABORT_TRANSACTION \ li 0,syscall; \ sc - + Index: glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/sysdep.h @@ -140,13 +140,13 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h +#include +#include +#endif - + #define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC) - + @@ -164,4 +168,22 @@ #define ALIGNARG(log2) log2 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name - + +#else + +/* Linux kernel powerpc documentation [1] states issuing a syscall inside a @@ -197,7 +197,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c @@ -16,9 +16,16 @@ License along with the GNU C Library; if not, see . */ - + +/* RHEL 7-specific changes: The functions PREPARE_CREATE and TLS_VALUE + are used by createthread.c to override thread setup. In upstream + they appear in TLS_DEFINE_INIT_TP. */ @@ -210,6 +210,6 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/createthread.c -#define TLS_VALUE ((void *) (pd) \ - + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) +# define TLS_VALUE tp - + /* Get the real implementation. */ #include diff --git a/SOURCES/glibc-rh731835-2.patch b/SOURCES/glibc-rh731835-2.patch index c5ba166a..ea314ac5 100644 --- a/SOURCES/glibc-rh731835-2.patch +++ b/SOURCES/glibc-rh731835-2.patch @@ -17,14 +17,14 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/elision-conf.c + } #endif } - + Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strstr.c =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc64/multiarch/strstr.c +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strstr.c @@ -17,7 +17,10 @@ . */ - + /* Define multiple versions only for definition in libc. */ -#if IS_IN (libc) +/* RHEL 7-specific: Define multiple versions only for the definition in diff --git a/SOURCES/glibc-rh731837-00.patch b/SOURCES/glibc-rh731837-00.patch index cc933b33..6c31372a 100644 --- a/SOURCES/glibc-rh731837-00.patch +++ b/SOURCES/glibc-rh731837-00.patch @@ -206,5 +206,6 @@ index 9a5e3c7..0000000 @@ -1,2 +0,0 @@ -powerpc/powerpc64/power7/fpu -powerpc/powerpc64/power7 --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-01.patch b/SOURCES/glibc-rh731837-01.patch index 12722c04..d7be5d14 100644 --- a/SOURCES/glibc-rh731837-01.patch +++ b/SOURCES/glibc-rh731837-01.patch @@ -533,5 +533,6 @@ index 0000000..305e963 +strong_alias (__libc_memcpy, memcpy); +libc_hidden_ver (__libc_memcpy, memcpy); +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-02.patch b/SOURCES/glibc-rh731837-02.patch index 815a6624..dbcaffba 100644 --- a/SOURCES/glibc-rh731837-02.patch +++ b/SOURCES/glibc-rh731837-02.patch @@ -25,19 +25,19 @@ index a73cc19..4a3ef58 100644 --- glibc-2.17-c758a686/string/memcmp.c +++ glibc-2.17-c758a686/string/memcmp.c @@ -30,6 +30,10 @@ - + #undef memcmp - + +#ifndef MEMCMP +# define MEMCMP memcmp +#endif + #ifdef _LIBC - + # include @@ -308,7 +312,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len) } - + int -memcmp (s1, s2, len) +MEMCMP (s1, s2, len) @@ -62,7 +62,7 @@ index 5090af4..295ebca 100644 @@ -62,5 +62,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc)) #endif - + + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ + IFUNC_IMPL (i, name, memcmp, + IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX, @@ -251,5 +251,6 @@ index 0000000..af90f0a +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-03.patch b/SOURCES/glibc-rh731837-03.patch index 221bea74..946cff6a 100644 --- a/SOURCES/glibc-rh731837-03.patch +++ b/SOURCES/glibc-rh731837-03.patch @@ -43,14 +43,14 @@ index d02af98..fd5d4e5 100644 @@ -265,6 +265,7 @@ L(medium_28t): END_GEN_TB (BP_SYM (memset),TB_TOCLESS) libc_hidden_builtin_def (memset) - + +#ifndef NO_BZERO_IMPL /* Copied from bzero.S to prevent the linker from inserting a stub between bzero and memset. */ ENTRY (BP_SYM (__bzero)) @@ -284,3 +285,4 @@ ENTRY (BP_SYM (__bzero)) END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS) - + weak_alias (BP_SYM (__bzero), BP_SYM (bzero)) +#endif diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -226,12 +226,12 @@ index 295ebca..11e7063 100644 + __memset_power4) + IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc)) #endif - + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ @@ -70,5 +80,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memcmp_power4) IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */ + IFUNC_IMPL (i, name, bzero, + IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX, @@ -530,14 +530,14 @@ index c86a68a..c077ae7 100644 @@ -253,6 +253,7 @@ L(medium_28t): END_GEN_TB (BP_SYM (memset),TB_TOCLESS) libc_hidden_builtin_def (memset) - + +#ifndef NO_BZERO_IMPL /* Copied from bzero.S to prevent the linker from inserting a stub between bzero and memset. */ ENTRY (BP_SYM (__bzero)) @@ -272,3 +273,4 @@ ENTRY (BP_SYM (__bzero)) END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS) - + weak_alias (BP_SYM (__bzero), BP_SYM (bzero)) +#endif diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S @@ -547,14 +547,14 @@ index 930ecce..967642a3 100644 @@ -397,6 +397,7 @@ L(medium_28t): END_GEN_TB (BP_SYM (memset),TB_TOCLESS) libc_hidden_builtin_def (memset) - + +#ifndef NO_BZERO_IMPL /* Copied from bzero.S to prevent the linker from inserting a stub between bzero and memset. */ ENTRY (BP_SYM (__bzero)) @@ -416,3 +417,4 @@ ENTRY (BP_SYM (__bzero)) END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS) - + weak_alias (BP_SYM (__bzero), BP_SYM (bzero)) +#endif diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S @@ -564,15 +564,16 @@ index 5970fbe..2716656 100644 @@ -385,6 +385,7 @@ L(small): END_GEN_TB (BP_SYM (memset),TB_TOCLESS) libc_hidden_builtin_def (memset) - + +#ifndef NO_BZERO_IMPL /* Copied from bzero.S to prevent the linker from inserting a stub between bzero and memset. */ ENTRY (BP_SYM (__bzero)) @@ -395,3 +396,4 @@ ENTRY (BP_SYM (__bzero)) END_GEN_TB (BP_SYM (__bzero),TB_TOCLESS) - + weak_alias (BP_SYM (__bzero), BP_SYM (bzero)) +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-04.patch b/SOURCES/glibc-rh731837-04.patch index 549ee11b..2aa3ba92 100644 --- a/SOURCES/glibc-rh731837-04.patch +++ b/SOURCES/glibc-rh731837-04.patch @@ -30,7 +30,7 @@ index 2a542e3..7509c24 100644 @@ -26,11 +26,12 @@ #undef mempcpy #undef __mempcpy - + +#ifndef MEMPCPY +# define MEMPCPY __mempcpy +#endif @@ -101,7 +101,7 @@ index 11e7063..c72c229 100644 @@ -90,5 +90,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __bzero_power4) IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */ + IFUNC_IMPL (i, name, mempcpy, + IFUNC_IMPL_ADD (array, i, mempcpy, @@ -228,5 +228,6 @@ index 0000000..38fbcc3 +#else +# include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-05.patch b/SOURCES/glibc-rh731837-05.patch index 429f1906..5ce6fbf2 100644 --- a/SOURCES/glibc-rh731837-05.patch +++ b/SOURCES/glibc-rh731837-05.patch @@ -31,7 +31,7 @@ index 22637cf..822c0a4 100644 @@ -56,9 +56,13 @@ #undef memchr #undef __memchr - + +#ifndef MEMCHR +# define MEMCHR __memchr +#endif @@ -101,7 +101,7 @@ index c72c229..663e294 100644 @@ -98,5 +98,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */ + IFUNC_IMPL (i, name, memchr, + IFUNC_IMPL_ADD (array, i, memchr, @@ -227,5 +227,6 @@ index 0000000..ca0f714 +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-06.patch b/SOURCES/glibc-rh731837-06.patch index 06e5f726..51bc94e2 100644 --- a/SOURCES/glibc-rh731837-06.patch +++ b/SOURCES/glibc-rh731837-06.patch @@ -72,7 +72,7 @@ index 663e294..a0700dc 100644 @@ -106,5 +106,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */ + IFUNC_IMPL (i, name, memrchr, + IFUNC_IMPL_ADD (array, i, memrchr, @@ -197,5 +197,6 @@ index 0000000..610a957 +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-07.patch b/SOURCES/glibc-rh731837-07.patch index 3fcaae7d..6c5d8c64 100644 --- a/SOURCES/glibc-rh731837-07.patch +++ b/SOURCES/glibc-rh731837-07.patch @@ -28,13 +28,13 @@ index 90e8c7c..0e4f192 100644 --- glibc-2.17-c758a686/string/rawmemchr.c +++ glibc-2.17-c758a686/string/rawmemchr.c @@ -47,10 +47,13 @@ - + #undef memchr - + +#ifndef RAWMEMCHR +# define RAWMEMCHR __rawmemchr +#endif - + /* Find the first occurrence of C in S. */ __ptr_t -__rawmemchr (s, c_in) @@ -99,7 +99,7 @@ index a0700dc..5b15c3f 100644 @@ -114,5 +114,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */ + IFUNC_IMPL (i, name, rawmemchr, + IFUNC_IMPL_ADD (array, i, rawmemchr, @@ -219,5 +219,6 @@ index 0000000..3f53cd5 +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-08.patch b/SOURCES/glibc-rh731837-08.patch index 44573ef8..b942e1cf 100644 --- a/SOURCES/glibc-rh731837-08.patch +++ b/SOURCES/glibc-rh731837-08.patch @@ -44,7 +44,7 @@ index 5b15c3f..bdc908b 100644 + IFUNC_IMPL_ADD (array, i, strlen, 1, + __strlen_ppc)) #endif - + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S new file mode 100644 @@ -183,5 +183,6 @@ index 0000000..d2c26e9 +strong_alias (__libc_strlen, strlen) +libc_hidden_ver (__libc_strlen, strlen) +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-09.patch b/SOURCES/glibc-rh731837-09.patch index 8b7e29ff..d1a08b51 100644 --- a/SOURCES/glibc-rh731837-09.patch +++ b/SOURCES/glibc-rh731837-09.patch @@ -73,7 +73,7 @@ index bdc908b..c9125b8 100644 @@ -129,5 +129,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */ + IFUNC_IMPL (i, name, strnlen, + IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX, @@ -195,5 +195,6 @@ index 0000000..3926031 +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-10.patch b/SOURCES/glibc-rh731837-10.patch index b180df23..ac203980 100644 --- a/SOURCES/glibc-rh731837-10.patch +++ b/SOURCES/glibc-rh731837-10.patch @@ -37,7 +37,7 @@ index c9125b8..ba78d97 100644 @@ -136,5 +136,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */ + IFUNC_IMPL (i, name, strcasecmp, + IFUNC_IMPL_ADD (array, i, strcasecmp, @@ -243,5 +243,6 @@ index 0000000..a3374c3 + +weak_alias (__libc_strcasecmp_l, strcasecmp_l) +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-11.patch b/SOURCES/glibc-rh731837-11.patch index d0e47e86..15e2c172 100644 --- a/SOURCES/glibc-rh731837-11.patch +++ b/SOURCES/glibc-rh731837-11.patch @@ -41,7 +41,7 @@ index ba78d97..4b8fb22 100644 @@ -151,5 +151,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1, __strcasecmp_l_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */ + IFUNC_IMPL (i, name, strncasecmp, + IFUNC_IMPL_ADD (array, i, strncasecmp, @@ -215,5 +215,6 @@ index 0000000..4014269 + +weak_alias (__libc_strncasecmp_l, strncasecmp_l) +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-12.patch b/SOURCES/glibc-rh731837-12.patch index 73f040d4..257cd2f9 100644 --- a/SOURCES/glibc-rh731837-12.patch +++ b/SOURCES/glibc-rh731837-12.patch @@ -30,7 +30,7 @@ index 4dca756..22baf1c 100644 - strncase-power7 strncase_l-power7 + strncase-power7 strncase_l-power7 strncmp-power7 \ + strncmp-power4 strncmp-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -51,7 +51,7 @@ index 4b8fb22..67f75a5 100644 + IFUNC_IMPL_ADD (array, i, strncmp, 1, + __strncmp_ppc)) #endif - + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S new file mode 100644 @@ -232,5 +232,6 @@ index 0000000..9829d69 + ? __strncmp_power4 + : __strncmp_ppc); +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-13.patch b/SOURCES/glibc-rh731837-13.patch index 4a35bbf8..e494b732 100644 --- a/SOURCES/glibc-rh731837-13.patch +++ b/SOURCES/glibc-rh731837-13.patch @@ -29,7 +29,7 @@ index 22baf1c..f7c5853 100644 strncase-power7 strncase_l-power7 strncmp-power7 \ - strncmp-power4 strncmp-ppc64 + strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -49,7 +49,7 @@ index 67f75a5..3b005ea 100644 + IFUNC_IMPL_ADD (array, i, strchr, 1, + __strchr_ppc)) #endif - + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S new file mode 100644 @@ -207,5 +207,6 @@ index 0000000..74a9d54 + : __strchr_ppc); +weak_alias (strchr, index) +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-14.patch b/SOURCES/glibc-rh731837-14.patch index 6aeafa74..6379ab56 100644 --- a/SOURCES/glibc-rh731837-14.patch +++ b/SOURCES/glibc-rh731837-14.patch @@ -30,7 +30,7 @@ index 0db5e23..39540a3 100644 @@ -27,9 +27,13 @@ #undef __strchrnul #undef strchrnul - + +#ifndef STRCHRNUL +# define STRCHRNUL __strchrnul +#endif @@ -87,7 +87,7 @@ index f7c5853..15b86bd 100644 - strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 + strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \ + strchrnul-power7 strchrnul-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -107,7 +107,7 @@ index 3b005ea..9e3b89d 100644 + IFUNC_IMPL_ADD (array, i, strchrnul, 1, + __strchrnul_ppc)) #endif - + /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S new file mode 100644 @@ -221,5 +221,6 @@ index 0000000..dab1cbf +#else +#include +#endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-15.patch b/SOURCES/glibc-rh731837-15.patch index 460312aa..a8ff112e 100644 --- a/SOURCES/glibc-rh731837-15.patch +++ b/SOURCES/glibc-rh731837-15.patch @@ -242,7 +242,7 @@ index 15b86bd..ff3b8cf 100644 - strchrnul-power7 strchrnul-ppc64 + strchrnul-power7 strchrnul-ppc64 wcschr-power7 \ + wcschr-power6 wcschr-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops +CFLAGS-wcschr-power7.c += -mcpu=power7 @@ -255,7 +255,7 @@ index 9e3b89d..cc932c9 100644 @@ -191,5 +191,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, __strncasecmp_l_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ + IFUNC_IMPL (i, name, wcschr, + IFUNC_IMPL_ADD (array, i, wcschr, @@ -394,5 +394,6 @@ index 9136c02..ae04a13 100644 @@ -1 +1 @@ -#include "../../powerpc32/power6/wcschr.c" +#include --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-16.patch b/SOURCES/glibc-rh731837-16.patch index 9f7f28d2..9aee31d3 100644 --- a/SOURCES/glibc-rh731837-16.patch +++ b/SOURCES/glibc-rh731837-16.patch @@ -226,7 +226,7 @@ index ff3b8cf..b4504b7 100644 - wcschr-power6 wcschr-ppc64 + wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \ + wcsrchr-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops CFLAGS-wcschr-power7.c += -mcpu=power7 @@ -241,7 +241,7 @@ index cc932c9..6c7422c 100644 @@ -202,5 +202,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, wcschr, 1, __wcschr_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ + IFUNC_IMPL (i, name, wcsrchr, + IFUNC_IMPL_ADD (array, i, wcsrchr, @@ -383,13 +383,13 @@ index c1b5a59..27c94c5 100644 --- glibc-2.17-c758a686/wcsmbs/wcsrchr.c +++ glibc-2.17-c758a686/wcsmbs/wcsrchr.c @@ -18,10 +18,13 @@ - + #include - + +#ifndef WCSRCHR +# define WCSRCHR wcsrchr +#endif - + /* Find the last occurrence of WC in WCS. */ wchar_t * -wcsrchr (wcs, wc) @@ -397,5 +397,6 @@ index c1b5a59..27c94c5 100644 register const wchar_t *wcs; register const wchar_t wc; { --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-17.patch b/SOURCES/glibc-rh731837-17.patch index 10282694..f8668b41 100644 --- a/SOURCES/glibc-rh731837-17.patch +++ b/SOURCES/glibc-rh731837-17.patch @@ -246,7 +246,7 @@ index b4504b7..7113212 100644 wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \ - wcsrchr-ppc64 + wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops @@ -19,4 +19,6 @@ CFLAGS-wcschr-power7.c += -mcpu=power7 @@ -263,7 +263,7 @@ index 6c7422c..2d21ce1 100644 @@ -213,5 +213,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ppc)) - + + /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */ + IFUNC_IMPL (i, name, wcscpy, + IFUNC_IMPL_ADD (array, i, wcscpy, @@ -407,11 +407,11 @@ index 6dea24d..cec1249 100644 @@ -19,10 +19,13 @@ #include #include - + +#ifndef WCSCPY +# define WCSCPY wcscpy +#endif - + /* Copy SRC to DEST. */ wchar_t * -wcscpy (dest, src) @@ -419,5 +419,6 @@ index 6dea24d..cec1249 100644 wchar_t *dest; const wchar_t *src; { --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-18.patch b/SOURCES/glibc-rh731837-18.patch index 8ce9d6c4..fd8b4e0e 100644 --- a/SOURCES/glibc-rh731837-18.patch +++ b/SOURCES/glibc-rh731837-18.patch @@ -53,11 +53,11 @@ index b171f27..ff4cce4 100644 + Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Torbjorn Granlund (tege@sics.se). - + @@ -26,11 +26,12 @@ block beginning at DSTP with LEN `op_t' words (not LEN bytes!). Both SRCP and DSTP should be aligned for memory operations on `op_t's. */ - + +#ifndef WORDCOPY_FWD_ALIGNED +# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned +#endif @@ -70,11 +70,11 @@ index b171f27..ff4cce4 100644 +WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len) { op_t a0, a1; - + @@ -134,11 +135,12 @@ _wordcopy_fwd_aligned (dstp, srcp, len) DSTP should be aligned for memory operations on `op_t's, but SRCP must *not* be aligned. */ - + +#ifndef WORDCOPY_FWD_DEST_ALIGNED +# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned +#endif @@ -91,7 +91,7 @@ index b171f27..ff4cce4 100644 @@ -221,11 +223,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len) (not LEN bytes!). Both SRCP and DSTP should be aligned for memory operations on `op_t's. */ - + +#ifndef WORDCOPY_BWD_ALIGNED +# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned +#endif @@ -104,11 +104,11 @@ index b171f27..ff4cce4 100644 +WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len) { op_t a0, a1; - + @@ -329,11 +332,12 @@ _wordcopy_bwd_aligned (dstp, srcp, len) words (not LEN bytes!). DSTP should be aligned for memory operations on `op_t', but SRCP must *not* be aligned. */ - + +#ifndef WORDCOPY_BWD_DEST_ALIGNED +# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned +#endif @@ -665,7 +665,7 @@ index 7113212..8dceb09 100644 - wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 + wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \ + wordcopy-power7 wordcopy-power6 wordcopy-ppc64 - + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops @@ -21,4 +22,6 @@ CFLAGS-wcsrchr-power7.c += -mcpu=power7 @@ -893,7 +893,7 @@ index 4c72404..0000000 - if (len & 1) - { - ((op_t *) dstp)[0] = ((op_t *) srcp)[0]; -- +- - if (len == 1) - return; - srcp += OPSIZ; @@ -961,10 +961,10 @@ index 4c72404..0000000 - { - a1 = ((op_t *) srcp)[1]; - ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2); -- +- - if (len == 1) - return; -- +- - a0 = a1; - srcp += OPSIZ; - dstp += OPSIZ; @@ -993,7 +993,7 @@ index 4c72404..0000000 - srcp -= OPSIZ; - dstp -= OPSIZ; - ((op_t *) dstp)[0] = ((op_t *) srcp)[0]; -- +- - if (len == 1) - return; - len -= 1; @@ -1071,5 +1071,6 @@ index 4c72404..0000000 - - bwd_align_merge (align); -} --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-19.patch b/SOURCES/glibc-rh731837-19.patch index 7cf21c68..ffa4548d 100644 --- a/SOURCES/glibc-rh731837-19.patch +++ b/SOURCES/glibc-rh731837-19.patch @@ -23,5 +23,6 @@ index 9eaf014..6bec24b 100644 asm ("memset = __GI_memset"); +asm ("memcpy = __GI_memcpy"); #endif --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-20.patch b/SOURCES/glibc-rh731837-20.patch index 350b34f3..47d2f9f8 100644 --- a/SOURCES/glibc-rh731837-20.patch +++ b/SOURCES/glibc-rh731837-20.patch @@ -70,5 +70,6 @@ index 6243d2e..0000000 @@ -1,2 +0,0 @@ -# Override ldbl-opt with powerpc64 specific routines. -powerpc/powerpc64/fpu --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-21.patch b/SOURCES/glibc-rh731837-21.patch index 87458083..bb68825e 100644 --- a/SOURCES/glibc-rh731837-21.patch +++ b/SOURCES/glibc-rh731837-21.patch @@ -121,10 +121,10 @@ index 1bd6a67..0000000 -#else - if (__builtin_expect (_LIB_VERSION == _IEEE_, 0)) - return z; -- +- - if (__builtin_expect (x != x, 0)) - return z; -- +- - if (__builtin_expect (x < 0.0, 0)) - return __kernel_standard (x, x, 26); /* sqrt(negative) */ - else @@ -185,10 +185,10 @@ index 0e7e692..0000000 - - if (__builtin_expect (_LIB_VERSION == _IEEE_, 0)) - return z; -- +- - if (__builtin_expect (x != x, 0)) - return z; -- +- - if (__builtin_expect (x < 0.0, 0)) - /* sqrtf(negative) */ - return (float) __kernel_standard ((double) x, (double) x, 126); @@ -198,5 +198,6 @@ index 0e7e692..0000000 -} - -weak_alias (__sqrtf, sqrtf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-22.patch b/SOURCES/glibc-rh731837-22.patch index 6b18bc42..73464420 100644 --- a/SOURCES/glibc-rh731837-22.patch +++ b/SOURCES/glibc-rh731837-22.patch @@ -28,7 +28,7 @@ index 6cbc93b..a0f0af9 100644 + Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. - + @@ -24,9 +24,7 @@ __complex__ float __cprojf (__complex__ float x) @@ -39,6 +39,7 @@ index 6cbc93b..a0f0af9 100644 + if (__isinf_nsf (__real__ x) || __isinf_nsf (__imag__ x)) { __complex__ float res; - --- + +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-23.patch b/SOURCES/glibc-rh731837-23.patch index bb21bacd..7dd71388 100644 --- a/SOURCES/glibc-rh731837-23.patch +++ b/SOURCES/glibc-rh731837-23.patch @@ -34,7 +34,7 @@ index f1ea473..0157805 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_isnan.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_isnan.S @@ -37,9 +37,11 @@ weak_alias (__isnan, isnan) - + /* It turns out that the 'double' version will also always work for single-precision. */ +#ifndef __isnan @@ -42,7 +42,7 @@ index f1ea473..0157805 100644 hidden_def (__isnanf) weak_alias (__isnanf, isnanf) +#endif - + #ifdef NO_LONG_DOUBLE strong_alias (__isnan, __isnanl) diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -357,5 +357,6 @@ index 0000000..b237455 + : __isnan_ppc64); + +weak_alias (__isnanf, isnanf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-24.patch b/SOURCES/glibc-rh731837-24.patch index d08d1dbd..fa417124 100644 --- a/SOURCES/glibc-rh731837-24.patch +++ b/SOURCES/glibc-rh731837-24.patch @@ -26,7 +26,7 @@ index b57ddc9..a4636b0 100644 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -3,5 +3,6 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ - s_isnan-power5 s_isnan-ppc64 + s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -215,5 +215,6 @@ index 0000000..0dab544 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/s_lround.c @@ -0,0 +1 @@ +/* __lround is in s_llround.c */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-25.patch b/SOURCES/glibc-rh731837-25.patch index 6e98573c..132b67ad 100644 --- a/SOURCES/glibc-rh731837-25.patch +++ b/SOURCES/glibc-rh731837-25.patch @@ -27,7 +27,7 @@ index a4636b0..9eb69af 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -4,5 +4,6 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ - s_llround-power5+ s_llround-ppc64 @@ -256,5 +256,6 @@ index 0000000..d951990 + : __ceilf_ppc64); + +weak_alias (__ceilf, ceilf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-26.patch b/SOURCES/glibc-rh731837-26.patch index f9855578..d587fe41 100644 --- a/SOURCES/glibc-rh731837-26.patch +++ b/SOURCES/glibc-rh731837-26.patch @@ -258,5 +258,6 @@ index 0000000..08fc95e + : __floorf_ppc64); + +weak_alias (__floorf, floorf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-27.patch b/SOURCES/glibc-rh731837-27.patch index 0babc3c5..9457fc5b 100644 --- a/SOURCES/glibc-rh731837-27.patch +++ b/SOURCES/glibc-rh731837-27.patch @@ -256,5 +256,6 @@ index 0000000..34c5bc7 + : __roundf_ppc64); + +weak_alias (__roundf, roundf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-28.patch b/SOURCES/glibc-rh731837-28.patch index 7d494f85..6510503e 100644 --- a/SOURCES/glibc-rh731837-28.patch +++ b/SOURCES/glibc-rh731837-28.patch @@ -256,5 +256,6 @@ index 0000000..0eef89f + : __truncf_ppc64); + +weak_alias (__truncf, truncf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-29.patch b/SOURCES/glibc-rh731837-29.patch index 9af3f03f..2edaeba9 100644 --- a/SOURCES/glibc-rh731837-29.patch +++ b/SOURCES/glibc-rh731837-29.patch @@ -28,7 +28,7 @@ index 4cdb383..3af4ac3 100644 - s_isnan-power5 s_isnan-ppc64 + s_isnan-power5 s_isnan-ppc64 s_copysign-power6 \ + s_copysign-ppc64 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -9,5 +10,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -214,5 +214,6 @@ index 0000000..55cc272 + : __copysign_ppc64); + +weak_alias (__copysignf, copysignf) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-30.patch b/SOURCES/glibc-rh731837-30.patch index bb8d9194..49d8f6f5 100644 --- a/SOURCES/glibc-rh731837-30.patch +++ b/SOURCES/glibc-rh731837-30.patch @@ -174,5 +174,6 @@ index 0000000..d092862 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/s_lrint.c @@ -0,0 +1 @@ + /* __lrint is in s_llrint.c */ --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-31.patch b/SOURCES/glibc-rh731837-31.patch index 072475db..6c2c4faf 100644 --- a/SOURCES/glibc-rh731837-31.patch +++ b/SOURCES/glibc-rh731837-31.patch @@ -32,7 +32,7 @@ index 47dad5d..49986bb 100644 +++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/s_finite.c @@ -23,11 +23,16 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $"; #include - + #undef __finite -int __finite(double x) + @@ -57,7 +57,7 @@ index dfdf4ad..4ea270a 100644 +++ glibc-2.17-c758a686/sysdeps/ieee754/flt-32/s_finitef.c @@ -26,7 +26,12 @@ static char rcsid[] = "$NetBSD: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $" #include - + #undef __finitef -int __finitef(float x) + @@ -67,8 +67,8 @@ index dfdf4ad..4ea270a 100644 + +int FINITEF(float x) { - int32_t ix; - GET_FLOAT_WORD(ix,x); + int32_t ix; + GET_FLOAT_WORD(ix,x); diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 10d0ac9..1c23ddc 100644 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -80,7 +80,7 @@ index 10d0ac9..1c23ddc 100644 - s_copysign-ppc64 + s_copysign-ppc64 s_finite-power7 s_finite-ppc64 \ + s_finitef-ppc64 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -12,5 +13,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -303,5 +303,6 @@ index 0000000..a7243b5 + : __finitef_ppc64); + +weak_alias (__finitef, finitef) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-32.patch b/SOURCES/glibc-rh731837-32.patch index 28f7e509..01ef0c81 100644 --- a/SOURCES/glibc-rh731837-32.patch +++ b/SOURCES/glibc-rh731837-32.patch @@ -31,7 +31,7 @@ index 1c23ddc..64dd85f 100644 - s_finitef-ppc64 + s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \ + s_isinf-ppc64 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -14,5 +15,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -246,5 +246,6 @@ index 0000000..1336feb + : __isinff_ppc64); + +weak_alias (__isinff, isinff) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-33.patch b/SOURCES/glibc-rh731837-33.patch index 1929245a..927bda17 100644 --- a/SOURCES/glibc-rh731837-33.patch +++ b/SOURCES/glibc-rh731837-33.patch @@ -57,7 +57,7 @@ index 6cbfcfa..28a50de 100644 @@ -44,4 +44,6 @@ __logbl (long double x) return (long double) (rhx - 1023); } - + +#ifndef __logbl long_double_symbol (libm, __logbl, logbl); +#endif @@ -693,5 +693,6 @@ index 0000000..cb0b0c5 + : __logbl_ppc64); + +long_double_symbol (libm, __logbl, logbl); --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-33A.patch b/SOURCES/glibc-rh731837-33A.patch index 12260613..e10da652 100644 --- a/SOURCES/glibc-rh731837-33A.patch +++ b/SOURCES/glibc-rh731837-33A.patch @@ -5,7 +5,7 @@ - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2014 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 @@ -35,14 +35,14 @@ long double @@ -14,11 +14,11 @@ - double xh, xl; + double xh; double ret; - + if (__builtin_expect (x == 0.0L, 0)) /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */ return -1.0L / __builtin_fabsl (x); - + - ldbl_unpack (x, &xh, &xl); + xh = ldbl_high (x); /* ret = x & 0x7ff0000000000000; */ @@ -30,7 +30,7 @@ though it were normalized. */ - int64_t lx, hx; + int64_t hx; - + - GET_LDOUBLE_WORDS64 (hx, lx, x); + EXTRACT_WORDS64 (hx, xh); return (long double) (-1023 - (__builtin_clzll (hx) - 12)); diff --git a/SOURCES/glibc-rh731837-34.patch b/SOURCES/glibc-rh731837-34.patch index 89779701..69488290 100644 --- a/SOURCES/glibc-rh731837-34.patch +++ b/SOURCES/glibc-rh731837-34.patch @@ -111,7 +111,7 @@ index 87aabca..e152bf5 100644 - s_isinf-ppc64 + s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \ + s_modff-power5+ s_modff-ppc64 - + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ @@ -18,9 +19,12 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ @@ -121,7 +121,7 @@ index 87aabca..e152bf5 100644 - s_logbl-ppc64 + s_logbl-ppc64 s_modf-power5+ s_modf-ppc64 \ + s_modff-power5+ s_modff-ppc64 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 CFLAGS-s_logb-power7.c = -mcpu=power7 @@ -331,5 +331,6 @@ index 0000000..137b7aa + : __modff_ppc64); + +weak_alias (__modff, modff) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-35.patch b/SOURCES/glibc-rh731837-35.patch index da48f944..9b411d70 100644 --- a/SOURCES/glibc-rh731837-35.patch +++ b/SOURCES/glibc-rh731837-35.patch @@ -105,7 +105,7 @@ index e152bf5..1e04f21 100644 - s_modff-power5+ s_modff-ppc64 + s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \ + e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 - + CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 CFLAGS-s_logb-power7.c = -mcpu=power7 @@ -304,5 +304,6 @@ index 0000000..3c418d3 + : __ieee754_hypotf_ppc64); + +strong_alias (__ieee754_hypotf, __hypotf_finite) --- +-- 1.8.3.1 + diff --git a/SOURCES/glibc-rh731837-36.patch b/SOURCES/glibc-rh731837-36.patch index 48a1581c..bb49f73f 100644 --- a/SOURCES/glibc-rh731837-36.patch +++ b/SOURCES/glibc-rh731837-36.patch @@ -13,7 +13,7 @@ index b1b4ec7..4a8d459 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memchr_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S @@ -27,7 +27,7 @@ index 12db42c..9903276 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcmp_power4) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S @@ -41,7 +41,7 @@ index 4898a88..ee31ca6 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcmp_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S @@ -55,7 +55,7 @@ index 2d5bfa9..decbcff 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_a2) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S @@ -69,7 +69,7 @@ index 92c06be..c3c2f7f 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_cell) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S @@ -83,7 +83,7 @@ index eb01d67..02ba9b1 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_power4) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S @@ -97,7 +97,7 @@ index 13b514d..58e8113 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_power6) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S @@ -111,7 +111,7 @@ index 2aea73d..1170c50 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_power7) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S @@ -125,7 +125,7 @@ index b828915..c630654 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memcpy_ppc) - + # undef END_GEN_TB # define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S @@ -139,7 +139,7 @@ index 6a79847..8d4b7a7 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__mempcpy_power7) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S @@ -153,7 +153,7 @@ index 42ee8e2..c363215 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memrchr_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S @@ -167,7 +167,7 @@ index 9074b95..968dc24 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memset_power4) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S @@ -181,7 +181,7 @@ index 70688b5..65519b9 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memset_power6) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S @@ -195,7 +195,7 @@ index ab226c5..86765e7 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memset_power7) - + #undef END_GEN_TB #define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S @@ -209,7 +209,7 @@ index dc5549c..3601a77 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__memset_ppc) - + # undef END_GEN_TB # define END_GEN_TB(name, mask) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S @@ -223,7 +223,7 @@ index 24ae3bf..9f7533a 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__rawmemchr_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S @@ -237,7 +237,7 @@ index 9714f88..ad00f98 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strcasecmp_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S @@ -251,7 +251,7 @@ index 117e464..81ec696 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strcasecmp_l_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S @@ -265,7 +265,7 @@ index 0b2ca42..a3473a6 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strchr_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S @@ -279,7 +279,7 @@ index ded9284..607668a 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strchr_ppc) - + # undef END # define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S @@ -293,7 +293,7 @@ index 87d7c03..95ead0a 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strchrnul_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S @@ -307,7 +307,7 @@ index a38521d..c47c9d6 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strlen_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S @@ -321,7 +321,7 @@ index b463b3a..a195e9a 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strlen_ppc) - + # undef END # define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S @@ -335,7 +335,7 @@ index 62cebbc..da32b0b 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strncmp_power4) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S @@ -349,7 +349,7 @@ index b0d607a..65ee0cd 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strncmp_power7) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S @@ -363,7 +363,7 @@ index 25b7f26..14a2bec 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strncmp_ppc) - + #undef END #define END(name) \ diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S @@ -377,6 +377,6 @@ index 909aae8..057e5a8 100644 - cfi_startproc; + cfi_startproc; \ + LOCALENTRY(__strnlen_power7) - + #undef END #define END(name) \ diff --git a/SOURCES/glibc-rh739743.patch b/SOURCES/glibc-rh739743.patch index 1d261999..2072acf1 100644 --- a/SOURCES/glibc-rh739743.patch +++ b/SOURCES/glibc-rh739743.patch @@ -5,31 +5,31 @@ Author: Allan McRae Date: Fri Oct 25 14:25:38 2013 +1000 Fix incorrect getaddrinfo assertion trigger - + [BZ #9954] --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -1456,13 +1456,13 @@ - - /* Fill in the results in all the records. */ - for (int i = 0; i < src->nresults; ++i) + + /* Fill in the results in all the records. */ + for (int i = 0; i < src->nresults; ++i) - if (src->results[i].index == a1_index) + if (a1_index != -1 && src->results[i].index == a1_index) - { - assert (src->results[i].native == -1 - || src->results[i].native == a1_native); - src->results[i].native = a1_native; - } + { + assert (src->results[i].native == -1 + || src->results[i].native == a1_native); + src->results[i].native = a1_native; + } - else if (src->results[i].index == a2_index) + else if (a2_index != -1 && src->results[i].index == a2_index) - { - assert (src->results[i].native == -1 - || src->results[i].native == a2_native); + { + assert (src->results[i].native == -1 + || src->results[i].native == a2_native); 2009-03-15 Aurelien Jarno - * sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect + * sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect interface for all 127.X.Y.Z addresses. --- @@ -39,18 +39,18 @@ Date: Fri Oct 25 14:25:38 2013 +1000 --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -2265,7 +2265,14 @@ - tmp.addr[0] = 0; - tmp.addr[1] = 0; - tmp.addr[2] = htonl (0xffff); + tmp.addr[0] = 0; + tmp.addr[1] = 0; + tmp.addr[2] = htonl (0xffff); - tmp.addr[3] = sinp->sin_addr.s_addr; + /* Special case for lo interface, the source address -+ being possibly different than the interface ++ being possibly different than the interface + address. */ + if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000) + == 0x7f000000) + tmp.addr[3] = htonl(0x7f000001); + else + tmp.addr[3] = sinp->sin_addr.s_addr; - } - else - { + } + else + { diff --git a/SOURCES/glibc-rh741105.patch b/SOURCES/glibc-rh741105.patch index c83cac96..0c15fef6 100644 --- a/SOURCES/glibc-rh741105.patch +++ b/SOURCES/glibc-rh741105.patch @@ -2,9 +2,9 @@ diff -rup glibc-2.17-c758a686/elf/dl-load.c glibc-2.17-c758a686/elf/dl-load.c --- glibc-2.17-c758a686/elf/dl-load.c 2012-02-03 10:59:58.917870716 -0700 +++ glibc-2.17-c758a686/elf/dl-load.c 2012-02-03 11:01:01.796580644 -0700 @@ -1130,6 +1130,16 @@ _dl_map_object_from_fd (const char *name - = N_("ELF load command address/offset not properly aligned"); - goto call_lose; - } + = N_("ELF load command address/offset not properly aligned"); + goto call_lose; + } + if (__builtin_expect ((ph->p_offset + ph->p_filesz > st.st_size), 0)) + { + /* If the segment requires zeroing of part of its last @@ -15,7 +15,7 @@ diff -rup glibc-2.17-c758a686/elf/dl-load.c glibc-2.17-c758a686/elf/dl-load.c + errstring = N_("ELF load command past end of file"); + goto call_lose; + } - - c = &loadcmds[nloadcmds++]; - c->mapstart = ph->p_vaddr & ~(GLRO(dl_pagesize) - 1); + + c = &loadcmds[nloadcmds++]; + c->mapstart = ph->p_vaddr & ~(GLRO(dl_pagesize) - 1); Only inglibc-2.17-c758a686/elf: dl-load.c.orig diff --git a/SOURCES/glibc-rh742038.patch b/SOURCES/glibc-rh742038.patch index d9b5b1fd..6e5b3b50 100644 --- a/SOURCES/glibc-rh742038.patch +++ b/SOURCES/glibc-rh742038.patch @@ -1,56 +1,56 @@ Author: Alexandre Oliva Add malloc probes for sbrk and heap resizing. - - * malloc/arena.c (new_heap): New memory_heap_new probe. - (grow_heap): New memory_heap_more probe. - (shrink_heap): New memory_heap_less probe. - (heap_trim): New memory_heap_free probe. - * malloc/malloc.c (sysmalloc): New memory_sbrk_more probe. - (systrim): New memory_sbrk_less probe. - * manual/probes.texi: Document them. + + * malloc/arena.c (new_heap): New memory_heap_new probe. + (grow_heap): New memory_heap_more probe. + (shrink_heap): New memory_heap_less probe. + (heap_trim): New memory_heap_free probe. + * malloc/malloc.c (sysmalloc): New memory_sbrk_more probe. + (systrim): New memory_sbrk_less probe. + * manual/probes.texi: Document them. Add catch-all alloc retry probe. - - * malloc/arena.c (arena_get_retry): Add memory_arena_retry probe. - * manual/probes.texi: Document it. + + * malloc/arena.c (arena_get_retry): Add memory_arena_retry probe. + * manual/probes.texi: Document it. Add probes for malloc retries. - - * malloc/malloc.c (__libc_malloc): Add memory_malloc_retry probe. - (__libc_realloc): Add memory_realloc_retry probe. - (__libc_memalign): Add memory_memalign_retry probe. - (__libc_valloc): Add memory_valloc_retry probe. - (__libc_pvalloc): Add memory_pvalloc_retry probe. - (__libc_calloc): Add memory_calloc_retry probe. - * manual/probes.texi: Document them. + + * malloc/malloc.c (__libc_malloc): Add memory_malloc_retry probe. + (__libc_realloc): Add memory_realloc_retry probe. + (__libc_memalign): Add memory_memalign_retry probe. + (__libc_valloc): Add memory_valloc_retry probe. + (__libc_pvalloc): Add memory_pvalloc_retry probe. + (__libc_calloc): Add memory_calloc_retry probe. + * manual/probes.texi: Document them. Add probes for malloc arena changes. - - * malloc/arena.c (get_free_list): Add probe - memory_arena_reuse_free_list. - (reused_arena) [PER_THREAD]: Add probes memory_arena_reuse_wait - and memory_arena_reuse. - (arena_get2) [!PER_THREAD]: Likewise. - * malloc/malloc.c (__libc_realloc) [!PER_THREAD]: Add probe - memory_arena_reuse_realloc. - * manual/probes.texi: Document them. + + * malloc/arena.c (get_free_list): Add probe + memory_arena_reuse_free_list. + (reused_arena) [PER_THREAD]: Add probes memory_arena_reuse_wait + and memory_arena_reuse. + (arena_get2) [!PER_THREAD]: Likewise. + * malloc/malloc.c (__libc_realloc) [!PER_THREAD]: Add probe + memory_arena_reuse_realloc. + * manual/probes.texi: Document them. Add probes for all changes to malloc options. - - * malloc/malloc.c (__libc_free): Add - memory_mallopt_free_dyn_thresholds probe. - (__libc_mallopt): Add multiple memory_mallopt probes. - * manual/probes.texi: Document them. + + * malloc/malloc.c (__libc_free): Add + memory_mallopt_free_dyn_thresholds probe. + (__libc_mallopt): Add multiple memory_mallopt probes. + * manual/probes.texi: Document them. Add first set of memory probes. - - * malloc/malloc.c: Include stap-probe.h. - (__libc_mallopt): Add memory_mallopt probe. - * malloc/arena.c (_int_new_arena): Add memory_arena_new probe. - * manual/probes.texi: New. - * manual/Makefile (chapters): Add probes. - * manual/debug.texi: Set next node. + + * malloc/malloc.c: Include stap-probe.h. + (__libc_mallopt): Add memory_mallopt probe. + * malloc/arena.c (_int_new_arena): Add memory_arena_new probe. + * manual/probes.texi: New. + * manual/Makefile (chapters): Add probes. + * manual/debug.texi: Set next node. Index: glibc-2.17-c758a686/malloc/arena.c =================================================================== @@ -63,23 +63,23 @@ Index: glibc-2.17-c758a686/malloc/arena.c + LIBC_PROBE (memory_heap_new, 2, h, h->size); return h; } - + @@ -611,6 +612,7 @@ grow_heap(heap_info *h, long diff) } - + h->size = new_size; + LIBC_PROBE (memory_heap_more, 2, h, h->size); return 0; } - + @@ -638,6 +640,7 @@ shrink_heap(heap_info *h, long diff) /*fprintf(stderr, "shrink %p %08lx\n", h, new_size);*/ - + h->size = new_size; + LIBC_PROBE (memory_heap_less, 2, h, h->size); return 0; } - + @@ -679,6 +682,7 @@ heap_trim(heap_info *heap, size_t pad) break; ar_ptr->system_mem -= heap->size; @@ -91,26 +91,26 @@ Index: glibc-2.17-c758a686/malloc/arena.c @@ -741,6 +745,7 @@ _int_new_arena(size_t size) top(a) = (mchunkptr)ptr; set_head(top(a), (((char*)h + h->size) - ptr) | PREV_INUSE); - + + LIBC_PROBE (memory_arena_new, 2, a, size); tsd_setspecific(arena_key, (void *)a); mutex_init(&a->mutex); (void)mutex_lock(&a->mutex); @@ -779,6 +784,7 @@ get_free_list (void) - + if (result != NULL) - { + { + LIBC_PROBE (memory_arena_reuse_free_list, 1, result); - (void)mutex_lock(&result->mutex); - tsd_setspecific(arena_key, (void *)result); - THREAD_STAT(++(result->stat_lock_loop)); + (void)mutex_lock(&result->mutex); + tsd_setspecific(arena_key, (void *)result); + THREAD_STAT(++(result->stat_lock_loop)); @@ -815,9 +821,11 @@ reused_arena (mstate avoid_arena) result = result->next; - + /* No arena available. Wait for the next in line. */ + LIBC_PROBE (memory_arena_reuse_wait, 3, &result->mutex, result, avoid_arena); (void)mutex_lock(&result->mutex); - + out: + LIBC_PROBE (memory_arena_reuse, 2, result, avoid_arena); tsd_setspecific(arena_key, (void *)result); @@ -118,7 +118,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c next_to_use = result->next; @@ -896,6 +904,7 @@ arena_get2(mstate a_tsd, size_t size, ms if (retried) - (void)mutex_unlock(&list_lock); + (void)mutex_unlock(&list_lock); THREAD_STAT(++(a->stat_lock_loop)); + LIBC_PROBE (memory_arena_reuse, 2, a, a_tsd); tsd_setspecific(arena_key, (void *)a); @@ -130,7 +130,7 @@ Index: glibc-2.17-c758a686/malloc/arena.c /* We will block to not run in a busy loop. */ + LIBC_PROBE (memory_arena_reuse_wait, 3, &list_lock, NULL, a_tsd); (void)mutex_lock(&list_lock); - + /* Since we blocked there might be an arena available now. */ @@ -931,6 +941,7 @@ arena_get2(mstate a_tsd, size_t size, ms static mstate @@ -146,34 +146,34 @@ Index: glibc-2.17-c758a686/malloc/malloc.c +++ glibc-2.17-c758a686/malloc/malloc.c @@ -1884,6 +1884,8 @@ static int perturb_byte; #define free_perturb(p, n) memset (p, perturb_byte & 0xff, n) - - + + +#include + /* ------------------- Support for multiple arenas -------------------- */ #include "arena.c" - + @@ -2452,8 +2454,10 @@ static void* sysmalloc(INTERNAL_SIZE_T n below even if we cannot call MORECORE. */ - + - if (size > 0) + if (size > 0) { brk = (char*)(MORECORE(size)); + LIBC_PROBE (memory_sbrk_more, 2, brk, size); + } - + if (brk != (char*)(MORECORE_FAILURE)) { /* Call the `morecore' hook if necessary. */ @@ -2753,6 +2757,8 @@ static int systrim(size_t pad, mstate av - (*hook) (); + (*hook) (); new_brk = (char*)(MORECORE(0)); - + + LIBC_PROBE (memory_sbrk_less, 2, new_brk, extra); + if (new_brk != (char*)MORECORE_FAILURE) { - released = (long)(current_brk - new_brk); - + released = (long)(current_brk - new_brk); + @@ -2862,6 +2868,7 @@ __libc_malloc(size_t bytes) return 0; victim = _int_malloc(ar_ptr, bytes); @@ -184,8 +184,8 @@ Index: glibc-2.17-c758a686/malloc/malloc.c victim = _int_malloc(ar_ptr, bytes); @@ -2902,6 +2909,8 @@ __libc_free(void* mem) { - mp_.mmap_threshold = chunksize (p); - mp_.trim_threshold = 2 * mp_.mmap_threshold; + mp_.mmap_threshold = chunksize (p); + mp_.trim_threshold = 2 * mp_.mmap_threshold; + LIBC_PROBE (memory_mallopt_free_dyn_thresholds, 2, + mp_.mmap_threshold, mp_.trim_threshold); } @@ -193,7 +193,7 @@ Index: glibc-2.17-c758a686/malloc/malloc.c return; @@ -2981,6 +2990,7 @@ __libc_realloc(void* oldmem, size_t byte #endif - + #if !defined PER_THREAD + LIBC_PROBE (memory_arena_reuse_realloc, 1, ar_ptr); /* As in malloc(), remember this arena for the next allocation. */ @@ -206,7 +206,7 @@ Index: glibc-2.17-c758a686/malloc/malloc.c + LIBC_PROBE (memory_realloc_retry, 2, bytes, oldmem); newp = __libc_malloc(bytes); if (newp != NULL) - { + { @@ -3029,6 +3040,7 @@ __libc_memalign(size_t alignment, size_t return 0; p = _int_memalign(ar_ptr, alignment, bytes); @@ -232,8 +232,8 @@ Index: glibc-2.17-c758a686/malloc/malloc.c if (__builtin_expect(ar_ptr != NULL, 1)) { p = _int_memalign(ar_ptr, pagesz, rounded_bytes); @@ -3177,6 +3191,7 @@ __libc_calloc(size_t n, size_t elem_size - av == arena_for_chunk(mem2chunk(mem))); - + av == arena_for_chunk(mem2chunk(mem))); + if (mem == 0) { + LIBC_PROBE (memory_calloc_retry, 1, sz); av = arena_get_retry (av, sz); @@ -242,7 +242,7 @@ Index: glibc-2.17-c758a686/malloc/malloc.c @@ -4695,21 +4710,29 @@ int __libc_mallopt(int param_number, int /* Ensure initialization/consolidation */ malloc_consolidate(av); - + + LIBC_PROBE (memory_mallopt, 2, param_number, value); + switch(param_number) { @@ -258,14 +258,14 @@ Index: glibc-2.17-c758a686/malloc/malloc.c else res = 0; break; - + case M_TRIM_THRESHOLD: + LIBC_PROBE (memory_mallopt_trim_threshold, 3, value, + mp_.trim_threshold, mp_.no_dyn_threshold); mp_.trim_threshold = value; mp_.no_dyn_threshold = 1; break; - + case M_TOP_PAD: + LIBC_PROBE (memory_mallopt_top_pad, 3, value, + mp_.top_pad, mp_.no_dyn_threshold); @@ -278,28 +278,28 @@ Index: glibc-2.17-c758a686/malloc/malloc.c { + LIBC_PROBE (memory_mallopt_mmap_threshold, 3, value, + mp_.mmap_threshold, mp_.no_dyn_threshold); - mp_.mmap_threshold = value; - mp_.no_dyn_threshold = 1; + mp_.mmap_threshold = value; + mp_.no_dyn_threshold = 1; } break; - + case M_MMAP_MAX: + LIBC_PROBE (memory_mallopt_mmap_max, 3, value, + mp_.n_mmaps_max, mp_.no_dyn_threshold); mp_.n_mmaps_max = value; mp_.no_dyn_threshold = 1; break; - + case M_CHECK_ACTION: + LIBC_PROBE (memory_mallopt_check_action, 2, value, check_action); check_action = value; break; - + case M_PERTURB: + LIBC_PROBE (memory_mallopt_perturb, 2, value, perturb_byte); perturb_byte = value; break; - + #ifdef PER_THREAD case M_ARENA_TEST: if (value > 0) @@ -309,7 +309,7 @@ Index: glibc-2.17-c758a686/malloc/malloc.c + mp_.arena_test = value; + } break; - + case M_ARENA_MAX: if (value > 0) - mp_.arena_max = value; @@ -325,14 +325,14 @@ Index: glibc-2.17-c758a686/manual/Makefile --- glibc-2.17-c758a686/manual/Makefile.orig +++ glibc-2.17-c758a686/manual/Makefile @@ -43,7 +43,7 @@ chapters = $(addsuffix .texi, \ - message search pattern io stdio llio filesys \ - pipe socket terminal syslog math arith time \ - resource setjmp signal startup process job nss \ + message search pattern io stdio llio filesys \ + pipe socket terminal syslog math arith time \ + resource setjmp signal startup process job nss \ - users sysinfo conf crypt debug) + users sysinfo conf crypt debug probes) add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi)) appendices = lang.texi header.texi install.texi maint.texi platform.texi \ - contrib.texi + contrib.texi Index: glibc-2.17-c758a686/manual/probes.texi =================================================================== --- /dev/null @@ -605,3 +605,4 @@ Index: glibc-2.17-c758a686/manual/debug.texi +@c @node Debugging Support, Internal Probes, Cryptographic Functions, Top @c %MENU% Functions to help debugging applications @chapter Debugging support + diff --git a/SOURCES/glibc-rh757881.patch b/SOURCES/glibc-rh757881.patch index 26e347b2..daed9994 100644 --- a/SOURCES/glibc-rh757881.patch +++ b/SOURCES/glibc-rh757881.patch @@ -14,13 +14,13 @@ diff -Nru glibc-2.17-c758a686/malloc/hooks.c glibc-2.17-c758a686/malloc/hooks.c --- glibc-2.17-c758a686/malloc/hooks.c 2012-05-29 16:45:53.000000000 -0600 +++ glibc-2.17-c758a686/malloc/hooks.c 2012-05-30 00:13:40.684514011 -0600 @@ -191,7 +191,9 @@ top_check(void) - (char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem))) + (char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem))) return 0; - + + mutex_unlock(&main_arena); malloc_printerr (check_action, "malloc: top chunk is corrupt", t); + mutex_lock(&main_arena); - + /* Try to set up a new top chunk. */ brk = MORECORE(0); diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc.c @@ -28,7 +28,7 @@ diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc. +++ glibc-2.17-c758a686/malloc/malloc.c 2012-05-30 00:13:40.686514001 -0600 @@ -1424,12 +1424,14 @@ typedef struct malloc_chunk* mbinptr; #define last(b) ((b)->bk) - + /* Take a chunk off a bin list */ -#define unlink(P, BK, FD) { \ +#define unlink(AV, P, BK, FD) { \ @@ -45,29 +45,29 @@ diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc. BK->fd = FD; \ if (!in_smallbin_range (P->size) \ @@ -2511,7 +2513,9 @@ static void* sysmalloc(INTERNAL_SIZE_T n - + else if (contiguous(av) && old_size && brk < old_end) { /* Oops! Someone else killed our space.. Can't touch anything. */ + mutex_unlock(&av->mutex); malloc_printerr (3, "break adjusted to free malloc space", brk); + mutex_lock(&av->mutex); } - + /* @@ -3345,7 +3349,9 @@ _int_malloc(mstate av, size_t bytes) - { - errstr = "malloc(): memory corruption (fast)"; - errout: + { + errstr = "malloc(): memory corruption (fast)"; + errout: + mutex_unlock(&av->mutex); - malloc_printerr (check_action, errstr, chunk2mem (victim)); + malloc_printerr (check_action, errstr, chunk2mem (victim)); + mutex_lock(&av->mutex); - return NULL; - } + return NULL; + } check_remalloced_chunk(av, victim, nb); @@ -3430,8 +3436,12 @@ _int_malloc(mstate av, size_t bytes) bck = victim->bk; if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0) - || __builtin_expect (victim->size > av->system_mem, 0)) + || __builtin_expect (victim->size > av->system_mem, 0)) - malloc_printerr (check_action, "malloc(): memory corruption", - chunk2mem (victim)); + { @@ -77,33 +77,33 @@ diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc. + mutex_lock(&av->mutex); + } size = chunksize(victim); - + /* @@ -3572,7 +3582,7 @@ _int_malloc(mstate av, size_t bytes) - victim = victim->fd; - - remainder_size = size - nb; + victim = victim->fd; + + remainder_size = size - nb; - unlink(victim, bck, fwd); + unlink(av, victim, bck, fwd); - - /* Exhaust */ - if (remainder_size < MINSIZE) { + + /* Exhaust */ + if (remainder_size < MINSIZE) { @@ -3670,7 +3680,7 @@ _int_malloc(mstate av, size_t bytes) - remainder_size = size - nb; - - /* unlink */ + remainder_size = size - nb; + + /* unlink */ - unlink(victim, bck, fwd); + unlink(av, victim, bck, fwd); - - /* Exhaust */ - if (remainder_size < MINSIZE) { + + /* Exhaust */ + if (remainder_size < MINSIZE) { @@ -3805,9 +3815,11 @@ _int_free(mstate av, mchunkptr p, int ha { errstr = "free(): invalid pointer"; errout: - if (! have_lock && locked) + if (have_lock || locked) - (void)mutex_unlock(&av->mutex); + (void)mutex_unlock(&av->mutex); malloc_printerr (check_action, errstr, chunk2mem(p)); + if (have_lock) + mutex_lock(&av->mutex); @@ -117,35 +117,35 @@ diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc. - unlink(p, bck, fwd); + unlink(av, p, bck, fwd); } - + if (nextchunk != av->top) { @@ -3961,7 +3973,7 @@ _int_free(mstate av, mchunkptr p, int ha - + /* consolidate forward */ if (!nextinuse) { - unlink(nextchunk, bck, fwd); + unlink(av, nextchunk, bck, fwd); - size += nextsize; + size += nextsize; } else - clear_inuse_bit_at_offset(nextchunk, 0); + clear_inuse_bit_at_offset(nextchunk, 0); @@ -4122,7 +4134,7 @@ static void malloc_consolidate(mstate av - prevsize = p->prev_size; - size += prevsize; - p = chunk_at_offset(p, -((long) prevsize)); + prevsize = p->prev_size; + size += prevsize; + p = chunk_at_offset(p, -((long) prevsize)); - unlink(p, bck, fwd); + unlink(av, p, bck, fwd); - } - - if (nextchunk != av->top) { + } + + if (nextchunk != av->top) { @@ -4130,7 +4142,7 @@ static void malloc_consolidate(mstate av - - if (!nextinuse) { - size += nextsize; + + if (!nextinuse) { + size += nextsize; - unlink(nextchunk, bck, fwd); + unlink(av, nextchunk, bck, fwd); - } else - clear_inuse_bit_at_offset(nextchunk, 0); - + } else + clear_inuse_bit_at_offset(nextchunk, 0); + @@ -4199,7 +4211,9 @@ _int_realloc(mstate av, mchunkptr oldp, { errstr = "realloc(): invalid old size"; @@ -155,13 +155,13 @@ diff -Nru glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc. + mutex_lock(&av->mutex); return NULL; } - + @@ -4241,7 +4255,7 @@ _int_realloc(mstate av, mchunkptr oldp, - (unsigned long)(newsize = oldsize + nextsize) >= - (unsigned long)(nb)) { + (unsigned long)(newsize = oldsize + nextsize) >= + (unsigned long)(nb)) { newp = oldp; - unlink(next, bck, fwd); + unlink(av, next, bck, fwd); } - + /* allocate, copy, free */ diff --git a/SOURCES/glibc-rh804768-bugfix.patch b/SOURCES/glibc-rh804768-bugfix.patch index 0cb77310..3bd8e2c1 100644 --- a/SOURCES/glibc-rh804768-bugfix.patch +++ b/SOURCES/glibc-rh804768-bugfix.patch @@ -36,7 +36,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/bits/setjmp.h glibc-2.17-c758a686/sys +++ glibc-2.17-c758a686/sysdeps/s390/bits/setjmp.h 2013-08-23 12:33:20.597299428 -0400 @@ -34,7 +34,7 @@ typedef struct __s390_jmp_buf long int __gregs[10]; - + # if __WORDSIZE == 64 - /* We save fpu registers 1, 3, 5 and 7. */ + /* We save fpu registers f8 - f15. */ @@ -47,30 +47,30 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-trampoline.S glibc-2.17-c7 --- glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-trampoline.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-trampoline.S 2013-08-23 12:33:20.593298453 -0400 @@ -95,16 +95,16 @@ _dl_runtime_profile: - lr %r1,%r2 # function addr returned in r2 - icm %r0,15,20(%r12) # load & test framesize - jnm 2f + lr %r1,%r2 # function addr returned in r2 + icm %r0,15,20(%r12) # load & test framesize + jnm 2f + - lm %r2,%r6,32(%r12) - ld %f0,56(%r12) - ld %f2,64(%r12) + lm %r2,%r6,32(%r12) + ld %f0,56(%r12) + ld %f2,64(%r12) - basr %r14,%r1 # call resolved function -1: lr %r15,%r12 # remove stack frame + lr %r15,%r12 # remove stack frame - cfi_def_cfa_register (15) - l %r14,16(%r15) # restore registers - l %r12,12(%r15) + cfi_def_cfa_register (15) + l %r14,16(%r15) # restore registers + l %r12,12(%r15) - l %r6,8(%r15) - br %r14 + br %r1 # tail-call to the resolved function + - cfi_def_cfa_register (12) + cfi_def_cfa_register (12) 2: jz 4f # framesize == 0 ? - ahi %r0,7 # align framesize to 8 + ahi %r0,7 # align framesize to 8 @@ -131,7 +131,13 @@ _dl_runtime_profile: - la %r4,32(%r12) # pointer to struct La_s390_32_regs - la %r5,72(%r12) # pointer to struct La_s390_32_retval - basr %r14,%r1 # call _dl_call_pltexit + la %r4,32(%r12) # pointer to struct La_s390_32_regs + la %r5,72(%r12) # pointer to struct La_s390_32_retval + basr %r14,%r1 # call _dl_call_pltexit - j 1b + + lr %r15,%r12 # remove stack frame @@ -81,7 +81,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-32/dl-trampoline.S glibc-2.17-c7 + 6: .long _dl_profile_fixup - 0b 7: .long _dl_call_pltexit - 5b - cfi_endproc + cfi_endproc diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S --- glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S 2013-08-23 12:46:11.478239405 -0400 @@ -90,7 +90,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 +/* PLT trampolines. s390x version. Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. - + @@ -20,8 +20,8 @@ * with the following linkage: * r2 - r6 : parameter registers @@ -103,19 +103,19 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 * r0 - r5 : call clobbered * r6 - r13 : call saved @@ -39,21 +39,21 @@ - cfi_startproc - .align 16 + cfi_startproc + .align 16 _dl_runtime_resolve: - stmg 2,5,64(15) # save registers - stg 14,96(15) + stmg %r2,%r5,64(15) # save call-clobbered argument registers + stg %r14,96(15) - cfi_offset (r14, -64) + cfi_offset (r14, -64) - lgr 0,15 # create stack frame - aghi 15,-160 + lgr %r0,%r15 + aghi %r15,-160 # create stack frame - cfi_adjust_cfa_offset (160) + cfi_adjust_cfa_offset (160) - stg 0,0(15) - lmg 2,3,208(15) # load args saved by PLT - brasl 14,_dl_fixup # call fixup @@ -126,19 +126,19 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 + brasl %r14,_dl_fixup # call fixup + lgr %r1,%r2 # function addr returned in r2 + aghi %r15,160 # remove stack frame - cfi_adjust_cfa_offset (-160) + cfi_adjust_cfa_offset (-160) - lg 14,96(15) # restore registers - lmg 2,5,64(15) - br 1 + lg %r14,96(15) # restore registers + lmg %r2,%r5,64(15) + br %r1 - cfi_endproc - .size _dl_runtime_resolve, .-_dl_runtime_resolve - + cfi_endproc + .size _dl_runtime_resolve, .-_dl_runtime_resolve + @@ -64,13 +64,12 @@ _dl_runtime_resolve: - cfi_startproc - .align 16 + cfi_startproc + .align 16 _dl_runtime_profile: - stmg %r2,%r6,64(%r15) # save registers - std %f0,104(%r15) @@ -146,32 +146,32 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 + stmg %r2,%r6,64(%r15) # save call-clobbered arg regs + std %f0,104(%r15) # + r6 needed as arg for + std %f2,112(%r15) # _dl_profile_fixup - std %f4,120(%r15) - std %f6,128(%r15) + std %f4,120(%r15) + std %f6,128(%r15) - stg %r6,16(%r15) - stg %r12,24(%r15) + stg %r12,24(%r15) # r12 is used as backup of r15 - stg %r14,32(%r15) - cfi_offset (r6, -96) - cfi_offset (f0, -56) + stg %r14,32(%r15) + cfi_offset (r6, -96) + cfi_offset (f0, -56) @@ -79,10 +78,10 @@ _dl_runtime_profile: - cfi_offset (f6, -32) - cfi_offset (r12, -136) - cfi_offset (r14, -128) + cfi_offset (f6, -32) + cfi_offset (r12, -136) + cfi_offset (r14, -128) - lgr %r12,%r15 # create stack frame + lgr %r12,%r15 # backup stack pointer - cfi_def_cfa_register (12) + cfi_def_cfa_register (12) - aghi %r15,-160 - stg %r12,0(%r15) + aghi %r15,-160 # create stack frame + stg %r12,0(%r15) # save backchain - lmg %r2,%r3,48(%r12) # load arguments saved by PLT - lgr %r4,%r14 # return address as third parameter - la %r5,64(%r12) # pointer to struct La_s390_32_regs + lmg %r2,%r3,48(%r12) # load arguments saved by PLT + lgr %r4,%r14 # return address as third parameter + la %r5,64(%r12) # pointer to struct La_s390_32_regs @@ -92,18 +91,19 @@ _dl_runtime_profile: - lg %r0,40(%r12) # load framesize - ltgr %r0,%r0 - jnm 1f + lg %r0,40(%r12) # load framesize + ltgr %r0,%r0 + jnm 1f - lmg %r2,%r6,64(%r12) - ld %f0,104(%r12) - ld %f2,112(%r12) @@ -179,35 +179,35 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 + lmg %r2,%r6,64(%r12) # framesize < 0 means no pltexit call + ld %f0,104(%r12) # so we can do a tail call without + ld %f2,112(%r12) # copying the arg overflow area - ld %f4,120(%r12) - ld %f6,128(%r12) + ld %f4,120(%r12) + ld %f6,128(%r12) - basr %r14,%r1 # call resolved function -0: lgr %r15,%r12 # remove stack frame + + lgr %r15,%r12 # remove stack frame - cfi_def_cfa_register (15) - lg %r14,32(%r15) # restore registers - lg %r12,24(%r15) + cfi_def_cfa_register (15) + lg %r14,32(%r15) # restore registers + lg %r12,24(%r15) - lg %r6,16(%r15) - br %r14 + br %r1 # tail-call to resolved function + - cfi_def_cfa_register (12) + cfi_def_cfa_register (12) 1: jz 4f # framesize == 0 ? - aghi %r0,7 # align framesize to 8 + aghi %r0,7 # align framesize to 8 @@ -118,7 +118,7 @@ _dl_runtime_profile: - la %r3,8(%r3) - brctg %r0,3b + la %r3,8(%r3) + brctg %r0,3b 4: lmg %r2,%r6,64(%r12) # load register parameters - ld %f0,104(%r12) + ld %f0,104(%r12) # restore call-clobbered arg regs - ld %f2,112(%r12) - ld %f4,120(%r12) - ld %f6,128(%r12) + ld %f2,112(%r12) + ld %f4,120(%r12) + ld %f6,128(%r12) @@ -129,7 +129,13 @@ _dl_runtime_profile: - la %r4,32(%r12) # pointer to struct La_s390_32_regs - la %r5,72(%r12) # pointer to struct La_s390_32_retval - brasl %r14,_dl_call_pltexit + la %r4,32(%r12) # pointer to struct La_s390_32_regs + la %r5,72(%r12) # pointer to struct La_s390_32_retval + brasl %r14,_dl_call_pltexit - j 0b + + lgr %r15,%r12 # remove stack frame @@ -216,8 +216,8 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/dl-trampoline.S glibc-2.17-c7 + lg %r12,24(%r15) + br %r14 + - cfi_endproc - .size _dl_runtime_profile, .-_dl_runtime_profile + cfi_endproc + .size _dl_runtime_profile, .-_dl_runtime_profile #endif diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/__longjmp.c glibc-2.17-c758a686/sysdeps/s390/s390-64/__longjmp.c --- glibc-2.17-c758a686/sysdeps/s390/s390-64/__longjmp.c 2012-12-24 22:02:13.000000000 -0500 @@ -239,8 +239,8 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/__longjmp.c glibc-2.17-c758a6 + "ld %%f14,128(%1)\n\t" + "ld %%f15,136(%1)\n\t" #ifdef PTR_DEMANGLE - "lmg %%r6,%%r13,0(%1)\n\t" - "lmg %%r4,%%r5,64(%1)\n\t" + "lmg %%r6,%%r13,0(%1)\n\t" + "lmg %%r4,%%r5,64(%1)\n\t" diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S --- glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S 2013-08-23 12:33:20.598300448 -0400 @@ -261,13 +261,13 @@ diff -Nru glibc-2.17-c758a686/sysdeps/s390/s390-64/setjmp.S glibc-2.17-c758a686/ + std %f14,128(%r2) + std %f15,136(%r2) #if defined NOT_IN_libc && defined IS_IN_rtld - /* In ld.so we never save the signal mask. */ - lghi %r2,0 + /* In ld.so we never save the signal mask. */ + lghi %r2,0 diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h 2013-08-23 12:33:20.601180842 -0400 @@ -23,8 +23,8 @@ - + struct statfs { - int f_type; @@ -290,7 +290,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h glibc-2 + unsigned int f_flags; + unsigned int f_spare[4]; }; - + #ifdef __USE_LARGEFILE64 struct statfs64 { @@ -314,26 +314,26 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/bits/statfs.h glibc-2 + unsigned int f_spare[4]; }; #endif - + diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S 2013-08-23 12:33:20.588297827 -0400 @@ -31,41 +31,42 @@ other than the PRESERVED state. */ - + ENTRY(__getcontext) - lr %r5,%r2 + lr %r1,%r2 - - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slr %r3,%r3 + + /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ + la %r2,SIG_BLOCK + slr %r3,%r3 - la %r4,SC_MASK(%r5) + la %r4,SC_MASK(%r1) + lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Store fpu context. */ - stfpc SC_FPC(%r5) - std %f0,SC_FPRS(%r5) - std %f1,SC_FPRS+8(%r5) @@ -368,39 +368,39 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S + std %f13,SC_FPRS+104(%r1) + std %f14,SC_FPRS+112(%r1) + std %f15,SC_FPRS+120(%r1) - - /* Set __getcontext return value to 0. */ - slr %r2,%r2 - - /* Store access registers. */ + + /* Set __getcontext return value to 0. */ + slr %r2,%r2 + + /* Store access registers. */ - stam %a0,%a15,SC_ACRS(%r5) + stam %a0,%a15,SC_ACRS(%r1) - - /* Store general purpose registers. */ + + /* Store general purpose registers. */ - stm %r0,%r15,SC_GPRS(%r5) + stm %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 + + /* Return. */ + br %r14 diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S 2013-08-23 12:33:20.588297827 -0400 @@ -31,38 +31,39 @@ other than the PRESERVED state. */ - + ENTRY(__setcontext) - lr %r5,%r2 + lr %r1,%r2 - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + la %r2,SIG_BLOCK - la %r3,SC_MASK(%r5) + la %r3,SC_MASK(%r1) - slr %r4,%r4 + slr %r4,%r4 + lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Load fpu context. */ - lfpc SC_FPC(%r5) - ld %f0,SC_FPRS(%r5) - ld %f1,SC_FPRS+8(%r5) @@ -435,69 +435,69 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S + ld %f13,SC_FPRS+104(%r1) + ld %f14,SC_FPRS+112(%r1) + ld %f15,SC_FPRS+120(%r1) - - /* Don't touch %a0, used for thread purposes. */ + + /* Don't touch %a0, used for thread purposes. */ - lam %a1,%a15,SC_ACRS+4(%r5) + lam %a1,%a15,SC_ACRS+4(%r1) - - /* Load general purpose registers. */ + + /* Load general purpose registers. */ - lm %r0,%r15,SC_GPRS(%r5) + lm %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 + + /* Return. */ + br %r14 diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S 2013-08-23 12:33:20.589298155 -0400 @@ -34,12 +34,13 @@ - + ENTRY(__swapcontext) - lr %r1,%r2 + lr %r1,%r2 - lr %r5,%r3 + lr %r0,%r3 - - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slr %r3,%r3 - la %r4,SC_MASK(%r1) + + /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ + la %r2,SIG_BLOCK + slr %r3,%r3 + la %r4,SC_MASK(%r1) + lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Store fpu context. */ @@ -72,11 +73,14 @@ ENTRY(__swapcontext) - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + la %r2,SIG_BLOCK + lr %r5,%r0 - la %r3,SC_MASK(%r5) - slr %r4,%r4 + la %r3,SC_MASK(%r5) + slr %r4,%r4 + lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Load fpu context. */ + lr %r5,%r0 - lfpc SC_FPC(%r5) - ld %f0,SC_FPRS(%r5) - ld %f1,SC_FPRS+8(%r5) + lfpc SC_FPC(%r5) + ld %f0,SC_FPRS(%r5) + ld %f1,SC_FPRS+8(%r5) diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S 2013-08-23 12:33:20.590298812 -0400 @@ -31,41 +31,42 @@ other than the PRESERVED state. */ - + ENTRY(__getcontext) - lgr %r5,%r2 + lgr %r1,%r2 - - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slgr %r3,%r3 + + /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ + la %r2,SIG_BLOCK + slgr %r3,%r3 - la %r4,SC_MASK(%r5) + la %r4,SC_MASK(%r1) + lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Store fpu context. */ - stfpc SC_FPC(%r5) - std %f0,SC_FPRS(%r5) - std %f1,SC_FPRS+8(%r5) @@ -532,39 +532,39 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S + std %f13,SC_FPRS+104(%r1) + std %f14,SC_FPRS+112(%r1) + std %f15,SC_FPRS+120(%r1) - - /* Set __getcontext return value to 0. */ - slgr %r2,%r2 - - /* Store access registers. */ + + /* Set __getcontext return value to 0. */ + slgr %r2,%r2 + + /* Store access registers. */ - stam %a0,%a15,SC_ACRS(%r5) + stam %a0,%a15,SC_ACRS(%r1) - - /* Store general purpose registers. */ + + /* Store general purpose registers. */ - stmg %r0,%r15,SC_GPRS(%r5) + stmg %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 + + /* Return. */ + br %r14 diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S 2013-08-23 12:33:20.591298098 -0400 @@ -31,38 +31,39 @@ other than the PRESERVED state. */ - + ENTRY(__setcontext) - lgr %r5,%r2 + lgr %r1,%r2 - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + la %r2,SIG_BLOCK - la %r3,SC_MASK(%r5) + la %r3,SC_MASK(%r1) - slgr %r4,%r4 + slgr %r4,%r4 + lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Load fpu context. */ - lfpc SC_FPC(%r5) - ld %f0,SC_FPRS(%r5) - ld %f1,SC_FPRS+8(%r5) @@ -599,58 +599,59 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S + ld %f13,SC_FPRS+104(%r1) + ld %f14,SC_FPRS+112(%r1) + ld %f15,SC_FPRS+120(%r1) - - /* Don't touch %a0 and %a1, used for thread purposes. */ + + /* Don't touch %a0 and %a1, used for thread purposes. */ - lam %a2,%a15,SC_ACRS+8(%r5) + lam %a2,%a15,SC_ACRS+8(%r1) - - /* Load general purpose registers. */ + + /* Load general purpose registers. */ - lmg %r0,%r15,SC_GPRS(%r5) + lmg %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 + + /* Return. */ + br %r14 diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S 2013-08-23 12:33:20.591298098 -0400 @@ -34,12 +34,13 @@ - + ENTRY(__swapcontext) - lgr %r1,%r2 + lgr %r1,%r2 - lgr %r5,%r3 + lgr %r0,%r3 - - /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ - la %r2,SIG_BLOCK - slgr %r3,%r3 - la %r4,SC_MASK(%r1) + + /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */ + la %r2,SIG_BLOCK + slgr %r3,%r3 + la %r4,SC_MASK(%r1) + lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ + svc SYS_ify(rt_sigprocmask) + + /* Store fpu context. */ @@ -72,11 +73,14 @@ ENTRY(__swapcontext) - - /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ - la %r2,SIG_BLOCK + + /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ + la %r2,SIG_BLOCK + lgr %r5,%r0 - la %r3,SC_MASK(%r5) + la %r3,SC_MASK(%r5) + lghi %r5,_NSIG8 - slgr %r4,%r4 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ + slgr %r4,%r4 + svc SYS_ify(rt_sigprocmask) + + /* Load fpu context. */ + lgr %r5,%r0 - lfpc SC_FPC(%r5) - ld %f0,SC_FPRS(%r5) - ld %f1,SC_FPRS+8(%r5) + lfpc SC_FPC(%r5) + ld %f0,SC_FPRS(%r5) + ld %f1,SC_FPRS+8(%r5) diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/ucontext_i.sym glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/ucontext_i.sym --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/ucontext_i.sym 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/s390/ucontext_i.sym 2013-08-23 12:33:20.591298098 -0400 @@ -8,6 +8,8 @@ SIG_BLOCK SIG_UNBLOCK SIG_SETMASK - + +_NSIG8 (_NSIG / 8) + #define ucontext(member) offsetof (ucontext_t, member) #define mcontext(member) ucontext (uc_mcontext.member) + diff --git a/SOURCES/glibc-rh819430.patch b/SOURCES/glibc-rh819430.patch index 0382f094..0c29e8ae 100644 --- a/SOURCES/glibc-rh819430.patch +++ b/SOURCES/glibc-rh819430.patch @@ -10,35 +10,35 @@ diff -Nru glibc-2.17-c758a686/posix/fnmatch.c glibc-2.17-c758a686/posix/fnmatch. size_t n; const char *p; @@ -356,10 +357,8 @@ fnmatch (pattern, string, flags) - alloca_used); - n = mbsrtowcs (wpattern, &p, n + 1, &ps); - if (__builtin_expect (n == (size_t) -1, 0)) + alloca_used); + n = mbsrtowcs (wpattern, &p, n + 1, &ps); + if (__builtin_expect (n == (size_t) -1, 0)) - /* Something wrong. - XXX Do we have to set `errno' to something which mbsrtows hasn't - already done? */ - return -1; + /* Something wrong: Fall back to single byte matching. */ + goto try_singlebyte; - if (p) - { - memset (&ps, '\0', sizeof (ps)); + if (p) + { + memset (&ps, '\0', sizeof (ps)); @@ -371,10 +370,8 @@ fnmatch (pattern, string, flags) - prepare_wpattern: - n = mbsrtowcs (NULL, &pattern, 0, &ps); - if (__builtin_expect (n == (size_t) -1, 0)) + prepare_wpattern: + n = mbsrtowcs (NULL, &pattern, 0, &ps); + if (__builtin_expect (n == (size_t) -1, 0)) - /* Something wrong. - XXX Do we have to set `errno' to something which mbsrtows hasn't - already done? */ - return -1; + /*Something wrong: Fall back to single byte matching. */ + goto try_singlebyte; - if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) - { - __set_errno (ENOMEM); + if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) + { + __set_errno (ENOMEM); @@ -401,14 +398,8 @@ fnmatch (pattern, string, flags) - alloca_used); - n = mbsrtowcs (wstring, &p, n + 1, &ps); - if (__builtin_expect (n == (size_t) -1, 0)) + alloca_used); + n = mbsrtowcs (wstring, &p, n + 1, &ps); + if (__builtin_expect (n == (size_t) -1, 0)) - { - /* Something wrong. - XXX Do we have to set `errno' to something which @@ -49,25 +49,25 @@ diff -Nru glibc-2.17-c758a686/posix/fnmatch.c glibc-2.17-c758a686/posix/fnmatch. - } + /* Something wrong: Fall back to single byte matching. */ + goto free_and_try_singlebyte; - if (p) - { - memset (&ps, '\0', sizeof (ps)); + if (p) + { + memset (&ps, '\0', sizeof (ps)); @@ -420,10 +411,8 @@ fnmatch (pattern, string, flags) - prepare_wstring: - n = mbsrtowcs (NULL, &string, 0, &ps); - if (__builtin_expect (n == (size_t) -1, 0)) + prepare_wstring: + n = mbsrtowcs (NULL, &string, 0, &ps); + if (__builtin_expect (n == (size_t) -1, 0)) - /* Something wrong. - XXX Do we have to set `errno' to something which mbsrtows hasn't - already done? */ - goto free_return; + /* Something wrong: Fall back to singlebyte matching. */ + goto free_and_try_singlebyte; - if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) - { - free (wpattern_malloc); + if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) + { + free (wpattern_malloc); @@ -450,6 +439,10 @@ fnmatch (pattern, string, flags) free (wpattern_malloc); - + return res; + free_and_try_singlebyte: + free(wpattern_malloc); @@ -75,3 +75,4 @@ diff -Nru glibc-2.17-c758a686/posix/fnmatch.c glibc-2.17-c758a686/posix/fnmatch. + pattern = orig_pattern; } # endif /* mbstate_t and mbsrtowcs or _LIBC. */ + diff --git a/SOURCES/glibc-rh825061.patch b/SOURCES/glibc-rh825061.patch index f7aa4cf2..a8f88954 100644 --- a/SOURCES/glibc-rh825061.patch +++ b/SOURCES/glibc-rh825061.patch @@ -2,12 +2,12 @@ diff -rup glibc-2.17-c758a686/manual/Makefile glibc-2.17-c758a686/manual/Makefil --- glibc-2.17-c758a686/manual/Makefile 2012-05-20 19:47:38.000000000 -0600 +++ glibc-2.17-c758a686/manual/Makefile 2012-05-29 22:23:33.920428631 -0600 @@ -129,7 +129,8 @@ $(objpfx)%.c.texi: examples/%.c - mv -f $@.new $@ - + mv -f $@.new $@ + $(objpfx)%.info: %.texinfo - LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $< + LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=`basename $@` $< + mv `basename $@`* $(objpfx) - + $(objpfx)%.dvi: %.texinfo - cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(decided = 1; file->data = NULL; - + fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC); @@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) newdata->alloc = alloc; - + file->data = newdata; + file->decided = 1; } - + void diff --git a/SOURCES/glibc-rh841318.patch b/SOURCES/glibc-rh841318.patch index 48797d86..a15e5b85 100644 --- a/SOURCES/glibc-rh841318.patch +++ b/SOURCES/glibc-rh841318.patch @@ -5,7 +5,7 @@ Author: Jeff Law Date: Mon Dec 15 10:09:32 2014 +0100 CVE-2012-3406: Stack overflow in vfprintf [BZ #16617] - + A larger number of format specifiers coudld cause a stack overflow, potentially allowing to bypass _FORTIFY_SOURCE format string protection. @@ -14,14 +14,14 @@ diff -Nru glibc-2.17-c758a686/stdio-common/Makefile glibc-2.17-c758a686/stdio-co --- glibc-2.17-c758a686/stdio-common/Makefile 2012-09-14 14:31:29.000000000 -0600 +++ glibc-2.17-c758a686/stdio-common/Makefile 2012-09-14 14:41:50.837749196 -0600 @@ -57,7 +57,7 @@ tests := tstscanf test_rdwr test-popen t - bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ - scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \ - bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \ + bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ + scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \ + bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \ - bug25 tst-printf-round + bug25 tst-printf-round bug23-2 bug23-3 - + test-srcs = tst-unbputc tst-printf - + diff -Nru glibc-2.17-c758a686/stdio-common/bug23-2.c glibc-2.17-c758a686/stdio-common/bug23-2.c --- glibc-2.17-c758a686/stdio-common/bug23-2.c 1969-12-31 17:00:00.000000000 -0700 +++ glibc-2.17-c758a686/stdio-common/bug23-2.c 2012-09-14 14:41:27.832840375 -0600 @@ -33904,7 +33904,7 @@ diff -Nru glibc-2.17-c758a686/stdio-common/bug23-3.c glibc-2.17-c758a686/stdio-c +do_test (void) +{ + char *buf = malloc (strlen (expected) + 1); -+ snprintf (buf, strlen (expected) + 1, ++ snprintf (buf, strlen (expected) + 1, + "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" + "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" + "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" @@ -45182,7 +45182,7 @@ diff -Nru glibc-2.17-c758a686/stdio-common/vfprintf.c glibc-2.17-c758a686/stdio- @@ -243,6 +243,12 @@ vfprintf (FILE *s, const CHAR_T *format, /* For the argument descriptions, which may be allocated on the heap. */ void *args_malloced = NULL; - + + /* For positional argument handling. */ + struct printf_spec *specs; + @@ -45197,15 +45197,15 @@ diff -Nru glibc-2.17-c758a686/stdio-common/vfprintf.c glibc-2.17-c758a686/stdio- /* A more or less arbitrary start value. */ size_t nspecs_size = 32 * sizeof (struct printf_spec); - struct printf_spec *specs = alloca (nspecs_size); - + + specs = alloca (nspecs_size); /* The number of arguments the format string requests. This will determine the size of the array needed to store the argument attributes. */ @@ -1727,10 +1733,25 @@ do_positional: - { - /* Extend the array of format specifiers. */ - struct printf_spec *old = specs; + { + /* Extend the array of format specifiers. */ + struct printf_spec *old = specs; - specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size); - + if (__libc_use_alloca (2 * nspecs_size)) @@ -45215,24 +45215,24 @@ diff -Nru glibc-2.17-c758a686/stdio-common/vfprintf.c glibc-2.17-c758a686/stdio- + nspecs_size *= 2; + specs = malloc (nspecs_size); + } -+ - /* Copy the old array's elements to the new space. */ - memmove (specs, old, nspecs * sizeof (*specs)); ++ + /* Copy the old array's elements to the new space. */ + memmove (specs, old, nspecs * sizeof (*specs)); + + /* If we had previously malloc'd space for SPECS, then + release it after the copy is complete. */ + if (specs_malloced) + free (old); -+ ++ + /* Now set SPECS_MALLOCED if needed. */ + if (!__libc_use_alloca (nspecs_size)) + specs_malloced = true; - } - - /* Parse the format specifier. */ + } + + /* Parse the format specifier. */ @@ -2045,6 +2066,8 @@ do_positional: } - + all_done: + if (specs_malloced) + free (specs); diff --git a/SOURCES/glibc-rh841653-0.patch b/SOURCES/glibc-rh841653-0.patch index 9add04f8..e57b33fa 100644 --- a/SOURCES/glibc-rh841653-0.patch +++ b/SOURCES/glibc-rh841653-0.patch @@ -10,10 +10,10 @@ Author: H.J. Lu Date: Thu Aug 13 03:40:40 2015 -0700 Update x86 elision-conf.c for - + This patch updates x86 elision-conf.c to use the newly defined HAS_CPU_FEATURE from . - + * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init): Replace HAS_RTM with HAS_CPU_FEATURE (RTM). @@ -25,7 +25,7 @@ Author: Andi Kleen Date: Thu May 16 19:17:14 2013 -0700 Add a configure option to enable lock elision and disable by default - + Can be enabled with --enable-lock-elision=yes at configure time. commit 1cdbe579482c07e9f4bb3baa4864da2d3e7eb837 @@ -33,34 +33,34 @@ Author: Andi Kleen Date: Sat Nov 10 00:51:26 2012 -0800 Add the low level infrastructure for pthreads lock elision with TSX - + Lock elision using TSX is a technique to optimize lock scaling It allows to run locks in parallel using hardware support for a transactional execution mode in 4th generation Intel Core CPUs. See http://www.intel.com/software/tsx for more Information. - + This patch implements a simple adaptive lock elision algorithm based on RTM. It enables elision for the pthread mutexes and rwlocks. The algorithm keeps track whether a mutex successfully elides or not, and stops eliding for some time when it is not. - + When the CPU supports RTM the elision path is automatically tried, otherwise any elision is disabled. - + The adaptation algorithm and its tuning is currently preliminary. - + The code adds some checks to the lock fast paths. Micro-benchmarks show little to no difference without RTM. - + This patch implements the low level "lll_" code for lock elision. Followon patches hook this into the pthread implementation - + Changes with the RTM mutexes: ----------------------------- Lock elision in pthreads is generally compatible with existing programs. There are some obscure exceptions, which are expected to be uncommon. See the manual for more details. - + - A broken program that unlocks a free lock will crash. There are ways around this with some tradeoffs (more code in hot paths) I'm still undecided on what approach to take here; have to wait for testing reports. @@ -82,9 +82,9 @@ Date: Sat Nov 10 00:51:26 2012 -0800 happens at some point) This only happens for mutexes not explicitely set to PTHREAD_MUTEX_NORMAL or PTHREAD_MUTEX_ADAPTIVE_NP. PTHREAD_MUTEX_NORMAL mutexes do not elide. - + The elision default can be set at configure time. - + This patch implements the basic infrastructure for elision. Index: glibc-2.17-c758a686/nptl/elision-conf.h =================================================================== @@ -97,22 +97,22 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -430,6 +430,12 @@ LLL_STUB_UNWIND_INFO_END - : "memory"); \ + : "memory"); \ result; }) - + +extern int __lll_timedlock_elision (int *futex, short *adapt_count, + const struct timespec *timeout, + int private) attribute_hidden; + +#define lll_timedlock_elision(futex, adapt_count, timeout, private) \ + __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private) - + #define lll_robust_timedlock(futex, timeout, id, private) \ ({ int result, ignore1, ignore2, ignore3; \ @@ -583,6 +589,22 @@ extern int __lll_timedwait_tid (int *tid } \ __result; }) - + +extern int __lll_lock_elision (int *futex, short *adapt_count, int private) + attribute_hidden; + @@ -130,7 +130,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h + __lll_trylock_elision(&(futex), &(adapt_count)) + #endif /* !__ASSEMBLER__ */ - + #endif /* lowlevellock.h */ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/Makefile =================================================================== @@ -614,9 +614,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -427,6 +427,13 @@ LLL_STUB_UNWIND_INFO_END - : "memory", "cx", "cc", "r10", "r11"); \ + : "memory", "cx", "cc", "r10", "r11"); \ result; }) - + +extern int __lll_timedlock_elision (int *futex, short *adapt_count, + const struct timespec *timeout, + int private) attribute_hidden; @@ -630,7 +630,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -597,6 +604,22 @@ extern int __lll_timedwait_tid (int *tid } \ __result; }) - + +extern int __lll_lock_elision (int *futex, short *adapt_count, int private) + attribute_hidden; + @@ -648,7 +648,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h + __lll_trylock_elision (&(futex), &(adapt_count)) + #endif /* !__ASSEMBLER__ */ - + #endif /* lowlevellock.h */ Index: glibc-2.17-c758a686/sysdeps/i386/i686/multiarch/init-arch.c =================================================================== @@ -663,7 +663,7 @@ Index: glibc-2.17-c758a686/INSTALL @@ -140,6 +140,9 @@ will be used, and CFLAGS sets optimizati additional security risks to the system and you should enable it only if you understand and accept those risks. - + +`--enable-lock-elision=yes' + Enable lock elision for pthread mutexes and rwlocks by default. + @@ -677,13 +677,13 @@ Index: glibc-2.17-c758a686/config.h.in @@ -180,6 +180,9 @@ /* Define if __stack_chk_guard canary should be randomized at program startup. */ #undef ENABLE_STACKGUARD_RANDOMIZE - + +/* Define if lock elision should be enabled by default. */ +#undef ENABLE_LOCK_ELISION + /* Package description. */ #undef PKGVERSION - + Index: glibc-2.17-c758a686/configure =================================================================== --- glibc-2.17-c758a686.orig/configure @@ -707,9 +707,9 @@ Index: glibc-2.17-c758a686/configure configure and build add-ons in DIR1,DIR2,... search for add-ons if no parameter given @@ -3716,6 +3720,18 @@ if test "$enable_stackguard_randomize" = - + fi - + +# Check whether --enable-lock-elision was given. +if test "${enable_lock_elision+set}" = set; then : + enableval=$enable_lock_elision; enable_lock_elision=$enableval @@ -732,7 +732,7 @@ Index: glibc-2.17-c758a686/configure.in @@ -155,6 +155,15 @@ if test "$enable_stackguard_randomize" = AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE) fi - + +AC_ARG_ENABLE([lock-elision], + AC_HELP_STRING([--enable-lock-elision[=yes/no]], + [Enable lock elision for pthread mutexes and rwlocks by default]), @@ -744,7 +744,7 @@ Index: glibc-2.17-c758a686/configure.in + dnl Generic infrastructure for drop-in additions to libc. AC_ARG_ENABLE([add-ons], - AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@], + AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@], Index: glibc-2.17-c758a686/manual/install.texi =================================================================== --- glibc-2.17-c758a686.orig/manual/install.texi @@ -752,7 +752,7 @@ Index: glibc-2.17-c758a686/manual/install.texi @@ -174,6 +174,9 @@ setuid and owned by @code{root}. The us additional security risks to the system and you should enable it only if you understand and accept those risks. - + +@item --enable-lock-elision=yes +Enable lock elision for pthread mutexes by default. + diff --git a/SOURCES/glibc-rh841653-1.patch b/SOURCES/glibc-rh841653-1.patch index 9526fbfe..a4388313 100644 --- a/SOURCES/glibc-rh841653-1.patch +++ b/SOURCES/glibc-rh841653-1.patch @@ -3,13 +3,13 @@ Author: Andi Kleen Date: Sat Dec 22 00:58:34 2012 -0800 Add new internal mutex type flags for elision. - + Add Enable/disable flags used internally - + Extend the mutex initializers to have the fields needed for elision. The layout stays the same, and this is not visible to programs. - + These changes are not exposed outside pthread Index: glibc-2.17-c758a686/nptl/pthreadP.h =================================================================== @@ -41,12 +41,12 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h + PTHREAD_MUTEX_TIMED_NP | PTHREAD_MUTEX_NO_ELISION_NP, }; #define PTHREAD_MUTEX_PSHARED_BIT 128 - + #define PTHREAD_MUTEX_TYPE(m) \ ((m)->__data.__kind & 127) +#define PTHREAD_MUTEX_TYPE_ELISION(m) \ + ((m)->__data.__kind & (127|PTHREAD_MUTEX_ELISION_FLAGS_NP)) - + #if LLL_PRIVATE == 0 && LLL_SHARED == 128 # define PTHREAD_MUTEX_PSHARED(m) \ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/pthread.h @@ -54,8 +54,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/pthread.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/pthread/pthread.h +++ glibc-2.17-c758a686/nptl/sysdeps/pthread/pthread.h @@ -83,27 +83,39 @@ enum - - + + /* Mutex initializers. */ +#if __PTHREAD_MUTEX_HAVE_ELISION == 1 /* 64bit layout. */ +#define __PTHREAD_SPINS 0, 0 @@ -100,3 +100,4 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/pthread.h + # endif #endif + diff --git a/SOURCES/glibc-rh841653-10.patch b/SOURCES/glibc-rh841653-10.patch index ca4ea553..d94fc164 100644 --- a/SOURCES/glibc-rh841653-10.patch +++ b/SOURCES/glibc-rh841653-10.patch @@ -11,26 +11,26 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c @@ -26,8 +26,8 @@ #define lll_trylock_elision(a,t) lll_trylock(a) #endif - + -#ifndef DO_ELISION -#define DO_ELISION(m) 0 +#ifndef FORCE_ELISION +#define FORCE_ELISION(m, s) #endif - + /* We don't force elision in trylock, because this can lead to inconsistent @@ -69,7 +69,7 @@ __pthread_mutex_trylock (mutex) break; - + case PTHREAD_MUTEX_TIMED_ELISION_NP: - elision: + elision: __attribute__((unused)) if (lll_trylock_elision (mutex->__data.__lock, - mutex->__data.__elision) != 0) + mutex->__data.__elision) != 0) break; @@ -77,8 +77,7 @@ __pthread_mutex_trylock (mutex) return 0; - + case PTHREAD_MUTEX_TIMED_NP: - if (DO_ELISION (mutex)) - goto elision; @@ -45,7 +45,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h @@ -16,11 +16,6 @@ License along with the GNU C Library; if not, see . */ - + -/* Check for elision on this lock without upgrading. */ -#define DO_ELISION(m) \ - (__pthread_force_elision \ diff --git a/SOURCES/glibc-rh841653-11.patch b/SOURCES/glibc-rh841653-11.patch index 387dba06..062ac763 100644 --- a/SOURCES/glibc-rh841653-11.patch +++ b/SOURCES/glibc-rh841653-11.patch @@ -10,7 +10,7 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex5.c @@ -86,8 +86,6 @@ do_test (void) return 1; } - + - /* Elided locks do not time out. */ -#ifndef ENABLE_LOCK_ELISION if (pthread_mutex_trylock (&m) == 0) @@ -21,6 +21,6 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex5.c return 1; } -#endif - + if (pthread_mutex_unlock (&m) != 0) { diff --git a/SOURCES/glibc-rh841653-12.patch b/SOURCES/glibc-rh841653-12.patch index b7ba6607..e0170670 100644 --- a/SOURCES/glibc-rh841653-12.patch +++ b/SOURCES/glibc-rh841653-12.patch @@ -3,7 +3,7 @@ Author: Andreas Schwab Date: Mon Aug 11 11:18:26 2014 +0200 Filter out PTHREAD_MUTEX_NO_ELISION_NP bit in pthread_mutexattr_gettype (BZ #15790) - + pthread_mutexattr_settype adds PTHREAD_MUTEX_NO_ELISION_NP to kind, which is an internal flag that pthread_mutexattr_gettype shouldn't expose, since pthread_mutexattr_settype wouldn't accept it. @@ -12,25 +12,25 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -252,6 +252,7 @@ tests = tst-typesizes \ - tst-exit1 tst-exit2 tst-exit3 \ - tst-stdio1 tst-stdio2 \ - tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \ + tst-exit1 tst-exit2 tst-exit3 \ + tst-stdio1 tst-stdio2 \ + tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \ + tst-pthread-mutexattr \ - tst-unload \ - tst-dlsym1 \ - tst-sysconf \ + tst-unload \ + tst-dlsym1 \ + tst-sysconf \ Index: glibc-2.17-c758a686/nptl/pthread_mutexattr_gettype.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/pthread_mutexattr_gettype.c +++ glibc-2.17-c758a686/nptl/pthread_mutexattr_gettype.c @@ -28,7 +28,8 @@ pthread_mutexattr_gettype (attr, kind) - + iattr = (const struct pthread_mutexattr *) attr; - + - *kind = iattr->mutexkind & ~PTHREAD_MUTEXATTR_FLAG_BITS; + *kind = (iattr->mutexkind & ~PTHREAD_MUTEXATTR_FLAG_BITS + & ~PTHREAD_MUTEX_NO_ELISION_NP); - + return 0; } Index: glibc-2.17-c758a686/nptl/tst-pthread-mutexattr.c diff --git a/SOURCES/glibc-rh841653-13.patch b/SOURCES/glibc-rh841653-13.patch index 8bac62b5..9f4eac21 100644 --- a/SOURCES/glibc-rh841653-13.patch +++ b/SOURCES/glibc-rh841653-13.patch @@ -3,7 +3,7 @@ Author: Andreas Schwab Date: Wed Jan 13 16:04:42 2016 +0100 Don't do lock elision on an error checking mutex (bug 17514) - + Error checking mutexes are not supposed to be subject to lock elision. That would defeat the error checking nature of the mutex because lock elision doesn't record ownership. @@ -12,27 +12,27 @@ Index: glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile @@ -266,7 +266,8 @@ tests = tst-typesizes \ - tst-abstime \ - tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ - tst-getpid1 tst-getpid2 tst-getpid3 \ + tst-abstime \ + tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ + tst-getpid1 tst-getpid2 tst-getpid3 \ - tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) + tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99) \ + tst-mutex-errorcheck xtests = tst-setuid1 tst-setuid1-static tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit - + Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/pthread_mutex_timedlock.c +++ glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c @@ -87,7 +87,8 @@ pthread_mutex_timedlock (mutex, abstime) if (__builtin_expect (mutex->__data.__owner == id, 0)) - return EDEADLK; - + return EDEADLK; + - /* FALLTHROUGH */ + /* Don't do lock elision on an error checking mutex. */ + goto simple; - + case PTHREAD_MUTEX_TIMED_NP: FORCE_ELISION (mutex, goto elision); Index: glibc-2.17-c758a686/nptl/tst-mutex-errorcheck.c diff --git a/SOURCES/glibc-rh841653-14.patch b/SOURCES/glibc-rh841653-14.patch index 78a8a269..0c1b4a5c 100644 --- a/SOURCES/glibc-rh841653-14.patch +++ b/SOURCES/glibc-rh841653-14.patch @@ -7,12 +7,12 @@ Author: Torvald Riegel Date: Wed Nov 30 17:53:11 2016 +0100 Use C11-like atomics instead of plain memory accesses in x86 lock elision. - + This uses atomic operations to access lock elision metadata that is accessed concurrently (ie, adapt_count fields). The size of the data is less than a word but accessed only with atomic loads and stores; therefore, we add support for shorter-size atomic load and stores too. - + * include/atomic.h (__atomic_check_size_ls): New. (atomic_load_relaxed, atomic_load_acquire, atomic_store_relaxed, atomic_store_release): Use it. @@ -45,12 +45,12 @@ Index: glibc-2.17-c758a686/include/atomic.h + if ((sizeof (*mem) != 1) && (sizeof (*mem) != 2) && sizeof (*mem) != 4) \ + __atomic_link_error (); +# endif - + # define atomic_thread_fence_acquire() \ __atomic_thread_fence (__ATOMIC_ACQUIRE) @@ -576,18 +590,20 @@ void __atomic_link_error (void); __atomic_thread_fence (__ATOMIC_SEQ_CST) - + # define atomic_load_relaxed(mem) \ - ({ __atomic_check_size((mem)); __atomic_load_n ((mem), __ATOMIC_RELAXED); }) + ({ __atomic_check_size_ls((mem)); \ @@ -59,7 +59,7 @@ Index: glibc-2.17-c758a686/include/atomic.h - ({ __atomic_check_size((mem)); __atomic_load_n ((mem), __ATOMIC_ACQUIRE); }) + ({ __atomic_check_size_ls((mem)); \ + __atomic_load_n ((mem), __ATOMIC_ACQUIRE); }) - + # define atomic_store_relaxed(mem, val) \ do { \ - __atomic_check_size((mem)); \ @@ -72,7 +72,7 @@ Index: glibc-2.17-c758a686/include/atomic.h + __atomic_check_size_ls((mem)); \ __atomic_store_n ((mem), (val), __ATOMIC_RELEASE); \ } while (0) - + Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c @@ -93,9 +93,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c unsigned status; int try_xbegin; @@ -70,15 +76,20 @@ __lll_lock_elision (int *futex, short *a - && _XABORT_CODE (status) == _ABORT_LOCK_BUSY) - { - /* Right now we skip here. Better would be to wait a bit + && _XABORT_CODE (status) == _ABORT_LOCK_BUSY) + { + /* Right now we skip here. Better would be to wait a bit - and retry. This likely needs some spinning. */ - if (*adapt_count != aconf.skip_lock_busy) - *adapt_count = aconf.skip_lock_busy; @@ -104,9 +104,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c + if (atomic_load_relaxed (adapt_count) + != aconf.skip_lock_busy) + atomic_store_relaxed (adapt_count, aconf.skip_lock_busy); - } - /* Internal abort. There is no chance for retry. - Use the normal locking and next time use lock. + } + /* Internal abort. There is no chance for retry. + Use the normal locking and next time use lock. - Be careful to avoid writing to the lock. */ - else if (*adapt_count != aconf.skip_lock_internal_abort) - *adapt_count = aconf.skip_lock_internal_abort; @@ -116,18 +116,18 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c + != aconf.skip_lock_internal_abort) + atomic_store_relaxed (adapt_count, + aconf.skip_lock_internal_abort); - break; - } - } + break; + } + } @@ -87,7 +98,8 @@ __lll_lock_elision (int *futex, short *a { /* Use a normal lock until the threshold counter runs out. - Lost updates possible. */ + Lost updates possible. */ - (*adapt_count)--; + atomic_store_relaxed (adapt_count, + atomic_load_relaxed (adapt_count) - 1); } - + /* Use a normal lock here. */ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c =================================================================== @@ -136,7 +136,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c @@ -36,8 +36,10 @@ __lll_trylock_elision (int *futex, short return an error. */ _xabort (_ABORT_NESTED_TRYLOCK); - + - /* Only try a transaction if it's worth it. */ - if (*adapt_count <= 0) + /* Only try a transaction if it's worth it. See __lll_lock_elision for @@ -145,7 +145,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c + if (atomic_load_relaxed (adapt_count) <= 0) { unsigned status; - + @@ -55,16 +57,18 @@ __lll_trylock_elision (int *futex, short if (!(status & _XABORT_RETRY)) { @@ -168,5 +168,5 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c + atomic_store_relaxed (adapt_count, + atomic_load_relaxed (adapt_count) - 1); } - + return lll_trylock (*futex); diff --git a/SOURCES/glibc-rh841653-15.patch b/SOURCES/glibc-rh841653-15.patch index 3cf8dc49..8eb551c6 100644 --- a/SOURCES/glibc-rh841653-15.patch +++ b/SOURCES/glibc-rh841653-15.patch @@ -9,9 +9,9 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c @@ -52,11 +52,6 @@ int __rwlock_rtm_enabled attribute_hidde - + int __rwlock_rtm_read_retries attribute_hidden = 3; - + -/* Set when the CPU supports elision. When false elision is never attempted. - */ - @@ -21,8 +21,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c DEFAULT locks should be automatically upgraded to elision in pthread_mutex_lock(). Disabled for suid programs. Only used when elision @@ -71,10 +66,10 @@ elision_init (int argc __attribute__ ((u - char **argv __attribute__ ((unused)), - char **environ) + char **argv __attribute__ ((unused)), + char **environ) { - __elision_available = HAS_CPU_FEATURE (RTM); + int elision_available = HAS_CPU_FEATURE (RTM); @@ -33,16 +33,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c + __rwlock_rtm_enabled = __libc_enable_secure ? 0 : elision_available; #endif } - + Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h @@ -35,7 +35,6 @@ struct elision_config extern struct elision_config __elision_aconf attribute_hidden; - + extern int __rwlock_rtm_enabled attribute_hidden; -extern int __elision_available attribute_hidden; extern int __pthread_force_elision attribute_hidden; - + /* Tell the test suite to test elision for this architecture. */ diff --git a/SOURCES/glibc-rh841653-16.patch b/SOURCES/glibc-rh841653-16.patch index 8be759e9..b2b49151 100644 --- a/SOURCES/glibc-rh841653-16.patch +++ b/SOURCES/glibc-rh841653-16.patch @@ -5,7 +5,7 @@ Index: glibc-2.17-c758a686/elf/rtld.c @@ -2478,6 +2478,11 @@ process_envvars (enum mode *modep) GLRO(dl_profile_output) = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0]; - + + /* RHEL 7 specific change: + Without the tunables farmework we simulate tunables only for + use with enabling transactional memory. */ @@ -38,7 +38,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c + } #endif } - + Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h =================================================================== --- glibc-2.17-c758a686.orig/sysdeps/generic/ldsodefs.h @@ -46,7 +46,7 @@ Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h @@ -557,6 +557,9 @@ struct rtld_global_ro platforms. */ EXTERN uint64_t _dl_hwcap2; - + + /* RHEL 7 specific change: Is elision enabled for this process? */ + EXTERN bool _dl_elision_enabled; + @@ -56,14 +56,14 @@ Index: glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h @@ -893,6 +896,10 @@ extern void _dl_show_auxv (void) interna other. */ extern char *_dl_next_ld_env_entry (char ***position) internal_function; - + +/* RHEL 7 specific change: + Manually process RHEL 7-specific tunable entries. */ +extern void _dl_process_tunable_env_entries (void) internal_function; + /* Return an array with the names of the important hardware capabilities. */ extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform, - size_t paltform_len, + size_t paltform_len, Index: glibc-2.17-c758a686/elf/dl-support.c =================================================================== --- glibc-2.17-c758a686.orig/elf/dl-support.c @@ -71,7 +71,7 @@ Index: glibc-2.17-c758a686/elf/dl-support.c @@ -123,6 +123,10 @@ size_t _dl_phnum; uint64_t _dl_hwcap __attribute__ ((nocommon)); uint64_t _dl_hwcap2 __attribute__ ((nocommon)); - + +/* RHEL 7-specific change: Is elision enabled for the process? + Static library definition. */ +bool _dl_elision_enabled; @@ -82,7 +82,7 @@ Index: glibc-2.17-c758a686/elf/dl-support.c @@ -289,6 +293,9 @@ _dl_non_dynamic_init (void) _dl_profile_output = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0]; - + + /* RHEL 7 specific change: Process tunables at startup. */ + _dl_process_tunable_env_entries (); + @@ -96,7 +96,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c @@ -17,6 +17,10 @@ License along with the GNU C Library; if not, see . */ - + +/* RHEL 7-specific: Define multiple versions only for the definition in + libc. Don't define multiple versions for strstr in static library + since we need strstr before initialization has happened. */ @@ -109,15 +109,15 @@ Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/strstr-c.c __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2); #endif +#endif - + #include "string/strstr.c" - + +#if defined SHARED && IS_IN (libc) extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden; extern __typeof (__redirect_strstr) __strstr_sse2_unaligned attribute_hidden; extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden; @@ -48,3 +54,5 @@ libc_ifunc (__libc_strstr, HAS_CPU_FEATU - + #undef strstr strong_alias (__libc_strstr, strstr) +#endif diff --git a/SOURCES/glibc-rh841653-17.patch b/SOURCES/glibc-rh841653-17.patch index 639989b6..dba8b9fc 100644 --- a/SOURCES/glibc-rh841653-17.patch +++ b/SOURCES/glibc-rh841653-17.patch @@ -3,11 +3,11 @@ Author: Andrew Senkevich Date: Mon Dec 19 13:20:31 2016 +0300 Disable TSX on some Haswell processors. - + Patch disables Intel TSX on some Haswell processors to avoid TSX on kernels that weren't updated with the latest microcode package (which disables broken feature by default). - + * sysdeps/x86/cpu-features.c (get_common_indeces): Add stepping identification. (init_cpu_features): Add handle of Haswell. @@ -17,7 +17,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c --- glibc-2.17-c758a686.orig/sysdeps/x86/cpu-features.c +++ glibc-2.17-c758a686/sysdeps/x86/cpu-features.c @@ -21,7 +21,8 @@ - + static inline void get_common_indeces (struct cpu_features *cpu_features, - unsigned int *family, unsigned int *model) @@ -32,7 +32,7 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c *model = (eax >> 4) & 0x0f; + *stepping = eax & 0x0f; } - + static inline void @@ -45,9 +47,11 @@ init_cpu_features (struct cpu_features * /* This spells out "GenuineIntel". */ @@ -41,16 +41,16 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c + unsigned int stepping; + kind = arch_kind_intel; - + - get_common_indeces (cpu_features, &family, &model); + get_common_indeces (cpu_features, &family, &model, &stepping); - + /* Intel processors prefer SSE instruction for memory/string routines if they are available. */ @@ -128,6 +132,20 @@ init_cpu_features (struct cpu_features * - | bit_Fast_Unaligned_Load - | bit_Prefer_PMINUB_for_stringop); - break; + | bit_Fast_Unaligned_Load + | bit_Prefer_PMINUB_for_stringop); + break; + + case 0x3f: + /* Xeon E7 v3 with stepping >= 4 has working TSX. */ @@ -65,9 +65,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c + broken feature by default). */ + cpu_features->cpuid[COMMON_CPUID_INDEX_7].ebx &= ~(bit_RTM); + break; - } - } - + } + } + @@ -148,9 +166,11 @@ init_cpu_features (struct cpu_features * /* This spells out "AuthenticAMD". */ else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65) @@ -75,8 +75,9 @@ Index: glibc-2.17-c758a686/sysdeps/x86/cpu-features.c + unsigned int stepping; + kind = arch_kind_amd; - + - get_common_indeces (cpu_features, &family, &model); + get_common_indeces (cpu_features, &family, &model, &stepping); - + ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx; + diff --git a/SOURCES/glibc-rh841653-2.patch b/SOURCES/glibc-rh841653-2.patch index 839910d9..5738a0e1 100644 --- a/SOURCES/glibc-rh841653-2.patch +++ b/SOURCES/glibc-rh841653-2.patch @@ -3,7 +3,7 @@ Author: Andi Kleen Date: Fri Jun 28 05:19:37 2013 -0700 Add minimal test suite changes for elision enabled kernels - + tst-mutex5 and 8 test some behaviour not required by POSIX, that elision changes. This changes these tests to not check this when elision is enabled at configure time. @@ -16,13 +16,13 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex5.c #include #include +#include - - + + #ifndef TYPE @@ -85,6 +86,8 @@ do_test (void) return 1; } - + + /* Elided locks do not time out. */ +#ifdef ENABLE_LOCK_ELISION if (pthread_mutex_trylock (&m) == 0) @@ -33,7 +33,7 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex5.c return 1; } +#endif - + if (pthread_mutex_unlock (&m) != 0) { Index: glibc-2.17-c758a686/nptl/tst-mutex8.c @@ -52,7 +52,7 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex8.c @@ -117,7 +119,10 @@ check_type (const char *mas, pthread_mut return 1; } - + - int e = pthread_mutex_destroy (m); + /* Elided mutexes don't fail destroy. If elision is not explicitly disabled + we don't know, so can also not check this. */ @@ -62,34 +62,34 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex8.c { printf ("mutex_destroy of self-locked mutex succeeded for %s\n", mas); @@ -129,6 +134,7 @@ check_type (const char *mas, pthread_mut - mas); + mas); return 1; } +#endif - + if (pthread_mutex_unlock (m) != 0) { @@ -142,6 +148,8 @@ check_type (const char *mas, pthread_mut return 1; } - + + /* Elided mutexes don't fail destroy. */ +#ifndef ENABLE_LOCK_ELISION e = pthread_mutex_destroy (m); if (e == 0) { @@ -155,6 +163,7 @@ mutex_destroy of self-trylocked mutex di - mas); + mas); return 1; } +#endif - + if (pthread_mutex_unlock (m) != 0) { @@ -189,6 +198,8 @@ mutex_destroy of self-trylocked mutex di return 1; } - + + /* Elided mutexes don't fail destroy. */ +#ifndef ENABLE_LOCK_ELISION e = pthread_mutex_destroy (m); @@ -100,23 +100,23 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex8.c return 1; } +#endif - + done = true; if (pthread_cond_signal (&c) != 0) @@ -259,6 +271,8 @@ mutex_destroy of condvar-used mutex did return 1; } - + + /* Elided mutexes don't fail destroy. */ +#ifndef ENABLE_LOCK_ELISION e = pthread_mutex_destroy (m); if (e == 0) { @@ -273,6 +287,7 @@ mutex_destroy of condvar-used mutex did - mas); + mas); return 1; } +#endif - + if (pthread_cancel (th) != 0) { diff --git a/SOURCES/glibc-rh841653-3.patch b/SOURCES/glibc-rh841653-3.patch index ca157ed1..5ce6f086 100644 --- a/SOURCES/glibc-rh841653-3.patch +++ b/SOURCES/glibc-rh841653-3.patch @@ -3,24 +3,24 @@ Author: Andi Kleen Date: Sat Dec 22 01:03:04 2012 -0800 Add elision to pthread_mutex_{try,timed,un}lock - + Add elision paths to the basic mutex locks. - + The normal path has a check for RTM and upgrades the lock to RTM when available. Trylocks cannot automatically upgrade, so they check for elision every time. - + We use a 4 byte value in the mutex to store the lock elision adaptation state. This is separate from the adaptive spin state and uses a separate field. - + Condition variables currently do not support elision. - + Recursive mutexes and condition variables may be supported at some point, but are not in the current implementation. Also "trylock" will not automatically enable elision unless some other lock call has been already called on the lock. - + This version does not use IFUNC, so it means every lock has one additional check for elision. Benchmarking showed the overhead to be negligible. @@ -29,7 +29,7 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h --- glibc-2.17-c758a686.orig/nptl/pthreadP.h +++ glibc-2.17-c758a686/nptl/pthreadP.h @@ -110,8 +110,10 @@ enum - + #define PTHREAD_MUTEX_TYPE(m) \ ((m)->__data.__kind & 127) +/* Don't include NO_ELISION, as that type is always the same @@ -37,7 +37,7 @@ Index: glibc-2.17-c758a686/nptl/pthreadP.h #define PTHREAD_MUTEX_TYPE_ELISION(m) \ - ((m)->__data.__kind & (127|PTHREAD_MUTEX_ELISION_FLAGS_NP)) + ((m)->__data.__kind & (127|PTHREAD_MUTEX_ELISION_NP)) - + #if LLL_PRIVATE == 0 && LLL_SHARED == 128 # define PTHREAD_MUTEX_PSHARED(m) \ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c @@ -47,7 +47,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c @@ -25,6 +25,14 @@ #include #include - + +#ifndef lll_lock_elision +#define lll_lock_elision(lock, try_lock, private) ({ \ + lll_lock (lock, private); 0; }) @@ -56,13 +56,13 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c +#ifndef lll_trylock_elision +#define lll_trylock_elision(a,t) lll_trylock(a) +#endif - + #ifndef LLL_MUTEX_LOCK # define LLL_MUTEX_LOCK(mutex) \ @@ -34,39 +42,60 @@ # define LLL_ROBUST_MUTEX_LOCK(mutex, id) \ lll_robust_lock ((mutex)->__data.__lock, id, \ - PTHREAD_ROBUST_MUTEX_PSHARED (mutex)) + PTHREAD_ROBUST_MUTEX_PSHARED (mutex)) +# define LLL_MUTEX_LOCK_ELISION(mutex) \ + lll_lock_elision ((mutex)->__data.__lock, (mutex)->__data.__elision, \ + PTHREAD_MUTEX_PSHARED (mutex)) @@ -70,31 +70,31 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c + lll_trylock_elision((mutex)->__data.__lock, (mutex)->__data.__elision, \ + PTHREAD_MUTEX_PSHARED (mutex)) #endif - + +#ifndef FORCE_ELISION +#define FORCE_ELISION(m, s) +#endif - + static int __pthread_mutex_lock_full (pthread_mutex_t *mutex) __attribute_noinline__; - + - int __pthread_mutex_lock (mutex) pthread_mutex_t *mutex; { assert (sizeof (mutex->__size) >= sizeof (mutex->__data)); - + - unsigned int type = PTHREAD_MUTEX_TYPE (mutex); + unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex); - + LIBC_PROBE (mutex_entry, 1, mutex); - + - if (__builtin_expect (type & ~PTHREAD_MUTEX_KIND_MASK_NP, 0)) + if (__builtin_expect (type & ~(PTHREAD_MUTEX_KIND_MASK_NP + | PTHREAD_MUTEX_ELISION_FLAGS_NP), 0)) return __pthread_mutex_lock_full (mutex); - + - pid_t id = THREAD_GETMEM (THREAD_SELF, tid); - - if (__builtin_expect (type, PTHREAD_MUTEX_TIMED_NP) @@ -125,7 +125,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c { /* Recursive mutex. */ + pid_t id = THREAD_GETMEM (THREAD_SELF, tid); - + /* Check whether we already hold the mutex. */ if (mutex->__data.__owner == id) @@ -87,7 +116,8 @@ __pthread_mutex_lock (mutex) @@ -137,7 +137,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c + == PTHREAD_MUTEX_ADAPTIVE_NP, 1)) { if (! __is_smp) - goto simple; + goto simple; @@ -117,13 +147,16 @@ __pthread_mutex_lock (mutex) } else @@ -147,10 +147,10 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c + assert (PTHREAD_MUTEX_TYPE (mutex) == PTHREAD_MUTEX_ERRORCHECK_NP); /* Check whether we already hold the mutex. */ if (__builtin_expect (mutex->__data.__owner == id, 0)) - return EDEADLK; + return EDEADLK; goto simple; } - + + pid_t id = THREAD_GETMEM (THREAD_SELF, tid); + /* Record the ownership. */ @@ -161,9 +161,9 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c --- glibc-2.17-c758a686.orig/nptl/pthread_mutex_timedlock.c +++ glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c @@ -25,6 +25,17 @@ - + #include - + +#ifndef lll_timedlock_elision +#define lll_timedlock_elision(a,dummy,b,c) lll_timedlock(a, b, c) +#endif @@ -175,16 +175,16 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c +#ifndef FORCE_ELISION +#define FORCE_ELISION(m, s) +#endif - + int pthread_mutex_timedlock (mutex, abstime) @@ -40,10 +51,11 @@ pthread_mutex_timedlock (mutex, abstime) /* We must not check ABSTIME here. If the thread does not block abstime must not be checked for a valid value. */ - + - switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex), + switch (__builtin_expect (PTHREAD_MUTEX_TYPE_ELISION (mutex), - PTHREAD_MUTEX_TIMED_NP)) + PTHREAD_MUTEX_TIMED_NP)) { /* Recursive mutex. */ + case PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_ELISION_NP: @@ -193,15 +193,15 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c if (mutex->__data.__owner == id) @@ -78,12 +90,22 @@ pthread_mutex_timedlock (mutex, abstime) /* FALLTHROUGH */ - + case PTHREAD_MUTEX_TIMED_NP: + FORCE_ELISION (mutex, goto elision); simple: /* Normal mutex. */ result = lll_timedlock (mutex->__data.__lock, abstime, - PTHREAD_MUTEX_PSHARED (mutex)); + PTHREAD_MUTEX_PSHARED (mutex)); break; - + + case PTHREAD_MUTEX_TIMED_ELISION_NP: + elision: __attribute__((unused)) + /* Don't record ownership */ @@ -213,7 +213,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c + case PTHREAD_MUTEX_ADAPTIVE_NP: if (! __is_smp) - goto simple; + goto simple; Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/pthread_mutex_trylock.c @@ -221,7 +221,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c @@ -22,6 +22,16 @@ #include "pthreadP.h" #include - + +#ifndef lll_trylock_elision +#define lll_trylock_elision(a,t) lll_trylock(a) +#endif @@ -232,16 +232,16 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c + +/* We don't force elision in trylock, because this can lead to inconsistent + lock state if the lock was actually busy. */ - + int __pthread_mutex_trylock (mutex) @@ -30,10 +40,11 @@ __pthread_mutex_trylock (mutex) int oldval; pid_t id = THREAD_GETMEM (THREAD_SELF, tid); - + - switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex), + switch (__builtin_expect (PTHREAD_MUTEX_TYPE_ELISION (mutex), - PTHREAD_MUTEX_TIMED_NP)) + PTHREAD_MUTEX_TIMED_NP)) { /* Recursive mutex. */ + case PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_ELISION_NP: @@ -249,9 +249,9 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c /* Check whether we already hold the mutex. */ if (mutex->__data.__owner == id) @@ -57,10 +68,20 @@ __pthread_mutex_trylock (mutex) - } + } break; - + - case PTHREAD_MUTEX_ERRORCHECK_NP: + case PTHREAD_MUTEX_TIMED_ELISION_NP: + elision: @@ -269,10 +269,10 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c - /* Normal mutex. */ + case PTHREAD_MUTEX_ERRORCHECK_NP: if (lll_trylock (mutex->__data.__lock) != 0) - break; - + break; + @@ -378,4 +399,9 @@ __pthread_mutex_trylock (mutex) - + return EBUSY; } + @@ -288,7 +288,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_unlock.c @@ -23,6 +23,10 @@ #include #include - + +#ifndef lll_unlock_elision +#define lll_unlock_elision(a,b) ({ lll_unlock (a,b); 0; }) +#endif @@ -306,10 +306,10 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_unlock.c + if (__builtin_expect (type & + ~(PTHREAD_MUTEX_KIND_MASK_NP|PTHREAD_MUTEX_ELISION_FLAGS_NP), 0)) return __pthread_mutex_unlock_full (mutex, decr); - + if (__builtin_expect (type, PTHREAD_MUTEX_TIMED_NP) @@ -55,7 +60,14 @@ __pthread_mutex_unlock_usercnt (mutex, d - + return 0; } - else if (__builtin_expect (type == PTHREAD_MUTEX_RECURSIVE_NP, 1)) @@ -325,7 +325,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_unlock.c /* Recursive mutex. */ if (mutex->__data.__owner != THREAD_GETMEM (THREAD_SELF, tid)) @@ -66,7 +78,8 @@ __pthread_mutex_unlock_usercnt (mutex, d - return 0; + return 0; goto normal; } - else if (__builtin_expect (type == PTHREAD_MUTEX_ADAPTIVE_NP, 1)) @@ -339,7 +339,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock. --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c @@ -2,8 +2,15 @@ - + #define LLL_MUTEX_LOCK(mutex) \ lll_cond_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex)) + @@ -353,7 +353,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock. + #define LLL_ROBUST_MUTEX_LOCK(mutex, id) \ lll_robust_cond_lock ((mutex)->__data.__lock, id, \ - PTHREAD_ROBUST_MUTEX_PSHARED (mutex)) + PTHREAD_ROBUST_MUTEX_PSHARED (mutex)) Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h @@ -389,15 +389,15 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c @@ -24,9 +24,8 @@ - + #define aconf __elision_aconf - + -/* Try to elide a futex trylock. FUTEX is the futex variable. TRY_LOCK is the - adaptation counter in the mutex. UPGRADED is != 0 when this is for an - automatically upgraded lock. */ +/* Try to elide a futex trylock. FUTEX is the futex variable. ADAPT_COUNT is the + adaptation counter in the mutex. */ - + int __lll_trylock_elision (int *futex, short *adapt_count) Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h diff --git a/SOURCES/glibc-rh841653-4.patch b/SOURCES/glibc-rh841653-4.patch index 9ca05092..0477254e 100644 --- a/SOURCES/glibc-rh841653-4.patch +++ b/SOURCES/glibc-rh841653-4.patch @@ -3,13 +3,13 @@ Author: Andi Kleen Date: Thu Jun 27 11:15:06 2013 -0700 Disable elision for any pthread_mutexattr_settype call - + PTHREAD_MUTEX_NORMAL requires deadlock for nesting, DEFAULT does not. Since glibc uses the same value (0) disable elision for any call to pthread_mutexattr_settype() with a 0 value. This implies that a program can disable elision by doing pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL) - + Based on a original proposal by Rich Felker. Index: glibc-2.17-c758a686/nptl/pthread_mutexattr_settype.c =================================================================== @@ -18,12 +18,12 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutexattr_settype.c @@ -30,6 +30,11 @@ __pthread_mutexattr_settype (attr, kind) if (kind < PTHREAD_MUTEX_NORMAL || kind > PTHREAD_MUTEX_ADAPTIVE_NP) return EINVAL; - + + /* Cannot distinguish between DEFAULT and NORMAL. So any settype + call disables elision for now. */ + if (kind == PTHREAD_MUTEX_DEFAULT) + kind |= PTHREAD_MUTEX_NO_ELISION_NP; + iattr = (struct pthread_mutexattr *) attr; - + iattr->mutexkind = (iattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_BITS) | kind; diff --git a/SOURCES/glibc-rh841653-5.patch b/SOURCES/glibc-rh841653-5.patch index bb840157..32ed90b4 100644 --- a/SOURCES/glibc-rh841653-5.patch +++ b/SOURCES/glibc-rh841653-5.patch @@ -9,11 +9,11 @@ Index: glibc-2.17-c758a686/INSTALL +++ glibc-2.17-c758a686/INSTALL @@ -141,7 +141,7 @@ will be used, and CFLAGS sets optimizati only if you understand and accept those risks. - + `--enable-lock-elision=yes' - Enable lock elision for pthread mutexes and rwlocks by default. + Enable lock elision for pthread mutexes by default. - + `--build=BUILD-SYSTEM' `--host=HOST-SYSTEM' Index: glibc-2.17-c758a686/configure @@ -35,11 +35,11 @@ Index: glibc-2.17-c758a686/configure.in --- glibc-2.17-c758a686.orig/configure.in +++ glibc-2.17-c758a686/configure.in @@ -157,7 +157,7 @@ fi - + AC_ARG_ENABLE([lock-elision], - AC_HELP_STRING([--enable-lock-elision[=yes/no]], + AC_HELP_STRING([--enable-lock-elision[=yes/no]], - [Enable lock elision for pthread mutexes and rwlocks by default]), + [Enable lock elision for pthread mutexes by default]), - [enable_lock_elision=$enableval], - [enable_lock_elision=no]) + [enable_lock_elision=$enableval], + [enable_lock_elision=no]) if test "$enable_lock_elision" = yes ; then diff --git a/SOURCES/glibc-rh841653-6.patch b/SOURCES/glibc-rh841653-6.patch index ef8c76de..047c17c8 100644 --- a/SOURCES/glibc-rh841653-6.patch +++ b/SOURCES/glibc-rh841653-6.patch @@ -3,7 +3,7 @@ Author: Dominik Vogt Date: Fri Jul 19 05:16:28 2013 +0000 Clean up whitespace in lock elision patches. - + Signed-off-by: Carlos O'Donell Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c =================================================================== @@ -12,7 +12,7 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c @@ -86,7 +86,7 @@ __pthread_mutex_lock (mutex) /* This case can never happen on a system without elision, as the mutex type initialization functions will not - allow to set the elision flags. */ + allow to set the elision flags. */ - /* Don't record owner or users for elision case. This is a + /* Don't record owner or users for elision case. This is a tail call. */ @@ -24,21 +24,21 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c +++ glibc-2.17-c758a686/nptl/pthread_mutex_trylock.c @@ -31,7 +31,7 @@ #endif - + /* We don't force elision in trylock, because this can lead to inconsistent - lock state if the lock was actually busy. */ + lock state if the lock was actually busy. */ - + int __pthread_mutex_trylock (mutex) @@ -73,7 +73,7 @@ __pthread_mutex_trylock (mutex) if (lll_trylock_elision (mutex->__data.__lock, - mutex->__data.__elision) != 0) + mutex->__data.__elision) != 0) break; - /* Don't record the ownership. */ + /* Don't record the ownership. */ return 0; - + case PTHREAD_MUTEX_TIMED_NP: Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h =================================================================== @@ -50,7 +50,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h { - short __espins; + short __espins; - short __elision; + short __elision; # define __spins d.__espins # define __elision d.__elision Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c @@ -58,12 +58,12 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + #include "config.h" #include @@ -32,7 +32,7 @@ struct elision_config __elision_aconf = @@ -76,85 +76,85 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c .skip_lock_internal_abort = 3, /* How often we retry using elision if there is chance for the transaction @@ -52,13 +52,14 @@ int __rwlock_rtm_enabled attribute_hidde - + int __rwlock_rtm_read_retries attribute_hidden = 3; - + -/* Set when the CPU supports elision. When false elision is never attempted. */ +/* Set when the CPU supports elision. When false elision is never attempted. + */ - + int __elision_available attribute_hidden; - + -/* Force elision for all new locks. This is used to decide whether existing +/* Force elision for all new locks. This is used to decide whether existing DEFAULT locks should be automatically upgraded to elision in - pthread_mutex_lock(). Disabled for suid programs. Only used when elision + pthread_mutex_lock(). Disabled for suid programs. Only used when elision is available. */ - + int __pthread_force_elision attribute_hidden; Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.h @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #ifndef _ELISION_CONF_H #define _ELISION_CONF_H 1 - + Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + #include #include "pthreadP.h" @@ -58,7 +58,7 @@ __lll_lock_elision (int *futex, short *a - if (*futex == 0) - return 0; - + if (*futex == 0) + return 0; + - /* Lock was busy. Fall back to normal locking. + /* Lock was busy. Fall back to normal locking. - Could also _xend here but xabort with 0xff code - is more visible in the profiler. */ - _xabort (_ABORT_LOCK_BUSY); + Could also _xend here but xabort with 0xff code + is more visible in the profiler. */ + _xabort (_ABORT_LOCK_BUSY); @@ -69,12 +69,12 @@ __lll_lock_elision (int *futex, short *a - if ((status & _XABORT_EXPLICIT) - && _XABORT_CODE (status) == _ABORT_LOCK_BUSY) - { + if ((status & _XABORT_EXPLICIT) + && _XABORT_CODE (status) == _ABORT_LOCK_BUSY) + { - /* Right now we skip here. Better would be to wait a bit - and retry. This likely needs some spinning. */ + /* Right now we skip here. Better would be to wait a bit + and retry. This likely needs some spinning. */ - if (*adapt_count != aconf.skip_lock_busy) - *adapt_count = aconf.skip_lock_busy; - } + if (*adapt_count != aconf.skip_lock_busy) + *adapt_count = aconf.skip_lock_busy; + } - /* Internal abort. There is no chance for retry. + /* Internal abort. There is no chance for retry. - Use the normal locking and next time use lock. - Be careful to avoid writing to the lock. */ - else if (*adapt_count != aconf.skip_lock_internal_abort) + Use the normal locking and next time use lock. + Be careful to avoid writing to the lock. */ + else if (*adapt_count != aconf.skip_lock_internal_abort) Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-timed.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-timed.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-timed.c @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + #include #include Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c @@ -162,23 +162,23 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + #include #include @@ -24,14 +24,14 @@ - + #define aconf __elision_aconf - + -/* Try to elide a futex trylock. FUTEX is the futex variable. ADAPT_COUNT is the - adaptation counter in the mutex. */ +/* Try to elide a futex trylock. FUTEX is the futex variable. ADAPT_COUNT is + the adaptation counter in the mutex. */ - + int __lll_trylock_elision (int *futex, short *adapt_count) { @@ -189,16 +189,16 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c return an error. */ _xabort (_ABORT_NESTED_TRYLOCK); @@ -46,7 +46,7 @@ __lll_trylock_elision (int *futex, short - if (*futex == 0) - return 0; - + if (*futex == 0) + return 0; + - /* Lock was busy. Fall back to normal locking. + /* Lock was busy. Fall back to normal locking. - Could also _xend here but xabort with 0xff code - is more visible in the profiler. */ - _xabort (_ABORT_LOCK_BUSY); + Could also _xend here but xabort with 0xff code + is more visible in the profiler. */ + _xabort (_ABORT_LOCK_BUSY); @@ -54,12 +54,12 @@ __lll_trylock_elision (int *futex, short - + if (!(status & _XABORT_RETRY)) { - /* Internal abort. No chance for retry. For future @@ -217,12 +217,12 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h @@ -14,7 +14,7 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + /* Check for elision on this lock without upgrading. */ #define DO_ELISION(m) \ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/hle.h @@ -236,14 +236,14 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/hle.h + that do not support the intrinsics and instructions yet. */ #ifndef _HLE_H #define _HLE_H 1 - + @@ -28,7 +28,7 @@ /* Official RTM intrinsics interface matching gcc/icc, but works on older gcc compatible compilers and binutils. We should somehow detect if the compiler supports it, because - it may be able to generate slightly better code. */ + it may be able to generate slightly better code. */ - + #define _XBEGIN_STARTED (~0u) #define _XABORT_EXPLICIT (1 << 0) Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c @@ -251,12 +251,12 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_l --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c @@ -13,9 +13,10 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ - + /* The cond lock is not actually elided yet, but we still need to handle already elided locks. */ #include @@ -267,7 +267,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c @@ -14,7 +14,8 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ @@ -275,13 +275,13 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c + #include #include "force-elision.h" - + Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c =================================================================== --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c @@ -14,7 +14,9 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ @@ -296,7 +296,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_tryloc --- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c @@ -14,7 +14,8 @@ - + You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ @@ -304,3 +304,4 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_tryloc + #include #include "force-elision.h" + diff --git a/SOURCES/glibc-rh841653-7.patch b/SOURCES/glibc-rh841653-7.patch index 19f3bece..9a2c9e83 100644 --- a/SOURCES/glibc-rh841653-7.patch +++ b/SOURCES/glibc-rh841653-7.patch @@ -9,7 +9,7 @@ Index: glibc-2.17-c758a686/nptl/tst-mutex5.c +++ glibc-2.17-c758a686/nptl/tst-mutex5.c @@ -87,7 +87,7 @@ do_test (void) } - + /* Elided locks do not time out. */ -#ifdef ENABLE_LOCK_ELISION +#ifndef ENABLE_LOCK_ELISION diff --git a/SOURCES/glibc-rh841653-8.patch b/SOURCES/glibc-rh841653-8.patch index 89fd4d30..5c1af8fc 100644 --- a/SOURCES/glibc-rh841653-8.patch +++ b/SOURCES/glibc-rh841653-8.patch @@ -8,11 +8,11 @@ Index: glibc-2.17-c758a686/nptl/pthread_mutexattr_settype.c --- glibc-2.17-c758a686.orig/nptl/pthread_mutexattr_settype.c +++ glibc-2.17-c758a686/nptl/pthread_mutexattr_settype.c @@ -32,7 +32,7 @@ __pthread_mutexattr_settype (attr, kind) - + /* Cannot distinguish between DEFAULT and NORMAL. So any settype call disables elision for now. */ - if (kind == PTHREAD_MUTEX_DEFAULT) + if (kind == PTHREAD_MUTEX_NORMAL) kind |= PTHREAD_MUTEX_NO_ELISION_NP; - + iattr = (struct pthread_mutexattr *) attr; diff --git a/SOURCES/glibc-rh841653-9.patch b/SOURCES/glibc-rh841653-9.patch index f2592332..7a98cc47 100644 --- a/SOURCES/glibc-rh841653-9.patch +++ b/SOURCES/glibc-rh841653-9.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Tue Jun 24 22:40:07 2014 +0530 Fix namespace violation in pthreadtypes.h (BZ #17084) - + This was causing conformtest failures on i386. Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h @@ -12,8 +12,8 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h @@ -114,10 +114,10 @@ typedef union { - short __espins; - short __elision; + short __espins; + short __elision; -# define __spins d.__espins -# define __elision d.__elision +# define __spins __elision_data.__espins diff --git a/SOURCES/glibc-rh841787.patch b/SOURCES/glibc-rh841787.patch index adcbafc4..afa48678 100644 --- a/SOURCES/glibc-rh841787.patch +++ b/SOURCES/glibc-rh841787.patch @@ -6,7 +6,7 @@ Author: Andreas Schwab Date: Thu Feb 19 15:52:08 2015 +0100 Simplify handling of nameserver configuration in resolver - + Remove use of ext.nsmap member of struct __res_state and always use an identity mapping betwen the nsaddr_list array and the ext.nsaddrs array. The fact that a nameserver has an IPv6 address is signalled by @@ -16,41 +16,41 @@ diff -rup glibc-2.17-c758a686/resolv/res_init.c glibc-2.17-c758a686/resolv/res_i --- glibc-2.17-c758a686/resolv/res_init.c 2012-07-26 15:10:45.655638776 -0600 +++ glibc-2.17-c758a686/resolv/res_init.c 2012-07-26 15:11:27.731423002 -0600 @@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit - cp++; - if ((*cp != '\0') && (*cp != '\n') - && __inet_aton(cp, &a)) { + cp++; + if ((*cp != '\0') && (*cp != '\n') + && __inet_aton(cp, &a)) { - statp->nsaddr_list[nservall].sin_addr = a; - statp->nsaddr_list[nservall].sin_family = AF_INET; - statp->nsaddr_list[nservall].sin_port = + statp->nsaddr_list[nserv].sin_addr = a; + statp->nsaddr_list[nserv].sin_family = AF_INET; + statp->nsaddr_list[nserv].sin_port = - htons(NAMESERVER_PORT); - nserv++; + htons(NAMESERVER_PORT); + nserv++; #ifdef _LIBC diff -rup glibc-2.17-c758a686/resolv/res_send.c glibc-2.17-c758a686/resolv/res_send.c --- glibc-2.17-c758a686/resolv/res_send.c 2010-05-04 05:27:23.000000000 -0600 +++ glibc-2.17-c758a686/resolv/res_send.c 2012-07-26 15:34:58.398261659 -0600 @@ -421,10 +421,10 @@ __libc_res_nsend(res_state statp, const - EXT(statp).nsmap[n] = MAXNS; - } - } + EXT(statp).nsmap[n] = MAXNS; + } + } - n = statp->nscount; - if (statp->nscount > EXT(statp).nscount) + n = statp->nscount - EXT(statp).nscount6; + if (n > EXT(statp).nscount) - for (n = EXT(statp).nscount, ns = 0; + for (n = EXT(statp).nscount, ns = 0; - n < statp->nscount; n++) { + n < statp->nscount - EXT(statp).nscount6; n++) { - while (ns < MAXNS - && EXT(statp).nsmap[ns] != MAXNS) - ns++; + while (ns < MAXNS + && EXT(statp).nsmap[ns] != MAXNS) + ns++; @@ -441,7 +441,7 @@ __libc_res_nsend(res_state statp, const - malloc(sizeof (struct sockaddr_in6)); - if (EXT(statp).nsaddrs[n] != NULL) { - memset (mempcpy(EXT(statp).nsaddrs[n], + malloc(sizeof (struct sockaddr_in6)); + if (EXT(statp).nsaddrs[n] != NULL) { + memset (mempcpy(EXT(statp).nsaddrs[n], - &statp->nsaddr_list[n], + &statp->nsaddr_list[ns], - sizeof (struct sockaddr_in)), - '\0', - sizeof (struct sockaddr_in6) + sizeof (struct sockaddr_in)), + '\0', + sizeof (struct sockaddr_in6) diff --git a/SOURCES/glibc-rh884008.patch b/SOURCES/glibc-rh884008.patch index 35258b9c..3b8b817e 100644 --- a/SOURCES/glibc-rh884008.patch +++ b/SOURCES/glibc-rh884008.patch @@ -13,7 +13,7 @@ index 5bd1609..65af0f2 100644 + return. */ + volatile int ret = 0; struct sigaction sa; - + sa.sa_handler = sig_handler; @@ -50,7 +56,7 @@ do_test (void) if (setjmp (jmpbuf)) @@ -22,5 +22,5 @@ index 5bd1609..65af0f2 100644 - return 0; + return ret; } - + sprintf (p, "This should segv\n"); diff --git a/SOURCES/glibc-rh892777.patch b/SOURCES/glibc-rh892777.patch index 5def5aa3..ad890430 100644 --- a/SOURCES/glibc-rh892777.patch +++ b/SOURCES/glibc-rh892777.patch @@ -4,10 +4,10 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c @@ -32,6 +32,14 @@ #include #include - -+/* The specification suggests 1024 as a maximum length of all fields, -+ but current linux systems usually don't use any limits. So, to stay -+ as much compatible as possible with recent linux systems we choose + ++/* The specification suggests 1024 as a maximum length of all fields, ++ but current linux systems usually don't use any limits. So, to stay ++ as much compatible as possible with recent linux systems we choose + limits large enough to avoid problems. */ + +#define XDRMAXNAME 1024 @@ -24,7 +24,7 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c + return xdr_string (xdrs, objp, XDRMAXNAME); } libnsl_hidden_def (xdr_domainname) - + bool_t xdr_mapname (XDR *xdrs, mapname *objp) { @@ -32,7 +32,7 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c + return xdr_string (xdrs, objp, XDRMAXNAME); } libnsl_hidden_def (xdr_mapname) - + bool_t xdr_peername (XDR *xdrs, peername *objp) { @@ -40,7 +40,7 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c + return xdr_string (xdrs, objp, XDRMAXNAME); } libnsl_hidden_def (xdr_peername) - + @@ -71,7 +79,7 @@ bool_t xdr_keydat (XDR *xdrs, keydat *objp) { @@ -49,7 +49,7 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c + (u_int *) &objp->keydat_len, XDRMAXRECORD); } libnsl_hidden_def (xdr_keydat) - + @@ -79,7 +87,7 @@ bool_t xdr_valdat (XDR *xdrs, valdat *objp) { @@ -58,3 +58,4 @@ diff -Nru glibc-2.17-c758a686/nis/yp_xdr.c glibc-2.17-c758a686/nis/yp_xdr.c + (u_int *) &objp->valdat_len, XDRMAXRECORD); } libnsl_hidden_def (xdr_valdat) + diff --git a/SOURCES/glibc-rh905184.patch b/SOURCES/glibc-rh905184.patch index 365820f7..67e774b8 100644 --- a/SOURCES/glibc-rh905184.patch +++ b/SOURCES/glibc-rh905184.patch @@ -45,9 +45,9 @@ index acc4f28..504feca 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h @@ -18,12 +18,17 @@ - + #include - + +/* In order to support the transition from unmarked objects + to marked objects we must treat unmarked objects as + compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF. */ @@ -62,24 +62,24 @@ index acc4f28..504feca 100644 + ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \ + || (flags) == FLAG_ELF_LIBC6) #endif - + #include_next diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/readelflib.c glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/readelflib.c index 81e5ccb..3efb613 100644 --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/readelflib.c +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/arm/readelflib.c @@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag, - if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD) - *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6; - else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT) + if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD) + *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6; + else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT) + *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6; + else + /* We must assume the unmarked objects are compatible + with all ABI variants. Such objects may have been + generated in a transitional period when the ABI + tags were not added to all objects. */ - *flag = FLAG_ELF_LIBC6; - } + *flag = FLAG_ELF_LIBC6; + } } diff --git glibc-2.17-c758a686/sysdeps/generic/ldconfig.h glibc-2.17-c758a686/sysdeps/generic/ldconfig.h index 57a9a46..91190aa 100644 @@ -90,6 +90,6 @@ index 57a9a46..91190aa 100644 #define FLAG_ARM_LIBHF 0x0900 #define FLAG_AARCH64_LIB64 0x0a00 +#define FLAG_ARM_LIBSF 0x0b00 - + /* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" diff --git a/SOURCES/glibc-rh905877.patch b/SOURCES/glibc-rh905877.patch index 556b8175..d95587f3 100644 --- a/SOURCES/glibc-rh905877.patch +++ b/SOURCES/glibc-rh905877.patch @@ -9,7 +9,7 @@ # # ChangeLog/ # 2013-02-12 Andreas Schwab -# +# # [BZ #15078] # * posix/regexec.c (extend_buffers): Add parameter min_len. # (check_matching): Pass minimum needed length. @@ -22,9 +22,9 @@ --- glibc-2.17-c758a686/posix/Makefile 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/posix/Makefile 2013-03-17 15:30:13.121068666 -0400 @@ -86,7 +86,7 @@ - tst-rfc3484-3 \ - tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ - bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ + tst-rfc3484-3 \ + tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ + bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ - bug-getopt5 tst-getopt_long1 + bug-getopt5 tst-getopt_long1 bug-regex34 xtests := bug-ga2 @@ -96,7 +96,7 @@ index 7f2de85..5ca2bf6 100644 +++ glibc-2.17-c758a686/posix/regexec.c @@ -197,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa, static int check_node_accept (const re_match_context_t *mctx, - const re_token_t *node, int idx) + const re_token_t *node, int idx) internal_function; -static reg_errcode_t extend_buffers (re_match_context_t *mctx) +static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) @@ -104,34 +104,34 @@ index 7f2de85..5ca2bf6 100644 /* Entry point for POSIX code. */ @@ -1160,7 +1160,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match, - || (BE (next_char_idx >= mctx->input.valid_len, 0) - && mctx->input.valid_len < mctx->input.len)) - { + || (BE (next_char_idx >= mctx->input.valid_len, 0) + && mctx->input.valid_len < mctx->input.len)) + { - err = extend_buffers (mctx); + err = extend_buffers (mctx, next_char_idx + 1); - if (BE (err != REG_NOERROR, 0)) - { - assert (err == REG_ESPACE); + if (BE (err != REG_NOERROR, 0)) + { + assert (err == REG_ESPACE); @@ -1738,7 +1738,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx) - && mctx->input.valid_len < mctx->input.len)) + && mctx->input.valid_len < mctx->input.len)) { reg_errcode_t err; - err = extend_buffers (mctx); + err = extend_buffers (mctx, next_state_log_idx + 1); if (BE (err != REG_NOERROR, 0)) - return err; + return err; } @@ -2792,7 +2792,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) - if (bkref_str_off >= mctx->input.len) - break; - + if (bkref_str_off >= mctx->input.len) + break; + - err = extend_buffers (mctx); + err = extend_buffers (mctx, bkref_str_off + 1); - if (BE (err != REG_NOERROR, 0)) - return err; - + if (BE (err != REG_NOERROR, 0)) + return err; + @@ -4102,7 +4102,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node, - + static reg_errcode_t internal_function __attribute_warn_unused_result__ -extend_buffers (re_match_context_t *mctx) @@ -142,7 +142,7 @@ index 7f2de85..5ca2bf6 100644 @@ -4111,8 +4111,10 @@ extend_buffers (re_match_context_t *mctx) if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) return REG_ESPACE; - + - /* Double the lengthes of the buffers. */ - ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2)); + /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */ @@ -151,3 +151,4 @@ index 7f2de85..5ca2bf6 100644 + MIN (pstr->len, pstr->bufs_len * 2))); if (BE (ret != REG_NOERROR, 0)) return ret; + diff --git a/SOURCES/glibc-rh906468-1.patch b/SOURCES/glibc-rh906468-1.patch index 4dd529eb..09f7ebef 100644 --- a/SOURCES/glibc-rh906468-1.patch +++ b/SOURCES/glibc-rh906468-1.patch @@ -5,29 +5,29 @@ Author: Florian Weimer Date: Thu Apr 14 09:17:02 2016 +0200 malloc: Run fork handler as late as possible [BZ #19431] - + Previously, a thread M invoking fork would acquire locks in this order: - + (M1) malloc arena locks (in the registered fork handler) (M2) libio list lock - + A thread F invoking flush (NULL) would acquire locks in this order: - + (F1) libio list lock (F2) individual _IO_FILE locks - + A thread G running getdelim would use this order: - + (G1) _IO_FILE lock (G2) malloc arena lock - + After executing (M1), (F1), (G1), none of the threads can make progress. - + This commit changes the fork lock order to: - + (M'1) libio list lock (M'2) malloc arena locks - + It explicitly encodes the lock order in the implementations of fork, and does not rely on the registration order, thus avoiding the deadlock. @@ -36,7 +36,7 @@ Author: Florian Weimer Date: Thu Apr 14 12:53:03 2016 +0200 malloc: Add missing internal_function attributes on function definitions - + Fixes build on i386 after commit 29d794863cd6e03115d3670707cc873a9965ba92. Index: b/malloc/Makefile @@ -44,20 +44,20 @@ Index: b/malloc/Makefile --- a/malloc/Makefile +++ b/malloc/Makefile @@ -28,7 +28,7 @@ tests := mallocbug tst-malloc tst-valloc - tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ - tst-malloc-usable \ - tst-malloc-backtrace tst-malloc-thread-exit \ + tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ + tst-malloc-usable \ + tst-malloc-backtrace tst-malloc-thread-exit \ - tst-malloc-thread-fail + tst-malloc-thread-fail tst-malloc-fork-deadlock test-srcs = tst-mtrace - + routines = malloc morecore mcheck mtrace obstack @@ -49,6 +49,7 @@ $(objpfx)tst-malloc-thread-fail: $(commo - $(common-objpfx)nptl/libpthread_nonshared.a + $(common-objpfx)nptl/libpthread_nonshared.a $(objpfx)tst-malloc-thread-exit: $(common-objpfx)nptl/libpthread.so \ - $(common-objpfx)nptl/libpthread_nonshared.a + $(common-objpfx)nptl/libpthread_nonshared.a +$(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library) - + # These should be removed by `make clean'. extra-objs = mcheck-init.o libmcheck.a Index: b/malloc/arena.c @@ -65,20 +65,20 @@ Index: b/malloc/arena.c --- a/malloc/arena.c +++ b/malloc/arena.c @@ -162,10 +162,6 @@ static void (*save_free_hook) - const __malloc_ptr_t); + const __malloc_ptr_t); static void* save_arena; - + -#ifdef ATFORK_MEM -ATFORK_MEM; -#endif - /* Magic value for the thread-specific arena pointer when malloc_atfork() is in use. */ - + @@ -228,14 +224,15 @@ free_atfork(void* mem, const void *calle /* Counter for number of times the list is locked by the same thread. */ static unsigned int atfork_recursive_cntr; - + -/* The following two functions are registered via thread_atfork() to - make sure that the mutexes remain in a consistent state in the - fork()ed version of a thread. Also adapt the malloc and free hooks @@ -89,7 +89,7 @@ Index: b/malloc/arena.c + mechanism to make sure that our handlers are the last ones being + called, so that other fork handlers can use the malloc + subsystem. */ - + -static void -ptmalloc_lock_all (void) +void @@ -97,14 +97,14 @@ Index: b/malloc/arena.c +__malloc_fork_lock_parent (void) { mstate ar_ptr; - + @@ -243,7 +240,7 @@ ptmalloc_lock_all (void) return; - + /* We do not acquire free_list_lock here because we completely - reconstruct free_list in ptmalloc_unlock_all2. */ + reconstruct free_list in __malloc_fork_unlock_child. */ - + if (mutex_trylock(&list_lock)) { @@ -268,7 +265,7 @@ ptmalloc_lock_all (void) @@ -119,7 +119,7 @@ Index: b/malloc/arena.c @@ -276,8 +273,9 @@ ptmalloc_lock_all (void) ++atfork_recursive_cntr; } - + -static void -ptmalloc_unlock_all (void) +void @@ -127,7 +127,7 @@ Index: b/malloc/arena.c +__malloc_fork_unlock_parent (void) { mstate ar_ptr; - + @@ -286,8 +284,8 @@ ptmalloc_unlock_all (void) if (--atfork_recursive_cntr != 0) return; @@ -142,7 +142,7 @@ Index: b/malloc/arena.c @@ -299,15 +297,9 @@ ptmalloc_unlock_all (void) (void)mutex_unlock(&list_lock); } - + -# ifdef __linux__ - -/* In NPTL, unlocking a mutex in the child process after a @@ -157,11 +157,11 @@ Index: b/malloc/arena.c +__malloc_fork_unlock_child (void) { mstate ar_ptr; - + @@ -338,12 +330,6 @@ ptmalloc_unlock_all2 (void) atfork_recursive_cntr = 0; } - + -# else - -# define ptmalloc_unlock_all2 ptmalloc_unlock_all @@ -169,10 +169,10 @@ Index: b/malloc/arena.c -# endif - #endif /* !NO_THREADS */ - + /* Initialization routine. */ @@ -413,7 +399,6 @@ ptmalloc_init (void) - + tsd_key_create(&arena_key, NULL); tsd_setspecific(arena_key, (void *)&main_arena); - thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2); @@ -182,7 +182,7 @@ Index: b/malloc/arena.c @@ -487,12 +472,6 @@ ptmalloc_init (void) __malloc_initialized = 1; } - + -/* There are platforms (e.g. Hurd) with a link-time hook mechanism. */ -#ifdef thread_atfork_static -thread_atfork_static(ptmalloc_lock_all, ptmalloc_unlock_all, \ @@ -190,7 +190,7 @@ Index: b/malloc/arena.c -#endif - - + /* Managing heaps and arenas (for concurrent threads) */ @@ -827,7 +806,8 @@ _int_new_arena(size_t size) limit is reached). At this point, some arena has to be attached @@ -199,9 +199,9 @@ Index: b/malloc/arena.c - but this could result in a deadlock with ptmalloc_lock_all. */ + but this could result in a deadlock with + __malloc_fork_lock_parent. */ - + (void) mutex_lock (&a->mutex); - + Index: b/malloc/malloc-internal.h =================================================================== --- /dev/null @@ -246,9 +246,9 @@ Index: b/malloc/malloc.c @@ -291,6 +291,7 @@ __malloc_assert (const char *assertion, } #endif - + +#include - + /* INTERNAL_SIZE_T is the word-size used for internal bookkeeping Index: b/malloc/tst-malloc-fork-deadlock.c @@ -505,13 +505,13 @@ Index: b/nptl/sysdeps/unix/sysv/linux/fork.c #include - +#include - + unsigned long int *__fork_generation_pointer; - + @@ -116,6 +116,11 @@ __libc_fork (void) - + _IO_list_lock (); - + + /* Acquire malloc locks. This needs to come last because fork + handlers may use malloc, and the libio list lock has an indirect + malloc dependency as well (via the getdelim function). */ @@ -523,19 +523,20 @@ Index: b/nptl/sysdeps/unix/sysv/linux/fork.c @@ -172,6 +177,9 @@ __libc_fork (void) # endif #endif - + + /* Release malloc locks. */ + __malloc_fork_unlock_child (); + /* Reset the file list. These are recursive mutexes. */ fresetlockfiles (); - + @@ -213,6 +221,9 @@ __libc_fork (void) /* Restore the PID value. */ THREAD_SETMEM (THREAD_SELF, pid, parentpid); - + + /* Release malloc locks, parent process variant. */ + __malloc_fork_unlock_parent (); + /* We execute this even if the 'fork' call failed. */ _IO_list_unlock (); + diff --git a/SOURCES/glibc-rh906468-2.patch b/SOURCES/glibc-rh906468-2.patch index fefa7f15..30d37e0c 100644 --- a/SOURCES/glibc-rh906468-2.patch +++ b/SOURCES/glibc-rh906468-2.patch @@ -5,7 +5,7 @@ Author: Florian Weimer Date: Fri Aug 26 22:40:27 2016 +0200 malloc: Simplify static malloc interposition [BZ #20432] - + Existing interposed mallocs do not define the glibc-internal fork callbacks (and they should not), so statically interposed mallocs lead to link failures because the strong reference from @@ -23,7 +23,7 @@ index 836fec8c0681ae49..0f47900922d4099b 100644 @@ -119,6 +119,21 @@ # define weak_extern(symbol) _weak_extern (weak symbol) # define _weak_extern(expr) _Pragma (#expr) - + +/* In shared builds, the expression call_function_static_weak + (FUNCTION-SYMBOL, ARGUMENTS) invokes FUNCTION-SYMBOL (an + identifier) unconditionally, with the (potentially empty) argument @@ -39,17 +39,17 @@ index 836fec8c0681ae49..0f47900922d4099b 100644 + (func != NULL ? func (__VA_ARGS__) : (void)0); \ + }) +# endif - + #else /* __ASSEMBLER__ */ - + diff --git a/malloc/Makefile b/malloc/Makefile index bb7f455f79ea0be2..71883c2055b8067c 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -28,7 +28,16 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ - tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ - tst-malloc-usable \ - tst-malloc-backtrace tst-malloc-thread-exit \ + tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \ + tst-malloc-usable \ + tst-malloc-backtrace tst-malloc-thread-exit \ - tst-malloc-thread-fail tst-malloc-fork-deadlock + tst-malloc-thread-fail tst-malloc-fork-deadlock \ + tst-interpose-nothread \ @@ -62,12 +62,12 @@ index bb7f455f79ea0be2..71883c2055b8067c 100644 + tst-interpose-static-thread \ + test-srcs = tst-mtrace - + routines = malloc morecore mcheck mtrace obstack @@ -40,6 +49,15 @@ non-lib.a := libmcheck.a extra-libs = libmemusage extra-libs-others = $(extra-libs) - + +# Helper objects for some tests. +extra-tests-objs += \ + tst-interpose-aux-nothread.o \ @@ -79,11 +79,11 @@ index bb7f455f79ea0be2..71883c2055b8067c 100644 + libmemusage-routines = memusage libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes)) - + @@ -157,6 +175,13 @@ $(objpfx)libmemusage.so: $(common-objpfx)dlfcn/libdl.so # Extra dependencies $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c - + +$(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o +$(objpfx)tst-interpose-thread: \ + $(objpfx)tst-interpose-aux-thread.o $(shared-thread-library) @@ -793,24 +793,24 @@ index 9cc3ff8bf667817f..d404d135bc172555 100644 malloc dependency as well (via the getdelim function). */ - __malloc_fork_lock_parent (); + call_function_static_weak (__malloc_fork_lock_parent); - + #ifndef NDEBUG pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid); @@ -178,7 +178,7 @@ __libc_fork (void) #endif - + /* Release malloc locks. */ - __malloc_fork_unlock_child (); + call_function_static_weak (__malloc_fork_unlock_child); - + /* Reset the file list. These are recursive mutexes. */ fresetlockfiles (); @@ -222,7 +222,7 @@ __libc_fork (void) THREAD_SETMEM (THREAD_SELF, pid, parentpid); - + /* Release malloc locks, parent process variant. */ - __malloc_fork_unlock_parent (); + call_function_static_weak (__malloc_fork_unlock_parent); - + /* We execute this even if the 'fork' call failed. */ _IO_list_unlock (); diff --git a/SOURCES/glibc-rh911307-2.patch b/SOURCES/glibc-rh911307-2.patch index 5d52bbd7..3e6215e3 100644 --- a/SOURCES/glibc-rh911307-2.patch +++ b/SOURCES/glibc-rh911307-2.patch @@ -33,11 +33,12 @@ index 52a14fc..ad5b231 100644 @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ - + +#include_next "symbol-hacks.h" + /* A very dirty trick: gcc emits references to __divdi3, __udivdi3, __moddi3, and __umoddi3. These functions are exported and therefore we get PLTs. Unnecessarily so. Changing gcc is a big --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh911307-3.patch b/SOURCES/glibc-rh911307-3.patch index 783a6d7b..eff5f17a 100644 --- a/SOURCES/glibc-rh911307-3.patch +++ b/SOURCES/glibc-rh911307-3.patch @@ -27,7 +27,7 @@ index f3fe6b8..b34aac2 100644 @@ -69,6 +69,9 @@ /* Define if the compiler supports __builtin_memset. */ #undef HAVE_BUILTIN_MEMSET - + +/* Define if compiler accepts -ftree-loop-distribute-patterns. */ +#undef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL + @@ -48,8 +48,8 @@ index 8799b7d..99e85be 100755 gnu89_inline @@ -7164,6 +7165,38 @@ $as_echo "$libc_cv_cc_submachine" >&6; } fi - - + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ +__attribute__ ((__optimize__))" >&5 +$as_echo_n "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ @@ -92,7 +92,7 @@ index d369382..379e77a 100644 @@ -1928,6 +1928,24 @@ if test -n "$submachine"; then fi AC_SUBST(libc_cv_cc_submachine) - + +AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ +__attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl +cat > conftest.c < # Date: Thu, 4 Apr 2013 12:26:55 -0400 # Subject: [PATCH 4/4] Correct missed use of $(rtlddir). -# +# # --- # ChangeLog | 4 ++++ # Makerules | 2 +- # 2 files changed, 5 insertions(+), 1 deletion(-) -# +# # From bcce68c6dc678b443e7f140d664ba1fa49c0ceaa Mon Sep 17 00:00:00 2001 # From: Andreas Schwab # Date: Thu, 4 Apr 2013 12:23:43 -0400 # Subject: [PATCH 3/4] aarch64: Move rtld link to /lib -# +# # --- # ports/ChangeLog.aarch64 | 6 ++++++ # ports/sysdeps/unix/sysv/linux/aarch64/configure | 1 + # ports/sysdeps/unix/sysv/linux/aarch64/configure.in | 1 + # 3 files changed, 8 insertions(+) -# +# # From 05bc48a20b8c20574bc59a048750f0dd77fd6e23 Mon Sep 17 00:00:00 2001 # From: Andreas Schwab # Date: Thu, 4 Apr 2013 12:02:53 -0400 # Subject: [PATCH 1/4] aarch64: use lib64 as default lib and slib directory -# +# # --- # ports/ChangeLog.aarch64 | 6 ++++++ # ports/sysdeps/unix/sysv/linux/aarch64/configure | 13 +++++++++++++ # ports/sysdeps/unix/sysv/linux/aarch64/configure.in | 12 ++++++++++++ # 3 files changed, 31 insertions(+) -# +# # commit 446737706c186b33529a2c07fcb6f0cc10b2d1ea # Author: Andreas Schwab # Date: Tue Mar 19 10:13:46 2013 +0100 @@ -80,19 +80,19 @@ diff -urN glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure old_glibc_headers use_nscd @@ -7600,6 +7601,7 @@ - - - + + + + - - - + + + diff -urN glibc-2.17-c758a686/configure.in glibc-2.17-c758a686/configure.in --- glibc-2.17-c758a686/configure.in 2013-10-28 10:56:39.902320923 -0400 +++ glibc-2.17-c758a686/configure.in 2013-10-28 10:56:57.776317467 -0400 @@ -2127,6 +2127,7 @@ AC_SUBST(old_glibc_headers) - + AC_SUBST(libc_cv_slibdir) +AC_SUBST(libc_cv_rtlddir) AC_SUBST(libc_cv_localedir) @@ -109,53 +109,53 @@ diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile +install-others = $(inst_rtlddir)/$(rtld-installed-name) install-bin-script = ldd endif - + @@ -341,7 +341,7 @@ - | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' - + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' + # interp.c exists just to get this string into the libraries. -CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \ +CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \ - -DNOT_IN_libc=1 + -DNOT_IN_libc=1 $(objpfx)interp.os: $(common-objpfx)config.make - + @@ -373,18 +373,19 @@ - $(make-target-directory) - $(do-install-program) - + $(make-target-directory) + $(do-install-program) + -$(inst_slibdir)/$(rtld-installed-name): \ +$(inst_rtlddir)/$(rtld-installed-name): \ $(inst_slibdir)/$(rtld-version-installed-name) \ $(inst_slibdir)/libc-$(version).so + $(make-target-directory) - $(make-shlib-link) - + $(make-shlib-link) + # Special target called by parent to install just the dynamic linker. .PHONY: ldso_install -ldso_install: $(inst_slibdir)/$(rtld-installed-name) +ldso_install: $(inst_rtlddir)/$(rtld-installed-name) endif - - + + -common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ +common-ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ - -e 's%@VERSION@%$(version)%g' \ - -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ - -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' + -e 's%@VERSION@%$(version)%g' \ + -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ + -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' diff -urN glibc-2.17-c758a686/Makeconfig glibc-2.17-c758a686/Makeconfig --- glibc-2.17-c758a686/Makeconfig 2013-10-28 10:56:40.434320820 -0400 +++ glibc-2.17-c758a686/Makeconfig 2013-10-28 10:56:57.772317467 -0400 @@ -148,12 +148,18 @@ endif inst_libdir = $(install_root)$(libdir) - + -# Where to install the shared library and dynamic linker. +# Where to install the shared library. ifndef slibdir slibdir = $(exec_prefix)/lib endif inst_slibdir = $(install_root)$(slibdir) - + +# Where to install the dynamic linker. +ifndef rtlddir +rtlddir = $(slibdir) @@ -194,23 +194,23 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules +$(LN_S) `$(..)scripts/rellns-sh -p $< $@` $@ endef endif - + @@ -937,7 +937,7 @@ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ + '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ - ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ + ' AS_NEEDED (' $(rtlddir)/$(rtld-installed-name) ') )' \ - ) > $@.new - mv -f $@.new $@ - + ) > $@.new + mv -f $@.new $@ + diff -urN glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure 2013-10-28 10:56:39.873320928 -0400 +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure 2013-10-28 10:57:26.270311964 -0400 @@ -1,3 +1,17 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. - + arch_minimum_kernel=3.7.0 + +test -n "$libc_cv_slibdir" || @@ -230,7 +230,7 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure.in +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/configure.in 2013-10-28 10:57:49.162307556 -0400 @@ -2,3 +2,16 @@ # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. - + arch_minimum_kernel=3.7.0 + +test -n "$libc_cv_slibdir" || @@ -251,7 +251,7 @@ diff -urN glibc-2.17-c758a686/scripts/rellns-sh glibc-2.17-c758a686/scripts/rell @@ -16,8 +16,17 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . - + +# With -p, instead of creating the link print the computed relative link +# name. +do_print=false @@ -266,11 +266,11 @@ diff -urN glibc-2.17-c758a686/scripts/rellns-sh glibc-2.17-c758a686/scripts/rell + echo "Usage: rellns [-p] SOURCE DEST" >&2 exit 1 fi - + @@ -70,4 +79,8 @@ from=`echo $from | sed 's%^[^/]*/*%%'` done - + -ln -s $rfrom$to $2 +if $do_print; then + echo "$rfrom$to" diff --git a/SOURCES/glibc-rh952799.patch b/SOURCES/glibc-rh952799.patch index afbd06a7..625da589 100644 --- a/SOURCES/glibc-rh952799.patch +++ b/SOURCES/glibc-rh952799.patch @@ -6,14 +6,14 @@ # #2013-04-30 Patsy Franklin # -# * iconv/gconv_cache.c (find_module): Demangle init_fct before +# * iconv/gconv_cache.c (find_module): Demangle init_fct before # checking for NULL. Mangle __btowc_fct if init_fct is non-NULL. -# * iconv/gconv_db.c (free_derivation): Check that __shlib_handle +# * iconv/gconv_db.c (free_derivation): Check that __shlib_handle # is non-NULL before demangling the end_fct. Check for NULL # end_fct after demangling. -# (__gconv_release_step): Demangle the end_fct before checking +# (__gconv_release_step): Demangle the end_fct before checking # it for NULL. Remove assert on __shlibc_handle != NULL. -# (gen_steps): Don't check btowc_fct for NULL before mangling. +# (gen_steps): Don't check btowc_fct for NULL before mangling. # Demangle init_fct before checking for NULL. # (increment_counter): Likewise # * gconv_dl.c (__gconv_find_shlib): Don't check init_fct or @@ -26,7 +26,7 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_cache.c glibc-2.17-c758a686/iconv/gcon +++ glibc-2.17-c758a686/iconv/gconv_cache.c 2013-04-30 11:34:20.112389987 -0400 @@ -207,17 +207,16 @@ find_module (const char *directory, cons result->__data = NULL; - + /* Call the init function. */ - if (result->__init_fct != NULL) - { @@ -38,21 +38,21 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_cache.c glibc-2.17-c758a686/iconv/gcon #endif + if (init_fct != NULL) + { - status = DL_CALL_FCT (init_fct, (result)); - + status = DL_CALL_FCT (init_fct, (result)); + #ifdef PTR_MANGLE - if (result->__btowc_fct != NULL) - PTR_MANGLE (result->__btowc_fct); + PTR_MANGLE (result->__btowc_fct); #endif - } + } } diff -Nru glibc-2.17-c758a686/iconv/gconv_db.c glibc-2.17-c758a686/iconv/gconv_db.c --- glibc-2.17-c758a686/iconv/gconv_db.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/iconv/gconv_db.c 2013-04-30 11:32:42.700592914 -0400 @@ -179,16 +179,15 @@ free_derivation (void *p) size_t cnt; - + for (cnt = 0; cnt < deriv->nsteps; ++cnt) - if (deriv->steps[cnt].__counter > 0 - && deriv->steps[cnt].__end_fct != NULL) @@ -61,15 +61,15 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_db.c glibc-2.17-c758a686/iconv/gconv_d { - assert (deriv->steps[cnt].__shlib_handle != NULL); - - __gconv_end_fct end_fct = deriv->steps[cnt].__end_fct; + __gconv_end_fct end_fct = deriv->steps[cnt].__end_fct; #ifdef PTR_DEMANGLE - PTR_DEMANGLE (end_fct); + PTR_DEMANGLE (end_fct); #endif - DL_CALL_FCT (end_fct, (&deriv->steps[cnt])); + if (end_fct != NULL) + DL_CALL_FCT (end_fct, (&deriv->steps[cnt])); } - + /* Free the name strings. */ @@ -212,16 +211,12 @@ __gconv_release_step (struct __gconv_ste if (step->__shlib_handle != NULL && --step->__counter == 0) @@ -89,13 +89,13 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_db.c glibc-2.17-c758a686/iconv/gconv_d - } + if (end_fct != NULL) + DL_CALL_FCT (end_fct, (step)); - + #ifndef STATIC_GCONV /* Release the loaded module. */ @@ -293,13 +288,11 @@ gen_steps (struct derivation_step *best, - - /* Call the init function. */ - __gconv_init_fct init_fct = result[step_cnt].__init_fct; + + /* Call the init function. */ + __gconv_init_fct init_fct = result[step_cnt].__init_fct; - if (init_fct != NULL) - { - assert (result[step_cnt].__shlib_handle != NULL); @@ -106,23 +106,23 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_db.c glibc-2.17-c758a686/iconv/gconv_d # endif + if (init_fct != NULL) + { - status = DL_CALL_FCT (init_fct, (&result[step_cnt])); - - if (__builtin_expect (status, __GCONV_OK) != __GCONV_OK) + status = DL_CALL_FCT (init_fct, (&result[step_cnt])); + + if (__builtin_expect (status, __GCONV_OK) != __GCONV_OK) @@ -312,8 +305,7 @@ gen_steps (struct derivation_step *best, - } - + } + # ifdef PTR_MANGLE - if (result[step_cnt].__btowc_fct != NULL) - PTR_MANGLE (result[step_cnt].__btowc_fct); + PTR_MANGLE (result[step_cnt].__btowc_fct); # endif - } - } + } + } @@ -393,16 +385,15 @@ increment_counter (struct __gconv_step * - - /* Call the init function. */ - __gconv_init_fct init_fct = step->__init_fct; + + /* Call the init function. */ + __gconv_init_fct init_fct = step->__init_fct; - if (init_fct != NULL) - { #ifdef PTR_DEMANGLE @@ -131,22 +131,22 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_db.c glibc-2.17-c758a686/iconv/gconv_d #endif + if (init_fct != NULL) + { - DL_CALL_FCT (init_fct, (step)); - + DL_CALL_FCT (init_fct, (step)); + #ifdef PTR_MANGLE - if (step->__btowc_fct != NULL) - PTR_MANGLE (step->__btowc_fct); + PTR_MANGLE (step->__btowc_fct); #endif - } - } + } + } diff -Nru glibc-2.17-c758a686/iconv/gconv_dl.c glibc-2.17-c758a686/iconv/gconv_dl.c --- glibc-2.17-c758a686/iconv/gconv_dl.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/iconv/gconv_dl.c 2013-04-30 11:32:42.701592922 -0400 @@ -132,10 +132,8 @@ __gconv_find_shlib (const char *name) - + #ifdef PTR_MANGLE - PTR_MANGLE (found->fct); + PTR_MANGLE (found->fct); - if (found->init_fct != NULL) - PTR_MANGLE (found->init_fct); - if (found->end_fct != NULL) @@ -154,8 +154,8 @@ diff -Nru glibc-2.17-c758a686/iconv/gconv_dl.c glibc-2.17-c758a686/iconv/gconv_d + PTR_MANGLE (found->init_fct); + PTR_MANGLE (found->end_fct); #endif - - /* We have succeeded in loading the shared object. */ + + /* We have succeeded in loading the shared object. */ diff -Nru glibc-2.17-c758a686/wcsmbs/btowc.c glibc-2.17-c758a686/wcsmbs/btowc.c --- glibc-2.17-c758a686/wcsmbs/btowc.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/wcsmbs/btowc.c 2013-04-30 11:32:42.701592922 -0400 @@ -167,7 +167,7 @@ diff -Nru glibc-2.17-c758a686/wcsmbs/btowc.c glibc-2.17-c758a686/wcsmbs/btowc.c + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (btowc_fct); +#endif - + if (__builtin_expect (fcts->towc_nsteps == 1, 1) && __builtin_expect (btowc_fct != NULL, 1)) { diff --git a/SOURCES/glibc-rh958652.patch b/SOURCES/glibc-rh958652.patch index 31673f37..fefec922 100644 --- a/SOURCES/glibc-rh958652.patch +++ b/SOURCES/glibc-rh958652.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Tue May 21 21:54:41 2013 +0530 Set EAI_SYSTEM only when h_errno is NETDB_INTERNAL - + Fixes BZ #15339. - + NSS_STATUS_UNAVAIL may mean that a necessary input resource is not available. This could occur in a number of cases including when the network is down, system runs out of file descriptors, etc. The @@ -38,9 +38,9 @@ index ab135ad..7bb3ded 100644 --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c @@ -1036,7 +1036,15 @@ gaih_inet (const char *name, const struct gaih_service *service, - } - } - else + } + } + else - status = NSS_STATUS_UNAVAIL; + { + status = NSS_STATUS_UNAVAIL; @@ -51,18 +51,18 @@ index ab135ad..7bb3ded 100644 + if (errno != 0 && errno != ENOENT) + __set_h_errno (NETDB_INTERNAL); + } - } - - if (nss_next_action (nip, status) == NSS_ACTION_RETURN) + } + + if (nss_next_action (nip, status) == NSS_ACTION_RETURN) @@ -1050,7 +1058,7 @@ gaih_inet (const char *name, const struct gaih_service *service, - - _res.options |= old_res_options & RES_USE_INET6; - + + _res.options |= old_res_options & RES_USE_INET6; + - if (status == NSS_STATUS_UNAVAIL) + if (h_errno == NETDB_INTERNAL) - { - result = GAIH_OKIFUNSPEC | -EAI_SYSTEM; - goto free_and_return; + { + result = GAIH_OKIFUNSPEC | -EAI_SYSTEM; + goto free_and_return; _______________________________________________ glibc mailing list glibc@lists.fedoraproject.org diff --git a/SOURCES/glibc-rh959034.patch b/SOURCES/glibc-rh959034.patch index ac18facc..aecacc48 100644 --- a/SOURCES/glibc-rh959034.patch +++ b/SOURCES/glibc-rh959034.patch @@ -11,32 +11,32 @@ index 110307b..f4aa215 100644 --- glibc-2.17-c758a686/intl/dcigettext.c +++ glibc-2.17-c758a686/intl/dcigettext.c @@ -638,6 +638,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) - retval = _nl_find_msg (domain->successor[cnt], binding, - msgid1, 1, &retlen); - + retval = _nl_find_msg (domain->successor[cnt], binding, + msgid1, 1, &retlen); + + /* Resource problems are not fatal, instead we return no + translation. */ + if (__builtin_expect (retval == (char *) -1, 0)) + goto no_translation; + - if (retval != NULL) - { - domain = domain->successor[cnt]; + if (retval != NULL) + { + domain = domain->successor[cnt]; @@ -941,6 +946,11 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp) - nullentry = - _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); - + nullentry = + _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); + + /* Resource problems are fatal. If we continue onwards we will + only attempt to calloc a new conv_tab and fail later. */ + if (__builtin_expect (nullentry == (char *) -1, 0)) + return (char *) -1; + - if (nullentry != NULL) - { - const char *charsetstr; + if (nullentry != NULL) + { + const char *charsetstr; @@ -1170,10 +1180,14 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp) - freemem_size = INITIAL_BLOCK_SIZE; - newmem = (transmem_block_t *) malloc (freemem_size); + freemem_size = INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) malloc (freemem_size); # ifdef _LIBC - /* Add the block to the list of blocks we have to free - at some point. */ @@ -51,8 +51,8 @@ index 110307b..f4aa215 100644 + } + /* Fall through and return -1. */ # endif - } - if (__builtin_expect (newmem == NULL, 0)) + } + if (__builtin_expect (newmem == NULL, 0)) diff --git glibc-2.17-c758a686/intl/loadmsgcat.c glibc-2.17-c758a686/intl/loadmsgcat.c index e4b7b38..ac90ed1 100644 --- glibc-2.17-c758a686/intl/loadmsgcat.c @@ -67,7 +67,7 @@ index e4b7b38..ac90ed1 100644 #ifdef HAVE_MMAP if (use_mmap) @@ -1257,6 +1257,11 @@ _nl_load_domain (domain_file, domainbinding) - + /* Get the header entry and look for a plural specification. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); + if (__builtin_expect (nullentry == (char *) -1, 0)) @@ -76,5 +76,5 @@ index e4b7b38..ac90ed1 100644 + goto invalid; + } EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); - + out: diff --git a/SOURCES/glibc-rh966259.patch b/SOURCES/glibc-rh966259.patch index 9f428d04..3473eaea 100644 --- a/SOURCES/glibc-rh966259.patch +++ b/SOURCES/glibc-rh966259.patch @@ -13,7 +13,7 @@ index 2a3c004..6c9fa86 100644 +++ glibc-2.17-c758a686/manual/errno.texi @@ -739,13 +739,14 @@ The user's disk quota was exceeded. @end deftypevr - + @comment errno.h -@comment BSD: Stale NFS file handle +@comment BSD: Stale file handle @@ -29,7 +29,7 @@ index 2a3c004..6c9fa86 100644 +Repairing this condition usually requires unmounting, possibly repairing +and remounting the file system. @end deftypevr - + @comment errno.h diff --git glibc-2.17-c758a686/sysdeps/gnu/errlist.c glibc-2.17-c758a686/sysdeps/gnu/errlist.c index e3d2faf..bbd45f2 100644 diff --git a/SOURCES/glibc-rh966633.patch b/SOURCES/glibc-rh966633.patch index f6f4b722..011a09b4 100644 --- a/SOURCES/glibc-rh966633.patch +++ b/SOURCES/glibc-rh966633.patch @@ -10,34 +10,34 @@ index 7099215..69e3e7d 100644 +++ glibc-2.17-c758a686/nscd/connections.c @@ -1779,7 +1779,7 @@ nscd_run_worker (void *p) else - { - /* Get the key. */ + { + /* Get the key. */ - char keybuf[MAXKEYLEN]; + char keybuf[MAXKEYLEN + 1]; - - if (__builtin_expect (TEMP_FAILURE_RETRY (read (fd, keybuf, - req.key_len)) + + if (__builtin_expect (TEMP_FAILURE_RETRY (read (fd, keybuf, + req.key_len)) @@ -1791,6 +1791,7 @@ nscd_run_worker (void *p) - strerror_r (errno, buf, sizeof (buf))); - goto close_and_out; - } + strerror_r (errno, buf, sizeof (buf))); + goto close_and_out; + } + keybuf[req.key_len] = '\0'; - - if (__builtin_expect (debug_level, 0) > 0) - { + + if (__builtin_expect (debug_level, 0) > 0) + { diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c index 2d6c5aa..dd06ce4 100644 --- glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c @@ -192,18 +192,26 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - const char *nuser = data.val.triple.user; - const char *ndomain = data.val.triple.domain; - + const char *nuser = data.val.triple.user; + const char *ndomain = data.val.triple.domain; + - if (data.val.triple.host > data.val.triple.user - || data.val.triple.user > data.val.triple.domain) + if (nhost == NULL || nuser == NULL || ndomain == NULL + || nhost > nuser || nuser > ndomain) - { + { - const char *last = MAX (nhost, - MAX (nuser, ndomain)); - size_t bufused = (last + strlen (last) + 1 @@ -54,32 +54,32 @@ index 2d6c5aa..dd06ce4 100644 + = (last == NULL + ? buffilled + : last + strlen (last) + 1 - buffer); - - /* We have to make temporary copies. */ + + /* We have to make temporary copies. */ - size_t hostlen = strlen (nhost) + 1; - size_t userlen = strlen (nuser) + 1; - size_t domainlen = strlen (ndomain) + 1; + size_t hostlen = strlen (nhost ?: "") + 1; + size_t userlen = strlen (nuser ?: "") + 1; + size_t domainlen = strlen (ndomain ?: "") + 1; - size_t needed = hostlen + userlen + domainlen; - - if (buflen - req->key_len - bufused < needed) + size_t needed = hostlen + userlen + domainlen; + + if (buflen - req->key_len - bufused < needed) @@ -226,11 +234,11 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - } - - nhost = memcpy (buffer + bufused, + } + + nhost = memcpy (buffer + bufused, - nhost, hostlen); + nhost ?: "", hostlen); - nuser = memcpy ((char *) nhost + hostlen, + nuser = memcpy ((char *) nhost + hostlen, - nuser, userlen); + nuser ?: "", userlen); - ndomain = memcpy ((char *) nuser + userlen, + ndomain = memcpy ((char *) nuser + userlen, - ndomain, domainlen); + ndomain ?: "", domainlen); - } - - char *wp = buffer + buffilled; + } + + char *wp = buffer + buffilled; diff --git glibc-2.17-c758a686/nscd/nscd_netgroup.c glibc-2.17-c758a686/nscd/nscd_netgroup.c index cac4ebf..acb2c81 100644 --- glibc-2.17-c758a686/nscd/nscd_netgroup.c @@ -90,6 +90,6 @@ index cac4ebf..acb2c81 100644 int nretries = 0; - size_t group_len = strlen (group); + size_t group_len = strlen (group) + 1; - + /* If the mapping is available, try to search there instead of communicating with the nscd. */ diff --git a/SOURCES/glibc-rh970791.patch b/SOURCES/glibc-rh970791.patch index be942683..6ae96ecd 100644 --- a/SOURCES/glibc-rh970791.patch +++ b/SOURCES/glibc-rh970791.patch @@ -23,8 +23,8 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c +++ glibc-2.17-c758a686/elf/dl-tls.c 2013-04-24 16:06:49.092604707 -0400 @@ -109,6 +109,28 @@ } - - + + +size_t +internal_function +_dl_count_modids (void) @@ -51,48 +51,48 @@ diff -urN glibc-2.17-c758a686/elf/dl-tls.c glibc-2.17-c758a686/elf/dl-tls.c void internal_function @@ -411,6 +433,7 @@ - - /* Keep track of the maximum generation number. This might - not be the generation counter. */ + + /* Keep track of the maximum generation number. This might + not be the generation counter. */ + assert (listp->slotinfo[cnt].gen <= GL(dl_tls_generation)); - maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); - - if (map->l_tls_offset == NO_TLS_OFFSET + maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); + + if (map->l_tls_offset == NO_TLS_OFFSET diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile --- glibc-2.17-c758a686/elf/Makefile 2013-04-24 16:06:10.408756448 -0400 +++ glibc-2.17-c758a686/elf/Makefile 2013-04-24 16:07:29.475457962 -0400 @@ -198,7 +200,7 @@ - tst-dlmodcount tst-dlopenrpath tst-deep1 \ - tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ - unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ + tst-dlmodcount tst-dlopenrpath tst-deep1 \ + tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ + unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ - tst-audit1 tst-audit2 tst-audit8 \ + tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ - tst-stackguard1 tst-addr1 tst-thrlock \ - tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ - tst-initorder tst-initorder2 tst-relsort1 + tst-stackguard1 tst-addr1 tst-thrlock \ + tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ + tst-initorder tst-initorder2 tst-relsort1 @@ -251,7 +253,8 @@ - unload8mod1 unload8mod1x unload8mod2 unload8mod3 \ - order2mod1 order2mod2 order2mod3 order2mod4 \ - tst-unique1mod1 tst-unique1mod2 \ + unload8mod1 unload8mod1x unload8mod2 unload8mod3 \ + order2mod1 order2mod2 order2mod3 order2mod4 \ + tst-unique1mod1 tst-unique1mod2 \ - tst-unique2mod1 tst-unique2mod2 \ + tst-unique2mod1 tst-unique2mod2 \ + tst-auditmod9a tst-auditmod9b \ - tst-unique3lib tst-unique3lib2 \ - tst-unique4lib \ - tst-initordera1 tst-initorderb1 \ + tst-unique3lib tst-unique3lib2 \ + tst-unique4lib \ + tst-initordera1 tst-initorderb1 \ @@ -574,6 +577,8 @@ ifuncmod1.so-no-z-defs = yes ifuncmod5.so-no-z-defs = yes ifuncmod6.so-no-z-defs = yes +tst-auditmod9a.so-no-z-defs = yes +tst-auditmod9b.so-no-z-defs = yes - + ifeq ($(build-shared),yes) # Build all the modules even when not actually running test programs. @@ -1015,6 +1020,10 @@ $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so - + +$(objpfx)tst-audit9: $(libdl) +$(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so +tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so @@ -104,9 +104,9 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c --- glibc-2.17-c758a686/elf/rtld.c 2013-04-24 16:06:10.410756438 -0400 +++ glibc-2.17-c758a686/elf/rtld.c 2013-04-24 16:06:49.096604693 -0400 @@ -1637,6 +1637,10 @@ - } + } } - + + /* Keep track of the currently loaded modules to count how many + non-audit modules which use TLS are loaded. */ + size_t count_modids = _dl_count_modids (); @@ -117,12 +117,12 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c @@ -2281,7 +2285,8 @@ # define NONTLS_INIT_TP do { } while (0) #endif - + - if (!was_tls_init_tp_called && GL(dl_tls_max_dtv_idx) > 0) + if ((!was_tls_init_tp_called && GL(dl_tls_max_dtv_idx) > 0) + || count_modids != _dl_count_modids ()) ++GL(dl_tls_generation); - + /* Now that we have completed relocation, the initializer data diff -urN glibc-2.17-c758a686/elf/tst-audit9.c glibc-2.17-c758a686/elf/tst-audit9.c --- glibc-2.17-c758a686/elf/tst-audit9.c 1969-12-31 19:00:00.000000000 -0500 @@ -172,9 +172,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/ldsodefs.h glibc-2.17-c758a686/sys @@ -1031,6 +1031,9 @@ /* Determine next available module ID. */ extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden; - + +/* Count the modules with TLS segments. */ +extern size_t _dl_count_modids (void) internal_function attribute_hidden; + /* Calculate offset of the TLS blocks in the static TLS block. */ extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden; + diff --git a/SOURCES/glibc-rh971416-1.patch b/SOURCES/glibc-rh971416-1.patch index 35995a97..cfcf8970 100644 --- a/SOURCES/glibc-rh971416-1.patch +++ b/SOURCES/glibc-rh971416-1.patch @@ -3,18 +3,18 @@ Author: Alexandre Oliva Date: Mon Nov 17 22:00:58 2014 -0200 BZ #15969: search locale archive again after alias expansion - + If a locale alias is defined in locale.alias but not in an archive, and the referenced locale is only present in the archive, setlocale will fail if given the alias name. This is unintuitive. This patch fixes it, arranging for the locale archive to be searched again after alias expansion. - + for ChangeLog - - [BZ #15969] - * locale/findlocale.c (_nl_find_locale): Retry archive search - after alias expansion. + + [BZ #15969] + * locale/findlocale.c (_nl_find_locale): Retry archive search + after alias expansion. Index: b/locale/findlocale.c =================================================================== @@ -22,8 +22,8 @@ Index: b/locale/findlocale.c +++ b/locale/findlocale.c @@ -156,15 +156,26 @@ _nl_find_locale (const char *locale_path if (__builtin_expect (data != NULL, 1)) - return data; - + return data; + + /* Nothing in the archive with the given name. Expanding it as + an alias and retry. */ + loc_name = (char *) _nl_expand_alias (*name); @@ -43,7 +43,7 @@ Index: b/locale/findlocale.c + an alias. Please note that this makes it impossible to have "C" + or "POSIX" as aliases. */ + loc_name = (char *) _nl_expand_alias (*name); - + - /* We really have to load some data. First see whether the name is - an alias. Please note that this makes it impossible to have "C" - or "POSIX" as aliases. */ diff --git a/SOURCES/glibc-rh971416-2.patch b/SOURCES/glibc-rh971416-2.patch index 9f892947..39368cc0 100644 --- a/SOURCES/glibc-rh971416-2.patch +++ b/SOURCES/glibc-rh971416-2.patch @@ -3,12 +3,12 @@ Author: Alexandre Oliva Date: Thu Feb 26 02:46:02 2015 -0300 Fix constness error just introduced in findlocale. - + for ChangeLog - - [BZ #15969] - * locale/findlocale.c (_nl_find_locale): Fix constness error in - the previous change. + + [BZ #15969] + * locale/findlocale.c (_nl_find_locale): Fix constness error in + the previous change. diff --git a/locale/findlocale.c b/locale/findlocale.c index 360f58b..5e2639b 100644 @@ -17,10 +17,10 @@ index 360f58b..5e2639b 100644 @@ -161,7 +161,8 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, loc_name = (char *) _nl_expand_alias (*name); if (loc_name != NULL) - { + { - data = _nl_load_locale_from_archive (category, &loc_name); + data = _nl_load_locale_from_archive (category, + (const char **) &loc_name); - if (__builtin_expect (data != NULL, 1)) - return data; - } + if (__builtin_expect (data != NULL, 1)) + return data; + } diff --git a/SOURCES/glibc-rh971416-3.patch b/SOURCES/glibc-rh971416-3.patch index 695ffe1c..958d68d5 100644 --- a/SOURCES/glibc-rh971416-3.patch +++ b/SOURCES/glibc-rh971416-3.patch @@ -3,12 +3,12 @@ Author: Alexandre Oliva Date: Fri Feb 27 22:18:56 2015 -0300 Avoid unsafe loc_name type casts with additional variable - + for ChangeLog - - [BZ #15969] - * locale/findlocale.c (_nl_find_locale): Introduce const - version of loc_name and drop unsafe type casts. + + [BZ #15969] + * locale/findlocale.c (_nl_find_locale): Introduce const + version of loc_name and drop unsafe type casts. diff --git a/locale/findlocale.c b/locale/findlocale.c index 5e2639b..9e7df12 100644 @@ -26,12 +26,12 @@ index 5e2639b..9e7df12 100644 @@ -113,39 +113,39 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, const char *normalized_codeset; struct loaded_l10nfile *locale_file; - + - if (loc_name[0] == '\0') + if (cloc_name[0] == '\0') { /* The user decides which locale to use by setting environment - variables. */ + variables. */ - loc_name = getenv ("LC_ALL"); - if (!name_present (loc_name)) - loc_name = getenv (_nl_category_names.str @@ -49,18 +49,18 @@ index 5e2639b..9e7df12 100644 + if (!name_present (cloc_name)) + cloc_name = _nl_C_name; } - + /* We used to fall back to the C locale if the name contains a slash character '/', but we now check for directory traversal in valid_locale_name, so this is no longer necessary. */ - + - if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0 - || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0) + if (__builtin_expect (strcmp (cloc_name, _nl_C_name), 1) == 0 + || __builtin_expect (strcmp (cloc_name, _nl_POSIX_name), 1) == 0) { /* We need not load anything. The needed data is contained in - the library itself. */ + the library itself. */ - *name = (char *) _nl_C_name; + *name = _nl_C_name; return _nl_C[category]; @@ -71,42 +71,43 @@ index 5e2639b..9e7df12 100644 __set_errno (EINVAL); return NULL; } - + - *name = loc_name; + *name = cloc_name; - + /* We really have to load some data. First we try the archive, but only if there was no LOCPATH environment variable specified. */ @@ -158,11 +158,10 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, - + /* Nothing in the archive with the given name. Expanding it as - an alias and retry. */ + an alias and retry. */ - loc_name = (char *) _nl_expand_alias (*name); - if (loc_name != NULL) + cloc_name = _nl_expand_alias (*name); + if (cloc_name != NULL) - { + { - data = _nl_load_locale_from_archive (category, - (const char **) &loc_name); + data = _nl_load_locale_from_archive (category, &cloc_name); - if (__builtin_expect (data != NULL, 1)) - return data; - } + if (__builtin_expect (data != NULL, 1)) + return data; + } @@ -175,14 +174,14 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, /* We really have to load some data. First see whether the name is an alias. Please note that this makes it impossible to have "C" or "POSIX" as aliases. */ - loc_name = (char *) _nl_expand_alias (*name); + cloc_name = _nl_expand_alias (*name); - + - if (loc_name == NULL) + if (cloc_name == NULL) /* It is no alias. */ - loc_name = (char *) *name; + cloc_name = *name; - + /* Make a writable copy of the locale name. */ - loc_name = strdupa (loc_name); + char *loc_name = strdupa (cloc_name); - + /* LOCALE can consist of up to four recognized parts for the XPG syntax: + diff --git a/SOURCES/glibc-rh971589.patch b/SOURCES/glibc-rh971589.patch index 7aa329d0..b2c10faf 100644 --- a/SOURCES/glibc-rh971589.patch +++ b/SOURCES/glibc-rh971589.patch @@ -13,7 +13,7 @@ @@ -30,8 +30,15 @@ and the other based on the Data Encryption Standard (DES) that is compatible with Unix systems. - + +@cindex AUTH_DES +@cindex FIPS 140-2 It also provides support for Secure RPC, and some library functions that @@ -24,13 +24,13 @@ +within @theglibc{}. It is recommended that Secure RPC should not be used +for systems that need to be FIPS 140-2 compliant since all forms of +supported authentication use normal DES. - + @menu * Legal Problems:: This software can get you locked up, or worse. @@ -203,6 +210,7 @@ @node DES Encryption @section DES Encryption - + +@cindex FIPS 46-3 The Data Encryption Standard is described in the US Government Federal Information Processing Standards (FIPS) 46-3 published by the National diff --git a/SOURCES/glibc-rh977110-2.patch b/SOURCES/glibc-rh977110-2.patch index f57e27b8..6596242a 100644 --- a/SOURCES/glibc-rh977110-2.patch +++ b/SOURCES/glibc-rh977110-2.patch @@ -15,9 +15,9 @@ index cda8491..e4ae630 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h @@ -32,6 +32,16 @@ extern void *__vdso_get_tbfreq; - + extern void *__vdso_getcpu; - + +/* 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 @@ -29,7 +29,7 @@ index cda8491..e4ae630 100644 +#endif + #endif - + #endif /* _LIBC_VDSO_H */ diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c index 7376135..4f4abbd 100644 @@ -38,17 +38,17 @@ index 7376135..4f4abbd 100644 @@ -15,26 +15,48 @@ License along with the GNU C Library; if not, see . */ - + -#include -#include -#include #include -#include -#include - + -#include +#ifdef SHARED - + -/* Get the current time of day and timezone information, - putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. - Returns 0 on success, -1 on errors. */ @@ -82,7 +82,7 @@ index 7376135..4f4abbd 100644 + +# include +# include - + int -__gettimeofday (tv, tz) - struct timeval *tv; @@ -97,5 +97,6 @@ index 7376135..4f4abbd 100644 +#endif weak_alias (__gettimeofday, gettimeofday) libc_hidden_weak (gettimeofday) --- +-- 1.7.11.7 + diff --git a/SOURCES/glibc-rh977110.patch b/SOURCES/glibc-rh977110.patch index 3f4f911a..3522ddbf 100644 --- a/SOURCES/glibc-rh977110.patch +++ b/SOURCES/glibc-rh977110.patch @@ -2,13 +2,13 @@ diff -pruN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h 2013-08-05 16:56:30.295860152 +0530 @@ -30,6 +30,8 @@ extern void *__vdso_clock_getres; - + extern void *__vdso_get_tbfreq; - + +extern void *__vdso_getcpu; + #endif - + #endif /* _LIBC_VDSO_H */ diff -pruN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c 2012-12-25 08:32:13.000000000 +0530 @@ -18,17 +18,17 @@ diff -pruN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/init-first.c glib void *__vdso_clock_getres; void *__vdso_get_tbfreq; +void *__vdso_getcpu; - - + + static inline void @@ -41,6 +42,8 @@ _libc_vdso_platform_setup (void) __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615); - + __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615); + + __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); } - + # define VDSO_SETUP _libc_vdso_platform_setup diff -pruN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c 1970-01-01 05:30:00.000000000 +0530 diff --git a/SOURCES/glibc-rh977870.patch b/SOURCES/glibc-rh977870.patch index 87bb0a62..87931c74 100644 --- a/SOURCES/glibc-rh977870.patch +++ b/SOURCES/glibc-rh977870.patch @@ -3,15 +3,15 @@ Author: Siddhesh Poyarekar Date: Wed Apr 3 10:56:45 2013 +0530 Preserve errno across _PC_CHOWN_RESTRICTED call on XFS - + Fix BZ #15305. - + On kernel versions earlier than 2.6.29, the Linux kernel exported a sysctl called restrict_chown for xfs, which could be used to allow chown to users other than the owner. 2.6.29 removed this support, causing the open_not_cancel_2 to fail and thus modify errno. The fix is to save and restore errno so that the caller sees it as unmodified. - + Additionally, since the code to check the sysctl is not useful on newer kernels, we add an ifdef so that in future the code block gets rmeoved completely. @@ -37,7 +37,7 @@ index de91a45..723d234 100644 @@ -289,11 +289,16 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf) return -1; } - + +#if __ASSUME_XFS_RESTRICTED_CHOWN + return 1; +#else @@ -49,19 +49,19 @@ index de91a45..723d234 100644 case XFS_SUPER_MAGIC: + save_errno = errno; /* Read the value from /proc/sys/fs/xfs/restrict_chown. If we cannot - read it default to assume the restriction is in place. */ + read it default to assume the restriction is in place. */ fd = open_not_cancel_2 ("/proc/sys/fs/xfs/restrict_chown", O_RDONLY); @@ -306,6 +311,7 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf) - - close_not_cancel_no_status (fd); - } + + close_not_cancel_no_status (fd); + } + __set_errno (save_errno); break; - + default: @@ -313,4 +319,5 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf) } - + return retval; +#endif } diff --git a/SOURCES/glibc-rh977872.patch b/SOURCES/glibc-rh977872.patch index fe118b33..145d098b 100644 --- a/SOURCES/glibc-rh977872.patch +++ b/SOURCES/glibc-rh977872.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Thu Mar 7 12:15:08 2013 +0530 Remove PIPE_BUF Linux-specific code - + Fixes BZ #12723 - + The variable pipe buffer size does nothing to the value of PIPE_BUF, since the number of bytes that are atomically written is still PIPE_BUF on Linux. @@ -15,9 +15,9 @@ index 2cacd21..658c47e 100644 --- glibc-2.17-c758a686/posix/Makefile +++ glibc-2.17-c758a686/posix/Makefile @@ -86,7 +86,8 @@ tests := tstgetopt testfnm runtests runptests \ - tst-rfc3484-3 \ - tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ - bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ + tst-rfc3484-3 \ + tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ + bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ - bug-getopt5 tst-getopt_long1 bug-regex34 + bug-getopt5 tst-getopt_long1 bug-regex34 \ + tst-pathconf @@ -215,13 +215,13 @@ index c971644..e8c4dc9 100644 { struct statfs fsbuf; - int r; - + switch (name) { @@ -49,12 +48,6 @@ __fpathconf (fd, name) case _PC_CHOWN_RESTRICTED: return __statfs_chown_restricted (__fstatfs (fd, &fsbuf), &fsbuf); - + - case _PC_PIPE_BUF: - r = __fcntl (fd, F_GETPIPE_SZ); - if (r > 0) @@ -241,13 +241,13 @@ index edc691e..de91a45 100644 struct statfs fsbuf; - int fd; - int flags; - + switch (name) { @@ -56,21 +54,6 @@ __pathconf (const char *file, int name) case _PC_CHOWN_RESTRICTED: return __statfs_chown_restricted (__statfs (file, &fsbuf), &fsbuf); - + - case _PC_PIPE_BUF: - flags = O_RDONLY|O_NONBLOCK|O_NOCTTY; -#ifdef O_CLOEXEC diff --git a/SOURCES/glibc-rh977874.patch b/SOURCES/glibc-rh977874.patch index 8bff3c31..6f2e20e7 100644 --- a/SOURCES/glibc-rh977874.patch +++ b/SOURCES/glibc-rh977874.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Tue Feb 26 14:24:40 2013 +0530 Fix FPE in memusagestat when malloc utilization is zero - + [BZ #15160] - + Draw graphs for heap and stack only if MAXSIZE_HEAP and MAXSIZE_STACK are non-zero. @@ -14,7 +14,7 @@ index f561e0d..7bbd009 100644 --- glibc-2.17-c758a686/malloc/memusagestat.c +++ glibc-2.17-c758a686/malloc/memusagestat.c @@ -319,17 +319,26 @@ main (int argc, char *argv[]) - + for (line = 1; line <= 3; ++line) { - cnt = ((ysize - 40) * (maxsize_heap / 4 * line / heap_scale)) / @@ -49,21 +49,21 @@ index f561e0d..7bbd009 100644 + cnt2 = 0; + if (cnt != cnt2) - gdImageDashedLine (im_out, 40, ysize - 20 - cnt2, xsize - 40, - ysize - 20 - cnt2, green); + gdImageDashedLine (im_out, 40, ysize - 20 - cnt2, xsize - 40, + ysize - 20 - cnt2, green); @@ -372,7 +381,7 @@ main (int argc, char *argv[]) - ysize - 14, yellow); - previously = now; - + ysize - 14, yellow); + previously = now; + - if (also_total) + if (also_total && maxsize_heap > 0) - { - size_t new3; - + { + size_t new3; + @@ -386,21 +395,27 @@ main (int argc, char *argv[]) - last_total = new3; - } - + last_total = new3; + } + - // assert (entry.heap <= maxsize_heap); - new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40)) - * entry.heap) / maxsize_heap); @@ -100,22 +100,22 @@ index f561e0d..7bbd009 100644 + new[1], green); + last_stack = new[1]; + } - } - + } + cnt = 0; @@ -448,7 +463,7 @@ main (int argc, char *argv[]) - next_tick += MAX (1, total / 20); - } - + next_tick += MAX (1, total / 20); + } + - if (also_total) + if (also_total && maxsize_heap > 0) - { - size_t new3; - + { + size_t new3; + @@ -459,16 +474,24 @@ main (int argc, char *argv[]) - last_total = new3; - } - + last_total = new3; + } + - new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40)) - * entry.heap) / maxsize_heap); - gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red); @@ -128,7 +128,7 @@ index f561e0d..7bbd009 100644 + gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red); + last_heap = new[0]; + } - + - // assert (entry.stack <= maxsize_stack); - new[1] = (ysize - 20) - ((((unsigned long long int) (ysize - 40)) - * entry.stack) / maxsize_stack); @@ -143,6 +143,6 @@ index f561e0d..7bbd009 100644 + green); + last_stack = new[1]; + } - - last_xpos = xpos; - } + + last_xpos = xpos; + } diff --git a/SOURCES/glibc-rh977875.patch b/SOURCES/glibc-rh977875.patch index c0431f12..cf22dbfb 100644 --- a/SOURCES/glibc-rh977875.patch +++ b/SOURCES/glibc-rh977875.patch @@ -3,9 +3,9 @@ Author: Siddhesh Poyarekar Date: Wed Apr 10 11:31:46 2013 +0530 Accept leading and trailing spaces in getdate input string - + Fixes #15346. - + The POSIX description of getdate allows for extra spaces in the getdate input string. __getdate_r uses strptime internally, which works fine with extra spaces between format strings (and hence within @@ -22,13 +22,13 @@ index 637dd18..eadebc3 100644 #include +#include +#include - + #define TM_YEAR_BASE 1900 - + @@ -135,6 +137,44 @@ __getdate_r (const char *string, struct tm *tp) /* No threads reading this stream. */ __fsetlocking (fp, FSETLOCKING_BYCALLER); - + + /* Skip leading whitespace. */ + while (isspace (*string)) + string++; @@ -73,12 +73,12 @@ index 637dd18..eadebc3 100644 @@ -159,6 +199,8 @@ __getdate_r (const char *string, struct tm *tp) } while (!feof_unlocked (fp)); - + + free (instr); + /* Free the buffer. */ free (line); - + diff --git glibc-2.17-c758a686/time/tst-getdate.c glibc-2.17-c758a686/time/tst-getdate.c index 7604e83..dc8ecf4 100644 --- glibc-2.17-c758a686/time/tst-getdate.c diff --git a/SOURCES/glibc-rh977887-2.patch b/SOURCES/glibc-rh977887-2.patch index dedc5fd3..113bc167 100644 --- a/SOURCES/glibc-rh977887-2.patch +++ b/SOURCES/glibc-rh977887-2.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Jun 12 10:36:48 2013 +0530 Set/restore rounding mode only when needed - + The most common use case of math functions is with default rounding mode, i.e. rounding to nearest. Setting and restoring rounding mode is an unnecessary overhead for this, so I've added support for a @@ -12,35 +12,35 @@ Date: Wed Jun 12 10:36:48 2013 +0530 architectures should be unaffected by it, but would definitely benefit if the set/restore has as much overhead relative to the rest of the code, as the x86 bits do. - + Here's a summary of the performance improvement due to these improvements; I've only mentioned functions that use the set/restore and have benchmark inputs for x86_64: - + Before: - + cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy - + After: - + cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy - + So the improvements are: - + cos: 27.9089% exp: 22.6919% pow: 4.01564% sin: 19.1585% tan: 1.96086% - + The downside of the change is that it will have an adverse performance impact on non-default rounding modes, but I think the tradeoff is justified. @@ -53,13 +53,13 @@ index ed6d139..9f90d17 100644 #ifndef _FENV_H #include +#include - + #ifndef _ISOMAC /* Now define the internal interfaces. */ @@ -23,4 +24,13 @@ libm_hidden_proto (fetestexcept) libm_hidden_proto (feclearexcept) #endif - + +/* Rounding mode context. This allows functions to set/restore rounding mode + only when the desired rounding mode is different from the current rounding + mode. */ @@ -77,7 +77,7 @@ index e98360d..c0fc03d 100644 @@ -553,35 +553,62 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) # define libc_feresetround_noexl libc_fesetenvl #endif - + +#if HAVE_RM_CTX +/* Set/Restore Rounding Modes only when necessary. If defined, these functions + set/restore floating point state only if the state needed within the lexical @@ -112,7 +112,7 @@ index e98360d..c0fc03d 100644 +#endif + /* Save and restore the rounding mode within a lexical block. */ - + #define SET_RESTORE_ROUND(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround))); \ - libc_feholdsetround (&__libc_save_rm, (RM)) @@ -125,10 +125,10 @@ index e98360d..c0fc03d 100644 - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundl))); \ - libc_feholdsetroundl (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetroundl) - + /* Save and restore the rounding mode within a lexical block, and also the set of exceptions raised within the block may be discarded. */ - + #define SET_RESTORE_ROUND_NOEX(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noex))); \ - libc_feholdsetround (&__libc_save_rm, (RM)) @@ -141,14 +141,14 @@ index e98360d..c0fc03d 100644 - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexl))); \ - libc_feholdsetroundl (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetroundl, libc_feresetround_noexl) - + /* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits. */ #define SET_RESTORE_ROUND_53BIT(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_53bit))); \ - libc_feholdsetround_53bit (&__libc_save_rm, (RM)) + SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit, \ + libc_feresetround_53bit) - + #define __nan(str) \ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str)) diff --git glibc-2.17-c758a686/sysdeps/i386/fpu/fenv_private.h glibc-2.17-c758a686/sysdeps/i386/fpu/fenv_private.h @@ -158,7 +158,7 @@ index 1f8336c..3998387 100644 @@ -322,6 +322,179 @@ libc_feresetround_387 (fenv_t *e) # define libc_feholdsetround_53bit libc_feholdsetround_387_53bit #endif - + +/* We have support for rounding mode context. */ +#define HAVE_RM_CTX 1 + @@ -333,5 +333,5 @@ index 1f8336c..3998387 100644 +#endif + #undef __mxcsr - + #endif /* FENV_PRIVATE_H */ diff --git a/SOURCES/glibc-rh977887.patch b/SOURCES/glibc-rh977887.patch index 2d4c570f..3672d4ab 100644 --- a/SOURCES/glibc-rh977887.patch +++ b/SOURCES/glibc-rh977887.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Wed Jun 5 13:56:19 2013 +0530 Skip modifying exception mask and flags in SET_RESTORE_ROUND_53BIT - + We only need to set/restore rounding mode to ensure correct computation for non-default rounding modes. @@ -14,33 +14,33 @@ index 9d6ecad..e98360d 100644 @@ -446,8 +446,8 @@ default_libc_feholdexcept_setround (fenv_t *e, int r) # define libc_feholdexcept_setroundl default_libc_feholdexcept_setround #endif - + -#ifndef libc_feholdexcept_setround_53bit -# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround +#ifndef libc_feholdsetround_53bit +# define libc_feholdsetround_53bit libc_feholdsetround #endif - + #ifndef libc_fetestexcept @@ -492,8 +492,8 @@ default_libc_feupdateenv (fenv_t *e) # define libc_feupdateenvl default_libc_feupdateenv #endif - + -#ifndef libc_feupdateenv_53bit -# define libc_feupdateenv_53bit libc_feupdateenv +#ifndef libc_feresetround_53bit +# define libc_feresetround_53bit libc_feresetround #endif - + static __always_inline int @@ -580,8 +580,8 @@ default_libc_feupdateenv_test (fenv_t *e, int ex) - + /* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits. */ #define SET_RESTORE_ROUND_53BIT(RM) \ - fenv_t __libc_save_rm __attribute__((cleanup(libc_feupdateenv_53bit))); \ - libc_feholdexcept_setround_53bit (&__libc_save_rm, (RM)) + fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_53bit))); \ + libc_feholdsetround_53bit (&__libc_save_rm, (RM)) - + #define __nan(str) \ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str)) diff --git a/SOURCES/glibc-rh979363.patch b/SOURCES/glibc-rh979363.patch index eab6811c..391465a1 100644 --- a/SOURCES/glibc-rh979363.patch +++ b/SOURCES/glibc-rh979363.patch @@ -18,8 +18,8 @@ index 61b61b3..5f3dae7 100644 + ? write_not_cancel (f->_fileno, data, to_do) + : write (f->_fileno, data, to_do)); if (count < 0) - { - f->_flags |= _IO_ERR_SEEN; + { + f->_flags |= _IO_ERR_SEEN; @@ -1263,7 +1262,7 @@ _IO_new_file_write (f, data, n) n -= to_do; if (f->_offset >= 0) @@ -85,7 +85,7 @@ index 4a9d6ca..18dc6d0 100644 + simply did not manage to flush the buffer. But the data is in the + buffer and therefore written as far as fwrite is concerned. */ + if (written == request || written == EOF) - return count; + return count; - else if (written == EOF) - return 0; } @@ -129,10 +129,10 @@ index c8bcf5a..61d9dc2 100644 - if (__builtin_expect (d == EOF, 0)) \ + _IO_ssize_t written = _IO_padn (s, (Padchar), width); \ + if (__glibc_unlikely (written != width)) \ - { \ - done = -1; \ - goto all_done; \ - } \ + { \ + done = -1; \ + goto all_done; \ + } \ - done_add (d); \ + done_add (written); \ } \ @@ -146,12 +146,13 @@ index c8bcf5a..61d9dc2 100644 - if (__builtin_expect (d == EOF, 0)) \ + _IO_ssize_t written = _IO_wpadn (s, (Padchar), width); \ + if (__glibc_unlikely (written != width)) \ - { \ - done = -1; \ - goto all_done; \ - } \ + { \ + done = -1; \ + goto all_done; \ + } \ - done_add (d); \ + done_add (written); \ } \ } while (0) # define PUTC(C, F) _IO_putwc_unlocked (C, F) + diff --git a/SOURCES/glibc-rh980323.patch b/SOURCES/glibc-rh980323.patch index 1dd5146b..afea79b9 100644 --- a/SOURCES/glibc-rh980323.patch +++ b/SOURCES/glibc-rh980323.patch @@ -35,16 +35,16 @@ index d95c2d1..2309281 100644 + else + results = alloca (nresults * (sizeof (*results) + sizeof (size_t))); + order = (size_t *) (results + nresults); - + /* Now we definitely need the interface information. */ if (! check_pf_called) @@ -2664,6 +2680,9 @@ getaddrinfo (const char *name, const char *service, - + /* Fill in the canonical name into the new first entry. */ p->ai_canonname = canonname; + + if (malloc_results) + free (results); } - + __free_in6ai (in6ai); diff --git a/SOURCES/glibc-rh981332.patch b/SOURCES/glibc-rh981332.patch index f281ba37..20cffa04 100644 --- a/SOURCES/glibc-rh981332.patch +++ b/SOURCES/glibc-rh981332.patch @@ -4,7 +4,7 @@ diff -Nru glibc-2.17-c758a686/po/de.po glibc-2.17-c758a686/po/de.po @@ -6342,13 +6342,14 @@ msgstr "Zu viele Benutzer" msgid "Disk quota exceeded" msgstr "Der zugewiesene Plattenplatz (Quota) ist überschritten" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -19,7 +19,7 @@ diff -Nru glibc-2.17-c758a686/po/de.po glibc-2.17-c758a686/po/de.po -msgstr "Veraltete NFS-Dateizugriffsnummer" +msgid "Stale file handle" +msgstr "Veraltetes Datei-Handle" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/es.po glibc-2.17-c758a686/po/es.po @@ -43,7 +43,7 @@ diff -Nru glibc-2.17-c758a686/po/es.po glibc-2.17-c758a686/po/es.po -msgstr "`handle' de fichero NFS en desuso" +msgid "Stale file handle" +msgstr "Identificador de archivos obsoletos" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/fr.po glibc-2.17-c758a686/po/fr.po @@ -52,7 +52,7 @@ diff -Nru glibc-2.17-c758a686/po/fr.po glibc-2.17-c758a686/po/fr.po @@ -6236,13 +6236,14 @@ msgstr "Trop d'usagers" msgid "Disk quota exceeded" msgstr "Débordement du quota d'espace disque" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -67,7 +67,7 @@ diff -Nru glibc-2.17-c758a686/po/fr.po glibc-2.17-c758a686/po/fr.po -msgstr "Panne d'accès au fichier NFS" +msgid "Stale file handle" +msgstr "Gestionnaire de fichiers périmés" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/it.po glibc-2.17-c758a686/po/it.po @@ -76,7 +76,7 @@ diff -Nru glibc-2.17-c758a686/po/it.po glibc-2.17-c758a686/po/it.po @@ -6488,13 +6488,14 @@ msgstr "Troppi utenti" msgid "Disk quota exceeded" msgstr "Quota disco superata" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -91,7 +91,7 @@ diff -Nru glibc-2.17-c758a686/po/it.po glibc-2.17-c758a686/po/it.po -msgstr "Gestione del file NFS interrotta" +msgid "Stale file handle" +msgstr "Gestione file obsoleti" - + # lf #. TRANS An attempt was made to NFS-mount a remote file system with a file name that diff -Nru glibc-2.17-c758a686/po/ja.po glibc-2.17-c758a686/po/ja.po @@ -100,7 +100,7 @@ diff -Nru glibc-2.17-c758a686/po/ja.po glibc-2.17-c758a686/po/ja.po @@ -6060,13 +6060,14 @@ msgstr "ユーザが多すぎます" msgid "Disk quota exceeded" msgstr "ディスク使用量制限を超過しました" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -115,7 +115,7 @@ diff -Nru glibc-2.17-c758a686/po/ja.po glibc-2.17-c758a686/po/ja.po -msgstr "実効性のないNFSファイルハンドルです" +msgid "Stale file handle" +msgstr "古いファイルハンドルです" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/ko.po glibc-2.17-c758a686/po/ko.po @@ -124,7 +124,7 @@ diff -Nru glibc-2.17-c758a686/po/ko.po glibc-2.17-c758a686/po/ko.po @@ -6076,13 +6076,14 @@ msgstr "사용자가 너무 많음" msgid "Disk quota exceeded" msgstr "디스크 할당량이 초과됨" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -139,7 +139,7 @@ diff -Nru glibc-2.17-c758a686/po/ko.po glibc-2.17-c758a686/po/ko.po -msgstr "끊어진 NFS 파일 핸들" +msgid "Stale file handle" +msgstr "오래된 파일 처리" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/libc.pot glibc-2.17-c758a686/po/libc.pot @@ -148,7 +148,7 @@ diff -Nru glibc-2.17-c758a686/po/libc.pot glibc-2.17-c758a686/po/libc.pot @@ -6120,12 +6120,13 @@ msgstr "" msgid "Disk quota exceeded" msgstr "" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -162,7 +162,7 @@ diff -Nru glibc-2.17-c758a686/po/libc.pot glibc-2.17-c758a686/po/libc.pot -msgid "Stale NFS file handle" +msgid "Stale file handle" msgstr "" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that diff -Nru glibc-2.17-c758a686/po/pt_BR.po glibc-2.17-c758a686/po/pt_BR.po --- glibc-2.17-c758a686/po/pt_BR.po 2012-12-24 22:02:13.000000000 -0500 @@ -170,7 +170,7 @@ diff -Nru glibc-2.17-c758a686/po/pt_BR.po glibc-2.17-c758a686/po/pt_BR.po @@ -2287,13 +2287,14 @@ msgstr "Erro de Srmount" msgid "Stack fault" msgstr "Falha de pilha" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -186,7 +186,7 @@ diff -Nru glibc-2.17-c758a686/po/pt_BR.po glibc-2.17-c758a686/po/pt_BR.po +#: sysdeps/gnu/errlist.c:787 +msgid "Stale file handle" +msgstr "Manipulador de arquivo obsoleto" - + #: nscd/nscd.c:81 msgid "Start NUMBER threads" diff -Nru glibc-2.17-c758a686/po/ru.po glibc-2.17-c758a686/po/ru.po @@ -195,7 +195,7 @@ diff -Nru glibc-2.17-c758a686/po/ru.po glibc-2.17-c758a686/po/ru.po @@ -6243,13 +6243,14 @@ msgstr "Слишком много пол msgid "Disk quota exceeded" msgstr "Превышена дисковая квота" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -210,7 +210,7 @@ diff -Nru glibc-2.17-c758a686/po/ru.po glibc-2.17-c758a686/po/ru.po -msgstr "Устаревший дескриптор файла NFS" +msgid "Stale file handle" +msgstr "Устаревший дескриптор файла" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/zh_CN.po glibc-2.17-c758a686/po/zh_CN.po @@ -219,7 +219,7 @@ diff -Nru glibc-2.17-c758a686/po/zh_CN.po glibc-2.17-c758a686/po/zh_CN.po @@ -5519,13 +5519,14 @@ msgstr "用户过多" msgid "Disk quota exceeded" msgstr "超出磁盘限额" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -234,7 +234,7 @@ diff -Nru glibc-2.17-c758a686/po/zh_CN.po glibc-2.17-c758a686/po/zh_CN.po -msgstr "" +msgid "Stale file handle" +msgstr "失效文件句柄" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff -Nru glibc-2.17-c758a686/po/zh_TW.po glibc-2.17-c758a686/po/zh_TW.po @@ -243,7 +243,7 @@ diff -Nru glibc-2.17-c758a686/po/zh_TW.po glibc-2.17-c758a686/po/zh_TW.po @@ -6060,13 +6060,14 @@ msgstr "太多使用者" msgid "Disk quota exceeded" msgstr "硬碟 quota 滿了" - + -#. TRANS Stale NFS file handle. This indicates an internal confusion in the NFS -#. TRANS system which is due to file system rearrangements on the server host. -#. TRANS Repairing this condition usually requires unmounting and remounting @@ -258,6 +258,6 @@ diff -Nru glibc-2.17-c758a686/po/zh_TW.po glibc-2.17-c758a686/po/zh_TW.po -msgstr "過舊的 NFS 檔案控制碼" +msgid "Stale file handle" +msgstr "過舊的檔案處理" - + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. diff --git a/SOURCES/glibc-rh984828.patch b/SOURCES/glibc-rh984828.patch index f30faa98..fb3d185c 100644 --- a/SOURCES/glibc-rh984828.patch +++ b/SOURCES/glibc-rh984828.patch @@ -32,7 +32,7 @@ diff -Nru glibc-2.17-c758a686/config.h.in glibc-2.17-c758a686/config.h.in @@ -232,4 +232,7 @@ /* The ARM hard-float ABI is being used. */ #undef HAVE_ARM_PCS_VFP - + +/* The pt_chown binary is being built and used by grantpt. */ +#undef HAVE_PT_CHOWN + @@ -45,7 +45,7 @@ diff -Nru glibc-2.17-c758a686/config.make.in glibc-2.17-c758a686/config.make.in build-nscd = @build_nscd@ use-nscd = @use_nscd@ +build-pt-chown = @build_pt_chown@ - + # Build tools. CC = @CC@ diff -Nru glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure @@ -72,13 +72,13 @@ diff -Nru glibc-2.17-c758a686/configure glibc-2.17-c758a686/configure --disable-build-nscd disable building and installing the nscd daemon --disable-nscd library functions will not contact the nscd daemon + --enable-pt_chown Enable building and installing pt_chown - + Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3934,6 +3937,19 @@ else fi - - + + +# Check whether --enable-pt_chown was given. +if test "${enable_pt_chown+set}" = set; then : + enableval=$enable_pt_chown; build_pt_chown=$enableval @@ -99,9 +99,9 @@ diff -Nru glibc-2.17-c758a686/configure.in glibc-2.17-c758a686/configure.in --- glibc-2.17-c758a686/configure.in 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/configure.in 2013-07-24 00:20:07.658298658 -0400 @@ -315,6 +315,16 @@ AC_ARG_ENABLE([nscd], - [use_nscd=$enableval], - [use_nscd=yes]) - + [use_nscd=$enableval], + [use_nscd=yes]) + +AC_ARG_ENABLE([pt_chown], + [AS_HELP_STRING([--enable-pt_chown], + [Enable building and installing pt_chown])], @@ -121,7 +121,7 @@ diff -Nru glibc-2.17-c758a686/INSTALL glibc-2.17-c758a686/INSTALL @@ -128,6 +128,18 @@ will be used, and CFLAGS sets optimizati this can be prevented though there generally is no reason since it creates compatibility problems. - + +`--enable-pt_chown' + The file `pt_chown' is a helper binary for `grantpt' (*note + Pseudo-Terminals: Allocation.) that is installed setuid root to @@ -140,10 +140,10 @@ diff -Nru glibc-2.17-c758a686/INSTALL glibc-2.17-c758a686/INSTALL diff -Nru glibc-2.17-c758a686/login/Makefile glibc-2.17-c758a686/login/Makefile --- glibc-2.17-c758a686/login/Makefile 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/login/Makefile 2013-07-24 00:20:07.660298670 -0400 -@@ -29,9 +29,15 @@ routines := getutent getutent_r getutid - +@@ -29,9 +29,15 @@ routines := getutent getutent_r getutid + CFLAGS-grantpt.c = -DLIBEXECDIR='"$(libexecdir)"' - + -others = utmpdump pt_chown +others = utmpdump + @@ -154,16 +154,16 @@ diff -Nru glibc-2.17-c758a686/login/Makefile glibc-2.17-c758a686/login/Makefile others-pie = pt_chown install-others-programs = $(inst_libexecdir)/pt_chown +endif - + subdir-dirs = programs vpath %.c programs diff -Nru glibc-2.17-c758a686/manual/install.texi glibc-2.17-c758a686/manual/install.texi --- glibc-2.17-c758a686/manual/install.texi 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/manual/install.texi 2013-07-24 00:20:07.662298261 -0400 -@@ -155,6 +155,20 @@ if the used tools support it. By using +@@ -155,6 +155,20 @@ if the used tools support it. By using prevented though there generally is no reason since it creates compatibility problems. - + +@pindex pt_chown +@findex grantpt +@item --enable-pt_chown @@ -187,42 +187,42 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/grantpt.c glibc-2.17-c758a686/sysdeps @@ -173,9 +173,10 @@ grantpt (int fd) retval = 0; goto cleanup; - + - /* We have to use the helper program. */ + /* We have to use the helper program if it is available. */ helper:; - + +#ifdef HAVE_PT_CHOWN pid_t pid = __fork (); if (pid == -1) goto cleanup; @@ -190,9 +191,9 @@ grantpt (int fd) - if (__dup2 (fd, PTY_FILENO) < 0) - _exit (FAIL_EBADF); - + if (__dup2 (fd, PTY_FILENO) < 0) + _exit (FAIL_EBADF); + -#ifdef CLOSE_ALL_FDS +# ifdef CLOSE_ALL_FDS CLOSE_ALL_FDS (); -#endif +# endif - + execle (_PATH_PT_CHOWN, basename (_PATH_PT_CHOWN), NULL, NULL); _exit (FAIL_EXEC); @@ -231,6 +232,7 @@ grantpt (int fd) - assert(! "getpt: internal error: invalid exit code from pt_chown"); - } + assert(! "getpt: internal error: invalid exit code from pt_chown"); + } } +#endif - + cleanup: if (buf != _buf) diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/grantpt.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/grantpt.c --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/grantpt.c 2012-12-24 22:02:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/grantpt.c 2013-07-24 00:20:07.664298465 -0400 @@ -11,7 +11,7 @@ - + #include "pty-private.h" - + - +#if HAVE_PT_CHOWN /* Close all file descriptors except the one specified. */ @@ -235,5 +235,5 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/grantpt.c glibc-2.17-c758a -#define CLOSE_ALL_FDS() close_all_fds() +# define CLOSE_ALL_FDS() close_all_fds() +#endif - + #include diff --git a/SOURCES/glibc-rh988869.patch b/SOURCES/glibc-rh988869.patch index 75b8ce6a..bb73346b 100644 --- a/SOURCES/glibc-rh988869.patch +++ b/SOURCES/glibc-rh988869.patch @@ -3,7 +3,7 @@ Author: Florian Weimer Date: Wed Nov 30 14:59:27 2016 +0100 libio: Limit buffer size to 8192 bytes [BZ #4099] - + This avoids overly large buffers with network file systems which report very large block sizes. @@ -12,11 +12,11 @@ Index: b/libio/filedoalloc.c --- a/libio/filedoalloc.c +++ b/libio/filedoalloc.c @@ -121,7 +121,7 @@ _IO_file_doallocate (fp) - fp->_flags |= _IO_LINE_BUF; - } + fp->_flags |= _IO_LINE_BUF; + } #if _IO_HAVE_ST_BLKSIZE - if (st.st_blksize > 0) + if (st.st_blksize > 0 && st.st_blksize < _IO_BUFSIZ) - size = st.st_blksize; + size = st.st_blksize; #endif } diff --git a/SOURCES/glibc-rh989861.patch b/SOURCES/glibc-rh989861.patch index 7b05360d..08f4cb66 100644 --- a/SOURCES/glibc-rh989861.patch +++ b/SOURCES/glibc-rh989861.patch @@ -11,7 +11,7 @@ index 1be6874..cbe5962 100644 @@ -524,6 +524,14 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) memset (&seq1, 0, sizeof (seq1)); seq2 = seq1; - + + size_t size_max = SIZE_MAX / (sizeof (int32_t) + 1); + + /* If the strings are long enough to cause overflow in the size request, then @@ -26,10 +26,10 @@ index 1be6874..cbe5962 100644 @@ -546,8 +554,10 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) seq2.rulearr = (unsigned char *) alloca (s2len); } - + - int rule = 0; + int rule; - + + begin_collate: + rule = 0; /* Cache values in the first pass and if needed, use them in subsequent diff --git a/SOURCES/glibc-rh989862-2.patch b/SOURCES/glibc-rh989862-2.patch index 4b1f1af3..9f0218ce 100644 --- a/SOURCES/glibc-rh989862-2.patch +++ b/SOURCES/glibc-rh989862-2.patch @@ -3,7 +3,7 @@ Author: Siddhesh Poyarekar Date: Sun Jun 30 20:45:05 2013 +0530 Fall back to non-cached sequence traversal and comparison - + strcoll currently falls back to alloca if malloc fails, resulting in a possible stack overflow. This patch implements sequence traversal and comparison without caching indeces and rules. @@ -23,12 +23,12 @@ index 1bb9e23..1be6874 100644 + sequence. */ + const USTRING_TYPE *back_us; /* Beginning of the backward sequence. */ } coll_seq; - + /* Get next sequence. The weight indeces are cached, so we don't need to @@ -227,7 +233,191 @@ get_next_seq (coll_seq *seq, int nrules, const unsigned char *rulesets, seq->us = us; } - + -/* Compare two sequences. */ +/* Get next sequence. Traverse the string as required. This function does not + set or use any index or rule cache. */ @@ -217,11 +217,11 @@ index 1bb9e23..1be6874 100644 +/* Compare two sequences using the index cache. */ static int do_compare (coll_seq *seq1, coll_seq *seq2, int position, - const USTRING_TYPE *weights) + const USTRING_TYPE *weights) @@ -334,57 +524,62 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) memset (&seq1, 0, sizeof (seq1)); seq2 = seq1; - + - /* We need the elements of the strings as unsigned values since they - are used as indeces. */ - seq1.us = (const USTRING_TYPE *) s1; @@ -262,10 +262,10 @@ index 1bb9e23..1be6874 100644 seq1.rulearr = (unsigned char *) alloca (s1len); seq2.rulearr = (unsigned char *) alloca (s2len); } - + - seq1.rulearr[0] = 0; + int rule = 0; - + /* Cache values in the first pass and if needed, use them in subsequent passes. */ for (int pass = 0; pass < nrules; ++pass) @@ -278,19 +278,19 @@ index 1bb9e23..1be6874 100644 seq2.idxcnt = 0; seq2.backw_stop = ~0ul; seq2.backw = ~0ul; - + + /* We need the elements of the strings as unsigned values since they + are used as indeces. */ + seq1.us = (const USTRING_TYPE *) s1; + seq2.us = (const USTRING_TYPE *) s2; + /* We assume that if a rule has defined `position' in one section - this is true for all of them. */ + this is true for all of them. */ - int position = rulesets[seq1.rulearr[0] * nrules + pass] & sort_position; + int position = rulesets[rule * nrules + pass] & sort_position; - + while (1) - { + { - if (pass == 0) + if (__glibc_unlikely (seq1.idxarr == NULL)) + { @@ -300,26 +300,26 @@ index 1bb9e23..1be6874 100644 + extra, indirect, pass); + } + else if (pass == 0) - { - get_next_seq (&seq1, nrules, rulesets, weights, table, extra, - indirect); + { + get_next_seq (&seq1, nrules, rulesets, weights, table, extra, + indirect); @@ -411,10 +606,18 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) - goto free_and_return; - } - + goto free_and_return; + } + - result = do_compare (&seq1, &seq2, position, weights); + if (__glibc_unlikely (seq1.idxarr == NULL)) + result = do_compare_nocache (&seq1, &seq2, position, weights); + else + result = do_compare (&seq1, &seq2, position, weights); - if (result != 0) - goto free_and_return; - } + if (result != 0) + goto free_and_return; + } + + if (__glibc_likely (seq1.rulearr != NULL)) + rule = seq1.rulearr[0]; + else + rule = seq1.rule; } - + /* Free the memory if needed. */ diff --git a/SOURCES/glibc-rh989862-3.patch b/SOURCES/glibc-rh989862-3.patch index 75b5e491..be8fbe71 100644 --- a/SOURCES/glibc-rh989862-3.patch +++ b/SOURCES/glibc-rh989862-3.patch @@ -9,7 +9,7 @@ index fb6c959..1eee54e 100644 --- glibc-2.17-c758a686/misc/sys/cdefs.h +++ glibc-2.17-c758a686/misc/sys/cdefs.h @@ -378,8 +378,10 @@ - + #if __GNUC__ >= 3 # define __glibc_unlikely(cond) __builtin_expect((cond), 0) +# define __glibc_likely(cond) __builtin_expect((cond), 1) @@ -17,5 +17,5 @@ index fb6c959..1eee54e 100644 # define __glibc_unlikely(cond) (cond) +# define __glibc_likely(cond) (cond) #endif - + #include diff --git a/SOURCES/glibc-rh989862.patch b/SOURCES/glibc-rh989862.patch index 0d2003fc..7953b038 100644 --- a/SOURCES/glibc-rh989862.patch +++ b/SOURCES/glibc-rh989862.patch @@ -9,9 +9,9 @@ index ecda08f..1bb9e23 100644 --- glibc-2.17-c758a686/string/strcoll_l.c +++ glibc-2.17-c758a686/string/strcoll_l.c @@ -41,11 +41,244 @@ - + #include "../locale/localeinfo.h" - + +/* Track status while looking for sequences in a string. */ +typedef struct +{ @@ -289,7 +289,7 @@ index ecda08f..1bb9e23 100644 - int use_malloc; - -#include WEIGHT_H - + if (nrules == 0) return STRCMP (s1, s2); @@ -98,7 +303,6 @@ STRCOLL (s1, s2, l) @@ -297,23 +297,23 @@ index ecda08f..1bb9e23 100644 indirect = (const int32_t *) current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string; - use_malloc = 0; - + assert (((uintptr_t) table) % __alignof__ (table[0]) == 0); assert (((uintptr_t) weights) % __alignof__ (weights[0]) == 0); @@ -106,18 +310,13 @@ STRCOLL (s1, s2, l) assert (((uintptr_t) indirect) % __alignof__ (indirect[0]) == 0); - + /* We need this a few times. */ - s1len = STRLEN (s1); - s2len = STRLEN (s2); + size_t s1len = STRLEN (s1); + size_t s2len = STRLEN (s2); - + /* Catch empty strings. */ - if (__builtin_expect (s1len == 0, 0) || __builtin_expect (s2len == 0, 0)) + if (__glibc_unlikely (s1len == 0) || __glibc_unlikely (s2len == 0)) return (s1len != 0) - (s2len != 0); - + - /* We need the elements of the strings as unsigned values since they - are used as indeces. */ - us1 = (const USTRING_TYPE *) s1; @@ -323,7 +323,7 @@ index ecda08f..1bb9e23 100644 and store the weights for each character. Since we want this to be as fast as possible we are using `alloca' to store the temporary @@ -127,14 +326,27 @@ STRCOLL (s1, s2, l) - + Please note that the localedef programs makes sure that `position' is not used at the first level. */ + @@ -349,16 +349,16 @@ index ecda08f..1bb9e23 100644 + seq2.idxarr = &seq1.idxarr[s1len]; + seq1.rulearr = (unsigned char *) &seq2.idxarr[s2len]; + seq2.rulearr = &seq1.rulearr[s1len]; - + - if (idx1arr == NULL) + if (seq1.idxarr == NULL) - /* No memory. Well, go with the stack then. - - XXX Once this implementation is stable we will handle this + /* No memory. Well, go with the stack then. + + XXX Once this implementation is stable we will handle this @@ -142,396 +354,73 @@ STRCOLL (s1, s2, l) - do this in time. This means, though, that this happens for - every pass again. */ - goto try_stack; + do this in time. This means, though, that this happens for + every pass again. */ + goto try_stack; - use_malloc = 1; + use_malloc = true; } @@ -374,7 +374,7 @@ index ecda08f..1bb9e23 100644 + seq1.rulearr = (unsigned char *) alloca (s1len); + seq2.rulearr = (unsigned char *) alloca (s2len); } - + - idx1cnt = 0; - idx2cnt = 0; - idx1max = 0; @@ -531,7 +531,7 @@ index ecda08f..1bb9e23 100644 - goto free_and_return; - } + seq1.rulearr[0] = 0; - + - /* Test for position if necessary. */ - if (position && val1 != val2) - { @@ -580,7 +580,7 @@ index ecda08f..1bb9e23 100644 + seq2.backw = ~0ul; + /* We assume that if a rule has defined `position' in one section - this is true for all of them. */ + this is true for all of them. */ - idx1cnt = 0; - idx2cnt = 0; - backw1_stop = ~0ul; @@ -589,9 +589,9 @@ index ecda08f..1bb9e23 100644 - backw2 = ~0ul; - position = rulesets[rule1arr[0] * nrules + pass] & sort_position; + int position = rulesets[seq1.rulearr[0] * nrules + pass] & sort_position; - + while (1) - { + { - val1 = 0; - val2 = 0; - @@ -724,24 +724,24 @@ index ecda08f..1bb9e23 100644 + get_next_seq_cached (&seq1, nrules, pass, rulesets, weights); + get_next_seq_cached (&seq2, nrules, pass, rulesets, weights); + } - - /* See whether any or both strings are empty. */ + + /* See whether any or both strings are empty. */ - if (seq1len == 0 || seq2len == 0) + if (seq1.len == 0 || seq2.len == 0) - { + { - if (seq1len == seq2len) + if (seq1.len == seq2.len) - /* Both ended. So far so good, both strings are equal - at this level. */ - break; - - /* This means one string is shorter than the other. Find out - which one and return an appropriate value. */ + /* Both ended. So far so good, both strings are equal + at this level. */ + break; + + /* This means one string is shorter than the other. Find out + which one and return an appropriate value. */ - result = seq1len == 0 ? -1 : 1; + result = seq1.len == 0 ? -1 : 1; - goto free_and_return; - } - + goto free_and_return; + } + - /* Test for position if necessary. */ - if (position && val1 != val2) - { @@ -777,14 +777,14 @@ index ecda08f..1bb9e23 100644 + result = do_compare (&seq1, &seq2, position, weights); + if (result != 0) + goto free_and_return; - } + } } - + /* Free the memory if needed. */ free_and_return: if (use_malloc) - free (idx1arr); + free (seq1.idxarr); - + return result; } diff --git a/SOURCES/glibc-rh990388-2.patch b/SOURCES/glibc-rh990388-2.patch index 851d4f8e..09fffa4a 100644 --- a/SOURCES/glibc-rh990388-2.patch +++ b/SOURCES/glibc-rh990388-2.patch @@ -16,7 +16,7 @@ diff -pruN glibc-2.17-c758a686/csu/libc-start.c glibc-2.17-c758a686/csu/libc-sta we need to setup errno. */ - __pthread_initialize_minimal (); + __pthread_initialize_minimal (argc, argv, __environ); - + /* Set up the stack checker's canary. */ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random); diff -pruN glibc-2.17-c758a686/csu/libc-tls.c glibc-2.17-c758a686/csu/libc-tls.c @@ -35,18 +35,18 @@ diff -pruN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686/nptl/Makefile 2013-07-30 11:46:34.909902026 +0530 +++ glibc-2.17-c758a686/nptl/Makefile 2013-07-30 11:46:44.573901690 +0530 @@ -201,7 +201,7 @@ CFLAGS-pt-system.c = -fexceptions - - + + tests = tst-typesizes \ - tst-attr1 tst-attr2 tst-attr3 \ + tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ - tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \ - tst-mutex7 tst-mutex8 tst-mutex9 tst-mutex5a tst-mutex7a \ - tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \ + tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \ + tst-mutex7 tst-mutex8 tst-mutex9 tst-mutex5a tst-mutex7a \ + tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \ @@ -276,6 +276,13 @@ gen-as-const-headers = pthread-errnos.sy - + LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst - + +# The size is 1MB + 4KB. The extra 4KB has been added to prevent allocatestack +# from resizing the input size to avoid the 64K aliasing conflict on Intel +# processors. @@ -55,7 +55,7 @@ diff -pruN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile +tst-default-attr-ENV = GLIBC_PTHREAD_STACKSIZE=$(DEFAULT_STACKSIZE) + include ../Makeconfig - + ifeq ($(have-forced-unwind),yes) diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-init.c --- glibc-2.17-c758a686/nptl/nptl-init.c 2013-07-30 11:46:35.112902019 +0530 @@ -65,13 +65,13 @@ diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-in #include #include +#include - - + + /* Size and alignment of static TLS block. */ @@ -276,8 +277,28 @@ extern void **__libc_dl_error_tsd (void) /* This can be set by the debugger before initialization is complete. */ static bool __nptl_initial_report_events __attribute_used__; - + +/* Validate and set the default stacksize. */ +static void +set_default_stacksize (size_t stacksize) @@ -99,9 +99,9 @@ diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-in #ifndef SHARED /* Unlike in the dynamically linked case the dynamic linker has not @@ -401,29 +422,44 @@ __pthread_initialize_minimal_internal (v - + __static_tls_size = roundup (__static_tls_size, static_tls_align); - + - /* Determine the default allowed stack size. This is the size used - in case the user does not specify one. */ - struct rlimit limit; @@ -116,8 +116,8 @@ diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-in - limit.rlim_cur = PTHREAD_STACK_MIN; + /* Initialize the environment. libc.so gets initialized after us due to a + circular dependency and hence __environ is not available otherwise. */ -+ __environ = envp; - ++ __environ = envp; + - /* Make sure it meets the minimum size that allocate_stack - (allocatestack.c) will demand, which depends on the page size. */ - const uintptr_t pagesz = GLRO(dl_pagesize); @@ -127,7 +127,7 @@ diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-in +#ifndef SHARED + __libc_init_secure (); +#endif - + - /* Round the resource limit up to page size. */ - limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz; - __default_pthread_attr.stacksize = limit.rlim_cur; @@ -162,7 +162,7 @@ diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-in + not specify a stack size during thread creation. */ + set_default_stacksize (stacksize); __default_pthread_attr.guardsize = GLRO (dl_pagesize); - + #ifdef SHARED diff -pruN glibc-2.17-c758a686/nptl/tst-default-attr.c glibc-2.17-c758a686/nptl/tst-default-attr.c --- glibc-2.17-c758a686/nptl/tst-default-attr.c 1970-01-01 05:30:00.000000000 +0530 diff --git a/SOURCES/glibc-rh990388-3.patch b/SOURCES/glibc-rh990388-3.patch index db3eff36..4d4f3953 100644 --- a/SOURCES/glibc-rh990388-3.patch +++ b/SOURCES/glibc-rh990388-3.patch @@ -2,11 +2,11 @@ diff -pruN glibc-2.17-c758a686/nptl/pt-crti.S glibc-2.17-c758a686/nptl/pt-crti.S --- glibc-2.17-c758a686/nptl/pt-crti.S 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/pt-crti.S 2013-07-30 15:53:08.416386853 +0530 @@ -39,5 +39,6 @@ - + #define PREINIT_FUNCTION __pthread_initialize_minimal_internal #define PREINIT_FUNCTION_WEAK 0 +#define PREINIT_FUNCTION_HAS_ARGS 1 - + #include diff -pruN glibc-2.17-c758a686/sysdeps/i386/crti.S glibc-2.17-c758a686/sysdeps/i386/crti.S --- glibc-2.17-c758a686/sysdeps/i386/crti.S 2012-12-25 08:32:13.000000000 +0530 @@ -14,7 +14,7 @@ diff -pruN glibc-2.17-c758a686/sysdeps/i386/crti.S glibc-2.17-c758a686/sysdeps/i @@ -49,6 +49,13 @@ # define PREINIT_FUNCTION_WEAK 1 #endif - + +/* If the preinit function takes the argc, argv and envp arguments, push them + again on top before making the call. This is only used by for pt-crti for + nptl. */ @@ -23,12 +23,12 @@ diff -pruN glibc-2.17-c758a686/sysdeps/i386/crti.S glibc-2.17-c758a686/sysdeps/i +#endif + #if PREINIT_FUNCTION_WEAK - weak_extern (PREINIT_FUNCTION) + weak_extern (PREINIT_FUNCTION) #else @@ -64,6 +68,18 @@ _init: - /* Maintain 16-byte stack alignment for called functions. */ - subl $8, %esp - LOAD_PIC_REG (bx) + /* Maintain 16-byte stack alignment for called functions. */ + subl $8, %esp + LOAD_PIC_REG (bx) +#if PREINIT_FUNCTION_HAS_ARGS +/* Get argc, argv and envp from the stack and push them again on top so that + the called function can access them. Maintain 16-byte alignment for value @@ -42,15 +42,15 @@ diff -pruN glibc-2.17-c758a686/sysdeps/i386/crti.S glibc-2.17-c758a686/sysdeps/i + pushl %eax +#endif #if PREINIT_FUNCTION_WEAK - movl PREINIT_FUNCTION@GOT(%ebx), %eax - testl %eax, %eax + movl PREINIT_FUNCTION@GOT(%ebx), %eax + testl %eax, %eax @@ -73,6 +89,9 @@ _init: #else - call PREINIT_FUNCTION + call PREINIT_FUNCTION #endif +#if PREINIT_FUNCTION_HAS_ARGS + addl $16, %esp +#endif - - .section .fini,"ax",@progbits - .p2align 2 + + .section .fini,"ax",@progbits + .p2align 2 diff --git a/SOURCES/glibc-rh990388-4.patch b/SOURCES/glibc-rh990388-4.patch index 36c0cb4e..7894f6cd 100644 --- a/SOURCES/glibc-rh990388-4.patch +++ b/SOURCES/glibc-rh990388-4.patch @@ -2,9 +2,9 @@ diff -pruN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile --- glibc-2.17-c758a686/nptl/Makefile 2013-07-31 11:51:24.882747234 +0530 +++ glibc-2.17-c758a686/nptl/Makefile 2013-07-31 11:58:55.964731526 +0530 @@ -276,10 +276,7 @@ gen-as-const-headers = pthread-errnos.sy - + LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst - + -# The size is 1MB + 4KB. The extra 4KB has been added to prevent allocatestack -# from resizing the input size to avoid the 64K aliasing conflict on Intel -# processors. @@ -12,22 +12,22 @@ diff -pruN glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile +DEFAULT_STACKSIZE=1048576 CFLAGS-tst-default-attr.c = -DDEFAULT_STACKSIZE=$(DEFAULT_STACKSIZE) tst-default-attr-ENV = GLIBC_PTHREAD_STACKSIZE=$(DEFAULT_STACKSIZE) - + diff -pruN glibc-2.17-c758a686/nptl/tst-default-attr.c glibc-2.17-c758a686/nptl/tst-default-attr.c --- glibc-2.17-c758a686/nptl/tst-default-attr.c 2013-07-31 11:51:24.885747234 +0530 +++ glibc-2.17-c758a686/nptl/tst-default-attr.c 2013-07-31 12:18:10.016691337 +0530 @@ -38,6 +38,7 @@ - + /* DEFAULT_STACKSIZE macro is defined in the Makefile. */ static size_t stacksize = DEFAULT_STACKSIZE; +long int pagesize; - + static int verify_stacksize_result (pthread_attr_t *attr) @@ -46,12 +47,20 @@ verify_stacksize_result (pthread_attr_t - + RETURN_IF_FAIL (pthread_attr_getstacksize, attr, &stack); - + - if (stacksize != stack) + /* pthread_create perturbs the stack size by a page if it aligns to 64K to + avoid the 64K aliasing conflict. We cannot simply add 4K to the size in @@ -40,12 +40,12 @@ diff -pruN glibc-2.17-c758a686/nptl/tst-default-attr.c glibc-2.17-c758a686/nptl/ printf ("failed to set default stacksize (%zu, %zu)\n", stacksize, stack); return 1; } - + + printf ("Requested %zu and got %zu\n", stacksize, stack); + return 0; } - + @@ -101,6 +110,15 @@ run_threads (void) static int do_test (void) diff --git a/SOURCES/glibc-rh990388.patch b/SOURCES/glibc-rh990388.patch index 44eb571d..e48b1edf 100644 --- a/SOURCES/glibc-rh990388.patch +++ b/SOURCES/glibc-rh990388.patch @@ -4,7 +4,7 @@ diff -pruN glibc-2.17-c758a686/include/libc-internal.h glibc-2.17-c758a686/inclu @@ -50,4 +50,24 @@ extern void __init_misc (int, char **, c /* Cast an integer or a pointer VAL to integer with proper type. */ # define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val)) - + +/* Align a value by rounding down to closest size. + e.g. Using size of 4096, we get this behavior: + {4095, 4096, 4097} = {0, 4096, 4096}. */ @@ -30,37 +30,37 @@ diff -pruN glibc-2.17-c758a686/nptl/allocatestack.c glibc-2.17-c758a686/nptl/all --- glibc-2.17-c758a686/nptl/allocatestack.c 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/allocatestack.c 2013-07-30 11:26:38.012943707 +0530 @@ -355,7 +355,7 @@ allocate_stack (const struct pthread_att - + /* Get the stack size from the attribute if it is set. Otherwise we use the default we determined at start time. */ - size = attr->stacksize ?: __default_stacksize; + size = attr->stacksize ?: __default_pthread_attr.stacksize; - + /* Get memory for the stack. */ if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0)) diff -pruN glibc-2.17-c758a686/nptl/nptl-init.c glibc-2.17-c758a686/nptl/nptl-init.c --- glibc-2.17-c758a686/nptl/nptl-init.c 2013-07-30 11:45:16.902904743 +0530 +++ glibc-2.17-c758a686/nptl/nptl-init.c 2013-07-30 11:44:59.538905347 +0530 @@ -423,7 +423,8 @@ __pthread_initialize_minimal_internal (v - + /* Round the resource limit up to page size. */ limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz; - __default_stacksize = limit.rlim_cur; + __default_pthread_attr.stacksize = limit.rlim_cur; + __default_pthread_attr.guardsize = GLRO (dl_pagesize); - + #ifdef SHARED /* Transfer the old value from the dynamic linker's internal location. */ diff -pruN glibc-2.17-c758a686/nptl/pthread_attr_getstacksize.c glibc-2.17-c758a686/nptl/pthread_attr_getstacksize.c --- glibc-2.17-c758a686/nptl/pthread_attr_getstacksize.c 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/pthread_attr_getstacksize.c 2013-07-30 11:26:39.650943650 +0530 @@ -32,7 +32,7 @@ __pthread_attr_getstacksize (attr, stack - + /* If the user has not set a stack size we return what the system will use as the default. */ - *stacksize = iattr->stacksize ?: __default_stacksize; + *stacksize = iattr->stacksize ?: __default_pthread_attr.stacksize; - + return 0; } diff -pruN glibc-2.17-c758a686/nptl/pthread_barrier_init.c glibc-2.17-c758a686/nptl/pthread_barrier_init.c @@ -68,8 +68,8 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_barrier_init.c glibc-2.17-c758a686/n +++ glibc-2.17-c758a686/nptl/pthread_barrier_init.c 2013-07-30 11:26:40.206943631 +0530 @@ -22,7 +22,7 @@ #include - - + + -static const struct pthread_barrierattr default_attr = +static const struct pthread_barrierattr default_barrierattr = { @@ -81,7 +81,7 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_barrier_init.c glibc-2.17-c758a686/n ? iattr = (struct pthread_barrierattr *) attr - : &default_attr); + : &default_barrierattr); - + if (iattr->pshared != PTHREAD_PROCESS_PRIVATE && __builtin_expect (iattr->pshared != PTHREAD_PROCESS_SHARED, 0)) diff -pruN glibc-2.17-c758a686/nptl/pthread_create.c glibc-2.17-c758a686/nptl/pthread_create.c @@ -89,8 +89,8 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_create.c glibc-2.17-c758a686/nptl/pt +++ glibc-2.17-c758a686/nptl/pthread_create.c 2013-07-30 11:26:40.774943611 +0530 @@ -432,15 +432,6 @@ start_thread (void *arg) } - - + + -/* Default thread attributes for the case when the user does not - provide any. */ -static const struct pthread_attr default_attr = @@ -109,29 +109,29 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_create.c glibc-2.17-c758a686/nptl/pt accessing far-away memory. */ - iattr = &default_attr; + iattr = &__default_pthread_attr; - + struct pthread *pd = NULL; int err = ALLOCATE_STACK (iattr, &pd); diff -pruN glibc-2.17-c758a686/nptl/pthread_mutex_init.c glibc-2.17-c758a686/nptl/pthread_mutex_init.c --- glibc-2.17-c758a686/nptl/pthread_mutex_init.c 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/pthread_mutex_init.c 2013-07-30 11:26:42.079943566 +0530 @@ -24,7 +24,7 @@ - + #include - + -static const struct pthread_mutexattr default_attr = +static const struct pthread_mutexattr default_mutexattr = { /* Default is a normal mutex, not shared between processes. */ .mutexkind = PTHREAD_MUTEX_NORMAL @@ -45,7 +45,8 @@ __pthread_mutex_init (mutex, mutexattr) - + assert (sizeof (pthread_mutex_t) <= __SIZEOF_PTHREAD_MUTEX_T); - + - imutexattr = (const struct pthread_mutexattr *) mutexattr ?: &default_attr; + imutexattr = ((const struct pthread_mutexattr *) mutexattr + ?: &default_mutexattr); - + /* Sanity checks. */ switch (__builtin_expect (imutexattr->mutexkind diff -pruN glibc-2.17-c758a686/nptl/pthreadP.h glibc-2.17-c758a686/nptl/pthreadP.h @@ -139,13 +139,13 @@ diff -pruN glibc-2.17-c758a686/nptl/pthreadP.h glibc-2.17-c758a686/nptl/pthreadP +++ glibc-2.17-c758a686/nptl/pthreadP.h 2013-07-30 11:26:43.095943530 +0530 @@ -147,8 +147,8 @@ enum /* Internal variables. */ - - + + -/* Default stack size. */ -extern size_t __default_stacksize attribute_hidden; +/* Default pthread attributes. */ +extern struct pthread_attr __default_pthread_attr attribute_hidden; - + /* Size and alignment of static TLS block. */ extern size_t __static_tls_size attribute_hidden; diff -pruN glibc-2.17-c758a686/nptl/pthread_rwlock_init.c glibc-2.17-c758a686/nptl/pthread_rwlock_init.c @@ -153,8 +153,8 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_rwlock_init.c glibc-2.17-c758a686/np +++ glibc-2.17-c758a686/nptl/pthread_rwlock_init.c 2013-07-30 11:26:43.745943508 +0530 @@ -21,7 +21,7 @@ #include - - + + -static const struct pthread_rwlockattr default_attr = +static const struct pthread_rwlockattr default_rwlockattr = { @@ -163,19 +163,19 @@ diff -pruN glibc-2.17-c758a686/nptl/pthread_rwlock_init.c glibc-2.17-c758a686/np @@ -35,7 +35,7 @@ __pthread_rwlock_init (rwlock, attr) { const struct pthread_rwlockattr *iattr; - + - iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_attr; + iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_rwlockattr; - + memset (rwlock, '\0', sizeof (*rwlock)); - + diff -pruN glibc-2.17-c758a686/nptl/vars.c glibc-2.17-c758a686/nptl/vars.c --- glibc-2.17-c758a686/nptl/vars.c 2012-12-25 08:32:13.000000000 +0530 +++ glibc-2.17-c758a686/nptl/vars.c 2013-07-30 11:26:43.763943507 +0530 @@ -20,13 +20,9 @@ #include #include - + -/* Default stack size. */ -size_t __default_stacksize attribute_hidden -#ifdef SHARED @@ -186,6 +186,6 @@ diff -pruN glibc-2.17-c758a686/nptl/vars.c glibc-2.17-c758a686/nptl/vars.c +/* Default thread attributes for the case when the user does not + provide any. */ +struct pthread_attr __default_pthread_attr attribute_hidden; - + /* Flag whether the machine is SMP or not. */ int __is_smp attribute_hidden; diff --git a/SOURCES/glibc-rh990481-CVE-2013-4788.patch b/SOURCES/glibc-rh990481-CVE-2013-4788.patch index 7e392627..dc4f8453 100644 --- a/SOURCES/glibc-rh990481-CVE-2013-4788.patch +++ b/SOURCES/glibc-rh990481-CVE-2013-4788.patch @@ -51,7 +51,7 @@ diff -urN glibc-2.17-c758a686/csu/libc-start.c glibc-2.17-c758a686/csu/libc-star + attribute_relro attribute_hidden __attribute__ ((nocommon)); +# endif #endif - + #ifdef HAVE_PTR_NTHREADS @@ -184,6 +190,16 @@ # else @@ -68,14 +68,14 @@ diff -urN glibc-2.17-c758a686/csu/libc-start.c glibc-2.17-c758a686/csu/libc-star +# endif + #endif - + /* Register the destructor of the dynamic linker if there is any. */ diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile --- glibc-2.17-c758a686/elf/Makefile 2013-08-09 17:40:41.757856472 -0400 +++ glibc-2.17-c758a686/elf/Makefile 2013-08-09 17:53:40.383236966 -0400 @@ -121,7 +121,8 @@ tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \ - tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 + tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static \ - tst-leaks1-static tst-array1-static tst-array5-static + tst-leaks1-static tst-array1-static tst-array5-static \ @@ -84,9 +84,9 @@ diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile tests-static += tst-tls9-static tst-tls9-static-ENV = \ @@ -145,7 +146,7 @@ - tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ - tst-stackguard1 tst-addr1 tst-thrlock \ - tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ + tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ + tst-stackguard1 tst-addr1 tst-thrlock \ + tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ - tst-initorder tst-initorder2 tst-relsort1 + tst-initorder tst-initorder2 tst-relsort1 tst-ptrguard1 # reldep9 @@ -95,13 +95,13 @@ diff -urN glibc-2.17-c758a686/elf/Makefile glibc-2.17-c758a686/elf/Makefile @@ -1062,6 +1063,9 @@ tst-stackguard1-ARGS = --command "$(host-built-program-cmd) --child" tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" - + +tst-ptrguard1-ARGS = --command "$(host-built-program-cmd) --child" +tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child" + $(objpfx)tst-leaks1: $(libdl) $(objpfx)tst-leaks1-mem: $(objpfx)tst-leaks1.out - $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@ + $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@ diff -urN glibc-2.17-c758a686/elf/tst-ptrguard1.c glibc-2.17-c758a686/elf/tst-ptrguard1.c --- glibc-2.17-c758a686/elf/tst-ptrguard1.c 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.17-c758a686/elf/tst-ptrguard1.c 2013-08-09 17:53:40.383236966 -0400 @@ -317,7 +317,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/generic/stackguard-macros.h glibc-2.17-c75 --- glibc-2.17-c758a686/sysdeps/generic/stackguard-macros.h 2013-08-09 17:40:41.917855965 -0400 +++ glibc-2.17-c758a686/sysdeps/generic/stackguard-macros.h 2013-08-09 17:53:40.384236962 -0400 @@ -2,3 +2,6 @@ - + extern uintptr_t __stack_chk_guard; #define STACK_CHK_GUARD __stack_chk_guard + @@ -327,7 +327,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/i386/stackguard-macros.h glibc-2.17-c758a6 --- glibc-2.17-c758a686/sysdeps/i386/stackguard-macros.h 2013-08-09 17:40:41.893856041 -0400 +++ glibc-2.17-c758a686/sysdeps/i386/stackguard-macros.h 2013-08-09 22:44:04.774298862 -0400 @@ -2,3 +2,11 @@ - + #define STACK_CHK_GUARD \ ({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; }) + @@ -342,7 +342,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stackguard-macros.h glib --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stackguard-macros.h 2013-08-09 17:40:42.006855683 -0400 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stackguard-macros.h 2013-08-09 22:24:48.778793075 -0400 @@ -2,3 +2,13 @@ - + #define STACK_CHK_GUARD \ ({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; }) + @@ -359,7 +359,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stackguard-macros.h glib --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stackguard-macros.h 2013-08-09 17:40:41.994855721 -0400 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stackguard-macros.h 2013-08-09 22:24:47.831795865 -0400 @@ -2,3 +2,13 @@ - + #define STACK_CHK_GUARD \ ({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; }) + @@ -376,7 +376,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/s390/s390-32/stackguard-macros.h glibc-2.1 --- glibc-2.17-c758a686/sysdeps/s390/s390-32/stackguard-macros.h 2013-08-09 17:40:42.059855515 -0400 +++ glibc-2.17-c758a686/sysdeps/s390/s390-32/stackguard-macros.h 2013-08-09 22:39:31.913120373 -0400 @@ -2,3 +2,15 @@ - + #define STACK_CHK_GUARD \ ({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; }) + @@ -397,7 +397,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/stackguard-macros.h glibc-2.17-c758 @@ -4,3 +4,11 @@ ({ uintptr_t x; \ asm ("mov %%fs:%c1, %0" : "=r" (x) \ - : "i" (offsetof (tcbhead_t, stack_guard))); x; }) + : "i" (offsetof (tcbhead_t, stack_guard))); x; }) + +#define POINTER_CHK_GUARD \ + ({ \ @@ -409,7 +409,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/stackguard-macros.h glibc-2.17-c758 --- glibc-2.17-c758a686/sysdeps/s390/s390-64/stackguard-macros.h 2013-08-09 17:40:42.057855522 -0400 +++ glibc-2.17-c758a686/sysdeps/s390/s390-64/stackguard-macros.h 2013-08-26 15:21:27.239043425 -0400 @@ -2,3 +2,17 @@ - + #define STACK_CHK_GUARD \ ({ uintptr_t x; asm ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; }) + diff --git a/SOURCES/glibc-rh996227.patch b/SOURCES/glibc-rh996227.patch index e7bc4965..436d1104 100644 --- a/SOURCES/glibc-rh996227.patch +++ b/SOURCES/glibc-rh996227.patch @@ -3,24 +3,24 @@ Author: Florian Weimer Date: Fri Aug 16 09:38:52 2013 +0200 CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r - - * sysdeps/posix/dirstream.h (struct __dirstream): Add errcode - member. - * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode - member. - * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member. - * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit. - Return delayed error code. Remove GETDENTS_64BIT_ALIGNED - conditional. - * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define - GETDENTS_64BIT_ALIGNED. - * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. - * manual/filesys.texi (Reading/Closing Directory): Document - ENAMETOOLONG return value of readdir_r. Recommend readdir more - strongly. - * manual/conf.texi (Limits for Files): Add portability note to - NAME_MAX, PATH_MAX. - (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX. + + * sysdeps/posix/dirstream.h (struct __dirstream): Add errcode + member. + * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode + member. + * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member. + * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit. + Return delayed error code. Remove GETDENTS_64BIT_ALIGNED + conditional. + * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define + GETDENTS_64BIT_ALIGNED. + * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. + * manual/filesys.texi (Reading/Closing Directory): Document + ENAMETOOLONG return value of readdir_r. Recommend readdir more + strongly. + * manual/conf.texi (Limits for Files): Add portability note to + NAME_MAX, PATH_MAX. + (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX. diff --git glibc-2.17-c758a686/manual/conf.texi glibc-2.17-c758a686/manual/conf.texi index 7eb8b36..c720063 100644 @@ -34,7 +34,7 @@ index 7eb8b36..c720063 100644 +@strong{Portability Note:} On some systems, @theglibc{} defines +@code{NAME_MAX}, but does not actually enforce this limit. @end deftypevr - + @comment limits.h @@ -1157,6 +1160,9 @@ including the terminating null character. The uniform system limit (if any) for the length of an entire file name (that @@ -44,18 +44,18 @@ index 7eb8b36..c720063 100644 +@strong{Portability Note:} @Theglibc{} does not enforce this limit +even if @code{PATH_MAX} is defined. @end deftypevr - + @cindex limits, pipe buffer size @@ -1476,6 +1482,9 @@ Inquire about the value of @code{POSIX_REC_MIN_XFER_SIZE}. Inquire about the value of @code{POSIX_REC_XFER_ALIGN}. @end table - + +@strong{Portability Note:} On some systems, @theglibc{} does not +enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits. + @node Utility Limits @section Utility Program Capacity Limits - + diff --git glibc-2.17-c758a686/manual/filesys.texi glibc-2.17-c758a686/manual/filesys.texi index 1df9cf2..814c210 100644 --- glibc-2.17-c758a686/manual/filesys.texi @@ -70,13 +70,13 @@ index 1df9cf2..814c210 100644 +returns a pointer to a structure containing information about the +file. This structure is associated with the @var{dirstream} handle +and can be rewritten by a subsequent call. - + @strong{Portability Note:} On some systems @code{readdir} may not return entries for @file{.} and @file{..}, even though these are always @@ -461,19 +461,61 @@ conditions are defined for this function: The @var{dirstream} argument is not valid. @end table - + -@code{readdir} is not thread safe. Multiple threads using -@code{readdir} on the same @var{dirstream} may overwrite the return -value. Use @code{readdir_r} when this is critical. @@ -93,7 +93,7 @@ index 1df9cf2..814c210 100644 +below). It is recommended that you use @code{readdir}, with external +locking if multiple threads access the same @var{dirstream}. @end deftypefun - + @comment dirent.h @comment GNU @deftypefun int readdir_r (DIR *@var{dirstream}, struct dirent *@var{entry}, struct dirent **@var{result}) @@ -140,13 +140,13 @@ index 1df9cf2..814c210 100644 +@code{readdir} which is provided by @theglibc{} and other +implementations today. +@end itemize - + Normally @code{readdir_r} returns zero and sets @code{*@var{result}} to @var{entry}. If there are no more entries in the directory or an @@ -481,15 +523,6 @@ error is detected, @code{readdir_r} sets @code{*@var{result}} to a null pointer and returns a nonzero error code, also stored in @code{errno}, as described for @code{readdir}. - + -@strong{Portability Note:} On some systems @code{readdir_r} may not -return a NUL terminated string for the file name, even when there is no -@code{d_reclen} field in @code{struct dirent} and the file @@ -164,9 +164,9 @@ index a7a074d..8e8570d 100644 --- glibc-2.17-c758a686/sysdeps/posix/dirstream.h +++ glibc-2.17-c758a686/sysdeps/posix/dirstream.h @@ -39,6 +39,8 @@ struct __dirstream - + off_t filepos; /* Position of next entry to read. */ - + + int errcode; /* Delayed error code. */ + /* Directory block. */ @@ -181,7 +181,7 @@ index ddfc3a7..fc05b0f 100644 dirp->offset = 0; dirp->filepos = 0; + dirp->errcode = 0; - + return dirp; } diff --git glibc-2.17-c758a686/sysdeps/posix/readdir_r.c glibc-2.17-c758a686/sysdeps/posix/readdir_r.c @@ -193,26 +193,26 @@ index b5a8e2e..8ed5c3f 100644 size_t reclen; const int saved_errno = errno; + int ret; - + __libc_lock_lock (dirp->lock); - + @@ -70,10 +71,10 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result) - bytes = 0; - __set_errno (saved_errno); - } + bytes = 0; + __set_errno (saved_errno); + } + if (bytes < 0) + dirp->errcode = errno; - - dp = NULL; + + dp = NULL; - /* Reclen != 0 signals that an error occurred. */ - reclen = bytes != 0; - break; - } - dirp->size = (size_t) bytes; + break; + } + dirp->size = (size_t) bytes; @@ -106,29 +107,46 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result) dirp->filepos += reclen; #endif - + - /* Skip deleted files. */ +#ifdef NAME_MAX + if (reclen > offsetof (DIRENT_TYPE, d_name) + NAME_MAX + 1) @@ -236,7 +236,7 @@ index b5a8e2e..8ed5c3f 100644 + /* Skip deleted and ignored files. */ } while (dp->d_ino == 0); - + if (dp != NULL) { -#ifdef GETDENTS_64BIT_ALIGNED @@ -258,13 +258,13 @@ index b5a8e2e..8ed5c3f 100644 + *result = NULL; + ret = dirp->errcode; + } - + __libc_lock_unlock (dirp->lock); - + - return dp != NULL ? 0 : reclen ? errno : 0; + return ret; } - + #ifdef __READDIR_R_ALIAS diff --git glibc-2.17-c758a686/sysdeps/posix/rewinddir.c glibc-2.17-c758a686/sysdeps/posix/rewinddir.c index 2935a8e..d4991ad 100644 @@ -287,9 +287,9 @@ index 8ebbcfd..a7d114e 100644 #define __GETDENTS __getdents64 #define DIRENT_TYPE struct dirent64 -#define GETDENTS_64BIT_ALIGNED 1 - + #include - + diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c glibc-2.17-c758a686/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c index 5ed8e95..290f2c8 100644 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c diff --git a/SOURCES/glibc-rtkaio-inc-pthread.patch b/SOURCES/glibc-rtkaio-inc-pthread.patch index 372f25b2..9aa6162b 100644 --- a/SOURCES/glibc-rtkaio-inc-pthread.patch +++ b/SOURCES/glibc-rtkaio-inc-pthread.patch @@ -7,8 +7,8 @@ diff -urN glibc-2.17-c758a686/rtkaio/tst-aiod2.c glibc-2.17-c758a686/rtkaio/tst- #include +#include #include "tst-aiod.h" - - + + diff -urN glibc-2.17-c758a686/rtkaio/tst-aiod3.c glibc-2.17-c758a686/rtkaio/tst-aiod3.c --- glibc-2.17-c758a686/rtkaio/tst-aiod3.c 2011-10-19 07:04:41.000000000 -0400 +++ glibc-2.17-c758a686/rtkaio/tst-aiod3.c 2014-08-19 18:31:59.855273111 -0400 @@ -18,3 +18,5 @@ diff -urN glibc-2.17-c758a686/rtkaio/tst-aiod3.c glibc-2.17-c758a686/rtkaio/tst- #include +#include #include "tst-aiod.h" + + diff --git a/SOURCES/glibc-stap-libm.patch b/SOURCES/glibc-stap-libm.patch index 1b68d67a..9e7e7dff 100644 --- a/SOURCES/glibc-stap-libm.patch +++ b/SOURCES/glibc-stap-libm.patch @@ -12,7 +12,7 @@ diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c glibc-2.17-c758a6 @@ -30,6 +30,8 @@ #include "mpa.h" #include - + +#include + #ifndef SECTION @@ -34,7 +34,7 @@ diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c glibc-2.17-c758a6 __dbl_mp(x,&mpx,p); __mpexp(&mpx, &mpy, p); __mp_dbl(&mpy, &res, p); -+ ++ + /* Track how often we get to the uber-slow exp code plus + its input/output values. */ + LIBC_PROBE (slowexp_p32, 2, &x, &res); @@ -47,7 +47,7 @@ diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c glibc-2.17-c758a6 @@ -34,6 +34,8 @@ #include "mpa.h" #include - + +#include + #ifndef SECTION @@ -64,7 +64,7 @@ diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c glibc-2.17-c758a6 + LIBC_PROBE (slowpow_p10, 4, &x, &y, &z, &res); + return res; + } - + p = 32; /* if we get here result wasn't calculated exactly, continue */ __dbl_mp(x,&mpx,p); /* for more exact calculation */ @@ -75,5 +82,10 @@ __slowpow(double x, double y, double z) diff --git a/SPECS/glibc.spec b/SPECS/glibc.spec index c9200837..7852925b 100644 --- a/SPECS/glibc.spec +++ b/SPECS/glibc.spec @@ -1690,8 +1690,8 @@ package or when debugging this package. %patch1024 -p1 %patch1025 -p1 %patch1026 -p1 -#%patch1027 -p1 -#%patch1028 -p1 +%patch1027 -p1 +%patch1028 -p1 %patch1029 -p1 %patch1030 -p1 %patch1031 -p1 @@ -1700,7 +1700,7 @@ package or when debugging this package. %patch0045 -p1 %patch1047 -p1 %patch1034 -p1 -#%patch1058 -p1 +%patch1058 -p1 %patch1035 -p1 %patch1059 -p1 %patch1036 -p1 @@ -1725,41 +1725,41 @@ package or when debugging this package. %patch1063 -p1 %patch2053 -p1 # Apply ldbl_high() patch for both ppc64le and ppc64. -#%patch1110 -p1 +%patch1110 -p1 # PPC64LE Patch set: # 1064 to 1109. %patch1064 -p1 %patch1065 -p1 -#%patch1066 -p1 -#%patch1067 -p1 -#%patch1068 -p1 -#%patch1069 -p1 +%patch1066 -p1 +%patch1067 -p1 +%patch1068 -p1 +%patch1069 -p1 %patch1070 -p1 -#%patch1071 -p1 +%patch1071 -p1 %patch1072 -p1 -#%patch1073 -p1 +%patch1073 -p1 %patch1074 -p1 %patch1075 -p1 -#%patch1076 -p1 +%patch1076 -p1 %patch1077 -p1 %patch1078 -p1 %patch1079 -p1 -#%patch1080 -p1 +%patch1080 -p1 %patch1081 -p1 -#%patch1082 -p1 +%patch1082 -p1 %patch1083 -p1 %patch1084 -p1 -#%patch1085 -p1 +%patch1085 -p1 %patch1086 -p1 %patch1087 -p1 -#%patch1088 -p1 +%patch1088 -p1 %patch1089 -p1 -#%patch1090 -p1 +%patch1090 -p1 %patch1091 -p1 %patch1092 -p1 -#%patch1093 -p1 -#%patch1094 -p1 +%patch1093 -p1 +%patch1094 -p1 %patch1095 -p1 %patch1096 -p1 %patch1097 -p1 @@ -1774,7 +1774,7 @@ package or when debugging this package. %patch1106 -p1 %patch1107 -p1 %patch1108 -p1 -#%patch1109 -p1 +%patch1109 -p1 %patch1112 -p1 # End of PPC64LE Patch Set. @@ -1828,10 +1828,10 @@ package or when debugging this package. %patch1545 -p1 %patch1546 -p1 %patch1547 -p1 -#%patch1548 -p1 +%patch1548 -p1 %patch1549 -p1 %patch1550 -p1 -#%patch1551 -p1 +%patch1551 -p1 %patch1552 -p1 %patch1553 -p1 %patch1554 -p1 @@ -1852,7 +1852,7 @@ package or when debugging this package. # End of IBM IFUNC patch set. %patch1570 -p1 %patch1571 -p1 -#%patch1572 -p1 +%patch1572 -p1 %patch1573 -p1 %patch0063 -p1 %patch2064 -p1 @@ -1890,8 +1890,8 @@ package or when debugging this package. %patch1602 -p1 %patch1603 -p1 %patch1604 -p1 -#%patch1605 -p1 -#%patch1606 -p1 +%patch1605 -p1 +%patch1606 -p1 %patch2066 -p1 %patch20670 -p1 %patch2067 -p1 @@ -1921,7 +1921,7 @@ package or when debugging this package. %patch2091 -p1 # Rebase of microbenchmarks. -#%patch1607 -p1 +%patch1607 -p1 %patch1609 -p1 %patch1610 -p1 %patch1611 -p1 @@ -1936,9 +1936,9 @@ package or when debugging this package. %patch1618 -p1 %patch1619 -p1 %patch1620 -p1 -#%patch1621 -p1 -#%patch1622 -p1 -#%patch1623 -p1 +%patch1621 -p1 +%patch1622 -p1 +%patch1623 -p1 # Backport of upstream IBM z13 patches for RHEL 7.3 %patch1624 -p1 @@ -1950,27 +1950,27 @@ package or when debugging this package. %patch1630 -p1 %patch1631 -p1 %patch1632 -p1 -#%patch1633 -p1 -#%patch1634 -p1 -#%patch1635 -p1 -#%patch1636 -p1 -#%patch1637 -p1 -#%patch1638 -p1 -#%patch1639 -p1 -#%patch1640 -p1 -#%patch1641 -p1 -#%patch1642 -p1 -#%patch1643 -p1 -#%patch1644 -p1 -#%patch1645 -p1 -#%patch1646 -p1 -#%patch1647 -p1 -#%patch1648 -p1 -#%patch1649 -p1 -#%patch1650 -p1 -#%patch1651 -p1 -#%patch1652 -p1 -#%patch1653 -p1 +%patch1633 -p1 +%patch1634 -p1 +%patch1635 -p1 +%patch1636 -p1 +%patch1637 -p1 +%patch1638 -p1 +%patch1639 -p1 +%patch1640 -p1 +%patch1641 -p1 +%patch1642 -p1 +%patch1643 -p1 +%patch1644 -p1 +%patch1645 -p1 +%patch1646 -p1 +%patch1647 -p1 +%patch1648 -p1 +%patch1649 -p1 +%patch1650 -p1 +%patch1651 -p1 +%patch1652 -p1 +%patch1653 -p1 %patch1654 -p1 %patch1123 -p1 @@ -1991,16 +1991,16 @@ package or when debugging this package. %patch1667 -p1 %patch1668 -p1 %patch1669 -p1 -#%patch1670 -p1 +%patch1670 -p1 %patch1671 -p1 %patch1672 -p1 %patch1675 -p1 # RHBZ #1324427, parts 1 through 3 -#%patch1676 -p1 -#%patch1677 -p1 -#%patch1678 -p1 +%patch1676 -p1 +%patch1677 -p1 +%patch1678 -p1 # RHBZ #1234449, parts 1 through 4 %patch1679 -p1 @@ -2033,7 +2033,7 @@ package or when debugging this package. %patch1698 -p1 # RHBZ #1211823 -#%patch1699 -p1 +%patch1699 -p1 # RHBZ #1268050, parts 1 through 5 %patch1700 -p1 @@ -2054,62 +2054,62 @@ package or when debugging this package. %patch1711 -p1 %patch1712 -p1 -#%patch1713 -p1 +%patch1713 -p1 %patch1714 -p1 %patch1715 -p1 # RHBZ #1256317, IS_IN backports, parts 1 through 22. -#%patch1716 -p1 +%patch1716 -p1 %patch1717 -p1 %patch1718 -p1 %patch1719 -p1 -#%patch1720 -p1 -#%patch1721 -p1 -#%patch1722 -p1 -#%patch1723 -p1 -#%patch1724 -p1 +%patch1720 -p1 +%patch1721 -p1 +%patch1722 -p1 +%patch1723 -p1 +%patch1724 -p1 %patch1725 -p1 %patch1726 -p1 -#%patch1727 -p1 -#%patch1728 -p1 +%patch1727 -p1 +%patch1728 -p1 %patch1729 -p1 -#%patch1730 -p1 -#%patch1731 -p1 -#%patch1732 -p1 -#%patch1733 -p1 -#%patch1734 -p1 -#%patch1735 -p1 -#%patch1736 -p1 -#%patch1737 -p1 - -#%patch1738 -p1 -#%patch1739 -p1 +%patch1730 -p1 +%patch1731 -p1 +%patch1732 -p1 +%patch1733 -p1 +%patch1734 -p1 +%patch1735 -p1 +%patch1736 -p1 +%patch1737 -p1 + +%patch1738 -p1 +%patch1739 -p1 # RHBZ #1292018, patches 1 through 10. -#%patch1740 -p1 -#%patch1741 -p1 +%patch1740 -p1 +%patch1741 -p1 %patch1742 -p1 -#%patch1743 -p1 -#%patch1744 -p1 -#%patch1745 -p1 -#%patch1746 -p1 -#%patch1747 -p1 -#%patch1748 -p1 -#%patch1749 -p1 +%patch1743 -p1 +%patch1744 -p1 +%patch1745 -p1 +%patch1746 -p1 +%patch1747 -p1 +%patch1748 -p1 +%patch1749 -p1 %patch1750 -p1 # RHBZ #1298526, patch 1 of 5. -#%patch1751 -p1 -#%patch1752 -p1 -#%patch1753 -p1 -#%patch1754 -p1 +%patch1751 -p1 +%patch1752 -p1 +%patch1753 -p1 +%patch1754 -p1 %patch1755 -p1 %patch1756 -p1 %patch1757 -p1 %patch17580 -p1 -#%patch1758 -p1 +%patch1758 -p1 %patch1759 -p1 %patch1760 -p1 %patch1761 -p1 @@ -2119,8 +2119,8 @@ package or when debugging this package. %patch1765 -p1 %patch1766 -p1 %patch1767 -p1 -#%patch1768 -p1 -#%patch1769 -p1 +%patch1768 -p1 +%patch1769 -p1 %patch1770 -p1 %patch1771 -p1 %patch1772 -p1 @@ -2130,39 +2130,39 @@ package or when debugging this package. %patch1776 -p1 %patch1777 -p1 %patch1778 -p1 -#%patch1779 -p1 -#%patch1780 -p1 +%patch1779 -p1 +%patch1780 -p1 %patch1781 -p1 %patch1782 -p1 -#%patch1783 -p1 -#%patch1784 -p1 +%patch1783 -p1 +%patch1784 -p1 %patch1785 -p1 -#%patch1786 -p1 -#%patch1787 -p1 -#%patch1788 -p1 +%patch1786 -p1 +%patch1787 -p1 +%patch1788 -p1 %patch1789 -p1 -#%patch1790 -p1 +%patch1790 -p1 %patch1791 -p1 -#%patch1792 -p1 +%patch1792 -p1 %patch1793 -p1 -#%patch1794 -p1 -#%patch1795 -p1 -#%patch1796 -p1 -#%patch1797 -p1 +%patch1794 -p1 +%patch1795 -p1 +%patch1796 -p1 +%patch1797 -p1 %patch1798 -p1 -#%patch1799 -p1 -#%patch1800 -p1 -#%patch1801 -p1 -#%patch1802 -p1 +%patch1799 -p1 +%patch1800 -p1 +%patch1801 -p1 +%patch1802 -p1 %patch1803 -p1 %patch1804 -p1 -#%patch1805 -p1 -#%patch1806 -p1 +%patch1805 -p1 +%patch1806 -p1 %patch1807 -p1 %patch1808 -p1 %patch1809 -p1 -#%patch1810 -p1 -#%patch1811 -p1 +%patch1810 -p1 +%patch1811 -p1 %patch1812 -p1 %patch1813 -p1 %patch1814 -p1 @@ -2171,9 +2171,9 @@ package or when debugging this package. %patch1817 -p1 %patch1818 -p1 %patch1819 -p1 -#%patch1820 -p1 -#%patch1821 -p1 -#%patch1822 -p1 +%patch1820 -p1 +%patch1821 -p1 +%patch1822 -p1 %patch1823 -p1 %patch1824 -p1 %patch1825 -p1 @@ -2181,8 +2181,8 @@ package or when debugging this package. %patch1827 -p1 %patch1828 -p1 %patch1829 -p1 -#%patch1830 -p1 -#%patch1831 -p1 +%patch1830 -p1 +%patch1831 -p1 # RHBZ #841653 - Intel lock elision patch set. %patch1832 -p1 %patch1833 -p1 @@ -2201,25 +2201,25 @@ package or when debugging this package. %patch1846 -p1 %patch1847 -p1 %patch1848 -p1 -#%patch1849 -p1 +%patch1849 -p1 # End of Intel lock elision patch set. # RHBZ #731835 - IBM POWER lock elision patch set. %patch1850 -p1 %patch1851 -p1 -#%patch1852 -p1 +%patch1852 -p1 # End of IBM POWER lock elision patch set. %patch1853 -p1 %patch1854 -p1 # Built-in list of syscall names. -#%patch1855 -p1 +%patch1855 -p1 %patch1856 -p1 #%patch1857 -p1 -#%patch1858 -p1 +%patch1858 -p1 %patch1859 -p1 -#%patch1860 -p1 +%patch1860 -p1 %patch1861 -p1 %patch1862 -p1 @@ -2229,67 +2229,67 @@ package or when debugging this package. %patch1866 -p1 %patch1867 -p1 -#%patch1868 -p1 -#%patch1869 -p1 -#%patch1870 -p1 -#%patch1871 -p1 +%patch1868 -p1 +%patch1869 -p1 +%patch1870 -p1 +%patch1871 -p1 %patch1872 -p1 -#%patch1873 -p1 -#%patch1874 -p1 -#%patch1875 -p1 -#%patch1876 -p1 +%patch1873 -p1 +%patch1874 -p1 +%patch1875 -p1 +%patch1876 -p1 %patch1877 -p1 %patch2092 -p1 %patch2093 -p1 %patch2094 -p1 -#%patch2095 -p1 +%patch2095 -p1 %patch2096 -p1 %patch2097 -p1 %patch2098 -p1 %patch2099 -p1 -#%patch2100 -p1 -#%patch2101 -p1 -#%patch2102 -p1 +%patch2100 -p1 +%patch2101 -p1 +%patch2102 -p1 %patch2103 -p1 -#%patch2104 -p1 -#%patch2105 -p1 +%patch2104 -p1 +%patch2105 -p1 %patch2106 -p1 -#%patch2107 -p1 -#%patch2108 -p1 +%patch2107 -p1 +%patch2108 -p1 %patch2109 -p1 -#%patch2110 -p1 -#%patch2111 -p1 +%patch2110 -p1 +%patch2111 -p1 %patch2112 -p1 %patch2113 -p1 %patch1878 -p1 -#%patch1879 -p1 -#%patch1880 -p1 +%patch1879 -p1 +%patch1880 -p1 %patch1881 -p1 %patch1882 -p1 -#%patch1883 -p1 +%patch1883 -p1 %patch1884 -p1 %patch1885 -p1 %patch1886 -p1 %patch1887 -p1 %patch1888 -p1 %patch1889 -p1 -#%patch1890 -p1 -#%patch1891 -p1 -#%patch1892 -p1 +%patch1890 -p1 +%patch1891 -p1 +%patch1892 -p1 -#%patch1893 -p1 -#%patch1894 -p1 -#%patch1895 -p1 +%patch1893 -p1 +%patch1894 -p1 +%patch1895 -p1 %patch1896 -p1 %patch1897 -p1 %patch1898 -p1 %patch1899 -p1 %patch1900 -p1 %patch1901 -p1 -#%patch1902 -p1 +%patch1902 -p1 ############################################################################## # %%prep - Additional prep required...