summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-12-30 17:36:00 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-12-30 17:36:00 +0000
commit42bc5058cebfefa9329005e1b3bc0525f7f7b67b (patch)
treec56b80fae2dc79fa72b20eb88e2316d131cf1e82 /libc
parentf6620a07226c13e55ad71bc04a937539aa1b7dd4 (diff)
Merge changes between r9495 and r9569 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@9570 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc')
-rw-r--r--libc/ChangeLog42
-rwxr-xr-xlibc/configure49
-rw-r--r--libc/configure.in35
-rw-r--r--libc/hurd/hurdioctl.c24
-rw-r--r--libc/include/stdlib.h6
-rw-r--r--libc/nptl/ChangeLog6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c10
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c8
-rw-r--r--libc/stdlib/Makefile2
-rw-r--r--libc/stdlib/tst-makecontext3.c217
-rw-r--r--libc/stdlib/tst-setcontext.c2
-rw-r--r--libc/sysdeps/mach/hurd/getcwd.c4
-rw-r--r--libc/sysdeps/s390/s390-32/dl-machine.h5
-rw-r--r--libc/sysdeps/s390/s390-64/dl-machine.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/futimens.c5
15 files changed, 367 insertions, 50 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 35d0a57f4..9b1d78bca 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,45 @@
+2009-12-15 Maciej W. Rozycki <macro@codesourcery.com>
+
+ [BZ #11115]
+ * stdlib/tst-makecontext3.c: New file.
+ * stdlib/Makefile (tests): Add new test.
+
+ * stdlib/tst-setcontext.c (check_called): Fix a typo.
+
+2009-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure.in: Enable multi-arch by default if the assembler
+ supports gnu_indirect_function symbol type and the architecture
+ supports it.
+
+2009-12-23 Ulrich Drepper <drepper@redhat.com>
+
+ * include/stdlib.h: Exclude some includes and prototypes if _ISOMAC
+ is defined.
+
+2009-12-22 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/hurdioctl.c (_hurd_locked_install_cttyid): Set newctty to
+ MACH_PORT_NULL when id != cttyid.
+
+2009-12-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * sysdeps/mach/hurd/getcwd.c (cleanup): Do not call
+ __mach_port_deallocate on rootdevid.
+
+2009-12-17 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Handle
+ R_390_PC32DBL. Remove unneeded R_390_PLT16DBL.
+ * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Remove
+ unneeded R_390_PLT16DBL and R_390_PLT32DBL.
+
+2009-12-21 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #10992]
+ * sysdeps/unix/sysv/linux/futimens.c: Handle AT_FDCWD.
+ Patch by Eric Blake <ebb9@byu.net>.
+
2009-12-15 Ulrich Drepper <drepper@redhat.com>
[BZ #11093]
diff --git a/libc/configure b/libc/configure
index 469de2106..b620db88b 100755
--- a/libc/configure
+++ b/libc/configure
@@ -725,12 +725,12 @@ INSTALL_PROGRAM
sysdeps_add_ons
sysnames
submachine
+multi_arch
base_machine
add_on_subdirs
add_ons
libc_cv_nss_crypt
experimental_malloc
-multi_arch
REPORT_BUGS_TEXI
REPORT_BUGS_TO
PKGVERSION
@@ -3869,18 +3869,13 @@ _ACEOF
if test "${enable_multi_arch+set}" = set; then
enableval=$enable_multi_arch; multi_arch=$enableval
else
- multi_arch=no
+ multi_arch=default
fi
-if test x"$multi_arch" = xyes; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_MULTIARCH 1
-_ACEOF
-
+if test x"$multi_arch" != xno; then
multi_arch_d=/multiarch
fi
-
# Check whether --enable-experimental-malloc was given.
if test "${enable_experimental_malloc+set}" = set; then
enableval=$enable_experimental_malloc; experimental_malloc=$enableval
@@ -4427,6 +4422,44 @@ for b in $base ''; do
done
done
+# If the assembler supports gnu_indirect_function symbol type and the
+# architecture supports multi-arch, we enable multi-arch by default.
+if test "$multi_arch" = default; then
+{ $as_echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5
+$as_echo_n "checking for assembler gnu_indirect_function symbol type support... " >&6; }
+if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<EOF
+.type foo,%gnu_indirect_function
+EOF
+if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5;
+then
+ libc_cv_asm_gnu_indirect_function=yes
+else
+ libc_cv_asm_gnu_indirect_function=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5
+$as_echo "$libc_cv_asm_gnu_indirect_function" >&6; }
+ multi_arch=no
+ if test "$libc_cv_asm_gnu_indirect_function" = yes; then
+ case $sysnames_add_ons$sysnames in
+ *"$multi_arch_d"*)
+ multi_arch=yes
+ ;;
+ esac
+ fi
+fi
+if test x"$multi_arch" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_MULTIARCH 1
+_ACEOF
+
+fi
+
+
if test -z "$os_used" && test "$os" != none; then
{ { $as_echo "$as_me:$LINENO: error: Operating system $os is not supported." >&5
$as_echo "$as_me: error: Operating system $os is not supported." >&2;}
diff --git a/libc/configure.in b/libc/configure.in
index 216fad88b..82a974e62 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -277,12 +277,10 @@ AC_ARG_ENABLE([multi-arch],
AC_HELP_STRING([--enable-multi-arch],
[enable single DSO with optimizations for multiple architectures]),
[multi_arch=$enableval],
- [multi_arch=no])
-if test x"$multi_arch" = xyes; then
- AC_DEFINE(USE_MULTIARCH)
+ [multi_arch=default])
+if test x"$multi_arch" != xno; then
multi_arch_d=/multiarch
fi
-AC_SUBST(multi_arch)
AC_ARG_ENABLE([experimental-malloc],
AC_HELP_STRING([--enable-experimental-malloc],
@@ -727,6 +725,35 @@ for b in $base ''; do
done
done
+# If the assembler supports gnu_indirect_function symbol type and the
+# architecture supports multi-arch, we enable multi-arch by default.
+if test "$multi_arch" = default; then
+AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
+ libc_cv_asm_gnu_indirect_function, [dnl
+cat > conftest.s <<EOF
+.type foo,%gnu_indirect_function
+EOF
+if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
+then
+ libc_cv_asm_gnu_indirect_function=yes
+else
+ libc_cv_asm_gnu_indirect_function=no
+fi
+rm -f conftest*])
+ multi_arch=no
+ if test "$libc_cv_asm_gnu_indirect_function" = yes; then
+ case $sysnames_add_ons$sysnames in
+ *"$multi_arch_d"*)
+ multi_arch=yes
+ ;;
+ esac
+ fi
+fi
+if test x"$multi_arch" = xyes; then
+ AC_DEFINE(USE_MULTIARCH)
+fi
+AC_SUBST(multi_arch)
+
if test -z "$os_used" && test "$os" != none; then
AC_MSG_ERROR(Operating system $os is not supported.)
fi
diff --git a/libc/hurd/hurdioctl.c b/libc/hurd/hurdioctl.c
index 96d910ba1..7c689841c 100644
--- a/libc/hurd/hurdioctl.c
+++ b/libc/hurd/hurdioctl.c
@@ -1,5 +1,6 @@
/* ioctl commands which must be done in the C library.
- Copyright (C) 1994,95,96,97,99,2001,02 Free Software Foundation, Inc.
+ Copyright (C) 1994,95,96,97,99,2001,2002,2009
+ 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
@@ -169,33 +170,28 @@ _hurd_locked_install_cttyid (mach_port_t cttyid)
for (i = 0; i < _hurd_dtablesize; ++i)
{
struct hurd_fd *const d = _hurd_dtable[i];
- mach_port_t newctty;
+ mach_port_t newctty = MACH_PORT_NULL;
if (d == NULL)
/* Nothing to do for an unused descriptor cell. */
continue;
- if (cttyid == MACH_PORT_NULL)
- /* We now have no controlling tty at all. */
- newctty = MACH_PORT_NULL;
- else
+ if (cttyid != MACH_PORT_NULL)
+ /* We do have some controlling tty. */
HURD_PORT_USE (&d->port,
({ mach_port_t id;
/* Get the io object's cttyid port. */
if (! __term_getctty (port, &id))
{
- if (id == cttyid && /* Is it ours? */
+ if (id == cttyid /* Is it ours? */
/* Get the ctty io port. */
- __term_open_ctty (port,
- _hurd_pid, _hurd_pgrp,
- &newctty))
+ && __term_open_ctty (port,
+ _hurd_pid, _hurd_pgrp,
+ &newctty))
/* XXX it is our ctty but the call failed? */
newctty = MACH_PORT_NULL;
- __mach_port_deallocate
- (__mach_task_self (), (mach_port_t) id);
+ __mach_port_deallocate (__mach_task_self (), id);
}
- else
- newctty = MACH_PORT_NULL;
0;
}));
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index f540bece9..b4799d7d0 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -9,7 +9,9 @@
/* Now define the internal interfaces. */
#ifndef __Need_M_And_C
-# include <sys/stat.h>
+# ifndef _ISOMAC
+# include <sys/stat.h>
+# endif
__BEGIN_DECLS
@@ -78,8 +80,10 @@ extern int __clearenv (void);
extern char *__canonicalize_file_name (__const char *__name);
extern char *__realpath (__const char *__name, char *__resolved);
extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
+# ifndef _ISOMAC
extern int __ptsname_internal (int fd, char *buf, size_t buflen,
struct stat64 *stp);
+# endif
extern int __getpt (void);
extern int __posix_openpt (int __oflag);
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 8cea2f648..389bed4a6 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-18 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
+ call __gmon_start__.
+ * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
+
2009-12-17 Ulrich Drepper <drepper@redhat.com>
* pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c b/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c
index 40d4d50c3..eb09b4aaa 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for S/390.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it
@@ -67,8 +67,6 @@ _init:\n\
.LT1_0:\n\
.LC13:\n\
.long __pthread_initialize_minimal_internal-.LT1_0\n\
-.LC14:\n\
- .long __gmon_start__@GOT\n\
.LC15:\n\
.long _GLOBAL_OFFSET_TABLE_-.LT1_0\n\
.LTN1_0:\n\
@@ -80,12 +78,6 @@ _init:\n\
L 1,.LC13-.LT1_0(13)\n\
LA 1,0(1,13)\n\
BASR 14,1\n\
- L 1,.LC14-.LT1_0(13)\n\
- L 1,0(1,12)\n\
- LTR 1,1\n\
- JE .L22\n\
- BASR 14,1\n\
-.L22:\n\
#APP\n\
.align 4,0x07\n\
END_INIT\n\
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c b/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c
index a102d07d6..34951f6fb 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for 64 bit S/390.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it
@@ -68,12 +68,6 @@ _init:\n\
STG 1,0(15)\n\
LARL 12,_GLOBAL_OFFSET_TABLE_\n\
BRASL 14,__pthread_initialize_minimal_internal\n\
- LARL 1,__gmon_start__@GOTENT\n\
- LG 1,0(1)\n\
- LTGR 1,1\n\
- JE .L22\n\
- BASR 14,1\n\
-.L22:\n\
#APP\n\
.align 4,0x07\n\
END_INIT\n\
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index bf4df6411..8881c7dab 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -80,7 +80,7 @@ tests := tst-strtol tst-strtod testrand testsort testdiv \
test-a64l tst-qsort tst-system bug-strtod2 \
tst-atof1 tst-atof2 tst-strtod2 tst-rand48-2 \
tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6 \
- tst-unsetenv1
+ tst-unsetenv1 tst-makecontext3
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-strtod3 tst-strtod4 tst-strtod5 testmb2
tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
diff --git a/libc/stdlib/tst-makecontext3.c b/libc/stdlib/tst-makecontext3.c
new file mode 100644
index 000000000..f127c6a57
--- /dev/null
+++ b/libc/stdlib/tst-makecontext3.c
@@ -0,0 +1,217 @@
+/* Copyright (C) 2001,2002,2004,2006,2009 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, write to the Free
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ucontext.h>
+#include <unistd.h>
+
+static ucontext_t ctx[3];
+
+static int was_in_f1;
+static int was_in_f2;
+
+static char st2[32768];
+
+static volatile int flag;
+
+static void
+f1 (int a00, int a01, int a02, int a03, int a04, int a05, int a06, int a07,
+ int a08, int a09, int a10, int a11, int a12, int a13, int a14, int a15,
+ int a16, int a17, int a18, int a19, int a20, int a21, int a22, int a23,
+ int a24, int a25, int a26, int a27, int a28, int a29, int a30, int a31,
+ int a32)
+{
+ printf ("start f1(a00=%08x,a01=%08x,a02=%08x,a03=%08x,\n"
+ " a04=%08x,a05=%08x,a06=%08x,a07=%08x,\n"
+ " a08=%08x,a09=%08x,a10=%08x,a11=%08x,\n"
+ " a12=%08x,a13=%08x,a14=%08x,a15=%08x,\n"
+ " a16=%08x,a17=%08x,a18=%08x,a19=%08x,\n"
+ " a20=%08x,a21=%08x,a22=%08x,a23=%08x,\n"
+ " a24=%08x,a25=%08x,a26=%08x,a27=%08x,\n"
+ " a28=%08x,a29=%08x,a30=%08x,a31=%08x,\n"
+ " a32=%08x) [%d]\n",
+ a00, a01, a02, a03, a04, a05, a06, a07,
+ a08, a09, a10, a11, a12, a13, a14, a15,
+ a16, a17, a18, a19, a20, a21, a22, a23,
+ a24, a25, a26, a27, a28, a29, a30, a31,
+ a32, flag);
+
+ if (a00 != (0x00000001 << flag) || a01 != (0x00000004 << flag)
+ || a02 != (0x00000012 << flag) || a03 != (0x00000048 << flag)
+ || a04 != (0x00000123 << flag) || a05 != (0x0000048d << flag)
+ || a06 != (0x00001234 << flag) || a07 != (0x000048d1 << flag)
+ || a08 != (0x00012345 << flag) || a09 != (0x00048d15 << flag)
+ || a10 != (0x00123456 << flag) || a11 != (0x0048d159 << flag)
+ || a12 != (0x01234567 << flag) || a13 != (0x048d159e << flag)
+ || a14 != (0x12345678 << flag) || a15 != (0x48d159e2 << flag)
+ || a16 != (0x23456789 << flag) || a17 != (0x8d159e26 << flag)
+ || a18 != (0x3456789a << flag) || a19 != (0xd159e26a << flag)
+ || a20 != (0x456789ab << flag) || a21 != (0x159e26af << flag)
+ || a22 != (0x56789abc << flag) || a23 != (0x59e26af3 << flag)
+ || a24 != (0x6789abcd << flag) || a25 != (0x9e26af37 << flag)
+ || a26 != (0x789abcde << flag) || a27 != (0xe26af37b << flag)
+ || a28 != (0x89abcdef << flag) || a29 != (0x26af37bc << flag)
+ || a30 != (0x9abcdef0 << flag) || a31 != (0x6af37bc3 << flag)
+ || a32 != (0xabcdef0f << flag))
+ {
+ puts ("arg mismatch");
+ exit (-1);
+ }
+
+ if (flag && swapcontext (&ctx[1], &ctx[2]) != 0)
+ {
+ printf ("%s: swapcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+ printf ("finish f1 [%d]\n", flag);
+ flag++;
+ was_in_f1++;
+}
+
+static void
+f2 (void)
+{
+ puts ("start f2");
+ if (swapcontext (&ctx[2], &ctx[1]) != 0)
+ {
+ printf ("%s: swapcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+ puts ("finish f2");
+ was_in_f2 = 1;
+}
+
+volatile int global;
+
+
+static int back_in_main;
+
+
+static void
+check_called (void)
+{
+ if (back_in_main == 0)
+ {
+ puts ("program did not reach main again");
+ _exit (1);
+ }
+}
+
+
+int
+main (void)
+{
+ atexit (check_called);
+
+ char st1[32768];
+
+ puts ("making contexts");
+ if (getcontext (&ctx[0]) != 0)
+ {
+ if (errno == ENOSYS)
+ {
+ back_in_main = 1;
+ exit (0);
+ }
+
+ printf ("%s: getcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+
+ ctx[1] = ctx[0];
+ ctx[1].uc_stack.ss_sp = st1;
+ ctx[1].uc_stack.ss_size = sizeof st1;
+ ctx[1].uc_link = &ctx[0];
+ {
+ ucontext_t tempctx = ctx[1];
+ makecontext (&ctx[1], (void (*) (void)) f1, 33,
+ 0x00000001 << flag, 0x00000004 << flag,
+ 0x00000012 << flag, 0x00000048 << flag,
+ 0x00000123 << flag, 0x0000048d << flag,
+ 0x00001234 << flag, 0x000048d1 << flag,
+ 0x00012345 << flag, 0x00048d15 << flag,
+ 0x00123456 << flag, 0x0048d159 << flag,
+ 0x01234567 << flag, 0x048d159e << flag,
+ 0x12345678 << flag, 0x48d159e2 << flag,
+ 0x23456789 << flag, 0x8d159e26 << flag,
+ 0x3456789a << flag, 0xd159e26a << flag,
+ 0x456789ab << flag, 0x159e26af << flag,
+ 0x56789abc << flag, 0x59e26af3 << flag,
+ 0x6789abcd << flag, 0x9e26af37 << flag,
+ 0x789abcde << flag, 0xe26af37b << flag,
+ 0x89abcdef << flag, 0x26af37bc << flag,
+ 0x9abcdef0 << flag, 0x6af37bc3 << flag,
+ 0xabcdef0f << flag);
+
+ /* Without this check, a stub makecontext can make us spin forever. */
+ if (memcmp (&tempctx, &ctx[1], sizeof ctx[1]) == 0)
+ {
+ puts ("makecontext was a no-op, presuming not implemented");
+ return 0;
+ }
+ }
+
+ /* Play some tricks with this context. */
+ if (++global == 1)
+ if (setcontext (&ctx[1]) != 0)
+ {
+ printf ("%s: setcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+ if (global != 2)
+ {
+ printf ("%s: 'global' not incremented twice\n", __FUNCTION__);
+ exit (1);
+ }
+
+ if (getcontext (&ctx[2]) != 0)
+ {
+ printf ("%s: second getcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+ ctx[2].uc_stack.ss_sp = st2;
+ ctx[2].uc_stack.ss_size = sizeof st2;
+ ctx[2].uc_link = &ctx[1];
+ makecontext (&ctx[2], f2, 0);
+
+ puts ("swapping contexts");
+ if (swapcontext (&ctx[0], &ctx[2]) != 0)
+ {
+ printf ("%s: swapcontext: %m\n", __FUNCTION__);
+ exit (1);
+ }
+ puts ("back at main program");
+ back_in_main = 1;
+
+ if (was_in_f1 < 2)
+ {
+ puts ("didn't reach f1 twice");
+ exit (1);
+ }
+ if (was_in_f2 == 0)
+ {
+ puts ("didn't reach f2");
+ exit (1);
+ }
+
+ puts ("test succeeded");
+ return 0;
+}
diff --git a/libc/stdlib/tst-setcontext.c b/libc/stdlib/tst-setcontext.c
index 51296f74a..9a6d79ba9 100644
--- a/libc/stdlib/tst-setcontext.c
+++ b/libc/stdlib/tst-setcontext.c
@@ -133,7 +133,7 @@ check_called (void)
{
if (back_in_main == 0)
{
- puts ("program did no reach main again");
+ puts ("program did not reach main again");
_exit (1);
}
}
diff --git a/libc/sysdeps/mach/hurd/getcwd.c b/libc/sysdeps/mach/hurd/getcwd.c
index 7e07e6b40..7da677eec 100644
--- a/libc/sysdeps/mach/hurd/getcwd.c
+++ b/libc/sysdeps/mach/hurd/getcwd.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,2002,04 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98,2002,2004,2009
+ 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
@@ -60,7 +61,6 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
__mach_port_deallocate (__mach_task_self (), thisid);
__mach_port_deallocate (__mach_task_self (), thisdevid);
__mach_port_deallocate (__mach_task_self (), rootid);
- __mach_port_deallocate (__mach_task_self (), rootdevid);
if (dirbuf != NULL)
__vm_deallocate (__mach_task_self (),
diff --git a/libc/sysdeps/s390/s390-32/dl-machine.h b/libc/sysdeps/s390/s390-32/dl-machine.h
index 64bf3423b..251a5f692 100644
--- a/libc/sysdeps/s390/s390-32/dl-machine.h
+++ b/libc/sysdeps/s390/s390-32/dl-machine.h
@@ -389,10 +389,13 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
case R_390_PC16DBL:
- case R_390_PLT16DBL:
*(unsigned short *) reloc_addr = (unsigned short)
((short) (value + reloc->r_addend - (Elf32_Addr) reloc_addr) >> 1);
break;
+ case R_390_PC32DBL:
+ *(unsigned int *) reloc_addr = (unsigned int)
+ ((int) (value + reloc->r_addend - (Elf32_Addr) reloc_addr) >> 1);
+ break;
case R_390_PC16:
*(unsigned short *) reloc_addr =
value + reloc->r_addend - (Elf32_Addr) reloc_addr;
diff --git a/libc/sysdeps/s390/s390-64/dl-machine.h b/libc/sysdeps/s390/s390-64/dl-machine.h
index fa893befd..c4df274cd 100644
--- a/libc/sysdeps/s390/s390-64/dl-machine.h
+++ b/libc/sysdeps/s390/s390-64/dl-machine.h
@@ -371,7 +371,6 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
*reloc_addr = value +reloc->r_addend - (Elf64_Addr) reloc_addr;
break;
case R_390_PC32DBL:
- case R_390_PLT32DBL:
*(unsigned int *) reloc_addr = (unsigned int)
((int) (value + reloc->r_addend - (Elf64_Addr) reloc_addr) >> 1);
break;
@@ -380,7 +379,6 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
value + reloc->r_addend - (Elf64_Addr) reloc_addr;
break;
case R_390_PC16DBL:
- case R_390_PLT16DBL:
*(unsigned short *) reloc_addr = (unsigned short)
((short) (value + reloc->r_addend - (Elf64_Addr) reloc_addr) >> 1);
break;
diff --git a/libc/sysdeps/unix/sysv/linux/futimens.c b/libc/sysdeps/unix/sysv/linux/futimens.c
index 67f2588f8..fe8e92070 100644
--- a/libc/sysdeps/unix/sysv/linux/futimens.c
+++ b/libc/sysdeps/unix/sysv/linux/futimens.c
@@ -33,6 +33,11 @@ int
futimens (int fd, const struct timespec tsp[2])
{
#ifdef __NR_utimensat
+ if (fd < 0)
+ {
+ __set_errno (EBADF);
+ return -1;
+ }
return INLINE_SYSCALL (utimensat, 4, fd, NULL, tsp, 0);
#else
__set_errno (ENOSYS);