summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/generic/ldsodefs.h110
-rw-r--r--libc/sysdeps/generic/localplt.data9
-rw-r--r--libc/sysdeps/generic/sys/param.h75
-rw-r--r--libc/sysdeps/generic/tst-audit.h4
-rwxr-xr-xlibc/sysdeps/i386/configure43
-rw-r--r--libc/sysdeps/i386/configure.in32
-rw-r--r--libc/sysdeps/i386/fpu/e_expl.S42
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps530
-rw-r--r--libc/sysdeps/i386/fpu/s_expm1.S24
-rw-r--r--libc/sysdeps/i386/fpu/s_expm1f.S24
-rw-r--r--libc/sysdeps/i386/i386-mcount.S6
-rw-r--r--libc/sysdeps/i386/ldsodefs.h40
-rw-r--r--libc/sysdeps/i386/sysdep.h2
-rw-r--r--libc/sysdeps/i386/tls-macros.h76
-rw-r--r--libc/sysdeps/i386/tst-audit.h25
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_jn.c4
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_jnf.c4
-rw-r--r--libc/sysdeps/ieee754/flt-32/k_tanf.c2
-rw-r--r--libc/sysdeps/ieee754/k_standard.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_jnl.c4
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c4
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c38
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_ctanl.c34
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_jnl.c7
-rw-r--r--libc/sysdeps/mach/hurd/getgroups.c5
-rw-r--r--libc/sysdeps/mach/hurd/getlogin_r.c11
-rw-r--r--libc/sysdeps/mach/hurd/llistxattr.c35
-rw-r--r--libc/sysdeps/mach/hurd/lremovexattr.c35
-rw-r--r--libc/sysdeps/mach/hurd/sendto.c64
-rw-r--r--libc/sysdeps/mach/hurd/tmpfile.c2
-rw-r--r--libc/sysdeps/mach/sysdep.h2
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c10
-rw-r--r--libc/sysdeps/posix/getcwd.c2
-rw-r--r--libc/sysdeps/posix/libc_fatal.c5
-rw-r--r--libc/sysdeps/posix/pwrite64.c3
-rw-r--r--libc/sysdeps/posix/spawni.c3
-rw-r--r--libc/sysdeps/posix/sysconf.c5
-rw-r--r--libc/sysdeps/posix/tempname.c12
-rw-r--r--libc/sysdeps/powerpc/fpu/k_rem_pio2f.c4
-rw-r--r--libc/sysdeps/powerpc/fpu/libm-test-ulps275
-rw-r--r--libc/sysdeps/powerpc/ldsodefs.h54
-rw-r--r--libc/sysdeps/powerpc/powerpc32/Makefile3
-rw-r--r--libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/configure45
-rw-r--r--libc/sysdeps/powerpc/powerpc32/configure.in34
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/fprrest.S66
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/fprsave.S66
-rw-r--r--libc/sysdeps/powerpc/powerpc32/gprrest0.S36
-rw-r--r--libc/sysdeps/powerpc/powerpc32/gprrest1.S36
-rw-r--r--libc/sysdeps/powerpc/powerpc32/gprsave0.S36
-rw-r--r--libc/sysdeps/powerpc/powerpc32/gprsave1.S36
-rw-r--r--libc/sysdeps/powerpc/powerpc32/ppc-mcount.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/sysdep.h6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/tls-macros.h87
-rw-r--r--libc/sysdeps/powerpc/powerpc32/tst-audit.h25
-rw-r--r--libc/sysdeps/powerpc/powerpc64/configure64
-rw-r--r--libc/sysdeps/powerpc/powerpc64/configure.in53
-rw-r--r--libc/sysdeps/powerpc/powerpc64/tls-macros.h46
-rw-r--r--libc/sysdeps/powerpc/powerpc64/tst-audit.h25
-rw-r--r--libc/sysdeps/powerpc/tls-macros.h3
-rw-r--r--libc/sysdeps/s390/dl-irel.h52
-rw-r--r--libc/sysdeps/s390/ldsodefs.h57
-rw-r--r--libc/sysdeps/s390/s390-32/configure122
-rw-r--r--libc/sysdeps/s390/s390-32/configure.in29
-rw-r--r--libc/sysdeps/s390/s390-32/dl-machine.h24
-rw-r--r--libc/sysdeps/s390/s390-32/memcmp.S66
-rw-r--r--libc/sysdeps/s390/s390-32/memcpy.S90
-rw-r--r--libc/sysdeps/s390/s390-32/memset.S61
-rw-r--r--libc/sysdeps/s390/s390-32/multiarch/Makefile9
-rw-r--r--libc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c69
-rw-r--r--libc/sysdeps/s390/s390-32/multiarch/memcmp.S102
-rw-r--r--libc/sysdeps/s390/s390-32/multiarch/memcpy.S96
-rw-r--r--libc/sysdeps/s390/s390-32/multiarch/memset.S111
-rw-r--r--libc/sysdeps/s390/s390-32/s390-mcount.S4
-rw-r--r--libc/sysdeps/s390/s390-32/sysdep.h2
-rw-r--r--libc/sysdeps/s390/s390-32/tls-macros.h99
-rw-r--r--libc/sysdeps/s390/s390-32/tst-audit.h25
-rw-r--r--libc/sysdeps/s390/s390-64/configure122
-rw-r--r--libc/sysdeps/s390/s390-64/configure.in29
-rw-r--r--libc/sysdeps/s390/s390-64/dl-machine.h25
-rw-r--r--libc/sysdeps/s390/s390-64/memcmp.S64
-rw-r--r--libc/sysdeps/s390/s390-64/memcpy.S86
-rw-r--r--libc/sysdeps/s390/s390-64/memset.S51
-rw-r--r--libc/sysdeps/s390/s390-64/multiarch/Makefile3
-rw-r--r--libc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c74
-rw-r--r--libc/sysdeps/s390/s390-64/multiarch/memcmp.S101
-rw-r--r--libc/sysdeps/s390/s390-64/multiarch/memcpy.S94
-rw-r--r--libc/sysdeps/s390/s390-64/multiarch/memset.S109
-rw-r--r--libc/sysdeps/s390/s390-64/s390x-mcount.S4
-rw-r--r--libc/sysdeps/s390/s390-64/sysdep.h2
-rw-r--r--libc/sysdeps/s390/s390-64/tls-macros.h87
-rw-r--r--libc/sysdeps/s390/s390-64/tst-audit.h25
-rw-r--r--libc/sysdeps/sh/_mcount.S2
-rw-r--r--libc/sysdeps/sh/configure117
-rw-r--r--libc/sysdeps/sh/configure.in24
-rw-r--r--libc/sysdeps/sh/ldsodefs.h40
-rw-r--r--libc/sysdeps/sh/sysdep.h2
-rw-r--r--libc/sysdeps/sh/tls-macros.h143
-rw-r--r--libc/sysdeps/sh/tst-audit.h25
-rw-r--r--libc/sysdeps/sparc/configure54
-rw-r--r--libc/sysdeps/sparc/configure.in45
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps502
-rw-r--r--libc/sysdeps/sparc/ldsodefs.h55
-rw-r--r--libc/sysdeps/sparc/sparc32/tls-macros.h66
-rw-r--r--libc/sysdeps/sparc/sparc32/tst-audit.h25
-rw-r--r--libc/sysdeps/sparc/sparc64/tls-macros.h65
-rw-r--r--libc/sysdeps/sparc/sparc64/tst-audit.h25
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/siginfo.h13
-rw-r--r--libc/sysdeps/unix/sysv/linux/check_pf.c127
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure15
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure.in15
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/accept4.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/clone.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/epoll_pwait.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getcontext.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/mmap.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/mmap64.S7
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/nptl/localplt.data7
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/semtimedop.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setcontext.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/socket.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/swapcontext.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/syscall.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sysdep.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/vfork.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/if_index.c83
-rw-r--r--libc/sysdeps/unix/sysv/linux/ifaddrs.c31
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h76
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h10
-rw-r--r--libc/sysdeps/unix/sysv/linux/libc_fatal.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/netlinkaccess.h9
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c34
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S21
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c35
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c35
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S19
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data6
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S37
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S36
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h14
-rw-r--r--libc/sysdeps/unix/sysv/linux/prof-freq.c22
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h13
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S48
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c12
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data7
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S29
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c12
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data7
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h16
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/makecontext.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h13
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/localplt.data17
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/localplt.data19
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h15
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/epoll.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/ptrace.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/bits/siginfo.h11
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/__start_context.S5
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/clone.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/syscall.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/vfork.S3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/c++-types.data67
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c1
-rw-r--r--libc/sysdeps/wordsize-64/tmpfile.c3
-rw-r--r--libc/sysdeps/wordsize-64/tmpfile64.c1
-rw-r--r--libc/sysdeps/x86_64/_mcount.S6
-rw-r--r--libc/sysdeps/x86_64/configure39
-rw-r--r--libc/sysdeps/x86_64/configure.in28
-rw-r--r--libc/sysdeps/x86_64/fpu/e_expl.S42
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps520
-rw-r--r--libc/sysdeps/x86_64/ldsodefs.h55
-rw-r--r--libc/sysdeps/x86_64/sysdep.h2
-rw-r--r--libc/sysdeps/x86_64/tls-macros.h39
-rw-r--r--libc/sysdeps/x86_64/tst-audit.h32
206 files changed, 5819 insertions, 2042 deletions
diff --git a/libc/sysdeps/generic/ldsodefs.h b/libc/sysdeps/generic/ldsodefs.h
index 40fdf3c27..8d73212bb 100644
--- a/libc/sysdeps/generic/ldsodefs.h
+++ b/libc/sysdeps/generic/ldsodefs.h
@@ -182,28 +182,6 @@ enum allowmask
};
-/* Type for list of auditing interfaces. */
-struct La_i86_regs;
-struct La_i86_retval;
-struct La_x86_64_regs;
-struct La_x86_64_retval;
-struct La_x32_regs;
-struct La_x32_retval;
-struct La_ppc32_regs;
-struct La_ppc32_retval;
-struct La_ppc64_regs;
-struct La_ppc64_retval;
-struct La_sh_regs;
-struct La_sh_retval;
-struct La_s390_32_regs;
-struct La_s390_32_retval;
-struct La_s390_64_regs;
-struct La_s390_64_retval;
-struct La_sparc32_regs;
-struct La_sparc32_retval;
-struct La_sparc64_regs;
-struct La_sparc64_retval;
-
struct audit_ifaces
{
void (*activity) (uintptr_t *, unsigned int);
@@ -219,98 +197,12 @@ struct audit_ifaces
};
union
{
- Elf32_Addr (*i86_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_i86_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf64_Addr (*x86_64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_x86_64_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf32_Addr (*x32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_x32_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_ppc32_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_ppc64_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- uintptr_t (*sh_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, const struct La_sh_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf32_Addr (*s390_32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_s390_32_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf64_Addr (*s390_64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, struct La_s390_64_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf32_Addr (*sparc32_gnu_pltenter) (Elf32_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_sparc32_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
- Elf64_Addr (*sparc64_gnu_pltenter) (Elf64_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_sparc64_regs *,
- unsigned int *, const char *name,
- long int *framesizep);
#ifdef ARCH_PLTENTER_MEMBERS
ARCH_PLTENTER_MEMBERS;
#endif
};
union
{
- unsigned int (*i86_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, const struct La_i86_regs *,
- struct La_i86_retval *, const char *);
- unsigned int (*x86_64_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
- uintptr_t *,
- const struct La_x86_64_regs *,
- struct La_x86_64_retval *,
- const char *);
- unsigned int (*x32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *,
- const struct La_x32_regs *,
- struct La_x86_64_retval *,
- const char *);
- unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *,
- const struct La_ppc32_regs *,
- struct La_ppc32_retval *, const char *);
- unsigned int (*ppc64_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
- uintptr_t *,
- const struct La_ppc64_regs *,
- struct La_ppc64_retval *, const char *);
- unsigned int (*sh_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
- uintptr_t *, const struct La_sh_regs *,
- struct La_sh_retval *, const char *);
- unsigned int (*s390_32_gnu_pltexit) (Elf32_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_s390_32_regs *,
- struct La_s390_32_retval *,
- const char *);
- unsigned int (*s390_64_gnu_pltexit) (Elf64_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_s390_64_regs *,
- struct La_s390_64_retval *,
- const char *);
- unsigned int (*sparc32_gnu_pltexit) (Elf32_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_sparc32_regs *,
- struct La_sparc32_retval *,
- const char *);
- unsigned int (*sparc64_gnu_pltexit) (Elf64_Sym *, unsigned int,
- uintptr_t *, uintptr_t *,
- const struct La_sparc32_regs *,
- struct La_sparc32_retval *,
- const char *);
#ifdef ARCH_PLTEXIT_MEMBERS
ARCH_PLTEXIT_MEMBERS;
#endif
@@ -380,7 +272,7 @@ struct rtld_global
/* Search table for unique objects. */
struct unique_sym_table
{
- __rtld_lock_recursive_t lock;
+ __rtld_lock_define_recursive (, lock)
struct unique_sym
{
uint32_t hashval;
diff --git a/libc/sysdeps/generic/localplt.data b/libc/sysdeps/generic/localplt.data
new file mode 100644
index 000000000..d2965199f
--- /dev/null
+++ b/libc/sysdeps/generic/localplt.data
@@ -0,0 +1,9 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/generic/sys/param.h b/libc/sysdeps/generic/sys/param.h
index 0e10a0ea9..f6e9f431d 100644
--- a/libc/sysdeps/generic/sys/param.h
+++ b/libc/sysdeps/generic/sys/param.h
@@ -1,15 +1,74 @@
-/* This file should contain various parameter macros appropriate for the
- machine and operating system. There is no standard set of macros; this
- file is just for compatibility with programs written for Unix that
- expect it to define things. On Unix systems that do not have their own
- sysdep version of this file, it is generated at build time by examining
- the installed headers on the system. */
+/* Compatibility header for old-style Unix parameters and limits. Stub version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_PARAM_H
+
+#define _SYS_PARAM_H 1
+#include <features.h>
+
+#define __need_NULL
+#include <stddef.h>
+
+#include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
+#include <endian.h>
#include <limits.h>
-#define MAXSYMLINKS 1
-#define MAXPATHLEN 256
+
+/* BSD names for some <limits.h> values. We do not define the BSD names
+ for the values which are not statically limited, such as NOFILE. */
+
+#define NBBY CHAR_BIT
+#define NGROUPS NGROUPS_MAX
+#define MAXSYMLINKS SYMLOOP_MAX
+#define CANBSIZ MAX_CANON /* XXX ? */
+
+/* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
+ compare against some fixed limit. */
+#define NCARGS INT_MAX
+
+
+/* Magical constants. */
+#define NOGROUP 65535 /* Marker for empty group set member. */
+#define NODEV ((dev_t) -1) /* Non-existent device. */
+
+
+/* Bit map related macros. */
+#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+
+/* Macros for counting and rounding. */
+#ifndef howmany
+# define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
+#define powerof2(x) ((((x)-1)&(x))==0)
/* Macros for min/max. */
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
+
+
+/* Unit of `st_blocks'. */
+#define DEV_BSIZE 512
+
+
+#endif /* sys/param.h */
diff --git a/libc/sysdeps/generic/tst-audit.h b/libc/sysdeps/generic/tst-audit.h
index 402e7c066..45bc6039b 100644
--- a/libc/sysdeps/generic/tst-audit.h
+++ b/libc/sysdeps/generic/tst-audit.h
@@ -1,5 +1,5 @@
-/* Some machines have these macros defined in elf/tst-auditmod1.c directly.
- New machines can supply a tst-audit.h to define these macros used there.
+/* Machines can supply a tst-audit.h to define these macros used in
+ elf/tst-auditmod1.c.
# define pltenter la_CPU_gnu_pltenter
diff --git a/libc/sysdeps/i386/configure b/libc/sysdeps/i386/configure
index f56538f99..44bdb20b3 100755
--- a/libc/sysdeps/i386/configure
+++ b/libc/sysdeps/i386/configure
@@ -174,7 +174,7 @@ else
/* comment on
two lines */
${libc_cv_dot_text}
- ${libc_cv_asm_global_directive} foo
+ .globl foo
foo:
/* Unfortunately this test only works for a real instruction,
not for any of the machine-independent pseudo-ops.
@@ -349,45 +349,4 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
$as_echo "$libc_cv_cc_novzeroupper" >&6; }
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386 TLS support" >&5
-$as_echo_n "checking for i386 TLS support... " >&6; }
-if ${libc_cv_386_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.s <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .long 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 4
- .text
-baz: leal bar@TLSLDM(%ebx), %eax
- leal bar@DTPOFF(%eax), %edx
- subl foo@GOTTPOFF(%edx), %eax
- subl $bar@TPOFF, %eax
- movl foo@GOTNTPOFF(%edx), %ecx
- movl %gs:(%ecx), %eax
- movl %gs:bar@NTPOFF, %eax
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_386_tls=yes
-else
- libc_cv_386_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_386_tls" >&5
-$as_echo "$libc_cv_386_tls" >&6; }
-if test $libc_cv_386_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
-
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/libc/sysdeps/i386/configure.in b/libc/sysdeps/i386/configure.in
index b9e6f9eef..399f737ef 100644
--- a/libc/sysdeps/i386/configure.in
+++ b/libc/sysdeps/i386/configure.in
@@ -13,7 +13,7 @@ cat > conftest.S <<EOF
/* comment on
two lines */
${libc_cv_dot_text}
- ${libc_cv_asm_global_directive} foo
+ .globl foo
foo:
/* Unfortunately this test only works for a real instruction,
not for any of the machine-independent pseudo-ops.
@@ -86,36 +86,6 @@ LIBC_TRY_CC_OPTION([-mno-vzeroupper],
[libc_cv_cc_novzeroupper=no])
])
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for i386 TLS support, libc_cv_386_tls, [dnl
-cat > conftest.s <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .long 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 4
- .text
-baz: leal bar@TLSLDM(%ebx), %eax
- leal bar@DTPOFF(%eax), %edx
- subl foo@GOTTPOFF(%edx), %eax
- subl $bar@TPOFF, %eax
- movl foo@GOTNTPOFF(%edx), %ecx
- movl %gs:(%ecx), %eax
- movl %gs:bar@NTPOFF, %eax
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_386_tls=yes
-else
- libc_cv_386_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_386_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/libc/sysdeps/i386/fpu/e_expl.S b/libc/sysdeps/i386/fpu/e_expl.S
index bab0a081b..e42c9a121 100644
--- a/libc/sysdeps/i386/fpu/e_expl.S
+++ b/libc/sysdeps/i386/fpu/e_expl.S
@@ -60,10 +60,12 @@ c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#endif
+#ifndef USE_AS_EXPM1L
ASM_TYPE_DIRECTIVE(csat,@object)
csat: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(csat)
+#endif
#ifdef PIC
# define MO(op) op##@GOTOFF(%ecx)
@@ -88,9 +90,26 @@ ENTRY(IEEE754_EXPL)
#ifdef PIC
LOAD_PIC_REG (cx)
#endif
-#ifndef USE_AS_EXPM1L
+#ifdef USE_AS_EXPM1L
+ xorb $0x80, %ah
+ cmpl $0xc006, %eax
+ fstsw %ax
+ movb $0x45, %dh
+ jb 4f
+
+ /* Below -64.0 (may be -NaN or -Inf). */
+ andb %ah, %dh
+ cmpb $0x01, %dh
+ je 2f /* Is +-NaN, jump. */
+ jmp 1f /* -large, possibly -Inf. */
+
+4: /* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf). */
+ /* Test for +-0 as argument. */
+ andb %ah, %dh
+ cmpb $0x40, %dh
+ je 2f
+#else
movzwl 4+8(%esp), %eax
-#endif
andl $0x7fff, %eax
cmpl $0x400d, %eax
jle 3f
@@ -108,16 +127,8 @@ ENTRY(IEEE754_EXPL)
andb $2, %ah
jz 3f
fchs
-3:
-#ifdef USE_AS_EXPM1L
- /* Test for +-0 as argument. */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x40, %dh
- je 2f
#endif
- FLDLOG /* 1 log2(base) */
+3: FLDLOG /* 1 log2(base) */
fmul %st(1), %st /* 1 x log2(base) */
frndint /* 1 i */
fld %st(1) /* 2 x */
@@ -154,13 +165,16 @@ ENTRY(IEEE754_EXPL)
#endif
fstp %st(1) /* 0 */
jmp 2f
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
+1:
#ifdef USE_AS_EXPM1L
+ /* For expm1l, only negative sign gets here. */
+ fstp %st
fld1
fchs
#else
+ testl $0x200, %eax /* Test sign. */
+ jz 2f /* If positive, jump. */
+ fstp %st
fldz /* Set result to 0. */
#endif
2: ret
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 4661aea4a..f832e17a2 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -789,11 +789,38 @@ ildouble: 1
ldouble: 1
# clog
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.234566p-30 + 1.0 i) == 5.614163921211322622623353961365728040115e-19 + 1.570796325735258575254858696548386439740 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
ildouble: 1
ldouble: 1
@@ -803,12 +830,33 @@ ldouble: 1
Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-149 + 0x1p-149 i) == -102.9323563131518784484589700365392203592 + pi/4 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -821,6 +869,68 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.234566p-40 - 1.0 i) == 2.325249110681915353442924915876654139373e-25 - 6.821881769213700828789403802671540158935e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1.fp+16383 + 0x1p-16445 i) == 4932.061660674182269085496060792589701158 + 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (-0x1.fp+16383 - 0x1p-16445 i) == 4932.061660674182269085496060792589701158 - 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1p-16445 + 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (-0x1p-16445 - 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
idouble: 1
@@ -876,6 +986,19 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
ildouble: 1
ldouble: 1
@@ -896,17 +1019,37 @@ ldouble: 1
Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p-16445 i) == 4932.061660674182269085496060792589701158 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 - 0x1p-16445 i) == 4932.061660674182269085496060792589701158 - 0 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
ildouble: 1
ldouble: 1
@@ -915,12 +1058,58 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1p-16445 + 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1p-16445 - 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-8190 + 1.0 i) == 2.920285685286322365786846845062520925172e-4932 + 6.821881769209206737428918127156778851051e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -1374,6 +1563,30 @@ float: 1
ifloat: 1
# csqrt
+Test "Real part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000001p-1022 - 0x1.0000000000001p-1022 i) == 6.788430486774966350907249113759995429568e-155 - 1.638872094839911521020410942677082920935e-154 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000001p-1022 + 0x1.0000000000001p-1022 i) == 1.638872094839911521020410942677082920935e-154 + 6.788430486774966350907249113759995429568e-155 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
ildouble: 1
ldouble: 1
@@ -1437,6 +1650,93 @@ idouble: 1
ildouble: 2
ldouble: 2
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+# ctan_tonearest
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 4
+ldouble: 4
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
float: 1
@@ -1488,6 +1788,93 @@ idouble: 1
ildouble: 2
ldouble: 2
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Real part of: ctanh_tonearest (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 2
+ldouble: 2
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1581,6 +1968,9 @@ idouble: 1
ifloat: 1
# expm1
+Test "expm1 (-45.0) == -0.9999999999999999999713748141945060635553":
+ildouble: 1
+ldouble: 1
Test "expm1 (1) == M_El - 1.0":
ildouble: 1
Test "expm1 (11356.25) == 9.05128237311923300051376115753226014206e+4931":
@@ -2152,9 +2542,45 @@ double: 1
idouble: 1
# tan
+Test "tan (-0xc.90fdbp-4) == -1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fdcp-4) == -1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fep-4) == -1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (-0xc.91p-4) == -1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (-0xc.92p-4) == -1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (-0xc.94p-4) == -1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575":
ildouble: 1
ldouble: 1
+Test "tan (0xc.90fdbp-4) == 1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fdcp-4) == 1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fep-4) == 1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (0xc.91p-4) == 1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (0xc.92p-4) == 1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (0xc.94p-4) == 1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
Test "tan (1e22) == -1.628778225606898878549375936939548513545":
ildouble: 1
ldouble: 1
@@ -2858,6 +3284,10 @@ ifloat: 1
ildouble: 2
ldouble: 2
+Function: Real part of "csqrt":
+ildouble: 1
+ldouble: 1
+
Function: Imaginary part of "csqrt":
ildouble: 1
ldouble: 1
@@ -2878,6 +3308,56 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ctan_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_downward":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctan_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctan_towardzero":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctan_upward":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -2894,6 +3374,56 @@ ifloat: 1
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_towardzero":
+float: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_upward":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/sysdeps/i386/fpu/s_expm1.S b/libc/sysdeps/i386/fpu/s_expm1.S
index 9883f9b35..d2754de91 100644
--- a/libc/sysdeps/i386/fpu/s_expm1.S
+++ b/libc/sysdeps/i386/fpu/s_expm1.S
@@ -51,19 +51,31 @@ ENTRY(__expm1)
jae HIDDEN_JUMPTARGET (__exp)
fldl 4(%esp) // x
- fxam // Is NaN or +-Inf?
+ fxam // Is NaN, +-Inf or +-0?
+ xorb $0x80, %ah
+ cmpl $0xc043, %eax // is num <= -38.0?
fstsw %ax
movb $0x45, %ch
+ jb 4f
+
+ // Below -38.0 (may be -NaN or -Inf).
+ andb %ah, %ch
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#endif
+ cmpb $0x01, %ch
+ je 5f // If -NaN, jump.
+ jmp 2f // -large, possibly -Inf.
+
+4: // In range -38.0 to 704.0 (may be +-0 but not NaN or +-Inf).
andb %ah, %ch
cmpb $0x40, %ch
je 3f // If +-0, jump.
#ifdef PIC
LOAD_PIC_REG (dx)
#endif
- cmpb $0x05, %ch
- je 2f // If +-Inf, jump.
- fldt MO(l2e) // log2(e) : x
+5: fldt MO(l2e) // log2(e) : x
fmulp // log2(e)*x
fld %st // log2(e)*x : log2(e)*x
frndint // int(log2(e)*x) : log2(e)*x
@@ -79,9 +91,7 @@ ENTRY(__expm1)
fsubrp %st, %st(1) // 2^(log2(e)*x)
ret
-2: testl $0x200, %eax // Test sign.
- jz 3f // If positive, jump.
- fstp %st
+2: fstp %st
fldl MO(minus1) // Set result to -1.0.
3: ret
END(__expm1)
diff --git a/libc/sysdeps/i386/fpu/s_expm1f.S b/libc/sysdeps/i386/fpu/s_expm1f.S
index 45257d752..fc82b9234 100644
--- a/libc/sysdeps/i386/fpu/s_expm1f.S
+++ b/libc/sysdeps/i386/fpu/s_expm1f.S
@@ -51,19 +51,31 @@ ENTRY(__expm1f)
jae HIDDEN_JUMPTARGET (__expf)
flds 4(%esp) // x
- fxam // Is NaN or +-Inf?
+ fxam // Is NaN, +-Inf or +-0?
+ xorb $0x80, %ah
+ cmpl $0xc190, %eax // is num <= -18.0?
fstsw %ax
movb $0x45, %ch
+ jb 4f
+
+ // Below -18.0 (may be -NaN or -Inf).
+ andb %ah, %ch
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#endif
+ cmpb $0x01, %ch
+ je 5f // If -NaN, jump.
+ jmp 2f // -large, possibly -Inf.
+
+4: // In range -18.0 to 88.5 (may be +-0 but not NaN or +-Inf).
andb %ah, %ch
cmpb $0x40, %ch
je 3f // If +-0, jump.
#ifdef PIC
LOAD_PIC_REG (dx)
#endif
- cmpb $0x05, %ch
- je 2f // If +-Inf, jump.
- fldt MO(l2e) // log2(e) : x
+5: fldt MO(l2e) // log2(e) : x
fmulp // log2(e)*x
fld %st // log2(e)*x : log2(e)*x
frndint // int(log2(e)*x) : log2(e)*x
@@ -79,9 +91,7 @@ ENTRY(__expm1f)
fsubrp %st, %st(1) // 2^(log2(e)*x)
ret
-2: testl $0x200, %eax // Test sign.
- jz 3f // If positive, jump.
- fstp %st
+2: fstp %st
fldl MO(minus1) // Set result to -1.0.
3: ret
END(__expm1f)
diff --git a/libc/sysdeps/i386/i386-mcount.S b/libc/sysdeps/i386/i386-mcount.S
index 66a3caa30..11f7493c3 100644
--- a/libc/sysdeps/i386/i386-mcount.S
+++ b/libc/sysdeps/i386/i386-mcount.S
@@ -1,5 +1,5 @@
/* i386-specific implemetation of profiling support.
- Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,7 +26,7 @@
- the ELF `fixup' function uses GCC's regparm feature
- some (future) systems might want to pass parameters in registers. */
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
+ .globl C_SYMBOL_NAME(_mcount)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
.align ALIGNARG(4)
C_LABEL(_mcount)
@@ -54,7 +54,7 @@ C_LABEL(_mcount)
weak_alias (_mcount, mcount)
/* Same as above, but doesn't require a frame pointer */
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(__fentry__)
+ .globl C_SYMBOL_NAME(__fentry__)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(__fentry__), @function)
.align ALIGNARG(4)
C_LABEL(__fentry__)
diff --git a/libc/sysdeps/i386/ldsodefs.h b/libc/sysdeps/i386/ldsodefs.h
new file mode 100644
index 000000000..74880e9eb
--- /dev/null
+++ b/libc/sysdeps/i386/ldsodefs.h
@@ -0,0 +1,40 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _I386_LDSODEFS_H
+#define _I386_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_i86_regs;
+struct La_i86_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf32_Addr (*i86_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_i86_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*i86_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, const struct La_i86_regs *, \
+ struct La_i86_retval *, const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/i386/sysdep.h b/libc/sysdeps/i386/sysdep.h
index b31caab0f..01e681791 100644
--- a/libc/sysdeps/i386/sysdep.h
+++ b/libc/sysdeps/i386/sysdep.h
@@ -63,7 +63,7 @@
#define ENTRY(name) \
STABS_CURRENT_FILE1("") \
STABS_CURRENT_FILE(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
STABS_FUN(name) \
diff --git a/libc/sysdeps/i386/tls-macros.h b/libc/sysdeps/i386/tls-macros.h
new file mode 100644
index 000000000..0b857383c
--- /dev/null
+++ b/libc/sysdeps/i386/tls-macros.h
@@ -0,0 +1,76 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ asm ("movl %%gs:0,%0\n\t" \
+ "subl $" #x "@tpoff,%0" \
+ : "=r" (__l)); \
+ __l; })
+
+#ifdef PIC
+# define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("movl %%gs:0,%0\n\t" \
+ "subl " #x "@gottpoff(%%ebx),%0" \
+ : "=r" (__l)); \
+ __l; })
+#else
+# define TLS_IE(x) \
+ ({ int *__l, __b; \
+ asm ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "movl %%gs:0,%0\n\t" \
+ "subl " #x "@gottpoff(%%ebx),%0" \
+ : "=r" (__l), "=&b" (__b)); \
+ __l; })
+#endif
+
+#ifdef PIC
+# define TLS_LD(x) \
+ ({ int *__l, __c, __d; \
+ asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "leal " #x "@dtpoff(%%eax), %%eax" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#else
+# define TLS_LD(x) \
+ ({ int *__l, __b, __c, __d; \
+ asm ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "leal " #x "@dtpoff(%%eax), %%eax" \
+ : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#endif
+
+#ifdef PIC
+# define TLS_GD(x) \
+ ({ int *__l, __c, __d; \
+ asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "nop" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#else
+# define TLS_GD(x) \
+ ({ int *__l, __b, __c, __d; \
+ asm ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "nop" \
+ : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#endif
diff --git a/libc/sysdeps/i386/tst-audit.h b/libc/sysdeps/i386/tst-audit.h
new file mode 100644
index 000000000..082c559c7
--- /dev/null
+++ b/libc/sysdeps/i386/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. i386 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_i86_gnu_pltenter
+#define pltexit la_i86_gnu_pltexit
+#define La_regs La_i86_regs
+#define La_retval La_i86_retval
+#define int_retval lrv_eax
diff --git a/libc/sysdeps/ieee754/dbl-64/e_jn.c b/libc/sysdeps/ieee754/dbl-64/e_jn.c
index 63788c5a2..0d2a24c93 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_jn.c
@@ -36,6 +36,7 @@
*
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
@@ -276,6 +277,9 @@ __ieee754_yn(int n, double x)
GET_HIGH_WORD(high,b);
a = temp;
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! __finite (b))
+ __set_errno (ERANGE);
}
if(sign>0) return b; else return -b;
}
diff --git a/libc/sysdeps/ieee754/flt-32/e_jnf.c b/libc/sysdeps/ieee754/flt-32/e_jnf.c
index bed9cee7a..ad26d7e8a 100644
--- a/libc/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_jnf.c
@@ -13,6 +13,7 @@
* ====================================================
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
@@ -199,6 +200,9 @@ __ieee754_ynf(int n, float x)
GET_FLOAT_WORD(ib,b);
a = temp;
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! __finitef (b))
+ __set_errno (ERANGE);
if(sign>0) return b; else return -b;
}
strong_alias (__ieee754_ynf, __ynf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/k_tanf.c b/libc/sysdeps/ieee754/flt-32/k_tanf.c
index 92206069c..be9a5d0f0 100644
--- a/libc/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/libc/sysdeps/ieee754/flt-32/k_tanf.c
@@ -56,6 +56,8 @@ float __kernel_tanf(float x, float y, int iy)
z = pio4-x;
w = pio4lo-y;
x = z+w; y = 0.0;
+ if (fabsf (x) < 0x1p-13f)
+ return (1 - ((hx >> 30) & 2)) * iy * (1.0f - 2 * iy * x);
}
z = x*x;
w = z*z;
diff --git a/libc/sysdeps/ieee754/k_standard.c b/libc/sysdeps/ieee754/k_standard.c
index 4e65bb16c..cd3123046 100644
--- a/libc/sysdeps/ieee754/k_standard.c
+++ b/libc/sysdeps/ieee754/k_standard.c
@@ -1003,6 +1003,7 @@ __kernel_standard_f(float x, float y, int type)
return __kernel_standard(x, y, type);
}
+#ifndef __NO_LONG_DOUBLE_MATH
long double
__kernel_standard_l (long double x, long double y, int type)
{
@@ -1082,3 +1083,4 @@ __kernel_standard_l (long double x, long double y, int type)
return __kernel_standard (dx, dy, type);
}
}
+#endif
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
index e320d994b..70d5672fd 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -56,6 +56,7 @@
*
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
@@ -385,6 +386,9 @@ __ieee754_ynl (int n, long double x)
a = temp;
}
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! __finitel (b))
+ __set_errno (ERANGE);
if (sign > 0)
return b;
else
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 930a2bcbd..40012e41e 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -56,6 +56,7 @@
*
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
@@ -387,6 +388,9 @@ __ieee754_ynl (int n, long double x)
a = temp;
}
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! __finitel (b))
+ __set_errno (ERANGE);
if (sign > 0)
return b;
else
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c
index 2ab80a224..e11ce5678 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c
@@ -25,6 +25,8 @@
#include <math_private.h>
+/* IBM long double GCC builtin sets LDBL_EPSILON == LDBL_DENORM_MIN */
+static const long double ldbl_eps = 0x1p-106L;
__complex__ long double
__ctanhl (__complex__ long double x)
@@ -35,8 +37,8 @@ __ctanhl (__complex__ long double x)
{
if (__isinfl (__real__ x))
{
- __real__ res = __copysignl (1.0, __real__ x);
- __imag__ res = __copysignl (0.0, __imag__ x);
+ __real__ res = __copysignl (1.0L, __real__ x);
+ __imag__ res = __copysignl (0.0L, __imag__ x);
}
else if (__imag__ x == 0.0)
{
@@ -57,7 +59,7 @@ __ctanhl (__complex__ long double x)
{
long double sinix, cosix;
long double den;
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2);
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2.0L);
/* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
= (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */
@@ -71,7 +73,7 @@ __ctanhl (__complex__ long double x)
the real part is +/- 1, the imaginary part is
sin(y)*cos(y)/sinh(x)^2 = 4*sin(y)*cos(y)/exp(2x). */
long double exp_2t = __ieee754_expl (2 * t);
- __real__ res = __copysignl (1.0, __real__ x);
+ __real__ res = __copysignl (1.0L, __real__ x);
__imag__ res = 4 * sinix * cosix;
__real__ x = fabsl (__real__ x);
__real__ x -= t;
@@ -83,22 +85,34 @@ __ctanhl (__complex__ long double x)
__imag__ res /= exp_2t;
}
else
- __imag__ res /= __ieee754_expl (2 * __real__ x);
+ __imag__ res /= __ieee754_expl (2.0L * __real__ x);
}
else
{
- long double sinhrx = __ieee754_sinhl (__real__ x);
- long double coshrx = __ieee754_coshl (__real__ x);
+ long double sinhrx, coshrx;
+ if (fabs (__real__ x) > LDBL_MIN)
+ {
+ sinhrx = __ieee754_sinhl (__real__ x);
+ coshrx = __ieee754_coshl (__real__ x);
+ }
+ else
+ {
+ sinhrx = __real__ x;
+ coshrx = 1.0L;
+ }
- den = sinhrx * sinhrx + cosix * cosix;
- __real__ res = sinhrx * coshrx / den;
- __imag__ res = sinix * cosix / den;
+ if (fabsl (sinhrx) > fabsl (cosix) * ldbl_eps)
+ den = sinhrx * sinhrx + cosix * cosix;
+ else
+ den = cosix * cosix;
+ __real__ res = sinhrx * (coshrx / den);
+ __imag__ res = sinix * (cosix / den);
}
/* __gcc_qmul does not respect -0.0 so we need the following fixup. */
- if ((__real__ res == 0.0) && (__real__ x == 0.0))
+ if ((__real__ res == 0.0L) && (__real__ x == 0.0L))
__real__ res = __real__ x;
- if ((__real__ res == 0.0) && (__imag__ x == 0.0))
+ if ((__real__ res == 0.0L) && (__imag__ x == 0.0L))
__imag__ res = __imag__ x;
}
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanl.c
index 9d89bbe31..34a370a30 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_ctanl.c
@@ -25,6 +25,8 @@
#include <math_private.h>
+/* IBM long double GCC builtin sets LDBL_EPSILON == LDBL_DENORM_MIN */
+static const long double ldbl_eps = 0x1p-106L;
__complex__ long double
__ctanl (__complex__ long double x)
@@ -55,7 +57,7 @@ __ctanl (__complex__ long double x)
{
long double sinrx, cosrx;
long double den;
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2);
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2.0L);
/* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
= (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
@@ -70,7 +72,7 @@ __ctanl (__complex__ long double x)
sin(x)*cos(x)/sinh(y)^2 = 4*sin(x)*cos(x)/exp(2y). */
long double exp_2t = __ieee754_expl (2 * t);
- __imag__ res = __copysignl (1.0, __imag__ x);
+ __imag__ res = __copysignl (1.0L, __imag__ x);
__real__ res = 4 * sinrx * cosrx;
__imag__ x = fabsl (__imag__ x);
__imag__ x -= t;
@@ -82,23 +84,35 @@ __ctanl (__complex__ long double x)
__real__ res /= exp_2t;
}
else
- __real__ res /= __ieee754_expl (2 * __imag__ x);
+ __real__ res /= __ieee754_expl (2.0L * __imag__ x);
}
else
{
- long double sinhix = __ieee754_sinhl (__imag__ x);
- long double coshix = __ieee754_coshl (__imag__ x);
+ long double sinhix, coshix;
+ if (fabsl (__imag__ x) > LDBL_MIN)
+ {
+ sinhix = __ieee754_sinhl (__imag__ x);
+ coshix = __ieee754_coshl (__imag__ x);
+ }
+ else
+ {
+ sinhix = __imag__ x;
+ coshix = 1.0L;
+ }
- den = cosrx * cosrx + sinhix * sinhix;
- __real__ res = sinrx * cosrx / den;
- __imag__ res = sinhix * coshix / den;
+ if (fabsl (sinhix) > fabsl (cosrx) * ldbl_eps)
+ den = cosrx * cosrx + sinhix * sinhix;
+ else
+ den = cosrx * cosrx;
+ __real__ res = sinrx * (cosrx / den);
+ __imag__ res = sinhix * (coshix / den);
}
/* __gcc_qmul does not respect -0.0 so we need the following fixup. */
- if ((__real__ res == 0.0) && (__real__ x == 0.0))
+ if ((__real__ res == 0.0L) && (__real__ x == 0.0L))
__real__ res = __real__ x;
- if ((__real__ res == 0.0) && (__imag__ x == 0.0))
+ if ((__real__ res == 0.0L) && (__imag__ x == 0.0L))
__imag__ res = __imag__ x;
}
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_jnl.c b/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
index 2e206e7e2..58a9107f7 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
@@ -56,6 +56,7 @@
*
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
@@ -360,7 +361,8 @@ __ieee754_ynl (int n, long double x)
b = __ieee754_y1l (x);
/* quit if b is -inf */
GET_LDOUBLE_WORDS (se, i0, i1, b);
- for (i = 1; i < n && se != 0xffff; i++)
+ /* Use 0xffffffff since GET_LDOUBLE_WORDS sign-extends SE. */
+ for (i = 1; i < n && se != 0xffffffff; i++)
{
temp = b;
b = ((long double) (i + i) / x) * b - a;
@@ -368,6 +370,9 @@ __ieee754_ynl (int n, long double x)
a = temp;
}
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! __finitel (b))
+ __set_errno (ERANGE);
if (sign > 0)
return b;
else
diff --git a/libc/sysdeps/mach/hurd/getgroups.c b/libc/sysdeps/mach/hurd/getgroups.c
index 157a98174..35b219ef6 100644
--- a/libc/sysdeps/mach/hurd/getgroups.c
+++ b/libc/sysdeps/mach/hurd/getgroups.c
@@ -30,6 +30,9 @@ __getgroups (n, gidset)
int ngids;
void *crit;
+ if (n < 0)
+ return __hurd_fail (EINVAL);
+
crit = _hurd_critical_section_lock ();
__mutex_lock (&_hurd_id.lock);
@@ -53,7 +56,7 @@ __getgroups (n, gidset)
/* Now that the lock is released, we can safely copy the
group set into the user's array, which might fault. */
if (ngids > n)
- ngids = n;
+ return __hurd_fail (EINVAL);
memcpy (gidset, gids, ngids * sizeof (gid_t));
}
else
diff --git a/libc/sysdeps/mach/hurd/getlogin_r.c b/libc/sysdeps/mach/hurd/getlogin_r.c
index 2539e6b0a..5410709e7 100644
--- a/libc/sysdeps/mach/hurd/getlogin_r.c
+++ b/libc/sysdeps/mach/hurd/getlogin_r.c
@@ -29,13 +29,20 @@ getlogin_r (name, name_len)
char *name;
size_t name_len;
{
- static char login[1024]; /* XXX */
+ string_t login;
error_t err;
if (err = __USEPORT (PROC, __proc_getlogin (port, login)))
return errno = err;
- strncpy (name, login, name_len);
+ size_t len = __strnlen (login, sizeof login - 1) + 1;
+ if (len > name_len)
+ {
+ errno = ERANGE;
+ return errno;
+ }
+
+ memcpy (name, login, len);
return 0;
}
libc_hidden_def (getlogin_r)
diff --git a/libc/sysdeps/mach/hurd/llistxattr.c b/libc/sysdeps/mach/hurd/llistxattr.c
new file mode 100644
index 000000000..23fb165c7
--- /dev/null
+++ b/libc/sysdeps/mach/hurd/llistxattr.c
@@ -0,0 +1,35 @@
+/* Access to extended attributes on files. Hurd version.
+ Copyright (C) 2005-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <sys/xattr.h>
+#include <hurd.h>
+#include <hurd/xattr.h>
+#include <fcntl.h>
+
+ssize_t
+llistxattr (const char *path, char *list, size_t size)
+{
+ error_t err;
+ file_t port = __file_name_lookup (path, O_NOLINK, 0);
+ if (port == MACH_PORT_NULL)
+ return -1;
+ err = _hurd_xattr_list (port, list, &size);
+ __mach_port_deallocate (__mach_task_self (), port);
+ return err ? __hurd_fail (err) : size;
+}
diff --git a/libc/sysdeps/mach/hurd/lremovexattr.c b/libc/sysdeps/mach/hurd/lremovexattr.c
new file mode 100644
index 000000000..32a96ac33
--- /dev/null
+++ b/libc/sysdeps/mach/hurd/lremovexattr.c
@@ -0,0 +1,35 @@
+/* Access to extended attributes on files. Hurd version.
+ Copyright (C) 2005-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <sys/xattr.h>
+#include <hurd.h>
+#include <hurd/xattr.h>
+#include <fcntl.h>
+
+ssize_t
+lremovexattr (const char *path, const char *name)
+{
+ error_t err;
+ file_t port = __file_name_lookup (path, O_NOLINK, 0);
+ if (port == MACH_PORT_NULL)
+ return -1;
+ err = _hurd_xattr_remove (port, name);
+ __mach_port_deallocate (__mach_task_self (), port);
+ return __hurd_fail (err);
+}
diff --git a/libc/sysdeps/mach/hurd/sendto.c b/libc/sysdeps/mach/hurd/sendto.c
index c641757dd..bd4123ea1 100644
--- a/libc/sysdeps/mach/hurd/sendto.c
+++ b/libc/sysdeps/mach/hurd/sendto.c
@@ -33,37 +33,50 @@ __sendto (int fd,
const struct sockaddr_un *addr,
socklen_t addr_len)
{
- addr_port_t aport;
+ addr_port_t aport = MACH_PORT_NULL;
error_t err;
size_t wrote;
- if (addr->sun_family == AF_LOCAL)
+ /* Get an address port for the desired destination address. */
+ error_t create_address_port (io_t port,
+ const struct sockaddr_un *addr,
+ socklen_t addr_len,
+ addr_port_t *aport)
{
- /* For the local domain, we must look up the name as a file and talk
- to it with the ifsock protocol. */
- file_t file = __file_name_lookup (addr->sun_path, 0, 0);
- if (file == MACH_PORT_NULL)
- return -1;
- err = __ifsock_getsockaddr (file, &aport);
- __mach_port_deallocate (__mach_task_self (), file);
- if (err == MIG_BAD_ID || err == EOPNOTSUPP)
- /* The file did not grok the ifsock protocol. */
- err = ENOTSOCK;
- if (err)
- return __hurd_fail (err);
+ error_t err_port;
+
+ if (addr->sun_family == AF_LOCAL)
+ {
+ /* For the local domain, we must look up the name as a file and talk
+ to it with the ifsock protocol. */
+ file_t file = __file_name_lookup (addr->sun_path, 0, 0);
+ if (file == MACH_PORT_NULL)
+ return errno;
+ err_port = __ifsock_getsockaddr (file, aport);
+ __mach_port_deallocate (__mach_task_self (), file);
+ if (err_port == MIG_BAD_ID || err_port == EOPNOTSUPP)
+ /* The file did not grok the ifsock protocol. */
+ err_port = ENOTSOCK;
+ }
+ else
+ {
+ err_port = __socket_create_address (port,
+ addr->sun_family,
+ (char *) addr,
+ addr_len,
+ aport);
+ }
+
+ return err_port;
}
- else
- err = EIEIO;
- /* Get an address port for the desired destination address. */
err = HURD_DPORT_USE (fd,
({
- if (err)
- err = __socket_create_address (port,
- addr->sun_family,
- (char *) addr,
- addr_len,
- &aport);
+ if (addr != NULL)
+ err = create_address_port (port, addr, addr_len,
+ &aport);
+ else
+ err = 0;
if (! err)
{
/* Send the data. */
@@ -72,12 +85,13 @@ __sendto (int fd,
NULL,
MACH_MSG_TYPE_COPY_SEND, 0,
NULL, 0, &wrote);
- __mach_port_deallocate (__mach_task_self (),
- aport);
}
err;
}));
+ if (aport != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), aport);
+
return err ? __hurd_sockfail (fd, flags, err) : wrote;
}
diff --git a/libc/sysdeps/mach/hurd/tmpfile.c b/libc/sysdeps/mach/hurd/tmpfile.c
index 94b1380da..c2aa76491 100644
--- a/libc/sysdeps/mach/hurd/tmpfile.c
+++ b/libc/sysdeps/mach/hurd/tmpfile.c
@@ -37,7 +37,7 @@ __tmpfile (void)
FILE *f;
/* Get a port to the directory that will contain the file. */
- const char *dirname = __secure_getenv ("TMPDIR") ?: P_tmpdir;
+ const char *dirname = __libc_secure_getenv ("TMPDIR") ?: P_tmpdir;
file_t dir = __file_name_lookup (dirname, 0, 0);
if (dir == MACH_PORT_NULL)
return NULL;
diff --git a/libc/sysdeps/mach/sysdep.h b/libc/sysdeps/mach/sysdep.h
index 3bcb9b32b..29a2c8e90 100644
--- a/libc/sysdeps/mach/sysdep.h
+++ b/libc/sysdeps/mach/sysdep.h
@@ -31,7 +31,7 @@
work right. */
#undef ENTRY
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE name; \
+ .globl name; \
.align ALIGN; \
.type name,@function; \
name:
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index 2eca2ae0e..78a2474b1 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -568,7 +568,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
IPv6 scope ids. */
if (req->ai_family == AF_INET)
{
- size_t tmpbuflen = 512;
+ /* 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;
@@ -811,7 +813,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
old_res_options = _res.options;
_res.options &= ~RES_USE_INET6;
- size_t tmpbuflen = 1024;
+ size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple);
malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
assert (tmpbuf == NULL);
if (!malloc_tmpbuf)
@@ -1113,7 +1115,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
struct hostent *h = NULL;
int herrno;
struct hostent th;
- size_t tmpbuf2len = 512;
+ /* Add room for struct host_data. */
+ size_t tmpbuf2len = (512 + (MAX_NR_ALIASES+MAX_NR_ADDRS+1)
+ * sizeof(char*) + 16 * sizeof(char));
do
{
diff --git a/libc/sysdeps/posix/getcwd.c b/libc/sysdeps/posix/getcwd.c
index 1dc45e8ee..911cbfab5 100644
--- a/libc/sysdeps/posix/getcwd.c
+++ b/libc/sysdeps/posix/getcwd.c
@@ -401,8 +401,10 @@ __getcwd (buf, size)
goto lose;
}
+#ifdef _DIRENT_HAVE_D_TYPE
if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
continue;
+#endif
if (d->d_name[0] == '.'
&& (d->d_name[1] == '\0'
|| (d->d_name[1] == '.' && d->d_name[2] == '\0')))
diff --git a/libc/sysdeps/posix/libc_fatal.c b/libc/sysdeps/posix/libc_fatal.c
index 62acb9bea..6b741297c 100644
--- a/libc/sysdeps/posix/libc_fatal.c
+++ b/libc/sysdeps/posix/libc_fatal.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993-1995,1997,2000,2004,2005,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 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
@@ -61,7 +60,7 @@ __libc_message (int do_abort, const char *fmt, ...)
/* Open a descriptor for /dev/tty unless the user explicitly
requests errors on standard error. */
- const char *on_2 = __secure_getenv ("LIBC_FATAL_STDERR_");
+ const char *on_2 = __libc_secure_getenv ("LIBC_FATAL_STDERR_");
if (on_2 == NULL || *on_2 == '\0')
fd = open_not_cancel_2 (_PATH_TTY, O_RDWR | O_NOCTTY | O_NDELAY);
diff --git a/libc/sysdeps/posix/pwrite64.c b/libc/sysdeps/posix/pwrite64.c
index d9ec10f38..61c193bea 100644
--- a/libc/sysdeps/posix/pwrite64.c
+++ b/libc/sysdeps/posix/pwrite64.c
@@ -1,6 +1,6 @@
/* Write block to given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -56,7 +56,6 @@ __libc_pwrite64 (int fd, const void *buf, size_t nbyte, off64_t offset)
return result;
}
#ifndef __libc_pwrite64
-libc_hidden_def (__libc_pwrite64)
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
diff --git a/libc/sysdeps/posix/spawni.c b/libc/sysdeps/posix/spawni.c
index abbf95622..2d3ae941d 100644
--- a/libc/sysdeps/posix/spawni.c
+++ b/libc/sysdeps/posix/spawni.c
@@ -1,5 +1,5 @@
/* Guts of POSIX spawn interface. Generic POSIX.1 version.
- Copyright (C) 2000-2005, 2006, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 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,6 +20,7 @@
#include <fcntl.h>
#include <paths.h>
#include <spawn.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/libc/sysdeps/posix/sysconf.c b/libc/sysdeps/posix/sysconf.c
index 1f988d547..d9b3c83ab 100644
--- a/libc/sysdeps/posix/sysconf.c
+++ b/libc/sysdeps/posix/sysconf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1993,1995-1997,1999-2003,2004,2006,2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -1259,7 +1258,7 @@ __sysconf_check_spec (const char *spec)
{
int save_errno = errno;
- const char *getconf_dir = __secure_getenv ("GETCONF_DIR") ?: GETCONF_DIR;
+ const char *getconf_dir = __libc_secure_getenv ("GETCONF_DIR") ?: GETCONF_DIR;
size_t getconf_dirlen = strlen (getconf_dir);
size_t speclen = strlen (spec);
diff --git a/libc/sysdeps/posix/tempname.c b/libc/sysdeps/posix/tempname.c
index a98f1d6e9..2f0bfef34 100644
--- a/libc/sysdeps/posix/tempname.c
+++ b/libc/sysdeps/posix/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2001, 2006, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -101,8 +101,12 @@
# define __xstat64(version, path, buf) stat (path, buf)
#endif
-#if ! (HAVE___SECURE_GETENV || _LIBC)
-# define __secure_getenv getenv
+#if ! (HAVE_SECURE_GETENV || _LIBC)
+# ifdef HAVE___SECURE_GETENV
+# define __libc_secure_getenv __secure_getenv
+# else
+# define __libc_secure_getenv getenv
+# endif
#endif
#ifdef _LIBC
@@ -168,7 +172,7 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
if (try_tmpdir)
{
- d = __secure_getenv ("TMPDIR");
+ d = __libc_secure_getenv ("TMPDIR");
if (d != NULL && direxists (d))
dir = d;
else if (dir != NULL && direxists (dir))
diff --git a/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c b/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
index 206064274..c388f25b0 100644
--- a/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
+++ b/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
@@ -1,5 +1,5 @@
/* k_rem_pio2f.c -- float version of e_rem_pio2.c
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -153,7 +153,7 @@ recompute:
ih = iq[jz - 1] >> (7 - q0);
}
else if (q0 == 0)
- ih = iq[jz - 1] >> 8;
+ ih = iq[jz - 1] >> 7;
else if (z >= 0.5)
ih = 2;
diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps
index 66576a52a..ffb8e3a95 100644
--- a/libc/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps
@@ -1336,33 +1336,120 @@ ldouble: 1
Test "Real part of: ctan (0x1p1023 + 1 i) == -0.2254627924997545057926782581695274244229 + 0.8786063118883068695462540226219865087189 i":
double: 1
idouble: 1
+Test "Imaginary part of: ctan (0x1p1023 + 1 i) == -0.2254627924997545057926782581695274244229 + 0.8786063118883068695462540226219865087189 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: ctan (0x1p127 + 1 i) == 0.2446359391192790896381501310437708987204 + 0.9101334047676183761532873794426475906201 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctan (0x1p127 + 1 i) == 0.2446359391192790896381501310437708987204 + 0.9101334047676183761532873794426475906201 i":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Real part of: ctan (0x3.243f6cp-1 + 0 i) == -2.287733242885645987394874673945769518150e7 + 0.0 i":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Real part of: ctan (1 + 47 i) == 2.729321264492904590777293425576722354636e-41 + 1.0 i":
ildouble: 2
ldouble: 2
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+# ctan_tonearest
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ldouble: 4
+ildouble: 4
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 13
+ldouble: 13
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 6
+ldouble: 6
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 10
+ldouble: 10
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 6
+ldouble: 6
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
float: 2
idouble: 1
ifloat: 2
+idouble: 2
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (0 + 0x3.243f6cp-1 i) == 0.0 - 2.287733242885645987394874673945769518150e7 i":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
double: 1
float: 1
@@ -1378,22 +1465,100 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: ctanh (1 + 0x1p1023 i) == 0.8786063118883068695462540226219865087189 - 0.2254627924997545057926782581695274244229 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (1 + 0x1p1023 i) == 0.8786063118883068695462540226219865087189 - 0.2254627924997545057926782581695274244229 i":
-double: 1
idouble: 1
+double: 1
Test "Real part of: ctanh (1 + 0x1p127 i) == 0.9101334047676183761532873794426475906201 + 0.2446359391192790896381501310437708987204 i":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (1 + 0x1p127 i) == 0.9101334047676183761532873794426475906201 + 0.2446359391192790896381501310437708987204 i":
double: 1
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (47 + 1 i) == 1.0 + 2.729321264492904590777293425576722354636e-41 i":
ildouble: 2
ldouble: 2
+# ctanh_downward
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 13
+ldouble: 13
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 4
+ldouble: 4
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 6
+ldouble: 6
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -2714,9 +2879,63 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 13
+ldouble: 13
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 10
+ldouble: 10
+
Function: Real part of "ctanh":
double: 1
float: 2
@@ -2733,6 +2952,60 @@ ifloat: 1
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 13
+ldouble: 13
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 10
+ldouble: 10
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 6
+ldouble: 6
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/sysdeps/powerpc/ldsodefs.h b/libc/sysdeps/powerpc/ldsodefs.h
new file mode 100644
index 000000000..4a543491a
--- /dev/null
+++ b/libc/sysdeps/powerpc/ldsodefs.h
@@ -0,0 +1,54 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _POWERPC_LDSODEFS_H
+#define _POWERPC_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_ppc32_regs;
+struct La_ppc32_retval;
+struct La_ppc64_regs;
+struct La_ppc64_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_ppc32_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_ppc64_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ const struct La_ppc32_regs *, \
+ struct La_ppc32_retval *, \
+ const char *); \
+ unsigned int (*ppc64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ const struct La_ppc64_regs *, \
+ struct La_ppc64_retval *, const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/Makefile b/libc/sysdeps/powerpc/powerpc32/Makefile
index aa2d0b9fb..64f79003a 100644
--- a/libc/sysdeps/powerpc/powerpc32/Makefile
+++ b/libc/sysdeps/powerpc/powerpc32/Makefile
@@ -6,8 +6,9 @@ sysdep-LDFLAGS += -msoft-float
endif
ifeq ($(subdir),gmon)
-sysdep_routines += ppc-mcount
+sysdep_routines += ppc-mcount compat-ppc-mcount
static-only-routines += ppc-mcount
+shared-only-routines += compat-ppc-mcount
endif
ifeq ($(subdir),misc)
diff --git a/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S b/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S
new file mode 100644
index 000000000..2a9cb2407
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S
@@ -0,0 +1,11 @@
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_15)
+
+ compat_text_section
+# define _mcount __compat_mcount
+# include "ppc-mcount.S"
+# undef _mcount
+
+compat_symbol (libc, __compat_mcount, _mcount, GLIBC_2_0)
+#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/configure b/libc/sysdeps/powerpc/powerpc32/configure
index da0e7f4af..86ecfdcf4 100644
--- a/libc/sysdeps/powerpc/powerpc32/configure
+++ b/libc/sysdeps/powerpc/powerpc32/configure
@@ -137,48 +137,3 @@ if test $libc_cv_ppc_secure_plt = yes; then
$as_echo "#define HAVE_PPC_SECURE_PLT 1" >>confdefs.h
fi
-
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powerpc32 TLS support" >&5
-$as_echo_n "checking for powerpc32 TLS support... " >&6; }
-if ${libc_cv_powerpc32_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
-x: .long 1
-x1: .long 1
-x2: .long 1
- .text
- addi 3,31,x@got@tlsgd
- addi 3,31,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- lwz 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- lwz 9,x3@got@tprel(31)
- add 9,9,x@tls
- addi 9,2,x1@tprel
- addis 9,2,x2@tprel@ha
- addi 9,9,x2@tprel@l
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_powerpc32_tls=yes
-else
- libc_cv_powerpc32_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_powerpc32_tls" >&5
-$as_echo "$libc_cv_powerpc32_tls" >&6; }
-if test $libc_cv_powerpc32_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
diff --git a/libc/sysdeps/powerpc/powerpc32/configure.in b/libc/sysdeps/powerpc/powerpc32/configure.in
index bc775bb13..21d3f5ee5 100644
--- a/libc/sysdeps/powerpc/powerpc32/configure.in
+++ b/libc/sysdeps/powerpc/powerpc32/configure.in
@@ -30,37 +30,3 @@ rm -rf conftest*])
if test $libc_cv_ppc_secure_plt = yes; then
AC_DEFINE(HAVE_PPC_SECURE_PLT)
fi
-
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for powerpc32 TLS support, libc_cv_powerpc32_tls, [dnl
-cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
-x: .long 1
-x1: .long 1
-x2: .long 1
- .text
- addi 3,31,x@got@tlsgd
- addi 3,31,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- lwz 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- lwz 9,x3@got@tprel(31)
- add 9,9,x@tls
- addi 9,2,x1@tprel
- addis 9,2,x2@tprel@ha
- addi 9,9,x2@tprel@l
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_powerpc32_tls=yes
-else
- libc_cv_powerpc32_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_powerpc32_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/fprrest.S b/libc/sysdeps/powerpc/powerpc32/fpu/fprrest.S
index 39bfc621d..fe530f8bb 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/fprrest.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/fprrest.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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,68 +22,68 @@
#include <sysdep.h>
ENTRY(_restfpr_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf14)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_14)
+ .globl C_TEXT(_restf14)
+ .globl C_TEXT(_restfpr_14)
C_TEXT(_restf14):
C_TEXT(_restfpr_14): lfd fp14,-144(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf15)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_15)
+ .globl C_TEXT(_restf15)
+ .globl C_TEXT(_restfpr_15)
C_TEXT(_restf15):
C_TEXT(_restfpr_15): lfd fp15,-136(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf16)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_16)
+ .globl C_TEXT(_restf16)
+ .globl C_TEXT(_restfpr_16)
C_TEXT(_restf16):
C_TEXT(_restfpr_16): lfd fp16,-128(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf17)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_17)
+ .globl C_TEXT(_restf17)
+ .globl C_TEXT(_restfpr_17)
C_TEXT(_restf17):
C_TEXT(_restfpr_17): lfd fp17,-120(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf18)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_18)
+ .globl C_TEXT(_restf18)
+ .globl C_TEXT(_restfpr_18)
C_TEXT(_restf18):
C_TEXT(_restfpr_18): lfd fp18,-112(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf19)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_19)
+ .globl C_TEXT(_restf19)
+ .globl C_TEXT(_restfpr_19)
C_TEXT(_restf19):
C_TEXT(_restfpr_19): lfd fp19,-104(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf20)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_20)
+ .globl C_TEXT(_restf20)
+ .globl C_TEXT(_restfpr_20)
C_TEXT(_restf20):
C_TEXT(_restfpr_20): lfd fp20,-96(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf21)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_21)
+ .globl C_TEXT(_restf21)
+ .globl C_TEXT(_restfpr_21)
C_TEXT(_restf21):
C_TEXT(_restfpr_21): lfd fp21,-88(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf22)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_22)
+ .globl C_TEXT(_restf22)
+ .globl C_TEXT(_restfpr_22)
C_TEXT(_restf22):
C_TEXT(_restfpr_22): lfd fp22,-80(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf23)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_23)
+ .globl C_TEXT(_restf23)
+ .globl C_TEXT(_restfpr_23)
C_TEXT(_restf23):
C_TEXT(_restfpr_23): lfd fp23,-72(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf24)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_24)
+ .globl C_TEXT(_restf24)
+ .globl C_TEXT(_restfpr_24)
C_TEXT(_restf24):
C_TEXT(_restfpr_24): lfd fp24,-64(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf25)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_25)
+ .globl C_TEXT(_restf25)
+ .globl C_TEXT(_restfpr_25)
C_TEXT(_restf25):
C_TEXT(_restfpr_25): lfd fp25,-56(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf26)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_26)
+ .globl C_TEXT(_restf26)
+ .globl C_TEXT(_restfpr_26)
C_TEXT(_restf26):
C_TEXT(_restfpr_26): lfd fp26,-48(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf27)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_27)
+ .globl C_TEXT(_restf27)
+ .globl C_TEXT(_restfpr_27)
C_TEXT(_restf27):
C_TEXT(_restfpr_27): lfd fp27,-40(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf28)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_28)
+ .globl C_TEXT(_restf28)
+ .globl C_TEXT(_restfpr_28)
C_TEXT(_restf28):
C_TEXT(_restfpr_28): lfd fp28,-32(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restf29)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_29)
+ .globl C_TEXT(_restf29)
+ .globl C_TEXT(_restfpr_29)
C_TEXT(_restf29):
C_TEXT(_restfpr_29): lwz r0,8(r1) #get return address from frame
lfd fp29,-24(r1) #restore f29
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/fprsave.S b/libc/sysdeps/powerpc/powerpc32/fpu/fprsave.S
index fbeaa7952..25e472a8a 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/fprsave.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/fprsave.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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,83 +22,83 @@
#include <sysdep.h>
ENTRY(_savefpr_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef14)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_14)
+ .globl C_TEXT(_savef14)
+ .globl C_TEXT(_savefpr_14)
C_TEXT(_savef14):
C_TEXT(_savefpr_14): stfd fp14,-144(r1)
cfi_offset(fp14,-144)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_15)
+ .globl C_TEXT(_savef15)
+ .globl C_TEXT(_savefpr_15)
C_TEXT(_savef15):
C_TEXT(_savefpr_15): stfd fp15,-136(r1)
cfi_offset(fp15,-136)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_16)
+ .globl C_TEXT(_savef16)
+ .globl C_TEXT(_savefpr_16)
C_TEXT(_savef16):
C_TEXT(_savefpr_16): stfd fp16,-128(r1)
cfi_offset(fp16,-128)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_17)
+ .globl C_TEXT(_savef17)
+ .globl C_TEXT(_savefpr_17)
C_TEXT(_savef17):
C_TEXT(_savefpr_17): stfd fp17,-120(r1)
cfi_offset(fp17,-120)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_18)
+ .globl C_TEXT(_savef18)
+ .globl C_TEXT(_savefpr_18)
C_TEXT(_savef18):
C_TEXT(_savefpr_18): stfd fp18,-112(r1)
cfi_offset(fp18,-112)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_19)
+ .globl C_TEXT(_savef19)
+ .globl C_TEXT(_savefpr_19)
C_TEXT(_savef19):
C_TEXT(_savefpr_19): stfd fp19,-104(r1)
cfi_offset(fp19,-104)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_20)
+ .globl C_TEXT(_savef20)
+ .globl C_TEXT(_savefpr_20)
C_TEXT(_savef20):
C_TEXT(_savefpr_20): stfd fp20,-96(r1)
cfi_offset(fp20,-96)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_21)
+ .globl C_TEXT(_savef21)
+ .globl C_TEXT(_savefpr_21)
C_TEXT(_savef21):
C_TEXT(_savefpr_21): stfd fp21,-88(r1)
cfi_offset(fp21,-88)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_22)
+ .globl C_TEXT(_savef22)
+ .globl C_TEXT(_savefpr_22)
C_TEXT(_savef22):
C_TEXT(_savefpr_22): stfd fp22,-80(r1)
cfi_offset(fp22,-80)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_23)
+ .globl C_TEXT(_savef23)
+ .globl C_TEXT(_savefpr_23)
C_TEXT(_savef23):
C_TEXT(_savefpr_23): stfd fp23,-72(r1)
cfi_offset(fp23,-72)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_24)
+ .globl C_TEXT(_savef24)
+ .globl C_TEXT(_savefpr_24)
C_TEXT(_savef24):
C_TEXT(_savefpr_24): stfd fp24,-64(r1)
cfi_offset(fp24,-64)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_25)
+ .globl C_TEXT(_savef25)
+ .globl C_TEXT(_savefpr_25)
C_TEXT(_savef25):
C_TEXT(_savefpr_25): stfd fp25,-56(r1)
cfi_offset(fp25,-56)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_26)
+ .globl C_TEXT(_savef26)
+ .globl C_TEXT(_savefpr_26)
C_TEXT(_savef26):
C_TEXT(_savefpr_26): stfd fp26,-48(r1)
cfi_offset(fp26,-48)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_27)
+ .globl C_TEXT(_savef27)
+ .globl C_TEXT(_savefpr_27)
C_TEXT(_savef27):
C_TEXT(_savefpr_27): stfd fp27,-40(r1)
cfi_offset(fp27,-40)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_28)
+ .globl C_TEXT(_savef28)
+ .globl C_TEXT(_savefpr_28)
C_TEXT(_savef28):
C_TEXT(_savefpr_28): stfd fp28,-32(r1)
cfi_offset(fp28,-32)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_29)
+ .globl C_TEXT(_savef29)
+ .globl C_TEXT(_savefpr_29)
C_TEXT(_savef29):
C_TEXT(_savefpr_29): stfd fp29,-24(r1) #save f29
stfd fp30,-16(r1) #save f30
diff --git a/libc/sysdeps/powerpc/powerpc32/gprrest0.S b/libc/sysdeps/powerpc/powerpc32/gprrest0.S
index 79150ef4d..854e02ba0 100644
--- a/libc/sysdeps/powerpc/powerpc32/gprrest0.S
+++ b/libc/sysdeps/powerpc/powerpc32/gprrest0.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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
@@ -27,39 +27,39 @@
#include <sysdep.h>
ENTRY(_restgpr0_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_13)
+ .globl C_TEXT(_restgpr0_13)
C_TEXT(_restgpr0_13): lwz r13,-76(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_14)
+ .globl C_TEXT(_restgpr0_14)
C_TEXT(_restgpr0_14): lwz r14,-72(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_15)
+ .globl C_TEXT(_restgpr0_15)
C_TEXT(_restgpr0_15): lwz r15,-68(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_16)
+ .globl C_TEXT(_restgpr0_16)
C_TEXT(_restgpr0_16): lwz r16,-64(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_17)
+ .globl C_TEXT(_restgpr0_17)
C_TEXT(_restgpr0_17): lwz r17,-60(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_18)
+ .globl C_TEXT(_restgpr0_18)
C_TEXT(_restgpr0_18): lwz r18,-56(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_19)
+ .globl C_TEXT(_restgpr0_19)
C_TEXT(_restgpr0_19): lwz r19,-52(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_20)
+ .globl C_TEXT(_restgpr0_20)
C_TEXT(_restgpr0_20): lwz r20,-48(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_21)
+ .globl C_TEXT(_restgpr0_21)
C_TEXT(_restgpr0_21): lwz r21,-44(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_22)
+ .globl C_TEXT(_restgpr0_22)
C_TEXT(_restgpr0_22): lwz r22,-40(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_23)
+ .globl C_TEXT(_restgpr0_23)
C_TEXT(_restgpr0_23): lwz r23,-36(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_24)
+ .globl C_TEXT(_restgpr0_24)
C_TEXT(_restgpr0_24): lwz r24,-32(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_25)
+ .globl C_TEXT(_restgpr0_25)
C_TEXT(_restgpr0_25): lwz r25,-28(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_26)
+ .globl C_TEXT(_restgpr0_26)
C_TEXT(_restgpr0_26): lwz r26,-24(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_27)
+ .globl C_TEXT(_restgpr0_27)
C_TEXT(_restgpr0_27): lwz r27,-20(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_28)
+ .globl C_TEXT(_restgpr0_28)
C_TEXT(_restgpr0_28): lwz r28,-16(r1)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr0_29)
+ .globl C_TEXT(_restgpr0_29)
C_TEXT(_restgpr0_29): lwz r0,8(r1) #get return address from frame
lwz r29,-12(r1) #restore r29
mtlr r0 #move return address to LR
diff --git a/libc/sysdeps/powerpc/powerpc32/gprrest1.S b/libc/sysdeps/powerpc/powerpc32/gprrest1.S
index 945b935ba..0c20cf884 100644
--- a/libc/sysdeps/powerpc/powerpc32/gprrest1.S
+++ b/libc/sysdeps/powerpc/powerpc32/gprrest1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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
@@ -23,39 +23,39 @@
#include <sysdep.h>
ENTRY(_restgpr1_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_13)
+ .globl C_TEXT(_restgpr1_13)
C_TEXT(_restgpr1_13): lwz r13,-76(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_14)
+ .globl C_TEXT(_restgpr1_14)
C_TEXT(_restgpr1_14): lwz r14,-72(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_15)
+ .globl C_TEXT(_restgpr1_15)
C_TEXT(_restgpr1_15): lwz r15,-68(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_16)
+ .globl C_TEXT(_restgpr1_16)
C_TEXT(_restgpr1_16): lwz r16,-64(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_17)
+ .globl C_TEXT(_restgpr1_17)
C_TEXT(_restgpr1_17): lwz r17,-60(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_18)
+ .globl C_TEXT(_restgpr1_18)
C_TEXT(_restgpr1_18): lwz r18,-56(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_19)
+ .globl C_TEXT(_restgpr1_19)
C_TEXT(_restgpr1_19): lwz r19,-52(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_20)
+ .globl C_TEXT(_restgpr1_20)
C_TEXT(_restgpr1_20): lwz r20,-48(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_21)
+ .globl C_TEXT(_restgpr1_21)
C_TEXT(_restgpr1_21): lwz r21,-44(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_22)
+ .globl C_TEXT(_restgpr1_22)
C_TEXT(_restgpr1_22): lwz r22,-40(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_23)
+ .globl C_TEXT(_restgpr1_23)
C_TEXT(_restgpr1_23): lwz r23,-36(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_24)
+ .globl C_TEXT(_restgpr1_24)
C_TEXT(_restgpr1_24): lwz r24,-32(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_25)
+ .globl C_TEXT(_restgpr1_25)
C_TEXT(_restgpr1_25): lwz r25,-28(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_26)
+ .globl C_TEXT(_restgpr1_26)
C_TEXT(_restgpr1_26): lwz r26,-24(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_27)
+ .globl C_TEXT(_restgpr1_27)
C_TEXT(_restgpr1_27): lwz r27,-20(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_28)
+ .globl C_TEXT(_restgpr1_28)
C_TEXT(_restgpr1_28): lwz r28,-16(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_restgpr1_29)
+ .globl C_TEXT(_restgpr1_29)
C_TEXT(_restgpr1_29): lwz r29,-12(r12) #restore r29
lwz r30,-8(r12) #restore r30
lwz r31,-4(r12) #restore r31
diff --git a/libc/sysdeps/powerpc/powerpc32/gprsave0.S b/libc/sysdeps/powerpc/powerpc32/gprsave0.S
index 977653e44..25b1e2858 100644
--- a/libc/sysdeps/powerpc/powerpc32/gprsave0.S
+++ b/libc/sysdeps/powerpc/powerpc32/gprsave0.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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
@@ -27,55 +27,55 @@
#include <sysdep.h>
ENTRY(_savegpr0_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_13)
+ .globl C_TEXT(_savegpr0_13)
C_TEXT(_savegpr0_13): stw r13,-76(r1)
cfi_offset(r13,-76)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_14)
+ .globl C_TEXT(_savegpr0_14)
C_TEXT(_savegpr0_14): stw r14,-72(r1)
cfi_offset(r14,-72)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_15)
+ .globl C_TEXT(_savegpr0_15)
C_TEXT(_savegpr0_15): stw r15,-68(r1)
cfi_offset(r15,-68)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_16)
+ .globl C_TEXT(_savegpr0_16)
C_TEXT(_savegpr0_16): stw r16,-64(r1)
cfi_offset(r16,-64)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_17)
+ .globl C_TEXT(_savegpr0_17)
C_TEXT(_savegpr0_17): stw r17,-60(r1)
cfi_offset(r17,-60)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_18)
+ .globl C_TEXT(_savegpr0_18)
C_TEXT(_savegpr0_18): stw r18,-56(r1)
cfi_offset(r18,-56)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_19)
+ .globl C_TEXT(_savegpr0_19)
C_TEXT(_savegpr0_19): stw r19,-52(r1)
cfi_offset(r19,-52)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_20)
+ .globl C_TEXT(_savegpr0_20)
C_TEXT(_savegpr0_20): stw r20,-48(r1)
cfi_offset(r20,-48)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_21)
+ .globl C_TEXT(_savegpr0_21)
C_TEXT(_savegpr0_21): stw r21,-44(r1)
cfi_offset(r21,-44)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_22)
+ .globl C_TEXT(_savegpr0_22)
C_TEXT(_savegpr0_22): stw r22,-40(r1)
cfi_offset(r22,-40)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_23)
+ .globl C_TEXT(_savegpr0_23)
C_TEXT(_savegpr0_23): stw r23,-36(r1)
cfi_offset(r23,-36)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_24)
+ .globl C_TEXT(_savegpr0_24)
C_TEXT(_savegpr0_24): stw r24,-32(r1)
cfi_offset(r24,-32)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_25)
+ .globl C_TEXT(_savegpr0_25)
C_TEXT(_savegpr0_25): stw r25,-28(r1)
cfi_offset(r25,-28)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_26)
+ .globl C_TEXT(_savegpr0_26)
C_TEXT(_savegpr0_26): stw r26,-24(r1)
cfi_offset(r26,-24)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_27)
+ .globl C_TEXT(_savegpr0_27)
C_TEXT(_savegpr0_27): stw r27,-20(r1)
cfi_offset(r27,-20)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_28)
+ .globl C_TEXT(_savegpr0_28)
C_TEXT(_savegpr0_28): stw r28,-16(r1)
cfi_offset(r28,-16)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_29)
+ .globl C_TEXT(_savegpr0_29)
C_TEXT(_savegpr0_29): stw r29,-12(r1) #save r29
stw r30,-8(r1) #save r30
stw r31,-4(r1) #save r31
diff --git a/libc/sysdeps/powerpc/powerpc32/gprsave1.S b/libc/sysdeps/powerpc/powerpc32/gprsave1.S
index a15d785d0..eb1cf3755 100644
--- a/libc/sysdeps/powerpc/powerpc32/gprsave1.S
+++ b/libc/sysdeps/powerpc/powerpc32/gprsave1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 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
@@ -23,39 +23,39 @@
#include <sysdep.h>
ENTRY(_savegpr1_all)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_13)
+ .globl C_TEXT(_savegpr1_13)
C_TEXT(_savegpr1_13): stw r13,-76(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_14)
+ .globl C_TEXT(_savegpr1_14)
C_TEXT(_savegpr1_14): stw r14,-72(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_15)
+ .globl C_TEXT(_savegpr1_15)
C_TEXT(_savegpr1_15): stw r15,-68(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_16)
+ .globl C_TEXT(_savegpr1_16)
C_TEXT(_savegpr1_16): stw r16,-64(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_17)
+ .globl C_TEXT(_savegpr1_17)
C_TEXT(_savegpr1_17): stw r17,-60(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_18)
+ .globl C_TEXT(_savegpr1_18)
C_TEXT(_savegpr1_18): stw r18,-56(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_19)
+ .globl C_TEXT(_savegpr1_19)
C_TEXT(_savegpr1_19): stw r19,-52(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_20)
+ .globl C_TEXT(_savegpr1_20)
C_TEXT(_savegpr1_20): stw r20,-48(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_21)
+ .globl C_TEXT(_savegpr1_21)
C_TEXT(_savegpr1_21): stw r21,-44(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_22)
+ .globl C_TEXT(_savegpr1_22)
C_TEXT(_savegpr1_22): stw r22,-40(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_23)
+ .globl C_TEXT(_savegpr1_23)
C_TEXT(_savegpr1_23): stw r23,-36(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_24)
+ .globl C_TEXT(_savegpr1_24)
C_TEXT(_savegpr1_24): stw r24,-32(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_25)
+ .globl C_TEXT(_savegpr1_25)
C_TEXT(_savegpr1_25): stw r25,-28(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_26)
+ .globl C_TEXT(_savegpr1_26)
C_TEXT(_savegpr1_26): stw r26,-24(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_27)
+ .globl C_TEXT(_savegpr1_27)
C_TEXT(_savegpr1_27): stw r27,-20(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_28)
+ .globl C_TEXT(_savegpr1_28)
C_TEXT(_savegpr1_28): stw r28,-16(r12)
- ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr1_29)
+ .globl C_TEXT(_savegpr1_29)
C_TEXT(_savegpr1_29): stw r29,-12(r12) #save r29
stw r30,-8(r12) #save r30
stw r31,-4(r12) #save r31
diff --git a/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S b/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
index 9a3c041dd..911638b5b 100644
--- a/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
+++ b/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
@@ -1,5 +1,5 @@
/* PowerPC-specific implementation of profiling support.
- Copyright (C) 1997, 1999, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -57,7 +57,11 @@ ENTRY(_mcount)
stw r4, 44(r1)
cfi_offset (lr, -4)
stw r5, 8(r1)
+#ifndef SHARED
bl JUMPTARGET(__mcount_internal)
+#else
+ bl __mcount_internal@local
+#endif
/* Restore the registers... */
lwz r6, 8(r1)
lwz r0, 44(r1)
diff --git a/libc/sysdeps/powerpc/powerpc32/sysdep.h b/libc/sysdeps/powerpc/powerpc32/sysdep.h
index 621022eff..811ebf2ae 100644
--- a/libc/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/libc/sysdeps/powerpc/powerpc32/sysdep.h
@@ -37,7 +37,7 @@
#endif /* PROF */
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
@@ -64,7 +64,7 @@ GOT_LABEL: ; \
past a 2^align boundary. */
#ifdef PROF
# define EALIGN(name, alignt, words) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
@@ -76,7 +76,7 @@ GOT_LABEL: ; \
0:
#else /* PROF */
# define EALIGN(name, alignt, words) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(alignt); \
EALIGN_W_##words; \
diff --git a/libc/sysdeps/powerpc/powerpc32/tls-macros.h b/libc/sysdeps/powerpc/powerpc32/tls-macros.h
new file mode 100644
index 000000000..0df081424
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/tls-macros.h
@@ -0,0 +1,87 @@
+/* Include sysdeps/powerpc/tls-macros.h for __TLS_CALL_CLOBBERS */
+#include_next "tls-macros.h"
+#include "config.h"
+
+/* PowerPC32 Local Exec TLS access. */
+#define TLS_LE(x) \
+ ({ int *__result; \
+ asm ("addi %0,2," #x "@tprel" \
+ : "=r" (__result)); \
+ __result; })
+
+/* PowerPC32 Initial Exec TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_IE(x) \
+ ({ int *__result; \
+ asm ("bcl 20,31,1f\n1:\t" \
+ "mflr %0\n\t" \
+ "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "lwz %0," #x "@got@tprel(%0)\n\t" \
+ "add %0,%0," #x "@tls" \
+ : "=b" (__result) : \
+ : "lr"); \
+ __result; })
+#else
+# define TLS_IE(x) \
+ ({ int *__result; \
+ asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr %0\n\t" \
+ "lwz %0," #x "@got@tprel(%0)\n\t" \
+ "add %0,%0," #x "@tls" \
+ : "=b" (__result) : \
+ : "lr"); \
+ __result; })
+#endif
+
+/* PowerPC32 Local Dynamic TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_LD(x) \
+ ({ int *__result; \
+ asm ("bcl 20,31,1f\n1:\t" \
+ "mflr 3\n\t" \
+ "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "addi 3,3," #x "@got@tlsld\n\t" \
+ "bl __tls_get_addr@plt\n\t" \
+ "addi %0,3," #x "@dtprel" \
+ : "=r" (__result) : \
+ : "3", __TLS_CALL_CLOBBERS); \
+ __result; })
+#else
+# define TLS_LD(x) \
+ ({ int *__result; \
+ asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr 3\n\t" \
+ "addi 3,3," #x "@got@tlsld\n\t" \
+ "bl __tls_get_addr@plt\n\t" \
+ "addi %0,3," #x "@dtprel" \
+ : "=r" (__result) : \
+ : "3", __TLS_CALL_CLOBBERS); \
+ __result; })
+#endif
+
+/* PowerPC32 General Dynamic TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_GD(x) \
+ ({ register int *__result __asm__ ("r3"); \
+ asm ("bcl 20,31,1f\n1:\t" \
+ "mflr 3\n\t" \
+ "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "addi 3,3," #x "@got@tlsgd\n\t" \
+ "bl __tls_get_addr@plt" \
+ : "=r" (__result) : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#else
+# define TLS_GD(x) \
+ ({ register int *__result __asm__ ("r3"); \
+ asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr 3\n\t" \
+ "addi 3,3," #x "@got@tlsgd\n\t" \
+ "bl __tls_get_addr@plt" \
+ : "=r" (__result) : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/tst-audit.h b/libc/sysdeps/powerpc/powerpc32/tst-audit.h
new file mode 100644
index 000000000..3faac8daa
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. PowerPC32 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_ppc32_gnu_pltenter
+#define pltexit la_ppc32_gnu_pltexit
+#define La_regs La_ppc32_regs
+#define La_retval La_ppc32_retval
+#define int_retval lrv_r3
diff --git a/libc/sysdeps/powerpc/powerpc64/configure b/libc/sysdeps/powerpc/powerpc64/configure
index 762ae4a25..7cff76141 100644
--- a/libc/sysdeps/powerpc/powerpc64/configure
+++ b/libc/sysdeps/powerpc/powerpc64/configure
@@ -144,67 +144,3 @@ if test x$libc_cv_overlapping_opd = xyes; then
$as_echo "#define USE_PPC64_OVERLAPPING_OPD 1" >>confdefs.h
fi
-
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powerpc64 TLS support" >&5
-$as_echo_n "checking for powerpc64 TLS support... " >&6; }
-if ${libc_cv_powerpc64_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
-x: .quad 1
-x1: .quad 1
-x2: .quad 1
-x3: .quad 1
-x4: .long 1
- .section ".toc","aw"
-.LC0:
- .quad x@dtpmod
- .quad x@dtprel
-.LC1:
- .quad x1@dtpmod
- .quad 0
-.LC2:
- .quad x@tprel
- .text
- addi 3,2,x@got@tlsgd
- addi 3,2,.LC0@toc
- addi 3,2,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- ld 9,x3@got@dtprel(2)
- addi 3,2,.LC0@toc
- lwz 0,x1@dtprel(3)
- ld 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- ld 0,x2@dtprel@l(9)
- ld 9,x3@got@dtprel(2)
- ld 9,x@got@tprel(2)
- add 9,9,x@tls
- ld 9,.LC2@toc(2)
- add 9,9,.LC2@tls
- addi 9,13,x1@tprel
- addis 9,13,x2@tprel@ha
- addi 9,9,x2@tprel@l
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_powerpc64_tls=yes
-else
- libc_cv_powerpc64_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_powerpc64_tls" >&5
-$as_echo "$libc_cv_powerpc64_tls" >&6; }
-if test $libc_cv_powerpc64_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
diff --git a/libc/sysdeps/powerpc/powerpc64/configure.in b/libc/sysdeps/powerpc/powerpc64/configure.in
index 7d333a7c5..67aac663d 100644
--- a/libc/sysdeps/powerpc/powerpc64/configure.in
+++ b/libc/sysdeps/powerpc/powerpc64/configure.in
@@ -40,56 +40,3 @@ rm -f conftest.c conftest.s
if test x$libc_cv_overlapping_opd = xyes; then
AC_DEFINE(USE_PPC64_OVERLAPPING_OPD)
fi
-
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for powerpc64 TLS support, libc_cv_powerpc64_tls, [dnl
-cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
-x: .quad 1
-x1: .quad 1
-x2: .quad 1
-x3: .quad 1
-x4: .long 1
- .section ".toc","aw"
-.LC0:
- .quad x@dtpmod
- .quad x@dtprel
-.LC1:
- .quad x1@dtpmod
- .quad 0
-.LC2:
- .quad x@tprel
- .text
- addi 3,2,x@got@tlsgd
- addi 3,2,.LC0@toc
- addi 3,2,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- ld 9,x3@got@dtprel(2)
- addi 3,2,.LC0@toc
- lwz 0,x1@dtprel(3)
- ld 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- ld 0,x2@dtprel@l(9)
- ld 9,x3@got@dtprel(2)
- ld 9,x@got@tprel(2)
- add 9,9,x@tls
- ld 9,.LC2@toc(2)
- add 9,9,.LC2@tls
- addi 9,13,x1@tprel
- addis 9,13,x2@tprel@ha
- addi 9,9,x2@tprel@l
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_powerpc64_tls=yes
-else
- libc_cv_powerpc64_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_powerpc64_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
diff --git a/libc/sysdeps/powerpc/powerpc64/tls-macros.h b/libc/sysdeps/powerpc/powerpc64/tls-macros.h
new file mode 100644
index 000000000..198215d5f
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/tls-macros.h
@@ -0,0 +1,46 @@
+/* Include sysdeps/powerpc/tls-macros.h for __TLS_CALL_CLOBBERS */
+#include_next "tls-macros.h"
+
+/* PowerPC64 Local Exec TLS access. */
+#define TLS_LE(x) \
+ ({ int * __result; \
+ asm ("addis %0,13," #x "@tprel@ha\n\t" \
+ "addi %0,%0," #x "@tprel@l" \
+ : "=b" (__result) ); \
+ __result; \
+ })
+/* PowerPC64 Initial Exec TLS access. */
+#define TLS_IE(x) \
+ ({ int * __result; \
+ asm ("ld %0," #x "@got@tprel(2)\n\t" \
+ "add %0,%0," #x "@tls" \
+ : "=r" (__result) ); \
+ __result; \
+ })
+#ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define __TLS_GET_ADDR ".__tls_get_addr"
+#else
+# define __TLS_GET_ADDR "__tls_get_addr"
+#endif
+/* PowerPC64 Local Dynamic TLS access. */
+#define TLS_LD(x) \
+ ({ int * __result; \
+ asm ("addi 3,2," #x "@got@tlsld\n\t" \
+ "bl " __TLS_GET_ADDR "\n\t" \
+ "nop \n\t" \
+ "addis %0,3," #x "@dtprel@ha\n\t" \
+ "addi %0,%0," #x "@dtprel@l" \
+ : "=b" (__result) : \
+ : "3", __TLS_CALL_CLOBBERS); \
+ __result; \
+ })
+/* PowerPC64 General Dynamic TLS access. */
+#define TLS_GD(x) \
+ ({ register int *__result __asm__ ("r3"); \
+ asm ("addi 3,2," #x "@got@tlsgd\n\t" \
+ "bl " __TLS_GET_ADDR "\n\t" \
+ "nop " \
+ : "=r" (__result) : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; \
+ })
diff --git a/libc/sysdeps/powerpc/powerpc64/tst-audit.h b/libc/sysdeps/powerpc/powerpc64/tst-audit.h
new file mode 100644
index 000000000..cee3f5b87
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. PowerPC64 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_ppc64_gnu_pltenter
+#define pltexit la_ppc64_gnu_pltexit
+#define La_regs La_ppc64_regs
+#define La_retval La_ppc64_retval
+#define int_retval lrv_r3
diff --git a/libc/sysdeps/powerpc/tls-macros.h b/libc/sysdeps/powerpc/tls-macros.h
new file mode 100644
index 000000000..809ef5cea
--- /dev/null
+++ b/libc/sysdeps/powerpc/tls-macros.h
@@ -0,0 +1,3 @@
+#define __TLS_CALL_CLOBBERS \
+ "0", "4", "5", "6", "7", "8", "9", "10", "11", "12", \
+ "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
diff --git a/libc/sysdeps/s390/dl-irel.h b/libc/sysdeps/s390/dl-irel.h
new file mode 100644
index 000000000..bc1a10e50
--- /dev/null
+++ b/libc/sysdeps/s390/dl-irel.h
@@ -0,0 +1,52 @@
+/* Machine-dependent ELF indirect relocation inline functions.
+ Version for S/390 32 and 64 bit.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _DL_IREL_H
+#define _DL_IREL_H
+
+#include <stdio.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+
+#define ELF_MACHINE_IRELA 1
+
+static inline ElfW(Addr)
+__attribute ((always_inline))
+elf_ifunc_invoke (ElfW(Addr) addr)
+{
+ return ((ElfW(Addr) (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));
+}
+
+static inline void
+__attribute ((always_inline))
+elf_irela (const ElfW(Rela) *reloc)
+{
+ ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset;
+ const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
+
+ if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+ {
+ ElfW(Addr) value = elf_ifunc_invoke(reloc->r_addend);
+ *reloc_addr = value;
+ }
+ else
+ __libc_fatal ("unexpected reloc type in static binary");
+}
+
+#endif /* dl-irel.h */
diff --git a/libc/sysdeps/s390/ldsodefs.h b/libc/sysdeps/s390/ldsodefs.h
new file mode 100644
index 000000000..e5e316898
--- /dev/null
+++ b/libc/sysdeps/s390/ldsodefs.h
@@ -0,0 +1,57 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _S390_LDSODEFS_H
+#define _S390_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_s390_32_regs;
+struct La_s390_32_retval;
+struct La_s390_64_regs;
+struct La_s390_64_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf32_Addr (*s390_32_gnu_pltenter) (Elf32_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ struct La_s390_32_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf64_Addr (*s390_64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ struct La_s390_64_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*s390_32_gnu_pltexit) (Elf32_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_s390_32_regs *, \
+ struct La_s390_32_retval *, \
+ const char *); \
+ unsigned int (*s390_64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_s390_64_regs *, \
+ struct La_s390_64_retval *, \
+ const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/s390/s390-32/configure b/libc/sysdeps/s390/s390-32/configure
index 484548454..e982e817f 100644
--- a/libc/sysdeps/s390/s390-32/configure
+++ b/libc/sysdeps/s390/s390-32/configure
@@ -1,126 +1,4 @@
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/s390.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for s390 TLS support" >&5
-$as_echo_n "checking for s390 TLS support... " >&6; }
-if ${libc_cv_390_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .long foo@TLSGD
- .long foo@TLSLDM
- .long foo@DTPOFF
- .long foo@NTPOFF
- .long foo@GOTNTPOFF
- .long foo@INDNTPOFF
- l %r1,foo@GOTNTPOFF(%r12)
- l %r1,0(%r1):tls_load:foo
- bas %r14,0(%r1,%r13):tls_gdcall:foo
- bas %r14,0(%r1,%r13):tls_ldcall:foo
-EOF
-if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_390_tls=yes
-else
- libc_cv_390_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_390_tls" >&5
-$as_echo "$libc_cv_390_tls" >&6; }
-if test $libc_cv_390_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
-
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/libc/sysdeps/s390/s390-32/configure.in b/libc/sysdeps/s390/s390-32/configure.in
index 529bdda36..b5af4e12f 100644
--- a/libc/sysdeps/s390/s390-32/configure.in
+++ b/libc/sysdeps/s390/s390-32/configure.in
@@ -1,35 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/s390.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for s390 TLS support, libc_cv_390_tls, [dnl
-cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .long foo@TLSGD
- .long foo@TLSLDM
- .long foo@DTPOFF
- .long foo@NTPOFF
- .long foo@GOTNTPOFF
- .long foo@INDNTPOFF
- l %r1,foo@GOTNTPOFF(%r12)
- l %r1,0(%r1):tls_load:foo
- bas %r14,0(%r1,%r13):tls_gdcall:foo
- bas %r14,0(%r1,%r13):tls_ldcall:foo
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_390_tls=yes
-else
- libc_cv_390_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_390_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/libc/sysdeps/s390/s390-32/dl-machine.h b/libc/sysdeps/s390/s390-32/dl-machine.h
index 3eb7e4115..e56ad676c 100644
--- a/libc/sysdeps/s390/s390-32/dl-machine.h
+++ b/libc/sysdeps/s390/s390-32/dl-machine.h
@@ -1,6 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. S390 Version.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
Contributed by Carl Pederson & Martin Schwidefsky.
This file is part of the GNU C Library.
@@ -27,6 +26,7 @@
#include <string.h>
#include <link.h>
#include <sysdeps/s390/dl-procinfo.h>
+#include <dl-irel.h>
/* This is an older, now obsolete value. */
#define EM_S390_OLD 0xA390
@@ -305,8 +305,21 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ if (sym != NULL
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+
switch (r_type)
{
+ case R_390_IRELATIVE:
+ value = map->l_addr + reloc->r_addend;
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+ *reloc_addr = value;
+ break;
+
case R_390_GLOB_DAT:
case R_390_JMP_SLOT:
*reloc_addr = value + reloc->r_addend;
@@ -444,6 +457,13 @@ elf_machine_lazy_rel (struct link_map *map,
map->l_mach.plt
+ (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 8;
}
+ else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+ {
+ Elf32_Addr value = map->l_addr + reloc->r_addend;
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+ *reloc_addr = value;
+ }
else
_dl_reloc_bad_type (map, r_type, 1);
}
diff --git a/libc/sysdeps/s390/s390-32/memcmp.S b/libc/sysdeps/s390/s390-32/memcmp.S
new file mode 100644
index 000000000..9ff84a36a
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/memcmp.S
@@ -0,0 +1,66 @@
+/* memcmp - compare two memory blocks. 32 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of first memory area
+ %r3 = address of second memory area
+ %r4 = number of bytes to compare. */
+
+ .text
+#ifdef USE_MULTIARCH
+ENTRY(memcmp_g5)
+#else
+ENTRY(memcmp)
+#endif
+ .machine "g5"
+ basr %r5,0
+.L_G5_16:
+ ltr %r4,%r4
+ je .L_G5_4
+ ahi %r4,-1
+ lr %r1,%r4
+ srl %r1,8
+ ltr %r1,%r1
+ jne .L_G5_12
+ ex %r4,.L_G5_17-.L_G5_16(%r5)
+.L_G5_4:
+ ipm %r2
+ sll %r2,2
+ sra %r2,30
+ br %r14
+.L_G5_12:
+ clc 0(256,%r3),0(%r2)
+ jne .L_G5_4
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ brct %r1,.L_G5_12
+ ex %r4,.L_G5_17-.L_G5_16(%r5)
+ j .L_G5_4
+.L_G5_17:
+ clc 0(1,%r3),0(%r2)
+#ifdef USE_MULTIARCH
+END(memcmp_g5)
+#else
+END(memcmp)
+libc_hidden_builtin_def (memcmp)
+weak_alias(memcmp, bcmp)
+#endif
diff --git a/libc/sysdeps/s390/s390-32/memcpy.S b/libc/sysdeps/s390/s390-32/memcpy.S
index b2a688ea3..90cc4cbf7 100644
--- a/libc/sysdeps/s390/s390-32/memcpy.S
+++ b/libc/sysdeps/s390/s390-32/memcpy.S
@@ -1,7 +1,6 @@
/* memcpy - copy a block from source to destination. S/390 version.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,42 +16,67 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
/* INPUT PARAMETERS
%r2 = address of destination memory area
%r3 = address of source memory area
%r4 = number of bytes to copy. */
-#include "sysdep.h"
-#include "asm-syntax.h"
-
- .text
+#ifdef USE_MULTIARCH
+ENTRY(memcpy_g5)
+#else
ENTRY(memcpy)
- ltr %r4,%r4
- jz .L3
- ahi %r4,-1 # length - 1
- lr %r1,%r2 # copy destination address
- lr %r5,%r4
- srl %r5,8
- ltr %r5,%r5 # < 256 bytes to move ?
- jz .L1
- chi %r5,255 # > 1MB to move ?
- jh .L4
-.L0: mvc 0(256,%r1),0(%r3) # move in 256 byte chunks
- la %r1,256(%r1)
- la %r3,256(%r3)
- brct %r5,.L0
-.L1: bras %r5,.L2 # setup base pointer for execute
- mvc 0(1,%r1),0(%r3) # instruction for execute
-.L2: ex %r4,0(%r5) # execute mvc with length ((%r4)&255)+1
-.L3: br %r14
- # data copies > 1MB are faster with mvcle.
-.L4: ahi %r4,1 # length + 1
- lr %r5,%r4 # source length
- lr %r4,%r3 # source address
- lr %r3,%r5 # destination length = source length
-.L5: mvcle %r2,%r4,0 # thats it, MVCLE is your friend
- jo .L5
- lr %r2,%r1 # return destination address
- br %r14
+#endif
+ .machine "g5"
+ st %r13,52(%r15)
+ .cfi_offset 13, -44
+ basr %r13,0
+.L_G5_16:
+ ltr %r4,%r4
+ je .L_G5_4
+ ahi %r4,-1
+ lr %r5,%r4
+ srl %r5,8
+ ltr %r5,%r5
+ lr %r1,%r2
+ jne .L_G5_12
+ ex %r4,.L_G5_17-.L_G5_16(%r13)
+.L_G5_4:
+ l %r13,52(%r15)
+ br %r14
+.L_G5_13:
+ chi %r5,4096 # Switch to mvcle for copies >1MB
+ jh memcpy_mvcle
+.L_G5_12:
+ mvc 0(256,%r1),0(%r3)
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ brct %r5,.L_G5_12
+ ex %r4,.L_G5_17-.L_G5_16(%r13)
+ j .L_G5_4
+.L_G5_17:
+ mvc 0(1,%r1),0(%r3)
+#ifdef USE_MULTIARCH
+END(memcpy_g5)
+#else
END(memcpy)
libc_hidden_builtin_def (memcpy)
+#endif
+
+ENTRY(memcpy_mvcle)
+ # Using as standalone function will result in unexpected
+ # results since the length field is incremented by 1 in order to
+ # compensate the changes already done in the functions above.
+ ahi %r4,1 # length + 1
+ lr %r5,%r4 # source length
+ lr %r4,%r3 # source address
+ lr %r3,%r5 # destination length = source length
+.L_MVCLE_1:
+ mvcle %r2,%r4,0 # thats it, MVCLE is your friend
+ jo .L_MVCLE_1
+ lr %r2,%r1 # return destination address
+ br %r14
+END(memcpy_mvcle)
diff --git a/libc/sysdeps/s390/s390-32/memset.S b/libc/sysdeps/s390/s390-32/memset.S
index 00e908278..31a70f0c9 100644
--- a/libc/sysdeps/s390/s390-32/memset.S
+++ b/libc/sysdeps/s390/s390-32/memset.S
@@ -1,7 +1,6 @@
/* Set a block of memory to some byte value. For IBM S390
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,28 +16,50 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/*
- * R2 = address to memory area
- * R3 = byte to fill memory with
- * R4 = number of bytes to fill
- */
#include "sysdep.h"
#include "asm-syntax.h"
- .text
+/* INPUT PARAMETERS
+ %r2 = address to memory area
+ %r3 = byte to fill memory with
+ %r4 = number of bytes to fill. */
+
+ .text
+
+#ifdef USE_MULTIARCH
+ENTRY(memset_g5)
+#else
ENTRY(memset)
- ltr %r4,%r4
- jz .L1
- lr %r0,%r2 # save source address
- lr %r1,%r3 # move pad byte to R1
- lr %r3,%r4
- sr %r4,%r4 # no source for MVCLE, only a pad byte
- sr %r5,%r5
-.L0: mvcle %r2,%r4,0(%r1) # thats it, MVCLE is your friend
- jo .L0
- lr %r2,%r0 # return value is source address
-.L1:
- br %r14
+#endif
+ .machine "g5"
+ basr %r5,0
+.L_G5_19:
+ ltr %r4,%r4
+ je .L_G5_4
+ stc %r3,0(%r2)
+ chi %r4,1
+ lr %r1,%r2
+ je .L_G5_4
+ ahi %r4,-2
+ lr %r3,%r4
+ srl %r3,8
+ ltr %r3,%r3
+ jne .L_G5_14
+ ex %r4,.L_G5_20-.L_G5_19(%r5)
+.L_G5_4:
+ br %r14
+.L_G5_14:
+ mvc 1(256,%r1),0(%r1)
+ la %r1,256(%r1)
+ brct %r3,.L_G5_14
+ ex %r4,.L_G5_20-.L_G5_19(%r5)
+ j .L_G5_4
+.L_G5_20:
+ mvc 1(1,%r1),0(%r1)
+#ifdef USE_MULTIARCH
+END(memset_g5)
+#else
END(memset)
libc_hidden_builtin_def (memset)
+#endif
diff --git a/libc/sysdeps/s390/s390-32/multiarch/Makefile b/libc/sysdeps/s390/s390-32/multiarch/Makefile
new file mode 100644
index 000000000..5b0cd49c7
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/multiarch/Makefile
@@ -0,0 +1,9 @@
+ASFLAGS-.o += -Wa,-mzarch
+ASFLAGS-.os += -Wa,-mzarch
+ASFLAGS-.op += -Wa,-mzarch
+ASFLAGS-.og += -Wa,-mzarch
+ASFLAGS-.ob += -Wa,-mzarch
+ASFLAGS-.oS += -Wa,-mzarch
+ifeq ($(subdir),string)
+sysdep_routines += ifunc-resolve memset memcpy memcmp
+endif
diff --git a/libc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c b/libc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
new file mode 100644
index 000000000..fd6e36706
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
@@ -0,0 +1,69 @@
+/* IFUNC resolver function for CPU specific functions.
+ 32 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <dl-procinfo.h>
+
+#define STFLE_BITS_Z10 34 /* General instructions extension */
+#define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
+
+#ifndef NOT_IN_libc
+
+#define IFUNC_RESOLVE(FUNC) \
+ asm (".globl " #FUNC "\n\t" \
+ ".type " #FUNC ",@gnu_indirect_function\n\t" \
+ ".set " #FUNC ",resolve_" #FUNC "\n\t" \
+ ".globl __GI_" #FUNC "\n\t" \
+ ".set __GI_" #FUNC "," #FUNC "\n"); \
+ \
+ extern void *FUNC##_z10; \
+ extern void *FUNC##_z196; \
+ extern void *FUNC##_g5; \
+ \
+ void *resolve_##FUNC (unsigned long int dl_hwcap) \
+ { \
+ if ((dl_hwcap & HWCAP_S390_STFLE) \
+ && (dl_hwcap & HWCAP_S390_HIGH_GPRS)) /* Implies zarch */ \
+ { \
+ /* We want just 1 double word to be returned. */ \
+ register unsigned long reg0 asm("0") = 0; \
+ unsigned long long stfle_bits; \
+ \
+ asm volatile(".insn s,0xb2b00000,%0" "\n\t" /* stfle */ \
+ : "=QS" (stfle_bits), "+d" (reg0) \
+ : : "cc"); \
+ \
+ if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z196))) != 0) \
+ return &FUNC##_z196; \
+ else if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z10))) != 0) \
+ return &FUNC##_z10; \
+ } \
+ return &FUNC##_g5; \
+ }
+
+IFUNC_RESOLVE(memset)
+IFUNC_RESOLVE(memcmp)
+asm(".weak bcmp ; bcmp = memcmp");
+
+/* In the static lib memcpy is needed before the reloc is resolved. */
+#ifdef SHARED
+IFUNC_RESOLVE(memcpy)
+#endif
+
+#endif
diff --git a/libc/sysdeps/s390/s390-32/multiarch/memcmp.S b/libc/sysdeps/s390/s390-32/multiarch/memcmp.S
new file mode 100644
index 000000000..cd8ea86b0
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/multiarch/memcmp.S
@@ -0,0 +1,102 @@
+/* CPU specific memcmp implementations. 32 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of first memory area
+ %r3 = address of second memory area
+ %r4 = number of bytes to compare. */
+
+ .text
+
+#ifndef NOT_IN_libc
+
+ENTRY(memcmp_z196)
+ .machine "z196"
+ ltr %r4,%r4
+ je .L_Z196_4
+ ahi %r4,-1
+ srlk %r1,%r4,8
+ ltr %r1,%r1
+ jne .L_Z196_2
+.L_Z196_3:
+ exrl %r4,.L_Z196_14
+.L_Z196_4:
+ ipm %r2
+ sll %r2,2
+ sra %r2,30
+ br %r14
+.L_Z196_17:
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ ahi %r1,-1
+ je .L_Z196_3
+.L_Z196_2:
+ pfd 1,512(%r3)
+ pfd 1,512(%r2)
+ clc 0(256,%r3),0(%r2)
+ je .L_Z196_17
+ ipm %r2
+ sll %r2,2
+ sra %r2,30
+ br %r14
+.L_Z196_14:
+ clc 0(1,%r3),0(%r2)
+END(memcmp_z196)
+
+ENTRY(memcmp_z10)
+ .machine "z10"
+ ltr %r4,%r4
+ je .L_Z10_4
+ ahi %r4,-1
+ lr %r1,%r4
+ srl %r1,8
+ cijlh %r1,0,.L_Z10_12
+.L_Z10_3:
+ exrl %r4,.L_Z10_15
+.L_Z10_4:
+ ipm %r2
+ sll %r2,2
+ sra %r2,30
+ br %r14
+.L_Z10_12:
+ pfd 1,512(%r3)
+ pfd 1,512(%r2)
+ clc 0(256,%r3),0(%r2)
+ jne .L_Z10_4
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ brct %r1,.L_Z10_12
+ j .L_Z10_3
+.L_Z10_15:
+ clc 0(1,%r3),0(%r2)
+END(memcmp_z10)
+
+#endif
+
+#include "../memcmp.S"
+
+#ifdef NOT_IN_libc
+.globl memcmp
+.set memcmp,memcmp_g5
+.weak bcmp
+.set bcmp,memcmp_g5
+#endif
diff --git a/libc/sysdeps/s390/s390-32/multiarch/memcpy.S b/libc/sysdeps/s390/s390-32/multiarch/memcpy.S
new file mode 100644
index 000000000..40f4acfbb
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/multiarch/memcpy.S
@@ -0,0 +1,96 @@
+/* CPU specific memcpy implementations. 32 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = target operands address
+ %r3 = source operands address
+ %r4 = number of bytes to copy. */
+
+ .text
+
+#if defined SHARED && !defined NOT_IN_libc
+
+ENTRY(memcpy_z196)
+ .machine "z196"
+ llgfr %r4,%r4
+ ltgr %r4,%r4
+ je .L_Z196_4
+ aghi %r4,-1
+ lr %r1,%r2
+ srlg %r5,%r4,8
+ ltgr %r5,%r5
+ jne .L_Z196_5
+.L_Z196_3:
+ exrl %r4,.L_Z196_14
+.L_Z196_4:
+ br %r14
+.L_Z196_5:
+ cgfi %r5,262144 # Switch to mvcle for copies >64MB
+ jh memcpy_mvcle
+.L_Z196_2:
+ pfd 1,768(%r3)
+ pfd 2,768(%r1)
+ mvc 0(256,%r1),0(%r3)
+ aghi %r5,-1
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ jne .L_Z196_2
+ j .L_Z196_3
+.L_Z196_14:
+ mvc 0(1,%r1),0(%r3)
+END(memcpy_z196)
+
+ENTRY(memcpy_z10)
+ .machine "z10"
+ llgfr %r4,%r4
+ cgije %r4,0,.L_Z10_4
+ aghi %r4,-1
+ lr %r1,%r2
+ srlg %r5,%r4,8
+ cgijlh %r5,0,.L_Z10_13
+.L_Z10_3:
+ exrl %r4,.L_Z10_15
+.L_Z10_4:
+ br %r14
+.L_Z10_13:
+ cgfi %r5,65535 # Switch to mvcle for copies >16MB
+ jh memcpy_mvcle
+.L_Z10_12:
+ pfd 1,768(%r3)
+ pfd 2,768(%r1)
+ mvc 0(256,%r1),0(%r3)
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ brctg %r5,.L_Z10_12
+ j .L_Z10_3
+.L_Z10_15:
+ mvc 0(1,%r1),0(%r3)
+END(memcpy_z10)
+
+#endif
+
+#include "../memcpy.S"
+
+#if !defined SHARED || defined NOT_IN_libc
+.globl memcpy
+.set memcpy,memcpy_g5
+#endif
diff --git a/libc/sysdeps/s390/s390-32/multiarch/memset.S b/libc/sysdeps/s390/s390-32/multiarch/memset.S
new file mode 100644
index 000000000..5ce7b4de8
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/multiarch/memset.S
@@ -0,0 +1,111 @@
+/* Set a block of memory to some byte value. 32 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of memory area
+ %r3 = byte to fill memory with
+ %r4 = number of bytes to fill. */
+
+ .text
+
+#ifndef NOT_IN_libc
+
+ENTRY(memset_z196)
+ .machine "z196"
+ llgfr %r4,%r4
+ ltgr %r4,%r4
+ je .L_Z196_4
+ stc %r3,0(%r2)
+ lr %r1,%r2
+ cghi %r4,1
+ je .L_Z196_4
+ aghi %r4,-2
+ srlg %r5,%r4,8
+ ltgr %r5,%r5
+ jne .L_Z196_1
+.L_Z196_3:
+ exrl %r4,.L_Z196_17
+.L_Z196_4:
+ br %r14
+.L_Z196_1:
+ cgfi %r5,1048576
+ jh memset_mvcle # Switch to mvcle for >256MB
+.L_Z196_2:
+ pfd 2,1024(%r1)
+ mvc 1(256,%r1),0(%r1)
+ aghi %r5,-1
+ la %r1,256(%r1)
+ jne .L_Z196_2
+ j .L_Z196_3
+.L_Z196_17:
+ mvc 1(1,%r1),0(%r1)
+END(memset_z196)
+
+ENTRY(memset_z10)
+ .machine "z10"
+ llgfr %r4,%r4
+ cgije %r4,0,.L_Z10_4
+ stc %r3,0(%r2)
+ lr %r1,%r2
+ cgije %r4,1,.L_Z10_4
+ aghi %r4,-2
+ srlg %r5,%r4,8
+ cgijlh %r5,0,.L_Z10_15
+.L_Z10_3:
+ exrl %r4,.L_Z10_18
+.L_Z10_4:
+ br %r14
+.L_Z10_15:
+ cgfi %r5,163840 # Switch to mvcle for >40MB
+ jh memset_mvcle
+.L_Z10_14:
+ pfd 2,1024(%r1)
+ mvc 1(256,%r1),0(%r1)
+ la %r1,256(%r1)
+ brctg %r5,.L_Z10_14
+ j .L_Z10_3
+.L_Z10_18:
+ mvc 1(1,%r1),0(%r1)
+END(memset_z10)
+
+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
+ lr %r3,%r4
+ sr %r4,%r4 # no source for MVCLE, only a pad byte
+ sr %r5,%r5
+.L0: mvcle %r2,%r4,0(%r1) # thats it, MVCLE is your friend
+ jo .L0
+ lr %r2,%r0 # return value is source address
+.L1:
+ br %r14
+END(memset_mvcle)
+
+#endif
+
+#include "../memset.S"
+
+#ifdef NOT_IN_libc
+.globl memset
+.set memset,memset_g5
+#endif
diff --git a/libc/sysdeps/s390/s390-32/s390-mcount.S b/libc/sysdeps/s390/s390-32/s390-mcount.S
index 6e09c79a6..1c8c79ada 100644
--- a/libc/sysdeps/s390/s390-32/s390-mcount.S
+++ b/libc/sysdeps/s390/s390-32/s390-mcount.S
@@ -1,5 +1,5 @@
/* S/390-specific implemetation of profiling support.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com)
@@ -47,7 +47,7 @@
* _mcount may not modify any register.
*/
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
+ .globl C_SYMBOL_NAME(_mcount)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
cfi_startproc
.align ALIGNARG(4)
diff --git a/libc/sysdeps/s390/s390-32/sysdep.h b/libc/sysdeps/s390/s390-32/sysdep.h
index 43da126ac..24a07a2a9 100644
--- a/libc/sysdeps/s390/s390-32/sysdep.h
+++ b/libc/sysdeps/s390/s390-32/sysdep.h
@@ -32,7 +32,7 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
diff --git a/libc/sysdeps/s390/s390-32/tls-macros.h b/libc/sysdeps/s390/s390-32/tls-macros.h
new file mode 100644
index 000000000..8a0ad5863
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/tls-macros.h
@@ -0,0 +1,99 @@
+#define TLS_LE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long " #x "@ntpoff\n" \
+ "1:\tl %0,0(%0)" \
+ : "=a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+
+#ifdef PIC
+# define TLS_IE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long " #x "@gotntpoff\n" \
+ "1:\tl %0,0(%0)\n\t" \
+ "l %0,0(%0,%%r12):tls_load:" #x \
+ : "=&a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_IE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long " #x "@indntpoff\n" \
+ "1:\t l %0,0(%0)\n\t" \
+ "l %0,0(%0):tls_load:" #x \
+ : "=&a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
+
+#ifdef PIC
+# define TLS_LD(x) \
+ ({ unsigned long __offset, __save12; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
+ ".long __tls_get_offset@plt-0b\n\t" \
+ ".long " #x "@tlsldm\n\t" \
+ ".long " #x "@dtpoff\n" \
+ "1:\tlr %1,%%r12\n\t" \
+ "l %%r12,0(%0)\n\t" \
+ "la %%r12,0(%%r12,%0)\n\t" \
+ "l %%r1,4(%0)\n\t" \
+ "l %%r2,8(%0)\n\t" \
+ "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \
+ "l %0,12(%0)\n\t" \
+ "alr %0,%%r2\n\t" \
+ "lr %%r12,%1" \
+ : "=&a" (__offset), "=&a" (__save12) \
+ : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_LD(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
+ ".long __tls_get_offset@plt\n\t" \
+ ".long " #x "@tlsldm\n\t" \
+ ".long " #x "@dtpoff\n" \
+ "1:\tl %%r12,0(%0)\n\t" \
+ "l %%r1,4(%0)\n\t" \
+ "l %%r2,8(%0)\n\t" \
+ "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
+ "l %0,12(%0)\n\t" \
+ "alr %0,%%r2" \
+ : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
+
+#ifdef PIC
+# define TLS_GD(x) \
+ ({ unsigned long __offset, __save12; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
+ ".long __tls_get_offset@plt-0b\n\t" \
+ ".long " #x "@tlsgd\n" \
+ "1:\tlr %1,%%r12\n\t" \
+ "l %%r12,0(%0)\n\t" \
+ "la %%r12,0(%%r12,%0)\n\t" \
+ "l %%r1,4(%0)\n\t" \
+ "l %%r2,8(%0)\n\t" \
+ "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \
+ "lr %0,%%r2\n\t" \
+ "lr %%r12,%1" \
+ : "=&a" (__offset), "=&a" (__save12) \
+ : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_GD(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
+ ".long __tls_get_offset@plt\n\t" \
+ ".long " #x "@tlsgd\n" \
+ "1:\tl %%r12,0(%0)\n\t" \
+ "l %%r1,4(%0)\n\t" \
+ "l %%r2,8(%0)\n\t" \
+ "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
+ "lr %0,%%r2" \
+ : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
diff --git a/libc/sysdeps/s390/s390-32/tst-audit.h b/libc/sysdeps/s390/s390-32/tst-audit.h
new file mode 100644
index 000000000..051e5abaf
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. S/390 32-bit version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_s390_32_gnu_pltenter
+#define pltexit la_s390_32_gnu_pltexit
+#define La_regs La_s390_32_regs
+#define La_retval La_s390_32_retval
+#define int_retval lrv_r2
diff --git a/libc/sysdeps/s390/s390-64/configure b/libc/sysdeps/s390/s390-64/configure
index 0e71b82a1..e982e817f 100644
--- a/libc/sysdeps/s390/s390-64/configure
+++ b/libc/sysdeps/s390/s390-64/configure
@@ -1,126 +1,4 @@
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/s390.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for s390 TLS support" >&5
-$as_echo_n "checking for s390 TLS support... " >&6; }
-if ${libc_cv_390_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .quad foo@TLSGD
- .quad foo@TLSLDM
- .quad foo@DTPOFF
- .quad foo@NTPOFF
- .quad foo@GOTNTPOFF
- .quad foo@INDNTPOFF
- lg %r1,foo@GOTNTPOFF(%r12)
- lg %r1,0(%r1):tls_load:foo
- brasl %r14,__tls_get_offset@plt:tls_gdcall:foo
- brasl %r14,__tls_get_offset@plt:tls_ldcall:foo
-EOF
-if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_390_tls=yes
-else
- libc_cv_390_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_390_tls" >&5
-$as_echo "$libc_cv_390_tls" >&6; }
-if test $libc_cv_390_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
-
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/libc/sysdeps/s390/s390-64/configure.in b/libc/sysdeps/s390/s390-64/configure.in
index 235b5f03e..b5af4e12f 100644
--- a/libc/sysdeps/s390/s390-64/configure.in
+++ b/libc/sysdeps/s390/s390-64/configure.in
@@ -1,35 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/s390.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for s390 TLS support, libc_cv_390_tls, [dnl
-cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .quad foo@TLSGD
- .quad foo@TLSLDM
- .quad foo@DTPOFF
- .quad foo@NTPOFF
- .quad foo@GOTNTPOFF
- .quad foo@INDNTPOFF
- lg %r1,foo@GOTNTPOFF(%r12)
- lg %r1,0(%r1):tls_load:foo
- brasl %r14,__tls_get_offset@plt:tls_gdcall:foo
- brasl %r14,__tls_get_offset@plt:tls_ldcall:foo
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_390_tls=yes
-else
- libc_cv_390_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_390_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/libc/sysdeps/s390/s390-64/dl-machine.h b/libc/sysdeps/s390/s390-64/dl-machine.h
index 908c02476..067336e2a 100644
--- a/libc/sysdeps/s390/s390-64/dl-machine.h
+++ b/libc/sysdeps/s390/s390-64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
64 bit S/390 Version.
- Copyright (C) 2001-2005, 2006, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -26,6 +26,9 @@
#include <sys/param.h>
#include <string.h>
#include <link.h>
+#include <dl-irel.h>
+
+#define ELF_MACHINE_IRELATIVE R_390_IRELATIVE
/* This is an older, now obsolete value. */
#define EM_S390_OLD 0xA390
@@ -280,8 +283,21 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
Elf64_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ if (sym != NULL
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
+ 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+
switch (r_type)
{
+ case R_390_IRELATIVE:
+ value = map->l_addr + reloc->r_addend;
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+ *reloc_addr = value;
+ break;
case R_390_GLOB_DAT:
case R_390_JMP_SLOT:
*reloc_addr = value + reloc->r_addend;
@@ -426,6 +442,13 @@ elf_machine_lazy_rel (struct link_map *map,
map->l_mach.plt
+ (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4;
}
+ else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+ {
+ Elf64_Addr value = map->l_addr + reloc->r_addend;
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = elf_ifunc_invoke (value);
+ *reloc_addr = value;
+ }
else
_dl_reloc_bad_type (map, r_type, 1);
}
diff --git a/libc/sysdeps/s390/s390-64/memcmp.S b/libc/sysdeps/s390/s390-64/memcmp.S
new file mode 100644
index 000000000..e0b62e3a4
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/memcmp.S
@@ -0,0 +1,64 @@
+/* memcmp - compare two memory blocks. 64 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of first memory area
+ %r3 = address of second memory area
+ %r4 = number of bytes to compare. */
+
+ .text
+#ifdef USE_MULTIARCH
+ENTRY(memcmp_z900)
+#else
+ENTRY(memcmp)
+#endif
+ .machine "z900"
+ ltgr %r4,%r4
+ je .L_Z900_4
+ aghi %r4,-1
+ srlg %r1,%r4,8
+ ltgr %r1,%r1
+ jne .L_Z900_12
+.L_Z900_3:
+ larl %r1,.L_Z900_15
+ ex %r4,0(%r1)
+.L_Z900_4:
+ ipm %r2
+ sllg %r2,%r2,34
+ srag %r2,%r2,62
+ br %r14
+.L_Z900_12:
+ clc 0(256,%r3),0(%r2)
+ jne .L_Z900_4
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ brctg %r1,.L_Z900_12
+ j .L_Z900_3
+.L_Z900_15:
+ clc 0(1,%r3),0(%r2)
+#ifdef USE_MULTIARCH
+END(memcmp_z900)
+#else
+END(memcmp)
+libc_hidden_builtin_def (memcmp)
+weak_alias (memcmp, bcmp)
+#endif
diff --git a/libc/sysdeps/s390/s390-64/memcpy.S b/libc/sysdeps/s390/s390-64/memcpy.S
index be916fea7..1e5f050b8 100644
--- a/libc/sysdeps/s390/s390-64/memcpy.S
+++ b/libc/sysdeps/s390/s390-64/memcpy.S
@@ -1,7 +1,6 @@
/* memcpy - copy a block from source to destination. 64 bit S/390 version.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,41 +16,66 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
/* INPUT PARAMETERS
%r2 = address of destination memory area
%r3 = address of source memory area
%r4 = number of bytes to copy. */
-#include "sysdep.h"
-#include "asm-syntax.h"
- .text
+ .text
+
+#ifdef USE_MULTIARCH
+ENTRY(memcpy_z900)
+#else
ENTRY(memcpy)
- ltgr %r4,%r4
- jz .L3
- aghi %r4,-1 # length - 1
- lgr %r1,%r2 # copy destination address
- srlg %r5,%r4,8
- ltgr %r5,%r5 # < 256 bytes to mvoe ?
- jz .L1
- chi %r5,255 # > 1 MB to move ?
- jh .L4
-.L0: mvc 0(256,%r1),0(%r3) # move in 256 byte chunks
- la %r1,256(%r1)
- la %r3,256(%r3)
- brctg %r5,.L0
-.L1: bras %r5,.L2 # setup base pointer for execute
- mvc 0(1,%r1),0(%r3) # instruction for execute
-.L2: ex %r4,0(%r5) # execute mvc with length ((%r4)&255)+1
-.L3: br %r14
- # data copies > 1MB are faster with mvcle.
-.L4: aghi %r4,1 # length + 1
- lgr %r5,%r4 # source length
- lgr %r4,%r3 # source address
- lgr %r3,%r5 # destination length = source length
-.L5: mvcle %r2,%r4,0 # thats it, MVCLE is your friend
- jo .L5
- lgr %r2,%r1 # return destination address
- br %r14
+#endif
+ .machine "z900"
+ ltgr %r4,%r4
+ je .L_Z900_4
+ aghi %r4,-1
+ srlg %r5,%r4,8
+ ltgr %r5,%r5
+ lgr %r1,%r2
+ jne .L_Z900_13
+.L_Z900_3:
+ larl %r5,.L_Z900_15
+ ex %r4,0(%r5)
+.L_Z900_4:
+ br %r14
+.L_Z900_13:
+ chi %r5,4096 # Switch to mvcle for copies >1MB
+ jh memcpy_mvcle
+.L_Z900_12:
+ mvc 0(256,%r1),0(%r3)
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ brctg %r5,.L_Z900_12
+ j .L_Z900_3
+.L_Z900_15:
+ mvc 0(1,%r1),0(%r3)
+
+#ifdef USE_MULTIARCH
+END(memcpy_z900)
+#else
END(memcpy)
libc_hidden_builtin_def (memcpy)
+#endif
+
+ENTRY(memcpy_mvcle)
+ # Using as standalone function will result in unexpected
+ # results since the length field is incremented by 1 in order to
+ # compensate the changes already done in the functions above.
+ aghi %r4,1 # length + 1
+ lgr %r5,%r4 # source length
+ lgr %r4,%r3 # source address
+ lgr %r3,%r5 # destination length = source length
+.L_MVCLE_1:
+ mvcle %r2,%r4,0 # thats it, MVCLE is your friend
+ jo .L_MVCLE_1
+ lgr %r2,%r1 # return destination address
+ br %r14
+END(memcpy_mvcle)
diff --git a/libc/sysdeps/s390/s390-64/memset.S b/libc/sysdeps/s390/s390-64/memset.S
index 03a77eea4..6b3007bd9 100644
--- a/libc/sysdeps/s390/s390-64/memset.S
+++ b/libc/sysdeps/s390/s390-64/memset.S
@@ -17,27 +17,48 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
/* INPUT PARAMETERS
%r2 = address of memory area
%r3 = byte to fill memory with
%r4 = number of bytes to fill. */
-#include "sysdep.h"
-#include "asm-syntax.h"
+ .text
- .text
+#ifdef USE_MULTIARCH
+ENTRY(memset_z900)
+#else
ENTRY(memset)
- ltgr %r4,%r4
- jz .L1
- lgr %r0,%r2 # save source address
- lgr %r1,%r3 # move pad byte to R1
- lgr %r3,%r4
- sgr %r4,%r4 # no source for MVCLE, only a pad byte
- sgr %r5,%r5
-.L0: mvcle %r2,%r4,0(%r1) # thats it, MVCLE is your friend
- jo .L0
- lgr %r2,%r0 # return value is source address
-.L1:
- br %r14
+#endif
+ .machine "z900"
+ ltgr %r4,%r4
+ je .L_Z900_4
+ stc %r3,0(%r2)
+ cghi %r4,1
+ lgr %r1,%r2
+ je .L_Z900_4
+ aghi %r4,-2
+ srlg %r3,%r4,8
+ ltgr %r3,%r3
+ jne .L_Z900_14
+.L_Z900_3:
+ larl %r3,.L_Z900_18
+ ex %r4,0(%r3)
+.L_Z900_4:
+ br %r14
+.L_Z900_14:
+ mvc 1(256,%r1),0(%r1)
+ la %r1,256(%r1)
+ brctg %r3,.L_Z900_14
+ j .L_Z900_3
+.L_Z900_18:
+ mvc 1(1,%r1),0(%r1)
+#ifdef USE_MULTIARCH
+END(memset_z900)
+#else
END(memset)
libc_hidden_builtin_def (memset)
+#endif
diff --git a/libc/sysdeps/s390/s390-64/multiarch/Makefile b/libc/sysdeps/s390/s390-64/multiarch/Makefile
new file mode 100644
index 000000000..9baeecda6
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/multiarch/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),string)
+sysdep_routines += ifunc-resolve memset memcpy memcmp
+endif
diff --git a/libc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c b/libc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
new file mode 100644
index 000000000..f980bc939
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
@@ -0,0 +1,74 @@
+/* IFUNC resolver function for CPU specific functions.
+ 64 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <dl-procinfo.h>
+
+#define STFLE_BITS_Z10 34 /* General instructions extension */
+#define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
+
+#ifndef NOT_IN_libc
+
+#define IFUNC_RESOLVE(FUNC) \
+ asm (".globl " #FUNC "\n\t" \
+ ".type " #FUNC ",@gnu_indirect_function\n\t" \
+ ".set " #FUNC ",resolve_" #FUNC "\n\t" \
+ ".globl __GI_" #FUNC "\n\t" \
+ ".set __GI_" #FUNC "," #FUNC "\n"); \
+ \
+ extern void *FUNC##_z10; \
+ extern void *FUNC##_z196; \
+ extern void *FUNC##_z900; \
+ \
+ void *resolve_##FUNC (unsigned long int dl_hwcap) \
+ { \
+ if (dl_hwcap & HWCAP_S390_STFLE) \
+ { \
+ /* We want just 1 double word to be returned. */ \
+ register unsigned long reg0 asm("0") = 0; \
+ unsigned long stfle_bits; \
+ \
+ asm volatile(".machine push" "\n\t" \
+ ".machine \"z9-109\"" "\n\t" \
+ "stfle %0" "\n\t" \
+ ".machine pop" "\n" \
+ : "=QS" (stfle_bits), "+d" (reg0) \
+ : : "cc"); \
+ \
+ if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) \
+ return &FUNC##_z196; \
+ else if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z10))) != 0) \
+ return &FUNC##_z10; \
+ else \
+ return &FUNC##_z900; \
+ } \
+ else \
+ return &FUNC##_z900; \
+ }
+
+IFUNC_RESOLVE(memset)
+IFUNC_RESOLVE(memcmp)
+asm(".weak bcmp ; bcmp = memcmp");
+
+/* In the static lib memcpy is needed before the reloc is resolved. */
+#ifdef SHARED
+IFUNC_RESOLVE(memcpy)
+#endif
+
+#endif
diff --git a/libc/sysdeps/s390/s390-64/multiarch/memcmp.S b/libc/sysdeps/s390/s390-64/multiarch/memcmp.S
new file mode 100644
index 000000000..f40a3c198
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/multiarch/memcmp.S
@@ -0,0 +1,101 @@
+/* CPU specific memcmp implementations. 64 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of first memory area
+ %r3 = address of second memory area
+ %r4 = number of bytes to compare. */
+
+ .text
+
+#ifndef NOT_IN_libc
+
+ENTRY(memcmp_z196)
+ .machine "z196"
+ ltgr %r4,%r4
+ je .L_Z196_4
+ aghi %r4,-1
+ srlg %r1,%r4,8
+ ltgr %r1,%r1
+ jne .L_Z196_2
+.L_Z196_3:
+ exrl %r4,.L_Z196_14
+.L_Z196_4:
+ ipm %r2
+ sllg %r2,%r2,34
+ srag %r2,%r2,62
+ br %r14
+.L_Z196_17:
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ aghi %r1,-1
+ je .L_Z196_3
+.L_Z196_2:
+ pfd 1,512(%r3)
+ pfd 1,512(%r2)
+ clc 0(256,%r3),0(%r2)
+ je .L_Z196_17
+ ipm %r2
+ sllg %r2,%r2,34
+ srag %r2,%r2,62
+ br %r14
+.L_Z196_14:
+ clc 0(1,%r3),0(%r2)
+END(memcmp_z196)
+
+ENTRY(memcmp_z10)
+ .machine "z10"
+ ltgr %r4,%r4
+ je .L_Z10_4
+ aghi %r4,-1
+ srlg %r1,%r4,8
+ cgijlh %r1,0,.L_Z10_12
+.L_Z10_3:
+ exrl %r4,.L_Z10_15
+.L_Z10_4:
+ ipm %r2
+ sllg %r2,%r2,34
+ srag %r2,%r2,62
+ br %r14
+.L_Z10_12:
+ pfd 1,512(%r3)
+ pfd 1,512(%r2)
+ clc 0(256,%r3),0(%r2)
+ jne .L_Z10_4
+ la %r3,256(%r3)
+ la %r2,256(%r2)
+ brctg %r1,.L_Z10_12
+ j .L_Z10_3
+.L_Z10_15:
+ clc 0(1,%r3),0(%r2)
+END(memcmp_z10)
+
+#endif
+
+#include "../memcmp.S"
+
+#ifdef NOT_IN_libc
+.globl memcmp
+.set memcmp,memcmp_z900
+.weak bcmp
+.set bcmp,memcmp_z900
+#endif
diff --git a/libc/sysdeps/s390/s390-64/multiarch/memcpy.S b/libc/sysdeps/s390/s390-64/multiarch/memcpy.S
new file mode 100644
index 000000000..b00ffc132
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/multiarch/memcpy.S
@@ -0,0 +1,94 @@
+/* CPU specific memcpy implementations. 64 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = target operands address
+ %r3 = source operands address
+ %r4 = number of bytes to copy. */
+
+ .text
+
+#if defined SHARED && !defined NOT_IN_libc
+
+ENTRY(memcpy_z196)
+ .machine "z196"
+ ltgr %r4,%r4
+ je .L_Z196_4
+ aghi %r4,-1
+ lgr %r1,%r2
+ srlg %r5,%r4,8
+ ltgr %r5,%r5
+ jne .L_Z196_5
+.L_Z196_3:
+ exrl %r4,.L_Z196_14
+.L_Z196_4:
+ br %r14
+.L_Z196_5:
+ cgfi %r5,262144 # Switch to mvcle for copies >64MB
+ jh memcpy_mvcle
+.L_Z196_2:
+ pfd 1,768(%r3)
+ pfd 2,768(%r1)
+ mvc 0(256,%r1),0(%r3)
+ aghi %r5,-1
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ jne .L_Z196_2
+ j .L_Z196_3
+.L_Z196_14:
+ mvc 0(1,%r1),0(%r3)
+END(memcpy_z196)
+
+ENTRY(memcpy_z10)
+ .machine "z10"
+ cgije %r4,0,.L_Z10_4
+ aghi %r4,-1
+ lgr %r1,%r2
+ srlg %r5,%r4,8
+ cgijlh %r5,0,.L_Z10_13
+.L_Z10_3:
+ exrl %r4,.L_Z10_15
+.L_Z10_4:
+ br %r14
+.L_Z10_13:
+ cgfi %r5,65535 # Switch to mvcle for copies >16MB
+ jh memcpy_mvcle
+.L_Z10_12:
+ pfd 1,768(%r3)
+ pfd 2,768(%r1)
+ mvc 0(256,%r1),0(%r3)
+ la %r1,256(%r1)
+ la %r3,256(%r3)
+ brctg %r5,.L_Z10_12
+ j .L_Z10_3
+.L_Z10_15:
+ mvc 0(1,%r1),0(%r3)
+END(memcpy_z10)
+
+#endif
+
+#include "../memcpy.S"
+
+#if !defined SHARED || defined NOT_IN_libc
+.globl memcpy
+.set memcpy,memcpy_z900
+#endif
diff --git a/libc/sysdeps/s390/s390-64/multiarch/memset.S b/libc/sysdeps/s390/s390-64/multiarch/memset.S
new file mode 100644
index 000000000..1f9064d5f
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/multiarch/memset.S
@@ -0,0 +1,109 @@
+/* Set a block of memory to some byte value. 64 bit S/390 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include "sysdep.h"
+#include "asm-syntax.h"
+
+/* INPUT PARAMETERS
+ %r2 = address of memory area
+ %r3 = byte to fill memory with
+ %r4 = number of bytes to fill. */
+
+ .text
+
+#ifndef NOT_IN_libc
+
+ENTRY(memset_z196)
+ .machine "z196"
+ ltgr %r4,%r4
+ je .L_Z196_4
+ stc %r3,0(%r2)
+ lgr %r1,%r2
+ cghi %r4,1
+ je .L_Z196_4
+ aghi %r4,-2
+ srlg %r5,%r4,8
+ ltgr %r5,%r5
+ jne .L_Z196_1
+.L_Z196_3:
+ exrl %r4,.L_Z196_17
+.L_Z196_4:
+ br %r14
+.L_Z196_1:
+ cgfi %r5,1048576
+ jh memset_mvcle # Switch to mvcle for >256MB
+.L_Z196_2:
+ pfd 2,1024(%r1)
+ mvc 1(256,%r1),0(%r1)
+ aghi %r5,-1
+ la %r1,256(%r1)
+ jne .L_Z196_2
+ j .L_Z196_3
+.L_Z196_17:
+ mvc 1(1,%r1),0(%r1)
+END(memset_z196)
+
+ENTRY(memset_z10)
+ .machine "z10"
+ cgije %r4,0,.L_Z10_4
+ stc %r3,0(%r2)
+ lgr %r1,%r2
+ cgije %r4,1,.L_Z10_4
+ aghi %r4,-2
+ srlg %r5,%r4,8
+ cgijlh %r5,0,.L_Z10_15
+.L_Z10_3:
+ exrl %r4,.L_Z10_18
+.L_Z10_4:
+ br %r14
+.L_Z10_15:
+ cgfi %r5,163840 # Switch to mvcle for >40MB
+ jh memset_mvcle
+.L_Z10_14:
+ pfd 2,1024(%r1)
+ mvc 1(256,%r1),0(%r1)
+ la %r1,256(%r1)
+ brctg %r5,.L_Z10_14
+ j .L_Z10_3
+.L_Z10_18:
+ mvc 1(1,%r1),0(%r1)
+END(memset_z10)
+
+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
+ lgr %r3,%r4 # move length to r3
+ sgr %r4,%r4 # no source for MVCLE, only a pad byte
+ sgr %r5,%r5
+.L0: mvcle %r2,%r4,0(%r1) # thats it, MVCLE is your friend
+ jo .L0
+ lgr %r2,%r0 # return value is source address
+.L1:
+ br %r14
+END(memset_mvcle)
+
+#endif
+
+#include "../memset.S"
+
+#ifdef NOT_IN_libc
+.globl memset
+.set memset,memset_z900
+#endif
diff --git a/libc/sysdeps/s390/s390-64/s390x-mcount.S b/libc/sysdeps/s390/s390-64/s390x-mcount.S
index 95fa848d1..5d8ef9117 100644
--- a/libc/sysdeps/s390/s390-64/s390x-mcount.S
+++ b/libc/sysdeps/s390/s390-64/s390x-mcount.S
@@ -1,5 +1,5 @@
/* 64 bit S/390-specific implemetation of profiling support.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com)
This file is part of the GNU C Library.
@@ -43,7 +43,7 @@
parameter. &.LP0 was loaded to %r1 and the return address is in %r14.
_mcount may not modify any register. */
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
+ .globl C_SYMBOL_NAME(_mcount)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
cfi_startproc
.align ALIGNARG(4)
diff --git a/libc/sysdeps/s390/s390-64/sysdep.h b/libc/sysdeps/s390/s390-64/sysdep.h
index d5465b37e..b7449b6b1 100644
--- a/libc/sysdeps/s390/s390-64/sysdep.h
+++ b/libc/sysdeps/s390/s390-64/sysdep.h
@@ -32,7 +32,7 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
diff --git a/libc/sysdeps/s390/s390-64/tls-macros.h b/libc/sysdeps/s390/s390-64/tls-macros.h
new file mode 100644
index 000000000..be8aa6cde
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/tls-macros.h
@@ -0,0 +1,87 @@
+#define TLS_LE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@ntpoff\n" \
+ "1:\tlg %0,0(%0)" \
+ : "=a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+
+#ifdef PIC
+# define TLS_IE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@gotntpoff\n" \
+ "1:\tlg %0,0(%0)\n\t" \
+ "lg %0,0(%0,%%r12):tls_load:" #x \
+ : "=&a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_IE(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@indntpoff\n" \
+ "1:\t lg %0,0(%0)\n\t" \
+ "lg %0,0(%0):tls_load:" #x \
+ : "=&a" (__offset) : : "cc" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
+
+#ifdef PIC
+# define TLS_LD(x) \
+ ({ unsigned long __offset, __save12; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@tlsldm\n\t" \
+ ".quad " #x "@dtpoff\n" \
+ "1:\tlgr %1,%%r12\n\t" \
+ "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
+ "lg %%r2,0(%0)\n\t" \
+ "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
+ "lg %0,8(%0)\n\t" \
+ "algr %0,%%r2\n\t" \
+ "lgr %%r12,%1" \
+ : "=&a" (__offset), "=&a" (__save12) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_LD(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@tlsldm\n\t" \
+ ".quad " #x "@dtpoff\n" \
+ "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
+ "lg %%r2,0(%0)\n\t" \
+ "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
+ "lg %0,8(%0)\n\t" \
+ "algr %0,%%r2" \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
+
+#ifdef PIC
+# define TLS_GD(x) \
+ ({ unsigned long __offset, __save12; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@tlsgd\n" \
+ "1:\tlgr %1,%%r12\n\t" \
+ "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
+ "lg %%r2,0(%0)\n\t" \
+ "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
+ "lgr %0,%%r2\n\t" \
+ "lgr %%r12,%1" \
+ : "=&a" (__offset), "=&a" (__save12) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#else
+# define TLS_GD(x) \
+ ({ unsigned long __offset; \
+ asm ("bras %0,1f\n" \
+ "0:\t.quad " #x "@tlsgd\n" \
+ "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
+ "lg %%r2,0(%0)\n\t" \
+ "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
+ "lgr %0,%%r2" \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
+ (int *) (__builtin_thread_pointer() + __offset); })
+#endif
diff --git a/libc/sysdeps/s390/s390-64/tst-audit.h b/libc/sysdeps/s390/s390-64/tst-audit.h
new file mode 100644
index 000000000..3b4fac4fc
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. S/390 64-bit version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_s390_64_gnu_pltenter
+#define pltexit la_s390_64_gnu_pltexit
+#define La_regs La_s390_64_regs
+#define La_retval La_s390_64_retval
+#define int_retval lrv_r2
diff --git a/libc/sysdeps/sh/_mcount.S b/libc/sysdeps/sh/_mcount.S
index 7e3d50e94..878788b59 100644
--- a/libc/sysdeps/sh/_mcount.S
+++ b/libc/sysdeps/sh/_mcount.S
@@ -19,7 +19,7 @@
#include <sysdep.h>
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
+ .globl C_SYMBOL_NAME(_mcount)
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(_mcount),function)
cfi_startproc
.align 5
diff --git a/libc/sysdeps/sh/configure b/libc/sysdeps/sh/configure
index 29a924b08..655668556 100644
--- a/libc/sysdeps/sh/configure
+++ b/libc/sysdeps/sh/configure
@@ -1,121 +1,4 @@
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/sh.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SH TLS support" >&5
-$as_echo_n "checking for SH TLS support... " >&6; }
-if ${libc_cv_sh_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .long foo@TLSGD
- .long foo@TLSLDM
- .long foo@DTPOFF
- .long foo@GOTTPOFF
- .long foo@TPOFF
-EOF
-if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_sh_tls=yes
-else
- libc_cv_sh_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sh_tls" >&5
-$as_echo "$libc_cv_sh_tls" >&6; }
-if test $libc_cv_sh_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
-
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/libc/sysdeps/sh/configure.in b/libc/sysdeps/sh/configure.in
index 538e34e9f..21400c447 100644
--- a/libc/sysdeps/sh/configure.in
+++ b/libc/sysdeps/sh/configure.in
@@ -1,30 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/sh.
-# Check for support of thread-local storage handling in assembler and
-# linker.
-AC_CACHE_CHECK(for SH TLS support, libc_cv_sh_tls, [dnl
-cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
-foo: .long 25
- .text
- .long foo@TLSGD
- .long foo@TLSLDM
- .long foo@DTPOFF
- .long foo@GOTTPOFF
- .long foo@TPOFF
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_sh_tls=yes
-else
- libc_cv_sh_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_sh_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/libc/sysdeps/sh/ldsodefs.h b/libc/sysdeps/sh/ldsodefs.h
new file mode 100644
index 000000000..66d1e2fbb
--- /dev/null
+++ b/libc/sysdeps/sh/ldsodefs.h
@@ -0,0 +1,40 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SH_LDSODEFS_H
+#define _SH_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_sh_regs;
+struct La_sh_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ uintptr_t (*sh_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, const struct La_sh_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*sh_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, const struct La_sh_regs *, \
+ struct La_sh_retval *, const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/sh/sysdep.h b/libc/sysdeps/sh/sysdep.h
index 9354d2711..66a198288 100644
--- a/libc/sysdeps/sh/sysdep.h
+++ b/libc/sysdeps/sh/sysdep.h
@@ -36,7 +36,7 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(5); \
C_LABEL(name) \
diff --git a/libc/sysdeps/sh/tls-macros.h b/libc/sysdeps/sh/tls-macros.h
new file mode 100644
index 000000000..aa56b0a01
--- /dev/null
+++ b/libc/sysdeps/sh/tls-macros.h
@@ -0,0 +1,143 @@
+#define TLS_LE(x) \
+ ({ int *__l; void *__tp; \
+ asm ("stc gbr,%1\n\t" \
+ "mov.l 1f,%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tpoff\n\t" \
+ "2:" \
+ : "=r" (__l), "=r" (__tp)); \
+ __l; })
+
+#ifdef PIC
+# define TLS_IE(x) \
+ ({ int *__l; void *__tp; \
+ register void *__gp __asm__("r12"); \
+ asm ("mov.l 1f,r0\n\t" \
+ "stc gbr,%1\n\t" \
+ "mov.l @(r0,r12),%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@gottpoff\n\t" \
+ "2:" \
+ : "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
+ __l; })
+#else
+# define TLS_IE(x) \
+ ({ int *__l; void *__tp; \
+ asm ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r0\n\t" \
+ "stc gbr,%1\n\t" \
+ "mov.l @(r0,r12),%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@gottpoff\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "2: mov.l @r15+,r12" \
+ : "=r" (__l), "=r" (__tp) : : "r0"); \
+ __l; })
+#endif
+
+#ifdef PIC
+# define TLS_LD(x) \
+ ({ int *__l; \
+ register void *__gp __asm__("r12"); \
+ asm ("mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 4f\n\t" \
+ " nop\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsldm\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "4: mov.l 3f,%0\n\t" \
+ "bra 5f\n\t" \
+ " add r0,%0\n\t" \
+ ".align 2\n\t" \
+ "3: .long " #x "@dtpoff\n\t" \
+ "5:" \
+ : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
+ "r6", "r7", "pr", "t"); \
+ __l; })
+#else
+# define TLS_LD(x) \
+ ({ int *__l; \
+ asm ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 4f\n\t" \
+ " nop\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsldm\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "4: mov.l 3f,%0\n\t" \
+ "bra 5f\n\t" \
+ " add r0,%0\n\t" \
+ ".align 2\n\t" \
+ "3: .long " #x "@dtpoff\n\t" \
+ "5: mov.l @r15+,r12" \
+ : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pr", "t"); \
+ __l; })
+#endif
+
+#ifdef PIC
+# define TLS_GD(x) \
+ ({ int *__l; \
+ register void *__gp __asm__("r12"); \
+ asm ("mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 3f\n\t" \
+ " mov r0,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsgd\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "3:" \
+ : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
+ "r6", "r7", "pr", "t"); \
+ __l; })
+#else
+# define TLS_GD(x) \
+ ({ int *__l; \
+ asm ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 3f\n\t" \
+ " mov r0,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsgd\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "3: mov.l @r15+,r12" \
+ : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pr", "t"); \
+ __l; })
+#endif
diff --git a/libc/sysdeps/sh/tst-audit.h b/libc/sysdeps/sh/tst-audit.h
new file mode 100644
index 000000000..bb8db9895
--- /dev/null
+++ b/libc/sysdeps/sh/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. SH version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_sh_gnu_pltenter
+#define pltexit la_sh_gnu_pltexit
+#define La_regs La_sh_regs
+#define La_retval La_sh_retval
+#define int_retval lrv_r0
diff --git a/libc/sysdeps/sparc/configure b/libc/sysdeps/sparc/configure
index 13d9c63b9..72b4622af 100644
--- a/libc/sysdeps/sparc/configure
+++ b/libc/sysdeps/sparc/configure
@@ -123,60 +123,6 @@ if test $libc_cv_sparc_as_vis3 = yes; then
fi
-# Check for support of thread-local storage handling in assembler and linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc TLS support" >&5
-$as_echo_n "checking for sparc TLS support... " >&6; }
-if ${libc_cv_sparc_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .word 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 4
- .text
-baz: sethi %tgd_hi22(foo), %l1
- add %l1, %tgd_lo10(foo), %l1
- add %l7, %l1, %o0, %tgd_add(foo)
- call __tls_get_addr, %tgd_call(foo)
- sethi %tldm_hi22(bar), %l1
- add %l1, %tldm_lo10(bar), %l1
- add %l7, %l1, %o0, %tldm_add(bar)
- call __tls_get_addr, %tldm_call(bar)
- sethi %tldo_hix22(bar), %l1
- xor %l1, %tldo_lox10(bar), %l1
- add %o0, %l1, %l1, %tldo_add(bar)
- sethi %tie_hi22(foo), %l1
- add %l1, %tie_lo10(foo), %l1
-#ifdef __arch64__
- ldx [%l7 + %l1], %l1, %tie_ldx(foo)
-#else
- ld [%l7 + %l1], %l1, %tie_ld(foo)
-#endif
- add %g7, %l1, %l1, %tie_add(foo)
- sethi %tle_hix22(foo), %l1
- xor %l1, %tle_lox10(foo), %l1
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS conftest.S 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_sparc_tls=yes
-else
- libc_cv_sparc_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_tls" >&5
-$as_echo "$libc_cv_sparc_tls" >&6; }
-if test $libc_cv_sparc_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-fi
-
# Check for a GCC emitting GOTDATA relocations.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc gcc GOTDATA reloc support" >&5
$as_echo_n "checking for sparc gcc GOTDATA reloc support... " >&6; }
diff --git a/libc/sysdeps/sparc/configure.in b/libc/sysdeps/sparc/configure.in
index a85d0544f..080be992d 100644
--- a/libc/sysdeps/sparc/configure.in
+++ b/libc/sysdeps/sparc/configure.in
@@ -29,51 +29,6 @@ if test $libc_cv_sparc_as_vis3 = yes; then
AC_DEFINE(HAVE_AS_VIS3_SUPPORT)
fi
-# Check for support of thread-local storage handling in assembler and linker.
-AC_CACHE_CHECK(for sparc TLS support, libc_cv_sparc_tls, [dnl
-changequote(,)dnl
-cat > conftest.S <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .word 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 4
- .text
-baz: sethi %tgd_hi22(foo), %l1
- add %l1, %tgd_lo10(foo), %l1
- add %l7, %l1, %o0, %tgd_add(foo)
- call __tls_get_addr, %tgd_call(foo)
- sethi %tldm_hi22(bar), %l1
- add %l1, %tldm_lo10(bar), %l1
- add %l7, %l1, %o0, %tldm_add(bar)
- call __tls_get_addr, %tldm_call(bar)
- sethi %tldo_hix22(bar), %l1
- xor %l1, %tldo_lox10(bar), %l1
- add %o0, %l1, %l1, %tldo_add(bar)
- sethi %tie_hi22(foo), %l1
- add %l1, %tie_lo10(foo), %l1
-#ifdef __arch64__
- ldx [%l7 + %l1], %l1, %tie_ldx(foo)
-#else
- ld [%l7 + %l1], %l1, %tie_ld(foo)
-#endif
- add %g7, %l1, %l1, %tie_add(foo)
- sethi %tle_hix22(foo), %l1
- xor %l1, %tle_lox10(foo), %l1
-EOF
-changequote([,])dnl
-dnl
-if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_sparc_tls=yes
-else
- libc_cv_sparc_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_sparc_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
# Check for a GCC emitting GOTDATA relocations.
AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
changequote(,)dnl
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index 80ba338be..3d54a5901 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -820,20 +820,104 @@ ildouble: 1
ldouble: 1
# clog
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16494 i) == 11356.49165759582936919077408168801636572 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16494 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16494 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16494 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
+float: 1
+ifloat: 1
Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p-16494 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16494 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
double: 1
idouble: 1
Test "Real part of: clog (0x1p-147 + 0x1p-147 i) == -101.5460619520319878296245057936228672231 + pi/4 i":
float: 1
ifloat: 1
+Test "Real part of: clog (0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16494 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16494 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -846,6 +930,37 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
ildouble: 1
ldouble: 1
@@ -903,6 +1018,23 @@ ifloat: 1
Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
double: 1
float: 1
@@ -923,22 +1055,65 @@ ldouble: 1
Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Real part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
double: 1
idouble: 1
Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -1329,6 +1504,21 @@ ildouble: 1
ldouble: 1
# csqrt
+Test "Real part of: csqrt (-0x1.0000000000000000000000000001p-16382 - 0x1.0000000000000000000000000001p-16382 i) == 8.344545284118961663847948339519226074126e-2467 - 2.014551439675644900022606748976158925145e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000001p-1022 - 0x1.0000000000001p-1022 i) == 6.788430486774966350907249113759995429568e-155 - 1.638872094839911521020410942677082920935e-154 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
@@ -1342,6 +1532,21 @@ ldouble: 1
Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000000000000000001p-16382 + 0x1.0000000000000000000000000001p-16382 i) == 2.014551439675644900022606748976158925145e-2466 + 8.344545284118961663847948339519226074126e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000001p-1022 + 0x1.0000000000001p-1022 i) == 1.638872094839911521020410942677082920935e-154 + 6.788430486774966350907249113759995429568e-155 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 i":
+double: 1
+idouble: 1
Test "Imaginary part of: csqrt (0x1.fffffep+127 + 1.0 i) == 1.844674352395372953599975585936590505260e+19 + 2.710505511993121390769065968615872097053e-20 i":
float: 1
ifloat: 1
@@ -1428,6 +1633,97 @@ Test "Real part of: ctan (1 + 47 i) == 2.729321264492904590777293425576722354636
ildouble: 1
ldouble: 1
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+# ctan_tonearest
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
@@ -1500,6 +1796,97 @@ Test "Imaginary part of: ctanh (47 + 1 i) == 1.0 + 2.729321264492904590777293425
ildouble: 1
ldouble: 1
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 4
+ldouble: 4
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_downward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 2
+ldouble: 2
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_tonearest (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_towardzero (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1597,6 +1984,9 @@ ildouble: 1
ldouble: 1
# expm1
+Test "expm1 (-79.0) == -0.9999999999999999999999999999999999509391":
+ildouble: 1
+ldouble: 1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
double: 1
idouble: 1
@@ -2588,6 +2978,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+
Function: Real part of "clog10":
double: 1
float: 1
@@ -2726,6 +3120,60 @@ idouble: 1
ildouble: 2
ldouble: 2
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -2742,6 +3190,60 @@ ifloat: 2
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/sysdeps/sparc/ldsodefs.h b/libc/sysdeps/sparc/ldsodefs.h
new file mode 100644
index 000000000..2cfdc49f7
--- /dev/null
+++ b/libc/sysdeps/sparc/ldsodefs.h
@@ -0,0 +1,55 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SPARC_LDSODEFS_H
+#define _SPARC_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_sparc32_regs;
+struct La_sparc32_retval;
+struct La_sparc64_regs;
+struct La_sparc64_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf32_Addr (*sparc32_gnu_pltenter) (Elf32_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_sparc32_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf64_Addr (*sparc64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_sparc64_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*sparc32_gnu_pltexit) (Elf32_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_sparc32_regs *, \
+ struct La_sparc32_retval *, \
+ const char *); \
+ unsigned int (*sparc64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_sparc32_regs *, \
+ struct La_sparc32_retval *, \
+ const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/sparc/sparc32/tls-macros.h b/libc/sysdeps/sparc/sparc32/tls-macros.h
new file mode 100644
index 000000000..152216e8a
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/tls-macros.h
@@ -0,0 +1,66 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
+ asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#ifdef __PIC__
+# define TLS_LOAD_PIC \
+ ({ register long pc __asm__ ("%o7"); \
+ long got; \
+ asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
+ "call .+8\n\t" \
+ "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
+ "add %1, %0, %1\n\t" \
+ : "=r" (pc), "=r" (got)); \
+ got; })
+#else
+# define TLS_LOAD_PIC \
+ ({ long got; \
+ asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
+ "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
+ "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
+ : "=r" (got)); \
+ got; })
+#endif
+
+#define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("ld [%1 + %2], %0, %%tie_ld(" #x ")" \
+ : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ long __o; \
+ asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
+ asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
+ asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
+ : "r" (__o0), "r" (__o)); \
+ __l; })
+
+#define TLS_GD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ __o0; })
diff --git a/libc/sysdeps/sparc/sparc32/tst-audit.h b/libc/sysdeps/sparc/sparc32/tst-audit.h
new file mode 100644
index 000000000..f3aaf13d8
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. SPARC32 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_sparc32_gnu_pltenter
+#define pltexit la_sparc32_gnu_pltexit
+#define La_regs La_sparc32_regs
+#define La_retval La_sparc32_retval
+#define int_retval lrv_reg[0]
diff --git a/libc/sysdeps/sparc/sparc64/tls-macros.h b/libc/sysdeps/sparc/sparc64/tls-macros.h
new file mode 100644
index 000000000..bb0d8035f
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/tls-macros.h
@@ -0,0 +1,65 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
+ asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#ifdef __PIC__
+# define TLS_LOAD_PIC \
+ ({ long pc, got; \
+ asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
+ "rd %%pc, %0\n\t" \
+ "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
+ "add %1, %0, %1\n\t" \
+ : "=r" (pc), "=r" (got)); \
+ got; })
+#else
+# define TLS_LOAD_PIC \
+ ({ long got; \
+ asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
+ "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
+ "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
+ : "=r" (got)); \
+ got; })
+#endif
+
+#define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("ldx [%1 + %2], %0, %%tie_ldx(" #x ")" \
+ : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ long __o; \
+ asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
+ asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
+ asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
+ : "r" (__o0), "r" (__o)); \
+ __l; })
+
+#define TLS_GD(x) \
+ ({ int *__l; register void *__o0 asm ("%o0"); \
+ asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
+ asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ __o0; })
diff --git a/libc/sysdeps/sparc/sparc64/tst-audit.h b/libc/sysdeps/sparc/sparc64/tst-audit.h
new file mode 100644
index 000000000..7dd470130
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/tst-audit.h
@@ -0,0 +1,25 @@
+/* Definitions for testing PLT entry/exit auditing. SPARC64 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define pltenter la_sparc64_gnu_pltenter
+#define pltexit la_sparc64_gnu_pltexit
+#define La_regs La_sparc64_regs
+#define La_retval La_sparc64_retval
+#define int_retval lrv_reg[0]
diff --git a/libc/sysdeps/unix/sysv/linux/bits/siginfo.h b/libc/sysdeps/unix/sysv/linux/bits/siginfo.h
index d68a493e6..1304d5cc3 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/siginfo.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/siginfo.h
@@ -1,5 +1,5 @@
/* siginfo_t, sigevent and constants. Linux version.
- Copyright (C) 1997-2002, 2003, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -103,6 +103,14 @@ typedef struct
long int si_band; /* Band event for SIGPOLL. */
int si_fd;
} _sigpoll;
+
+ /* SIGSYS. */
+ struct
+ {
+ void *_call_addr; /* Calling user insn. */
+ int _syscall; /* Triggering system call number. */
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
+ } _sigsys;
} _sifields;
} siginfo_t;
@@ -121,6 +129,9 @@ typedef struct
# define si_addr _sifields._sigfault.si_addr
# define si_band _sifields._sigpoll.si_band
# define si_fd _sifields._sigpoll.si_fd
+# define si_call_addr _sifields._sigsys._call_addr
+# define si_syscall _sifields._sigsys._syscall
+# define si_arch _sifields._sigsys._arch
/* Values for `si_code'. Positive values are reserved for kernel-generated
diff --git a/libc/sysdeps/unix/sysv/linux/check_pf.c b/libc/sysdeps/unix/sysv/linux/check_pf.c
index 793d27db4..950498acd 100644
--- a/libc/sysdeps/unix/sysv/linux/check_pf.c
+++ b/libc/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006-2008, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2003-2012 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
@@ -289,16 +289,6 @@ out_fail:
}
-/* We don't know if we have NETLINK support compiled into our
- Kernel. */
-#if __ASSUME_NETLINK_SUPPORT == 0
-/* Define in ifaddrs.h. */
-extern int __no_netlink_support attribute_hidden;
-#else
-# define __no_netlink_support 0
-#endif
-
-
void
attribute_hidden
__check_pf (bool *seen_ipv4, bool *seen_ipv6,
@@ -307,12 +297,10 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
*in6ai = NULL;
*in6ailen = 0;
- if (! __no_netlink_support)
- {
- struct cached_data *olddata = NULL;
- struct cached_data *data = NULL;
+ struct cached_data *olddata = NULL;
+ struct cached_data *data = NULL;
- __libc_lock_lock (lock);
+ __libc_lock_lock (lock);
#ifdef IS_IN_nscd
# define cache_valid() nl_timestamp != 0 && cache->timestamp == nl_timestamp
@@ -321,90 +309,59 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
({ uint32_t val = __nscd_get_nl_timestamp (); \
val != 0 && cache->timestamp == val; })
#endif
- if (cache != NULL && cache_valid ())
- {
- data = cache;
- atomic_increment (&cache->usecnt);
- }
- else
- {
- int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
-
- if (__builtin_expect (fd >= 0, 1))
- {
- struct sockaddr_nl nladdr;
- memset (&nladdr, '\0', sizeof (nladdr));
- nladdr.nl_family = AF_NETLINK;
+ if (cache != NULL && cache_valid ())
+ {
+ data = cache;
+ atomic_increment (&cache->usecnt);
+ }
+ else
+ {
+ int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
- socklen_t addr_len = sizeof (nladdr);
+ if (__builtin_expect (fd >= 0, 1))
+ {
+ struct sockaddr_nl nladdr;
+ memset (&nladdr, '\0', sizeof (nladdr));
+ nladdr.nl_family = AF_NETLINK;
- if(__bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
- && __getsockname (fd, (struct sockaddr *) &nladdr,
- &addr_len) == 0)
- data = make_request (fd, nladdr.nl_pid);
+ socklen_t addr_len = sizeof (nladdr);
- close_not_cancel_no_status (fd);
- }
+ if (__bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
+ && __getsockname (fd, (struct sockaddr *) &nladdr,
+ &addr_len) == 0)
+ data = make_request (fd, nladdr.nl_pid);
- if (data != NULL)
- {
- olddata = cache;
- cache = data;
- }
+ close_not_cancel_no_status (fd);
}
- __libc_lock_unlock (lock);
-
if (data != NULL)
{
- /* It worked. */
- *seen_ipv4 = data->seen_ipv4;
- *seen_ipv6 = data->seen_ipv6;
- *in6ailen = data->in6ailen;
- *in6ai = data->in6ai;
-
- if (olddata != NULL && olddata->usecnt > 0
- && atomic_add_zero (&olddata->usecnt, -1))
- free (olddata);
-
- return;
+ olddata = cache;
+ cache = data;
}
-
-#if __ASSUME_NETLINK_SUPPORT == 0
- /* Remember that there is no netlink support. */
- __no_netlink_support = 1;
-#else
- /* We cannot determine what interfaces are available. Be
- pessimistic. */
- *seen_ipv4 = true;
- *seen_ipv6 = true;
-#endif
}
-#if __ASSUME_NETLINK_SUPPORT == 0
- /* No netlink. Get the interface list via getifaddrs. */
- struct ifaddrs *ifa = NULL;
- if (getifaddrs (&ifa) != 0)
+ __libc_lock_unlock (lock);
+
+ if (data != NULL)
{
- /* We cannot determine what interfaces are available. Be
- pessimistic. */
- *seen_ipv4 = true;
- *seen_ipv6 = true;
+ /* It worked. */
+ *seen_ipv4 = data->seen_ipv4;
+ *seen_ipv6 = data->seen_ipv6;
+ *in6ailen = data->in6ailen;
+ *in6ai = data->in6ai;
+
+ if (olddata != NULL && olddata->usecnt > 0
+ && atomic_add_zero (&olddata->usecnt, -1))
+ free (olddata);
+
return;
}
- struct ifaddrs *runp;
- for (runp = ifa; runp != NULL; runp = runp->ifa_next)
- if (runp->ifa_addr != NULL)
- {
- if (runp->ifa_addr->sa_family == PF_INET)
- *seen_ipv4 = true;
- else if (runp->ifa_addr->sa_family == PF_INET6)
- *seen_ipv6 = true;
- }
-
- (void) freeifaddrs (ifa);
-#endif
+ /* We cannot determine what interfaces are available. Be
+ pessimistic. */
+ *seen_ipv4 = true;
+ *seen_ipv6 = true;
}
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure
index ef2f71578..0650067e4 100644
--- a/libc/sysdeps/unix/sysv/linux/configure
+++ b/libc/sysdeps/unix/sysv/linux/configure
@@ -284,25 +284,22 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
- ;;
- powerpc/powerpc64)
arch_minimum_kernel=2.4.21
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
sh*)
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
@@ -311,10 +308,10 @@ case "$machine" in
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
*)
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
esac
if test -n "$minimum_kernel"; then
diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.in
index c3ec328b9..fc514fbf4 100644
--- a/libc/sysdeps/unix/sysv/linux/configure.in
+++ b/libc/sysdeps/unix/sysv/linux/configure.in
@@ -41,25 +41,22 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
- ;;
- powerpc/powerpc64)
arch_minimum_kernel=2.4.21
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
sh*)
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
@@ -68,10 +65,10 @@ case "$machine" in
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
*)
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.21
;;
esac
if test -n "$minimum_kernel"; then
diff --git a/libc/sysdeps/unix/sysv/linux/i386/accept4.S b/libc/sysdeps/unix/sysv/linux/i386/accept4.S
index 7282155ca..7fa549315 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/accept4.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/accept4.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1998,2002,2003,2005, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -67,7 +67,6 @@ ENTRY (__libc_accept4)
jae errlabel
/* Successful; return the syscall's value. */
-L(pseudo_end):
ret
diff --git a/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S b/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
index 077467c46..b413bc718 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
@@ -1,5 +1,5 @@
/* Selective file content synch'ing.
- Copyright (C) 2006, 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2006-2012 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
@@ -66,6 +66,5 @@ ENTRY (__call_sync_file_range)
movl $-ENOSYS, %eax
jmp SYSCALL_ERROR_LABEL
#endif
-L(pseudo_end):
ret
PSEUDO_END (__call_sync_file_range)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/clone.S b/libc/sysdeps/unix/sysv/linux/i386/clone.S
index 0603218ac..1aa2a1f82 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000,02,03,04,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
@@ -115,7 +115,6 @@ ENTRY (BP_SYM (__clone))
jl SYSCALL_ERROR_LABEL
jz L(thread_start)
-L(pseudo_end):
ret
L(thread_start):
diff --git a/libc/sysdeps/unix/sysv/linux/i386/epoll_pwait.S b/libc/sysdeps/unix/sysv/linux/i386/epoll_pwait.S
index 18459140d..aee115ce6 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/epoll_pwait.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/epoll_pwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2012 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
@@ -74,6 +74,5 @@ ENTRY (epoll_pwait)
movl $-ENOSYS, %eax
jmp SYSCALL_ERROR_LABEL
#endif
-L(pseudo_end):
ret
PSEUDO_END (epoll_pwait)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getcontext.S b/libc/sysdeps/unix/sysv/linux/i386/getcontext.S
index 27dd476bb..4ba2f6550 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -77,7 +77,6 @@ ENTRY(__getcontext)
/* All done, return 0 for success. */
xorl %eax, %eax
-L(pseudo_end):
ret
PSEUDO_END(__getcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/mmap.S b/libc/sysdeps/unix/sysv/linux/i386/mmap.S
index 7fc2f11e1..c8bf3e108 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/mmap.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/mmap.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,96,97,98,99,2000,2002,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -98,7 +97,6 @@ L(skip):
ja SYSCALL_ERROR_LABEL
/* Successful; return the syscall's value. */
-L(pseudo_end):
ret
PSEUDO_END (__mmap)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
index 72e216a5a..7599b8544 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,96,97,98,99,2000,2002,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -100,7 +99,6 @@ L(do_syscall):
ja SYSCALL_ERROR_LABEL
/* Successful; return the syscall's value. */
-L(pseudo_end):
ret
cfi_adjust_cfa_offset (16)
@@ -151,9 +149,6 @@ L(einval):
ja SYSCALL_ERROR_LABEL
/* Successful; return the syscall's value. */
-#ifndef __NR_mmap2
-L(pseudo_end):
-#endif
ret
cfi_register (ebx, edx)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/i386/nptl/c++-types.data
new file mode 100644
index 000000000..fde53bf33
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/i386/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
index d6695ebb9..0e8576fdd 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
@@ -1811,6 +1811,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/i386/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/i386/nptl/localplt.data
new file mode 100644
index 000000000..8fb56b608
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/i386/nptl/localplt.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S b/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
index 2e01bc87b..785be2efc 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -65,7 +65,6 @@ ENTRY (BP_SYM (semtimedop))
ja SYSCALL_ERROR_LABEL
/* Successful; return the syscall's value. */
-L(pseudo_end):
ret
#ifdef PIC
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setcontext.S b/libc/sysdeps/unix/sysv/linux/i386/setcontext.S
index d5e10f6a4..a030d626e 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -89,7 +89,6 @@ ENTRY(__setcontext)
/* The following 'ret' will pop the address of the code and jump
to it. */
-L(pseudo_end):
ret
PSEUDO_END(__setcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/socket.S b/libc/sysdeps/unix/sysv/linux/i386/socket.S
index c2954077d..c01ce7ac2 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/socket.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1998,2002,2003,2005,2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -68,7 +68,6 @@ ENTRY (__socket)
jae SYSCALL_ERROR_LABEL
/* Successful; return the syscall's value. */
-L(pseudo_end):
ret
diff --git a/libc/sysdeps/unix/sysv/linux/i386/swapcontext.S b/libc/sysdeps/unix/sysv/linux/i386/swapcontext.S
index 3676b3f3e..7a6dfa105 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -103,8 +103,6 @@ ENTRY(__swapcontext)
/* The following 'ret' will pop the address of the code and jump
to it. */
-
-L(pseudo_end):
ret
PSEUDO_END(__swapcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/syscall.S b/libc/sysdeps/unix/sysv/linux/i386/syscall.S
index e3865d0d1..c37e7cbb5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/syscall.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1998, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -30,7 +30,6 @@ ENTRY (syscall)
POPARGS_6 /* Restore register contents. */
cmpl $-4095, %eax /* Check %eax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
-L(pseudo_end):
ret /* Return to caller. */
PSEUDO_END (syscall)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
index 4b7acb9a5..2fbb0f660 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007,2011-2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
@@ -74,8 +73,7 @@
ENTRY (name) \
DO_CALL (syscall_name, args); \
cmpl $-4095, %eax; \
- jae SYSCALL_ERROR_LABEL; \
- L(pseudo_end):
+ jae SYSCALL_ERROR_LABEL
#undef PSEUDO_END
#define PSEUDO_END(name) \
diff --git a/libc/sysdeps/unix/sysv/linux/i386/vfork.S b/libc/sysdeps/unix/sysv/linux/i386/vfork.S
index 23e7fc717..a8a7e4567 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002, 2004, 2005, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
@@ -57,7 +57,6 @@ ENTRY (__vfork)
/* Branch forward if it failed. */
# ifdef __ASSUME_VFORK_SYSCALL
jae SYSCALL_ERROR_LABEL
-.Lpseudo_end:
# else
jae .Lerror
# endif
@@ -79,7 +78,6 @@ ENTRY (__vfork)
int $0x80
cmpl $-4095, %eax
jae SYSCALL_ERROR_LABEL
-.Lpseudo_end:
ret
#endif
PSEUDO_END (__vfork)
diff --git a/libc/sysdeps/unix/sysv/linux/if_index.c b/libc/sysdeps/unix/sysv/linux/if_index.c
index 3c86bb865..cf3368392 100644
--- a/libc/sysdeps/unix/sysv/linux/if_index.c
+++ b/libc/sysdeps/unix/sysv/linux/if_index.c
@@ -74,90 +74,13 @@ if_freenameindex (struct if_nameindex *ifn)
libc_hidden_def (if_freenameindex)
-#if __ASSUME_NETLINK_SUPPORT == 0
-static struct if_nameindex *
-if_nameindex_ioctl (void)
-{
- int fd = __opensock ();
- struct ifconf ifc;
- unsigned int nifs, i;
- int rq_len;
- struct if_nameindex *idx = NULL;
-# define RQ_IFS 4
-
- if (fd < 0)
- return NULL;
-
- ifc.ifc_buf = NULL;
-
- /* We may be able to get the needed buffer size directly, rather than
- guessing. */
- ifc.ifc_buf = NULL;
- ifc.ifc_len = 0;
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
- rq_len = RQ_IFS * sizeof (struct ifreq);
- else
- rq_len = ifc.ifc_len;
-
- /* Read all the interfaces out of the kernel. */
- ifc.ifc_buf = alloca (rq_len);
- ifc.ifc_len = rq_len;
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
- {
- close_not_cancel_no_status (fd);
- return NULL;
- }
-
- nifs = ifc.ifc_len / sizeof (struct ifreq);
-
- idx = malloc ((nifs + 1) * sizeof (struct if_nameindex));
- if (idx == NULL)
- {
- close_not_cancel_no_status (fd);
- __set_errno (ENOBUFS);
- return NULL;
- }
-
- for (i = 0; i < nifs; ++i)
- {
- struct ifreq *ifr = &ifc.ifc_req[i];
- idx[i].if_name = __strdup (ifr->ifr_name);
- if (idx[i].if_name == NULL
- || __ioctl (fd, SIOCGIFINDEX, ifr) < 0)
- {
- int saved_errno = errno;
- unsigned int j;
-
- for (j = 0; j < i; ++j)
- free (idx[j].if_name);
- free (idx);
- close_not_cancel_no_status (fd);
- if (saved_errno == EINVAL)
- saved_errno = ENOSYS;
- else if (saved_errno == ENOMEM)
- saved_errno = ENOBUFS;
- __set_errno (saved_errno);
- return NULL;
- }
- idx[i].if_index = ifr->ifr_ifindex;
- }
-
- idx[i].if_index = 0;
- idx[i].if_name = NULL;
-
- close_not_cancel_no_status (fd);
- return idx;
-}
-#endif
-
-
static struct if_nameindex *
if_nameindex_netlink (void)
{
struct netlink_handle nh = { 0, 0, 0, NULL, NULL };
struct if_nameindex *idx = NULL;
- if (__no_netlink_support || __netlink_open (&nh) < 0)
+ if (__netlink_open (&nh) < 0)
return NULL;
@@ -274,10 +197,6 @@ if_nameindex (void)
return NULL;
#else
struct if_nameindex *result = if_nameindex_netlink ();
-# if __ASSUME_NETLINK_SUPPORT == 0
- if (__no_netlink_support)
- result = if_nameindex_ioctl ();
-# endif
return result;
#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/ifaddrs.c b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
index 51836b0dc..179653103 100644
--- a/libc/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -1,5 +1,5 @@
/* getifaddrs -- get names and addresses of all network interfaces
- Copyright (C) 2003-2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2003-2012 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
@@ -37,17 +37,6 @@
#include "netlinkaccess.h"
-/* We don't know if we have NETLINK support compiled into our
- Kernel, so include the old implementation as fallback. */
-#if __ASSUME_NETLINK_SUPPORT == 0
-int __no_netlink_support attribute_hidden;
-
-# define getifaddrs fallback_getifaddrs
-# include "sysdeps/gnu/ifaddrs.c"
-# undef getifaddrs
-#endif
-
-
/* There is a problem with this type. The address length for
Infiniband sockets is much longer than the 8 bytes allocated in the
sockaddr_ll definition. Hence we use here a special
@@ -274,9 +263,6 @@ __netlink_open (struct netlink_handle *h)
close_and_out:
__netlink_close (h);
out:
-#if __ASSUME_NETLINK_SUPPORT == 0
- __no_netlink_support = 1;
-#endif
return -1;
}
/* Determine the ID the kernel assigned for this netlink connection.
@@ -340,17 +326,8 @@ getifaddrs_internal (struct ifaddrs **ifap)
*ifap = NULL;
- if (! __no_netlink_support && __netlink_open (&nh) < 0)
- {
-#if __ASSUME_NETLINK_SUPPORT != 0
- return -1;
-#endif
- }
-
-#if __ASSUME_NETLINK_SUPPORT == 0
- if (__no_netlink_support)
- return fallback_getifaddrs (ifap);
-#endif
+ if (__netlink_open (&nh) < 0)
+ return -1;
/* Tell the kernel that we wish to get a list of all
active interfaces, collect all data for every interface. */
@@ -859,11 +836,9 @@ getifaddrs (struct ifaddrs **ifap)
libc_hidden_def (getifaddrs)
-#if __ASSUME_NETLINK_SUPPORT != 0
void
freeifaddrs (struct ifaddrs *ifa)
{
free (ifa);
}
libc_hidden_def (freeifaddrs)
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index 4d333e81e..cfe335d0b 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -76,87 +76,42 @@
# define __ASSUME_STAT64_SYSCALL 1
#endif
-/* The changed st_ino field appeared in 2.4.0-test6. But we cannot
- distinguish this version from other 2.4.0 releases. Therefore play
- save and assume it available is for 2.4.1 and up. However, SH is lame,
+/* The changed st_ino field appeared in 2.4.0-test6. However, SH is lame,
and still does not have a 64-bit inode field. */
-#if __LINUX_KERNEL_VERSION >= 132097 && !defined __sh__
+#ifndef __sh__
# define __ASSUME_ST_INO_64_BIT 1
#endif
/* To support locking of large files a new fcntl() syscall was introduced
- in 2.4.0-test7. We test for 2.4.1 for the earliest version we know
- the syscall is available. */
-#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__)
+ in 2.4.0-test7. */
+#if defined __i386__ || defined __sparc__
# define __ASSUME_FCNTL64 1
#endif
-/* The AT_CLKTCK auxiliary vector entry was introduction in the 2.4.0
- series. */
-#if __LINUX_KERNEL_VERSION >= 132097
-# define __ASSUME_AT_CLKTCK 1
-#endif
-
/* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I
don't know when it got introduced). But PowerPC64 does not support
separate FCNTL64 call, FCNTL is already 64-bit */
-#if __LINUX_KERNEL_VERSION >= 132100 \
- && (defined __powerpc__ || defined __sh__) \
+#if (defined __powerpc__ || defined __sh__) \
&& !defined __powerpc64__
# define __ASSUME_FCNTL64 1
#endif
-/* The getdents64 syscall was introduced in 2.4.0-test7. We test for
- 2.4.1 for the earliest version we know the syscall is available. */
-#if __LINUX_KERNEL_VERSION >= 132097
-# define __ASSUME_GETDENTS64_SYSCALL 1
-#endif
-
-/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
- up the page size information. */
-#if __LINUX_KERNEL_VERSION >= 132097
-# define __ASSUME_AT_PAGESIZE 1
-#endif
-
-/* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally
- up to the child. */
-#if __LINUX_KERNEL_VERSION >= 132097
-# define __ASSUME_AT_XID 1
-#endif
+/* The getdents64 syscall was introduced in 2.4.0-test7 (but later for
+ MIPS n32). */
+#define __ASSUME_GETDENTS64_SYSCALL 1
-/* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way
- and the vfork syscall made it into the official kernel. */
-#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__
-# define __ASSUME_STD_AUXV 1
+/* Starting with 2.4.5 kernels the vfork syscall made it into the
+ official kernel for PPC. */
+#ifdef __powerpc__
# define __ASSUME_VFORK_SYSCALL 1
#endif
/* Starting with 2.4.5 kernels the mmap2 syscall made it into the official
kernel. But PowerPC64 does not support a separate MMAP2 call. */
-#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \
- && !defined __powerpc64__
+#if defined __powerpc__ && !defined __powerpc64__
# define __ASSUME_MMAP2_SYSCALL 1
#endif
-/* Starting with 2.4.21 PowerPC implements the new prctl syscall.
- This allows applications to get/set the Floating Point Exception Mode. */
-#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__
-# define __ASSUME_NEW_PRCTL_SYSCALL 1
-#endif
-
-/* Starting with 2.4.21 the PowerPC32 clone syscall works as expected. */
-#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \
- && !defined __powerpc64__
-# define __ASSUME_FIXED_CLONE_SYSCALL 1
-#endif
-
-/* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall.
- The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn
- to be used in the set/swapcontext implementation. */
-#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc64__
-# define __ASSUME_NEW_RT_SIGRETURN_SYSCALL 1
-#endif
-
/* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
semantics was changed in 2.5.30, and again after 2.5.31. */
#if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
@@ -164,7 +119,7 @@
#endif
/* The vfork syscall on x86 and arm was definitely available in 2.4. */
-#if __LINUX_KERNEL_VERSION >= 132097 && defined __i386__
+#ifdef __i386__
# define __ASSUME_VFORK_SYSCALL 1
#endif
@@ -192,11 +147,6 @@
# define __ASSUME_POSIX_CPU_TIMERS 1
#endif
-/* With kernel 2.4.17 we always have netlink support. */
-#if __LINUX_KERNEL_VERSION >= (132096+17)
-# define __ASSUME_NETLINK_SUPPORT 1
-#endif
-
/* The requeue futex functionality was introduced in 2.5.70. */
#if __LINUX_KERNEL_VERSION >= 132422
# define __ASSUME_FUTEX_REQUEUE 1
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index d295b9671..50f3e2b64 100644
--- a/libc/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2001, 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 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
@@ -37,9 +37,7 @@ extern void _dl_non_dynamic_init (void) internal_function;
/* We can assume that the kernel always provides the AT_UID, AT_EUID,
AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */
-#if __ASSUME_AT_XID
-# define HAVE_AUX_XID
-#endif
+#define HAVE_AUX_XID
/* We can assume that the kernel always provides the AT_SECURE value
in the auxiliary vector from 2.5.74 or so on. */
@@ -49,9 +47,7 @@ extern void _dl_non_dynamic_init (void) internal_function;
/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
up the page size information. */
-#if __ASSUME_AT_PAGESIZE
-# define HAVE_AUX_PAGESIZE
-#endif
+#define HAVE_AUX_PAGESIZE
/* Accept binaries which identify the binary as using Linux extensions. */
#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \
diff --git a/libc/sysdeps/unix/sysv/linux/libc_fatal.c b/libc/sysdeps/unix/sysv/linux/libc_fatal.c
index a17170c70..f46e53e7e 100644
--- a/libc/sysdeps/unix/sysv/linux/libc_fatal.c
+++ b/libc/sysdeps/unix/sysv/linux/libc_fatal.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993-1995,1997,2000,2002-2005,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 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
@@ -65,7 +64,7 @@ __libc_message (int do_abort, const char *fmt, ...)
/* Open a descriptor for /dev/tty unless the user explicitly
requests errors on standard error. */
- const char *on_2 = __secure_getenv ("LIBC_FATAL_STDERR_");
+ const char *on_2 = __libc_secure_getenv ("LIBC_FATAL_STDERR_");
if (on_2 == NULL || *on_2 == '\0')
fd = open_not_cancel_2 (_PATH_TTY, O_RDWR | O_NOCTTY | O_NDELAY);
diff --git a/libc/sysdeps/unix/sysv/linux/netlinkaccess.h b/libc/sysdeps/unix/sysv/linux/netlinkaccess.h
index cb190c0ec..6cd8a8826 100644
--- a/libc/sysdeps/unix/sysv/linux/netlinkaccess.h
+++ b/libc/sysdeps/unix/sysv/linux/netlinkaccess.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2012 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
@@ -44,13 +44,6 @@ struct netlink_handle
};
-#if __ASSUME_NETLINK_SUPPORT == 0
-extern int __no_netlink_support attribute_hidden;
-#else
-# define __no_netlink_support 0
-#endif
-
-
extern int __netlink_open (struct netlink_handle *h);
extern void __netlink_close (struct netlink_handle *h);
extern void __netlink_free_handle (struct netlink_handle *h);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
index 347e249ab..9cf138186 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
@@ -1,6 +1,5 @@
/* Operating system support for run-time dynamic linker. Linux/PPC version.
- Copyright (C) 1997, 1998, 2001, 2003, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -44,35 +43,4 @@ int __cache_line_size attribute_hidden;
__cache_line_size = av->a_un.a_val; \
break;
-#ifndef __ASSUME_STD_AUXV
-
-/* The PowerPC's auxiliary argument block gets aligned to a 16-byte
- boundary. This is history and impossible to change compatibly. */
-
-#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
- do { \
- char **_tmp; \
- size_t _test; \
- (argc) = *(long int *) cookie; \
- (argv) = (char **) cookie + 1; \
- (envp) = (argv) + (argc) + 1; \
- for (_tmp = (envp); *_tmp; ++_tmp) \
- continue; \
- /* The following '++' is important! */ \
- ++_tmp; \
- \
- _test = (size_t)_tmp; \
- _test = (_test + 0xf) & ~0xf; \
- /* Under some circumstances, MkLinux (up to at least DR3a5) \
- omits the padding. To work around this, we make a \
- basic sanity check of the argument vector. Of \
- course, this means that in future, the argument \
- vector will have to be laid out to allow for this \
- test :-(. */ \
- if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
- _tmp = (char **)_test; \
- (auxp) = (ElfW(auxv_t) *) _tmp; \
- } while (0)
-#endif
-
#include <sysdeps/unix/sysv/linux/dl-sysdep.c>
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
index 57640aa49..fb16519ef 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
@@ -1,5 +1,5 @@
/* Wrapper around clone system call.
- Copyright (C) 1997,98,99,2000,02,04,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -52,11 +52,7 @@ ENTRY (BP_SYM (__clone))
#ifdef RESET_PID
stmw r28,16(r1)
#else
-# ifndef __ASSUME_FIXED_CLONE_SYSCALL
- stmw r29,16(r1)
-# else
stmw r30,16(r1)
-# endif
#endif
/* Set up stack frame for child. */
@@ -66,9 +62,6 @@ ENTRY (BP_SYM (__clone))
/* Save fn, args, stack across syscall. */
mr r30,r3 /* Function in r30. */
-#ifndef __ASSUME_FIXED_CLONE_SYSCALL
- mr r29,r4 /* Stack pointer in r29. */
-#endif
#ifdef RESET_PID
mr r28,r5
#endif
@@ -95,14 +88,6 @@ ENTRY (BP_SYM (__clone))
crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */
-#ifndef __ASSUME_FIXED_CLONE_SYSCALL
- /* On at least mklinux DR3a5, clone() doesn't actually change
- the stack pointer. I'm pretty sure this is a bug, because
- it adds a race condition if a signal is sent to a thread
- just after it is created (in the previous three instructions). */
- mr r1,r29
-#endif
-
#ifdef RESET_PID
andis. r0,r28,CLONE_THREAD>>16
bne+ r0,L(oldpid)
@@ -128,11 +113,7 @@ L(parent):
#ifdef RESET_PID
lmw r28,16(r1)
#else
-# ifndef __ASSUME_FIXED_CLONE_SYSCALL
- lmw r29,16(r1)
-# else
lmw r30,16(r1)
-# endif
#endif
addi r1,r1,32
bnslr+
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
index 0642e0b40..366c5fe93 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_MASK_ENV for Linux/ppc.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2012 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,44 +24,11 @@
#include <sys/prctl.h>
#include <kernel-features.h>
-#if __ASSUME_NEW_PRCTL_SYSCALL == 0
-/* This is rather fiddly under Linux. We don't have direct access,
- and there is no system call, but we can change the bits
- in a signal handler's context... */
-
-static struct sigaction oact;
-
-static void
-fe_mask_handler (int signum, struct sigcontext *sc)
-{
- sc->regs->msr &= ~0x900ul; /* FE0 | FE1 */
- sigaction (SIGUSR1, &oact, NULL);
-}
-#endif
-
const fenv_t *
__fe_mask_env (void)
{
-#if __ASSUME_NEW_PRCTL_SYSCALL == 0
-# if defined PR_SET_FPEXC && defined PR_FP_EXC_DISABLED
- int result = INLINE_SYSCALL (prctl, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED);
-
- if (result == -1 && errno == EINVAL)
-# endif
- {
- struct sigaction act;
-
- act.sa_handler = (sighandler_t) fe_mask_handler;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
-
- sigaction (SIGUSR1, &act, &oact);
- raise (SIGUSR1);
- }
-#else
INTERNAL_SYSCALL_DECL (err);
INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED);
-#endif
return FE_DFL_ENV;
}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
index 2097af654..86738fdd5 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_NOMASK_ENV for Linux/ppc.
- Copyright (C) 2000, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 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,44 +24,11 @@
#include <sys/prctl.h>
#include <kernel-features.h>
-#if __ASSUME_NEW_PRCTL_SYSCALL == 0
-/* This is rather fiddly under Linux. We don't have direct access,
- and there is no system call, but we can change the bits
- in a signal handler's context... */
-
-static struct sigaction oact;
-
-static void
-fe_nomask_handler (int signum, struct sigcontext *sc)
-{
- sc->regs->msr |= 0x900ul; /* FE0 | FE1 */
- sigaction (SIGUSR1, &oact, NULL);
-}
-#endif
-
const fenv_t *
__fe_nomask_env (void)
{
-#if __ASSUME_NEW_PRCTL_SYSCALL == 0
-# if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
- int result = INLINE_SYSCALL (prctl, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
-
- if (result == -1 && errno == EINVAL)
-# endif
- {
- struct sigaction act;
-
- act.sa_handler = (sighandler_t) fe_nomask_handler;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
-
- sigaction (SIGUSR1, &act, &oact);
- raise (SIGUSR1);
- }
-#else
INTERNAL_SYSCALL_DECL (err);
INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
-#endif
return FE_ENABLED_ENV;
}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/c++-types.data
new file mode 100644
index 000000000..fde53bf33
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
index 706d2a9eb..75123b9f3 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
@@ -1772,6 +1772,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data
new file mode 100644
index 000000000..8fb56b608
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
index 9d41ae736..e4bcd9800 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_MASK_ENV for Linux/ppc64.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2012 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
@@ -30,11 +30,6 @@ __fe_mask_env (void)
int result;
INTERNAL_SYSCALL_DECL (err);
result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED);
-# ifndef __ASSUME_NEW_PRCTL_SYSCALL
- if (INTERNAL_SYSCALL_ERROR_P (result, err)
- && INTERNAL_SYSCALL_ERRNO (result, err) == EINVAL)
- __set_errno (ENOSYS);
-# endif
#else
__set_errno (ENOSYS);
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
index 14cf14d5b..46b947898 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_NOMASK_ENV for Linux/ppc64.
- Copyright (C) 2003, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003-2012 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
@@ -30,11 +30,6 @@ __fe_nomask_env (void)
int result;
INTERNAL_SYSCALL_DECL (err);
result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
-# ifndef __ASSUME_NEW_PRCTL_SYSCALL
- if (INTERNAL_SYSCALL_ERROR_P (result, err)
- && INTERNAL_SYSCALL_ERRNO (result, err) == EINVAL)
- __set_errno (ENOSYS);
-# endif
#else
__set_errno (ENOSYS);
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
index 533d98bcc..472b785c1 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 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
@@ -30,7 +30,6 @@
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
ENTRY(__novec_getcontext)
CALL_MCOUNT 1
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
std r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
mflr r0
@@ -137,18 +136,6 @@ ENTRY(__novec_getcontext)
li r3,SIG_BLOCK
bl JUMPTARGET(__sigprocmask)
nop
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset (lr, FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset(128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
-#endif
ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
@@ -172,7 +159,6 @@ compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3)
.machine "altivec"
ENTRY(__getcontext)
CALL_MCOUNT 1
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
std r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
mflr r0
@@ -388,18 +374,6 @@ L(has_no_vec):
li r3,SIG_BLOCK
bl JUMPTARGET(__sigprocmask)
nop
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset (lr, FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset (128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
-#endif
ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
index 9d5898c05..ded2a35e0 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 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
@@ -26,7 +26,6 @@
ENTRY(__makecontext)
CALL_MCOUNT 3
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
/* Save parameters into the parameter save area of callers frame. */
std r3,FRAME_PARM1_SAVE(r1) /* ucontext_t *ucp */
std r4,FRAME_PARM2_SAVE(r1) /* void (*func)(void) */
@@ -166,22 +165,6 @@ L(gotexitcodeaddr):
addi r1,r1,128
mtlr r0
blr
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset (lr, FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset (128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
- addi r1,r1,128
- mtlr r0
- blr
-#endif
END(__makecontext)
weak_alias (__makecontext, makecontext)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/c++-types.data
new file mode 100644
index 000000000..23c11dc41
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:l
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:m
+fd_mask:l
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:m
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:l
+int8_t:a
+intptr_t:l
+key_t:i
+loff_t:l
+mode_t:j
+nlink_t:m
+off64_t:l
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:l
+register_t:l
+rlim64_t:m
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:m
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:m
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
index a0d362e11..e2484d3f2 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
@@ -78,6 +78,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.3
GLIBC_2.3 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data
new file mode 100644
index 000000000..2219aa904
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data
@@ -0,0 +1,6 @@
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index 988ea3a7b..a7192a623 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -1,6 +1,5 @@
/* Switch to context.
- Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 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
@@ -39,7 +38,6 @@
#if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
ENTRY(__novec_setcontext)
CALL_MCOUNT 1
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
mflr r0
std r31,-8(1)
cfi_offset(r31,-8)
@@ -200,22 +198,6 @@ L(nv_do_sigret):
li r0,SYS_ify(rt_sigreturn)
sc
/* No return. */
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset(lr,FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset(128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
- addi r1,r1,128
- mtlr r0
- blr
-#endif
PSEUDO_END(__novec_setcontext)
@@ -227,7 +209,6 @@ compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3)
.machine "altivec"
ENTRY(__setcontext)
CALL_MCOUNT 1
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
mflr r0
std r31,-8(1)
cfi_offset(r31,-8)
@@ -491,22 +472,6 @@ L(do_sigret):
li r0,SYS_ify(rt_sigreturn)
sc
/* No return. */
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset (lr, FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset (128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
- addi r1,r1,128
- mtlr r0
- blr
-#endif
PSEUDO_END(__setcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index 6b007a595..f20e9a9be 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -1,6 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 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
@@ -39,7 +38,6 @@
.section ".text"
ENTRY(__novec_swapcontext)
CALL_MCOUNT 2
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
std r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
mflr r0
@@ -294,21 +292,6 @@ L(nv_do_sigret):
li r0,SYS_ify(rt_sigreturn)
sc
/* No return. */
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset(lr,FRAME_LR_SAVE)
- stdu r1,-128(r1)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
- addi r1,r1,128
- mtlr r0
- blr
-#endif
PSEUDO_END(__novec_swapcontext)
@@ -320,7 +303,6 @@ compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3)
.machine "altivec"
ENTRY(__swapcontext)
CALL_MCOUNT 2
-#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
std r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
mflr r0
@@ -789,22 +771,6 @@ L(do_sigret):
li r0,SYS_ify(rt_sigreturn)
sc
/* No return. */
-#else
- /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */
- mflr r0
- std r0,FRAME_LR_SAVE(r1)
- cfi_offset (lr, FRAME_LR_SAVE)
- stdu r1,-128(r1)
- cfi_adjust_cfa_offset (128)
- li r3,ENOSYS
- bl JUMPTARGET(__syscall_error)
- nop
- li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
- addi r1,r1,128
- mtlr r0
- blr
-#endif
PSEUDO_END(__swapcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index d43a135cf..b26a86a09 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2001, 2006, 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 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
@@ -126,7 +126,8 @@ enum __ptrace_flags
};
/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions {
+enum __ptrace_setoptions
+{
PTRACE_O_TRACESYSGOOD = 0x00000001,
PTRACE_O_TRACEFORK = 0x00000002,
PTRACE_O_TRACEVFORK = 0x00000004,
@@ -134,17 +135,20 @@ enum __ptrace_setoptions {
PTRACE_O_TRACEEXEC = 0x00000010,
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_MASK = 0x0000007f
+ PTRACE_O_TRACESECCOMP = 0x00000080,
+ PTRACE_O_MASK = 0x000000ff
};
/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes {
+enum __ptrace_eventcodes
+{
PTRACE_EVENT_FORK = 1,
PTRACE_EVENT_VFORK = 2,
PTRACE_EVENT_CLONE = 3,
PTRACE_EVENT_EXEC = 4,
PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6
+ PTRACE_EVENT_EXIT = 6,
+ PTRACE_EVENT_SECCOMP = 7
};
/* Perform process tracing functions. REQUEST is one of the values
diff --git a/libc/sysdeps/unix/sysv/linux/prof-freq.c b/libc/sysdeps/unix/sysv/linux/prof-freq.c
index e50731cdd..b0f255326 100644
--- a/libc/sysdeps/unix/sysv/linux/prof-freq.c
+++ b/libc/sysdeps/unix/sysv/linux/prof-freq.c
@@ -1,5 +1,5 @@
/* Determine realtime clock frequency.
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003-2012 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
@@ -25,26 +25,6 @@
int
__profile_frequency (void)
{
-#ifdef __ASSUME_AT_CLKTCK
return GLRO(dl_clktck);
-#else
- if (GLRO(dl_clktck) != 0)
- return GLRO(dl_clktck);
-
- struct itimerval tim;
-
- tim.it_interval.tv_sec = 0;
- tim.it_interval.tv_usec = 1;
- tim.it_value.tv_sec = 0;
- tim.it_value.tv_usec = 0;
-
- __setitimer (ITIMER_REAL, &tim, 0);
- __setitimer (ITIMER_REAL, 0, &tim);
-
- if (tim.it_interval.tv_usec < 2)
- return 0;
-
- return 1000000 / tim.it_interval.tv_usec;
-#endif
}
libc_hidden_def (__profile_frequency)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h b/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
index baa989195..159bafb73 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
@@ -1,5 +1,5 @@
/* siginfo_t, sigevent and constants. S/390 version.
- Copyright (C) 2001, 2002, 2003, 2009, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 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
@@ -104,6 +104,14 @@ typedef struct
long int si_band; /* Band event for SIGPOLL. */
int si_fd;
} _sigpoll;
+
+ /* SIGSYS. */
+ struct
+ {
+ void *_call_addr; /* Calling user insn. */
+ int _syscall; /* Triggering system call number. */
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
+ } _sigsys;
} _sifields;
} siginfo_t;
@@ -123,6 +131,9 @@ typedef struct
# define si_trapno _sifields._sigfault.si_trapno
# define si_band _sifields._sigpoll.si_band
# define si_fd _sifields._sigpoll.si_fd
+# define si_call_addr _sifields._sigsys._call_addr
+# define si_syscall _sifields._sigsys._syscall
+# define si_arch _sifields._sigsys._arch
/* Values for `si_code'. Positive values are reserved for kernel-generated
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/Makefile b/libc/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
index 3216804f7..626a96f04 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
@@ -21,3 +21,7 @@ sysdep_routines += framestate
shared-only-routines += framestate
endif
endif
+
+ifeq ($(subdir),stdlib)
+sysdep_routines += __makecontext_ret
+endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S b/libc/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
new file mode 100644
index 000000000..ab172bb72
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
@@ -0,0 +1,48 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY(__makecontext_ret)
+ basr %r14,%r7
+ ltr %r8,%r8 /* Check whether uc_link is 0. */
+ jz 1f
+ lr %r2,%r8
+ br %r9
+1: lhi %r2,0 /* EXIT return value. */
+ basr %r13,0
+2:
+#ifdef PIC
+ l %r12,4f-2b(%r13)
+ la %r12,0(%r12,%r13) /* GOT pointer in r12 after this. */
+ l %r1,3f-2b(%r13)
+ bas %r14,0(%r1,%r12)
+ .align 4
+3:
+ .long HIDDEN_JUMPTARGET (exit)@GOTOFF
+4:
+ .long _GLOBAL_OFFSET_TABLE_-2b
+#else
+ l %r1,3f-2b(%r13)
+ basr %r14,%r1
+ .align 4
+3:
+ .long HIDDEN_JUMPTARGET (exit)
+#endif
+ .align 2
+ j .+2 /* Trap if exit returns for some reason. */
+END(__makecontext_ret)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c b/libc/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
index 7eb2712ec..407676b48 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
@@ -80,10 +80,10 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
sp -= 24;
*sp = 0;
- /* Pass (*func) to __start_context in %r7. */
+ /* Pass (*func) to __makecontext_ret in %r7. */
ucp->uc_mcontext.gregs[7] = (long int) func;
- /* Pass ucp->uc_link to __start_context in %r8. */
+ /* Pass ucp->uc_link to __makecontext_ret in %r8. */
ucp->uc_mcontext.gregs[8] = (long int) ucp->uc_link;
/* Pass address of setcontext in %r9. */
@@ -93,12 +93,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
ucp->uc_mcontext.gregs[15] = (long int) sp;
}
-asm (".text\n"
- ".type __makecontext_ret,@function\n"
- "__makecontext_ret:\n"
- " basr %r14,%r7\n"
- " lr %r2,%r8\n"
- " br %r9\n"
- ".size __makecontext_ret, .-__makecontext_ret");
-
weak_alias (__makecontext, makecontext)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/c++-types.data
new file mode 100644
index 000000000..6e2036ec0
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
index d56560112..ff0b82f51 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
@@ -1763,6 +1763,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data
new file mode 100644
index 000000000..8fb56b608
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/Makefile b/libc/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
index 1f6ad2106..679573474 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
@@ -12,3 +12,7 @@ sysdep_routines += framestate
shared-only-routines += framestate
endif
endif
+
+ifeq ($(subdir),stdlib)
+sysdep_routines += __makecontext_ret
+endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
new file mode 100644
index 000000000..cbd88e170
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
@@ -0,0 +1,29 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY(__makecontext_ret)
+ basr %r14,%r7
+ ltgr %r8,%r8 /* Check whether uc_link is 0. */
+ jz 1f
+ lgr %r2,%r8
+ br %r9
+1: lghi %r2,0
+ brasl %r14,HIDDEN_JUMPTARGET (exit)
+ j .+2 /* Trap if exit returns. */
+END(__makecontext_ret)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c b/libc/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
index dcc63a235..17e5dba3c 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
@@ -80,10 +80,10 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
sp -= 20;
*sp = 0;
- /* Pass (*func) to __start_context in %r7. */
+ /* Pass (*func) to __makecontext_ret in %r7. */
ucp->uc_mcontext.gregs[7] = (long int) func;
- /* Pass ucp->uc_link to __start_context in %r8. */
+ /* Pass ucp->uc_link to __makecontext_ret in %r8. */
ucp->uc_mcontext.gregs[8] = (long int) ucp->uc_link;
/* Pass address of setcontext in %r9. */
@@ -93,12 +93,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
ucp->uc_mcontext.gregs[15] = (long int) sp;
}
-asm (".text\n"
- ".type __makecontext_ret,@function\n"
- "__makecontext_ret:\n"
- " basr %r14,%r7\n"
- " lgr %r2,%r8\n"
- " br %r9\n"
- ".size __makecontext_ret, .-__makecontext_ret");
-
weak_alias (__makecontext, makecontext)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/c++-types.data
new file mode 100644
index 000000000..23c11dc41
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:l
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:m
+fd_mask:l
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:m
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:l
+int8_t:a
+intptr_t:l
+key_t:i
+loff_t:l
+mode_t:j
+nlink_t:m
+off64_t:l
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:l
+register_t:l
+rlim64_t:m
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:m
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:m
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
index f161a51e2..2fb078694 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
@@ -84,6 +84,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data
new file mode 100644
index 000000000..8fb56b608
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
index 4bc776880..e9181cb1b 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2000, 2006, 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
This file is part of the GNU C Library.
@@ -165,7 +165,8 @@ enum __ptrace_flags
};
/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions {
+enum __ptrace_setoptions
+{
PTRACE_O_TRACESYSGOOD = 0x00000001,
PTRACE_O_TRACEFORK = 0x00000002,
PTRACE_O_TRACEVFORK = 0x00000004,
@@ -173,17 +174,20 @@ enum __ptrace_setoptions {
PTRACE_O_TRACEEXEC = 0x00000010,
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_MASK = 0x0000007f
+ PTRACE_O_TRACESECCOMP = 0x00000080,
+ PTRACE_O_MASK = 0x000000ff
};
/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes {
+enum __ptrace_eventcodes
+{
PTRACE_EVENT_FORK = 1,
PTRACE_EVENT_VFORK = 2,
PTRACE_EVENT_CLONE = 3,
PTRACE_EVENT_EXEC = 4,
PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6
+ PTRACE_EVENT_EXIT = 6,
+ PTRACE_EVENT_SECCOMP = 7
};
/* Perform process tracing functions. REQUEST is one of the values
@@ -195,7 +199,7 @@ enum __ptrace_eventcodes {
appear (those that are used for the particular request) as:
pid_t PID, void *ADDR, int DATA, void *ADDR2
after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...);
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
__END_DECLS
diff --git a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
index a04bc9f63..73fca8bf5 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -128,6 +128,7 @@ ENTRY(__makecontext)
cfi_restore (pr)
/* If this returns (which can happen if the syscall fails) we'll exit
the program with the return error value (-1). */
+ mov r0, r4
2:
mov.l .Lexit, r1
@@ -135,7 +136,7 @@ ENTRY(__makecontext)
add r12, r1
#endif
jsr @r1
- mov r0, r4
+ nop
/* The 'exit' call should never return. In case it does cause the
process to terminate. */
ABORT_INSTRUCTION_ASM
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
index c474f415c..3fd150e7e 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -84,6 +84,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
index 4ce1bbfda..babd70c79 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
@@ -1,5 +1,5 @@
/* siginfo_t, sigevent and constants. Linux/SPARC version.
- Copyright (C) 1997-2002, 2003, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -104,6 +104,14 @@ typedef struct
int si_band; /* Band event for SIGPOLL. */
int si_fd;
} _sigpoll;
+
+ /* SIGSYS. */
+ struct
+ {
+ void *_call_addr; /* Calling user insn. */
+ int _syscall; /* Triggering system call number. */
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
+ } _sigsys;
} _sifields;
} siginfo_t;
@@ -123,6 +131,9 @@ typedef struct
# define si_trapno _sifields._sigfault.si_trapno
# define si_band _sifields._sigpoll.si_band
# define si_fd _sifields._sigpoll.si_fd
+# define si_call_addr _sifields._sigsys._call_addr
+# define si_syscall _sifields._sigsys._syscall
+# define si_arch _sifields._sigsys._arch
/* Values for `si_code'. Positive values are reserved for kernel-generated
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/c++-types.data
new file mode 100644
index 000000000..b3c19d9c6
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:i
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
index 1804348cf..7d5a3429f 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
@@ -1768,6 +1768,9 @@ GLIBC_2.16
sys_errlist D 0x220
sys_nerr D 0x4
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/localplt.data
new file mode 100644
index 000000000..15ba18b96
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/localplt.data
@@ -0,0 +1,17 @@
+libc.so: _Q_add ?
+libc.so: _Q_div ?
+libc.so: _Q_feq ?
+libc.so: _Q_fge ?
+libc.so: _Q_fle ?
+libc.so: _Q_flt ?
+libc.so: _Q_fne ?
+libc.so: _Q_itoq ?
+libc.so: _Q_mul ?
+libc.so: _Q_sub ?
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/c++-types.data
new file mode 100644
index 000000000..5a04f4939
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:l
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:m
+fd_mask:l
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:m
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:l
+int8_t:a
+intptr_t:l
+key_t:i
+loff_t:l
+mode_t:j
+nlink_t:j
+off64_t:l
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:l
+register_t:l
+rlim64_t:m
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:i
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:m
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:m
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
index 8571fa8da..6d6e57c11 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
@@ -89,6 +89,9 @@ GLIBC_2.16
sys_errlist D 0x440
sys_nerr D 0x4
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/localplt.data b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/localplt.data
new file mode 100644
index 000000000..6f1769c02
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/localplt.data
@@ -0,0 +1,19 @@
+libc.so: _Qp_add ?
+libc.so: _Qp_div ?
+libc.so: _Qp_feq ?
+libc.so: _Qp_fge ?
+libc.so: _Qp_fle ?
+libc.so: _Qp_flt ?
+libc.so: _Qp_fne ?
+libc.so: _Qp_itoq ?
+libc.so: _Qp_mul ?
+libc.so: _Qp_qtod ?
+libc.so: _Qp_sub ?
+libc.so: _Qp_xtoq ?
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index e33536292..4ec5becde 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -1,6 +1,5 @@
/* `ptrace' debugger support interface. Linux/SPARC version.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2007, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 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
@@ -210,7 +209,8 @@ enum __ptrace_flags
};
/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions {
+enum __ptrace_setoptions
+{
PTRACE_O_TRACESYSGOOD = 0x00000001,
PTRACE_O_TRACEFORK = 0x00000002,
PTRACE_O_TRACEVFORK = 0x00000004,
@@ -218,17 +218,20 @@ enum __ptrace_setoptions {
PTRACE_O_TRACEEXEC = 0x00000010,
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_MASK = 0x0000007f
+ PTRACE_O_TRACESECCOMP = 0x00000080,
+ PTRACE_O_MASK = 0x000000ff
};
/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes {
+enum __ptrace_eventcodes
+{
PTRACE_EVENT_FORK = 1,
PTRACE_EVENT_VFORK = 2,
PTRACE_EVENT_CLONE = 3,
PTRACE_EVENT_EXEC = 4,
PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6
+ PTRACE_EVENT_EXIT = 6,
+ PTRACE_EVENT_SECCOMP = 7
};
/* Perform process tracing functions. REQUEST is one of the values
diff --git a/libc/sysdeps/unix/sysv/linux/sys/epoll.h b/libc/sysdeps/unix/sysv/linux/sys/epoll.h
index a55ebad62..6c2f10aab 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/epoll.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/epoll.h
@@ -61,6 +61,8 @@ enum EPOLL_EVENTS
#define EPOLLHUP EPOLLHUP
EPOLLRDHUP = 0x2000,
#define EPOLLRDHUP EPOLLRDHUP
+ EPOLLWAKEUP = 1u << 29,
+#define EPOLLWAKEUP EPOLLWAKEUP
EPOLLONESHOT = 1u << 30,
#define EPOLLONESHOT EPOLLONESHOT
EPOLLET = 1u << 31
diff --git a/libc/sysdeps/unix/sysv/linux/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
index eadb4d0e5..7a7998a6c 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 1996-1999,2000,2006,2007,2011 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 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
@@ -165,7 +165,8 @@ enum __ptrace_setoptions
PTRACE_O_TRACEEXEC = 0x00000010,
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_MASK = 0x0000007f
+ PTRACE_O_TRACESECCOMP = 0x00000080,
+ PTRACE_O_MASK = 0x000000ff
};
/* Wait extended result codes for the above trace options. */
@@ -176,7 +177,8 @@ enum __ptrace_eventcodes
PTRACE_EVENT_CLONE = 3,
PTRACE_EVENT_EXEC = 4,
PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6
+ PTRACE_EVENT_EXIT = 6,
+ PTRAVE_EVENT_SECCOMP = 7
};
/* Perform process tracing functions. REQUEST is one of the values
diff --git a/libc/sysdeps/unix/sysv/linux/x86/bits/siginfo.h b/libc/sysdeps/unix/sysv/linux/x86/bits/siginfo.h
index 2e05e6528..b0f4a6520 100644
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/siginfo.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/bits/siginfo.h
@@ -115,6 +115,14 @@ typedef struct
long int si_band; /* Band event for SIGPOLL. */
int si_fd;
} _sigpoll;
+
+ /* SIGSYS. */
+ struct
+ {
+ void *_call_addr; /* Calling user insn. */
+ int _syscall; /* Triggering system call number. */
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
+ } _sigsys;
} _sifields;
} siginfo_t __SI_ALIGNMENT;
@@ -133,6 +141,9 @@ typedef struct
# define si_addr _sifields._sigfault.si_addr
# define si_band _sifields._sigpoll.si_band
# define si_fd _sifields._sigpoll.si_fd
+# define si_call_addr _sifields._sigsys._call_addr
+# define si_syscall _sifields._sigsys._syscall
+# define si_arch _sifields._sigsys._arch
/* Values for `si_code'. Positive values are reserved for kernel-generated
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/c++-types.data
new file mode 100644
index 000000000..23c11dc41
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:l
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:m
+fd_mask:l
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:m
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:l
+int8_t:a
+intptr_t:l
+key_t:i
+loff_t:l
+mode_t:j
+nlink_t:m
+off64_t:l
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:l
+register_t:l
+rlim64_t:m
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:m
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:m
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
index 2a1b8e9f9..d6ab153e1 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
@@ -80,6 +80,9 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
GLIBC_2.2.5
GLIBC_2.2.5 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/__start_context.S b/libc/sysdeps/unix/sysv/linux/x86_64/__start_context.S
index 77d322e04..9f2ee2373 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/__start_context.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/__start_context.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -39,8 +39,9 @@ ENTRY(__start_context)
call JUMPTARGET(__setcontext)
/* If this returns (which can happen if the syscall fails) we'll
exit the program with the return error value (-1). */
+ movq %rax,%rdi
-2: movq %rax,%rdi
+2:
call HIDDEN_JUMPTARGET(exit)
/* The 'exit' call should never return. In case it does cause
the process to terminate. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
index 6bcb542e7..53f9fbd78 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 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
@@ -84,7 +84,6 @@ ENTRY (BP_SYM (__clone))
jl SYSCALL_ERROR_LABEL
jz L(thread_start)
-L(pseudo_end):
ret
L(thread_start):
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index 11f5df9ec..5f2b64c6e 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002, 2005, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -81,7 +81,6 @@ ENTRY(__getcontext)
/* All done, return 0 for success. */
xorl %eax, %eax
-L(pseudo_end):
ret
PSEUDO_END(__getcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
index 896deb065..3b319d7c7 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
@@ -70,6 +70,5 @@ ENTRY (sched_getcpu)
jae SYSCALL_ERROR_LABEL
movl %edx, %eax
-L(pseudo_end):
ret
PSEUDO_END(sched_getcpu)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S
index 19032f079..adcb243cb 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -96,8 +96,6 @@ ENTRY(__setcontext)
/* Clear rax to indicate success. */
xorl %eax, %eax
-
-L(pseudo_end):
ret
PSEUDO_END(__setcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S b/libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
index ebab2b9de..0d04a01fa 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -114,8 +114,6 @@ ENTRY(__swapcontext)
/* Clear rax to indicate success. */
xorl %eax, %eax
-
-L(pseudo_end):
ret
PSEUDO_END(__swapcontext)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/syscall.S b/libc/sysdeps/unix/sysv/linux/x86_64/syscall.S
index 03eea9894..87dfd8c28 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/syscall.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 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
@@ -37,7 +37,6 @@ ENTRY (syscall)
syscall /* Do the system call. */
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
-L(pseudo_end):
ret /* Return to caller. */
PSEUDO_END (syscall)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 1c3cbd6de..5323104ba 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005, 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 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
@@ -79,8 +79,7 @@
ENTRY (name) \
DO_CALL (syscall_name, args); \
cmpq $-4095, %rax; \
- jae SYSCALL_ERROR_LABEL; \
- L(pseudo_end):
+ jae SYSCALL_ERROR_LABEL
# undef PSEUDO_END
# define PSEUDO_END(name) \
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/vfork.S b/libc/sysdeps/unix/sysv/linux/x86_64/vfork.S
index 2e85f9067..c28087d07 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 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
@@ -52,7 +52,6 @@ ENTRY (__vfork)
jae SYSCALL_ERROR_LABEL /* Branch forward if it failed. */
/* Normal return. */
-.Lpseudo_end:
ret
PSEUDO_END (__vfork)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/c++-types.data b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/c++-types.data
new file mode 100644
index 000000000..348bf52b2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:x
+blksize_t:x
+caddr_t:Pc
+clockid_t:i
+clock_t:x
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:y
+fsfilcnt64_t:y
+fsfilcnt_t:y
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:y
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:y
+off64_t:x
+off_t:x
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:x
+rlim64_t:y
+rlim_t:y
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:x
+time_t:x
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
index 13b1d91cf..65bcead8b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
@@ -2078,3 +2078,6 @@ GLIBC_2.16
xencrypt F
xprt_register F
xprt_unregister F
+GLIBC_2.17
+ GLIBC_2.17 A
+ secure_getenv F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
index 789552ebb..58a7178d7 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
@@ -44,7 +44,6 @@ ENTRY (sched_getcpu)
jae SYSCALL_ERROR_LABEL
mov %edx, %eax
-L(pseudo_end):
ret
PSEUDO_END(sched_getcpu)
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c
deleted file mode 100644
index f24f361bb..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/tmpfile.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c
deleted file mode 100644
index 55feef2a6..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/tmpfile64.c>
diff --git a/libc/sysdeps/wordsize-64/tmpfile.c b/libc/sysdeps/wordsize-64/tmpfile.c
deleted file mode 100644
index 449a222d9..000000000
--- a/libc/sysdeps/wordsize-64/tmpfile.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../stdio-common/tmpfile.c"
-
-weak_alias (__new_tmpfile, tmpfile64)
diff --git a/libc/sysdeps/wordsize-64/tmpfile64.c b/libc/sysdeps/wordsize-64/tmpfile64.c
deleted file mode 100644
index 5c124c249..000000000
--- a/libc/sysdeps/wordsize-64/tmpfile64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in tmpfile.c. */
diff --git a/libc/sysdeps/x86_64/_mcount.S b/libc/sysdeps/x86_64/_mcount.S
index 6904731ba..c919865b4 100644
--- a/libc/sysdeps/x86_64/_mcount.S
+++ b/libc/sysdeps/x86_64/_mcount.S
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. x86-64 version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
Contributed by Andreas Jaeger <aj@suse.de>.
This file is part of the GNU C Library.
@@ -24,7 +24,7 @@
#include <sysdep.h>
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
+ .globl C_SYMBOL_NAME(_mcount)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function)
.align ALIGNARG(4)
C_LABEL(_mcount)
@@ -65,7 +65,7 @@ C_LABEL(_mcount)
#undef mcount
weak_alias (_mcount, mcount)
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(__fentry__)
+ .globl C_SYMBOL_NAME(__fentry__)
ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(__fentry__), @function)
.align ALIGNARG(4)
C_LABEL(__fentry__)
diff --git a/libc/sysdeps/x86_64/configure b/libc/sysdeps/x86_64/configure
index d73710756..b87c0b14b 100644
--- a/libc/sysdeps/x86_64/configure
+++ b/libc/sysdeps/x86_64/configure
@@ -174,7 +174,7 @@ else
/* comment on
two lines */
${libc_cv_dot_text}
- ${libc_cv_asm_global_directive} foo
+ .globl foo
foo:
/* Unfortunately this test only works for a real instruction,
not for any of the machine-independent pseudo-ops.
@@ -329,43 +329,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
$as_echo "$libc_cv_cc_novzeroupper" >&6; }
-# Check for support of thread-local storage handling in assembler and linker.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86-64 TLS support" >&5
-$as_echo_n "checking for x86-64 TLS support... " >&6; }
-if ${libc_cv_x86_64_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.s <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .quad 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 8
- .text
-baz: leaq bar@TLSLD(%rip), %rdi
- leaq bar@DTPOFF(%rax), %rcx
- addq foo@GOTTPOFF(%rip), %rax
- movq $bar@TPOFF, %rdx
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_x86_64_tls=yes
-else
- libc_cv_x86_64_tls=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_64_tls" >&5
-$as_echo "$libc_cv_x86_64_tls" >&6; }
-if test $libc_cv_x86_64_tls = no; then
- as_fn_error $? "the assembler must support TLS" "$LINENO" 5
-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 --git a/libc/sysdeps/x86_64/configure.in b/libc/sysdeps/x86_64/configure.in
index e3bf103fd..a95dc8d8c 100644
--- a/libc/sysdeps/x86_64/configure.in
+++ b/libc/sysdeps/x86_64/configure.in
@@ -13,7 +13,7 @@ cat > conftest.S <<EOF
/* comment on
two lines */
${libc_cv_dot_text}
- ${libc_cv_asm_global_directive} foo
+ .globl foo
foo:
/* Unfortunately this test only works for a real instruction,
not for any of the machine-independent pseudo-ops.
@@ -79,32 +79,6 @@ LIBC_TRY_CC_OPTION([-mno-vzeroupper],
[libc_cv_cc_novzeroupper=no])
])
-# Check for support of thread-local storage handling in assembler and linker.
-AC_CACHE_CHECK(for x86-64 TLS support, libc_cv_x86_64_tls, [dnl
-cat > conftest.s <<\EOF
- .section ".tdata", "awT", @progbits
- .globl foo
-foo: .quad 1
- .section ".tbss", "awT", @nobits
- .globl bar
-bar: .skip 8
- .text
-baz: leaq bar@TLSLD(%rip), %rdi
- leaq bar@DTPOFF(%rax), %rcx
- addq foo@GOTTPOFF(%rip), %rax
- movq $bar@TPOFF, %rdx
-EOF
-dnl
-if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_x86_64_tls=yes
-else
- libc_cv_x86_64_tls=no
-fi
-rm -f conftest*])
-if test $libc_cv_x86_64_tls = no; then
- AC_MSG_ERROR([the assembler must support TLS])
-fi
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/libc/sysdeps/x86_64/fpu/e_expl.S b/libc/sysdeps/x86_64/fpu/e_expl.S
index e6b842bf2..1c37c86f7 100644
--- a/libc/sysdeps/x86_64/fpu/e_expl.S
+++ b/libc/sysdeps/x86_64/fpu/e_expl.S
@@ -60,10 +60,12 @@ c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(c1)
#endif
+#ifndef USE_AS_EXPM1L
ASM_TYPE_DIRECTIVE(csat,@object)
csat: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(csat)
+#endif
#ifdef PIC
# define MO(op) op##(%rip)
@@ -85,9 +87,26 @@ ENTRY(IEEE754_EXPL)
For the i686 the code can be written better.
-- drepper@cygnus.com. */
fxam /* Is NaN or +-Inf? */
-#ifndef USE_AS_EXPM1L
+#ifdef USE_AS_EXPM1L
+ xorb $0x80, %ah
+ cmpl $0xc006, %eax
+ fstsw %ax
+ movb $0x45, %dh
+ jb 4f
+
+ /* Below -64.0 (may be -NaN or -Inf). */
+ andb %ah, %dh
+ cmpb $0x01, %dh
+ je 2f /* Is +-NaN, jump. */
+ jmp 1f /* -large, possibly -Inf. */
+
+4: /* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf). */
+ /* Test for +-0 as argument. */
+ andb %ah, %dh
+ cmpb $0x40, %dh
+ je 2f
+#else
movzwl 8+8(%rsp), %eax
-#endif
andl $0x7fff, %eax
cmpl $0x400d, %eax
jle 3f
@@ -105,16 +124,8 @@ ENTRY(IEEE754_EXPL)
andb $2, %ah
jz 3f
fchs
-3:
-#ifdef USE_AS_EXPM1L
- /* Test for +-0 as argument. */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x40, %dh
- je 2f
#endif
- FLDLOG /* 1 log2(base) */
+3: FLDLOG /* 1 log2(base) */
fmul %st(1), %st /* 1 x log2(base) */
frndint /* 1 i */
fld %st(1) /* 2 x */
@@ -151,13 +162,16 @@ ENTRY(IEEE754_EXPL)
#endif
fstp %st(1) /* 0 */
jmp 2f
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
+1:
#ifdef USE_AS_EXPM1L
+ /* For expm1l, only negative sign gets here. */
+ fstp %st
fld1
fchs
#else
+ testl $0x200, %eax /* Test sign. */
+ jz 2f /* If positive, jump. */
+ fstp %st
fldz /* Set result to 0. */
#endif
2: ret
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 3374b5fbd..dba153b61 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -729,6 +729,47 @@ ildouble: 1
ldouble: 1
# clog
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
float: 3
ifloat: 3
@@ -740,12 +781,24 @@ ldouble: 1
Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
+float: 1
+ifloat: 1
Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
ildouble: 1
ldouble: 1
Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
double: 1
idouble: 1
@@ -754,9 +807,28 @@ ldouble: 1
Test "Real part of: clog (0x1p-147 + 0x1p-147 i) == -101.5460619520319878296245057936228672231 + pi/4 i":
float: 1
ifloat: 1
+Test "Real part of: clog (0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-149 + 0x1p-149 i) == -102.9323563131518784484589700365392203592 + pi/4 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -769,6 +841,61 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-0x1.fp+16383 + 0x1p-16445 i) == 4932.061660674182269085496060792589701158 + 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (-0x1.fp+16383 - 0x1p-16445 i) == 4932.061660674182269085496060792589701158 - 1.364376353841841347485783625431355770210 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1p-16445 + 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (-0x1p-16445 - 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
float: 5
@@ -826,6 +953,22 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
ildouble: 1
ldouble: 1
@@ -849,20 +992,40 @@ ldouble: 1
Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p-16445 i) == 4932.061660674182269085496060792589701158 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 - 0x1p-16445 i) == 4932.061660674182269085496060792589701158 - 0 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Real part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
double: 1
idouble: 1
Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
ildouble: 1
ldouble: 1
@@ -871,12 +1034,58 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1p-16445 + 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 + 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1p-16445 - 0x1.fp+16383 i) == 4932.061660674182269085496060792589701158 - 0.6821881769209206737428918127156778851051 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-8190 + 1.0 i) == 2.920285685286322365786846845062520925172e-4932 + 6.821881769209206737428918127156778851051e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -1222,12 +1431,40 @@ float: 1
ifloat: 1
# csqrt
+Test "Real part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000001p-1022 - 0x1.0000000000001p-1022 i) == 6.788430486774966350907249113759995429568e-155 - 1.638872094839911521020410942677082920935e-154 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
+Test "Real part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000001p-1022 + 0x1.0000000000001p-1022 i) == 1.638872094839911521020410942677082920935e-154 + 6.788430486774966350907249113759995429568e-155 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: csqrt (0x1.fffffep+127 + 1.0 i) == 1.844674352395372953599975585936590505260e+19 + 2.710505511993121390769065968615872097053e-20 i":
float: 1
ifloat: 1
@@ -1304,6 +1541,93 @@ Test "Real part of: ctan (1 + 47 i) == 2.729321264492904590777293425576722354636
ildouble: 2
ldouble: 2
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+# ctan_tonearest
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 4
+ldouble: 4
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
@@ -1359,6 +1683,93 @@ Test "Imaginary part of: ctanh (47 + 1 i) == 1.0 + 2.729321264492904590777293425
ildouble: 2
ldouble: 2
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Real part of: ctanh_tonearest (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 2
+ldouble: 2
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1455,6 +1866,9 @@ float: 1
ifloat: 1
# expm1
+Test "expm1 (-45.0) == -0.9999999999999999999713748141945060635553":
+ildouble: 1
+ldouble: 1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
double: 1
idouble: 1
@@ -2644,6 +3058,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "csqrt":
double: 1
@@ -2669,6 +3085,58 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -2685,6 +3153,58 @@ ifloat: 2
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/sysdeps/x86_64/ldsodefs.h b/libc/sysdeps/x86_64/ldsodefs.h
new file mode 100644
index 000000000..bf06837b2
--- /dev/null
+++ b/libc/sysdeps/x86_64/ldsodefs.h
@@ -0,0 +1,55 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _X86_64_LDSODEFS_H
+#define _X86_64_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_x86_64_regs;
+struct La_x86_64_retval;
+struct La_x32_regs;
+struct La_x32_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf64_Addr (*x86_64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, struct La_x86_64_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf32_Addr (*x32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_x32_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*x86_64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ const struct La_x86_64_regs *, \
+ struct La_x86_64_retval *, \
+ const char *); \
+ unsigned int (*x32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, \
+ const struct La_x32_regs *, \
+ struct La_x86_64_retval *, \
+ const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/libc/sysdeps/x86_64/sysdep.h b/libc/sysdeps/x86_64/sysdep.h
index af6949975..258781d09 100644
--- a/libc/sysdeps/x86_64/sysdep.h
+++ b/libc/sysdeps/x86_64/sysdep.h
@@ -34,7 +34,7 @@
/* Define an entry point visible from C. */
#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
+ .globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
C_LABEL(name) \
diff --git a/libc/sysdeps/x86_64/tls-macros.h b/libc/sysdeps/x86_64/tls-macros.h
new file mode 100644
index 000000000..22d2a4b59
--- /dev/null
+++ b/libc/sysdeps/x86_64/tls-macros.h
@@ -0,0 +1,39 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ asm ("mov %%fs:0,%0\n\t" \
+ "lea " #x "@tpoff(%0), %0" \
+ : "=r" (__l)); \
+ __l; })
+
+#define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("mov %%fs:0,%0\n\t" \
+ "add " #x "@gottpoff(%%rip),%0" \
+ : "=r" (__l)); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l, __c, __d; \
+ asm ("leaq " #x "@tlsld(%%rip),%%rdi\n\t" \
+ "call __tls_get_addr@plt\n\t" \
+ "leaq " #x "@dtpoff(%%rax), %%rax" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d) \
+ : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
+ __l; })
+
+#ifdef __ILP32__
+# define TLS_GD_PREFIX
+#else
+# define TLS_GD_PREFIX ".byte 0x66\n\t"
+#endif
+
+#define TLS_GD(x) \
+ ({ int *__l, __c, __d; \
+ asm (TLS_GD_PREFIX \
+ "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \
+ ".word 0x6666\n\t" \
+ "rex64\n\t" \
+ "call __tls_get_addr@plt" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d) \
+ : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
+ __l; })
diff --git a/libc/sysdeps/x86_64/tst-audit.h b/libc/sysdeps/x86_64/tst-audit.h
new file mode 100644
index 000000000..00cd36985
--- /dev/null
+++ b/libc/sysdeps/x86_64/tst-audit.h
@@ -0,0 +1,32 @@
+/* Definitions for testing PLT entry/exit auditing. x86_64 version.
+
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __ILP32__
+# define pltenter la_x86_64_gnu_pltenter
+# define pltexit la_x86_64_gnu_pltexit
+# define La_regs La_x86_64_regs
+# define La_retval La_x86_64_retval
+#else
+# define pltenter la_x32_gnu_pltenter
+# define pltexit la_x32_gnu_pltexit
+# define La_regs La_x32_regs
+# define La_retval La_x32_retval
+#endif
+#define int_retval lrv_rax