summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-06-25 21:30:45 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-06-25 21:30:45 +0000
commit5043a6ad2450235873e1a14c1b0a10ba779304d1 (patch)
treef9be4e84a0936ee1c62f8ce8be8ff1799fdbc806
parente86ff722e7f38c0ad5dce27190e18f5e8741b626 (diff)
downloadeglibc2-5043a6ad2450235873e1a14c1b0a10ba779304d1.tar.gz
Merge changes between r19234 and r19292 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@19293 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog92
-rw-r--r--libc/Makeconfig2
-rw-r--r--libc/NEWS25
-rw-r--r--libc/config.make.in1
-rwxr-xr-xlibc/configure3
-rw-r--r--libc/configure.in6
-rw-r--r--libc/elf/dl-close.c15
-rw-r--r--libc/elf/dl-deps.c7
-rw-r--r--libc/elf/dl-libc.c9
-rw-r--r--libc/elf/rtld.c2
-rw-r--r--libc/include/link.h8
-rw-r--r--libc/nptl/ChangeLog5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S10
-rw-r--r--libc/sysdeps/gnu/configure8
-rw-r--r--libc/sysdeps/gnu/configure.in8
-rw-r--r--libc/sysdeps/i386/init-first.c2
-rw-r--r--libc/sysdeps/mach/hurd/i386/static-start.S4
-rw-r--r--libc/sysdeps/mach/start.c103
-rw-r--r--libc/sysdeps/s390/fpu/libm-test-ulps358
-rw-r--r--libc/sysdeps/sh/____longjmp_chk.S23
-rw-r--r--libc/sysdeps/sh/abort-instr.h3
-rw-r--r--libc/sysdeps/sh/init-first.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/Versions3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S122
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h187
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/makecontext.S83
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym13
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/sysdep.h11
31 files changed, 829 insertions, 293 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 6f3676f78..9508ade96 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,93 @@
+2012-06-25 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/s390/fpu/libm-test-ulps: Update.
+
+2012-06-23 Andreas Schwab <schwab@linux-m68k.org>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/sh/syscalls.list: Add fanotify_mark.
+ * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.16): Add fanotify_mark.
+ * sysdeps/unix/sysv/linux/sh/nptl/libc.abilist (GLIBC_2.16): Add
+ fanotify_mark.
+
+2012-06-23 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/mach/start.c: Remove file.
+ * sysdeps/mach/hurd/i386/static-start.S: Fix start.S include.
+ * sysdeps/i386/init-first.c: Fix comment regarding start.S.
+ * sysdeps/sh/init-first.c: Likewise.
+
+ * sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Preserve r12 and pr
+ registers for frame unwinding purposes, add CFI directives.
+ * sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
+ * sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Likewise
+ * sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Likewise.
+
+ * sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Don't plan for the call to
+ __fortify_fail returning.
+ * sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
+
+ * sysdeps/unix/sysv/linux/sh/____longjmp_chk.S: New file, based on
+ sysdeps/sh/____longjmp_chk.S.
+ * sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym: New file, based
+ on sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym.
+ * sysdeps/unix/sysv/linux/sh/Makefile [subdir=misc]
+ (gen-as-const-headers): Append sigaltstack-offsets.sym.
+
+ * sysdeps/sh/abort-instr.h: New file.
+ * sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Terminate the
+ process in case exit returns.
+
+ * sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Always
+ initialize the GOT register before use.
+
+ * sysdeps/unix/sysv/linux/sh/makecontext.S (__makecontext): Fix
+ calculation of ARGC > 4.
+
+ * sysdeps/unix/sysv/linux/sh/makecontext.S: Add comments and give more
+ meaningful names to some local labels.
+
+2012-06-22 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sysdeps/unix/sysv/linux/sh/bits/atomic.h
+ (__arch_compare_and_exchange_val_8_acq): Remove explicit nop.
+ (__arch_compare_and_exchange_val_16_acq): Likewise.
+ (__arch_compare_and_exchange_val_32_acq): Likewise.
+ (atomic_exchange_and_add): Fix gUSA sequence.
+ (atomic_add): Likewise.
+ (atomic_add_negative): Likewise.
+ (atomic_add_zero): Likewise.
+ (atomic_bit_test_set): Likewise.
+
+2012-06-22 Andreas Schwab <schwab@redhat.com>
+
+ [BZ #13579]
+ * include/link.h (struct link_map): Add l_free_initfini.
+ * elf/dl-deps.c (_dl_map_object_deps): Set it when assigning
+ l_initfini.
+ * elf/dl-close.c (_dl_close_worker): Don't free l_initfini.
+ * elf/rtld.c (dl_main): Clear it on all objects loaded on startup.
+ * elf/dl-libc.c (free_mem): Free l_initfini if l_free_initfini is
+ set.
+
+2012-06-22 Carlos O'Donell <carlos_odonell@mentor.com>
+
+ * configure.in: Use AC_LANG_SOURCE.
+ * configure: Regenerate.
+
+2012-06-22 Roland McGrath <roland@hack.frob.com>
+
+ * configure.in (libc_cv_localstatedir): New substituted variable.
+ * configure: Regenerated.
+ * config.make.in (localstatedir): New variable, substituted from
+ libc_cv_localstatedir.
+ * Makeconfig (vardbdir): Use $(localstatedir) in place of /var.
+ * sysdeps/gnu/configure.in (libc_cv_localstatedir): Change
+ ${prefix}/var to /var when we change ${prefix}/etc to /etc.
+ * sysdeps/gnu/configure: Regenerated.
+
2012-06-21 Jeff Law <law@redhat.com>
[BZ #14277]
@@ -23,7 +113,7 @@
[BZ #13882]
* elf/dl-deps.c (_dl_map_object_deps): Fix cycle detection. Use
uint16_t for elements in the "seen" array to avoid char overflows.
- * elf/dl-fini.c (_dl_sort_fini): Likewise.
+ * elf/dl-fini.c (_dl_sort_fini): Likewise.
* elf/dl-open.c (dl_open_worker): Likewise.
2012-06-21 Carlos O'Donell <carlos_odonell@mentor.com>
diff --git a/libc/Makeconfig b/libc/Makeconfig
index ef0421c95..cdb94a5d6 100644
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -287,7 +287,7 @@ inst_sysconfdir = $(install_root)$(sysconfdir)
# Directory for the database files and Makefile for nss_db.
ifndef vardbdir
-vardbdir = /var/db
+vardbdir = $(localstatedir)/db
endif
inst_vardbdir = $(install_root)$(vardbdir)
diff --git a/libc/NEWS b/libc/NEWS
index 1ce8ee350..a9500faeb 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -19,18 +19,19 @@ Version 2.16
12193, 12194, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058,
13223, 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532,
13533, 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566,
- 13576, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673,
- 13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739, 13743,
- 13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824,
- 13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871, 13872,
- 13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892, 13895, 13908,
- 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918, 13919,
- 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938, 13941,
- 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973, 13979,
- 13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040, 14043,
- 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075, 14080,
- 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134, 14153,
- 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277, 14278
+ 13576, 13579, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658,
+ 13673, 13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739,
+ 13743, 13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806,
+ 13824, 13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871,
+ 13872, 13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892, 13895,
+ 13908, 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918,
+ 13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938,
+ 13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973,
+ 13979, 13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040,
+ 14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075,
+ 14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134,
+ 14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277,
+ 14278
* Support for the x32 ABI on x86-64 added. The x32 target is selected by
configuring glibc with:
diff --git a/libc/config.make.in b/libc/config.make.in
index 0a0c54ae1..32bced0ee 100644
--- a/libc/config.make.in
+++ b/libc/config.make.in
@@ -18,6 +18,7 @@ rootsbindir = @libc_cv_rootsbindir@
infodir = @infodir@
includedir = @includedir@
datarootdir = @datarootdir@
+localstatedir = @libc_cv_localstatedir@
# Should we use and build ldconfig?
use-ldconfig = @use_ldconfig@
diff --git a/libc/configure b/libc/configure
index c57e4faea..255697464 100755
--- a/libc/configure
+++ b/libc/configure
@@ -592,6 +592,7 @@ libc_cv_cc_sse4
libc_cv_cpp_asm_debuginfo
libc_cv_forced_unwind
libc_cv_rootsbindir
+libc_cv_localstatedir
libc_cv_sysconfdir
libc_cv_localedir
libc_cv_slibdir
@@ -7543,6 +7544,7 @@ fi
use_ldconfig=no
ldd_rewrite_script=no
libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
libc_cv_gcc_unwind_find_fde=no
libc_cv_idn=no
@@ -7608,6 +7610,7 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fPIC is default" >&5
$as_echo_n "checking whether -fPIC is default... " >&6; }
if ${libc_cv_pic_default+:} false; then :
diff --git a/libc/configure.in b/libc/configure.in
index b855f48e9..c55f3b269 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -283,12 +283,12 @@ if test "x$systemtap" != xno; then
AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
old_CFLAGS="$CFLAGS"
CFLAGS="-std=gnu99 $CFLAGS"
- AC_COMPILE_IFELSE([#include <sys/sdt.h>
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/sdt.h>
void foo (int i, void *p)
{
asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
:: STAP_PROBE_ASM_OPERANDS (2, i, p));
-}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+}]])], [libc_cv_sdt=yes], [libc_cv_sdt=no])
CFLAGS="$old_CFLAGS"])
if test $libc_cv_sdt = yes; then
AC_DEFINE([USE_STAP_PROBE])
@@ -2152,6 +2152,7 @@ AC_SUBST(libc_extra_cflags)
use_ldconfig=no
ldd_rewrite_script=no
libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
libc_cv_gcc_unwind_find_fde=no
libc_cv_idn=no
@@ -2192,6 +2193,7 @@ AC_SUBST(old_glibc_headers)
AC_SUBST(libc_cv_slibdir)
AC_SUBST(libc_cv_localedir)
AC_SUBST(libc_cv_sysconfdir)
+AC_SUBST(libc_cv_localstatedir)
AC_SUBST(libc_cv_rootsbindir)
AC_SUBST(libc_cv_forced_unwind)
diff --git a/libc/elf/dl-close.c b/libc/elf/dl-close.c
index 81a5d39a4..410fb48d4 100644
--- a/libc/elf/dl-close.c
+++ b/libc/elf/dl-close.c
@@ -1,5 +1,5 @@
/* Close a shared object opened by `_dl_open'.
- Copyright (C) 1996-2007, 2009, 2010, 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
@@ -118,17 +118,8 @@ _dl_close_worker (struct link_map *map)
if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
|| dl_close_state != not_pending)
{
- if (map->l_direct_opencount == 0)
- {
- if (map->l_type == lt_loaded)
- dl_close_state = rerun;
- else if (map->l_type == lt_library)
- {
- struct link_map **oldp = map->l_initfini;
- map->l_initfini = map->l_orig_initfini;
- _dl_scope_free (oldp);
- }
- }
+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
+ dl_close_state = rerun;
/* There are still references to this object. Do nothing more. */
if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index d7560e8e5..2f50e80b9 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -1,6 +1,5 @@
/* Load the dependencies of a mapped object.
- Copyright (C) 1996-2003, 2004-2007, 2010-2012
- 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
@@ -488,6 +487,7 @@ _dl_map_object_deps (struct link_map *map,
nneeded * sizeof needed[0]);
atomic_write_barrier ();
l->l_initfini = l_initfini;
+ l->l_free_initfini = 1;
}
/* If we have no auxiliary objects just go on to the next map. */
@@ -688,6 +688,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
l_initfini[nlist] = NULL;
atomic_write_barrier ();
map->l_initfini = l_initfini;
+ map->l_free_initfini = 1;
if (l_reldeps != NULL)
{
atomic_write_barrier ();
@@ -696,7 +697,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
_dl_scope_free (old_l_reldeps);
}
if (old_l_initfini != NULL)
- map->l_orig_initfini = old_l_initfini;
+ _dl_scope_free (old_l_initfini);
if (errno_reason)
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
diff --git a/libc/elf/dl-libc.c b/libc/elf/dl-libc.c
index a58e2164f..af2e66373 100644
--- a/libc/elf/dl-libc.c
+++ b/libc/elf/dl-libc.c
@@ -1,6 +1,5 @@
/* Handle loading and unloading shared objects for internal libc purposes.
- Copyright (C) 1999-2002,2004-2006,2009,2010,2011
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
@@ -269,13 +268,13 @@ libc_freeres_fn (free_mem)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
{
- /* Remove all additional names added to the objects. */
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
{
struct libname_list *lnp = l->l_libname->next;
l->l_libname->next = NULL;
+ /* Remove all additional names added to the objects. */
while (lnp != NULL)
{
struct libname_list *old = lnp;
@@ -283,6 +282,10 @@ libc_freeres_fn (free_mem)
if (! old->dont_free)
free (old);
}
+
+ /* Free the initfini dependency list. */
+ if (l->l_free_initfini)
+ free (l->l_initfini);
}
if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index bfa487d24..123aa48e4 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -2293,6 +2293,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
lnp->dont_free = 1;
lnp = lnp->next;
}
+ /* Also allocated with the fake malloc(). */
+ l->l_free_initfini = 0;
if (l != &GL(dl_rtld_map))
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
diff --git a/libc/include/link.h b/libc/include/link.h
index 2eb317947..f0c8ad521 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -1,6 +1,6 @@
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
- Copyright (C) 1995-2006, 2007, 2009, 2010, 2011 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
@@ -191,6 +191,9 @@ struct link_map
during LD_TRACE_PRELINKING=1
contains any DT_SYMBOLIC
libraries. */
+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
+ freed, ie. not allocated with
+ the dummy malloc in ld.so. */
/* Collected information about own RPATH directories. */
struct r_search_path_struct l_rpath_dirs;
@@ -239,9 +242,6 @@ struct link_map
/* List of object in order of the init and fini calls. */
struct link_map **l_initfini;
- /* The init and fini list generated at startup, saved when the
- object is also loaded dynamically. */
- struct link_map **l_orig_initfini;
/* List of the dependencies introduced through symbol binding. */
struct link_map_reldeps
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index f53c2f282..b5d0d7103 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-23 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
+ (__lll_robust_timedlock_wait): Simplify CFI directives.
+
2012-06-20 Siddhesh Poyarekar <siddhesh@redhat.com>
[BZ #12416]
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
index 7a192a9cc..d2624dd99 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
@@ -139,6 +139,8 @@ __lll_robust_timedlock_wait:
cmp/hs r0, r1
bt 3f
+ cfi_remember_state
+
mov.l r11, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r11, 0)
@@ -258,13 +260,9 @@ __lll_robust_timedlock_wait:
8:
bra 6b
mov #ETIMEDOUT, r0
+
+ cfi_restore_state
3:
- /* Restore initial state for invalid timeout case. */
- cfi_restore (r8)
- cfi_restore (r9)
- cfi_restore (r10)
- cfi_restore (r11)
- cfi_def_cfa_offset (0)
rts
mov #EINVAL, r0
cfi_endproc
diff --git a/libc/sysdeps/gnu/configure b/libc/sysdeps/gnu/configure
index 634e1d0cc..26327ca3b 100644
--- a/libc/sysdeps/gnu/configure
+++ b/libc/sysdeps/gnu/configure
@@ -25,12 +25,18 @@ case "$prefix" in
libc_cv_slibdir=/lib
;;
esac
- # Allow the user to override the path with --sysconfdir
+ # Allow the user to override the path with --sysconfdir.
if test "$sysconfdir" = '${prefix}/etc'; then
libc_cv_sysconfdir=/etc
else
libc_cv_sysconfdir=$sysconfdir
fi
+ # Allow the user to override the path with --localstatedir.
+ if test "$localstatedir" = '${prefix}/var'; then
+ libc_cv_localstatedir=/var
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
libc_cv_rootsbindir=/sbin
;;
esac
diff --git a/libc/sysdeps/gnu/configure.in b/libc/sysdeps/gnu/configure.in
index 3422007ff..b8fd74cff 100644
--- a/libc/sysdeps/gnu/configure.in
+++ b/libc/sysdeps/gnu/configure.in
@@ -25,12 +25,18 @@ case "$prefix" in
libc_cv_slibdir=/lib
;;
esac
- # Allow the user to override the path with --sysconfdir
+ # Allow the user to override the path with --sysconfdir.
if test "$sysconfdir" = '${prefix}/etc'; then
libc_cv_sysconfdir=/etc
else
libc_cv_sysconfdir=$sysconfdir
fi
+ # Allow the user to override the path with --localstatedir.
+ if test "$localstatedir" = '${prefix}/var'; then
+ libc_cv_localstatedir=/var
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
libc_cv_rootsbindir=/sbin
;;
esac
diff --git a/libc/sysdeps/i386/init-first.c b/libc/sysdeps/i386/init-first.c
index c2eaccd01..edea7f269 100644
--- a/libc/sysdeps/i386/init-first.c
+++ b/libc/sysdeps/i386/init-first.c
@@ -48,7 +48,7 @@ init (int *data)
#ifdef SHARED
/* This function is called to initialize the shared C library.
- It is called just before the user _start code from i386/elf/start.S,
+ It is called just before the user _start code from i386/start.S,
with the stack set up as that code gets it. */
/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT
diff --git a/libc/sysdeps/mach/hurd/i386/static-start.S b/libc/sysdeps/mach/hurd/i386/static-start.S
index e30d226b2..9c9c7b0fb 100644
--- a/libc/sysdeps/mach/hurd/i386/static-start.S
+++ b/libc/sysdeps/mach/hurd/i386/static-start.S
@@ -1,5 +1,5 @@
/* Startup code for statically linked Hurd/i386 binaries.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998-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,4 +24,4 @@ _start:
jmp _start1
#define _start _start1
-#include <sysdeps/i386/elf/start.S>
+#include <sysdeps/i386/start.S>
diff --git a/libc/sysdeps/mach/start.c b/libc/sysdeps/mach/start.c
deleted file mode 100644
index 59e1ab6ba..000000000
--- a/libc/sysdeps/mach/start.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright (C) 1992, 1993, 1994, 1995, 1997 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.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- 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 <stddef.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sysdep.h>
-
-#ifndef __GNUC__
- #error This file uses GNU C extensions; you must compile with GCC.
-#endif
-
-/* The first piece of initialized data. */
-int __data_start = 0;
-
-#ifndef _HURD_THREADVAR_H
-volatile int errno;
-#endif
-
-extern void __mach_init (void);
-extern void __libc_init (int argc, char **argv, char **envp);
-extern int main (int argc, char **argv, char **envp);
-
-/* These are uninitialized common definitions so they will be zero
- by default. If the user links in C threads, that will provide initialized
- definitions that override these. */
-void *(*_cthread_init_routine) (void); /* Returns new SP to use. */
-void (*_cthread_exit_routine) (int status);
-
-
-/* These are for communication from _start to start1,
- where we cannot use the stack for anything. */
-static int start_argc;
-static char **start_argv;
-
-/* _start calls this on the new stack. */
-static volatile void
-start1 (void)
-{
- __libc_init (start_argc, start_argv, __environ);
-
- (_cthread_exit_routine != NULL ? *_cthread_exit_routine : exit)
- (main (start_argc, start_argv, __environ));
-
- /* Should never get here. */
- LOSE;
-}
-
-#ifndef START_ARGS
-#define START_ARGS void
-#endif
-#ifdef START_MACHDEP
-START_MACHDEP
-#define _start _start0
-#endif
-
-void
-_start (START_ARGS)
-{
- SNARF_ARGS (start_argc, start_argv, __environ);
-
- __mach_init ();
-
- if (_cthread_init_routine != NULL)
- CALL_WITH_SP (start1, (*_cthread_init_routine) ());
- else
- start1 ();
-
- /* Should never get here. */
- LOSE;
-}
diff --git a/libc/sysdeps/s390/fpu/libm-test-ulps b/libc/sysdeps/s390/fpu/libm-test-ulps
index 5667d1b57..ee804a7c6 100644
--- a/libc/sysdeps/s390/fpu/libm-test-ulps
+++ b/libc/sysdeps/s390/fpu/libm-test-ulps
@@ -1,9 +1,18 @@
# Begin of automatic generation
# acos_downward
+Test "acos_downward (-0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_downward (-0.5) == M_PI_6l*4.0":
double: 1
idouble: 1
+Test "acos_downward (-1) == pi":
+float: 1
+ifloat: 1
+Test "acos_downward (0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_downward (0.5) == M_PI_6l*2.0":
double: 1
float: 1
@@ -13,9 +22,18 @@ ildouble: 1
ldouble: 1
# acos_towardzero
+Test "acos_towardzero (-0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_towardzero (-0.5) == M_PI_6l*4.0":
double: 1
idouble: 1
+Test "acos_towardzero (-1) == pi":
+float: 1
+ifloat: 1
+Test "acos_towardzero (0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_towardzero (0.5) == M_PI_6l*2.0":
double: 1
float: 1
@@ -24,6 +42,17 @@ ifloat: 1
ildouble: 1
ldouble: 1
+# acos_upward
+Test "acos_upward (-0) == pi/2":
+ildouble: 1
+ldouble: 1
+Test "acos_upward (-1) == pi":
+ildouble: 1
+ldouble: 1
+Test "acos_upward (0) == pi/2":
+ildouble: 1
+ldouble: 1
+
# asin_downward
Test "asin_downward (-0.5) == -pi/6":
double: 1
@@ -551,6 +580,38 @@ double: 1
idouble: 1
# ccos
+Test "Imaginary part of: ccos (-0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
ildouble: 1
ldouble: 1
@@ -567,8 +628,52 @@ ifloat: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0x1p-16434 + 22730 i) == inf - 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
# ccosh
+Test "Imaginary part of: ccosh (-11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
@@ -579,6 +684,32 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
@@ -587,6 +718,44 @@ ifloat: 1
Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccosh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# cexp
Test "Imaginary part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
@@ -656,6 +825,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 709.8942846690411016323109979483151967689 + 0.4636476090008061606231772164674799632783 i":
+double: 1
+idouble: 1
Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
ildouble: 1
ldouble: 1
@@ -745,6 +917,9 @@ ifloat: 1
Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
double: 1
idouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 308.3031705664207720674749211936626341569 + 0.2013595981366865903254995612594728746470 i":
+double: 1
+idouble: 1
Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
ildouble: 1
ldouble: 1
@@ -981,9 +1156,9 @@ ildouble: 2
ldouble: 2
Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
double: 1
-float: 4
+float: 5
idouble: 1
-ifloat: 4
+ifloat: 5
ildouble: 2
ldouble: 2
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
@@ -998,26 +1173,166 @@ ildouble: 1
ldouble: 1
# csin
+Test "Real part of: csin (-0.75 + 11357.25 i) == -8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 11357.25 i) == -8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
ildouble: 1
ldouble: 1
Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
ildouble: 1
ldouble: 1
+Test "Real part of: csin (0.75 + 11357.25 i) == 8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 11357.25 i) == 8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0x1p-16434 + 22730 i) == 1.217853148905605987081057582351152052687e4924 + inf i":
+ildouble: 1
+ldouble: 1
# csinh
+Test "Imaginary part of: csinh (-11357.25 + 0.75 i) == -9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-11357.25 - 0.75 i) == -9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
double: 1
idouble: 1
+Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
+Test "Imaginary part of: csinh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# csqrt
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
@@ -1223,6 +1538,14 @@ idouble: 1
Test "exp10 (-1) == 0.1":
double: 2
idouble: 2
+Test "exp10 (-305) == 1.0e-305":
+double: 1
+idouble: 1
+Test "exp10 (-36) == 1.0e-36":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
double: 1
idouble: 1
@@ -1231,6 +1554,12 @@ double: 6
idouble: 6
ildouble: 1
ldouble: 1
+Test "exp10 (36) == 1.0e36":
+double: 1
+idouble: 1
+Test "exp10 (4932) == 1.0e4932":
+ildouble: 1
+ldouble: 1
# exp2
Test "exp2 (100.5) == 1.792728671193156477399422023278661496394e+30":
@@ -1279,6 +1608,9 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "expm1 (500.0) == 1.4035922178528374107397703328409120821806e+217":
+double: 1
+idouble: 1
# gamma
Test "gamma (-0.5) == log(2*sqrt(pi))":
@@ -2094,6 +2426,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: "acos_upward":
+ildouble: 1
+ldouble: 1
+
Function: "asin_downward":
double: 1
float: 1
@@ -2217,7 +2553,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2231,7 +2569,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2260,6 +2600,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: Imaginary part of "clog":
+double: 1
+idouble: 1
+
Function: Real part of "clog10":
double: 1
float: 1
@@ -2328,9 +2672,9 @@ ldouble: 1
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 11
ldouble: 11
@@ -2343,6 +2687,10 @@ ildouble: 1
ldouble: 1
Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -2361,6 +2709,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "csqrt":
double: 1
diff --git a/libc/sysdeps/sh/____longjmp_chk.S b/libc/sysdeps/sh/____longjmp_chk.S
index 5d17f3ae7..b37a94861 100644
--- a/libc/sysdeps/sh/____longjmp_chk.S
+++ b/libc/sysdeps/sh/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009-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
@@ -28,14 +28,20 @@ longjmp_msg:
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ mov.l r12, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r12, 0); \
mova .Lgot, r0; \
mov.l .Lgot, r12; \
add r0, r12; \
+ sts.l pr, @-r15; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
bsrf r1; \
add r12, r4; \
+ /* Unreachable. */ \
.Lfail0: \
- bra 0f; \
- nop; \
.align 2; \
.Lgot: \
.long _GLOBAL_OFFSET_TABLE_; \
@@ -43,21 +49,24 @@ longjmp_msg:
.long longjmp_msg@GOTOFF; \
.Lfail: \
.long __GI___fortify_fail@PLT-(.Lfail0-.); \
-0:
+ cfi_restore_state;
#else
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ sts.l pr, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
jsr @r1; \
nop; \
- bra 0f; \
- nop; \
+ /* Unreachable. */ \
.align 2; \
.Lstr: \
.long longjmp_msg; \
.Lfail: \
.long __fortify_fail; \
-0:
+ cfi_restore_state;
#endif
#define CHECK_SP(reg) \
diff --git a/libc/sysdeps/sh/abort-instr.h b/libc/sysdeps/sh/abort-instr.h
new file mode 100644
index 000000000..69381aec8
--- /dev/null
+++ b/libc/sysdeps/sh/abort-instr.h
@@ -0,0 +1,3 @@
+/* An instruction which should crash any program is `sleep'. */
+#define ABORT_INSTRUCTION_ASM sleep
+#define ABORT_INSTRUCTION asm ("sleep")
diff --git a/libc/sysdeps/sh/init-first.c b/libc/sysdeps/sh/init-first.c
index c2e45e428..f298724c1 100644
--- a/libc/sysdeps/sh/init-first.c
+++ b/libc/sysdeps/sh/init-first.c
@@ -48,7 +48,7 @@ init (int *data)
#ifdef SHARED
/* This function is called to initialize the shared C library.
- It is called just before the user _start code from sh/sh[34]/elf/start.S,
+ It is called just before the user _start code from sh/sh[34]/start.S,
with the stack set up as that code gets it. */
/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT
diff --git a/libc/sysdeps/unix/sysv/linux/sh/Makefile b/libc/sysdeps/unix/sysv/linux/sh/Makefile
index 1ead8f2ae..dd3b382ac 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/sh/Makefile
@@ -6,6 +6,10 @@ ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
+ifeq ($(subdir),misc)
+gen-as-const-headers += sigaltstack-offsets.sym
+endif
+
ifeq ($(subdir),math)
# The libm.so link can't find __fpscr_values
libm.so-no-z-defs = yes
diff --git a/libc/sysdeps/unix/sysv/linux/sh/Versions b/libc/sysdeps/unix/sysv/linux/sh/Versions
index 9fb83456f..ca1d7da33 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/Versions
+++ b/libc/sysdeps/unix/sysv/linux/sh/Versions
@@ -28,4 +28,7 @@ libc {
GLIBC_2.11 {
fallocate64;
}
+ GLIBC_2.16 {
+ fanotify_mark;
+ }
}
diff --git a/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
new file mode 100644
index 000000000..d74caa21b
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
@@ -0,0 +1,122 @@
+/* Copyright (C) 2009-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 <sigaltstack-offsets.h>
+
+ .section .rodata.str1.1,"aMS",@progbits,1
+ .type longjmp_msg,@object
+longjmp_msg:
+ .string "longjmp causes uninitialized stack frame"
+ .size longjmp_msg, .-longjmp_msg
+ .text
+
+#define __longjmp ____longjmp_chk
+
+#ifdef PIC
+# define CALL_FAIL \
+ mov.l .Lfail, r1; \
+ mov.l .Lstr, r4; \
+ mov.l r12, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r12, 0); \
+ mova .Lgot, r0; \
+ mov.l .Lgot, r12; \
+ add r0, r12; \
+ sts.l pr, @-r15; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
+ bsrf r1; \
+ add r12, r4; \
+.Lfail0: \
+ /* Unreachable. */ \
+ .align 2; \
+.Lgot: \
+ .long _GLOBAL_OFFSET_TABLE_; \
+.Lstr: \
+ .long longjmp_msg@GOTOFF; \
+.Lfail: \
+ .long __GI___fortify_fail@PLT-(.Lfail0-.); \
+ cfi_restore_state;
+#else
+# define CALL_FAIL \
+ mov.l .Lfail, r1; \
+ mov.l .Lstr, r4; \
+ sts.l pr, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
+ jsr @r1; \
+ nop; \
+ /* Unreachable. */ \
+ .align 2; \
+.Lstr: \
+ .long longjmp_msg; \
+.Lfail: \
+ .long __fortify_fail; \
+ cfi_restore_state;
+#endif
+
+#define CHECK_SP(reg) \
+ /* Jumping to a higher-address frame is always allowed. */ \
+ cmp/hs r15, reg; \
+ bt .Lok; \
+ \
+ mov.l r0, @-r15; /* The return value is already in here. */ \
+ cfi_adjust_cfa_offset (4); \
+ mov.l r1, @-r15; /* PTR_DEMANGLE helper. */ \
+ cfi_adjust_cfa_offset (4); \
+ mov.l r2, @-r15; /* The new SP value is already in here. */ \
+ cfi_adjust_cfa_offset (4); \
+ mov.l r4, @-r15; /* We'll still need this one. */ \
+ cfi_adjust_cfa_offset (4); \
+ add #-sizeSS, r15; \
+ cfi_adjust_cfa_offset (sizeSS); \
+ mov #0, r4; \
+ mov r15, r5; \
+ DO_CALL (sigaltstack, 2); \
+ /* Without working sigaltstack we cannot perform the test. */ \
+ tst r0, r0; \
+ bf .Lok2; \
+ mov.l @(oSS_FLAGS, r15), r0; \
+ tst #SS_ONSTACK, r0; \
+ bt .Lcall_fail; \
+ mov.l @(oSS_SIZE, r15), r2; \
+ mov.l @(oSS_SP, r15), r1; \
+ add r2, r1; \
+ sub r8, r1; \
+ cmp/hi r1, r2; \
+ bf .Lok2; \
+.Lcall_fail: \
+ CALL_FAIL \
+ \
+.Lok2: \
+ add #sizeSS, r15; \
+ cfi_adjust_cfa_offset (-sizeSS); \
+ mov.l @r15+, r4; \
+ cfi_adjust_cfa_offset (-4); \
+ mov.l @r15+, r2; \
+ cfi_adjust_cfa_offset (-4); \
+ mov.l @r15+, r1; \
+ cfi_adjust_cfa_offset (-4); \
+ mov.l @r15+, r0; \
+ cfi_adjust_cfa_offset (-4); \
+.Lok:
+
+#include <__longjmp.S>
diff --git a/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h b/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h
index c8f07e55a..05e492202 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h
@@ -1,5 +1,5 @@
/* Atomic operations used inside libc. Linux/SH version.
- Copyright (C) 2003, 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
@@ -73,11 +73,10 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
({ __typeof (*(mem)) __result; \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-8,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%1,%0\n\
cmp/eq %0,%3\n\
bf 1f\n\
@@ -90,10 +89,10 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
({ __typeof (*(mem)) __result; \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
mov r15,r1\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
mov #-8,r15\n\
0: mov.w @%1,%0\n\
cmp/eq %0,%3\n\
@@ -107,11 +106,10 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ __typeof (*(mem)) __result; \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-8,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%1,%0\n\
cmp/eq %0,%3\n\
bf 1f\n\
@@ -133,40 +131,43 @@ typedef uintmax_t uatomic_max_t;
({ __typeof (*(mem)) __result, __tmp, __value = (value); \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%2,%0\n\
- add %0,%1\n\
- mov.b %1,@%2\n\
+ mov %1,r2\n\
+ add %0,r2\n\
+ mov.b r2,@%2\n\
1: mov r1,r15"\
: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
- : "r0", "r1", "memory"); \
+ : "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%2,%0\n\
- add %0,%1\n\
- mov.w %1,@%2\n\
+ mov %1,r2\n\
+ add %0,r2\n\
+ mov.w r2,@%2\n\
1: mov r1,r15"\
: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
- : "r0", "r1", "memory"); \
+ : "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%2,%0\n\
- add %0,%1\n\
- mov.l %1,@%2\n\
+ mov %1,r2\n\
+ add %0,r2\n\
+ mov.l r2,@%2\n\
1: mov r1,r15"\
: "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
- : "r0", "r1", "memory"); \
+ : "r0", "r1", "r2", "memory"); \
else \
{ \
__typeof (mem) memp = (mem); \
@@ -182,37 +183,37 @@ typedef uintmax_t uatomic_max_t;
(void) ({ __typeof (*(mem)) __tmp, __value = (value); \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%1,r2\n\
- add r2,%0\n\
- mov.b %0,@%1\n\
+ add %0,r2\n\
+ mov.b r2,@%1\n\
1: mov r1,r15"\
: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
: "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%1,r2\n\
- add r2,%0\n\
- mov.w %0,@%1\n\
+ add %0,r2\n\
+ mov.w r2,@%1\n\
1: mov r1,r15"\
: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
: "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%1,r2\n\
- add r2,%0\n\
- mov.l %0,@%1\n\
+ add %0,r2\n\
+ mov.l r2,@%1\n\
1: mov r1,r15"\
: "=&r" (__tmp) : rNOSP (mem), "0" (__value) \
: "r0", "r1", "r2", "memory"); \
@@ -233,43 +234,43 @@ typedef uintmax_t uatomic_max_t;
__typeof (*(mem)) __tmp, __value = (value); \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%2,r2\n\
- add r2,%1\n\
- mov.b %1,@%2\n\
+ add %1,r2\n\
+ mov.b r2,@%2\n\
1: mov r1,r15\n\
- shal %1\n\
+ shal r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%2,r2\n\
- add r2,%1\n\
- mov.w %1,@%2\n\
+ add %1,r2\n\
+ mov.w r2,@%2\n\
1: mov r1,r15\n\
- shal %1\n\
+ shal r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%2,r2\n\
- add r2,%1\n\
- mov.l %1,@%2\n\
+ add %1,r2\n\
+ mov.l r2,@%2\n\
1: mov r1,r15\n\
- shal %1\n\
+ shal r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
@@ -282,43 +283,43 @@ typedef uintmax_t uatomic_max_t;
__typeof (*(mem)) __tmp, __value = (value); \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%2,r2\n\
- add r2,%1\n\
- mov.b %1,@%2\n\
+ add %1,r2\n\
+ mov.b r2,@%2\n\
1: mov r1,r15\n\
- tst %1,%1\n\
+ tst r2,r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%2,r2\n\
- add r2,%1\n\
- mov.w %1,@%2\n\
+ add %1,r2\n\
+ mov.w r2,@%2\n\
1: mov r1,r15\n\
- tst %1,%1\n\
+ tst r2,r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%2,r2\n\
- add r2,%1\n\
- mov.l %1,@%2\n\
+ add %1,r2\n\
+ mov.l r2,@%2\n\
1: mov r1,r15\n\
- tst %1,%1\n\
+ tst r2,r2\n\
movt %0"\
: "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \
: "r0", "r1", "r2", "t", "memory"); \
@@ -333,10 +334,10 @@ typedef uintmax_t uatomic_max_t;
(void) ({ unsigned int __mask = 1 << (bit); \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%0,r2\n\
or %1,r2\n\
mov.b r2,@%0\n\
@@ -345,10 +346,10 @@ typedef uintmax_t uatomic_max_t;
: "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%0,r2\n\
or %1,r2\n\
mov.w r2,@%0\n\
@@ -357,10 +358,10 @@ typedef uintmax_t uatomic_max_t;
: "r0", "r1", "r2", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
mov r15,r1\n\
- mov #-6,r15\n\
+ .align 2\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%0,r2\n\
or %1,r2\n\
mov.l r2,@%0\n\
@@ -376,49 +377,49 @@ typedef uintmax_t uatomic_max_t;
unsigned int __result = __mask; \
if (sizeof (*(mem)) == 1) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-8,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.b @%2,r2\n\
- or r2,%1\n\
- and r2,%0\n\
- mov.b %1,@%2\n\
- 1: mov r1,r15"\
+ mov r2,r3\n\
+ or %1,r2\n\
+ mov.b r2,@%2\n\
+ 1: mov r1,r15\n\
+ and r3,%0"\
: "=&r" (__result), "=&r" (__mask) \
: rNOSP (mem), "0" (__result), "1" (__mask) \
- : "r0", "r1", "r2", "memory"); \
+ : "r0", "r1", "r2", "r3", "memory"); \
else if (sizeof (*(mem)) == 2) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-8,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.w @%2,r2\n\
- or r2,%1\n\
- and r2,%0\n\
+ mov r2,r3\n\
+ or %1,r2\n\
mov.w %1,@%2\n\
- 1: mov r1,r15"\
+ 1: mov r1,r15\n\
+ and r3,%0"\
: "=&r" (__result), "=&r" (__mask) \
: rNOSP (mem), "0" (__result), "1" (__mask) \
- : "r0", "r1", "r2", "memory"); \
+ : "r0", "r1", "r2", "r3", "memory"); \
else if (sizeof (*(mem)) == 4) \
__asm __volatile ("\
- .align 2\n\
mova 1f,r0\n\
- nop\n\
+ .align 2\n\
mov r15,r1\n\
- mov #-8,r15\n\
+ mov #(0f-1f),r15\n\
0: mov.l @%2,r2\n\
+ mov r2,r3\n\
or r2,%1\n\
- and r2,%0\n\
mov.l %1,@%2\n\
- 1: mov r1,r15"\
+ 1: mov r1,r15\n\
+ and r3,%0"\
: "=&r" (__result), "=&r" (__mask) \
: rNOSP (mem), "0" (__result), "1" (__mask) \
- : "r0", "r1", "r2", "memory"); \
+ : "r0", "r1", "r2", "r3", "memory"); \
else \
abort (); \
__result; })
diff --git a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
index 0a9e07954..a04bc9f63 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ 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
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <abort-instr.h>
#include "ucontext_i.h"
@@ -33,44 +34,44 @@
.align 5
ENTRY(__makecontext)
mov #4, r3
- mov.l @(oSS_SP,r4), r1
- mov.l @(oSS_SIZE,r4), r2
- add r1, r2
- cmp/gt r6, r3
+ mov.l @(oSS_SP,r4), r1 /* r1 <- ucb->stack_base */
+ mov.l @(oSS_SIZE,r4), r2 /* r2 <- ucb->stack_size */
+ add r1, r2 /* r2 <- stack_top */
+ cmp/gt r3, r6 /* argc > 4? */
bf/s 1f
- shlr2 r2
+ shlr2 r2 /* r2 <- stack_top / 4 */
sub r6, r2
add r3, r2
1:
- shll2 r2
+ shll2 r2 /* r2 <- stack_top - ((argc > 4) ? 4 * (argc - 4) : 0 */
mov #oR15, r0
mov.l @(oLINK,r4), r1
- mov.l r2, @(r0,r4)
- mov.l r1, @(oR8,r4)
+ mov.l r2, @(r0,r4) /* ucp->r15 <- r2 */
+ mov.l r1, @(oR8,r4) /* ucp->r8 <- ucp->uc_link */
mov #oPC, r0
- mov.l r5, @(r0,r4)
+ mov.l r5, @(r0,r4) /* ucp->PC <- func */
- cmp/pl r6
+ cmp/pl r6 /* argc > 0? */
bf/s .L1
dt r6
- mov.l r7, @(oR4,r4)
- cmp/pl r6
+ mov.l r7, @(oR4,r4) /* ucp->r4 <- argv[0] */
+ cmp/pl r6 /* argc > 1? */
bf/s .L1
dt r6
mov.l @(0,r15), r1
- mov.l r1, @(oR5,r4)
- cmp/pl r6
+ mov.l r1, @(oR5,r4) /* ucp->r5 <- argv[1] */
+ cmp/pl r6 /* argc > 2? */
bf/s .L1
dt r6
mov.l @(4,r15), r1
- mov.l r1, @(oR6,r4)
- cmp/pl r6
+ mov.l r1, @(oR6,r4) /* ucp->r6 <- argv[2] */
+ cmp/pl r6 /* argc > 3? */
bf/s .L1
dt r6
mov.l @(8,r15), r1
- mov.l r1, @(oR7,r4)
+ mov.l r1, @(oR7,r4) /* ucp->r7 <- argv[3] */
mov #12,r0
-.L0:
+.L0: /* Save remaining argv[] on the stack. */
cmp/pl r6
bf/s .L1
dt r6
@@ -87,7 +88,7 @@ ENTRY(__makecontext)
#endif
add #oPR, r4
rts
- mov.l r0, @r4
+ mov.l r0, @r4 /* ucp->pr <- exitcode */
#ifndef PIC
.align 2
.L2:
@@ -96,49 +97,63 @@ ENTRY(__makecontext)
cfi_endproc
.align 5
+ cfi_startproc
.Lexitcode:
- tst r8, r8
- bt/s 2f
- mov r8, r4
#ifdef PIC
+ mov.l r12, @-r15
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r12, 0)
mova .Lgot, r0
mov.l .Lgot, r12
add r0, r12
- mov.l .L3, r1
+#endif
+ tst r8, r8 /* ucb->uc_link == NULL? */
+ bt/s 2f
+ mov r8, r4 /* r4 <- ucb->uc_link */
+ mov.l .Lsetcontext, r1
+ sts.l pr, @-r15
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (pr, 0)
+#ifdef PIC
bsrf r1
.LPCS0:
nop
#else
- mov.l .L3, r1
jsr @r1
nop
#endif
+ /* Restore to keep CFI/CFA balanced. */
+ lds.l @r15+, pr
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (pr)
+ /* If this returns (which can happen if the syscall fails) we'll exit
+ the program with the return error value (-1). */
+
2:
- mov.l .L4, r1
+ mov.l .Lexit, r1
#ifdef PIC
add r12, r1
#endif
jsr @r1
mov r0, r4
-0:
- bra 0b
- nop
+ /* The 'exit' call should never return. In case it does cause the
+ process to terminate. */
+ ABORT_INSTRUCTION_ASM
.align 2
#ifdef PIC
.Lgot:
.long _GLOBAL_OFFSET_TABLE_
-.L3:
+.Lsetcontext:
.long __setcontext@PLT-(.LPCS0+2-(.))
-.L4:
+.Lexit:
.long HIDDEN_JUMPTARGET(exit)@GOTOFF
#else
-.L3:
+.Lsetcontext:
.long __setcontext
-.L4:
+.Lexit:
.long HIDDEN_JUMPTARGET(exit)
#endif
- cfi_startproc
PSEUDO_END(__makecontext)
weak_alias (__makecontext, makecontext)
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
index 7c1425f89..c474f415c 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -79,6 +79,7 @@ GLIBC_2.16
aligned_alloc F
c16rtomb F
c32rtomb F
+ fanotify_mark F
getauxval F
mbrtoc16 F
mbrtoc32 F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym b/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym
new file mode 100644
index 000000000..f73446941
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym
@@ -0,0 +1,13 @@
+#include <stddef.h>
+#include <signal.h>
+
+--
+
+#define sigaltstack(member) offsetof (stack_t, member)
+
+sizeSS sizeof (stack_t)
+oSS_SP sigaltstack (ss_sp)
+oSS_FLAGS sigaltstack (ss_flags)
+oSS_SIZE sigaltstack (ss_size)
+
+SS_ONSTACK
diff --git a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
index be9ffed22..faffe377e 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
@@ -3,3 +3,5 @@
waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
prlimit64 EXTRA prlimit64 i:iipp prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.16
diff --git a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
index 5215a845d..ce72c66a7 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
- 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.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -100,11 +99,15 @@
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
+ mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
mov.l 1f,r0; \
mov.l r1,@(r0,r12); \
+ mov r2,r12; \
+ cfi_restore (r12); \
bra .Lpseudo_end; \
mov _IMM1,r0; \
.align 2; \
@@ -121,6 +124,7 @@
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
@@ -128,6 +132,7 @@
stc gbr, r4; \
mov.l @(r0,r12),r0; \
mov r2,r12; \
+ cfi_restore (r12); \
add r4,r0; \
mov.l r1,@r0; \
bra .Lpseudo_end; \
@@ -140,12 +145,14 @@
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
mov.l 1f,r0; \
mov.l @(r0,r12),r0; \
mov r2,r12; \
+ cfi_restore (r12); \
mov.l r1,@r0; \
bra .Lpseudo_end; \
mov _IMM1,r0; \