summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--ports/ChangeLog.alpha64
-rw-r--r--ports/ChangeLog.arm50
-rw-r--r--ports/ChangeLog.mips14
-rw-r--r--ports/sysdeps/alpha/bits/atomic.h14
-rw-r--r--ports/sysdeps/alpha/elf/configure8
-rw-r--r--ports/sysdeps/alpha/elf/configure.in8
-rw-r--r--ports/sysdeps/alpha/fpu/fegetenv.c3
-rw-r--r--ports/sysdeps/arm/configure33
-rw-r--r--ports/sysdeps/arm/configure.in20
-rw-r--r--ports/sysdeps/arm/dl-trampoline.S4
-rw-r--r--ports/sysdeps/arm/eabi/__longjmp.S16
-rw-r--r--ports/sysdeps/arm/eabi/arm-mcount.S28
-rw-r--r--ports/sysdeps/arm/memcpy.S32
-rw-r--r--ports/sysdeps/arm/memmove.S34
-rw-r--r--ports/sysdeps/arm/sysdep.h17
-rw-r--r--ports/sysdeps/mips/bits/atomic.h52
-rw-r--r--ports/sysdeps/mips/dl-lookup.c54
-rw-r--r--ports/sysdeps/unix/alpha/sysdep.h22
-rw-r--r--ports/sysdeps/unix/arm/sysdep.S7
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/Versions4
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S139
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h21
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h429
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/creat.c8
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h2
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/sys/user.h4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/clone.S10
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S10
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S15
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h155
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c17
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c17
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S59
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/syscall.S12
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h7
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/mmap.S14
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/sysdep.h64
101 files changed, 2466 insertions, 325 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
/*
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index e41c20288..ded299ee4 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,67 @@
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S: New.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/Versions: Update errlist-compat
+ for GLIBC_2.12.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/fpu/fegetenv.c: Add hidden alias.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/dl-auxv.h (__libc_alpha_cache_shape):
+ Define extern here; move definition...
+ * sysdeps/unix/sysv/linux/alpha/dl-sysdep.c: ... here.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/sys/user.h: Don't include asm/page.h.
+ (PAGE_SHIFT, PAGE_SIZE, PAGE_MASK): Define.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (F_SETOWN_EX,
+ F_GETOWN_EX, F_OWNER_TID, F_OWNER_PID, F_OWNER_PGRP,
+ F_OWNER_GID, struct f_owner_ex): Define.
+ (F_SETOWN, F_GETOWN): Define with XPG7.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): Define for !PIC too.
+ (PTR_DEMANGLE): Likewise.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/alpha/sysdep.h (INTERNAL_SYSCALL_ERROR_P,
+ INTERNAL_SYSCALL_ERRNO): "Use" the "other" variable in each macro.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdep/unix/sysv/linux/alpha/creat.c: New.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdep/alpha/elf/configure.in (libc_cv_alpha_hidden_gprel)
+ Adjust the test for gcc 4.5.
+ * sysdep/alpha/elf/configure: Rebuild.
+
+2010-03-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/bits/atomic.h (__arch_exchange_8_int,
+ __arch_exchange_16_int, __arch_exchange_32_int,
+ __arch_exchange_64_int, __arch_exchange_and_add_32_int,
+ __arch_exchange_and_add_64_int): Use __typeof to get the
+ return type correct without warning.
+
+2010-03-23 Matt Turner <mattst88@gmail.com>
+ Aurelien Jarno <aurelien@aurel32.net>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/socket.h: New file.
+
2010-01-12 Matt Turner <mattst88@gmail.com>
* sysdeps/unix/sysv/linux/alpha/bits/stat.h: Fix double-inclusion
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index fbd173ea8..aa8f2d777 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,53 @@
+2010-03-26 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/arm/configure.in: New file.
+ * sysdeps/arm/configure: Generate.
+ * sysdeps/arm/sysdep.h (ENTRY, END): Add CFI statements.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
+ (PSEUDO, DOCARGS_0, RESTORE_LR_0, DOCARGS_1, UNDOCARGS_1, DOCARGS_2)
+ (UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3, DOCARGS_4, UNDOCARGS_4)
+ (DOCARGS_5, UNDOCARGS_5, RESTORE_LR_5, DOCARGS_6, UNDOCARGS_6):
+ Likewise.
+ [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
+ * sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (DO_CALL): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h
+ (POP_PC, SYSCALL_ERROR_HANDLER (__local_syscall_error))
+ (DOARGS_5, UNDOARGS_5, DOARGS_6, UNDOARGS_6, DOARGS_7, UNDOARGS_7):
+ Likewise.
+ * sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+ (__default_sa_restorer_v1, __default_sa_restorer_v2)
+ (__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2): Add END
+ statements.
+ * sysdeps/unix/sysv/linux/arm/eabi/syscall.S (syscall): Add CFI
+ statements.
+ * sysdeps/arm/memcpy.S (memcpy): Add CFI statements.
+ * sysdeps/arm/memmove.S (memmove): Likewise.
+ * sysdeps/unix/sysv/linux/arm/eabi/mmap64.S (__mmap64): Add CFI
+ statements.
+ * sysdeps/unix/sysv/linux/arm/mmap.S (__mmap): Likewise.
+ * sysdeps/arm/eabi/arm-mcount.S (__gnu_mcount_nc, _mcount): Add CFI
+ statements.
+ * sysdeps/arm/sysdep.h (CALL_MCOUNT): Likewise.
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+ (_Unwind_Resume): Add CFI statements.
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+ (_Unwind_Resume): Likewise.
+ * sysdeps/arm/dl-trampoline.S (_dl_runtime_resolve)
+ (_dl_runtime_profile) <CFI>: Only emit .debug_frame.
+ * sysdeps/arm/eabi/__longjmp.S (__longjmp): Add CFI statements.
+ * sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S (CALL_FAIL)
+ (CHECK_SP): Likewise
+ * sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S (SAVE_PID): Add CFI
+ statements.
+ * sysdeps/unix/sysv/linux/arm/nptl/vfork.S (SAVE_PID): Likewise.
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Add CFI statements.
+ * sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S (cfi_startproc):
+ Redefine for signal frames.
+ (__default_sa_restorer_v1, __default_sa_restorer_v2)
+ (__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2): Add CFI
+ statements.
+
2010-02-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/arm/eabi/fegetenv.c, sysdeps/arm/fpu/fegetenv.c: Add
diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index c2609b07e..272b2f30c 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,17 @@
+2010-03-24 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/dl-lookup.c: Update from generic version.
+
+2010-03-23 Mischa Jonker <mischa.jonker@viragelogic.com>
+
+ [BZ #11291]
+ * sysdeps/mips/bits/atomic.h
+ (__arch_compare_and_exchange_xxx_32_int,
+ __arch_compare_and_exchange_xxx_64_int,
+ __arch_exchange_xxx_32_int, __arch_exchange_xxx_64_int,
+ __arch_exchange_and_add_32_int, __arch_exchange_and_add_64_int):
+ Specify *mem as asm output as well as input.
+
2010-02-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/fpu/fegetenv.c: Add hidden alias.
diff --git a/ports/sysdeps/alpha/bits/atomic.h b/ports/sysdeps/alpha/bits/atomic.h
index 36a740c75..602fde3ff 100644
--- a/ports/sysdeps/alpha/bits/atomic.h
+++ b/ports/sysdeps/alpha/bits/atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -221,7 +221,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_8_int(mem, value, mb1, mb2) \
({ \
- unsigned long __ret, __tmp, __addr64, __sval; \
+ unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
" andnot %[__addr8],7,%[__addr64]\n" \
@@ -244,7 +244,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_16_int(mem, value, mb1, mb2) \
({ \
- unsigned long __ret, __tmp, __addr64, __sval; \
+ unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
" andnot %[__addr16],7,%[__addr64]\n" \
@@ -267,7 +267,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_32_int(mem, value, mb1, mb2) \
({ \
- signed int __ret, __tmp; \
+ signed int __tmp; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
"1: ldl_l %[__ret],%[__mem]\n" \
@@ -284,7 +284,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_64_int(mem, value, mb1, mb2) \
({ \
- unsigned long __ret, __tmp; \
+ unsigned long __tmp; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
"1: ldq_l %[__ret],%[__mem]\n" \
@@ -316,7 +316,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_and_add_32_int(mem, value, mb1, mb2) \
({ \
- signed int __ret, __tmp; \
+ signed int __tmp; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
"1: ldl_l %[__ret],%[__mem]\n" \
@@ -333,7 +333,7 @@ typedef uintmax_t uatomic_max_t;
#define __arch_exchange_and_add_64_int(mem, value, mb1, mb2) \
({ \
- unsigned long __ret, __tmp; \
+ unsigned long __tmp; __typeof(*mem) __ret; \
__asm__ __volatile__ ( \
mb1 \
"1: ldq_l %[__ret],%[__mem]\n" \
diff --git a/ports/sysdeps/alpha/elf/configure b/ports/sysdeps/alpha/elf/configure
index 0ee64b94b..1d594dc78 100644
--- a/ports/sysdeps/alpha/elf/configure
+++ b/ports/sysdeps/alpha/elf/configure
@@ -71,13 +71,9 @@ if test "${libc_cv_alpha_hidden_gprel+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat > conftest.c <<\EOF
-static int bar;
+static volatile int bar;
int baz __attribute__((visibility("hidden")));
-
-int foo (void)
-{
- return bar + baz;
-}
+int f(void) { return bar + baz; }
EOF
libc_cv_alpha_hidden_gprel=no
diff --git a/ports/sysdeps/alpha/elf/configure.in b/ports/sysdeps/alpha/elf/configure.in
index 798681454..3a479341e 100644
--- a/ports/sysdeps/alpha/elf/configure.in
+++ b/ports/sysdeps/alpha/elf/configure.in
@@ -53,13 +53,9 @@ fi
AC_CACHE_CHECK(for GP relative module local relocs, libc_cv_alpha_hidden_gprel, [dnl
cat > conftest.c <<\EOF
-static int bar;
+static volatile int bar;
int baz __attribute__((visibility("hidden")));
-
-int foo (void)
-{
- return bar + baz;
-}
+int f(void) { return bar + baz; }
EOF
dnl
diff --git a/ports/sysdeps/alpha/fpu/fegetenv.c b/ports/sysdeps/alpha/fpu/fegetenv.c
index c1950fa3b..ceaf9ed50 100644
--- a/ports/sysdeps/alpha/fpu/fegetenv.c
+++ b/ports/sysdeps/alpha/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,2001,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
@@ -45,3 +45,4 @@ compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
+libm_hidden_ver(__fegetenv, fegetenv)
diff --git a/ports/sysdeps/arm/configure b/ports/sysdeps/arm/configure
new file mode 100644
index 000000000..066a8b69c
--- /dev/null
+++ b/ports/sysdeps/arm/configure
@@ -0,0 +1,33 @@
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/arm.
+
+{ $as_echo "$as_me:$LINENO: checking whether the CFI directive .cfi_sections is supported" >&5
+$as_echo_n "checking whether the CFI directive .cfi_sections is supported... " >&6; }
+if test "${libc_cv_asm_cfi_directive_sections+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<EOF
+ .text
+ .cfi_sections .debug_frame, .eh_frame
+ .cfi_startproc
+ .cfi_endproc
+EOF
+ if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ libc_cv_asm_cfi_directive_sections=yes
+ else
+ libc_cv_asm_cfi_directive_sections=no
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_cfi_directive_sections" >&5
+$as_echo "$libc_cv_asm_cfi_directive_sections" >&6; }
+if test $libc_cv_asm_cfi_directive_sections != yes; then
+ { { $as_echo "$as_me:$LINENO: error: need .cfi_sections in this configuration" >&5
+$as_echo "$as_me: error: need .cfi_sections in this configuration" >&2;}
+ { (exit 1); exit 1; }; }
+fi
diff --git a/ports/sysdeps/arm/configure.in b/ports/sysdeps/arm/configure.in
new file mode 100644
index 000000000..9f4ff3b73
--- /dev/null
+++ b/ports/sysdeps/arm/configure.in
@@ -0,0 +1,20 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/arm.
+
+AC_CACHE_CHECK([whether the CFI directive .cfi_sections is supported],
+ [libc_cv_asm_cfi_directive_sections],
+ [cat > conftest.s <<EOF
+ .text
+ .cfi_sections .debug_frame, .eh_frame
+ .cfi_startproc
+ .cfi_endproc
+EOF
+ if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_asm_cfi_directive_sections=yes
+ else
+ libc_cv_asm_cfi_directive_sections=no
+ fi
+ rm -f conftest*])
+if test $libc_cv_asm_cfi_directive_sections != yes; then
+ AC_MSG_ERROR([need .cfi_sections in this configuration])
+fi
diff --git a/ports/sysdeps/arm/dl-trampoline.S b/ports/sysdeps/arm/dl-trampoline.S
index 0224fa1d1..de8d89182 100644
--- a/ports/sysdeps/arm/dl-trampoline.S
+++ b/ports/sysdeps/arm/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. ARM version.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 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,6 +29,7 @@
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, #function
+ .cfi_sections .debug_frame
cfi_startproc
.align 2
_dl_runtime_resolve:
@@ -77,6 +78,7 @@ _dl_runtime_resolve:
#ifndef PROF
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
+ .cfi_sections .debug_frame
cfi_startproc
.align 2
_dl_runtime_profile:
diff --git a/ports/sysdeps/arm/eabi/__longjmp.S b/ports/sysdeps/arm/eabi/__longjmp.S
index 305919393..edabdad4a 100644
--- a/ports/sysdeps/arm/eabi/__longjmp.S
+++ b/ports/sysdeps/arm/eabi/__longjmp.S
@@ -1,5 +1,6 @@
/* longjmp for ARM.
- Copyright (C) 1997, 1998, 2005, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 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
@@ -31,10 +32,21 @@ ENTRY (__longjmp)
moveq r0, #1 /* can't let setjmp() return zero! */
#ifdef CHECK_SP
- ldr r4, [ip, #32]
+ ldr r4, [ip, #32] /* jmpbuf's sp */
+ cfi_undefined (r4)
CHECK_SP (r4)
#endif
LOADREGS(ia, ip!, {v1-v6, sl, fp, sp, lr})
+ cfi_restore (v1)
+ cfi_restore (v2)
+ cfi_restore (v3)
+ cfi_restore (v4)
+ cfi_restore (v5)
+ cfi_restore (v6)
+ cfi_restore (sl)
+ cfi_restore (fp)
+ cfi_restore (sp)
+ cfi_restore (lr)
#ifdef IS_IN_rtld
ldr a2, 1f
diff --git a/ports/sysdeps/arm/eabi/arm-mcount.S b/ports/sysdeps/arm/eabi/arm-mcount.S
index 2aa50b70e..06e5f182d 100644
--- a/ports/sysdeps/arm/eabi/arm-mcount.S
+++ b/ports/sysdeps/arm/eabi/arm-mcount.S
@@ -1,5 +1,5 @@
/* Implementation of profiling support. ARM EABI version.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -46,10 +46,22 @@ func:
ENTRY(__gnu_mcount_nc)
push {r0, r1, r2, r3, lr}
+ cfi_adjust_cfa_offset (20)
+ cfi_rel_offset (r0, 0)
+ cfi_rel_offset (r1, 4)
+ cfi_rel_offset (r2, 8)
+ cfi_rel_offset (r3, 12)
+ cfi_rel_offset (lr, 16)
bic r1, lr, #1
ldr r0, [sp, #20]
bl __mcount_internal
pop {r0, r1, r2, r3, ip, lr}
+ cfi_adjust_cfa_offset (-24)
+ cfi_restore (r0)
+ cfi_restore (r1)
+ cfi_restore (r2)
+ cfi_restore (r3)
+ cfi_register (lr, ip)
bx ip
END(__gnu_mcount_nc)
@@ -59,6 +71,13 @@ END(__gnu_mcount_nc)
ENTRY(_mcount)
stmdb sp!, {r0, r1, r2, r3, fp, lr}
+ cfi_adjust_cfa_offset (24)
+ cfi_rel_offset (r0, 0)
+ cfi_rel_offset (r1, 4)
+ cfi_rel_offset (r2, 8)
+ cfi_rel_offset (r3, 12)
+ cfi_rel_offset (fp, 16)
+ cfi_rel_offset (lr, 20)
#ifdef __thumb2__
movs r0, fp
ittt ne
@@ -73,6 +92,13 @@ ENTRY(_mcount)
ldmia sp!, {r0, r1, r2, r3, fp, pc}
#else
ldmia sp!, {r0, r1, r2, r3, fp, lr}
+ cfi_adjust_cfa_offset (-24)
+ cfi_restore (r0)
+ cfi_restore (r1)
+ cfi_restore (r2)
+ cfi_restore (r3)
+ cfi_restore (fp)
+ cfi_restore (lr)
bx lr
#endif
END(_mcount)
diff --git a/ports/sysdeps/arm/memcpy.S b/ports/sysdeps/arm/memcpy.S
index 7f669a6e9..673bf43c4 100644
--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -58,6 +58,11 @@
ENTRY(memcpy)
stmfd sp!, {r0, r4, lr}
+ cfi_adjust_cfa_offset (12)
+ cfi_rel_offset (r4, 4)
+ cfi_rel_offset (lr, 8)
+
+ cfi_remember_state
subs r2, r2, #4
blt 8f
@@ -69,6 +74,11 @@ ENTRY(memcpy)
1: subs r2, r2, #(28)
stmfd sp!, {r5 - r8}
+ cfi_adjust_cfa_offset (16)
+ cfi_rel_offset (r5, 0)
+ cfi_rel_offset (r6, 4)
+ cfi_rel_offset (r7, 8)
+ cfi_rel_offset (r8, 12)
blt 5f
CALGN( ands ip, r1, #31 )
@@ -121,6 +131,11 @@ ENTRY(memcpy)
CALGN( bcs 2b )
7: ldmfd sp!, {r5 - r8}
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+ cfi_restore (r8)
8: movs r2, r2, lsl #31
ldrneb r3, [r1], #1
@@ -132,11 +147,16 @@ ENTRY(memcpy)
#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
ldmfd sp!, {r0, r4, lr}
+ cfi_adjust_cfa_offset (-12)
+ cfi_restore (r4)
+ cfi_restore (lr)
bx lr
#else
ldmfd sp!, {r0, r4, pc}
#endif
+ cfi_restore_state
+
9: rsb ip, ip, #4
cmp ip, #2
ldrgtb r3, [r1], #1
@@ -169,6 +189,12 @@ ENTRY(memcpy)
CALGN( bcc 15f )
11: stmfd sp!, {r5 - r9}
+ cfi_adjust_cfa_offset (20)
+ cfi_rel_offset (r5, 0)
+ cfi_rel_offset (r6, 4)
+ cfi_rel_offset (r7, 8)
+ cfi_rel_offset (r8, 12)
+ cfi_rel_offset (r9, 16)
PLD( pld [r1, #0] )
PLD( subs r2, r2, #96 )
@@ -203,6 +229,12 @@ ENTRY(memcpy)
PLD( bge 13b )
ldmfd sp!, {r5 - r9}
+ cfi_adjust_cfa_offset (-20)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+ cfi_restore (r8)
+ cfi_restore (r9)
14: ands ip, r2, #28
beq 16f
diff --git a/ports/sysdeps/arm/memmove.S b/ports/sysdeps/arm/memmove.S
index 9c9b2344d..026d8e2bd 100644
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -73,6 +73,12 @@ ENTRY(memmove)
#endif
stmfd sp!, {r0, r4, lr}
+ cfi_adjust_cfa_offset (12)
+ cfi_rel_offset (r4, 4)
+ cfi_rel_offset (lr, 8)
+
+ cfi_remember_state
+
add r1, r1, r2
add r0, r0, r2
subs r2, r2, #4
@@ -85,6 +91,11 @@ ENTRY(memmove)
1: subs r2, r2, #(28)
stmfd sp!, {r5 - r8}
+ cfi_adjust_cfa_offset (16)
+ cfi_rel_offset (r5, 0)
+ cfi_rel_offset (r6, 4)
+ cfi_rel_offset (r7, 8)
+ cfi_rel_offset (r8, 12)
blt 5f
CALGN( ands ip, r1, #31 )
@@ -136,6 +147,11 @@ ENTRY(memmove)
CALGN( bcs 2b )
7: ldmfd sp!, {r5 - r8}
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+ cfi_restore (r8)
8: movs r2, r2, lsl #31
ldrneb r3, [r1, #-1]!
@@ -144,13 +160,19 @@ ENTRY(memmove)
strneb r3, [r0, #-1]!
strcsb r4, [r0, #-1]!
strcsb ip, [r0, #-1]
+
#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
ldmfd sp!, {r0, r4, lr}
+ cfi_adjust_cfa_offset (-12)
+ cfi_restore (r4)
+ cfi_restore (lr)
bx lr
#else
ldmfd sp!, {r0, r4, pc}
#endif
+ cfi_restore_state
+
9: cmp ip, #2
ldrgtb r3, [r1, #-1]!
ldrgeb r4, [r1, #-1]!
@@ -182,6 +204,12 @@ ENTRY(memmove)
CALGN( bcc 15f )
11: stmfd sp!, {r5 - r9}
+ cfi_adjust_cfa_offset (20)
+ cfi_rel_offset (r5, 0)
+ cfi_rel_offset (r6, 4)
+ cfi_rel_offset (r7, 8)
+ cfi_rel_offset (r8, 12)
+ cfi_rel_offset (r9, 16)
PLD( pld [r1, #-4] )
PLD( subs r2, r2, #96 )
@@ -216,6 +244,12 @@ ENTRY(memmove)
PLD( bge 13b )
ldmfd sp!, {r5 - r9}
+ cfi_adjust_cfa_offset (-20)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+ cfi_restore (r8)
+ cfi_restore (r9)
14: ands ip, r2, #28
beq 16f
diff --git a/ports/sysdeps/arm/sysdep.h b/ports/sysdeps/arm/sysdep.h
index 442d3a146..9ffd7df2b 100644
--- a/ports/sysdeps/arm/sysdep.h
+++ b/ports/sysdeps/arm/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for ARM.
- Copyright (C) 1997, 1998, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2003, 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
@@ -81,18 +81,25 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(4); \
C_LABEL(name) \
+ .cfi_sections .debug_frame; \
+ cfi_startproc; \
CALL_MCOUNT
#undef END
#define END(name) \
+ cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
-#define CALL_MCOUNT \
- str lr,[sp, #-4]! ; \
- bl PLTJMP(mcount) ; \
- ldr lr, [sp], #4 ;
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#else
#define CALL_MCOUNT /* Do nothing. */
#endif
diff --git a/ports/sysdeps/mips/bits/atomic.h b/ports/sysdeps/mips/bits/atomic.h
index 167d9a59c..11b3467ee 100644
--- a/ports/sysdeps/mips/bits/atomic.h
+++ b/ports/sysdeps/mips/bits/atomic.h
@@ -69,16 +69,16 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
- "ll %0,%4\n\t" \
+ "ll %0,%5\n\t" \
"move %1,$0\n\t" \
- "bne %0,%2,2f\n\t" \
- "move %1,%3\n\t" \
- "sc %1,%4\n\t" \
+ "bne %0,%3,2f\n\t" \
+ "move %1,%4\n\t" \
+ "sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (oldval), "r" (newval), "m" (*mem) \
: "memory")
@@ -93,16 +93,16 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
- "lld %0,%4\n\t" \
+ "lld %0,%5\n\t" \
"move %1,$0\n\t" \
- "bne %0,%2,2f\n\t" \
- "move %1,%3\n\t" \
- "scd %1,%4\n\t" \
+ "bne %0,%3,2f\n\t" \
+ "move %1,%4\n\t" \
+ "scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (oldval), "r" (newval), "m" (*mem) \
: "memory")
#endif
@@ -189,14 +189,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
- "ll %0,%3\n\t" \
- "move %1,%2\n\t" \
- "sc %1,%3\n\t" \
+ "ll %0,%4\n\t" \
+ "move %1,%3\n\t" \
+ "sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (newval), "m" (*mem) \
: "memory"); \
__prev; })
@@ -213,14 +213,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\n" \
- "lld %0,%3\n\t" \
- "move %1,%2\n\t" \
- "scd %1,%3\n\t" \
+ "lld %0,%4\n\t" \
+ "move %1,%3\n\t" \
+ "scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (newval), "m" (*mem) \
: "memory"); \
__prev; })
@@ -248,14 +248,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
- "ll %0,%3\n\t" \
- "addu %1,%0,%2\n\t" \
- "sc %1,%3\n\t" \
+ "ll %0,%4\n\t" \
+ "addu %1,%0,%3\n\t" \
+ "sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (value), "m" (*mem) \
: "memory"); \
__prev; })
@@ -272,14 +272,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
- "lld %0,%3\n\t" \
- "daddu %1,%0,%2\n\t" \
- "scd %1,%3\n\t" \
+ "lld %0,%4\n\t" \
+ "daddu %1,%0,%3\n\t" \
+ "scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp) \
+ : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (value), "m" (*mem) \
: "memory"); \
__prev; })
diff --git a/ports/sysdeps/mips/dl-lookup.c b/ports/sysdeps/mips/dl-lookup.c
index a9fff598a..4090efeac 100644
--- a/ports/sysdeps/mips/dl-lookup.c
+++ b/ports/sysdeps/mips/dl-lookup.c
@@ -1,6 +1,7 @@
/* Look up a symbol in the loaded objects.
MIPS/Linux version - special handling of non-PIC undefined symbol rules.
- 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
@@ -431,6 +432,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);
@@ -934,13 +949,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/ports/sysdeps/unix/alpha/sysdep.h b/ports/sysdeps/unix/alpha/sysdep.h
index 2e5bc798e..d9009c157 100644
--- a/ports/sysdeps/unix/alpha/sysdep.h
+++ b/ports/sysdeps/unix/alpha/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004, 2006
+/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004, 2006, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -191,8 +191,10 @@ __LABEL(name) \
})
#define INTERNAL_SYSCALL_DECL(err) long int err
-#define INTERNAL_SYSCALL_ERROR_P(val, err) err
-#define INTERNAL_SYSCALL_ERRNO(val, err) val
+/* Make sure and "use" the variable that we're not returning,
+ in order to suppress unused variable warnings. */
+#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void)val, err)
+#define INTERNAL_SYSCALL_ERRNO(val, err) ((void)err, val)
#define inline_syscall_clobbers \
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
@@ -428,11 +430,21 @@ extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
+extern const uintptr_t __pointer_chk_guard attribute_relro;
# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
+ (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
# define PTR_DEMANGLE(var) PTR_MANGLE(var)
# endif
+#else
+/* There exists generic C code that assumes that PTR_MANGLE is always
+ defined. When generating code for the static libc, we don't have
+ __pointer_chk_guard defined. Nor is there any place that would
+ initialize it if it were defined, so there's little point in doing
+ anything more than nothing. */
+# ifndef __ASSEMBLER__
+# define PTR_MANGLE(var)
+# define PTR_DEMANGLE(var)
+# endif
#endif
#endif /* ASSEMBLER */
diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S
index dcb427e57..d3ad81b7b 100644
--- a/ports/sysdeps/unix/arm/sysdep.S
+++ b/ports/sysdeps/unix/arm/sysdep.S
@@ -1,5 +1,5 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003,
- 2004, 2005
+ 2004, 2005, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -44,6 +44,7 @@ syscall_error:
#if USE___THREAD
mov ip, lr
+ cfi_register (lr, ip)
mov r1, r0
mov r0, #0xffff0fff
@@ -66,9 +67,13 @@ syscall_error:
1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8
#elif defined(_LIBC_REENTRANT)
str lr, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (lr, 0)
str r0, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
bl PLTJMP(C_SYMBOL_NAME(__errno_location))
ldr r1, [sp], #4
+ cfi_adjust_cfa_offset (-4)
str r1, [r0]
mvn r0, $0
ldr pc, [sp], #4
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/Versions b/ports/sysdeps/unix/sysv/linux/alpha/Versions
index 8709dd2a3..5a617b4be 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/Versions
+++ b/ports/sysdeps/unix/sysv/linux/alpha/Versions
@@ -77,6 +77,10 @@ libc {
#errlist-compat 138
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
+ GLIBC_2.12 {
+ #errlist-compat 139
+ _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+ }
GLIBC_PRIVATE {
__libc_alpha_cache_shape;
}
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
new file mode 100644
index 000000000..5194ed818
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
@@ -0,0 +1,139 @@
+/* Copyright (C) 1992, 1994, 1997, 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
+ 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 <sysdep.h>
+#include <jmpbuf-offsets.h>
+
+
+ .section .rodata.str1.1,"aMS",@progbits,1
+ .type longjmp_msg,@object
+longjmp_msg:
+ .string "longjmp causes uninitialized stack frame"
+ .size longjmp_msg, .-longjmp_msg
+
+
+/* Jump to the position specified by ENV, causing the
+ setjmp call there to return VAL, or 1 if VAL is 0.
+ void __longjmp (__jmp_buf env, int val). */
+ .text
+ .align 4
+ .globl ____longjmp_chk
+ .type ____longjmp_chk, @function
+ .usepv ____longjmp_chk, std
+
+ cfi_startproc
+____longjmp_chk:
+ ldgp gp, 0(pv)
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+
+ ldq s2, JB_PC*8(a0)
+ mov a0, s0
+ ldq fp, JB_FP*8(a0)
+ mov a1, s1
+ ldq s3, JB_SP*8(a0)
+ cmoveq s1, 1, s1
+
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE(s2, t1)
+ PTR_DEMANGLE2(s3, t1)
+ PTR_DEMANGLE2(fp, t1)
+#endif
+ cmpule t0, sp, t1
+ bne t1, .Lfail
+
+ .align 4
+.Lok:
+ mov s0, a0
+ mov s1, v0
+ mov s3, t0
+ mov s2, ra
+ cfi_remember_state
+ cfi_def_cfa(a0, 0)
+ cfi_register(sp, t0)
+ cfi_offset(s0, JB_S0*8)
+ cfi_offset(s1, JB_S1*8)
+ cfi_offset(s2, JB_S2*8)
+ cfi_offset(s3, JB_S3*8)
+ cfi_offset(s4, JB_S4*8)
+ cfi_offset(s5, JB_S5*8)
+ cfi_offset(s3, JB_S3*8)
+ cfi_offset($f2, JB_F2*8)
+ cfi_offset($f3, JB_F3*8)
+ cfi_offset($f4, JB_F4*8)
+ cfi_offset($f5, JB_F5*8)
+ cfi_offset($f6, JB_F6*8)
+ cfi_offset($f7, JB_F7*8)
+ cfi_offset($f8, JB_F8*8)
+ cfi_offset($f9, JB_F9*8)
+ ldq s0, JB_S0*8(a0)
+ ldq s1, JB_S1*8(a0)
+ ldq s2, JB_S2*8(a0)
+ ldq s3, JB_S3*8(a0)
+ ldq s4, JB_S4*8(a0)
+ ldq s5, JB_S5*8(a0)
+ ldt $f2, JB_F2*8(a0)
+ ldt $f3, JB_F3*8(a0)
+ ldt $f4, JB_F4*8(a0)
+ ldt $f5, JB_F5*8(a0)
+ ldt $f6, JB_F6*8(a0)
+ ldt $f7, JB_F7*8(a0)
+ ldt $f8, JB_F8*8(a0)
+ ldt $f9, JB_F9*8(a0)
+ mov t0, sp
+ ret
+
+ .align 4
+.Lfail:
+ cfi_restore_state
+ lda v0, __NR_sigaltstack
+ lda a0, 0
+ lda a1, -32(sp)
+ lda sp, -32(sp)
+ cfi_adjust_cfa_offset(32)
+ callsys
+ ldq t0, 0(sp) /* ss_sp */
+ ldl t1, 8(sp) /* ss_flags */
+ ldq t2, 16(sp) /* ss_size */
+ lda sp, 32(sp)
+ cfi_adjust_cfa_offset(-32)
+
+ /* Without working sigaltstack we cannot perform the test. */
+ bne a3, .Lok
+
+ addq t0, t2, t0 /* t0 = ss_sp + ss_size */
+ subq t0, s3, t0 /* t0 = (ss_sp + ss_size) - new_sp */
+ cmpule t2, t0, t0 /* t0 = (t0 >= ss_size) */
+ and t0, t1, t0 /* t0 = (t0 >= ss_size) & (ss_flags & SS_ONSTACK) */
+ bne t0, .Lok
+
+ ldah a0, longjmp_msg(gp) !gprelhigh
+ lda a0, longjmp_msg(a0) !gprellow
+#ifdef PIC
+ jsr ra, HIDDEN_JUMPTARGET(__fortify_fail)
+#else
+ bsr ra, HIDDEN_JUMPTARGET(__fortify_fail) !samegp
+#endif
+ bugchk
+
+ cfi_endproc
+ .size ____longjmp_chk, .-____longjmp_chk
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index 7a6a3fd0f..860e9ac3e 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -81,7 +81,7 @@
#define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */
#define F_SETLKW64 F_SETLKW /* Set record locking info (blocking). */
-#if defined __USE_BSD || defined __USE_UNIX98 || defiend __USE_XOPEN2K8
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
# define F_SETOWN 5 /* Get owner of socket (receiver of SIGIO). */
# define F_GETOWN 6 /* Set owner of socket (receiver of SIGIO). */
#endif
@@ -89,6 +89,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -161,6 +163,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_PGRP, /* Process group. */
+ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
new file mode 100644
index 000000000..dedf8bc8b
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
@@ -0,0 +1,429 @@
+/* System-specific socket constants and types. Linux version.
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 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
+ 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. */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define __need_size_t
+#include <stddef.h>
+
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_RAW = 3, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
+#define SOCK_DCCP SOCK_DCCP
+ SOCK_PACKET = 10, /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+
+ /* Flags to be ORed into the type parameter of socket and socketpair and
+ used for the flags parameter of paccept. */
+
+ SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
+ new descriptor(s). */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+ SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
+ non-blocking. */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_AX25 3 /* Amateur Radio AX.25. */
+#define PF_IPX 4 /* Novell Internet Protocol. */
+#define PF_APPLETALK 5 /* Appletalk DDP. */
+#define PF_NETROM 6 /* Amateur radio NetROM. */
+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
+#define PF_ATMPVC 8 /* ATM PVCs. */
+#define PF_X25 9 /* Reserved for X.25 project. */
+#define PF_INET6 10 /* IP version 6. */
+#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
+#define PF_DECnet 12 /* Reserved for DECnet project. */
+#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
+#define PF_SECURITY 14 /* Security callback pseudo AF. */
+#define PF_KEY 15 /* PF_KEY key management API. */
+#define PF_NETLINK 16
+#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
+#define PF_PACKET 17 /* Packet family. */
+#define PF_ASH 18 /* Ash. */
+#define PF_ECONET 19 /* Acorn Econet. */
+#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_RDS 21 /* RDS sockets. */
+#define PF_SNA 22 /* Linux SNA Project */
+#define PF_IRDA 23 /* IRDA sockets. */
+#define PF_PPPOX 24 /* PPPoX sockets. */
+#define PF_WANPIPE 25 /* Wanpipe API sockets. */
+#define PF_LLC 26 /* Linux LLC. */
+#define PF_CAN 29 /* Controller Area Network. */
+#define PF_TIPC 30 /* TIPC sockets. */
+#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
+#define PF_IUCV 32 /* IUCV sockets. */
+#define PF_RXRPC 33 /* RxRPC sockets. */
+#define PF_ISDN 34 /* mISDN sockets. */
+#define PF_PHONET 35 /* Phonet sockets. */
+#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
+#define PF_MAX 37 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_LOCAL PF_LOCAL
+#define AF_UNIX PF_UNIX
+#define AF_FILE PF_FILE
+#define AF_INET PF_INET
+#define AF_AX25 PF_AX25
+#define AF_IPX PF_IPX
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NETROM PF_NETROM
+#define AF_BRIDGE PF_BRIDGE
+#define AF_ATMPVC PF_ATMPVC
+#define AF_X25 PF_X25
+#define AF_INET6 PF_INET6
+#define AF_ROSE PF_ROSE
+#define AF_DECnet PF_DECnet
+#define AF_NETBEUI PF_NETBEUI
+#define AF_SECURITY PF_SECURITY
+#define AF_KEY PF_KEY
+#define AF_NETLINK PF_NETLINK
+#define AF_ROUTE PF_ROUTE
+#define AF_PACKET PF_PACKET
+#define AF_ASH PF_ASH
+#define AF_ECONET PF_ECONET
+#define AF_ATMSVC PF_ATMSVC
+#define AF_RDS PF_RDS
+#define AF_SNA PF_SNA
+#define AF_IRDA PF_IRDA
+#define AF_PPPOX PF_PPPOX
+#define AF_WANPIPE PF_WANPIPE
+#define AF_LLC PF_LLC
+#define AF_CAN PF_CAN
+#define AF_TIPC PF_TIPC
+#define AF_BLUETOOTH PF_BLUETOOTH
+#define AF_IUCV PF_IUCV
+#define AF_RXRPC PF_RXRPC
+#define AF_ISDN PF_ISDN
+#define AF_PHONET PF_PHONET
+#define AF_IEEE802154 PF_IEEE802154
+#define AF_MAX PF_MAX
+
+/* Socket level values. Others are defined in the appropriate headers.
+
+ XXX These definitions also should go into the appropriate headers as
+ far as they are available. */
+#define SOL_RAW 255
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level). */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
+#define SOL_IRDA 266
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Structure large enough to hold any socket address (with the historical
+ exception of AF_UNIX). We reserve 128 bytes. */
+#define __ss_aligntype unsigned long int
+#define _SS_SIZE 128
+#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+ {
+ __SOCKADDR_COMMON (ss_); /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+#define MSG_OOB MSG_OOB
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+#define MSG_PEEK MSG_PEEK
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+#define MSG_DONTROUTE MSG_DONTROUTE
+#ifdef __USE_GNU
+ /* DECnet uses a different name. */
+ MSG_TRYHARD = MSG_DONTROUTE,
+# define MSG_TRYHARD MSG_DONTROUTE
+#endif
+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
+#define MSG_CTRUNC MSG_CTRUNC
+ MSG_PROXY = 0x10, /* Supply or ask second address. */
+#define MSG_PROXY MSG_PROXY
+ MSG_TRUNC = 0x20,
+#define MSG_TRUNC MSG_TRUNC
+ MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
+#define MSG_DONTWAIT MSG_DONTWAIT
+ MSG_EOR = 0x80, /* End of record. */
+#define MSG_EOR MSG_EOR
+ MSG_WAITALL = 0x100, /* Wait for a full request. */
+#define MSG_WAITALL MSG_WAITALL
+ MSG_FIN = 0x200,
+#define MSG_FIN MSG_FIN
+ MSG_SYN = 0x400,
+#define MSG_SYN MSG_SYN
+ MSG_CONFIRM = 0x800, /* Confirm path validity. */
+#define MSG_CONFIRM MSG_CONFIRM
+ MSG_RST = 0x1000,
+#define MSG_RST MSG_RST
+ MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
+#define MSG_ERRQUEUE MSG_ERRQUEUE
+ MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+ MSG_MORE = 0x8000, /* Sender will send more. */
+#define MSG_MORE MSG_MORE
+
+ MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
+ descriptor received through
+ SCM_RIGHTS. */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ void *msg_name; /* Address to send to/receive from. */
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+ size_t msg_iovlen; /* Number of elements in the vector. */
+
+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+ size_t msg_controllen; /* Ancillary data buffer length.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
+
+ int msg_flags; /* Flags on received message. */
+ };
+
+#ifdef __USE_GNU
+/* For `recvmmsg'. */
+struct mmsghdr
+ {
+ struct msghdr msg_hdr; /* Actual message header. */
+ unsigned int msg_len; /* Number of received bytes for the entry. */
+ };
+#endif
+
+/* Structure used for storage of ancillary data object information. */
+struct cmsghdr
+ {
+ size_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
+ int cmsg_level; /* Originating protocol. */
+ int cmsg_type; /* Protocol specific type. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+ __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
+#endif
+ };
+
+/* Ancillary data object manipulation macros. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+ & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+ /* The kernel header does this so there may be a reason. */
+ return 0;
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+ return 0;
+ return __cmsg;
+}
+#endif /* Use `extern inline'. */
+
+/* Socket level message types. This must match the definitions in
+ <linux/socket.h>. */
+enum
+ {
+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_GNU
+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+ };
+
+#ifdef __USE_GNU
+/* User visible structure for SCM_CREDENTIALS message */
+struct ucred
+{
+ pid_t pid; /* PID of sending process. */
+ uid_t uid; /* UID of sending process. */
+ gid_t gid; /* GID of sending process. */
+};
+#endif
+
+/* Ugly workaround for unclean kernel headers. */
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifndef FIOGETOWN
+# define __SYS_SOCKET_H_undef_FIOGETOWN
+# endif
+# ifndef FIOSETOWN
+# define __SYS_SOCKET_H_undef_FIOSETOWN
+# endif
+# ifndef SIOCATMARK
+# define __SYS_SOCKET_H_undef_SIOCATMARK
+# endif
+# ifndef SIOCGPGRP
+# define __SYS_SOCKET_H_undef_SIOCGPGRP
+# endif
+# ifndef SIOCGSTAMP
+# define __SYS_SOCKET_H_undef_SIOCGSTAMP
+# endif
+# ifndef SIOCGSTAMPNS
+# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# endif
+# ifndef SIOCSPGRP
+# define __SYS_SOCKET_H_undef_SIOCSPGRP
+# endif
+#endif
+
+/* Get socket manipulation related informations from kernel headers. */
+#include <asm/socket.h>
+
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
+# undef __SYS_SOCKET_H_undef_FIOGETOWN
+# undef FIOGETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
+# undef __SYS_SOCKET_H_undef_FIOSETOWN
+# undef FIOSETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
+# undef __SYS_SOCKET_H_undef_SIOCATMARK
+# undef SIOCATMARK
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
+# undef __SYS_SOCKET_H_undef_SIOCGPGRP
+# undef SIOCGPGRP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
+# undef __SYS_SOCKET_H_undef_SIOCGSTAMP
+# undef SIOCGSTAMP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# undef SIOCGSTAMPNS
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
+# undef __SYS_SOCKET_H_undef_SIOCSPGRP
+# undef SIOCSPGRP
+# endif
+#endif
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+
+__BEGIN_DECLS
+
+/* Receive a message as described by MESSAGE from socket FD.
+ Returns the number of bytes read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
+ unsigned int __vlen, int __flags,
+ __const struct timespec *__tmo);
+
+__END_DECLS
+
+#endif /* bits/socket.h */
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/creat.c b/ports/sysdeps/unix/sysv/linux/alpha/creat.c
new file mode 100644
index 000000000..9e661bab0
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/creat.c
@@ -0,0 +1,8 @@
+/* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list defines creat and
+ creat64 for most linux targets, but on alpha creat is not a syscall.
+ If we do nothing, we'll wind up with creat64 being undefined, because
+ the syscalls.list assumes the creat->creat64 alias was created. We
+ could have overridden that with a create64.c, but we might as well do
+ the right thing and set up creat64 as an alias. */
+#include <io/creat.c>
+weak_alias(__libc_creat, creat64)
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h b/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
index 8afc4dba3..075797db0 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
@@ -19,7 +19,7 @@
/* Scan the Aux Vector for the cache shape entries. */
-long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+extern long __libc_alpha_cache_shape[4];
#define DL_PLATFORM_AUXV \
case AT_L1I_CACHESHAPE: \
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c b/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
index 4034820f4..5d0867a10 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
+++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
@@ -1,2 +1,5 @@
#include "dl-auxv.h"
+
+long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+
#include <sysdeps/unix/sysv/linux/dl-sysdep.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h
index 4cd29d2ff..193085d5c 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h
@@ -23,7 +23,6 @@
only. Don't read too much into it. Don't use it for anything other
than gdb/strace unless you know what you are doing. */
-#include <asm/page.h>
#include <asm/reg.h>
struct user
@@ -41,6 +40,9 @@ struct user
char u_comm[32]; /* user command name */
};
+#define PAGE_SHIFT 13
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
#define NBPG PAGE_SIZE
#define UPAGES 1
#define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index 1a19f5b55..178b0f1ef 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2005, 2008, 2009
+/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2005, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Pat Beirne <patb@corelcomputer.com>
@@ -52,8 +52,13 @@ ENTRY(__clone)
@ new sp is already in r1
#ifdef __ARM_EABI__
stmfd sp!, {r4, r7}
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (r4, 0)
+ cfi_rel_offset (r7, 4)
#else
str r4, [sp, #-8]!
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (r4, 0)
#endif
ldr r2, [sp, #8]
ldr r3, [sp, #12]
@@ -64,6 +69,7 @@ ENTRY(__clone)
#else
swi SYS_ify(clone)
#endif
+ cfi_endproc
cmp r0, #0
beq 1f
#ifdef __ARM_EABI__
@@ -74,6 +80,8 @@ ENTRY(__clone)
blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
RETINSTR(, lr)
+ cfi_startproc
+ cfi_undefined (lr)
1:
#ifdef RESET_PID
tst ip, #CLONE_THREAD
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
index f92a382e4..423e7776e 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
@@ -30,6 +30,7 @@ longjmp_msg:
#ifdef PIC
# define CALL_FAIL \
ldr sl, .L_GOT; \
+ cfi_undefined (sl); \
.L_GOT_OFF: \
add sl, pc, sl; \
ldr r0, .Lstr; \
@@ -48,12 +49,17 @@ longjmp_msg:
#endif
#define CHECK_SP(reg) \
+ cfi_remember_state; \
cmp sp, reg; \
bls .Lok; \
mov r5, r0; \
+ cfi_undefined (r5); \
mov r7, #SYS_ify(sigaltstack); \
+ cfi_undefined (r7); \
mov r0, #0; \
- sub sp, sp, #16; \
+ sub sp, sp, #16; /* >= sizeof (stack_t) */ \
+ cfi_adjust_cfa_offset (16); \
+ cfi_remember_state; \
mov r1, sp; \
swi #0; \
cmp r0, #0; \
@@ -69,8 +75,10 @@ longjmp_msg:
bhi .Lok2; \
.Lfail: \
CALL_FAIL \
+ cfi_restore_state; \
.Lok2: \
mov r0, r5; \
+ cfi_restore_state; \
.Lok:
#include <__longjmp.S>
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
index 38fac06c3..59352f71d 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003, 2005, 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
@@ -34,8 +34,13 @@
ENTRY (__mmap64)
ldr ip, [sp, $LOW_OFFSET]
str r5, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r5, 0)
ldr r5, [sp, $HIGH_OFFSET]
str r4, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r4, 0)
+ cfi_remember_state
movs r4, ip, lsl $20 @ check that offset is page-aligned
mov ip, ip, lsr $12
moveqs r4, r5, lsr $12 @ check for overflow
@@ -45,11 +50,19 @@ ENTRY (__mmap64)
DO_CALL (mmap2, 0)
cmn r0, $4096
ldmfd sp!, {r4, r5}
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (r4)
+ cfi_restore (r5)
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
+
+ cfi_restore_state
.Linval:
mov r0, $-EINVAL
ldmfd sp!, {r4, r5}
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (r4)
+ cfi_restore (r5)
b PLTJMP(syscall_error)
PSEUDO_END (__mmap64)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
index 73912d517..458558b9c 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 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
@@ -36,17 +36,22 @@
.type __##syscall_name##_nocancel,%function; \
.globl __##syscall_name##_nocancel; \
__##syscall_name##_nocancel: \
+ .cfi_sections .debug_frame; \
+ cfi_startproc; \
DO_CALL (syscall_name, args); \
PSEUDO_RET; \
+ cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
ENTRY (name); \
SINGLE_THREAD_P; \
DOARGS_##args; \
bne .Lpseudo_cancel; \
+ cfi_remember_state; \
DO_CALL (syscall_name, 0); \
UNDOARGS_##args; \
cmn r0, $4096; \
PSEUDO_RET; \
+ cfi_restore_state; \
.Lpseudo_cancel: \
.fnstart; \
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
@@ -62,41 +67,127 @@
mov r0, r7; /* retrieve return value. */ \
RESTORE_LR_##args; \
UNDOARGS_##args; \
- cmn r0, $4096;
+ cmn r0, $4096
/* DOARGS pushes four bytes on the stack for five arguments, eight bytes for
six arguments, and nothing for fewer. In order to preserve doubleword
alignment, sometimes we must save an extra register. */
-# define RESTART_UNWIND .fnend; .fnstart; .save {r7, lr}
-
-# define DOCARGS_0 stmfd sp!, {r7, lr}; .save {r7, lr}
+# define RESTART_UNWIND \
+ .fnend; \
+ .fnstart; \
+ .save {r7, lr}
+
+# define DOCARGS_0 \
+ stmfd sp!, {r7, lr}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (r7, 0); \
+ cfi_rel_offset (lr, 4); \
+ .save {r7, lr}
# define UNDOCARGS_0
-# define RESTORE_LR_0 ldmfd sp!, {r7, lr};
-
-# define DOCARGS_1 stmfd sp!, {r0, r1, r7, lr}; .save {r7, lr}; .pad #8
-# define UNDOCARGS_1 ldr r0, [sp], #8; RESTART_UNWIND
-# define RESTORE_LR_1 RESTORE_LR_0
-
-# define DOCARGS_2 stmfd sp!, {r0, r1, r7, lr}; .save {r7, lr}; .pad #8
-# define UNDOCARGS_2 ldmfd sp!, {r0, r1}; RESTART_UNWIND
-# define RESTORE_LR_2 RESTORE_LR_0
-
-# define DOCARGS_3 stmfd sp!, {r0, r1, r2, r3, r7, lr}; .save {r7, lr}; .pad #16
-# define UNDOCARGS_3 ldmfd sp!, {r0, r1, r2, r3}; RESTART_UNWIND
-# define RESTORE_LR_3 RESTORE_LR_0
-
-# define DOCARGS_4 stmfd sp!, {r0, r1, r2, r3, r7, lr}; .save {r7, lr}; .pad #16
-# define UNDOCARGS_4 ldmfd sp!, {r0, r1, r2, r3}; RESTART_UNWIND
-# define RESTORE_LR_4 RESTORE_LR_0
-
-# define DOCARGS_5 .save {r4}; stmfd sp!, {r0, r1, r2, r3, r4, r7, lr}; .save {r7, lr}; .pad #20
-# define UNDOCARGS_5 ldmfd sp!, {r0, r1, r2, r3}; .fnend; .fnstart; .save {r4}; .save {r7, lr}; .pad #4
-# define RESTORE_LR_5 ldmfd sp!, {r4, r7, lr}
-
-# define DOCARGS_6 .save {r4, r5}; stmfd sp!, {r0, r1, r2, r3, r7, lr}; .save {r7, lr}; .pad #16
-# define UNDOCARGS_6 ldmfd sp!, {r0, r1, r2, r3}; .fnend; .fnstart; .save {r4, r5}; .save {r7, lr}
-# define RESTORE_LR_6 RESTORE_LR_0
+# define RESTORE_LR_0 \
+ ldmfd sp!, {r7, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (r7); \
+ cfi_restore (lr)
+
+# define DOCARGS_1 \
+ stmfd sp!, {r0, r1, r7, lr}; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r7, 8); \
+ cfi_rel_offset (lr, 12); \
+ .save {r7, lr}; \
+ .pad #8
+# define UNDOCARGS_1 \
+ ldr r0, [sp], #8; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_1 \
+ RESTORE_LR_0
+
+# define DOCARGS_2 \
+ stmfd sp!, {r0, r1, r7, lr}; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r7, 8); \
+ cfi_rel_offset (lr, 12); \
+ .save {r7, lr}; \
+ .pad #8
+# define UNDOCARGS_2 \
+ ldmfd sp!, {r0, r1}; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_2 \
+ RESTORE_LR_0
+
+# define DOCARGS_3 \
+ stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (r7, 16); \
+ cfi_rel_offset (lr, 20); \
+ .save {r7, lr}; \
+ .pad #16
+# define UNDOCARGS_3 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_3 \
+ RESTORE_LR_0
+
+# define DOCARGS_4 \
+ stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (r7, 16); \
+ cfi_rel_offset (lr, 20); \
+ .save {r7, lr}; \
+ .pad #16
+# define UNDOCARGS_4 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_4 \
+ RESTORE_LR_0
+
+/* r4 is only stmfd'ed for correct stack alignment. */
+# define DOCARGS_5 \
+ .save {r4}; \
+ stmfd sp!, {r0, r1, r2, r3, r4, r7, lr}; \
+ cfi_adjust_cfa_offset (28); \
+ cfi_rel_offset (r7, 20); \
+ cfi_rel_offset (lr, 24); \
+ .save {r7, lr}; \
+ .pad #20
+# define UNDOCARGS_5 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4}; \
+ .save {r7, lr}; \
+ .pad #4
+# define RESTORE_LR_5 \
+ ldmfd sp!, {r4, r7, lr}; \
+ cfi_adjust_cfa_offset (-12); \
+ /* r4 will be marked as restored later. */ \
+ cfi_restore (r7); \
+ cfi_restore (lr)
+
+# define DOCARGS_6 \
+ .save {r4, r5}; \
+ stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (r7, 16); \
+ cfi_rel_offset (lr, 20); \
+ .save {r7, lr}; \
+ .pad #16
+# define UNDOCARGS_6 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r5}; \
+ .save {r7, lr}
+# define RESTORE_LR_6 \
+ RESTORE_LR_0
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
@@ -136,9 +227,13 @@ extern int __local_multiple_threads attribute_hidden;
# define PSEUDO_PROLOGUE
# define SINGLE_THREAD_P \
stmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (lr, 4); \
bl __aeabi_read_tp; \
ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
ldmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (lr); \
teq ip, #0
# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
# endif
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index ed321a396..011746d0e 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -89,7 +89,15 @@ asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
"_Unwind_Resume:\n"
+" .cfi_sections .debug_frame\n"
+" " CFI_STARTPROC "\n"
" stmfd sp!, {r4, r5, r6, lr}\n"
+" " CFI_ADJUST_CFA_OFFSET (16)" \n"
+" " CFI_REL_OFFSET (r4, 0) "\n"
+" " CFI_REL_OFFSET (r5, 4) "\n"
+" " CFI_REL_OFFSET (r6, 8) "\n"
+" " CFI_REL_OFFSET (lr, 12) "\n"
+" " CFI_REMEMBER_STATE "\n"
" ldr r4, 1f\n"
" ldr r5, 2f\n"
"3: add r4, pc, r4\n"
@@ -99,10 +107,17 @@ asm (
" beq 4f\n"
"5: mov r0, r6\n"
" ldmfd sp!, {r4, r5, r6, lr}\n"
+" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
+" " CFI_RESTORE (r4) "\n"
+" " CFI_RESTORE (r5) "\n"
+" " CFI_RESTORE (r6) "\n"
+" " CFI_RESTORE (lr) "\n"
" bx r3\n"
+" " CFI_RESTORE_STATE "\n"
"4: bl pthread_cancel_init\n"
" ldr r3, [r4, r5]\n"
" b 5b\n"
+" " CFI_ENDPROC "\n"
" .align 2\n"
#ifdef __thumb2__
"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
index 3c780b713..cdab10e30 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -52,7 +52,15 @@ asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
"_Unwind_Resume:\n"
+" .cfi_sections .debug_frame\n"
+" " CFI_STARTPROC "\n"
" stmfd sp!, {r4, r5, r6, lr}\n"
+" " CFI_ADJUST_CFA_OFFSET (16)" \n"
+" " CFI_REL_OFFSET (r4, 0) "\n"
+" " CFI_REL_OFFSET (r5, 4) "\n"
+" " CFI_REL_OFFSET (r6, 8) "\n"
+" " CFI_REL_OFFSET (lr, 12) "\n"
+" " CFI_REMEMBER_STATE "\n"
" ldr r4, 1f\n"
" ldr r5, 2f\n"
"3: add r4, pc, r4\n"
@@ -62,10 +70,17 @@ asm (
" beq 4f\n"
"5: mov r0, r6\n"
" ldmfd sp!, {r4, r5, r6, lr}\n"
+" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
+" " CFI_RESTORE (r4) "\n"
+" " CFI_RESTORE (r5) "\n"
+" " CFI_RESTORE (r6) "\n"
+" " CFI_RESTORE (lr) "\n"
" bx r3\n"
+" " CFI_RESTORE_STATE "\n"
"4: bl init\n"
" ldr r3, [r4, r5]\n"
" b 5b\n"
+" " CFI_ENDPROC "\n"
" .align 2\n"
#ifdef __thumb2__
"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
index cc06a5597..09ff9c7d9 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2005, 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
@@ -34,46 +34,89 @@
Because the signal frame layout changed in 2.6.18, we provide two
copies of these functions with different unwind information. */
+/* Used in ENTRY. */
+#undef cfi_startproc
+#define cfi_startproc \
+ .cfi_startproc simple; \
+ .cfi_signal_frame
+
+/* The CFA is not computed / used correctly here; this is neither trivial to
+ do, nor is it needed. */
+#define CFI \
+ cfi_def_cfa (sp, 0); \
+ cfi_offset (r0, OFFSET + 0 * 4); \
+ cfi_offset (r1, OFFSET + 1 * 4); \
+ cfi_offset (r2, OFFSET + 2 * 4); \
+ cfi_offset (r3, OFFSET + 3 * 4); \
+ cfi_offset (r4, OFFSET + 4 * 4); \
+ cfi_offset (r5, OFFSET + 5 * 4); \
+ cfi_offset (r6, OFFSET + 6 * 4); \
+ cfi_offset (r7, OFFSET + 7 * 4); \
+ cfi_offset (r8, OFFSET + 8 * 4); \
+ cfi_offset (r9, OFFSET + 9 * 4); \
+ cfi_offset (r10, OFFSET + 10 * 4); \
+ cfi_offset (r11, OFFSET + 11 * 4); \
+ cfi_offset (r12, OFFSET + 12 * 4); \
+ cfi_offset (r13, OFFSET + 13 * 4); \
+ cfi_offset (r14, OFFSET + 14 * 4); \
+ cfi_offset (r15, OFFSET + 15 * 4)
+
#ifndef __ASSUME_SIGFRAME_V2
+#define OFFSET 12
.fnstart
.save {r0-r15}
- .pad #12
+ .pad #OFFSET
nop
ENTRY(__default_sa_restorer_v1)
+ CFI
mov r7, $SYS_ify(sigreturn)
swi 0x0
.fnend
-#endif
+END(__default_sa_restorer_v1)
+#undef OFFSET
+#endif /* __ASSUME_SIGFRAME_V2 */
+#define OFFSET 32
.fnstart
.save {r0-r15}
- .pad #32
+ .pad #OFFSET
nop
ENTRY(__default_sa_restorer_v2)
+ CFI
mov r7, $SYS_ify(sigreturn)
swi 0x0
.fnend
+END(__default_sa_restorer_v2)
+#undef OFFSET
#ifdef __NR_rt_sigreturn
#ifndef __ASSUME_SIGFRAME_V2
+#define OFFSET 168
.fnstart
.save {r0-r15}
- .pad #168
+ .pad #OFFSET
nop
ENTRY(__default_rt_sa_restorer_v1)
+ CFI
mov r7, $SYS_ify(rt_sigreturn)
swi 0x0
.fnend
-#endif
+END(__default_rt_sa_restorer_v1)
+#undef OFFSET
+#endif /* __ASSUME_SIGFRAME_V2 */
+#define OFFSET 160
.fnstart
.save {r0-r15}
- .pad #160
+ .pad #OFFSET
nop
ENTRY(__default_rt_sa_restorer_v2)
+ CFI
mov r7, $SYS_ify(rt_sigreturn)
swi 0x0
.fnend
+END(__default_rt_sa_restorer_v2)
+#undef OFFSET
-#endif
+#endif /* __NR_rt_sigreturn */
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/syscall.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/syscall.S
index 59ca051a8..f6d775e0a 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/syscall.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 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
@@ -25,6 +25,11 @@
ENTRY (syscall)
mov ip, sp
stmfd sp!, {r4, r5, r6, r7}
+ cfi_adjust_cfa_offset (16)
+ cfi_rel_offset (r4, 0)
+ cfi_rel_offset (r5, 4)
+ cfi_rel_offset (r6, 8)
+ cfi_rel_offset (r7, 12)
mov r7, r0
mov r0, r1
mov r1, r2
@@ -32,6 +37,11 @@ ENTRY (syscall)
ldmfd ip, {r3, r4, r5, r6}
swi 0x0
ldmfd sp!, {r4, r5, r6, r7}
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r4)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
cmn r0, #4096
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
index a7dd40d74..9d90f3e35 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007
+/* Copyright (C) 2005, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -50,6 +50,7 @@
For the moment the LOAD_ARGS_7 is sacrificed.
We can't use push/pop inside the asm because that breaks
unwinding (ie. thread cancellation). */
+/* FIXME: the str / ldr of r7 are not covered by CFI information. */
#undef LOAD_ARGS_7
#undef INTERNAL_SYSCALL_RAW
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
@@ -100,11 +101,13 @@
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
- DOARGS_##args \
+ DOARGS_##args; \
mov ip, r7; \
+ cfi_register (r7, ip); \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
mov r7, ip; \
+ cfi_restore (r7); \
UNDOARGS_##args
#endif /* _LINUX_ARM_EABI_SYSDEP_H */
diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
index 9227bd79f..abac9e066 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 2005, 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
@@ -33,8 +33,13 @@ ENTRY (__mmap)
/* shuffle args */
str r5, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r5, 0)
ldr r5, [sp, #8]
str r4, [sp, #-4]!
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r4, 0)
+ cfi_remember_state
ldr r4, [sp, #8]
/* convert offset to pages */
@@ -48,12 +53,17 @@ ENTRY (__mmap)
/* restore registers */
2:
ldr r4, [sp], #4
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (r4)
ldr r5, [sp], #4
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (r5)
cmn r0, $4096
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
+ cfi_restore_state
.Linval:
mov r0, #-EINVAL
b 2b
@@ -74,6 +84,7 @@ ENTRY (__mmap)
/* store args on the stack */
stmdb sp!, {a1-a4}
+ cfi_adjust_cfa_offset (16)
/* do the syscall */
mov a1, sp
@@ -81,6 +92,7 @@ ENTRY (__mmap)
/* pop args off the stack. */
add sp, sp, #16
+ cfi_adjust_cfa_offset (-16)
cmn r0, $4096
RETINSTR(cc, lr)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
index 1c2e1f554..964a389a6 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 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
@@ -21,10 +21,14 @@
/* Save the PID value. */
#define SAVE_PID \
str lr, [sp, #-4]!; /* Save LR. */ \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
mov r0, #0xffff0fff; /* Point to the high page. */ \
mov lr, pc; /* Save our return address. */ \
sub pc, r0, #31; /* Jump to the TLS entry. */ \
ldr lr, [sp], #4; /* Restore LR. */ \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr); \
mov r2, r0; /* Save the TLS addr in r2. */ \
ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \
rsb r0, r3, #0; /* Negate it. */ \
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
index 87e055e65..009d03ad9 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 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
@@ -21,10 +21,14 @@
/* Save the PID value. */
#define SAVE_PID \
str lr, [sp, #-4]!; /* Save LR. */ \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
mov r0, #0xffff0fff; /* Point to the high page. */ \
mov lr, pc; /* Save our return address. */ \
sub pc, r0, #31; /* Jump to the TLS entry. */ \
ldr lr, [sp], #4; /* Restore LR. */ \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr); \
mov r2, r0; /* Save the TLS addr in r2. */ \
ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \
rsbs r0, r3, #0; /* Negate it. */ \
diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index 3911aee62..bd5b2ce3e 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -84,7 +84,7 @@
#undef PSEUDO_END
#define PSEUDO_END(name) \
- SYSCALL_ERROR_HANDLER \
+ SYSCALL_ERROR_HANDLER; \
END (name)
#undef PSEUDO_NOERRNO
@@ -129,17 +129,26 @@ __local_syscall_error: \
DO_RET(lr); \
1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
# else
-#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
-#define POP_PC ldr lr, [sp], #4; bx lr
-#else
-#define POP_PC ldr pc, [sp], #4
-#endif
+# if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
+# define POP_PC \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr); \
+ bx lr
+# else
+# define POP_PC \
+ ldr pc, [sp], #4
+# endif
# define SYSCALL_ERROR_HANDLER \
__local_syscall_error: \
str lr, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
str r0, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
bl PLTJMP(C_SYMBOL_NAME(__errno_location)); \
ldr r1, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
rsb r1, r1, #0; \
str r1, [r0]; \
mvn r0, #0; \
@@ -179,7 +188,7 @@ __local_syscall_error: \
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
- DOARGS_##args \
+ DOARGS_##args; \
swi SYS_ify (syscall_name); \
UNDOARGS_##args
@@ -188,18 +197,47 @@ __local_syscall_error: \
#define DOARGS_2 /* nothing */
#define DOARGS_3 /* nothing */
#define DOARGS_4 /* nothing */
-#define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $4];
-#define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmia ip, {r4, r5};
-#define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmia ip, {r4, r5, r6};
+#define DOARGS_5 \
+ str r4, [sp, $-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r4, 0); \
+ ldr r4, [sp, $4]
+#define DOARGS_6 \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ ldmia ip, {r4, r5}
+#define DOARGS_7 \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5, r6}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ cfi_rel_offset (r6, 8); \
+ ldmia ip, {r4, r5, r6}
#define UNDOARGS_0 /* nothing */
#define UNDOARGS_1 /* nothing */
#define UNDOARGS_2 /* nothing */
#define UNDOARGS_3 /* nothing */
#define UNDOARGS_4 /* nothing */
-#define UNDOARGS_5 ldr r4, [sp], $4;
-#define UNDOARGS_6 ldmfd sp!, {r4, r5};
-#define UNDOARGS_7 ldmfd sp!, {r4, r5, r6};
+#define UNDOARGS_5 \
+ ldr r4, [sp], $4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (r4)
+#define UNDOARGS_6 \
+ ldmfd sp!, {r4, r5}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (r4); \
+ cfi_restore (r5)
+#define UNDOARGS_7 \
+ ldmfd sp!, {r4, r5, r6}; \
+ cfi_adjust_cfa_offset (-12); \
+ cfi_restore (r4); \
+ cfi_restore (r5); \
+ cfi_restore (r6)
#else /* not __ASSEMBLER__ */