summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-03-26 21:08:35 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-03-26 21:08:35 +0000
commit30feca091914f8d41f452394367677bfe56b3316 (patch)
treeb9f750862b34524d3bcf230ab749d293e9caebc8 /libc
parent5c92b8030ed5819dd183df7cc3cfb085317beb16 (diff)
Merge changes between r10031 and r10115 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@10116 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc')
-rw-r--r--libc/ChangeLog177
-rw-r--r--libc/Makerules16
-rw-r--r--libc/bits/time.h8
-rw-r--r--libc/catgets/gencat.c4
-rw-r--r--libc/csu/gmon-start.c4
-rw-r--r--libc/csu/version.c8
-rwxr-xr-xlibc/debug/catchsegv.sh6
-rwxr-xr-xlibc/debug/xtrace.sh4
-rw-r--r--libc/elf/dl-deps.c9
-rw-r--r--libc/elf/dl-load.c18
-rw-r--r--libc/elf/dl-lookup.c54
-rw-r--r--libc/elf/dl-sysdep.c6
-rw-r--r--libc/elf/ldconfig.c4
-rw-r--r--libc/elf/ldd.bash.in6
-rw-r--r--libc/elf/sprof.c6
-rw-r--r--libc/iconv/iconv_prog.c6
-rw-r--r--libc/iconv/iconvconfig.c32
-rw-r--r--libc/include/link.h6
-rw-r--r--libc/include/unistd.h3
-rw-r--r--libc/libc-abis48
-rw-r--r--libc/locale/programs/locale.c10
-rw-r--r--libc/locale/programs/localedef.c8
-rw-r--r--libc/locale/programs/simple-hash.c2
-rw-r--r--libc/locale/programs/simple-hash.h3
-rw-r--r--libc/locale/setlocale.c4
-rw-r--r--libc/localedata/ChangeLog10
-rw-r--r--libc/localedata/Makefile5
-rw-r--r--libc/localedata/locales/et_EE18
-rw-r--r--libc/malloc/malloc.c3
-rwxr-xr-xlibc/malloc/memusage.sh10
-rw-r--r--libc/malloc/mtrace.pl4
-rw-r--r--libc/nptl/ChangeLog7
-rw-r--r--libc/nptl/pthread_cond_timedwait.c12
-rw-r--r--libc/nscd/nscd.c8
-rw-r--r--libc/nss/getent.c4
-rw-r--r--libc/posix/Makefile4
-rw-r--r--libc/posix/bug-glob3.c45
-rw-r--r--libc/posix/getconf.c4
-rw-r--r--libc/posix/glob.c48
-rw-r--r--libc/posix/tst-gnuglob.c75
-rw-r--r--libc/resolv/res_send.c17
-rw-r--r--libc/scripts/gen-libc-abis26
-rw-r--r--libc/stdio-common/psiginfo.c2
-rw-r--r--libc/string/test-memcmp.c265
-rw-r--r--libc/sysdeps/generic/ldsodefs.h2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S15
-rw-r--r--libc/sysdeps/posix/cuserid.c5
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c22
-rw-r--r--libc/sysdeps/unix/getlogin.c8
-rw-r--r--libc/sysdeps/unix/getlogin_r.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_getres.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_gettime.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_settime.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-sysdep.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/getlogin.c39
-rw-r--r--libc/sysdeps/unix/sysv/linux/getlogin_r.c100
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h9
-rw-r--r--libc/sysdeps/unix/sysv/linux/mmap64.c21
-rw-r--r--libc/sysdeps/x86_64/multiarch/strpbrk-c.c12
-rw-r--r--libc/wcsmbs/wchar.h16
-rw-r--r--libc/wctype/wctype.h8
61 files changed, 1112 insertions, 197 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index e8781598a..a1bd98b6e 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,180 @@
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/generic/ldsodefs.h (_dl_random): Mark attribute_relro;
+
+ * stdio-common/psiginfo.c (psiginfo): Fix printf format
+ warning for si_band.
+
+ * locale/setlocale.c (free_category): Finish renaming
+ struct locale_data to __locale_data.
+
+ * csu/gmon-start.c (ENTRY_POINT, etext): Declare as char[], not void.
+ * elf/dl-sysdep.c (_end): Likewise.
+ * sysdeps/unix/sysv/dl-sysdep.c (frob_brk): Likewise with locally
+ declared _end, and associated variables.
+
+2010-03-26 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't assume success always
+ means aborting the loop over the NSS methods.
+
+2010-03-25 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
+ each action.
+
+2010-03-26 Ulrich Drepper <drepper@redhat.com>
+
+ * malloc/malloc.c: Remove stale reference to website.
+
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #11389]
+ * bits/time.h: Define CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, and
+ CLOCK_MONOTONIC_COARSE.
+ * sysdeps/unix/sysv/linux/clock_getres.c: Handle CLOCK_MONOTONIC_RAW,
+ CLOCK_REALTIME_COARSE, and CLOCK_MONOTONIC_COARSE.
+ * sysdeps/unix/sysv/linux/clock_gettime.c: Likewise.
+ * sysdeps/unix/sysv/linux/clock_settime.c: Likewise.
+
+2010-03-25 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/posix/cuserid.c: Fix typo.
+
+2010-03-16 Chris Demetriou <cgd@google.com>
+
+ [BZ #11394]
+ * locale/programs/simple-hash.c: Include inttypes.h.
+ (hashval_t): Defined to be uint32_t.
+ * locale/programs/simple_hash.h: Include inttypes.h.
+ (compute_hashval): Change return type to uint32_t.
+
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/getlogin_r.c: New file.
+ * sysdeps/unix/sysv/linux/getlogin.c: New file.
+ * sysdeps/unix/getlogin_r.c: Allow compiling getlogin as static
+ function.
+ * sysdeps/unix/getlogin.c: Likewise. Move name variable to toplevel.
+ * include/unistd.h: Declare __getlogin_r_loginuid.
+
+ [BZ #11397]
+ * sysdeps/posix/cuserid.c (cuserid): Make sure the returned string
+ is NUL terminated.
+ Patch by Jonathan Geisler <jgeisler@cse.taylor.edu>.
+
+ * sysdeps/unix/sysv/linux/mmap64.c: Allow variable shift values.
+
+2010-03-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/strpbrk-c.c: Define only if SHARED
+ is defined.
+
+2010-03-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * string/test-memcmp.c (check_result): New function.
+ (do_one_test): Use it.
+ (check1): New function.
+ (test_main): Use it.
+
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+
+ * posix/tst-gnuglob.c: Add tests with empty patterns. For this
+ rewrite the tests to add support for failing glob calls.
+ Some other minor cleanups.
+ * posix/bug-glob3.c: New file.
+ * posix/Makefile (tests): Add bug-glob3.
+
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+ Andreas Schwab <andreas@redhat.com>
+
+ * posix/glob.c (glob): Clean up gl_pathc and gl_pathv earlier.
+ If pattern is "" bail out early
+
+2010-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/dl-lookup.c (do_lookup_x): If tab->entries is NULL,
+ but tab->size != 0, just unlock and goto success, without
+ allocating anything or entering anything into the hash table.
+ (_dl_debug_bindings): Temporarily set tab->entries to NULL
+ around do_lookup_x in undef_map->l_local_scope[0]. If
+ undef_map->l_symbolic_in_local_scope, lookup also in
+ symbolic_searchlist of following libraries in l_local_scope
+ that have DT_SYMBOLIC set.
+ * elf/dl-deps.c (_dl_map_object_deps): Compute
+ l_symbolic_in_local_scope.
+ * include/link.h (struct link_map): Add l_symbolic_in_local_scope
+ bitfield.
+
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #11410]
+ * wctype/wctype.h: Use <wchar.h> to get the wint_t definition.
+
+ * wcsmbs/wchar.h: Correct preprocessor directive indentation. Move
+ C++ prototype handling to a better place.
+
+2010-03-18 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/dl-load.c (open_verify): Extend expected to the full size of the
+ e_ident array. When loading, check that the fields in e_ident we don't
+ know are zero to allow future extensions.
+
+2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Update %xmm3
+ when exit from loop.
+
+2010-03-16 Andreas Schwab <schwab@redhat.com>
+
+ * resolv/res_send.c (__libc_res_nsend): Fix printing of server
+ address in debug statement.
+ (send_dg): Pass correct buffer pointer to DprintQ.
+
+2010-03-17 Ulrich Drepper <drepper@redhat.com>
+
+ * libc-abis: Add a few more entries.
+
+2010-03-16 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/dl-load.c (VALID_ELF_ABIVERSION): Add additional osabi parameter.
+ Not used here.
+ (open_verify): Modify for extended VALID_ELF_ABIVERSION macro
+ interface.
+ * sysdeps/unix/sysv/linux/ldsodefs.h (VALID_ELF_ABIVERSION): Add
+ additional osabi parameter. Only acceept nonzero ABI versions if osabi
+ is Linux.
+ Fix includes.
+ (expected2): Don't explicitly initialize EI_ABIVERSION byte.
+
+ * sysdeps/unix/sysv/linux/ldsodefs.h (VALID_ELF_ABIVERSION): Update
+ definition to follow generic code.
+
+2010-03-15 Ulrich Drepper <drepper@redhat.com>
+
+ * posix/getconf.c: Update copyright year.
+ * nss/getent.c: Likewise.
+ * iconv/iconvconfig.c: Likewise.
+ * iconv/iconv_prog.c: Likewise.
+ * elf/ldconfig.c: Likewise.
+ * catgets/gencat.c: Likewise.
+ * csu/version.c: Likewise.
+ * elf/ldd.bash.in: Likewise.
+ * elf/sprof.c (print_version): Likewise.
+ * locale/programs/locale.c: Likewise.
+ * locale/programs/localedef.c: Likewise.
+ * nscd/nscd.c (print_version): Likewise.
+ * debug/xtrace.sh: Likewise.
+ * malloc/memusage.sh: Likewise.
+ * malloc/mtrace.pl: Likewise.
+ * debug/catchsegv.sh: Likewise.
+
+ * Makerules: Add rule for libc-abis.h.
+ * csu/version.c: Use LIBC_ABIS_STRING string if available.
+ * elf/dl-load.c (VALID_ELF_ABIVERSION): Check using LIBC_ABI_MAX.
+ (open_verify): Only check EI_ABIVERSION bytes using VALID_ELF_HEADER.
+ Add extra call to VALID_ELF_ABIVERSION.
+
2010-03-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/sys/mount.h (UMOUNT_NOFOLLOW): Define.
diff --git a/libc/Makerules b/libc/Makerules
index 24e735585..48f8f55a7 100644
--- a/libc/Makerules
+++ b/libc/Makerules
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2006,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright (C) 1991-2006,2007,2008,2009,2010 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
@@ -110,6 +110,18 @@ abi_versions_file := $(common-objpfx)abi-versions.h
endif # avoid-generated
endif # $(versioning) = yes
+ifndef avoid-generated
+before-compile := $(common-objpfx)libc-abis.h $(before-compile)
+libc-abis := $(firstword $(wildcard $(foreach D,$(add-ons), $(..)libc-abis)) \
+ libc-abis)
+$(common-objpfx)libc-abis.h: $(..)scripts/gen-libc-abis $(libc-abis)
+ $(SHELL) $(..)scripts/gen-libc-abis \
+ $(base-machine)-$(config-vendor)-$(config-os) \
+ < $(libc-abis) > $@T
+ $(move-if-change) $@T $@
+common-generated += $(common-objpfx)libc-abis.h
+endif # avoid-generated
+
# Make sure the subdirectory for object files gets created.
ifdef objpfx
ifeq (,$(wildcard $(objpfx).))
@@ -1461,7 +1473,7 @@ $(objpfx)stubs: $(objs-for-stubs)
ifneq (,$(strip $(objs-for-stubs)))
(cd $(objpfx).; $(OBJDUMP) -h $(patsubst $(objpfx)%,%,$^)) | \
$(AWK) '/\.gnu\.glibc-stub\./ { \
- sub(/\.gnu\.glibc-stub\./, "", $$2); \
+ sub(/\.gnu\.glibc-stub\./, "", $$2); \
stubs[$$2] = 1; } \
END { for (s in stubs) print "#define __stub_" s }' > $@T
mv -f $@T $@
diff --git a/libc/bits/time.h b/libc/bits/time.h
index b3184d1de..968ecc549 100644
--- a/libc/bits/time.h
+++ b/libc/bits/time.h
@@ -1,5 +1,5 @@
/* System-dependent timing definitions. Generic version.
- Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999-2002,2003,2010 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
@@ -50,6 +50,12 @@ extern long int __sysconf (int);
# define CLOCK_PROCESS_CPUTIME_ID 2
/* Thread-specific CPU-time clock. */
# define CLOCK_THREAD_CPUTIME_ID 3
+/* Monotonic system-wide clock, not adjusted for frequency scaling. */
+# define CLOCK_MONOTONIC_RAW 4
+/* Identifier for system-wide realtime clock, updated only on ticks. */
+# define CLOCK_REALTIME_COARSE 5
+/* Monotonic system-wide clock, updated only on ticks. */
+# define CLOCK_MONOTONIC_COARSE 6
/* Flag to indicate time is absolute. */
# define TIMER_ABSTIME 1
diff --git a/libc/catgets/gencat.c b/libc/catgets/gencat.c
index 7b5716ec8..1ef8f407c 100644
--- a/libc/catgets/gencat.c
+++ b/libc/catgets/gencat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1996.
@@ -250,7 +250,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
diff --git a/libc/csu/gmon-start.c b/libc/csu/gmon-start.c
index d11c9b953..7d585e135 100644
--- a/libc/csu/gmon-start.c
+++ b/libc/csu/gmon-start.c
@@ -31,9 +31,9 @@
#ifdef ENTRY_POINT_DECL
ENTRY_POINT_DECL(extern)
#else
-extern void ENTRY_POINT;
+extern char ENTRY_POINT[];
#endif
-extern void etext;
+extern char etext[];
#ifndef TEXT_START
# ifdef ENTRY_POINT_DECL
diff --git a/libc/csu/version.c b/libc/csu/version.c
index 3ce7fe0c7..8981d0241 100644
--- a/libc/csu/version.c
+++ b/libc/csu/version.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include "version.h"
#include <tls.h>
+#include <libc-abis.h>
#include <gnu/libc-version.h>
static const char __libc_release[] = RELEASE;
@@ -25,12 +26,15 @@ static const char __libc_version[] = VERSION;
static const char banner[] =
"GNU C Library "PKGVERSION RELEASE" release version "VERSION", by Roland McGrath et al.\n\
-Copyright (C) 2009 Free Software Foundation, Inc.\n\
+Copyright (C) 2010 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n\
Compiled by GNU CC version "__VERSION__".\n"
#include "version-info.h"
+#ifdef LIBC_ABIS_STRING
+LIBC_ABIS_STRING
+#endif
#ifdef GLIBC_OLDEST_ABI
"The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n"
#endif
diff --git a/libc/debug/catchsegv.sh b/libc/debug/catchsegv.sh
index bfbde6875..f8a22a24d 100755
--- a/libc/debug/catchsegv.sh
+++ b/libc/debug/catchsegv.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998,1999,2001,2003,2004,2006,2007,2008,2009
+# Copyright (C) 1998,1999,2001,2003,2004,2006,2007,2008,2009,2010
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -40,7 +40,7 @@ if test $# -eq 0; then
;;
--v | --ve | --ver | --vers | --versi | --versio | --version)
echo 'catchsegv @PKGVERSION@@VERSION@'
- echo 'Copyright (C) 2009 Free Software Foundation, Inc.
+ echo 'Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper.'
@@ -97,7 +97,7 @@ if test -s "$segv_output"; then
echo "$line"
fi
;;
- *) echo "$line"
+ *) echo "$line"
;;
esac
done)
diff --git a/libc/debug/xtrace.sh b/libc/debug/xtrace.sh
index 91959e4da..c3564c35b 100755
--- a/libc/debug/xtrace.sh
+++ b/libc/debug/xtrace.sh
@@ -1,5 +1,5 @@
#! @BASH@
-# Copyright (C) 1999, 2001-2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001-2008, 2009, 2010 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
@@ -66,7 +66,7 @@ do_version() {
printf $"Copyright (C) %s Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2009"
+" "2010"
printf $"Written by %s.
" "Ulrich Drepper"
exit 0
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index ba6cd04ee..92840e43f 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -1,5 +1,5 @@
/* Load the dependencies of a mapped object.
- Copyright (C) 1996-2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -554,7 +554,12 @@ Filters not supported with LD_TRACE_PRELINKING"));
cnt = _dl_build_local_scope (l_initfini, l);
assert (cnt <= nlist);
for (j = 0; j < cnt; j++)
- l_initfini[j]->l_reserved = 0;
+ {
+ l_initfini[j]->l_reserved = 0;
+ if (j && __builtin_expect (l_initfini[j]->l_info[DT_SYMBOLIC]
+ != NULL, 0))
+ l->l_symbolic_in_local_scope = true;
+ }
l->l_local_scope[0] =
(struct r_scope_elem *) malloc (sizeof (struct r_scope_elem)
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index cd02c8df7..7ecf82b28 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -1569,11 +1569,11 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
#ifndef VALID_ELF_HEADER
# define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0)
# define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV)
-# define VALID_ELF_ABIVERSION(ver) (ver == 0)
+# define VALID_ELF_ABIVERSION(osabi,ver) (ver == 0)
#elif defined MORE_ELF_HEADER_DATA
MORE_ELF_HEADER_DATA;
#endif
- static const unsigned char expected[EI_PAD] =
+ static const unsigned char expected[EI_NIDENT] =
{
[EI_MAG0] = ELFMAG0,
[EI_MAG1] = ELFMAG1,
@@ -1655,7 +1655,13 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
/* See whether the ELF header is what we expect. */
if (__builtin_expect (! VALID_ELF_HEADER (ehdr->e_ident, expected,
- EI_PAD), 0))
+ EI_ABIVERSION)
+ || !VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
+ ehdr->e_ident[EI_ABIVERSION])
+ || memcmp (&ehdr->e_ident[EI_PAD],
+ &expected[EI_PAD],
+ EI_NIDENT - EI_PAD) != 0,
+ 0))
{
/* Something is wrong. */
const Elf32_Word *magp = (const void *) ehdr->e_ident;
@@ -1695,8 +1701,12 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
allowed here. */
else if (!VALID_ELF_OSABI (ehdr->e_ident[EI_OSABI]))
errstring = N_("ELF file OS ABI invalid");
- else if (!VALID_ELF_ABIVERSION (ehdr->e_ident[EI_ABIVERSION]))
+ else if (!VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
+ ehdr->e_ident[EI_ABIVERSION]))
errstring = N_("ELF file ABI version invalid");
+ else if (memcmp (&ehdr->e_ident[EI_PAD], &expected[EI_PAD],
+ EI_NIDENT - EI_PAD) != 0)
+ errstring = N_("nonzero padding in e_ident");
else
/* Otherwise we don't know what went wrong. */
errstring = N_("internal error");
diff --git a/libc/elf/dl-lookup.c b/libc/elf/dl-lookup.c
index c350f16ef..16d7fbcc3 100644
--- a/libc/elf/dl-lookup.c
+++ b/libc/elf/dl-lookup.c
@@ -1,5 +1,6 @@
/* Look up a symbol in the loaded objects.
- Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2005, 2006, 2007, 2009, 2010
+ 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
@@ -414,6 +415,20 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
assert (!RTLD_CHECK_FOREIGN_CALL);
#endif
+#ifdef SHARED
+ /* If tab->entries is NULL, but tab->size is not, it means
+ this is the second, conflict finding, lookup for
+ LD_TRACE_PRELINKING in _dl_debug_bindings. Don't
+ allocate anything and don't enter anything into the
+ hash table. */
+ if (__builtin_expect (tab->size, 0))
+ {
+ assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
+ __rtld_lock_unlock_recursive (tab->lock);
+ goto success;
+ }
+#endif
+
#define INITIAL_NUNIQUE_SYM_TABLE 31
size = INITIAL_NUNIQUE_SYM_TABLE;
entries = calloc (sizeof (struct unique_sym), size);
@@ -917,13 +932,48 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
{
const uint_fast32_t new_hash = dl_new_hash (undef_name);
unsigned long int old_hash = 0xffffffff;
+ struct unique_sym *saved_entries
+ = GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries;
+ GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries = NULL;
do_lookup_x (undef_name, new_hash, &old_hash, *ref, &val,
undef_map->l_local_scope[0], 0, version, 0, NULL,
type_class, undef_map);
-
if (val.s != value->s || val.m != value->m)
conflict = 1;
+ else if (__builtin_expect (undef_map->l_symbolic_in_local_scope, 0)
+ && val.s
+ && __builtin_expect (ELFW(ST_BIND) (val.s->st_info),
+ STB_GLOBAL) == STB_GNU_UNIQUE)
+ {
+ /* If it is STB_GNU_UNIQUE and undef_map's l_local_scope
+ contains any DT_SYMBOLIC libraries, unfortunately there
+ can be conflicts even if the above is equal. As symbol
+ resolution goes from the last library to the first and
+ if a STB_GNU_UNIQUE symbol is found in some late DT_SYMBOLIC
+ library, it would be the one that is looked up. */
+ struct sym_val val2 = { NULL, NULL };
+ size_t n;
+ struct r_scope_elem *scope = undef_map->l_local_scope[0];
+
+ for (n = 0; n < scope->r_nlist; n++)
+ if (scope->r_list[n] == val.m)
+ break;
+
+ for (n++; n < scope->r_nlist; n++)
+ if (scope->r_list[n]->l_info[DT_SYMBOLIC] != NULL
+ && do_lookup_x (undef_name, new_hash, &old_hash, *ref,
+ &val2,
+ &scope->r_list[n]->l_symbolic_searchlist,
+ 0, version, 0, NULL, type_class,
+ undef_map) > 0)
+ {
+ conflict = 1;
+ val = val2;
+ break;
+ }
+ }
+ GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries = saved_entries;
}
if (value->s)
diff --git a/libc/elf/dl-sysdep.c b/libc/elf/dl-sysdep.c
index 5507e57b9..160503dac 100644
--- a/libc/elf/dl-sysdep.c
+++ b/libc/elf/dl-sysdep.c
@@ -47,7 +47,7 @@
#endif
extern char **_environ attribute_hidden;
-extern void _end attribute_hidden;
+extern char _end[] attribute_hidden;
/* Protect SUID program against misuse of file descriptors. */
extern void __libc_check_standard_fds (void);
@@ -226,14 +226,14 @@ _dl_sysdep_start (void **start_argptr,
if (GLRO(dl_platform) != NULL)
GLRO(dl_platformlen) = strlen (GLRO(dl_platform));
- if (__sbrk (0) == &_end)
+ if (__sbrk (0) == _end)
/* The dynamic linker was run as a program, and so the initial break
starts just after our bss, at &_end. The malloc in dl-minimal.c
will consume the rest of this page, so tell the kernel to move the
break up that far. When the user program examines its break, it
will see this new value and not clobber our data. */
__sbrk (GLRO(dl_pagesize)
- - ((&_end - (void *) 0) & (GLRO(dl_pagesize) - 1)));
+ - ((_end - (char *) 0) & (GLRO(dl_pagesize) - 1)));
/* If this is a SUID program we make sure that FDs 0, 1, and 2 are
allocated. If necessary we are doing it ourself. If it is not
diff --git a/libc/elf/ldconfig.c b/libc/elf/ldconfig.c
index 93a8d7aa7..6dc7b041c 100644
--- a/libc/elf/ldconfig.c
+++ b/libc/elf/ldconfig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -320,7 +320,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"),
"Andreas Jaeger");
}
diff --git a/libc/elf/ldd.bash.in b/libc/elf/ldd.bash.in
index 98e589064..b56f04d51 100644
--- a/libc/elf/ldd.bash.in
+++ b/libc/elf/ldd.bash.in
@@ -1,5 +1,5 @@
#! @BASH@
-# Copyright (C) 1996-2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2008, 2009, 2010 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 +39,7 @@ while test $# -gt 0; do
printf $"Copyright (C) %s Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2009"
+" "2010"
printf $"Written by %s and %s.
" "Roland McGrath" "Ulrich Drepper"
exit 0
@@ -160,7 +160,7 @@ warning: you do not have execution permission for" "\`$file'" >&2
for rtld in ${RTLDLIST}; do
if test -x $rtld; then
verify_out=`${rtld} --verify "$file"`
- ret=$?
+ ret=$?
case $ret in
[02]) RTLD=${rtld}; break;;
esac
diff --git a/libc/elf/sprof.c b/libc/elf/sprof.c
index 9d1188519..f5b0b9710 100644
--- a/libc/elf/sprof.c
+++ b/libc/elf/sprof.c
@@ -1,5 +1,5 @@
/* Read and display shared object profiling data.
- Copyright (C) 1997-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -261,7 +261,7 @@ main (int argc, char *argv[])
{
/* We need exactly two non-option parameter. */
argp_help (&argp, stdout, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR,
- program_invocation_short_name);
+ program_invocation_short_name);
exit (1);
}
@@ -391,7 +391,7 @@ Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"),
- "2009");
+ "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
diff --git a/libc/iconv/iconv_prog.c b/libc/iconv/iconv_prog.c
index a2c0ad687..4c3cc9e5b 100644
--- a/libc/iconv/iconv_prog.c
+++ b/libc/iconv/iconv_prog.c
@@ -1,5 +1,5 @@
/* Convert text in given files from the specified from-set to the to-set.
- Copyright (C) 1998-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -435,7 +435,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
@@ -512,7 +512,7 @@ process_block (iconv_t cd, char *addr, size_t len, FILE **output,
if (n != (size_t) -1)
{
/* All the input test is processed. For state-dependent
- character sets we have to flush the state now. */
+ character sets we have to flush the state now. */
outptr = outbuf;
outlen = OUTBUF_SIZE;
n = iconv (cd, NULL, NULL, &outptr, &outlen);
diff --git a/libc/iconv/iconvconfig.c b/libc/iconv/iconvconfig.c
index 81f88763b..a605d7963 100644
--- a/libc/iconv/iconvconfig.c
+++ b/libc/iconv/iconvconfig.c
@@ -1,5 +1,5 @@
/* Generate fastloading iconv module configuration files.
- Copyright (C) 2000-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2000-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -399,7 +399,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
@@ -996,24 +996,24 @@ next_prime (uint32_t seed)
stoff ??? String table
hoff 8*hsize Array of tuples
- string table offset
- module index
+ string table offset
+ module index
moff ??? Array of tuples
- canonical name offset
- from-internal module dir name offset
- from-internal module name off
- to-internal module dir name offset
- to-internal module name offset
- offset into other conversion table
+ canonical name offset
+ from-internal module dir name offset
+ from-internal module name off
+ to-internal module dir name offset
+ to-internal module name offset
+ offset into other conversion table
ooff ??? One or more of
- number of steps/modules
- one or more of tuple
- canonical name offset for output
- module dir name offset
- module name offset
- (following last entry with step count 0)
+ number of steps/modules
+ one or more of tuple
+ canonical name offset for output
+ module dir name offset
+ module name offset
+ (following last entry with step count 0)
*/
static struct hash_entry *hash_table;
diff --git a/libc/include/link.h b/libc/include/link.h
index 26c67438f..9d1fc1a8f 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 Free Software Foundation, Inc.
+ Copyright (C) 1995-2006, 2007, 2009, 2010 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
@@ -188,6 +188,10 @@ struct link_map
unsigned int l_contiguous:1; /* Nonzero if inter-segment holes are
mprotected or if no holes are present at
all. */
+ unsigned int l_symbolic_in_local_scope:1; /* Nonzero if l_local_scope
+ during LD_TRACE_PRELINKING=1
+ contains any DT_SYMBOLIC
+ libraries. */
/* Collected information about own RPATH directories. */
struct r_search_path_struct l_rpath_dirs;
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index ccba893ab..0ad298328 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -176,6 +176,9 @@ extern int __have_sock_cloexec;
unless it is really necessary. */
#define __have_pipe2 __have_sock_cloexec
+extern int __getlogin_r_loginuid (char *name, size_t namesize)
+ attribute_hidden;
+
__END_DECLS
#endif
diff --git a/libc/libc-abis b/libc/libc-abis
new file mode 100644
index 000000000..8668e49d8
--- /dev/null
+++ b/libc/libc-abis
@@ -0,0 +1,48 @@
+# Definition of features which introduce new libc ABI versions. This
+# file is used to create a header file with definitions for the various
+# versions. The static linker will encode in the EI_ABIVERSION field in
+# the e_ident array in the ELF program header the required ABI version.
+# This is not a bitmask. The maximum ABI version required must be
+# encoded.
+#
+# Adding new features should always happen by appending new lines. Never
+# add entries in the middle or where they seem "logical". Once a version
+# is assigned to a feature it must not change again. Since some features
+# are conditionally added this can only ever be done securely without much
+# risk is by adding at the end.
+#
+# The following lines have one of two formats:
+#
+# SYMBOL
+# With just a symbol on the line this is the name of a feature which
+# is architecture independent.
+#
+# SYMBOL PLATFORM
+# Using this form architecture (and platform) dependent features can be
+# specified. The PLATFORM name can use the wildcards available in
+# the Bourne shell's case expression.
+#
+# Note that the same symbol can be used using different platform triples.
+# They don't have to be in the same order relative to other entries. This
+# can happen if the feature is implemented for different architectures
+# at different times.
+#
+# This file is parsed by a script which produces a header file containing
+# a single enum definition. An extra symbol is added as entry zero to
+# specify the default ABI with number 0 and an artificial last entry is
+# added to allow computing the maximum ABI version for the platform.
+#
+# Feature Name Configuration
+# ------------ -------------
+#
+# Unique symbol definitions for C++.
+# Architecture independent, all ELF targets (== all targets)
+UNIQUE
+#
+# Indirect PLT relocations. Architecture dependent.
+IFUNC x86_64-*-linux*
+IFUNC i?86-*-linux*
+IFUNC powerpc64-*-linux*
+IFUNC powerpc-*-linux*
+IFUNC sparc64-*-linux*
+IFUNC sparc-*-linux*
diff --git a/libc/locale/programs/locale.c b/libc/locale/programs/locale.c
index 74924e5ec..23ccd0e84 100644
--- a/libc/locale/programs/locale.c
+++ b/libc/locale/programs/locale.c
@@ -1,5 +1,5 @@
/* Implementation of the locale program according to POSIX 9945-2.
- Copyright (C) 1995-1997, 1999-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 1999-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -144,7 +144,7 @@ struct category
#define DEFINE_CATEGORY(category, name, items, postload) \
static struct cat_item category##_desc[] = \
{ \
- NO_PAREN items \
+ NO_PAREN items \
};
#include "categories.def"
@@ -297,7 +297,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
@@ -542,7 +542,7 @@ write_locales (void)
because
a) we are only interested in the first two fields
b) these fields must be usable as file names and so must
- not be that long */
+ not be that long */
char buf[BUFSIZ];
char *alias;
char *value;
@@ -889,7 +889,7 @@ show_info (const char *name)
while (cnt > 1)
{
printf ("%d;", *val == '\177' ? -1 : *val);
- --cnt;
+ --cnt;
++val;
}
diff --git a/libc/locale/programs/localedef.c b/libc/locale/programs/localedef.c
index 0b2f81c7c..756e66728 100644
--- a/libc/locale/programs/localedef.c
+++ b/libc/locale/programs/localedef.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -384,8 +384,8 @@ more_help (int key, const char *text, void *input)
/* We print some extra information. */
if (asprintf (&cp, gettext ("\
System's directory for character maps : %s\n\
- repertoire maps: %s\n\
- locale path : %s\n\
+ repertoire maps: %s\n\
+ locale path : %s\n\
%s"),
CHARMAP_PATH, REPERTOIREMAP_PATH, LOCALE_PATH, gettext ("\
For bug reporting instructions, please see:\n\
@@ -407,7 +407,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
diff --git a/libc/locale/programs/simple-hash.c b/libc/locale/programs/simple-hash.c
index 5bd65f247..b9cc237e4 100644
--- a/libc/locale/programs/simple-hash.c
+++ b/libc/locale/programs/simple-hash.c
@@ -21,6 +21,7 @@
# include <config.h>
#endif
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -49,6 +50,7 @@
# define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif
+#define hashval_t uint32_t
#include "hashval.h"
extern void *xmalloc (size_t __n);
diff --git a/libc/locale/programs/simple-hash.h b/libc/locale/programs/simple-hash.h
index b41c233b0..e0c32bcc3 100644
--- a/libc/locale/programs/simple-hash.h
+++ b/libc/locale/programs/simple-hash.h
@@ -19,6 +19,7 @@
#ifndef _SIMPLE_HASH_H
#define _SIMPLE_HASH_H
+#include <inttypes.h>
#include <obstack.h>
typedef struct hash_table
@@ -45,7 +46,7 @@ extern int iterate_table (const hash_table *htab, void **ptr,
const void **key, size_t *keylen, void **data)
__THROW;
-extern unsigned long int compute_hashval (const void *key, size_t keylen)
+extern uint32_t compute_hashval (const void *key, size_t keylen)
__THROW;
extern unsigned long int next_prime (unsigned long int seed) __THROW;
diff --git a/libc/locale/setlocale.c b/libc/locale/setlocale.c
index fad726287..58daaf1f5 100644
--- a/libc/locale/setlocale.c
+++ b/libc/locale/setlocale.c
@@ -435,7 +435,7 @@ libc_hidden_def (setlocale)
static void __libc_freeres_fn_section
free_category (int category,
- struct __locale_data *here, struct locale_data *c_data)
+ struct __locale_data *here, struct __locale_data *c_data)
{
struct loaded_l10nfile *runp = _nl_locale_file_list[category];
@@ -451,7 +451,7 @@ free_category (int category,
while (runp != NULL)
{
struct loaded_l10nfile *curr = runp;
- struct __locale_data *data = (struct locale_data *) runp->data;
+ struct __locale_data *data = (struct __locale_data *) runp->data;
if (data != NULL && data != c_data)
_nl_unload_locale (data);
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index cc47bbaf7..da271f94b 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #10554]
+ * locales/et_EE: Change first_weekday and first_workday.
+ Patch by Priit Laes <plaes@plaes.org>.
+
+2010-02-16 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * Makefile: Add missing gconv-modules dependency.
+
2010-02-03 Ulrich Drepper <drepper@redhat.com>
[BZ #10414]
diff --git a/libc/localedata/Makefile b/libc/localedata/Makefile
index 256ecea12..ac1bed760 100644
--- a/libc/localedata/Makefile
+++ b/libc/localedata/Makefile
@@ -122,6 +122,8 @@ install-others := $(addprefix $(inst_i18ndir)/, \
$(addsuffix .gz, $(charmaps)) \
$(locales))
+tests: $(objdir)/iconvdata/gconv-modules
+
include ../Rules
# Install the charmap files in gzipped format.
@@ -327,3 +329,6 @@ tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
LOCPATH=$(common-objpfx)localedata
$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
+
+$(objdir)/iconvdata/gconv-modules:
+ $(MAKE) -C ../iconvdata subdir=iconvdata $@
diff --git a/libc/localedata/locales/et_EE b/libc/localedata/locales/et_EE
index efec335e0..33d31102f 100644
--- a/libc/localedata/locales/et_EE
+++ b/libc/localedata/locales/et_EE
@@ -209,7 +209,7 @@ collating-symbol <SPECIAL>
% letter;accent;case;specials
order_start forward;backward/
- ;forward;position
+ ;forward;position
% <CAPITAL> or <SMALL> letters first:
@@ -2197,8 +2197,8 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
week 7;19971130;4
-first_weekday 1
-first_workday 1
+first_weekday 2
+first_workday 2
END LC_TIME
LC_MESSAGES
@@ -2232,12 +2232,12 @@ END LC_NAME
LC_ADDRESS
postal_fmt "<U0025><U0061><U0025><U004E>/
- <U0025><U0066><U0025><U004E>/
- <U0025><U0064><U0025><U004E>/
- <U0025><U0062><U0025><U004E>/
- <U0025><U0073><U0025><U0074><U0025><U0068><U0025><U0074><U0025><U0065><U0025><U0074><U0025><U0072><U0025><U004E>/
- <U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025><U004E>/
- <U0025><U0063><U0025><U004E>"
+ <U0025><U0066><U0025><U004E>/
+ <U0025><U0064><U0025><U004E>/
+ <U0025><U0062><U0025><U004E>/
+ <U0025><U0073><U0025><U0074><U0025><U0068><U0025><U0074><U0025><U0065><U0025><U0074><U0025><U0072><U0025><U004E>/
+ <U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025><U004E>/
+ <U0025><U0063><U0025><U004E>"
country_name "<U0045><U0065><U0073><U0074><U0069>"
country_post "<U0045><U0045>"
country_ab2 "<U0045><U0045>"
diff --git a/libc/malloc/malloc.c b/libc/malloc/malloc.c
index 763852ea3..6993aea0e 100644
--- a/libc/malloc/malloc.c
+++ b/libc/malloc/malloc.c
@@ -148,8 +148,7 @@
Thread-safety: thread-safe unless NO_THREADS is defined
Compliance: I believe it is compliant with the 1997 Single Unix Specification
- (See http://www.opennc.org). Also SVID/XPG, ANSI C, and probably
- others as well.
+ Also SVID/XPG, ANSI C, and probably others as well.
* Synopsis of compile-time options:
diff --git a/libc/malloc/memusage.sh b/libc/malloc/memusage.sh
index d99676611..6be30e22c 100755
--- a/libc/malloc/memusage.sh
+++ b/libc/malloc/memusage.sh
@@ -1,5 +1,5 @@
#! @BASH@
-# Copyright (C) 1999-2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1999-2008, 2009, 2010 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
@@ -73,7 +73,7 @@ do_version() {
printf $"Copyright (C) %s Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2009"
+" "2010"
printf $"Written by %s.
" "Ulrich Drepper"
exit 0
@@ -99,9 +99,9 @@ while test $# -gt 0; do
;;
--us | --usa | --usag | --usage)
echo $"Syntax: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]
- [--buffer=SIZE] [--no-timer] [--time-based] [--total]
- [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]
- PROGRAM [PROGRAMOPTION]..."
+ [--buffer=SIZE] [--no-timer] [--time-based] [--total]
+ [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]
+ PROGRAM [PROGRAMOPTION]..."
exit 0
;;
-n | --pr | --pro | --prog | --progn | --progna | --prognam | --progname)
diff --git a/libc/malloc/mtrace.pl b/libc/malloc/mtrace.pl
index a4179c5f5..6512982fd 100644
--- a/libc/malloc/mtrace.pl
+++ b/libc/malloc/mtrace.pl
@@ -1,7 +1,7 @@
#! @PERL@
eval "exec @PERL@ -S $0 $@"
if 0;
-# Copyright (C) 1997-2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1997-2008, 2009, 2010 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1997.
# Based on the mtrace.awk script.
@@ -46,7 +46,7 @@ arglist: while (@ARGV) {
$ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" ||
$ARGV[0] eq "--versio" || $ARGV[0] eq "--version") {
print "mtrace $PKGVERSION$VERSION\n";
- print "Copyright (C) 2009 Free Software Foundation, Inc.\n";
+ print "Copyright (C) 2010 Free Software Foundation, Inc.\n";
print "This is free software; see the source for copying conditions. There is NO\n";
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
print "Written by Ulrich Drepper <drepper\@gnu.org>\n";
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index f51ad4326..bab38c7a8 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-23 Luis Machado <luisgpm@br.ibm.com>
+
+ * pthread_cond_timedwait.c: Add check for
+ HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
+ (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
+ INTERNAL_SYSCALL.
+
2010-03-09 Ulrich Drepper <drepper@redhat.com>
* pthread_create.c (__pthread_create_2_1): If priorities are incorrect
diff --git a/libc/nptl/pthread_cond_timedwait.c b/libc/nptl/pthread_cond_timedwait.c
index 9d268e911..7278ec45b 100644
--- a/libc/nptl/pthread_cond_timedwait.c
+++ b/libc/nptl/pthread_cond_timedwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -27,6 +27,14 @@
#include <shlib-compat.h>
+#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
+# undef INTERNAL_VSYSCALL
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
+# undef INLINE_VSYSCALL
+# define INLINE_VSYSCALL INLINE_SYSCALL
+#else
+# include <bits/libc-vdso.h>
+#endif
/* Cleanup handler, defined in pthread_cond_wait.c. */
extern void __condvar_cleanup (void *arg)
@@ -102,7 +110,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
#ifdef __NR_clock_gettime
INTERNAL_SYSCALL_DECL (err);
int ret;
- ret = INTERNAL_SYSCALL (clock_gettime, err, 2,
+ ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
(cond->__data.__nwaiters
& ((1 << COND_NWAITERS_SHIFT) - 1)),
&rt);
diff --git a/libc/nscd/nscd.c b/libc/nscd/nscd.c
index 2a697a0a8..43721976f 100644
--- a/libc/nscd/nscd.c
+++ b/libc/nscd/nscd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -246,7 +246,7 @@ main (int argc, char **argv)
openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
if (write_pid (_PATH_NSCDPID) < 0)
- dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
+ dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
if (!init_logfile ())
dbg_log (_("Could not create log file"));
@@ -433,7 +433,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"),
"Thorsten Kukuk and Ulrich Drepper");
}
@@ -514,7 +514,7 @@ check_pid (const char *file)
the PID is the same as the current process' since tha latter
can mean we re-exec. */
if ((n != 1 || kill (pid, 0) == 0) && pid != getpid ())
- return 1;
+ return 1;
}
return 0;
diff --git a/libc/nss/getent.c b/libc/nss/getent.c
index 66bd87d6d..95b35ec43 100644
--- a/libc/nss/getent.c
+++ b/libc/nss/getent.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -84,7 +84,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
}
diff --git a/libc/posix/Makefile b/libc/posix/Makefile
index 8db20c203..f88b84139 100644
--- a/libc/posix/Makefile
+++ b/libc/posix/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-1999, 2000-2006, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1991-1999, 2000-2007, 2009, 2010 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
@@ -97,7 +97,7 @@ tests := tstgetopt testfnm runtests \
tst-nice tst-nanosleep \
transbug \
tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
- bug-glob1 bug-glob2 tst-sysconf \
+ bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
diff --git a/libc/posix/bug-glob3.c b/libc/posix/bug-glob3.c
new file mode 100644
index 000000000..f2fbd703d
--- /dev/null
+++ b/libc/posix/bug-glob3.c
@@ -0,0 +1,45 @@
+#include <glob.h>
+#include <stdio.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+ int result = 0;
+ glob_t g;
+ g.gl_pathc = 0;
+
+ int r = glob ("", 0, NULL, &g);
+ if (r != GLOB_NOMATCH)
+ {
+ puts ("glob (\"\", 0, NULL, &g) did not fail");
+ result = 1;
+ }
+ else if (g.gl_pathc != 0)
+ {
+ puts ("gl_pathc after glob (\"\", 0, NULL, &g) not zero");
+ result = 1;
+ }
+
+ r = glob ("", GLOB_NOCHECK, NULL, &g);
+ if (r != 0)
+ {
+ puts ("glob (\"\", GLOB_NOCHECK, NULL, &g) did fail");
+ result = 1;
+ }
+ else if (g.gl_pathc != 1)
+ {
+ puts ("gl_pathc after glob (\"\", GLOB_NOCHECK, NULL, &g) not 1");
+ result = 1;
+ }
+ else if (strcmp (g.gl_pathv[0], "") != 0)
+ {
+ puts ("gl_pathv[0] after glob (\"\", GLOB_NOCHECK, NULL, &g) not \"\"");
+ result = 1;
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/posix/getconf.c b/libc/posix/getconf.c
index 74b762146..97c22e913 100644
--- a/libc/posix/getconf.c
+++ b/libc/posix/getconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 1995-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 1995-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -1105,7 +1105,7 @@ main (int argc, char *argv[])
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2009");
+"), "2010");
printf (gettext ("Written by %s.\n"), "Roland McGrath");
return 0;
}
diff --git a/libc/posix/glob.c b/libc/posix/glob.c
index ae1b6f6e0..b1bd3e4cc 100644
--- a/libc/posix/glob.c
+++ b/libc/posix/glob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008
+/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -421,6 +421,24 @@ glob (pattern, flags, errfunc, pglob)
}
}
+ if (!(flags & GLOB_APPEND))
+ {
+ pglob->gl_pathc = 0;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_pathv = NULL;
+ else
+ {
+ size_t i;
+ pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
+ * sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ return GLOB_NOSPACE;
+
+ for (i = 0; i <= pglob->gl_offs; ++i)
+ pglob->gl_pathv[i] = NULL;
+ }
+ }
+
/* Find the filename. */
filename = strrchr (pattern, '/');
#if defined __MSDOS__ || defined WINDOWS32
@@ -448,6 +466,12 @@ glob (pattern, flags, errfunc, pglob)
}
else
{
+ if (__builtin_expect (pattern[0] == '\0', 0))
+ {
+ dirs.gl_pathv = NULL;
+ goto no_matches;
+ }
+
filename = pattern;
#ifdef _AMIGA
dirname = "";
@@ -495,7 +519,7 @@ glob (pattern, flags, errfunc, pglob)
if (filename[0] == '\0'
#if defined __MSDOS__ || defined WINDOWS32
- && dirname[dirlen - 1] != ':'
+ && dirname[dirlen - 1] != ':'
&& (dirlen < 3 || dirname[dirlen - 2] != ':'
|| dirname[dirlen - 1] != '/')
#endif
@@ -532,24 +556,6 @@ glob (pattern, flags, errfunc, pglob)
}
}
- if (!(flags & GLOB_APPEND))
- {
- pglob->gl_pathc = 0;
- if (!(flags & GLOB_DOOFFS))
- pglob->gl_pathv = NULL;
- else
- {
- size_t i;
- pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
- * sizeof (char *));
- if (pglob->gl_pathv == NULL)
- return GLOB_NOSPACE;
-
- for (i = 0; i <= pglob->gl_offs; ++i)
- pglob->gl_pathv[i] = NULL;
- }
- }
-
oldcount = pglob->gl_pathc + pglob->gl_offs;
#ifndef VMS
@@ -567,7 +573,7 @@ glob (pattern, flags, errfunc, pglob)
# else
# ifdef WINDOWS32
if (home_dir == NULL || home_dir[0] == '\0')
- home_dir = "c:/users/default"; /* poor default */
+ home_dir = "c:/users/default"; /* poor default */
# else
# if ! _LIBC || __OPTION_EGLIBC_GETLOGIN
if (home_dir == NULL || home_dir[0] == '\0')
diff --git a/libc/posix/tst-gnuglob.c b/libc/posix/tst-gnuglob.c
index 95bfbae64..d4539bddb 100644
--- a/libc/posix/tst-gnuglob.c
+++ b/libc/posix/tst-gnuglob.c
@@ -1,6 +1,6 @@
/* Test the GNU extensions in glob which allow the user to provide callbacks
for the filesystem access functions.
- Copyright (C) 2001-2002, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -61,9 +61,9 @@ static struct
{ "..", 3, DT_DIR },
{ ".foo", 3, DT_REG },
{ "dir1lev3", 3, DT_DIR },
- { ".", 4, DT_DIR },
- { "..", 4, DT_DIR },
- { "file1lev4", 4, DT_REG },
+ { ".", 4, DT_DIR },
+ { "..", 4, DT_DIR },
+ { "file1lev4", 4, DT_REG },
{ "file1lev3", 3, DT_REG },
{ "file2lev3", 3, DT_REG },
{ "file2lev2", 2, DT_REG },
@@ -81,9 +81,9 @@ static struct
{ "..", 3, DT_DIR },
{ ".foo", 3, DT_REG },
{ ".dir", 3, DT_DIR },
- { ".", 4, DT_DIR },
- { "..", 4, DT_DIR },
- { "hidden", 4, DT_REG }
+ { ".", 4, DT_DIR },
+ { "..", 4, DT_DIR },
+ { "hidden", 4, DT_REG }
};
#define nfiles (sizeof (filesystem) / sizeof (filesystem[0]))
@@ -283,7 +283,7 @@ static const char *glob_errstring[] =
static const char *
flagstr (int flags)
{
- const char *strs[] =
+ static const char *const strs[] =
{
"GLOB_ERR", "GLOB_MARK", "GLOB_NOSORT", "GLOB_DOOFSS", "GLOB_NOCHECK",
"GLOB_APPEND", "GLOB_NOESCAPE", "GLOB_PERIOD", "GLOB_MAGCHAR",
@@ -312,6 +312,29 @@ flagstr (int flags)
}
return buf;
+#undef nstrs
+}
+
+
+static const char *
+errstr (int val)
+{
+ static const char *const strs[] =
+ {
+ [GLOB_NOSPACE] = "GLOB_NOSPACE",
+ [GLOB_ABORTED] = "GLOB_ABORTED",
+ [GLOB_NOMATCH] = "GLOB_NOMATCH",
+ [GLOB_NOSYS] = "GLOB_NOSYS"
+ };
+#define nstrs (sizeof (strs) / sizeof (strs[0]))
+ static char buf[100];
+ if (val < 0 || val >= nstrs || strs[val] == NULL)
+ {
+ snprintf (buf, sizeof (buf), "GLOB_??? (%d)", val);
+ return buf;
+ }
+ return strs[val];
+#undef nstrs
}
@@ -376,28 +399,34 @@ main (void)
gl.gl_lstat = my_stat;
gl.gl_stat = my_stat;
-#define test(a, b, c...) \
+#define test(a, b, r, c...) \
fmt = a; \
- flags = b; \
+ flags = GLOB_ALTDIRFUNC | b; \
errval = glob (fmt, flags, NULL, &gl); \
- if (errval != 0) \
+ if (errval != r) \
{ \
- printf ("glob (\"%s\", %s) failed: %s\n", fmt, flagstr (flags), \
- errval >= 0 && errval < nglob_errstring \
- ? glob_errstring[errval] : "???"); \
+ if (r == 0) \
+ printf ("glob (\"%s\", %s) failed: %s\n", fmt, flagstr (flags), \
+ errval >= 0 && errval < nglob_errstring \
+ ? glob_errstring[errval] : "???"); \
+ else \
+ printf ("glob (\"%s\", %s) did not fail\n", fmt, flagstr (flags)); \
result = 1; \
} \
+ else if (r == 0) \
+ result |= test_result (fmt, flags, &gl, (const char *[]) { c, NULL }); \
else \
- result |= test_result (fmt, flags, &gl, (const char *[]) { c, NULL })
+ printf ("result for glob (\"%s\", %s) = %s\n\n", fmt, flagstr (flags), \
+ errstr (errval))
- test ("*/*/*", GLOB_ALTDIRFUNC,
+ test ("*/*/*", 0, 0,
"dir1lev1/dir2lev2/dir1lev3",
"dir1lev1/dir2lev2/file1lev3",
"dir1lev1/dir2lev2/file2lev3",
"dir1lev1/dir3lev2/file3lev3",
"dir1lev1/dir3lev2/file4lev3");
- test ("*/*/*", GLOB_ALTDIRFUNC | GLOB_PERIOD,
+ test ("*/*/*", GLOB_PERIOD, 0,
"dir1lev1/dir1lev2/.",
"dir1lev1/dir1lev2/..",
"dir1lev1/dir2lev2/.",
@@ -415,7 +444,7 @@ main (void)
"dir2lev1/dir1lev2/.dir",
"dir2lev1/dir1lev2/.foo");
- test ("*/*/.*", GLOB_ALTDIRFUNC,
+ test ("*/*/.*", 0, 0,
"dir1lev1/dir1lev2/.",
"dir1lev1/dir1lev2/..",
"dir1lev1/dir2lev2/.",
@@ -428,7 +457,7 @@ main (void)
"dir2lev1/dir1lev2/.dir",
"dir2lev1/dir1lev2/.foo");
- test ("*1*/*2*/.*", GLOB_ALTDIRFUNC,
+ test ("*1*/*2*/.*", 0, 0,
"dir1lev1/dir1lev2/.",
"dir1lev1/dir1lev2/..",
"dir1lev1/dir2lev2/.",
@@ -441,7 +470,7 @@ main (void)
"dir2lev1/dir1lev2/.dir",
"dir2lev1/dir1lev2/.foo");
- test ("*1*/*1*/.*", GLOB_ALTDIRFUNC,
+ test ("*1*/*1*/.*", 0, 0,
"dir1lev1/dir1lev2/.",
"dir1lev1/dir1lev2/..",
"dir2lev1/dir1lev2/.",
@@ -449,12 +478,16 @@ main (void)
"dir2lev1/dir1lev2/.dir",
"dir2lev1/dir1lev2/.foo");
- test ("\\/*", GLOB_ALTDIRFUNC,
+ test ("\\/*", 0, 0,
"/dir1lev1",
"/dir2lev1",
"/file1lev1",
"/file2lev1");
+ test ("", 0, GLOB_NOMATCH, NULL);
+
+ test ("", GLOB_NOCHECK, 0, "");
+
globfree (&gl);
return result;
diff --git a/libc/resolv/res_send.c b/libc/resolv/res_send.c
index b0966ae03..845b658e3 100644
--- a/libc/resolv/res_send.c
+++ b/libc/resolv/res_send.c
@@ -535,7 +535,10 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
Dprint(statp->options & RES_DEBUG,
(stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntop(AF_INET6, &nsap->sin6_addr,
+ ns + 1, inet_ntop(nsap->sin6_family,
+ (nsap->sin6_family == AF_INET6
+ ? &nsap->sin6_addr
+ : &((struct sockaddr_in *) nsap)->sin_addr),
tmpbuf, sizeof (tmpbuf))));
if (__builtin_expect (v_circuit, 0)) {
@@ -1201,7 +1204,7 @@ send_dg(res_state statp,
DprintQ((statp->options & RES_DEBUG) ||
(statp->pfcode & RES_PRF_REPLY),
(stdout, ";; old answer:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
goto wait;
@@ -1216,7 +1219,7 @@ send_dg(res_state statp,
DprintQ((statp->options & RES_DEBUG) ||
(statp->pfcode & RES_PRF_REPLY),
(stdout, ";; not our server:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
goto wait;
@@ -1233,7 +1236,7 @@ send_dg(res_state statp,
DprintQ(statp->options & RES_DEBUG,
(stdout,
"server rejected query with EDNS0:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
/* record the error */
@@ -1258,7 +1261,7 @@ send_dg(res_state statp,
DprintQ((statp->options & RES_DEBUG) ||
(statp->pfcode & RES_PRF_REPLY),
(stdout, ";; wrong query name:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
goto wait;
@@ -1268,7 +1271,7 @@ send_dg(res_state statp,
anhp->rcode == REFUSED) {
DprintQ(statp->options & RES_DEBUG,
(stdout, "server rejected query:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
@@ -1295,7 +1298,7 @@ send_dg(res_state statp,
&& anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) {
DprintQ(statp->options & RES_DEBUG,
(stdout, "referred query:\n"),
- thisansp,
+ *thisansp,
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
goto next_ns;
diff --git a/libc/scripts/gen-libc-abis b/libc/scripts/gen-libc-abis
new file mode 100644
index 000000000..ce9ac5e20
--- /dev/null
+++ b/libc/scripts/gen-libc-abis
@@ -0,0 +1,26 @@
+#! /bin/sh
+triple="$1"
+
+printf "#ifndef _LIBC_ABIS_H\n#define _LIBC_ABIS_H 1\n\n"
+printf "enum\n{\n LIBC_ABI_DEFAULT = 0,\n"
+
+while read s t; do
+ if test "$s" = "#" || test -z "$s"; then continue; fi
+ if test -z "$t"; then
+ printf " LIBC_ABI_%s,\n" "$s"
+ features="$features $s"
+ else
+ case "$triple" in
+ $t) printf " LIBC_ABI_%s,\n" "$s"
+ features="$features $s" ;;
+ *) ;;
+ esac
+ fi
+done
+
+printf " LIBC_ABI_MAX\n};\n"
+printf "\n#endif\n"
+
+if test -n "$features"; then
+ printf "#define LIBC_ABIS_STRING \"libc ABIs:%s\\\\n\"\n" "$features"
+fi
diff --git a/libc/stdio-common/psiginfo.c b/libc/stdio-common/psiginfo.c
index e089fcaa4..90cdf0590 100644
--- a/libc/stdio-common/psiginfo.c
+++ b/libc/stdio-common/psiginfo.c
@@ -170,7 +170,7 @@ Signal generated by the completion of an I/O request");
fprintf (fp, "%ld %d %ld)", (long int) pinfo->si_pid, pinfo->si_status,
(long int) pinfo->si_uid);
else if (pinfo->si_signo == SIGPOLL)
- fprintf (fp, "%ld)", pinfo->si_band);
+ fprintf (fp, "%ld)", (long int) pinfo->si_band);
else
fprintf (fp, "%ld %ld)",
(long int) pinfo->si_pid, (long int) pinfo->si_uid);
diff --git a/libc/string/test-memcmp.c b/libc/string/test-memcmp.c
index af07a5e59..3040e212a 100644
--- a/libc/string/test-memcmp.c
+++ b/libc/string/test-memcmp.c
@@ -37,9 +37,9 @@ simple_memcmp (const char *s1, const char *s2, size_t n)
return ret;
}
-static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, size_t len,
- int exp_result)
+static int
+check_result (impl_t *impl, const char *s1, const char *s2, size_t len,
+ int exp_result)
{
int result = CALL (impl, s1, s2, len);
if ((exp_result == 0 && result != 0)
@@ -49,9 +49,19 @@ do_one_test (impl_t *impl, const char *s1, const char *s2, size_t len,
error (0, 0, "Wrong result in function %s %d %d", impl->name,
result, exp_result);
ret = 1;
- return;
+ return -1;
}
+ return 0;
+}
+
+static void
+do_one_test (impl_t *impl, const char *s1, const char *s2, size_t len,
+ int exp_result)
+{
+ if (check_result (impl, s1, s2, len, exp_result) < 0)
+ return;
+
if (HP_TIMING_AVAIL)
{
hp_timing_t start __attribute ((unused));
@@ -177,6 +187,251 @@ do_random_tests (void)
}
}
+static void
+check1 (void)
+{
+ char s1[116], s2[116];
+ int n, exp_result;
+
+ s1[0] = -108;
+ s2[0] = -108;
+ s1[1] = 99;
+ s2[1] = 99;
+ s1[2] = -113;
+ s2[2] = -113;
+ s1[3] = 1;
+ s2[3] = 1;
+ s1[4] = 116;
+ s2[4] = 116;
+ s1[5] = 99;
+ s2[5] = 99;
+ s1[6] = -113;
+ s2[6] = -113;
+ s1[7] = 1;
+ s2[7] = 1;
+ s1[8] = 84;
+ s2[8] = 84;
+ s1[9] = 99;
+ s2[9] = 99;
+ s1[10] = -113;
+ s2[10] = -113;
+ s1[11] = 1;
+ s2[11] = 1;
+ s1[12] = 52;
+ s2[12] = 52;
+ s1[13] = 99;
+ s2[13] = 99;
+ s1[14] = -113;
+ s2[14] = -113;
+ s1[15] = 1;
+ s2[15] = 1;
+ s1[16] = -76;
+ s2[16] = -76;
+ s1[17] = -14;
+ s2[17] = -14;
+ s1[18] = -109;
+ s2[18] = -109;
+ s1[19] = 1;
+ s2[19] = 1;
+ s1[20] = -108;
+ s2[20] = -108;
+ s1[21] = -14;
+ s2[21] = -14;
+ s1[22] = -109;
+ s2[22] = -109;
+ s1[23] = 1;
+ s2[23] = 1;
+ s1[24] = 84;
+ s2[24] = 84;
+ s1[25] = -15;
+ s2[25] = -15;
+ s1[26] = -109;
+ s2[26] = -109;
+ s1[27] = 1;
+ s2[27] = 1;
+ s1[28] = 52;
+ s2[28] = 52;
+ s1[29] = -15;
+ s2[29] = -15;
+ s1[30] = -109;
+ s2[30] = -109;
+ s1[31] = 1;
+ s2[31] = 1;
+ s1[32] = 20;
+ s2[32] = 20;
+ s1[33] = -15;
+ s2[33] = -15;
+ s1[34] = -109;
+ s2[34] = -109;
+ s1[35] = 1;
+ s2[35] = 1;
+ s1[36] = 20;
+ s2[36] = 20;
+ s1[37] = -14;
+ s2[37] = -14;
+ s1[38] = -109;
+ s2[38] = -109;
+ s1[39] = 1;
+ s2[39] = 1;
+ s1[40] = 52;
+ s2[40] = 52;
+ s1[41] = -14;
+ s2[41] = -14;
+ s1[42] = -109;
+ s2[42] = -109;
+ s1[43] = 1;
+ s2[43] = 1;
+ s1[44] = 84;
+ s2[44] = 84;
+ s1[45] = -14;
+ s2[45] = -14;
+ s1[46] = -109;
+ s2[46] = -109;
+ s1[47] = 1;
+ s2[47] = 1;
+ s1[48] = 116;
+ s2[48] = 116;
+ s1[49] = -14;
+ s2[49] = -14;
+ s1[50] = -109;
+ s2[50] = -109;
+ s1[51] = 1;
+ s2[51] = 1;
+ s1[52] = 116;
+ s2[52] = 116;
+ s1[53] = -15;
+ s2[53] = -15;
+ s1[54] = -109;
+ s2[54] = -109;
+ s1[55] = 1;
+ s2[55] = 1;
+ s1[56] = -44;
+ s2[56] = -44;
+ s1[57] = -14;
+ s2[57] = -14;
+ s1[58] = -109;
+ s2[58] = -109;
+ s1[59] = 1;
+ s2[59] = 1;
+ s1[60] = -108;
+ s2[60] = -108;
+ s1[61] = -15;
+ s2[61] = -15;
+ s1[62] = -109;
+ s2[62] = -109;
+ s1[63] = 1;
+ s2[63] = 1;
+ s1[64] = -76;
+ s2[64] = -76;
+ s1[65] = -15;
+ s2[65] = -15;
+ s1[66] = -109;
+ s2[66] = -109;
+ s1[67] = 1;
+ s2[67] = 1;
+ s1[68] = -44;
+ s2[68] = -44;
+ s1[69] = -15;
+ s2[69] = -15;
+ s1[70] = -109;
+ s2[70] = -109;
+ s1[71] = 1;
+ s2[71] = 1;
+ s1[72] = -12;
+ s2[72] = -12;
+ s1[73] = -15;
+ s2[73] = -15;
+ s1[74] = -109;
+ s2[74] = -109;
+ s1[75] = 1;
+ s2[75] = 1;
+ s1[76] = -12;
+ s2[76] = -12;
+ s1[77] = -14;
+ s2[77] = -14;
+ s1[78] = -109;
+ s2[78] = -109;
+ s1[79] = 1;
+ s2[79] = 1;
+ s1[80] = 20;
+ s2[80] = -68;
+ s1[81] = -12;
+ s2[81] = 64;
+ s1[82] = -109;
+ s2[82] = -106;
+ s1[83] = 1;
+ s2[83] = 1;
+ s1[84] = -12;
+ s2[84] = -12;
+ s1[85] = -13;
+ s2[85] = -13;
+ s1[86] = -109;
+ s2[86] = -109;
+ s1[87] = 1;
+ s2[87] = 1;
+ s1[88] = -44;
+ s2[88] = -44;
+ s1[89] = -13;
+ s2[89] = -13;
+ s1[90] = -109;
+ s2[90] = -109;
+ s1[91] = 1;
+ s2[91] = 1;
+ s1[92] = -76;
+ s2[92] = -76;
+ s1[93] = -13;
+ s2[93] = -13;
+ s1[94] = -109;
+ s2[94] = -109;
+ s1[95] = 1;
+ s2[95] = 1;
+ s1[96] = -108;
+ s2[96] = -108;
+ s1[97] = -13;
+ s2[97] = -13;
+ s1[98] = -109;
+ s2[98] = -109;
+ s1[99] = 1;
+ s2[99] = 1;
+ s1[100] = 116;
+ s2[100] = 116;
+ s1[101] = -13;
+ s2[101] = -13;
+ s1[102] = -109;
+ s2[102] = -109;
+ s1[103] = 1;
+ s2[103] = 1;
+ s1[104] = 84;
+ s2[104] = 84;
+ s1[105] = -13;
+ s2[105] = -13;
+ s1[106] = -109;
+ s2[106] = -109;
+ s1[107] = 1;
+ s2[107] = 1;
+ s1[108] = 52;
+ s2[108] = 52;
+ s1[109] = -13;
+ s2[109] = -13;
+ s1[110] = -109;
+ s2[110] = -109;
+ s1[111] = 1;
+ s2[111] = 1;
+ s1[112] = 20;
+ s2[112] = 20;
+ s1[113] = -13;
+ s2[113] = -13;
+ s1[114] = -109;
+ s2[114] = -109;
+ s1[115] = 1;
+ s2[115] = 1;
+
+ n = 116;
+ exp_result = simple_memcmp (s1, s2, n);
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s1, s2, n, exp_result);
+}
+
int
test_main (void)
{
@@ -184,6 +439,8 @@ test_main (void)
test_init ();
+ check1 ();
+
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
diff --git a/libc/sysdeps/generic/ldsodefs.h b/libc/sysdeps/generic/ldsodefs.h
index f6dedc49b..ff5017e28 100644
--- a/libc/sysdeps/generic/ldsodefs.h
+++ b/libc/sysdeps/generic/ldsodefs.h
@@ -756,7 +756,7 @@ extern int _dl_starting_up_internal attribute_hidden;
#endif
/* Random data provided by the kernel. */
-extern void *_dl_random attribute_hidden;
+extern void *_dl_random attribute_hidden attribute_relro;
/* OS-dependent function to open the zero-fill device. */
extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
diff --git a/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S b/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
index d2f852f72..2e0d15fe5 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
@@ -269,6 +269,7 @@ L(shr_1_gobble_loop):
lea 32(%edi), %edi
jz L(shr_1_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_1_gobble_next)
@@ -352,6 +353,7 @@ L(shr_2_gobble_loop):
lea 32(%edi), %edi
jz L(shr_2_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_2_gobble_next)
@@ -434,6 +436,7 @@ L(shr_3_gobble_loop):
lea 32(%edi), %edi
jz L(shr_3_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_3_gobble_next)
@@ -516,6 +519,7 @@ L(shr_4_gobble_loop):
lea 32(%edi), %edi
jz L(shr_4_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_4_gobble_next)
@@ -598,6 +602,7 @@ L(shr_5_gobble_loop):
lea 32(%edi), %edi
jz L(shr_5_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_5_gobble_next)
@@ -680,6 +685,7 @@ L(shr_6_gobble_loop):
lea 32(%edi), %edi
jz L(shr_6_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_6_gobble_next)
@@ -762,6 +768,7 @@ L(shr_7_gobble_loop):
lea 32(%edi), %edi
jz L(shr_7_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_7_gobble_next)
@@ -844,6 +851,7 @@ L(shr_8_gobble_loop):
lea 32(%edi), %edi
jz L(shr_8_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_8_gobble_next)
@@ -926,6 +934,7 @@ L(shr_9_gobble_loop):
lea 32(%edi), %edi
jz L(shr_9_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_9_gobble_next)
@@ -1008,6 +1017,7 @@ L(shr_10_gobble_loop):
lea 32(%edi), %edi
jz L(shr_10_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_10_gobble_next)
@@ -1090,6 +1100,7 @@ L(shr_11_gobble_loop):
lea 32(%edi), %edi
jz L(shr_11_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_11_gobble_next)
@@ -1172,6 +1183,7 @@ L(shr_12_gobble_loop):
lea 32(%edi), %edi
jz L(shr_12_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_12_gobble_next)
@@ -1254,6 +1266,7 @@ L(shr_13_gobble_loop):
lea 32(%edi), %edi
jz L(shr_13_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_13_gobble_next)
@@ -1336,6 +1349,7 @@ L(shr_14_gobble_loop):
lea 32(%edi), %edi
jz L(shr_14_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_14_gobble_next)
@@ -1418,6 +1432,7 @@ L(shr_15_gobble_loop):
lea 32(%edi), %edi
jz L(shr_15_gobble_loop)
+ pand %xmm0, %xmm3
cmp $0, %ecx
jge L(shr_15_gobble_next)
diff --git a/libc/sysdeps/posix/cuserid.c b/libc/sysdeps/posix/cuserid.c
index 11c827a68..a74ff8436 100644
--- a/libc/sysdeps/posix/cuserid.c
+++ b/libc/sysdeps/posix/cuserid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1998, 1999, 2001, 2010 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,5 +44,6 @@ cuserid (s)
if (s == NULL)
s = name;
- return strncpy (s, pwptr->pw_name, L_cuserid);
+ s[L_cuserid - 1] = '\0';
+ return strncpy (s, pwptr->pw_name, L_cuserid - 1);
}
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index 62c38f69b..2e0c7248f 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -702,6 +702,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
while (!no_more)
{
+ no_data = 0;
nss_gethostbyname4_r fct4
= __nss_lookup_function (nip, "gethostbyname4_r");
if (fct4 != NULL)
@@ -816,17 +817,18 @@ gaih_inet (const char *name, const struct gaih_service *service,
canon = name;
}
}
-
- break;
+ status = NSS_STATUS_SUCCESS;
+ }
+ else
+ {
+ /* We can have different states for AF_INET and
+ AF_INET6. Try to find a useful one for both. */
+ if (inet6_status == NSS_STATUS_TRYAGAIN)
+ status = NSS_STATUS_TRYAGAIN;
+ else if (status == NSS_STATUS_UNAVAIL
+ && inet6_status != NSS_STATUS_UNAVAIL)
+ status = inet6_status;
}
-
- /* We can have different states for AF_INET and
- AF_INET6. Try to find a useful one for both. */
- if (inet6_status == NSS_STATUS_TRYAGAIN)
- status = NSS_STATUS_TRYAGAIN;
- else if (status == NSS_STATUS_UNAVAIL
- && inet6_status != NSS_STATUS_UNAVAIL)
- status = inet6_status;
}
else
status = NSS_STATUS_UNAVAIL;
diff --git a/libc/sysdeps/unix/getlogin.c b/libc/sysdeps/unix/getlogin.c
index 4752685f8..b0ad97cfa 100644
--- a/libc/sysdeps/unix/getlogin.c
+++ b/libc/sysdeps/unix/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 2010 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,16 +25,20 @@
#include <utmp.h>
+static char name[UT_NAMESIZE + 1];
+
/* Return the login name of the user, or NULL if it can't be determined.
The returned pointer, if not NULL, is good only until the next call. */
+#ifdef STATIC
+STATIC
+#endif
char *
getlogin (void)
{
char tty_pathname[2 + 2 * NAME_MAX];
char *real_tty_path = tty_pathname;
char *result = NULL;
- static char name[UT_NAMESIZE + 1];
struct utmp *ut, line, buffer;
/* Get name of tty connected to fd 0. Return NULL if not a tty or
diff --git a/libc/sysdeps/unix/getlogin_r.c b/libc/sysdeps/unix/getlogin_r.c
index ba7badd05..bf3c889e1 100644
--- a/libc/sysdeps/unix/getlogin_r.c
+++ b/libc/sysdeps/unix/getlogin_r.c
@@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Unix version.
- Copyright (C) 1991,92,96,97,98,2002 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,96,97,98,2002,2010 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
@@ -31,6 +31,9 @@
If it cannot be determined or some other error occurred, return the error
code. Otherwise return 0. */
+#ifdef STATIC
+STATIC
+#endif
int
getlogin_r (name, name_len)
char *name;
@@ -96,4 +99,6 @@ getlogin_r (name, name_len)
return result;
}
+#ifndef STATIC
libc_hidden_def (getlogin_r)
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/clock_getres.c b/libc/sysdeps/unix/sysv/linux/clock_getres.c
index 581ff22c7..933580b60 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_getres.c
@@ -1,5 +1,5 @@
/* clock_getres -- Get the resolution of a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003,2004,2005,2006,2008,2010 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,6 +44,9 @@
SYSDEP_GETRES_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
+ case CLOCK_MONOTONIC_RAW: \
+ case CLOCK_REALTIME_COARSE: \
+ case CLOCK_MONOTONIC_COARSE: \
SYSCALL_GETRES
# define __libc_missing_posix_timers 0
@@ -80,6 +83,9 @@ maybe_syscall_getres (clockid_t clock_id, struct timespec *res)
SYSDEP_GETRES_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
+ case CLOCK_MONOTONIC_RAW: \
+ case CLOCK_REALTIME_COARSE: \
+ case CLOCK_MONOTONIC_COARSE: \
retval = maybe_syscall_getres (clock_id, res); \
if (retval == 0) \
break; \
diff --git a/libc/sysdeps/unix/sysv/linux/clock_gettime.c b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
index cd536a0fc..dd3755cce 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 2003,2004,2005,2006,2007,2010 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
@@ -80,6 +80,9 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
SYSDEP_GETTIME_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
+ case CLOCK_MONOTONIC_RAW: \
+ case CLOCK_REALTIME_COARSE: \
+ case CLOCK_MONOTONIC_COARSE: \
retval = maybe_syscall_gettime (clock_id, tp); \
if (retval == 0) \
break; \
diff --git a/libc/sysdeps/unix/sysv/linux/clock_settime.c b/libc/sysdeps/unix/sysv/linux/clock_settime.c
index 217ae3f29..8c52456fd 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_settime.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2010 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
@@ -45,7 +45,7 @@ maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
INTERNAL_SYSCALL_DECL (err);
int r = INTERNAL_SYSCALL (clock_settime, err, 2, clock_id, tp);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
+ return 0;
e = INTERNAL_SYSCALL_ERRNO (r, err);
# ifndef __ASSUME_POSIX_TIMERS
@@ -90,6 +90,7 @@ extern int __libc_missing_posix_timers attribute_hidden;
/* The REALTIME clock might be available. Try the syscall first. */
# define SYSDEP_SETTIME \
case CLOCK_REALTIME: \
+ case CLOCK_REALTIME_COARSE: \
{ \
int e = EINVAL; \
\
diff --git a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
index 08ae9aa86..34e880892 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -47,12 +47,12 @@ frob_brk (void)
Later Linux kernels have changed this behavior so that the initial
break value is rounded up to the page boundary before we start. */
- extern void *__curbrk attribute_hidden;
- extern void _end attribute_hidden;
- void *const endpage = (void *) 0 + (((__curbrk - (void *) 0)
+ extern char *__curbrk attribute_hidden;
+ extern char _end[] attribute_hidden;
+ char *const endpage = (void *) 0 + (((__curbrk - (char *) 0)
+ GLRO(dl_pagesize) - 1)
& -GLRO(dl_pagesize));
- if (__builtin_expect (__curbrk >= &_end && __curbrk < endpage, 0))
+ if (__builtin_expect (__curbrk >= _end && __curbrk < endpage, 0))
__brk (endpage);
#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/getlogin.c b/libc/sysdeps/unix/sysv/linux/getlogin.c
new file mode 100644
index 000000000..4d15db093
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/getlogin.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2010 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, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <pwd.h>
+#include <unistd.h>
+#include <not-cancel.h>
+
+#define STATIC static
+#define getlogin getlogin_fd0
+#include <sysdeps/unix/getlogin.c>
+#undef getlogin
+
+
+/* Return the login name of the user, or NULL if it can't be determined.
+ The returned pointer, if not NULL, is good only until the next call. */
+
+char *
+getlogin (void)
+{
+ if (__getlogin_r_loginuid (name, sizeof (name)) == 0)
+ return name;
+
+ return getlogin_fd0 ();
+}
diff --git a/libc/sysdeps/unix/sysv/linux/getlogin_r.c b/libc/sysdeps/unix/sysv/linux/getlogin_r.c
new file mode 100644
index 000000000..d07846ccb
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/getlogin_r.c
@@ -0,0 +1,100 @@
+/* Copyright (C) 2010 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, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <pwd.h>
+#include <unistd.h>
+#include <not-cancel.h>
+
+#define STATIC static
+static int getlogin_r_fd0 (char *name, size_t namesize);
+#define getlogin_r getlogin_r_fd0
+#include <sysdeps/unix/getlogin_r.c>
+#undef getlogin_r
+
+
+int
+attribute_hidden
+__getlogin_r_loginuid (name, namesize)
+ char *name;
+ size_t namesize;
+{
+ int fd = open_not_cancel_2 ("/proc/self/loginuid", O_RDONLY);
+ if (fd == -1)
+ return 1;
+
+ ssize_t n = TEMP_FAILURE_RETRY (read_not_cancel (fd, name, namesize));
+ close_not_cancel_no_status (fd);
+
+ uid_t uid;
+ char *endp;
+ if (n <= 0
+ || (uid = strtoul (name, &endp, 10), endp == name || *endp != '\0'))
+ return 1;
+
+ size_t buflen = 1024;
+ char *buf = alloca (buflen);
+ bool use_malloc = false;
+ struct passwd pwd;
+ struct passwd *tpwd;
+ int res;
+
+ while ((res = __getpwuid_r (uid, &pwd, buf, buflen, &tpwd)) != 0)
+ if (__libc_use_alloca (2 * buflen))
+ extend_alloca (buf, buflen, 2 * buflen);
+ else
+ {
+ buflen *= 2;
+ char *newp = realloc (use_malloc ? buf : NULL, buflen);
+ if (newp == NULL)
+ {
+ fail:
+ if (use_malloc)
+ free (buf);
+ return 1;
+ }
+ buf = newp;
+ use_malloc = true;
+ }
+
+ if (tpwd == NULL)
+ goto fail;
+
+ strncpy (name, pwd.pw_name, namesize - 1);
+ name[namesize - 1] = '\0';
+
+ if (use_malloc)
+ free (buf);
+
+ return 0;
+}
+
+
+/* Return the login name of the user, or NULL if it can't be determined.
+ The returned pointer, if not NULL, is good only until the next call. */
+
+int
+getlogin_r (name, namesize)
+ char *name;
+ size_t namesize;
+{
+ if (__getlogin_r_loginuid (name, namesize) == 0)
+ return 0;
+
+ return getlogin_r_fd0 (name, namesize);
+}
+libc_hidden_def (getlogin_r)
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index 0965f1496..5d5b1b4c0 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 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#ifndef _LDSODEFS_H
+#include <libc-abis.h>
#include <kernel-features.h>
/* Get the real definitions. */
@@ -58,7 +59,8 @@ extern void _dl_non_dynamic_init (void) internal_function;
|| memcmp (hdr, expected2, size) == 0)
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
|| osabi == ELFOSABI_LINUX)
-#define VALID_ELF_ABIVERSION(ver) (ver == 0)
+#define VALID_ELF_ABIVERSION(osabi,ver) \
+ (ver == 0 || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX))
#define MORE_ELF_HEADER_DATA \
static const unsigned char expected2[EI_PAD] = \
{ \
@@ -69,8 +71,7 @@ extern void _dl_non_dynamic_init (void) internal_function;
[EI_CLASS] = ELFW(CLASS), \
[EI_DATA] = byteorder, \
[EI_VERSION] = EV_CURRENT, \
- [EI_OSABI] = ELFOSABI_LINUX, \
- [EI_ABIVERSION] = 0 \
+ [EI_OSABI] = ELFOSABI_LINUX \
}
#endif /* ldsodefs.h */
diff --git a/libc/sysdeps/unix/sysv/linux/mmap64.c b/libc/sysdeps/unix/sysv/linux/mmap64.c
index d3c68cd10..85c801d50 100644
--- a/libc/sysdeps/unix/sysv/linux/mmap64.c
+++ b/libc/sysdeps/unix/sysv/linux/mmap64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2000,2001,2002,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2000,2001,2002,2006,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -30,8 +30,13 @@
#ifdef __NR_mmap2
/* This is always 12, even on architectures where PAGE_SHIFT != 12. */
-# ifndef MMAP2_PAGE_SHIFT
-# define MMAP2_PAGE_SHIFT 12
+# if MMAP2_PAGE_SHIFT == -1
+static int page_shift;
+# else
+# ifndef MMAP2_PAGE_SHIFT
+# define MMAP2_PAGE_SHIFT 12
+# endif
+# define page_shift MMAP2_PAGE_SHIFT
# endif
# ifndef __ASSUME_MMAP2_SYSCALL
@@ -44,7 +49,15 @@ void *
__mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
{
#ifdef __NR_mmap2
- if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
+# ifdef MMAP2_PAGE_SHIFT == -1
+ if (page_shift == 0)
+ {
+ int page_size = getpagesize ();
+ while ((1 << ++page_shift) != page_size)
+ ;
+ }
+# endif
+ if (offset & ((1 << page_shift) - 1))
{
__set_errno (EINVAL);
return MAP_FAILED;
diff --git a/libc/sysdeps/x86_64/multiarch/strpbrk-c.c b/libc/sysdeps/x86_64/multiarch/strpbrk-c.c
index c58dcb560..bbf5c49d8 100644
--- a/libc/sysdeps/x86_64/multiarch/strpbrk-c.c
+++ b/libc/sysdeps/x86_64/multiarch/strpbrk-c.c
@@ -1,4 +1,8 @@
-#define USE_AS_STRPBRK
-#define STRCSPN_SSE2 __strpbrk_sse2
-#define STRCSPN_SSE42 __strpbrk_sse42
-#include "strcspn-c.c"
+/* Don't define multiple versions for strpbrk in static library since we
+ need strpbrk before the initialization happened. */
+#ifdef SHARED
+# define USE_AS_STRPBRK
+# define STRCSPN_SSE2 __strpbrk_sse2
+# define STRCSPN_SSE42 __strpbrk_sse42
+# include "strcspn-c.c"
+#endif
diff --git a/libc/wcsmbs/wchar.h b/libc/wcsmbs/wchar.h
index 7a659116c..5a4e10e54 100644
--- a/libc/wcsmbs/wchar.h
+++ b/libc/wcsmbs/wchar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2008, 2009, 2010 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
@@ -51,11 +51,6 @@
# define __need_wint_t
# include <stddef.h>
-/* Tell the caller that we provide correct C++ prototypes. */
-#if defined __cplusplus && __GNUC_PREREQ (4, 4)
-# define __CORRECT_ISO_CPP_WCHAR_H_PROTO
-#endif
-
/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
there. So define it ourselves if it remains undefined. */
# ifndef _WINT_T
@@ -75,6 +70,11 @@ typedef __WINT_TYPE__ wint_t;
__END_NAMESPACE_STD
# endif
# endif
+
+/* Tell the caller that we provide correct C++ prototypes. */
+# if defined __cplusplus && __GNUC_PREREQ (4, 4)
+# define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+# endif
#endif
#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined __mbstate_t_defined
@@ -219,7 +219,7 @@ __BEGIN_NAMESPACE_STD
extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
__THROW __asm ("wcschr") __attribute_pure__;
extern "C++" __const wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
- __THROW __asm ("wcschr") __attribute_pure__;
+ __THROW __asm ("wcschr") __attribute_pure__;
#else
extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
__THROW __attribute_pure__;
@@ -892,7 +892,7 @@ __END_DECLS
#endif /* wchar.h */
-/* Undefined all __need_* constants in case we are included to get those
+/* Undefine all __need_* constants in case we are included to get those
constants but the whole file was already read. */
#undef __need_mbstate_t
#undef __need_wint_t
diff --git a/libc/wctype/wctype.h b/libc/wctype/wctype.h
index 9b29af563..1e2fbf9fa 100644
--- a/libc/wctype/wctype.h
+++ b/libc/wctype/wctype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2002,2005,2007,2008,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002,2005,2007-2009,2010 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
@@ -29,9 +29,9 @@
#ifndef __need_iswxxx
# define _WCTYPE_H 1
-/* Get wint_t from <stddef.h>. */
+/* Get wint_t from <wchar.h>. */
# define __need_wint_t
-# include <stddef.h>
+# include <wchar.h>
/* Constant expression of type `wint_t' whose value does not correspond
to any member of the extended character set. */
@@ -204,7 +204,7 @@ __END_DECLS
/* The remaining definitions and declarations must not appear in the
- <wcsmbs.h> header. */
+ <wchar.h> header. */
#ifdef _WCTYPE_H
/*