[meego-commits] 14744: Changes to devel:base/glibc
Austin Zhang
no_reply at build.meego.com
Mon Mar 14 09:44:24 UTC 2011
Hi,
I have made the following changes to glibc in project devel:base. Please review and accept ASAP.
Thank You,
Austin Zhang
[This message was auto-generated]
---
Request #14744:
submit: devel:toolchain/glibc -> devel:base/glibc
Message:
None
State: new 2011-03-14T02:44:00 austin
Comment: None
changes files:
--------------
--- glibc.changes
+++ glibc.changes
@@ -0,0 +1,3 @@
+* Thu Mar 10 2011 Junfeng Dong <junfeng.dong at intel.com> - 2.13
+- Update to 2.13.
+
old:
----
glibc-2.11-12-g24c0bf7-fedora.tar.bz2
glibc-2.11-12-g24c0bf7.tar.bz2
glibc-ports-2.11.tar.bz2
new:
----
glibc-2.13-fedora.tar.bz2
glibc-2.13.tar.bz2
glibc-ports-2.13.tar.bz2
spec files:
-----------
--- glibc.spec
+++ glibc.spec
@@ -1,5 +1,5 @@
-%define glibcsrcdir glibc-2.11-12-g24c0bf7
-%define glibcversion 2.11.90
+%define glibcsrcdir glibc-2.13
+%define glibcversion 2.13
### glibc.spec.in follows:
%define run_glibc_tests 0
%define multiarcharches %{ix86} x86_64
@@ -9,7 +9,7 @@
Summary: The GNU libc libraries
Name: glibc
-Version: 2.11.90
+Version: 2.13
Release: 12
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
@@ -19,26 +19,17 @@
License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Group: System/Libraries
URL: http://sources.redhat.com/glibc/
-Source0: glibc-2.11-12-g24c0bf7.tar.bz2
+Source0: glibc-2.13.tar.bz2
Source1: %{glibcsrcdir}-fedora.tar.bz2
-Source2: glibc-ports-2.11.tar.bz2
+Source2: glibc-ports-2.13.tar.bz2
Patch0: %{name}-fedora.patch
-Patch2: glibc-atom-memory-string-opt-tillto-20100226.patch
-Patch3: nis_shadow.diff
Patch4: tzdata-update.c.arm.patch
Patch5: glibc-arm-alignment-fix.patch
-Patch6: Correct-unwind-info-in-strcmp-sse4.S.patch
-Patch7: Update-xmm3-when-exit-from-loop.patch
-Patch8: prelink-causes-zypper-ref-to-die.patch
-Patch9: Fix-bugs-in-x86-32-strcmp-sse4.S-and-strcmp-ssse3.S.patch
-Patch10: cve-2010-0296-mount-DoS.patch
Patch11: glibc-arm-runfast.patch
-Patch12: glibc-arm-local-hwcap-updates.patch
-Patch13: glibc-arm-no-hwcap.patch
+#Patch13: glibc-arm-no-hwcap.patch
Patch14: cve-2010-3847.patch
-Patch15: cve-2010-3856.patch
Provides: ldconfig
# The dynamic linker supports DT_GNU_HASH
@@ -174,31 +165,21 @@
%prep
%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} -b1 -a2
%{?glibc_release_setup}
-mv glibc-ports-2.11 ports
+mv glibc-ports-2.13 ports
%patch0 -E -p1
-%patch2 -p1
-%patch3 -p1
%ifarch %{arm}
%patch4 -p1
%patch5 -p1
%endif
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-
%ifarch %{arm}
%patch11 -p1
-%patch12 -p0
-%patch13 -p1
+#%patch13 -p1
%endif
%patch14 -p1
-%patch15 -p1
cat > find_provides.sh <<EOF
#!/bin/sh
other changes:
--------------
++++++ glibc-2.13-fedora.tar.bz2 (new)
++++++ glibc-2.11-12-g24c0bf7-fedora.tar.bz2 -> glibc-2.13.tar.bz2
2723421 lines of diff (skipped)
++++++ glibc-fedora.patch
--- glibc-fedora.patch
+++ glibc-fedora.patch
@@ -1,99 +1,124 @@
---- glibc-2.11-12-g24c0bf7/ChangeLog
-+++ glibc-2.11.90-1/ChangeLog
-@@ -275,22 +275,6 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- * sysdeps/generic/netinet/ip.h: Define IPTOS_ENC* and IPTOS_DSCP*
- macros. Patch by Philip Prindeville <philipp at redfish-solutions.com>.
-
-- [BZ #10840]
-- * sysdeps/unix/sysv/linux/kernel-features.h: Define
-- __ASSUME_F_GETOWN_EX.
-- * sysdeps/unix/sysv/linux/fcntl.c: Implement F_GETOWN using F_GETOWN_EX
-- if possible.
-- * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
--
-- * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_OWNER_*
-- and f_owner_ex.
-- * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
--
- [BZ #10847]
- * sysdeps/gnu/getutmp.c: Allow compatibility code to play around with
- getutmpx symbol.
-@@ -378,17 +362,6 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- * locale/C-time.c: Revert week-1stday back to 19971130 and set
- first_weekday to 1 and first_workday to 2.
-
--2009-10-01 Ulrich Drepper <drepper at redhat.com>
--
-- * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_SETOWN_EX and
-- F_GETOWN_EX.
-- * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
-- * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
--
- 2009-09-28 Andreas Schwab <schwab at redhat.com>
+--- glibc-2.13/ChangeLog
++++ glibc-2.13-1/ChangeLog
+@@ -285,6 +285,11 @@
- * stdio-common/printf_fp.c: Check for and avoid integer overflows.
-@@ -1046,6 +1019,11 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- * sysdeps/generic/ldsodefs.h (struct rtld_global): The map element in
- the unique symbol hash table should not be const.
+ * sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_DISCARD): Define.
-+2009-07-22 Jakub Jelinek <jakub at redhat.com>
++2010-12-13 Andreas Schwab <schwab at redhat.com>
+
-+ * Makeconfig (ASFLAGS): Append $(sysdep-ASFLAGS).
-+ * sysdeps/i386/Makefile (sysdep-ASFLAGS): Add -U__i686.
++ * elf/dl-object.c (_dl_new_object): Ignore origin of privileged
++ program.
+
- 2009-07-21 Ulrich Drepper <drepper at redhat.com>
+ 2010-11-11 Andreas Schwab <schwab at redhat.com>
- * sysdeps/x86_64/multiarch/strstr.c: Minor cleanups. Remove
-@@ -1311,6 +1289,11 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- out common code into new function get_common_indeces. Determine
- extended family and model for Intel processors.
+ * posix/fnmatch_loop.c (NEW_PATTERN): Fix use of alloca.
+@@ -606,6 +611,11 @@
+ * string/str-two-way.h (two_way_long_needle): Always clear memory
+ when skipping input due to the shift table.
-+2009-06-26 Andreas Schwab <aschwab at redhat.com>
++2010-10-05 Andreas Schwab <schwab at redhat.com>
+
-+ * timezone/zic.c (stringzone): Don't try to generate a POSIX TZ
-+ string when the timezone ends in DST.
++ * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
++ decoding ACE if AI_CANONIDN.
+
- 2009-06-26 Ulrich Drepper <drepper at redhat.com>
+ 2010-10-03 Ulrich Drepper <drepper at gmail.com>
- * resolv/resolv.h: Define RES_SNGLKUPREOP.
-@@ -10004,6 +9987,10 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- [BZ #4368]
- * stdlib/stdlib.h: Remove obsolete part of comment for realpath.
+ [BZ #12005]
+@@ -648,6 +658,34 @@
+ * sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
+ Mask out sign-bit copies when constructing f_fsid.
-+2007-04-16 Jakub Jelinek <jakub at redhat.com>
++2010-09-28 Andreas Schwab <schwab at redhat.com>
+
-+ * locale/programs/locarchive.c (add_alias, insert_name): Remove static.
++ * elf/rtld.c (dl_main): Move setting of GLRO(dl_init_all_dirs)
++ before performing relro protection.
+
- 2007-04-16 Ulrich Drepper <drepper at redhat.com>
++2010-09-27 Andreas Schwab <schwab at redhat.com>
++
++ * include/link.h (struct link_map): Add l_free_initfini.
++ * elf/dl-deps.c (_dl_map_object_deps): Set it when assigning
++ l_initfini.
++ * elf/rtld.c (dl_main): Clear it on all objects loaded on startup.
++ * elf/dl-libc.c (free_mem): Free l_initfini if l_free_initfini is
++ set.
++
++ [BZ #11561]
++ * posix/regcomp.c (parse_bracket_exp): When looking up collating
++ elements compare against the byte sequence of it, not its name.
++
++ [BZ #6530]
++ * stdio-common/vfprintf.c (process_string_arg): Revert 2000-07-22
++ change.
++
++ * nss/nss_files/files-XXX.c (internal_getent): Declare linebuflen
++ as size_t.
++
++ * sysdeps/i386/i686/multiarch/strspn.S (ENTRY): Add missing
++ backslash.
++
+ 2010-09-24 Petr Baudis <pasky at suse.cz>
- [BZ #4364]
-@@ -11261,6 +11248,15 @@ d2009-10-30 Ulrich Drepper <drepper at redhat.com>
- separators also if no non-zero digits found.
- * stdlib/Makefile (tests): Add tst-strtod3.
+ * debug/stack_chk_fail_local.c: Add missing licence exception.
+@@ -1439,6 +1477,32 @@
+ call returning > 0 value.
+ * sysdeps/unix/sysv/linux/getlogin.c (getlogin): Likewise.
-+2006-12-10 Jakub Jelinek <jakub at redhat.com>
++2010-07-01 Andreas Schwab <schwab at redhat.com>
+
-+ * sysdeps/unix/sysv/linux/netlinkaccess.h: Include linux/if_addr.h
-+ if IFA_MAX is not defined.
-+ (IFA_RTA, IFA_PAYLOAD, IFLA_RTA, IFLA_PAYLOAD): Define if not
-+ defined.
-+ * sysdeps/unix/sysv/linux/check_pf.c: Include netlinkaccess.h
-+ instead of asm/types.h, linux/netlink.h and linux/rtnetlink.h.
++ * include/sys/resource.h (__getrlimit): Add hidden proto.
++ * sysdeps/unix/sysv/linux/i386/getrlimit.c: Add libc_hidden_weak.
++ * sysdeps/mach/hurd/getrlimit.c: Add libc_hidden_def.
++ * resource/getrlimit.c: Likewise.
+
- 2006-12-09 Ulrich Drepper <drepper at redhat.com>
++2010-06-28 Andreas Schwab <schwab at redhat.com>
++
++ * allocatestack.c (setxid_mark_thread): Ensure that the exiting
++ thread is woken up.
++
++ * elf/Makefile: Add rules to build and run unload8 test.
++ * elf/unload8.c: New file.
++ * elf/unload8mod1.c: New file.
++ * elf/unload8mod1x.c: New file.
++ * elf/unload8mod2.c: New file.
++ * elf/unload8mod3.c: New file.
++
++ * elf/dl-close.c (_dl_close_worker): Reset private search list if
++ it wasn't used.
++
++2010-06-21 Andreas Schwab <schwab at redhat.com>
++
++ * sysdeps/i386/i686/Makefile: Don't pass -mtune to assembler.
++
+ 2010-06-07 Andreas Schwab <schwab at redhat.com>
- [BZ #3632]
---- glibc-2.11-12-g24c0bf7/ChangeLog.15
-+++ glibc-2.11.90-1/ChangeLog.15
+ * dlfcn/Makefile: Remove explicit dependencies on libc.so and
+@@ -1491,6 +1555,24 @@
+ * hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
+ * sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
+
++2010-06-11 Andreas Schwab <schwab at redhat.com>
++
++ * elf/rtld.c (_dl_starting_up): Always define.
++ (dl_main): Always set _dl_starting_up.
++ * elf/dl-support.c (_dl_starting_up): Always define.
++ * elf/dl-init.c (_dl_init): Always clear _dl_starting_up.
++
++2010-06-10 Andreas Schwab <schwab at redhat.com>
++
++ * sysdeps/unix/sysv/linux/getpagesize.c: Don't assume AT_PAGESIZE
++ is always available.
++
++ * sysdeps/unix/sysv/linux/i386/Versions: Export __uname under
++ GLIBC_PRIVATE.
++ * nptl/Versions: Export __getrlimit under GLIBC_PRIVATE.
++ * sysdeps/unix/sysv/linux/i386/smp.h: Call __uname instead of uname.
++ * nptl/nptl-init.c: Call __getrlimit instead of getrlimit.
++
+ 2010-05-28 Luis Machado <luisgpm at br.ibm.com>
+
(2249 more lines skipped)
++++++ glibc-ports-2.11.tar.bz2 -> glibc-ports-2.13.tar.bz2
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
+2010-04-14 Joseph Myers <joseph at codesourcery.com>
+
+ * libc-abis: Remove.
+
+2010-04-06 Joseph Myers <joseph at codesourcery.com>
+
+ * libc-abis: New.
+
2006-03-06 Roland McGrath <roland at redhat.com>
* Makefile (%.bz2, %.gz): New pattern rules.
--- ChangeLog.alpha
+++ ChangeLog.alpha
@@ -1,3 +1,180 @@
+2010-09-26 Michael Cree <mcree at orcon.net.nz>
+
+ * sysdeps/alpha/memchr.c: Include <bp-sym.h>
+ (__memchr): Add casts for integer arithmetic on pointers.
+
+2010-09-23 Richard Henderson <rth at redhat.com>
+
+ [BZ #12019]
+ * sysdeps/alpha/alphaev6/memchr.S: Remove.
+ * sysdeps/alpha/memchr.S: Remove.
+ * sysdeps/alpha/memchr.c: New.
+
+2010-09-23 Richard Henderson <rth at redhat.com>
+
+ [BZ #1864]
+ * sysdeps/unix/sysv/linux/alpha/fstatfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/fstatvfs.c: New.
+ * sysdeps/unix/sysv/linux/alpha/fstatvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statvfs.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/syscalls.list (fstatfs, statfs):
+ Define without 64-bit aliases.
+
+2010-05-03 Aurelien Jarno <aurelien at aurel32.net>
+
+ * sysdeps/alpha/memchr.S: Use prefetch load.
+ * sysdeps/alpha/alphaev6/memchr.S: Likewise.
+
+2010-05-03 Aurelien Jarno <aurelien at aurel32.net>
+
+ [BZ #6827]
+ * sysdeps/alpha/dl-machine.h: Add dl-procinfo support.
+ * sysdeps/alpha/dl-procinfo.c: New.
+ * sysdeps/alpha/dl-procinfo.h: New.
+
+2010-05-03 Aurelien Jarno <aurelien at aurel32.net>
+
+ [BZ #5350]
+ * sysdeps/alpha/fpu/s_ceil.c: Fix corner cases.
+ * sysdeps/alpha/fpu/s_ceilf.c: Likewise.
+ * sysdeps/alpha/fpu/s_floor.c: Likewise.
+ * sysdeps/alpha/fpu/s_floorf.c: Likewise.
+ * sysdeps/alpha/fpu/s_rint.c: Likewise.
+ * sysdeps/alpha/fpu/s_rintf.c: Likewise.
+
+2010-05-03 GOTO Masanori <gotom at debian.or.jp>
+
+ [BZ #1026]
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h: Define
+ __ASSUME_STAT64_SYSCALL.
+ * sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
+ __ASSUME_STAT64_SYSCALL.
+ * sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
+ __libc_missing_axp_stat64 when it's not needed.
+ * sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
+
+2010-03-30 Richard Henderson <rth at redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/socket.h (MSG_WAITFORONE): New.
+
+2010-03-30 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h: New.
+
+2010-03-26 Richard Henderson <rth at redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S: New.
+
+2010-03-26 Richard Henderson <rth at redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/Versions: Update errlist-compat
+ for GLIBC_2.12.
+
+2010-03-26 Richard Henderson <rth at redhat.com>
+
+ * sysdeps/alpha/fpu/fegetenv.c: Add hidden alias.
+
+2010-03-26 Richard Henderson <rth at 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 at 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 at 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 at redhat.com>
+
+ * sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): Define for !PIC too.
+ (PTR_DEMANGLE): Likewise.
+
+2010-03-26 Richard Henderson <rth at 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 at redhat.com>
+
+ * sysdep/unix/sysv/linux/alpha/creat.c: New.
+
+2010-03-26 Richard Henderson <rth at 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 at 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 at gmail.com>
+ Aurelien Jarno <aurelien at aurel32.net>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/socket.h: New file.
+
+2010-01-12 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/stat.h: Fix double-inclusion
+ problem.
+
+2010-01-12 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Define
+ SA_RESTART, SA_NODEFER and SA_RESETHAND if __USE_XOPEN2K8.
+
+2010-01-12 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Define O_DIRECTORY,
+ O_NOFOLLOW, O_CLOEXEC, F_DUPFD_CLOEXEC, F_SETOWN, and F_GETOWN for
+ XPG7.
+ * sysdeps/unix/sysv/linux/alpha/bits/stat.h: Enable using from
+ fcntl.h.
+
+2010-01-12 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Redefine O_SYNC and
+ O_DSYNC to match 2.6.33+ kernels.
+
+2009-12-02 Mike Frysinger <vapier at gentoo.org>
+
+ * sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Fix typo in
+ include timer_gettime.c -> timer_settime.c.
+
+2009-11-23 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/stat.h: Use struct timespec
+ for timestamps also if __USE_XOPEN2K8.
+
+2009-11-23 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Change misleading
+ names of parameters of sync_file_range.
+
+2009-11-23 Matt Turner <mattst88 at gmail.com>
+
+ [BZ #10972]
+ * sysdeps/unix/sysv/linux/alpha/bits/mman.h: Add new MADV_*
+ constants from recent kernels.
+
2009-11-10 Matt Turner <mattst88 at gmail.com>
[BZ #10609]
--- ChangeLog.arm
+++ ChangeLog.arm
@@ -1,3 +1,184 @@
+2011-01-25 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/mman.h (MADV_HUGEPAGE,
+ MADV_NOHUGEPAGE): Define.
+
+2011-01-07 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/arm/eabi/fclrexcpt.c (__feclearexcept): Return zero if
+ unsupported but nothing needs to be done.
+ * sysdeps/arm/eabi/fraiseexcpt.c (feraiseexcept): Likewise.
+ * sysdeps/arm/eabi/fsetexcptflg.c (__fesetexceptflag): Likewise.
+
+2010-12-21 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/arm/stackinfo.h: Define DEFAULT_STACK_PERMS with PF_X.
+
+2010-11-24 Ken Werner <ken.werner at de.ibm.com>
+
+ * sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (atomic_full_barrier,
+ __arch_compare_and_exchange_val_32_acq): Use the atomic builtins
+ provided by GCC if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is defined.
+
+2010-11-22 Andreas Schwab <schwab at redhat.com>
+
+ * sysdeps/arm/preconfigure: Only modify CFLAGS when configuring
+ for arm-linux*eabi.
+
+2010-10-19 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/arm/bits/mathdef.h (FP_FAST_FMA, FP_FAST_FMAF,
+ FP_FAST_FMAL): Define if associated GCC macros are defined.
+
+2010-10-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/arm/eabi/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/arm/eabi/ftestexcept.c (fetestexcept): Add
+ libm_hidden_def.
+ * sysdeps/arm/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2010-09-30 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/syscalls.list: Add entry for
+ fanotify_mark syscall.
+
+2010-08-13 Alexander Kanevskiy <kad at kad.name>
+
+ * sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags):
+ Change "fast-mult" to "fastmult". Add new HWCAP names.
+ * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_DL_HWCAP_COUNT):
+ Change to 15.
+ (HWCAP_IMPORTANT): Change to (HWCAP_ARM_VFP | HWCAP_ARM_NEON).
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (HWCAP_ARM_CRUNCH,
+ HWCAP_ARM_THUMBEE, HWCAP_ARM_NEON, HWCAP_ARM_VFPv3,
+ HWCAP_ARM_VFPv3D16): Define.
+
+2010-08-12 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/syscalls.list: Add entry for
+ prlimit64 syscall.
+
+2010-06-14 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_SETPIPE_SZ,
+ F_GETPIPE_SZ): Define.
+
+2010-05-21 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S: New.
+
+2010-04-08 Daniel Jacobowitz <dan at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: New file.
+ * sysdeps/unix/sysv/linux/arm/eabi/sysdep.h [__thumb__]
+ (INTERNAL_SYSCALL_RAW): Rewrite to use __libc_do_syscall.
+ * sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall
+ to libraries and tests that require it.
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h: Delete.
+
+2010-03-30 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/arm/dl-machine.h (VALID_ELF_ABIVERSION, VALID_ELF_OSABI,
+ VALID_ELF_HEADER): Remove.
+ * sysdeps/unix/sysv/linux/arm/ldsodefs.h: New.
+
+2010-03-26 Thomas Schwinge <thomas at 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 at codesourcery.com>
+
+ * sysdeps/arm/eabi/fegetenv.c, sysdeps/arm/fpu/fegetenv.c: Add
+ hidden alias.
+
+2010-01-10 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Define O_DIRECTORY,
+ O_NOFOLLOW, O_CLOEXEC, F_DUPFD_CLOEXEC, F_SETOWN, and F_GETOWN for
+ XPG7.
+
+2009-12-16 Thomas Schwinge <thomas at codesourcery.com>
+
+ * sysdeps/arm/eabi/Makefile [gmon] (sysdep_routines): Add arm-mcount.
+ * sysdeps/arm/eabi/machine-gmon.h (mcount_internal): Define to
+ `__mcount_internal'.
+ (MCOUNT (__gnu_mcount_nc), OLD_MCOUNT (_mcount), mcount): Move to...
+ * sysdeps/arm/eabi/arm-mcount.S: ... this new file as __gnu_mcount_nc,
+ _mcount, and mcount, respectively.
+
+2009-12-15 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Redefine O_SYNC and
+ O_DSYNC to match 2.6.33+ kernels.
+
+2009-11-19 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Introduce new symbol
+ F_OWNER_PGRP and mark F_OWNER_GID obsolete.
+
+2009-11-19 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PSELECT,
+ __ASSUME_PPOLL): Don't undefine for kernel 2.6.32 and later.
+
+2009-11-18 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Change misleading
+ names of parameters of sync_file_range.
+
+2009-11-17 Joseph Myers <joseph at codesourcery.com>
+
+ [BZ #10972]
+ * sysdeps/unix/sysv/linux/arm/bits/mman.h: Add new MADV_*
+ constants from recent kernels.
+
2009-11-14 Joseph Myers <joseph at codesourcery.com>
* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_SETOWN_EX,
--- ChangeLog.hppa
+++ ChangeLog.hppa
@@ -1,3 +1,84 @@
+2010-06-24 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S: Only create stack
+ frame around call to SYSCALL_ERROR_HANDLER. Do not restore %rp
+ from the stack frame on successfull return.
+
+2010-06-23 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext_ret):
+ Document that this function is a non-standard calling ABI.
+ Document register usage.
+ (__getcontext): Use normal %sp without adjustment. Use named
+ resgister %sp.
+ * sysdeps/unix/sysv/linux/hppa/makecontext.c: Remove FRAME_SIZE.
+ Define FRAME_SIZE_UL, FRAME_SIZE_BYTES, ARGS.
+ (__makecontext): Create and setup a stack frame.
+ * sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext):
+ Use named register %sp. Do not use oSS_SP.
+
+2010-06-07 Andreas Schwab <schwab at redhat.com>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/pthread.h: Update to agree
+ with generic file.
+
+2010-03-30 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/socket.h: Define
+ MSG_WAITFORONE.
+
+2010-02-17 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/socket.h: Actually fix
+ SOCK_CLOEXEC to match O_CLOEXEC.
+
+2010-02-02 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/mman.h: Define
+ MADV_MERGEABLE and MADV_UNMERGEABLE.
+
+2010-02-02 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/hppa/nptl/tls.h (__set_cr27): Clobber
+ link register r31.
+
+2010-02-02 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/makecontext.c (__makecontext):
+ Support more than 8 arguments.
+
+2010-02-01 Kyle McMartin <kyle at redhat.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/socket.h: Fix value of
+ SOCK_CLOEXEC to match O_CLOEXEC.
+
+2010-02-01 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/Versions: Bump
+ errlist-compat to 257 for GLIBC_2.12.
+ * sysdeps/unix/sysv/linux/hppa/bits/errno.h
+ (EOWNERDEAD): Define if not already defined.
+ (ENOTRECOVERABLE): Likewise.
+ (ERFKILL): Likewise.
+
+2009-11-29 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h:
+ Rearrange file to reduce future maintenance.
+ [__USE_GNU]: Update F_GETOWN_EX, and F_SETOWN_EX.
+ Define f_owner_ex an __pid_type.
+
+2009-11-25 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
+ Use correct alignment for pthread_mutex_t, pthread_cond_t,
+ and pthread_rwlock_t.
+
+2009-11-22 Carlos O'Donell <carlos at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Avoid warnings
+ by casting oldval to int.
+
2009-11-15 Carlos O'Donell <carlos at codesourcery.com>
[BZ #6676]
@@ -7,7 +88,7 @@
2009-11-15 Carlos O'Donell <carlos at codesourcery.com>
- * sysdeps/unix/sysv/linux/hppa/Versions (libc): Add
+ * sysdeps/unix/sysv/linux/hppa/Versions (libc): Add
fallocate64@@GLIBC_2.11.
* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
[__USE_GNU]: Define F_GETOWN_EX, and F_SETOWN_EX.
@@ -15,7 +96,7 @@
[__USE_FILE_OFFSET64 && __REDIRECT]: Define __REDIRECT.
[__USE_FILE_OFFSET64 && !__REDIRECT]: Define fallocate as
fallocate64.
- [__USE_LARGEFILE64]: define fallocate64.
+ [__USE_LARGEFILE64]: define fallocate64.
2009-11-15 Carlos O'Donell <carlos at codesourcery.com>
@@ -51,10 +132,10 @@
* sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c: Remove.
2009-09-08 Carlos O'Donell <carlos at codesourcery.com>
-
+
sysdeps/unix/sysv/linux/hppa/
* internaltypes.h: New file.
-
+
sysdeps/unix/sysv/linux/hppa/nptl/
* pthreadP.h: New file.
* pthread.h: New file.
@@ -102,7 +183,7 @@
2009-02-25 Carlos O'Donell <carlos at codesourcery.com>
- * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define
FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME,
and FUTEX_BITSET_MATCH_ANY.
@@ -116,7 +197,7 @@
2009-02-13 Khem Raj <raj.khem at gmail.com>
- * sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
+ * sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
(libgcc_s_handle): New variable.
(pthread_cancel_init): Depend in libgcc_s_handle for decision to
load DSO. Assign last.
@@ -144,9 +225,9 @@
Carlos O'Donell <carlos at systemhalted.org>
[BZ #6037]
- * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11
+ * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11
(-EAGAIN) instead of 11. Loop again when the kernel
- returns -45 (-EDEADLOCK). Add back memory clobber.
+ returns -45 (-EDEADLOCK). Add back memory clobber.
Do not initialize lws_ret and lws_errno.
2008-06-17 Guy Martin <gmsoft at tuxicoman.be>
@@ -180,7 +261,7 @@
Guy Martin <gmsoft at tuxicoman.be>
[BZ #5923]
- * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass
timespec and futexp.
2008-02-22 Carlos O'Donell <carlos at codesourcery.com>
@@ -328,7 +409,7 @@
2007-05-17 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
+ * sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
(SEM_VALUE_MAX): Remove.
2007-05-17 Carlos O'Donell <carlos at systemhalted.org>
@@ -338,14 +419,14 @@
(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
(INTERNAL_SYSCALL): Likewise.
(INTERNAL_SYSCALL_NCS): Likewise.
- * sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use
+ * sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use
PIC_REG_DEF, PIC_REG_USE.
2007-05-01 Carlos O'Donell <carlos at systemhalted.org>
* sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
- [__USE_XOPEN2K]: Define pthread_rwlock_t and
- pthread_rwlockattr_t.
+ [__USE_XOPEN2K]: Define pthread_rwlock_t and
+ pthread_rwlockattr_t.
2007-02-02 Carlos O'Donell <carlos at systemhalted.org>
@@ -379,18 +460,18 @@
2006-09-20 Carlos O'Donell <carlos at systemhalted.org>
* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h (splice): Add offin
- and offout arguments to the prototype.
+ and offout arguments to the prototype.
2006-09-15 Carlos O'Donell <carlos at systemhalted.org>
* sysdeps/hppa/nptl/tcb-offsets.sym: Define TID_THREAD_OFFSET.
- * sysdeps/unix/sysv/linux/hppa/clone.S: Handle RESET_PID, and
+ * sysdeps/unix/sysv/linux/hppa/clone.S: Handle RESET_PID, and
restore r19 before call to _exit.
* sysdeps/unix/sysv/linux/hppa/nptl/clone.S: New file.
2006-09-13 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/hppa/dl-machine.h (RTLD_START): Comment the use of
+ * sysdeps/hppa/dl-machine.h (RTLD_START): Comment the use of
_dl_fini_plabel.
* sysdeps/hppa/elf/start.S: Correctly pass r23 to argument 6 of
__libc_start_main. Comment the order of arguments at entry and
@@ -410,7 +491,7 @@
as -EAGAIN.
* sysdeps/unix/sysv/linux/hppa/bits/mman.h: Adjust definitions to
match required standards.
- * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
(lll_futex_wait): Return __ret.
(lll_futex_timed_wait): Likewise.
(lll_futex_wake): Likewise.
@@ -433,7 +514,7 @@
2006-07-24 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
+ * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
__SIZEOF_PTHREAD_COND_T is 64 bytes. Remove __PAD_ATOMIC_LOCK_T.
2006-07-18 Carlos O'Donell <carlos at systemhalted.org>
@@ -459,7 +540,7 @@
* sysdeps/unix/sysv/linux/hppa/xstat.c: New file.
* sysdeps/unix/sysv/linux/hppa/lxstat.c: Likewise.
- * sysdeps/unix/sysv/linux/hppa/fxstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/fxstat.c: Likewise.
* sysdeps/unix/sysv/linux/hppa/fxstatat.c: Likewise.
2006-07-13 Carlos O'Donell <carlos at systemhalted.org>
@@ -488,12 +569,12 @@
2006-06-08 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/Versions: new errlist compat entry
+ * sysdeps/unix/sysv/linux/hppa/Versions: new errlist compat entry
for up to 256 errnos
2006-06-08 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/hppa/hppa1.1/Implies: Remove ieee754/ldbl-128.
+ * sysdeps/hppa/hppa1.1/Implies: Remove ieee754/ldbl-128.
* sysdeps/unix/sysv/linux/hppa/kernel-features.h
[__LINUX_KERNEL_VERSION >= 0x020609]: Define __ASSUME_LWS_CAS.
* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: New file.
@@ -591,9 +672,9 @@
2006-04-19 Carlos O'Donell <carlos at systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_GNU]:
+ * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_GNU]:
Define MMAP_FIXED.
- * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_GNU]:
+ * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_GNU]:
Define SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE,
SYNC_FILE_RANGE_WAIT_AFTER, sync_file_range, splice, tee.
--- ChangeLog.m68k
+++ ChangeLog.m68k
@@ -1,3 +1,205 @@
+2011-01-18 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_HUGEPAGE)
+ (MADV_NOHUGEPAGE): Define.
+
+2011-01-10 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h (sem_t):
+ Force alignment.
+
+2010-12-26 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/m68k/stackinfo.h (DEFAULT_STACK_PERMS): Define.
+
+2010-11-05 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/fchownat.c: Include
+ i386/fchownat.c.
+
+2010-10-11 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Remove fma inlines.
+
+ * sysdeps/m68k/fpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/m68k/fpu/ftestexcept.c (feupdateenv): Add
+ libm_hidden_def.
+
+2010-08-25 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
+ (SYSCALL_ERROR_LOAD_GOT): Use & instead of #.
+
+2010-08-17 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/syscalls.list: Remove
+ fanotify_init.
+
+2010-08-14 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/syscalls.list: Add prlimit64,
+ fanotify_init, fanotify_mask.
+
+2010-08-02 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/m68k/coldfire/sysdep.h: New file.
+ (PCREL_OP): Define.
+ * sysdeps/m68k/m680x0/sysdep.h: New file.
+ (PCREL_OP): Define.
+ * sysdeps/m68k/sysdep.h (PCREL_OP): Don't define here.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h: New file.
+ (SYSCALL_ERROR_LOAD_GOT): Define.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h: New file.
+ (SYSCALL_ERROR_LOAD_GOT): Define.
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h: Don't include subordinate
+ sysdep files.
+ (SYSCALL_ERROR_HANDLER) [PIC && USE___THREAD]: Use
+ SYSCALL_ERROR_LOAD_GOT.
+
+2010-06-24 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_SETPIPE_SZ,
+ F_GETPIPE_SZ): Define.
+
+2010-06-13 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Mark all functions as
+ non-throwing.
+
+ * sysdeps/unix/sysv/linux/m68k/sys/user.h (NBPG, UPAGES)
+ (HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Define.
+
+2010-06-11 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: Force
+ alignment of futex variables.
+
+2010-05-22 Andreas Schwab <schwab at linux-m68k.org>
+
+ * data/c++-types-m68k-linux-gnu.data: New file.
+ * data/localplt-m68k-linux-gnu.data: New file.
+
+2010-03-13 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Use signbit macro.
+ * sysdeps/m68k/m680x0/fpu/s_ccos.c: Likewise.
+
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__signbit)
+ (__signbitf, __signbitl): Always define as inline.
+
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Add variant for USE__THREAD.
+
+2010-03-12 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: Don't include
+ <sysdep.h>.
+
+ * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: Renamed ...
+ * sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S: ... to
+ this.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S: New file.
+
+2010-03-09 Maxim Kuvyrkov <maxim at codesourcery.com>
+
+ NPTL support for m68k/ColdFire
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h (tls.h): Include.
+ (INTERNAL_SYSCALL): Convert to INTERNAL_SYSCALL_NCS.
+ (PTR_MANGLE, PTR_DEMANGLE): Define.
+ (NEED_STATIC_SYSINFO_DSO): Define.
+ * sysdeps/unix/sysv/linux/m68k/clone.S: Support RESET_PID.
+ * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: New.
+ * sysdeps/unix/sysv/linux/m68k/Makefile: Add new files to lists.
+ * sysdeps/unix/sysv/linux/m68k/vfork.S: Add SAVE_PID/RESTORE_PID.
+ * sysdeps/unix/sysv/linux/m68k/m68k-vdso.c: New.
+ * sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c: New.
+ * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: New.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h: New.
+ * sysdeps/unix/sysv/linux/m68k/Versions: Add symbols for NPTL support.
+ * sysdeps/unix/sysv/linux/m68k/init-first.c: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/clone.S: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/fork.c: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/vfork.S: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/createthread.c: New.
+ * sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c: New.
+ * sysdeps/unix/sysv/linux/m68k/socket.S: Update cancelation code.
+ * sysdeps/m68k/dl-tls.h: New.
+ * sysdeps/m68k/libc-tls.c: New.
+ * sysdeps/m68k/tls-macros.h: New.
+ * sysdeps/m68k/dl-machine.h (RTLD_START): Terminate stack frame to
+ generate better backtraces.
+ (elf_machine_type_class, elf_machine_rela): Handle TLS relocations.
+ * sysdeps/m68k/dl-machine.h: Handle TLS relocations.
+ * sysdeps/m68k/nptl/tcb-offsets.sym: New.
+ * sysdeps/m68k/nptl/pthread_spin_trylock.c: New.
+ * sysdeps/m68k/nptl/tls.h: New.
+ * sysdeps/m68k/nptl/pthread_spin_lock.c: New.
+ * sysdeps/m68k/nptl/pthreaddef.h: New.
+ * sysdeps/m68k/nptl/Makefile: New.
+
+ * sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h: Remove.
+ * sysdeps/unix/sysv/linux/m68k/register-dump.h: Update.
+
+ * sysdeps/unix/sysv/linux/m68k/bits/siginfo.h: Remove.
+
+ * sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ)
+ (_jmpbuf_sp, _JMPBUF_UNWINDS_ADJ, __libc_unwind_longjmp): Define.
+
+2010-02-10 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/m68k/fpu/fegetenv.c: Add hidden alias.
+
+2010-01-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Fix double-inclusion
+ problem.
+
+2010-01-10 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Define O_DIRECTORY,
+ O_NOFOLLOW, O_CLOEXEC, F_DUPFD_CLOEXEC, F_SETOWN, and F_GETOWN for
+ XPG7.
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Enable using from
+ fcntl.h.
+
+2009-12-16 Joseph Myers <joseph at codesourcery.com>
+
+ [BZ #11093]
+ * sysdeps/unix/sysv/linux/m68k/bits/poll.h: Define POLLRDNORM,
+ POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
+
+2009-12-16 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
+ O_DSYNC to match 2.6.33+ kernels.
+
+2009-11-23 Andreas Schwab <schwab at linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Use struct timespec
+ for timestamps also if __USE_XOPEN2K8.
+
+2009-11-19 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Introduce new symbol
+ F_OWNER_PGRP and mark F_OWNER_GID obsolete.
+
+2009-11-18 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Change misleading
+ names of parameters of sync_file_range.
+
+2009-11-17 Joseph Myers <joseph at codesourcery.com>
+
+ [BZ #10972]
+ * sysdeps/unix/sysv/linux/m68k/bits/mman.h: Add new MADV_*
+ constants from recent kernels.
+
2009-11-15 Andreas Schwab <schwab at linux-m68k.org>
* sysdeps/m68k/libgcc_s.h: New file.
--- ChangeLog.mips
+++ ChangeLog.mips
@@ -1,3 +1,206 @@
+2011-01-25 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/mman.h (MADV_HUGEPAGE,
+ MADV_NOHUGEPAGE): Define.
+
+2011-01-25 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h (AF_CAIF, AF_ALG,
+ PF_CAIF, PF_ALG): Define.
+
+2010-12-30 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/init-first.c: Don't call __libc_global_ctors if
+ NO_CTORS_DTORS_SECTIONS is defined.
+ * sysdeps/mach/hurd/mips/init-first.c: Likewise.
+
+2010-12-21 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/stackinfo.h: Define DEFAULT_STACK_PERMS with PF_X.
+
+2010-12-06 Matt Turner <mattst88 at gmail.com>
+
+ * sysdeps/unix/sysv/linux/mips/getpagesize.c: Delete file.
+
+2010-12-06 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/configure.in (arch_minimum_kernel):
+ Change to 2.4.1.
+ * sysdeps/unix/sysv/linux/mips/configure: Regenerate.
+
+2010-10-21 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/syscalls.list,
+ sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list,
+ sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Add entries
+ for fanotify_mark.
+
+2010-10-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_def.
+ * sysdeps/mips/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2010-08-13 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/kernel-features.h
+ (__ASSUME_GETDENTS64_SYSCALL): Undefine for n32 ABI before 2.6.35.
+
+2010-08-13 Chandrakala Chavva <cchavva at caviumnetworks.com>
+
+ * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Add 'nop' in
+ jump delay slot.
+ * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Ditto.
+
+2010-08-13 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/termios.h (EXTPROC): Define.
+
+2010-08-12 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/statfs.h (struct statfs,
+ struct statfs64): Add f_flags field.
+
+2010-08-12 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/sys/inotify.h (IN_EXCL_UNLINK):
+ Define.
+
+2010-08-12 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/resource.h: Declare prlimit
+ and prlimit64.
+ * sysdeps/unix/sysv/linux/mips/mips32/syscalls.list,
+ sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: New files.
+ * sysdeps/unix/sysv/linux/mips/n32/syscalls.list: Add entry for
+ prlimit64 syscall.
+
+2010-06-14 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETPIPE_SZ,
+ F_GETPIPE_SZ): Define.
+
+2010-05-21 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c,
+ sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S: New.
+
+2010-04-14 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/libc-abis: New.
+
+2010-04-06 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/dl-machine.h (VALID_ELF_ABIVERSION,
+ VALID_ELF_OSABI, VALID_ELF_HEADER): Remove.
+ * sysdeps/unix/sysv/linux/mips/ldsodefs.h (VALID_ELF_ABIVERSION):
+ Define.
+
+2010-03-30 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h: Define
+ MSG_WAITFORONE.
+
+2010-03-24 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/dl-lookup.c: Update from generic version.
+
+2010-03-23 Mischa Jonker <mischa.jonker at 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 at codesourcery.com>
+
+ * sysdeps/mips/fpu/fegetenv.c: Add hidden alias.
+
+2010-01-28 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/dl-trampoline.c (_dl_runtime_resolve,
+ _dl_runtime_pltresolve): Calculate offset from start of function
+ to .cpload instead of hardcoding instruction size.
+
+2010-01-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/stat.h: Fix double-inclusion
+ problem.
+
+2010-01-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Define
+ SA_RESTART, SA_NODEFER and SA_RESETHAND if __USE_XOPEN2K8.
+
+2010-01-10 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Define O_DIRECTORY,
+ O_NOFOLLOW, O_CLOEXEC, F_DUPFD_CLOEXEC, F_SETOWN, and F_GETOWN for
+ XPG7.
+ * sysdeps/unix/sysv/linux/mips/bits/stat.h: Enable using from
+ fcntl.h.
+
+2009-12-16 Joseph Myers <joseph at codesourcery.com>
+
+ [BZ #11093]
+ * sysdeps/unix/sysv/linux/mips/bits/poll.h: Define POLLRDNORM,
+ POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
+
+2009-12-16 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/dl-lookup.c: Update from generic version.
+
+2009-12-15 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Redefine O_SYNC and
+ O_DSYNC to match 2.6.33+ kernels.
+
+2009-12-09 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h: Define mmsghdr and
+ declare recvmmsg.
+
+2009-12-01 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+ (posix_fadvise): Remove.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c,
+ sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c,
+ sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c: New.
+
+2009-12-01 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/mips/dl-lookup.c: Update from generic version.
+
+2009-11-23 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/stat.h: Use struct timespec
+ for timestamps also if __USE_XOPEN2K8.
+
+2009-11-19 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Introduce new symbol
+ F_OWNER_PGRP and mark F_OWNER_GID obsolete.
+
+2009-11-18 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Change misleading
+ names of parameters of sync_file_range.
+
+2009-11-17 Joseph Myers <joseph at codesourcery.com>
+
+ [BZ #10972]
+ * sysdeps/unix/sysv/linux/mips/bits/mman.h: Add new MADV_*
+ constants from recent kernels.
+
+2009-11-17 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/errno.h (ERFKILL): Define if
+ not already defined.
+
2009-11-14 Joseph Myers <joseph at codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETOWN_EX,
--- ChangeLog.powerpc
+++ ChangeLog.powerpc
@@ -1,3 +1,34 @@
+2010-09-03 Luis Machado <luisgpm at br.ibm.com>
+
+ * sysdeps/powerpc/dl-procinfo.c: New file.
+ * sysdeps/powerpc/dl-procinfo.h: New file.
+ * sysdeps/powerpc/powerpc32/405/memcmp.S: New file.
+ * sysdeps/powerpc/powerpc32/405/memcpy.S: New file.
+ * sysdeps/powerpc/powerpc32/405/memset.S: New file.
+ * sysdeps/powerpc/powerpc32/405/strcmp.S: New file.
+ * sysdeps/powerpc/powerpc32/405/strcpy.S: New file.
+ * sysdeps/powerpc/powerpc32/405/strlen.S: New file.
+ * sysdeps/powerpc/powerpc32/405/strncmp.S: New file.
+ * sysdeps/powerpc/powerpc32/440/Implies: New file.
+ * sysdeps/powerpc/powerpc32/464/Implies: New file.
+ * sysdeps/powerpc/powerpc32/476/Implies: New file.
+ * sysdeps/powerpc/powerpc32/Makefile: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies: New file.
+
+2010-10-11 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/powerpc/nofpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/powerpc/nofpu/ftestexcept.c (fetestexcept): Add
+ libm_hidden_def.
+
+2010-02-10 Joseph Myers <joseph at codesourcery.com>
+
+ * sysdeps/powerpc/nofpu/fegetenv.c: Add hidden alias.
+
2008-08-19 Joseph Myers <joseph at codesourcery.com>
* sysdeps/powerpc/nofpu/shlib-versions: New.
--- data/c++-types-m68k-linux-gnu.data
+++ data/c++-types-m68k-linux-gnu.data
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
--- data/localplt-m68k-linux-gnu.data
+++ data/localplt-m68k-linux-gnu.data
+libc.so: _Unwind_Find_FDE
+libc.so: __m68k_read_tp
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
--- sysdeps/alpha/alphaev6/memchr.S
+++ sysdeps/alpha/alphaev6/memchr.S
-/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger (davidm at cs.arizona.edu).
- EV6 optimized by Rick Gorton <rick.gorton at alpha-processor.com>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- 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>
-
- .arch ev6
- .set noreorder
- .set noat
-
-ENTRY(__memchr)
-#ifdef PROF
- ldgp gp, 0(pv)
- lda AT, _mcount
- jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
-#endif
-
- # Hack -- if someone passes in (size_t)-1, hoping to just
- # search til the end of the address space, we will overflow
- # below when we find the address of the last byte. Given
- # that we will never have a 56-bit address space, cropping
- # the length is the easiest way to avoid trouble.
- zap $18, 0x80, $5 # U : Bound length
- beq $18, $not_found # U :
- ldq_u $1, 0($16) # L : load first quadword Latency=3
- and $17, 0xff, $17 # E : L L U U : 00000000000000ch
-
- insbl $17, 1, $2 # U : 000000000000ch00
- cmpult $18, 9, $4 # E : small (< 1 quad) string?
- or $2, $17, $17 # E : 000000000000chch
- lda $3, -1($31) # E : U L L U
-
- sll $17, 16, $2 # U : 00000000chch0000
- addq $16, $5, $5 # E : Max search address
- or $2, $17, $17 # E : 00000000chchchch
- sll $17, 32, $2 # U : U L L U : chchchch00000000
-
- or $2, $17, $17 # E : chchchchchchchch
- extql $1, $16, $7 # U : $7 is upper bits
- beq $4, $first_quad # U :
- ldq_u $6, -1($5) # L : L U U L : eight or less bytes to search Latency=3
-
- extqh $6, $16, $6 # U : 2 cycle stall for $6
- mov $16, $0 # E :
- nop # E :
- or $7, $6, $1 # E : L U L U $1 = quadword starting at $16
-
- # Deal with the case where at most 8 bytes remain to be searched
- # in $1. E.g.:
- # $18 = 6
- # $1 = ????c6c5c4c3c2c1
-$last_quad:
- negq $18, $6 # E :
- xor $17, $1, $1 # E :
- srl $3, $6, $6 # U : $6 = mask of $18 bits set
- cmpbge $31, $1, $2 # E : L U L U
-
- nop
- nop
- and $2, $6, $2 # E :
- beq $2, $not_found # U : U L U L
-
-$found_it:
-#if defined(__alpha_fix__) && defined(__alpha_cix__)
- /*
- * Since we are guaranteed to have set one of the bits, we don't
- * have to worry about coming back with a 0x40 out of cttz...
- */
- cttz $2, $3 # U0 :
- addq $0, $3, $0 # E : All done
- nop # E :
- ret # L0 : L U L U
-#else
- /*
- * Slow and clunky. It can probably be improved.
- * An exercise left for others.
- */
- negq $2, $3 # E :
- and $2, $3, $2 # E :
- and $2, 0x0f, $1 # E :
- addq $0, 4, $3 # E :
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop # E : keep with cmov
- and $2, 0x33, $1 # E :
- addq $0, 2, $3 # E : U L U L : 2 cycle stall on $0
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop # E : keep with cmov
- and $2, 0x55, $1 # E :
- addq $0, 1, $3 # E : U L U L : 2 cycle stall on $0
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop
- nop
- ret # L0 : L U L U
-#endif
-
- # Deal with the case where $18 > 8 bytes remain to be
- # searched. $16 may not be aligned.
- .align 4
-$first_quad:
- andnot $16, 0x7, $0 # E :
- insqh $3, $16, $2 # U : $2 = 0000ffffffffffff ($16<0:2> ff)
- xor $1, $17, $1 # E :
- or $1, $2, $1 # E : U L U L $1 = ====ffffffffffff
-
- cmpbge $31, $1, $2 # E :
- bne $2, $found_it # U :
- # At least one byte left to process.
- ldq $1, 8($0) # L :
- subq $5, 1, $18 # E : U L U L
-
- addq $0, 8, $0 # E :
- # Make $18 point to last quad to be accessed (the
- # last quad may or may not be partial).
- andnot $18, 0x7, $18 # E :
- cmpult $0, $18, $2 # E :
- beq $2, $final # U : U L U L
-
- # At least two quads remain to be accessed.
-
- subq $18, $0, $4 # E : $4 <- nr quads to be processed
- and $4, 8, $4 # E : odd number of quads?
- bne $4, $odd_quad_count # U :
- # At least three quads remain to be accessed
- mov $1, $4 # E : L U L U : move prefetched value to correct reg
-
- .align 4
-$unrolled_loop:
- ldq $1, 8($0) # L : prefetch $1
- xor $17, $4, $2 # E :
- cmpbge $31, $2, $2 # E :
- bne $2, $found_it # U : U L U L
-
- addq $0, 8, $0 # E :
- nop # E :
- nop # E :
- nop # E :
-
-$odd_quad_count:
- xor $17, $1, $2 # E :
- ldq $4, 8($0) # L : prefetch $4
- cmpbge $31, $2, $2 # E :
- addq $0, 8, $6 # E :
-
- bne $2, $found_it # U :
- cmpult $6, $18, $6 # E :
- addq $0, 8, $0 # E :
- nop # E :
-
- bne $6, $unrolled_loop # U :
- mov $4, $1 # E : move prefetched value into $1
- nop # E :
- nop # E :
-
-$final: subq $5, $0, $18 # E : $18 <- number of bytes left to do
- nop # E :
- nop # E :
- bne $18, $last_quad # U :
-
-$not_found:
- mov $31, $0 # E :
- nop # E :
- nop # E :
- ret # L0 :
-
- END(__memchr)
-
-weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
-libc_hidden_builtin_def (memchr)
--- sysdeps/alpha/bits/atomic.h
+++ 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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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 @@
#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" \
--- sysdeps/alpha/dl-machine.h
+++ sysdeps/alpha/dl-machine.h
@@ -249,6 +249,18 @@
/* The alpha never uses Elf64_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
+/* We define an initialization functions. This is called very early in
+ * _dl_sysdep_start. */
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+ if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+ /* Avoid an empty string which would disturb us. */
+ GLRO(dl_platform) = NULL;
+}
+
/* Fix up the instructions of a PLT entry to invoke the function
rather than the dynamic linker. */
static inline Elf64_Addr
--- sysdeps/alpha/dl-procinfo.c
+++ sysdeps/alpha/dl-procinfo.c
+/* Data for Alpha version of processor capability information.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Aurelien Jarno <aurelien at aurel32.net>, 2008.
+
+ 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. */
+
+/* This information must be kept in sync with the _DL_PLATFORM_COUNT
+ definitions in procinfo.h.
+
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+#define PROCINFO_CLASS
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_alpha_platforms
+#else
+PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ "ev4", "ev5", "ev56", "ev6", "ev67"
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
--- sysdeps/alpha/dl-procinfo.h
+++ sysdeps/alpha/dl-procinfo.h
+/* Alpha version of processor capability information handling macros.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Aurelien Jarno <aurelien at aurel32.net>, 2008.
+
+ 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 _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+
+#include <ldsodefs.h>
+
+
+/* Mask to filter out platforms. */
+#define _DL_HWCAP_PLATFORM (-1ULL)
+
+#define _DL_PLATFORMS_COUNT 5
+
+static inline const char *
+__attribute__ ((unused))
+_dl_platform_string (int idx)
+{
+ return GLRO(dl_alpha_platforms)[idx];
+};
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_platform (const char *str)
+{
+ int i;
+
+ if (str != NULL)
+ for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
+ {
+ if (strcmp (str, _dl_platform_string (i)) == 0)
+ return i;
+ }
+ return -1;
+};
+
+/* We cannot provide a general printing function. */
+#define _dl_procinfo(word) -1
+
+/* There are no hardware capabilities defined. */
+#define _dl_hwcap_string(idx) ""
+
+/* By default there is no important hardware capability. */
+#define HWCAP_IMPORTANT (0)
+
+/* We don't have any hardware capabilities. */
+#define _DL_HWCAP_COUNT 0
+
+#define _dl_string_hwcap(str) (-1)
+
+#endif /* dl-procinfo.h */
--- sysdeps/alpha/elf/configure
+++ sysdeps/alpha/elf/configure
@@ -4,10 +4,10 @@
if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
-echo "$as_me:$LINENO: checking for Alpha TLS support" >&5
-echo $ECHO_N "checking for Alpha TLS support... $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for Alpha TLS support" >&5
+$as_echo_n "checking for Alpha TLS support... " >&6; }
if test "${libc_cv_alpha_tls+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $as_echo_n "(cached) " >&6
else
cat > conftest.s <<\EOF
.section ".tdata", "awT", @progbits
@@ -47,7 +47,7 @@
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
libc_cv_alpha_tls=yes
else
@@ -55,8 +55,8 @@
fi
rm -f conftest*
fi
-echo "$as_me:$LINENO: result: $libc_cv_alpha_tls" >&5
-echo "${ECHO_T}$libc_cv_alpha_tls" >&6
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_alpha_tls" >&5
+$as_echo "$libc_cv_alpha_tls" >&6; }
if test $libc_cv_alpha_tls = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TLS_SUPPORT 1
@@ -65,19 +65,15 @@
fi
fi
-echo "$as_me:$LINENO: checking for GP relative module local relocs" >&5
-echo $ECHO_N "checking for GP relative module local relocs... $ECHO_C" >&6
+{ $as_echo "$as_me:$LINENO: checking for GP relative module local relocs" >&5
+$as_echo_n "checking for GP relative module local relocs... " >&6; }
if test "${libc_cv_alpha_hidden_gprel+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $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
@@ -85,7 +81,7 @@
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
if grep -q 'bar.*!gprel' conftest.s \
&& grep -q 'baz.*!gprel' conftest.s \
@@ -96,8 +92,8 @@
fi
rm -f conftest*
fi
-echo "$as_me:$LINENO: result: $libc_cv_alpha_hidden_gprel" >&5
-echo "${ECHO_T}$libc_cv_alpha_hidden_gprel" >&6
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_alpha_hidden_gprel" >&5
+$as_echo "$libc_cv_alpha_hidden_gprel" >&6; }
if test $libc_cv_alpha_hidden_gprel = yes; then
cat >>confdefs.h <<\_ACEOF
#define PI_STATIC_AND_HIDDEN 1
--- sysdeps/alpha/elf/configure.in
+++ sysdeps/alpha/elf/configure.in
@@ -53,13 +53,9 @@
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
--- sysdeps/alpha/fpu/fegetenv.c
+++ 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 at tamu.edu>, 1997
@@ -45,3 +45,4 @@
#endif
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
+libm_hidden_ver(__fegetenv, fegetenv)
--- sysdeps/alpha/fpu/s_ceil.c
+++ sysdeps/alpha/fpu/s_ceil.c
@@ -27,20 +27,25 @@
double
__ceil (double x)
{
- double two52 = copysign (0x1.0p52, x);
- double r, tmp;
-
- __asm (
+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
+ {
+ double tmp1, new_x;
+
+ new_x = -x;
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+ "cvttq/svim %2,%1\n\t"
#else
- "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+ "cvttq/svm %2,%1\n\t"
#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(-x), "f"(-two52));
+ "cvtqt/m %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1)
+ : "f"(new_x));
- /* Fix up the negation we did above, as well as handling -0 properly. */
- return copysign (r, x);
+ /* Fix up the negation we did above, as well as handling -0 properly. */
+ x = copysign(new_x, x);
+ }
+ return x;
}
weak_alias (__ceil, ceil)
--- sysdeps/alpha/fpu/s_ceilf.c
+++ sysdeps/alpha/fpu/s_ceilf.c
@@ -26,20 +26,30 @@
float
__ceilf (float x)
{
- float two23 = copysignf (0x1.0p23, x);
- float r, tmp;
-
- __asm (
+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
+ {
+ /* Note that Alpha S_Floating is stored in registers in a
+ restricted T_Floating format, so we don't even need to
+ convert back to S_Floating in the end. The initial
+ conversion to T_Floating is needed to handle denormals. */
+
+ float tmp1, tmp2, new_x;
+
+ new_x = -x;
+ __asm ("cvtst/s %3,%2\n\t"
#ifdef _IEEE_FP_INEXACT
- "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+ "cvttq/svim %2,%1\n\t"
#else
- "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+ "cvttq/svm %2,%1\n\t"
#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(-x), "f"(-two23));
+ "cvtqt/m %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+ : "f"(new_x));
- /* Fix up the negation we did above, as well as handling -0 properly. */
- return copysignf (r, x);
+ /* Fix up the negation we did above, as well as handling -0 properly. */
+ x = copysignf(new_x, x);
+ }
+ return x;
}
weak_alias (__ceilf, ceilf)
--- sysdeps/alpha/fpu/s_floor.c
+++ sysdeps/alpha/fpu/s_floor.c
@@ -21,26 +21,32 @@
#include <math_ldbl_opt.h>
-/* Use the -inf rounding mode conversion instructions to implement floor. */
+/* Use the -inf rounding mode conversion instructions to implement
+ floor. We note when the exponent is large enough that the value
+ must be integral, as this avoids unpleasant integer overflows. */
double
__floor (double x)
{
- double two52 = copysign (0x1.0p52, x);
- double r, tmp;
-
- __asm (
+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
+ {
+ double tmp1, new_x;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+ "cvttq/svim %2,%1\n\t"
#else
- "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+ "cvttq/svm %2,%1\n\t"
#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(x), "f"(two52));
+ "cvtqt/m %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1)
+ : "f"(x));
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- return copysign (r, x);
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign(new_x, x);
+ }
+ return x;
}
weak_alias (__floor, floor)
--- sysdeps/alpha/fpu/s_floorf.c
+++ sysdeps/alpha/fpu/s_floorf.c
@@ -20,26 +20,37 @@
#include <math.h>
-/* Use the -inf rounding mode conversion instructions to implement floor. */
+/* Use the -inf rounding mode conversion instructions to implement
+ floor. We note when the exponent is large enough that the value
+ must be integral, as this avoids unpleasant integer overflows. */
float
__floorf (float x)
{
- float two23 = copysignf (0x1.0p23, x);
- float r, tmp;
-
- __asm (
+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
+ {
+ /* Note that Alpha S_Floating is stored in registers in a
+ restricted T_Floating format, so we don't even need to
+ convert back to S_Floating in the end. The initial
+ conversion to T_Floating is needed to handle denormals. */
+
+ float tmp1, tmp2, new_x;
+
+ __asm ("cvtst/s %3,%2\n\t"
#ifdef _IEEE_FP_INEXACT
- "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+ "cvttq/svim %2,%1\n\t"
#else
- "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+ "cvttq/svm %2,%1\n\t"
#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(x), "f"(two23));
+ "cvtqt/m %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+ : "f"(x));
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- return copysignf (r, x);
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf(new_x, x);
+ }
+ return x;
}
weak_alias (__floorf, floorf)
--- sysdeps/alpha/fpu/s_rint.c
+++ sysdeps/alpha/fpu/s_rint.c
@@ -24,15 +24,24 @@
double
__rint (double x)
{
- double two52 = copysign (0x1.0p52, x);
- double r;
-
- r = x + two52;
- r = r - two52;
+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
+ {
+ double tmp1, new_x;
+ __asm (
+#ifdef _IEEE_FP_INEXACT
+ "cvttq/svid %2,%1\n\t"
+#else
+ "cvttq/svd %2,%1\n\t"
+#endif
+ "cvtqt/d %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1)
+ : "f"(x));
- /* rint(-0.1) == -0, and in general we'll always have the same sign
- as our input. */
- return copysign (r, x);
+ /* rint(-0.1) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign(new_x, x);
+ }
+ return x;
}
weak_alias (__rint, rint)
--- sysdeps/alpha/fpu/s_rintf.c
+++ sysdeps/alpha/fpu/s_rintf.c
@@ -23,15 +23,30 @@
float
__rintf (float x)
{
- float two23 = copysignf (0x1.0p23, x);
- float r;
+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
+ {
+ /* Note that Alpha S_Floating is stored in registers in a
+ restricted T_Floating format, so we don't even need to
+ convert back to S_Floating in the end. The initial
+ conversion to T_Floating is needed to handle denormals. */
- r = x + two23;
- r = r - two23;
+ float tmp1, tmp2, new_x;
- /* rint(-0.1) == -0, and in general we'll always have the same sign
- as our input. */
- return copysign (r, x);
+ __asm ("cvtst/s %3,%2\n\t"
+#ifdef _IEEE_FP_INEXACT
+ "cvttq/svid %2,%1\n\t"
+#else
+ "cvttq/svd %2,%1\n\t"
+#endif
+ "cvtqt/d %1,%0\n\t"
+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+ : "f"(x));
+
+ /* rint(-0.1) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf(new_x, x);
+ }
+ return x;
}
weak_alias (__rintf, rintf)
--- sysdeps/alpha/memchr.S
+++ sysdeps/alpha/memchr.S
-/* Copyright (C) 1996, 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger (davidm at cs.arizona.edu).
-
- 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. */
-
-/* Finds characters in a memory area. Optimized for the Alpha:
-
- - memory accessed as aligned quadwords only
- - uses cmpbge to compare 8 bytes in parallel
- - does binary search to find 0 byte in last
- quadword (HAKMEM needed 12 instructions to
- do this instead of the 9 instructions that
- binary search needs).
-
-For correctness consider that:
-
- - only minimum number of quadwords may be accessed
- - the third argument is an unsigned long
-*/
-
-#include <sysdep.h>
-
- .set noreorder
- .set noat
-
-ENTRY(__memchr)
-#ifdef PROF
- ldgp gp, 0(pv)
- lda AT, _mcount
- jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
-#endif
-
- # Hack -- if someone passes in (size_t)-1, hoping to just
- # search til the end of the address space, we will overflow
- # below when we find the address of the last byte. Given
- # that we will never have a 56-bit address space, cropping
- # the length is the easiest way to avoid trouble.
- zap a2, 0x80, t4 #-e0 :
-
- beq a2, $not_found # .. e1 :
- ldq_u t0, 0(a0) # e1 : load first quadword
- insbl a1, 1, t1 # .. e0 : t1 = 000000000000ch00
- and a1, 0xff, a1 #-e0 : a1 = 00000000000000ch
- cmpult a2, 9, t3 # .. e1 :
- or t1, a1, a1 # e0 : a1 = 000000000000chch
- lda t2, -1(zero) # .. e1 :
- sll a1, 16, t1 #-e0 : t1 = 00000000chch0000
- addq a0, t4, t4 # .. e1 :
- or t1, a1, a1 # e1 : a1 = 00000000chchchch
- unop # :
- sll a1, 32, t1 #-e0 : t1 = chchchch00000000
- or t1, a1, a1 # e1 : a1 = chchchchchchchch
- extql t0, a0, t6 # e0 :
- beq t3, $first_quad # .. e1 :
-
- ldq_u t5, -1(t4) #-e1 : eight or less bytes to search
- extqh t5, a0, t5 # .. e0 :
- mov a0, v0 # e0 :
- or t6, t5, t0 # .. e1 : t0 = quadword starting at a0
-
- # Deal with the case where at most 8 bytes remain to be searched
- # in t0. E.g.:
- # a2 = 6
- # t0 = ????c6c5c4c3c2c1
-$last_quad:
- negq a2, t5 #-e0 :
- xor a1, t0, t0 # .. e1 :
- srl t2, t5, t5 # e0 : t5 = mask of a2 bits set
- cmpbge zero, t0, t1 # .. e1 :
- and t1, t5, t1 #-e0 :
- beq t1, $not_found # .. e1 :
-
-$found_it:
- # Now, determine which byte matched:
- negq t1, t2 # e0 :
- and t1, t2, t1 # e1 :
-
- and t1, 0x0f, t0 #-e0 :
- addq v0, 4, t2 # .. e1 :
- cmoveq t0, t2, v0 # e0 :
-
- addq v0, 2, t2 # .. e1 :
- and t1, 0x33, t0 #-e0 :
- cmoveq t0, t2, v0 # .. e1 :
-
- and t1, 0x55, t0 # e0 :
- addq v0, 1, t2 # .. e1 :
- cmoveq t0, t2, v0 #-e0 :
-
-$done: ret # .. e1 :
-
- # Deal with the case where a2 > 8 bytes remain to be
- # searched. a0 may not be aligned.
- .align 4
-$first_quad:
- andnot a0, 0x7, v0 #-e1 :
- insqh t2, a0, t1 # .. e0 : t1 = 0000ffffffffffff (a0<0:2> ff)
- xor t0, a1, t0 # e0 :
- or t0, t1, t0 # e1 : t0 = ====ffffffffffff
- cmpbge zero, t0, t1 #-e0 :
- bne t1, $found_it # .. e1 :
-
- # At least one byte left to process.
-
- ldq t0, 8(v0) # e0 :
- subq t4, 1, a2 # .. e1 :
- addq v0, 8, v0 #-e0 :
-
- # Make a2 point to last quad to be accessed (the
- # last quad may or may not be partial).
-
- andnot a2, 0x7, a2 # .. e1 :
- cmpult v0, a2, t1 # e0 :
- beq t1, $final # .. e1 :
-
- # At least two quads remain to be accessed.
-
- subq a2, v0, t3 #-e0 : t3 <- nr quads to be processed
- and t3, 8, t3 # e1 : odd number of quads?
- bne t3, $odd_quad_count # e1 :
-
- # At least three quads remain to be accessed
-
- mov t0, t3 # e0 : move prefetched value to correct reg
-
- .align 4
-$unrolled_loop:
- ldq t0, 8(v0) #-e0 : prefetch t0
- xor a1, t3, t1 # .. e1 :
- cmpbge zero, t1, t1 # e0 :
- bne t1, $found_it # .. e1 :
-
- addq v0, 8, v0 #-e0 :
-$odd_quad_count:
- xor a1, t0, t1 # .. e1 :
- ldq t3, 8(v0) # e0 : prefetch t3
- cmpbge zero, t1, t1 # .. e1 :
- addq v0, 8, t5 #-e0 :
- bne t1, $found_it # .. e1 :
-
- cmpult t5, a2, t5 # e0 :
- addq v0, 8, v0 # .. e1 :
- bne t5, $unrolled_loop #-e1 :
-
- mov t3, t0 # e0 : move prefetched value into t0
-$final: subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
- bne a2, $last_quad # e1 :
-
-$not_found:
- mov zero, v0 #-e0 :
- ret # .. e1 :
-
- END(__memchr)
-
-weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
-libc_hidden_builtin_def (memchr)
--- sysdeps/alpha/memchr.c
+++ sysdeps/alpha/memchr.c
+/* 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 <string.h>
+#include <bp-sym.h>
+
+typedef unsigned long word;
+
+static inline word
+ldq_u(const void *s)
+{
+ return *(const word *)((word)s & -8);
+}
+
+#define unlikely(X) __builtin_expect ((X), 0)
+#define prefetch(X) __builtin_prefetch ((void *)(X), 0)
+
+#define cmpbeq0(X) __builtin_alpha_cmpbge(0, (X))
+#define find(X, Y) cmpbeq0 ((X) ^ (Y))
+
+/* Search no more than N bytes of S for C. */
+
+void *
+__memchr (const void *s, int xc, size_t n)
+{
+ const word *s_align;
+ word t, current, found, mask, offset;
+
+ if (unlikely (n == 0))
+ return 0;
+
+ current = ldq_u (s);
+
+ /* Replicate low byte of XC into all bytes of C. */
+ t = xc & 0xff; /* 0000000c */
+ t = (t << 8) | t; /* 000000cc */
+ t = (t << 16) | t; /* 0000cccc */
+ const word c = (t << 32) | t; /* cccccccc */
+
+ /* Align the source, and decrement the count by the number
+ of bytes searched in the first word. */
+ s_align = (const word *)((word)s & -8);
+ n += ((word)s & 7);
+
+ /* Deal with misalignment in the first word for the comparison. */
+ mask = (1ul << ((word)s & 7)) - 1;
+
+ /* If the entire string fits within one word, we may need masking
+ at both the front and the back of the string. */
+ if (unlikely (n <= 8))
+ {
+ mask |= -1ul << n;
+ goto last_quad;
+ }
+
+ found = find (current, c) & ~mask;
+ if (unlikely (found))
+ goto found_it;
+
+ s_align++;
+ n -= 8;
+
+ /* If the block is sufficiently large, align to cacheline and prefetch. */
+ if (unlikely (n >= 256))
+ {
+ /* Prefetch 3 cache lines beyond the one we're working on. */
+ prefetch (s_align + 8);
+ prefetch (s_align + 16);
+ prefetch (s_align + 24);
+
+ while ((word)s_align & 63)
+ {
+ current = *s_align;
+ found = find (current, c);
+ if (found)
+ goto found_it;
+ s_align++;
+ n -= 8;
+ }
+
+ /* Within each cacheline, advance the load for the next word
+ before the test for the previous word is complete. This
+ allows us to hide the 3 cycle L1 cache load latency. We
+ only perform this advance load within a cacheline to prevent
+ reading across page boundary. */
+#define CACHELINE_LOOP \
+ do { \
+ word i, next = s_align[0]; \
+ for (i = 0; i < 7; ++i) \
+ { \
+ current = next; \
+ next = s_align[1]; \
+ found = find (current, c); \
+ if (unlikely (found)) \
+ goto found_it; \
+ s_align++; \
+ } \
+ current = next; \
+ found = find (current, c); \
+ if (unlikely (found)) \
+ goto found_it; \
+ s_align++; \
+ n -= 64; \
+ } while (0)
+
+ /* While there's still lots more data to potentially be read,
+ continue issuing prefetches for the 4th cacheline out. */
+ while (n >= 256)
+ {
+ prefetch (s_align + 24);
+ CACHELINE_LOOP;
+ }
+
+ /* Up to 3 cache lines remaining. Continue issuing advanced
+ loads, but stop prefetching. */
+ while (n >= 64)
+ CACHELINE_LOOP;
+
+ /* We may have exhausted the buffer. */
+ if (n == 0)
+ return NULL;
+ }
+
+ /* Quadword aligned loop. */
+ current = *s_align;
+ while (n > 8)
+ {
+ found = find (current, c);
+ if (unlikely (found))
+ goto found_it;
+ current = *++s_align;
+ n -= 8;
+ }
+
+ /* The last word may need masking at the tail of the compare. */
+ mask = -1ul << n;
+ last_quad:
+ found = find (current, c) & ~mask;
+ if (found == 0)
+ return NULL;
+
+ found_it:
+#ifdef __alpha_cix__
+ offset = __builtin_alpha_cttz (found);
+#else
+ /* Extract LSB. */
+ found &= -found;
+
+ /* Binary search for the LSB. */
+ offset = (found & 0x0f ? 0 : 4);
+ offset += (found & 0x33 ? 0 : 2);
+ offset += (found & 0x55 ? 0 : 1);
+#endif
+
+ return (void *)((word)s_align + offset);
+}
+
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
+libc_hidden_builtin_def (memchr)
--- sysdeps/arm/bits/mathdef.h
+++ sysdeps/arm/bits/mathdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2004, 2006, 2007
+/* Copyright (C) 1999, 2000, 2004, 2006, 2007, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,6 +34,20 @@
# define FP_ILOGB0 (-2147483647)
# define FP_ILOGBNAN (2147483647)
+/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
+ builtins are supported. */
+# if __FP_FAST_FMA
+# define FP_FAST_FMA 1
+# endif
+
+# if __FP_FAST_FMAF
+# define FP_FAST_FMAF 1
+# endif
+
+# if __FP_FAST_FMAL
+# define FP_FAST_FMAL 1
+# endif
+
#endif /* ISO C99 */
#ifndef __NO_LONG_DOUBLE_MATH
--- sysdeps/arm/configure
+++ sysdeps/arm/configure
+# 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
--- sysdeps/arm/configure.in
+++ sysdeps/arm/configure.in
+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
--- sysdeps/arm/dl-machine.h
+++ sysdeps/arm/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM version.
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
- Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,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
@@ -26,14 +26,6 @@
#include <sys/param.h>
#include <tls.h>
-#define VALID_ELF_ABIVERSION(ver) (ver == 0)
-#define VALID_ELF_OSABI(osabi) \
- (osabi == ELFOSABI_SYSV || osabi == ELFOSABI_ARM)
-#define VALID_ELF_HEADER(hdr,exp,size) \
- memcmp (hdr,exp,size-2) == 0 \
- && VALID_ELF_OSABI (hdr[EI_OSABI]) \
- && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
-
#define CLEAR_CACHE(BEG,END) \
INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0)
--- sysdeps/arm/dl-trampoline.S
+++ 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 @@
#ifndef PROF
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
+ .cfi_sections .debug_frame
cfi_startproc
.align 2
_dl_runtime_profile:
--- sysdeps/arm/eabi/Makefile
+++ sysdeps/arm/eabi/Makefile
@@ -12,6 +12,10 @@
gen-as-const-headers += rtld-global-offsets.sym
endif
+ifeq ($(subdir),gmon)
+sysdep_routines += arm-mcount
+endif
+
ifeq ($(subdir),debug)
CFLAGS-backtrace.c += -funwind-tables
endif
--- sysdeps/arm/eabi/__longjmp.S
+++ 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 @@
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
--- sysdeps/arm/eabi/arm-mcount.S
+++ sysdeps/arm/eabi/arm-mcount.S
+/* Implementation of profiling support. ARM EABI version.
+ 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
+ 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. */
+
+/* Don't call mcount when calling mcount... */
+#undef PROF
+
+#include <sysdep.h>
+
+
+#ifdef __thumb2__
+ .thumb
+ .syntax unified
+#endif
+
+
+/* Use an assembly stub with a special ABI. The calling lr has been
+ pushed to the stack (which will be misaligned). We should preserve
+ all registers except ip and pop a word off the stack.
+
+ NOTE: This assumes mcount_internal does not clobber any non-core
+ (coprocessor) registers. Currently this is true, but may require
+ additional attention in the future.
+
+ The calling sequence looks something like:
+func:
+ push {lr}
+ bl __gnu_mount_nc
+ <function body>
+*/
+
+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)
+
+
+/* Provide old mcount for backwards compatibility. This requires
+ code be compiled with APCS frame pointers. */
+
+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
+ ldrne r0, [r0, #-4]
+#else
+ movs fp, fp
+ ldrne r0, [fp, #-4]
+#endif
+ movnes r1, lr
+ blne __mcount_internal
+#ifdef __thumb2__
+ 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)
+
+/* The canonical name for the function is `_mcount' in both C and asm,
+ but some old asm code might assume it's `mcount'. */
+#undef mcount
+weak_alias (_mcount, mcount)
--- sysdeps/arm/eabi/fclrexcpt.c
+++ sysdeps/arm/eabi/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997,98,99,2000,01,05 Free Software Foundation, Inc.
+ Copyright (C) 1997,98,99,2000,01,05,11 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
@@ -48,8 +48,8 @@
return 0;
}
- /* Unsupported, so fail. */
- return 1;
+ /* Unsupported, so fail unless nothing needs to be done. */
+ return (excepts != 0);
}
#include <shlib-compat.h>
--- sysdeps/arm/eabi/fegetenv.c
+++ sysdeps/arm/eabi/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997,98,99,2000,01,05 Free Software Foundation, Inc.
+ Copyright (C) 1997,98,99,2000,01,05,10 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
@@ -48,4 +48,5 @@
compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
--- sysdeps/arm/eabi/feupdateenv.c
+++ sysdeps/arm/eabi/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper at cygnus.com>, 1997.
@@ -56,4 +56,5 @@
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
--- sysdeps/arm/eabi/fraiseexcpt.c
+++ sysdeps/arm/eabi/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -103,8 +103,8 @@
return 0;
}
- /* Unsupported, so fail. */
- return 1;
+ /* Unsupported, so fail unless nothing needs to be done. */
+ return (excepts != 0);
}
libm_hidden_def (feraiseexcept)
--- sysdeps/arm/eabi/fsetexcptflg.c
+++ sysdeps/arm/eabi/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997,98,99,2000,01,05,08 Free Software Foundation, Inc.
+ Copyright (C) 1997,98,99,2000,01,05,08,11 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
@@ -47,8 +47,8 @@
return 0;
}
- /* Unsupported, so fail. */
- return 1;
+ /* Unsupported, so fail unless nothing needs to be done. */
+ return (excepts != 0);
}
#include <shlib-compat.h>
--- sysdeps/arm/eabi/ftestexcept.c
+++ sysdeps/arm/eabi/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 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
@@ -41,3 +41,4 @@
/* Unsupported, return 0. */
return 0;
}
+libm_hidden_def (fetestexcept)
--- sysdeps/arm/eabi/machine-gmon.h
+++ sysdeps/arm/eabi/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-dependent definitions for profiling support. ARM EABI version.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 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
@@ -17,83 +17,18 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <sysdep.h>
+
/* GCC for the ARM cannot compile __builtin_return_address(N) for N != 0,
so we must use an assembly stub. */
-#include <sysdep.h>
-static void mcount_internal (u_long frompc, u_long selfpc) __attribute_used__;
+/* We must not pollute the global namespace. */
+#define mcount_internal __mcount_internal
+extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
#define _MCOUNT_DECL(frompc, selfpc) \
-static void mcount_internal (u_long frompc, u_long selfpc)
+ void internal_function mcount_internal (u_long frompc, u_long selfpc)
-/* Use an assembly stub with a special ABI. The calling lr has been
- pushed to the stack (which will be misaligned). We should preserve
- all registers except ip and pop a word off the stack.
-
- NOTE: This assumes mcount_internal does not clobber any non-core
- (coprocessor) registers. Currently this is true, but may require
- additional attention in the future.
-
- The calling sequence looks something like:
-func:
- push {lr}
- bl __gnu_mount_nc
- <function body>
- */
-
-
-#define MCOUNT \
-void __attribute__((__naked__)) __gnu_mcount_nc(void) \
-{ \
- asm ("push {r0, r1, r2, r3, lr}\n\t" \
- "bic r1, lr, #1\n\t" \
- "ldr r0, [sp, #20]\n\t" \
- "bl mcount_internal\n\t" \
- "pop {r0, r1, r2, r3, ip, lr}\n\t" \
- "bx ip"); \
-} \
-OLD_MCOUNT
-
-/* Provide old mcount for backwards compatibility. This requires
- code be compiled with APCS frame pointers. */
-
-#ifndef NO_UNDERSCORES
-/* The asm symbols for C functions are `_function'.
- The canonical name for the counter function is `mcount', no _. */
-void _mcount (void) asm ("mcount");
-#else
-/* The canonical name for the function is `_mcount' in both C and asm,
- but some old asm code might assume it's `mcount'. */
-void _mcount (void);
-weak_alias (_mcount, mcount)
-#endif
-
-#ifdef __thumb2__
-
-#define OLD_MCOUNT \
-void __attribute__((__naked__)) _mcount (void) \
-{ \
- __asm__("push {r0, r1, r2, r3, fp, lr};" \
- "movs r0, fp;" \
- "ittt ne;" \
- "ldrne r0, [r0, #-4];" \
- "movsne r1, lr;" \
- "blne mcount_internal;" \
- "pop {r0, r1, r2, r3, fp, pc}"); \
-}
-
-#else
-
-#define OLD_MCOUNT \
-void __attribute__((__naked__)) _mcount (void) \
-{ \
- __asm__("stmdb sp!, {r0, r1, r2, r3, fp, lr};" \
- "movs fp, fp;" \
- "ldrne r0, [fp, #-4];" \
- "movnes r1, lr;" \
- "blne mcount_internal;" \
- "ldmia sp!, {r0, r1, r2, r3, fp, lr};" \
- "bx lr"); \
-}
-#endif
+/* Define MCOUNT as empty since we have the implementation in another file. */
+#define MCOUNT
--- sysdeps/arm/fpu/fegetenv.c
+++ sysdeps/arm/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1997,98,99,2000,01,10 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,4 +37,5 @@
compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
--- sysdeps/arm/fpu/ftestexcept.c
+++ sysdeps/arm/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 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
@@ -30,3 +30,4 @@
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
--- sysdeps/arm/memcpy.S
+++ 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 @@
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 @@
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 @@
#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 @@
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 @@
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
--- sysdeps/arm/memmove.S
+++ sysdeps/arm/memmove.S
@@ -73,6 +73,12 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
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
--- sysdeps/arm/preconfigure
+++ sysdeps/arm/preconfigure
@@ -4,6 +4,10 @@
case $config_os in
linux-gnueabi)
machine=arm/eabi/$machine
+ if [ "${CFLAGS+set}" != "set" ]; then
+ CFLAGS="-g -O2"
+ fi
+ CFLAGS="$CFLAGS -fno-unwind-tables"
;;
*)
machine=arm/$machine
@@ -11,7 +15,3 @@
esac
;;
esac
-if [ "${CFLAGS+set}" != "set" ]; then
- CFLAGS="-g -O2"
-fi
-CFLAGS="$CFLAGS -fno-unwind-tables"
--- sysdeps/arm/stackinfo.h
+++ sysdeps/arm/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -22,7 +22,13 @@
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
+#include <elf.h>
+
/* On Arm the stack grows down. */
#define _STACK_GROWS_DOWN 1
+/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
+ * present, but it is presumed absent. */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+
#endif /* stackinfo.h */
--- sysdeps/arm/sysdep.h
+++ 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
--- sysdeps/hppa/nptl/tls.h
+++ sysdeps/hppa/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/hppa version.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005, 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
@@ -140,11 +140,13 @@
return (struct pthread *) cr27;
}
+/* We write to cr27, clobber r26 as the input argument, and clobber
+ r31 as the link register. */
static inline void __set_cr27(struct pthread *cr27)
{
asm ( "ble 0xe0(%%sr2, %%r0)\n\t"
"copy %0, %%r26"
- : : "r" (cr27) : "r26" );
+ : : "r" (cr27) : "r26", "r31" );
}
/* Get and set the global scope generation counter in struct pthread. */
--- sysdeps/m68k/coldfire/sysdep.h
+++ sysdeps/m68k/coldfire/sysdep.h
+/* Assembler macros for Coldfire.
+ Copyright (C) 1998, 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
+ 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 <sysdeps/m68k/sysdep.h>
+
+#ifdef __ASSEMBLER__
+
+/* Perform operation OP with PC-relative SRC as the first operand and
+ DST as the second. TMP is available as a temporary if needed. */
+# define PCREL_OP(OP, SRC, DST, TMP) \
+ move.l &SRC - ., TMP; OP (-8, %pc, TMP), DST
+
+#else
+
+/* As above, but PC is the spelling of the PC register. We need this
+ so that the macro can be used in both normal and extended asms. */
+# define PCREL_OP(OP, SRC, DST, TMP, PC) \
+ "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
+
+#endif /* __ASSEMBLER__ */
--- sysdeps/m68k/dl-machine.h
+++ sysdeps/m68k/dl-machine.h
@@ -1,5 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2002, 2003, 2004, 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
@@ -24,6 +25,7 @@
#include <sys/param.h>
#include <sysdep.h>
+#include <dl-tls.h>
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
@@ -121,6 +123,7 @@
.globl _start\n\
.type _start, at function\n\
_start:\n\
+ sub.l %fp, %fp\n\
move.l %sp, -(%sp)\n\
jbsr _dl_start\n\
addq.l #4, %sp\n\
@@ -159,12 +162,16 @@
.size _dl_start_user, . - _dl_start_user\n\
.previous");
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
- PLT entries should not be allowed to define the value.
+/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
+ TLS variable, so undefined references should not be allowed to
+ define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
#define elf_machine_type_class(type) \
- ((((type) == R_68K_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
+ ((((type) == R_68K_JMP_SLOT \
+ || (type) == R_68K_TLS_DTPMOD32 \
+ || (type) == R_68K_TLS_DTPREL32 \
+ || (type) == R_68K_TLS_TPREL32) * ELF_RTYPE_CLASS_PLT) \
| (((type) == R_68K_COPY) * ELF_RTYPE_CLASS_COPY))
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
@@ -262,6 +269,25 @@
case R_68K_PC32:
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
+#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+ case R_68K_TLS_DTPMOD32:
+ /* Get the information from the link map returned by the
+ resolv function. */
+ if (sym_map != NULL)
+ *reloc_addr = sym_map->l_tls_modid;
+ break;
+ case R_68K_TLS_DTPREL32:
+ if (sym != NULL)
+ *reloc_addr = TLS_DTPREL_VALUE (sym, reloc);
+ break;
+ case R_68K_TLS_TPREL32:
+ if (sym != NULL)
+ {
+ CHECK_STATIC_TLS (map, sym_map);
+ *reloc_addr = TLS_TPREL_VALUE (sym_map, sym, reloc);
+ }
+ break;
+#endif /* defined USE_TLS && !defined RTLD_BOOTSTRAP */
case R_68K_NONE: /* Alright, Wilbur. */
break;
default:
--- sysdeps/m68k/dl-tls.h
+++ sysdeps/m68k/dl-tls.h
+/* Thread-local storage handling in the ELF dynamic linker. M68K version.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+
+/* Type used for the representation of TLS information in the GOT. */
+typedef struct
+{
+ unsigned long int ti_module;
+ unsigned long int ti_offset;
+} tls_index;
+
+/* The thread pointer points 0x7000 past the first static TLS block. */
+#define TLS_TP_OFFSET 0x7000
+
+/* Dynamic thread vector pointers point 0x8000 past the start of each
+ TLS block. */
+#define TLS_DTV_OFFSET 0x8000
+
+/* Compute the value for a TPREL reloc. */
+#define TLS_TPREL_VALUE(sym_map, sym, reloc) \
+ ((sym_map)->l_tls_offset + (sym)->st_value + (reloc)->r_addend \
+ - TLS_TP_OFFSET)
+
+/* Compute the value for a DTPREL reloc. */
+#define TLS_DTPREL_VALUE(sym, reloc) \
+ ((sym)->st_value + (reloc)->r_addend - TLS_DTV_OFFSET)
+
+extern void *__tls_get_addr (tls_index *ti);
+
+#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
+#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
--- sysdeps/m68k/fpu/fegetenv.c
+++ sysdeps/m68k/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,01,10 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at issan.informatik.uni-dortmund.de>
@@ -41,4 +41,5 @@
compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
--- sysdeps/m68k/fpu/feupdateenv.c
+++ sysdeps/m68k/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999-2001,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at issan.informatik.uni-dortmund.de>
@@ -47,4 +47,5 @@
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
--- sysdeps/m68k/fpu/ftestexcept.c
+++ sysdeps/m68k/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at issan.informatik.uni-dortmund.de>
@@ -30,3 +30,4 @@
return fpsr & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
--- sysdeps/m68k/jmpbuf-unwind.h
+++ sysdeps/m68k/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. m68k version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -18,8 +18,29 @@
02111-1307 USA. */
#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
((void *) (address) < (void *) demangle ((jmpbuf)->__sp))
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+ uintptr_t sp = regs[0].__sp;
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (sp);
+#endif
+ return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
+
+/* We use the normal longjmp for unwinding. */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
--- sysdeps/m68k/libc-tls.c
+++ sysdeps/m68k/libc-tls.c
+/* Thread-local storage handling in the ELF dynamic linker. m68k version.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <csu/libc-tls.c>
+#include <dl-tls.h>
+
+#if USE_TLS
+
+/* On M68K, linker optimizations are not required, so __tls_get_addr
+ can be called even in statically linked binaries. In this case module
+ must be always 1 and PT_TLS segment exist in the binary, otherwise it
+ would not link. */
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+ dtv_t *dtv = THREAD_DTV ();
+ return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
+}
+
+#endif
--- sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Definitions of inline math functions implemented by the m68881/2.
- Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008
+ Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -85,6 +85,26 @@
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# endif /* GCC 3.1 */
+
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[0] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+ __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
+ return __u.__i[0] < 0;
+}
#endif
@@ -106,7 +126,7 @@
/* Define a const math function. */
#define __m81_defun(rettype, func, args) \
__m81_inline rettype __attribute__((__const__)) \
- __m81_u(func) args
+ __NTH (__m81_u(func) args)
/* Define the three variants of a math function that has a direct
implementation in the m68k fpu. FUNC is the name for C (which will be
@@ -281,17 +301,7 @@
#ifdef __USE_ISOC99
# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
-{ \
- /* There is no branch-condition for the sign bit, so we must extract \
- and examine the condition codes manually. */ \
- unsigned long int __fpsr; \
- __asm ("ftst%.x %1\n" \
- "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
- return (__fpsr >> 27) & 1; \
-} \
- \
- __m81_defun (float_type, __CONCAT(__scalbln,s), \
+__m81_defun (float_type, __CONCAT(__scalbln,s), \
(float_type __x, long int __n)) \
{ \
return __CONCAT(__scalbn,s) (__x, __n); \
@@ -316,13 +326,6 @@
long int __result; \
__asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \
return __result; \
-} \
- \
-__m81_inline float_type \
-__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
- float_type __z) \
-{ \
- return (__x * __y) + __z; \
}
__inline_functions (double,)
@@ -336,8 +339,8 @@
# define __inline_functions(float_type, s) \
__m81_inline void \
-__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
- float_type *__cosx) \
+__NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
+ float_type *__cosx)) \
{ \
__asm ("fsincos%.x %2,%1:%0" \
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
@@ -358,13 +361,13 @@
NAME, to make token pasting work correctly with -traditional. */
# define __inline_forward_c(rettype, name, args1, args2) \
__MATH_INLINE rettype __attribute__((__const__)) \
- name args1 \
+__NTH (name args1) \
{ \
return __CONCAT(__,name) args2; \
}
# define __inline_forward(rettype, name, args1, args2) \
-__MATH_INLINE rettype name args1 \
+__MATH_INLINE rettype __NTH (name args1) \
{ \
return __CONCAT(__,name) args2; \
}
@@ -387,8 +390,6 @@
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
__inline_forward_c(double,nearbyint, (double __value), (__value))
__inline_forward_c(long int,lrint, (double __value), (__value))
-__inline_forward_c(double,fma, (double __x, double __y, double __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -409,8 +410,6 @@
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(float,nearbyintf, (float __value), (__value))
__inline_forward_c(long int,lrintf, (float __value), (__value))
-__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -430,9 +429,6 @@
(__x, __n))
__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
__inline_forward_c(long int,lrintl, (long double __value), (__value))
-__inline_forward_c(long double,fmal,
- (long double __x, long double __y, long double __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosl,
--- sysdeps/m68k/m680x0/fpu/s_ccos.c
+++ sysdeps/m68k/m680x0/fpu/s_ccos.c
@@ -1,5 +1,5 @@
/* Complex cosine function. m68k fpu version
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at issan.informatik.uni-dortmund.de>.
@@ -48,7 +48,7 @@
: "f" (__real__ x));
__real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x);
if (rx_cond & __M81_COND_ZERO)
- __imag__ retval = (m81(__signbit) (__imag__ x)
+ __imag__ retval = (signbit (__imag__ x)
? __real__ x : -__real__ x);
else
__imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x);
--- sysdeps/m68k/m680x0/fpu/s_ccosh.c
+++ sysdeps/m68k/m680x0/fpu/s_ccosh.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function. m68k fpu version
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at issan.informatik.uni-dortmund.de>.
@@ -48,7 +48,7 @@
: "f" (__imag__ x));
__real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x);
if (ix_cond & __M81_COND_ZERO)
- __imag__ retval = (m81(__signbit) (__real__ x)
+ __imag__ retval = (signbit (__real__ x)
? -__imag__ x : __imag__ x);
else
__imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x);
--- sysdeps/m68k/m680x0/sysdep.h
+++ sysdeps/m68k/m680x0/sysdep.h
+/* Assembler macros for m680x0.
+ 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 <sysdeps/m68k/sysdep.h>
+
+#ifdef __ASSEMBLER__
+
+/* Perform operation OP with PC-relative SRC as the first operand and
+ DST as the second. TMP is available as a temporary if needed. */
+#define PCREL_OP(OP, SRC, DST, TMP) \
+ OP SRC(%pc), DST
+
+#else
+
+/* As above, but PC is the spelling of the PC register. We need this
+ so that the macro can be used in both normal and extended asms. */
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+ OP " " SRC "(" PC "), " DST
+
+#endif /* __ASSEMBLER__ */
--- sysdeps/m68k/nptl
+++ sysdeps/m68k/nptl
+(directory)
--- sysdeps/m68k/nptl/Makefile
+++ sysdeps/m68k/nptl/Makefile
+# Copyright (C) 2010 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+#
+# 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.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
--- sysdeps/m68k/nptl/pthread_spin_lock.c
+++ sysdeps/m68k/nptl/pthread_spin_lock.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <atomic.h>
+#include "pthreadP.h"
+
+int
+pthread_spin_lock (pthread_spinlock_t *lock)
+{
+ while (atomic_compare_and_exchange_val_acq(lock, 1, 0) != 0)
+ while (*lock != 0)
+ ;
+
+ return 0;
+}
--- sysdeps/m68k/nptl/pthread_spin_trylock.c
+++ sysdeps/m68k/nptl/pthread_spin_trylock.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <errno.h>
+#include <atomic.h>
+#include "pthreadP.h"
+
+int
+pthread_spin_trylock (pthread_spinlock_t *lock)
+{
+ return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
+}
--- sysdeps/m68k/nptl/pthreaddef.h
+++ sysdeps/m68k/nptl/pthreaddef.h
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+/* Default stack size. */
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning. */
+#define STACK_ALIGN 16
+
+/* Minimal stack size after allocating thread descriptor and guard size. */
+#define MINIMAL_REST_STACK 2048
+
+/* Alignment requirement for TCB. */
+#define TCB_ALIGNMENT 16
+
+
+/* Location of current stack frame. */
+#define CURRENT_STACK_FRAME __builtin_frame_address (0)
+
+
+/* XXX Until we have a better place keep the definitions here. */
+#define __exit_thread_inline(val) \
+ INLINE_SYSCALL (exit, 1, (val))
--- sysdeps/m68k/nptl/tcb-offsets.sym
+++ sysdeps/m68k/nptl/tcb-offsets.sym
+#include <sysdep.h>
+#include <tls.h>
+
+--
+
+-- Derive offsets relative to the thread register.
+#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
+MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
+PID_OFFSET thread_offsetof (pid)
+TID_OFFSET thread_offsetof (tid)
--- sysdeps/m68k/nptl/tls.h
+++ sysdeps/m68k/nptl/tls.h
+/* Definition for thread-local data handling. NPTL/m68k version.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 _TLS_H
+#define _TLS_H 1
+
+#include <dl-sysdep.h>
+
+#ifndef __ASSEMBLER__
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
+
+/* Type for the dtv. */
+typedef union dtv
+{
+ size_t counter;
+ struct
+ {
+ void *val;
+ bool is_static;
+ } pointer;
+} dtv_t;
+
+#else /* __ASSEMBLER__ */
+# include <tcb-offsets.h>
+#endif /* __ASSEMBLER__ */
+
+/* Signal that TLS support is available. */
+#define USE_TLS 1
+
+#ifndef __ASSEMBLER__
+
+/* Get system call information. */
+# include <sysdep.h>
+
+/* The TP points to the start of the thread blocks. */
+# define TLS_DTV_AT_TP 1
+
+/* Get the thread descriptor definition. */
+# include <nptl/descr.h>
+
+typedef struct
+{
+ dtv_t *dtv;
+ void *private;
+} tcbhead_t;
+
+/* This is the size of the initial TCB. Because our TCB is before the thread
+ pointer, we don't need this. */
+# define TLS_INIT_TCB_SIZE 0
+
+/* Alignment requirements for the initial TCB. */
+# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
+
+/* This is the size of the TCB. Because our TCB is before the thread
+ pointer, we don't need this. */
+# define TLS_TCB_SIZE 0
+
+/* Alignment requirements for the TCB. */
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
+
+/* This is the size we need before TCB - actually, it includes the TCB. */
+# define TLS_PRE_TCB_SIZE \
+ (sizeof (struct pthread) \
+ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
+
+/* The thread pointer (TP) points to the end of the
+ TCB + 0x7000, as for PowerPC and MIPS. This implies that TCB address is
+ TP - 0x7000. As we define TLS_DTV_AT_TP we can
+ assume that the pthread struct is allocated immediately ahead of the
+ TCB. This implies that the pthread_descr address is
+ TP - (TLS_PRE_TCB_SIZE + 0x7000). */
+# define TLS_TCB_OFFSET 0x7000
+
+/* Install the dtv pointer. The pointer passed is to the element with
+ index -1 which contain the length. */
+# define INSTALL_DTV(tcbp, dtvp) \
+ ((tcbhead_t *) (tcbp))[-1].dtv = dtvp + 1
+
+/* Install new dtv for current thread. */
+# define INSTALL_NEW_DTV(dtv) \
+ (THREAD_DTV () = (dtv))
+
+/* Return dtv of given thread descriptor. */
+# define GET_DTV(tcbp) \
+ (((tcbhead_t *) (tcbp))[-1].dtv)
+
+/* Code to initially initialize the thread pointer. This might need
+ special attention since 'errno' is not yet available and if the
+ operation can cause a failure 'errno' must not be touched. */
+# define TLS_INIT_TP(tcbp, secondcall) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (err); \
+ int _sys_result; \
+ \
+ _sys_result = INTERNAL_SYSCALL (set_thread_area, err, 1, \
+ ((void *) (tcbp)) + TLS_TCB_OFFSET); \
+ INTERNAL_SYSCALL_ERROR_P (_sys_result, err) ? "unknown error" : NULL; })
+
+extern void * __m68k_read_tp (void);
+
+/* Return the address of the dtv for the current thread. */
+# define THREAD_DTV() \
+ (((tcbhead_t *) (__m68k_read_tp () - TLS_TCB_OFFSET))[-1].dtv)
+
+/* Return the thread descriptor for the current thread. */
+# define THREAD_SELF \
+ ((struct pthread *) (__m68k_read_tp () - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+
+/* Magic for libthread_db to know how to do THREAD_SELF. */
+# define DB_THREAD_SELF \
+ CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+
+/* Access to data in the thread descriptor is easy. */
+# define THREAD_GETMEM(descr, member) \
+ descr->member
+# define THREAD_GETMEM_NC(descr, member, idx) \
+ descr->member[idx]
+# define THREAD_SETMEM(descr, member, value) \
+ descr->member = (value)
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
+ descr->member[idx] = (value)
+
+/* l_tls_offset == 0 is perfectly valid on M68K, so we have to use some
+ different value to mean unset l_tls_offset. */
+# define NO_TLS_OFFSET -1
+
+/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED 1
+#define THREAD_GSCOPE_FLAG_WAIT 2
+#define THREAD_GSCOPE_RESET_FLAG() \
+ do \
+ { int __res \
+ = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
+ THREAD_GSCOPE_FLAG_UNUSED); \
+ if (__res == THREAD_GSCOPE_FLAG_WAIT) \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
+ } \
+ while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+ do \
+ { \
+ THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \
+ atomic_write_barrier (); \
+ } \
+ while (0)
+#define THREAD_GSCOPE_WAIT() \
+ GL(dl_wait_lookup_done) ()
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* tls.h */
--- sysdeps/m68k/stackinfo.h
+++ sysdeps/m68k/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 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
@@ -22,7 +22,13 @@
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
+#include <elf.h>
+
/* On m68k the stack grows down. */
#define _STACK_GROWS_DOWN 1
+/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK
+ is present, but it is presumed absent. */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+
#endif /* stackinfo.h */
--- sysdeps/m68k/sysdep.h
+++ sysdeps/m68k/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for m68k.
- Copyright (C) 1998, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 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
@@ -97,26 +97,4 @@
# define JUMPTARGET(name) name
# endif
-/* Perform operation OP with PC-relative SRC as the first operand and
- DST as the second. TMP is available as a temporary if needed. */
-#ifdef __mcoldfire__
-#define PCREL_OP(OP, SRC, DST, TMP) \
- move.l &SRC - ., TMP; OP (-8, %pc, TMP), DST
-#else
-#define PCREL_OP(OP, SRC, DST, TMP) \
- OP SRC(%pc), DST
-#endif
-
-#else
-
-/* As above, but PC is the spelling of the PC register. We need this
- so that the macro can be used in both normal and extended asms. */
-#ifdef __mcoldfire__
-#define PCREL_OP(OP, SRC, DST, TMP, PC) \
- "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
-#else
-#define PCREL_OP(OP, SRC, DST, TMP, PC) \
- OP " " SRC "(" PC "), " DST
-#endif
-
#endif /* __ASSEMBLER__ */
--- sysdeps/m68k/tls-macros.h
+++ sysdeps/m68k/tls-macros.h
+/* Macros for accessing thread-local storage. m68k version.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+#define TLS_GD(x) \
+ ({ \
+ void *__result; \
+ extern void *__tls_get_addr (void *); \
+ \
+ asm ("movel #_GLOBAL_OFFSET_TABLE_ at GOTPC, %0\n\t" \
+ "lea (-6, %%pc, %0), %0\n\t" \
+ "lea " #x "@TLSGD(%0), %0" \
+ : "=&a" (__result)); \
+ (int *) __tls_get_addr (__result); })
+
+#define TLS_LD(x) \
+ ({ \
+ char *__tp; \
+ int __offset; \
+ extern void *__tls_get_addr (void *); \
+ \
+ asm ("movel #_GLOBAL_OFFSET_TABLE_ at GOTPC, %0\n\t" \
+ "lea (-6, %%pc, %0), %0\n\t" \
+ "lea " #x "@TLSLDM(%0), %0" \
+ : "=&a" (__tp)); \
+ __tp = (char *) __tls_get_addr (__tp); \
+ asm ("movel #" #x "@TLSLDO, %0" \
+ : "=a" (__offset)); \
+ (int *) (__tp + __offset); })
+
+#define TLS_IE(x) \
+ ({ \
+ char *__tp; \
+ int __offset; \
+ extern void * __m68k_read_tp (void); \
+ \
+ __tp = (char *) __m68k_read_tp (); \
+ asm ("movel #_GLOBAL_OFFSET_TABLE_ at GOTPC, %0\n\t" \
+ "lea (-6, %%pc, %0), %0\n\t" \
+ "movel " #x "@TLSIE(%0), %0" \
+ : "=&a" (__offset)); \
+ (int *) (__tp + __offset); })
+
+#define TLS_LE(x) \
+ ({ \
+ char *__tp; \
+ int __offset; \
+ extern void * __m68k_read_tp (void); \
+ \
+ __tp = (char *) __m68k_read_tp (); \
+ asm ("movel #" #x "@TLSLE, %0" \
+ : "=a" (__offset)); \
+ (int *) (__tp + __offset); })
+
--- sysdeps/mach/hurd/mips/init-first.c
+++ sysdeps/mach/hurd/mips/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For Mips/Hurd.
- Copyright (C) 1996,1997,1998,2000,01,02,03 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1998,2000,01,02,03,10 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
@@ -119,7 +119,7 @@
__getopt_clean_environment (envp);
#endif
-#ifdef SHARED
+#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS
__libc_global_ctors ();
#endif
--- sysdeps/mips/bits/atomic.h
+++ sysdeps/mips/bits/atomic.h
@@ -69,16 +69,16 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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; })
--- sysdeps/mips/dl-lookup.c
+++ 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
@@ -329,16 +330,16 @@
definition we have to use it. */
void enter (struct unique_sym *table, size_t size,
unsigned int hash, const char *name,
- const ElfW(Sym) *sym, const struct link_map *map)
+ const ElfW(Sym) *sym, struct link_map *map)
{
size_t idx = hash % size;
size_t hash2 = 1 + hash % (size - 2);
while (1)
{
- if (table[idx].hashval == 0)
+ if (table[idx].name == NULL)
{
table[idx].hashval = hash;
- table[idx].name = strtab + sym->st_name;
+ table[idx].name = name;
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
{
table[idx].sym = ref;
@@ -348,7 +349,13 @@
{
table[idx].sym = sym;
table[idx].map = map;
+
+ if (map->l_type == lt_loaded)
+ /* Make sure we don't unload this object by
+ setting the appropriate flag. */
+ map->l_flags_1 |= DF_1_NODELETE;
}
+
return;
}
@@ -380,8 +387,7 @@
return 1;
}
- if (entries[idx].hashval == 0
- && entries[idx].name == NULL)
+ if (entries[idx].name == NULL)
break;
idx += hash2;
@@ -389,10 +395,14 @@
idx -= size;
}
- if (size * 3 <= tab->n_elements)
+ if (size * 3 <= tab->n_elements * 4)
{
/* Expand the table. */
- size_t newsize = _dl_higher_prime_number (size);
+#ifdef RTLD_CHECK_FOREIGN_CALL
+ /* This must not happen during runtime relocations. */
+ assert (!RTLD_CHECK_FOREIGN_CALL);
+#endif
+ size_t newsize = _dl_higher_prime_number (size + 1);
struct unique_sym *newentries
= calloc (sizeof (struct unique_sym), newsize);
if (newentries == NULL)
@@ -403,19 +413,39 @@
}
for (idx = 0; idx < size; ++idx)
- if (entries[idx].hashval != 0)
+ if (entries[idx].name != NULL)
enter (newentries, newsize, entries[idx].hashval,
entries[idx].name, entries[idx].sym,
entries[idx].map);
tab->free (entries);
tab->size = newsize;
+ size = newsize;
entries = tab->entries = newentries;
tab->free = free;
}
}
else
{
+#ifdef RTLD_CHECK_FOREIGN_CALL
+ /* This must not happen during runtime relocations. */
+ 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);
@@ -427,7 +457,8 @@
tab->free = free;
}
- enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
+ enter (entries, size, new_hash, strtab + sym->st_name, sym,
+ (struct link_map *) map);
++tab->n_elements;
__rtld_lock_unlock_recursive (tab->lock);
@@ -610,6 +641,10 @@
unsigned int max
= undef_map->l_reldepsmax ? undef_map->l_reldepsmax * 2 : 10;
+#ifdef RTLD_PREPARE_FOREIGN_CALL
+ RTLD_PREPARE_FOREIGN_CALL;
+#endif
+
newp = malloc (sizeof (*newp) + max * sizeof (struct link_map *));
if (newp == NULL)
{
@@ -774,7 +809,7 @@
if (__builtin_expect (protected != 0, 0))
{
/* It is very tricky. We need to figure out what value to
- return for the protected symbol. */
+ return for the protected symbol. */
if (type_class == ELF_RTYPE_CLASS_PLT)
{
if (current_value.s != NULL && current_value.m != undef_map)
@@ -819,7 +854,8 @@
version, type_class, flags, skip_map);
/* The object is used. */
- current_value.m->l_used = 1;
+ if (__builtin_expect (current_value.m->l_used == 0, 0))
+ current_value.m->l_used = 1;
if (__builtin_expect (GLRO(dl_debug_mask)
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
@@ -841,7 +877,7 @@
Elf_Symndx nchain;
if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
- + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM] != NULL, 1))
{
Elf32_Word *hash32
@@ -913,13 +949,48 @@
{
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)
--- sysdeps/mips/dl-machine.h
+++ sysdeps/mips/dl-machine.h
@@ -75,15 +75,6 @@
(ElfW(Addr)) (r); \
} while (0)
-/* Allow ABIVERSION == 1, meaning PLTs and copy relocations are
- required. */
-#define VALID_ELF_ABIVERSION(ver) (ver == 0 || ver == 2)
-#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV)
-#define VALID_ELF_HEADER(hdr,exp,size) \
- memcmp (hdr,exp,size-2) == 0 \
- && VALID_ELF_OSABI (hdr[EI_OSABI]) \
- && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
-
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute_used__
elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
--- sysdeps/mips/dl-trampoline.c
+++ sysdeps/mips/dl-trampoline.c
@@ -278,13 +278,13 @@
.frame $29, " STRINGXP(ELF_DL_FRAME_SIZE) ", $31\n\
.set noreorder\n\
# Save GP.\n\
- move $3, $28\n\
+1: move $3, $28\n\
# Save arguments and sp value in stack.\n\
" STRINGXP(PTR_SUBIU) " $29, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\
# Modify t9 ($25) so as to point .cpload instruction.\n\
- " IFABIO32(STRINGXP(PTR_ADDIU) " $25, 12\n") "\
+ " IFABIO32(STRINGXP(PTR_ADDIU) " $25, (2f-1b)\n") "\
# Compute GP.\n\
- " STRINGXP(SETUP_GP) "\n\
+2: " STRINGXP(SETUP_GP) "\n\
" STRINGXV(SETUP_GP64 (0, _dl_runtime_resolve)) "\n\
.set reorder\n\
# Save slot call pc.\n\
@@ -334,13 +334,13 @@
.frame $29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $31\n\
.set noreorder\n\
# Save arguments and sp value in stack.\n\
- " STRINGXP(PTR_SUBIU) " $29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
+1: " STRINGXP(PTR_SUBIU) " $29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
" IFABIO32(STRINGXP(PTR_L) " $13, " STRINGXP(PTRSIZE) "($28)") "\n\
" IFNEWABI(STRINGXP(PTR_L) " $13, " STRINGXP(PTRSIZE) "($14)") "\n\
# Modify t9 ($25) so as to point .cpload instruction.\n\
- " IFABIO32(STRINGXP(PTR_ADDIU) " $25, 12\n") "\
+ " IFABIO32(STRINGXP(PTR_ADDIU) " $25, (2f-1b)\n") "\
# Compute GP.\n\
- " STRINGXP(SETUP_GP) "\n\
+2: " STRINGXP(SETUP_GP) "\n\
" STRINGXV(SETUP_GP64 (0, _dl_runtime_pltresolve)) "\n\
.set reorder\n\
" IFABIO32(STRINGXP(CPRESTORE(32))) "\n\
--- sysdeps/mips/fpu/fegetenv.c
+++ sysdeps/mips/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj at suse.de>, 1998.
@@ -29,3 +29,4 @@
/* Success. */
return 0;
}
+libm_hidden_def (fegetenv)
--- sysdeps/mips/fpu/feupdateenv.c
+++ sysdeps/mips/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj at suse.de>, 1998.
@@ -41,3 +41,4 @@
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
--- sysdeps/mips/fpu/ftestexcept.c
+++ sysdeps/mips/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj at arthur.rhein-neckar.de>, 1998.
@@ -31,3 +31,4 @@
return cw & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
--- sysdeps/mips/init-first.c
+++ sysdeps/mips/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For mips/Unix.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -50,7 +50,9 @@
{
init (&argc);
+#ifndef NO_CTORS_DTORS_SECTIONS
__libc_global_ctors ();
+#endif
}
#endif
--- sysdeps/mips/stackinfo.h
+++ sysdeps/mips/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 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
@@ -22,7 +22,13 @@
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
+#include <elf.h>
+
/* On MIPS the stack grows down. */
#define _STACK_GROWS_DOWN 1
+/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
+ * present, but it is presumed absent. */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+
#endif /* stackinfo.h */
--- sysdeps/powerpc/dl-procinfo.c
+++ sysdeps/powerpc/dl-procinfo.c
+/* Data for processor capability information. PowerPC version.
+ Copyright (C) 2005, 2006, 2008 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. */
+
+/* This information must be kept in sync with the _DL_HWCAP_COUNT and
+ _DL_PLATFORM_COUNT definitions in procinfo.h.
+
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_powerpc_cap_flags
+#else
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ "vsx",
+ "arch_2_06", "power6x", "dfp", "pa6t",
+ "arch_2_05", "ic_snoop", "smt", "booke",
+ "cellbe", "power5+", "power5", "power4",
+ "notb", "efpdouble", "efpsingle", "spe",
+ "ucache", "4xxmac", "mmu", "fpu",
+ "altivec", "ppc601", "ppc64", "ppc32",
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_powerpc_platforms
+#else
+PROCINFO_CLASS const char _dl_powerpc_platforms[12][12]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ [PPC_PLATFORM_POWER4] = "power4",
+ [PPC_PLATFORM_PPC970] = "ppc970",
+ [PPC_PLATFORM_POWER5] = "power5",
+ [PPC_PLATFORM_POWER5_PLUS] = "power5+",
+ [PPC_PLATFORM_POWER6] = "power6",
+ [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
+ [PPC_PLATFORM_POWER6X] = "power6x",
+ [PPC_PLATFORM_POWER7] = "power7",
+ [PPC_PLATFORM_PPC405] = "ppc405",
+ [PPC_PLATFORM_PPC440] = "ppc440",
+ [PPC_PLATFORM_PPC464] = "ppc464",
+ [PPC_PLATFORM_PPC476] = "ppc476"
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
--- sysdeps/powerpc/dl-procinfo.h
+++ sysdeps/powerpc/dl-procinfo.h
+/* Processor capability information handling macros. PowerPC version.
+ Copyright (C) 2005, 2006, 2008 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 _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+
+#include <ldsodefs.h>
+#include <sysdep.h> /* This defines the PPC_FEATURE_* macros. */
+
+/* There are 25 bits used, but they are bits 7..31. */
+#define _DL_HWCAP_FIRST 7
+#define _DL_HWCAP_COUNT 32
+
+/* These bits influence library search. */
+#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \
+ + PPC_FEATURE_HAS_DFP)
+
+#define _DL_PLATFORMS_COUNT 12
+
+#define _DL_FIRST_PLATFORM 32
+/* Mask to filter out platforms. */
+#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
+ << _DL_FIRST_PLATFORM)
+
+/* Platform bits (relative to _DL_FIRST_PLATFORM). */
+#define PPC_PLATFORM_POWER4 0
+#define PPC_PLATFORM_PPC970 1
+#define PPC_PLATFORM_POWER5 2
+#define PPC_PLATFORM_POWER5_PLUS 3
+#define PPC_PLATFORM_POWER6 4
+#define PPC_PLATFORM_CELL_BE 5
+#define PPC_PLATFORM_POWER6X 6
+#define PPC_PLATFORM_POWER7 7
+#define PPC_PLATFORM_PPC405 8
+#define PPC_PLATFORM_PPC440 9
+#define PPC_PLATFORM_PPC464 10
+#define PPC_PLATFORM_PPC476 11
+
+static inline const char *
+__attribute__ ((unused))
+_dl_hwcap_string (int idx)
+{
+ return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
+}
+
+static inline const char *
+__attribute__ ((unused))
+_dl_platform_string (int idx)
+{
+ return GLRO(dl_powerpc_platforms)[idx - _DL_FIRST_PLATFORM];
+}
+
+static inline int
+__attribute__ ((unused))
+_dl_string_hwcap (const char *str)
+{
+ for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
+ if (strcmp (str, _dl_hwcap_string (i)) == 0)
+ return i;
+ return -1;
+}
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_platform (const char *str)
+{
+ if (str == NULL)
+ return -1;
+
+ if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
+ {
+ int ret;
+ str += 5;
+ switch (*str)
+ {
+ case '4':
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
+ break;
+ case '5':
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
+ if (str[1] == '+')
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
+ ++str;
+ }
+ break;
+ case '6':
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
+ if (str[1] == 'x')
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
+ ++str;
+ }
+ break;
+ case '7':
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7;
+ break;
+ default:
+ return -1;
+ }
+ if (str[1] == '\0')
+ return ret;
+ }
+ else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
+ 3) == 0)
+ {
+ if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
+ + 3) == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC405] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC405;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC440] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC440;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC464] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC464;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC476] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC476;
+ }
+
+ return -1;
+}
+
+#ifdef IS_IN_rtld
+static inline int
+__attribute__ ((unused))
+_dl_procinfo (int word)
+{
+ _dl_printf ("AT_HWCAP: ");
+
+ for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
+ if (word & (1 << i))
+ _dl_printf (" %s", _dl_hwcap_string (i));
+
+ _dl_printf ("\n");
+
+ return 0;
+}
+#endif
+
+#endif /* dl-procinfo.h */
--- sysdeps/powerpc/nofpu/fegetenv.c
+++ sysdeps/powerpc/nofpu/fegetenv.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment (soft-float edition).
Copyright (C) 2002 Free Software Foundation, Inc.
- Contributed by Aldy Hernandez <aldyh at redhat.com>, 2002.
+ Contributed by Aldy Hernandez <aldyh at redhat.com>, 2002, 2010.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,4 +46,5 @@
compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__fegetenv, fegetenv)
versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
--- sysdeps/powerpc/nofpu/feupdateenv.c
+++ sysdeps/powerpc/nofpu/feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions
(soft-float edition).
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2010 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh at redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -49,4 +49,5 @@
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
--- sysdeps/powerpc/nofpu/ftestexcept.c
+++ sysdeps/powerpc/nofpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test floating-point exceptions (soft-float edition).
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2010 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh at redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -26,3 +26,4 @@
{
return __sim_exceptions & x;
}
+libm_hidden_def (fetestexcept)
--- sysdeps/powerpc/powerpc32
+++ sysdeps/powerpc/powerpc32
+(directory)
--- sysdeps/powerpc/powerpc32/405
+++ sysdeps/powerpc/powerpc32/405
+(directory)
--- sysdeps/powerpc/powerpc32/405/memcmp.S
+++ sysdeps/powerpc/powerpc32/405/memcmp.S
+/* Optimized memcmp implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* memcmp
+
+ r3:source1 address, return equality
+ r4:source2 address
+ r5:byte count
+
+ Check 2 words from src1 and src2. If unequal jump to end and
+ return src1 > src2 or src1 < src2.
+ If count = zero check bytes before zero counter and then jump to end and
+ return src1 > src2, src1 < src2 or src1 = src2.
+ If src1 = src2 and no null, repeat. */
+
+EALIGN (BP_SYM (memcmp), 5, 0)
+ srwi. r6,r5,5
+ beq L(preword2_count_loop)
+ mtctr r6
+ clrlwi r5,r5,27
+
+L(word8_compare_loop):
+ lwz r10,0(r3)
+ lwz r6,4(r3)
+ lwz r8,0(r4)
+ lwz r9,4(r4)
+ cmplw cr5,r8,r10
+ cmplw cr1,r9,r6
+ bne cr5,L(st2)
+ bne cr1,L(st1)
+ lwz r10,8(r3)
+ lwz r6,12(r3)
+ lwz r8,8(r4)
+ lwz r9,12(r4)
+ cmplw cr5,r8,r10
+ cmplw cr1,r9,r6
+ bne cr5,L(st2)
+ bne cr1,L(st1)
+ lwz r10,16(r3)
+ lwz r6,20(r3)
+ lwz r8,16(r4)
+ lwz r9,20(r4)
+ cmplw cr5,r8,r10
+ cmplw cr1,r9,r6
+ bne cr5,L(st2)
+ bne cr1,L(st1)
+ lwz r10,24(r3)
+ lwz r6,28(r3)
+ addi r3,r3,0x20
+ lwz r8,24(r4)
+ lwz r9,28(r4)
+ addi r4,r4,0x20
+ cmplw cr5,r8,r10
+ cmplw cr1,r9,r6
+ bne cr5,L(st2)
+ bne cr1,L(st1)
+ bdnz L(word8_compare_loop)
+
+L(preword2_count_loop):
+ srwi. r6,r5,3
+ beq L(prebyte_count_loop)
+ mtctr r6
+ clrlwi r5,r5,29
+
+L(word2_count_loop):
+ lwz r10,0(r3)
+ lwz r6,4(r3)
+ addi r3,r3,0x08
+ lwz r8,0(r4)
+ lwz r9,4(r4)
+ addi r4,r4,0x08
+ cmplw cr5,r8,r10
+ cmplw cr1,r9,r6
+ bne cr5,L(st2)
+ bne cr1,L(st1)
+ bdnz L(word2_count_loop)
+
+L(prebyte_count_loop):
+ addi r5,r5,1
+ mtctr r5
+ bdz L(end_memcmp)
+
+L(byte_count_loop):
+ lbz r6,0(r3)
+ addi r3,r3,0x01
+ lbz r8,0(r4)
+ addi r4,r4,0x01
+ cmplw cr5,r8,r6
+ bne cr5,L(st2)
+ bdnz L(byte_count_loop)
+
+L(end_memcmp):
+ addi r3,r0,0
+ blr
+
+L(l_r):
+ addi r3,r0,1
+ blr
+
+L(st1):
+ blt cr1,L(l_r)
+ addi r3,r0,-1
+ blr
+
+L(st2):
+ blt cr5,L(l_r)
+ addi r3,r0,-1
+ blr
+END (BP_SYM (memcmp))
+libc_hidden_builtin_def (memcmp)
+weak_alias (memcmp,bcmp)
--- sysdeps/powerpc/powerpc32/405/memcpy.S
+++ sysdeps/powerpc/powerpc32/405/memcpy.S
+/* Optimized memcpy implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* memcpy
+
+ r0:return address
+ r3:destination address
+ r4:source address
+ r5:byte count
+
+ Save return address in r0.
+ If destinationn and source are unaligned and copy count is greater than 256
+ then copy 0-3 bytes to make destination aligned.
+ If 32 or more bytes to copy we use 32 byte copy loop.
+ Finaly we copy 0-31 extra bytes. */
+
+EALIGN (BP_SYM (memcpy), 5, 0)
+/* Check if bytes to copy are greater than 256 and if
+ source and destination are unaligned */
+ cmpwi r5,0x0100
+ addi r0,r3,0
+ ble L(string_count_loop)
+ neg r6,r3
+ clrlwi. r6,r6,30
+ beq L(string_count_loop)
+ neg r6,r4
+ clrlwi. r6,r6,30
+ beq L(string_count_loop)
+ mtctr r6
+ subf r5,r6,r5
+
+L(unaligned_bytecopy_loop): /* Align destination by coping 0-3 bytes */
+ lbz r8,0x0(r4)
+ addi r4,r4,1
+ stb r8,0x0(r3)
+ addi r3,r3,1
+ bdnz L(unaligned_bytecopy_loop)
+ srwi. r7,r5,5
+ beq L(preword2_count_loop)
+ mtctr r7
+
+L(word8_count_loop_no_dcbt): /* Copy 32 bytes at a time */
+ lwz r6,0(r4)
+ lwz r7,4(r4)
+ lwz r8,8(r4)
+ lwz r9,12(r4)
+ subi r5,r5,0x20
+ stw r6,0(r3)
+ stw r7,4(r3)
+ stw r8,8(r3)
+ stw r9,12(r3)
+ lwz r6,16(r4)
+ lwz r7,20(r4)
+ lwz r8,24(r4)
+ lwz r9,28(r4)
+ addi r4,r4,0x20
+ stw r6,16(r3)
+ stw r7,20(r3)
+ stw r8,24(r3)
+ stw r9,28(r3)
+ addi r3,r3,0x20
+ bdnz L(word8_count_loop_no_dcbt)
+
+L(preword2_count_loop): /* Copy remaining 0-31 bytes */
+ clrlwi. r12,r5,27
+ beq L(end_memcpy)
+ mtxer r12
+ lswx r5,0,r4
+ stswx r5,0,r3
+ mr r3,r0
+ blr
+
+L(string_count_loop): /* Copy odd 0-31 bytes */
+ clrlwi. r12,r5,28
+ add r3,r3,r5
+ add r4,r4,r5
+ beq L(pre_string_copy)
+ mtxer r12
+ subf r4,r12,r4
+ subf r3,r12,r3
+ lswx r6,0,r4
+ stswx r6,0,r3
+
+L(pre_string_copy): /* Check how many 32 byte chunck to copy */
+ srwi. r7,r5,4
+ beq L(end_memcpy)
+ mtctr r7
+
+L(word4_count_loop_no_dcbt): /* Copy 32 bytes at a time */
+ lwz r6,-4(r4)
+ lwz r7,-8(r4)
+ lwz r8,-12(r4)
+ lwzu r9,-16(r4)
+ stw r6,-4(r3)
+ stw r7,-8(r3)
+ stw r8,-12(r3)
+ stwu r9,-16(r3)
+ bdz L(end_memcpy)
+ lwz r6,-4(r4)
+ lwz r7,-8(r4)
+ lwz r8,-12(r4)
+ lwzu r9,-16(r4)
+ stw r6,-4(r3)
+ stw r7,-8(r3)
+ stw r8,-12(r3)
+ stwu r9,-16(r3)
+ bdnz L(word4_count_loop_no_dcbt)
+
+L(end_memcpy):
+ mr r3,r0
+ blr
+END (BP_SYM (memcpy))
+libc_hidden_builtin_def (memcpy)
--- sysdeps/powerpc/powerpc32/405/memset.S
+++ sysdeps/powerpc/powerpc32/405/memset.S
+/* Optimized memset implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* memset
+
+ r3:destination address and return address
+ r4:source integer to copy
+ r5:byte count
+ r11:sources integer to copy in all 32 bits of reg
+ r12:temp return address
+
+ Save return address in r12
+ If destinationn is unaligned and count is greater tha 255 bytes
+ set 0-3 bytes to make destination aligned
+ If count is greater tha 255 bytes and setting zero to memory
+ use dbcz to set memeory when we can
+ otherwsie do the follwoing
+ If 16 or more words to set we use 16 word copy loop.
+ Finaly we set 0-15 extra bytes with string store. */
+
+EALIGN (BP_SYM (memset), 5, 0)
+ rlwinm r11,r4,0,24,31
+ rlwimi r11,r4,8,16,23
+ rlwimi r11,r11,16,0,15
+ addi r12,r3,0
+ cmpwi r5,0x00FF
+ ble L(preword8_count_loop)
+ cmpwi r4,0x00
+ beq L(use_dcbz)
+ neg r6,r3
+ clrlwi. r6,r6,30
+ beq L(preword8_count_loop)
+ addi r8,0,1
+ mtctr r6
+ subi r3,r3,1
+
+L(unaligned_bytecopy_loop):
+ stbu r11,0x1(r3)
+ subf. r5,r8,r5
+ beq L(end_memset)
+ bdnz L(unaligned_bytecopy_loop)
+ addi r3,r3,1
+
+L(preword8_count_loop):
+ srwi. r6,r5,4
+ beq L(preword2_count_loop)
+ mtctr r6
+ addi r3,r3,-4
+ mr r8,r11
+ mr r9,r11
+ mr r10,r11
+
+L(word8_count_loop_no_dcbt):
+ stwu r8,4(r3)
+ stwu r9,4(r3)
+ subi r5,r5,0x10
+ stwu r10,4(r3)
+ stwu r11,4(r3)
+ bdnz L(word8_count_loop_no_dcbt)
+ addi r3,r3,4
+
+L(preword2_count_loop):
+ clrlwi. r7,r5,28
+ beq L(end_memset)
+ mr r8,r11
+ mr r9,r11
+ mr r10,r11
+ mtxer r7
+ stswx r8,0,r3
+
+L(end_memset):
+ addi r3,r12,0
+ blr
+
+L(use_dcbz):
+ neg r6,r3
+ clrlwi. r7,r6,28
+ beq L(skip_string_loop)
+ mr r8,r11
+ mr r9,r11
+ mr r10,r11
+ subf r5,r7,r5
+ mtxer r7
+ stswx r8,0,r3
+ add r3,r3,r7
+
+L(skip_string_loop):
+ clrlwi r8,r6,25
+ srwi. r8,r8,4
+ beq L(dcbz_pre_loop)
+ mtctr r8
+
+L(word_loop):
+ stw r11,0(r3)
+ subi r5,r5,0x10
+ stw r11,4(r3)
+ stw r11,8(r3)
+ stw r11,12(r3)
+ addi r3,r3,0x10
+ bdnz L(word_loop)
+
+L(dcbz_pre_loop):
+ srwi r6,r5,7
+ mtctr r6
+ addi r7,0,0
+
+L(dcbz_loop):
+ dcbz r3,r7
+ addi r3,r3,0x80
+ subi r5,r5,0x80
+ bdnz L(dcbz_loop)
+ srwi. r6,r5,4
+ beq L(postword2_count_loop)
+ mtctr r6
+
+L(postword8_count_loop):
+ stw r11,0(r3)
+ subi r5,r5,0x10
+ stw r11,4(r3)
+ stw r11,8(r3)
+ stw r11,12(r3)
+ addi r3,r3,0x10
+ bdnz L(postword8_count_loop)
+
+L(postword2_count_loop):
+ clrlwi. r7,r5,28
+ beq L(end_memset)
+ mr r8,r11
+ mr r9,r11
+ mr r10,r11
+ mtxer r7
+ stswx r8,0,r3
+ b L(end_memset)
+END (BP_SYM (memset))
+libc_hidden_builtin_def (memset)
--- sysdeps/powerpc/powerpc32/405/strcmp.S
+++ sysdeps/powerpc/powerpc32/405/strcmp.S
+/* Optimized strcmp implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* strcmp
+
+ Register Use
+ r0:temp return equality
+ r3:source1 address, return equality
+ r4:source2 address
+
+ Implementation description
+ Check 2 words from src1 and src2. If unequal jump to end and
+ return src1 > src2 or src1 < src2.
+ If null check bytes before null and then jump to end and
+ return src1 > src2, src1 < src2 or src1 = src2.
+ If src1 = src2 and no null, repeat. */
+
+EALIGN (BP_SYM(strcmp),5,0)
+ neg r7,r3
+ clrlwi r7,r7,20
+ neg r8,r4
+ clrlwi r8,r8,20
+ srwi. r7,r7,5
+ beq L(byte_loop)
+ srwi. r8,r8,5
+ beq L(byte_loop)
+ cmplw r7,r8
+ mtctr r7
+ ble L(big_loop)
+ mtctr r8
+
+L(big_loop):
+ lwz r5,0(r3)
+ lwz r6,4(r3)
+ lwz r8,0(r4)
+ lwz r9,4(r4)
+ dlmzb. r12,r5,r6
+ bne L(end_check)
+ cmplw r5,r8
+ bne L(st1)
+ cmplw r6,r9
+ bne L(st1)
+ lwz r5,8(r3)
+ lwz r6,12(r3)
+ lwz r8,8(r4)
+ lwz r9,12(r4)
+ dlmzb. r12,r5,r6
+ bne L(end_check)
+ cmplw r5,r8
+ bne L(st1)
+ cmplw r6,r9
+ bne L(st1)
+ lwz r5,16(r3)
+ lwz r6,20(r3)
+ lwz r8,16(r4)
+ lwz r9,20(r4)
+ dlmzb. r12,r5,r6
+ bne L(end_check)
+ cmplw r5,r8
+ bne L(st1)
+ cmplw r6,r9
+ bne L(st1)
+ lwz r5,24(r3)
+ lwz r6,28(r3)
+ addi r3,r3,0x20
+ lwz r8,24(r4)
+ lwz r9,28(r4)
+ addi r4,r4,0x20
+ dlmzb. r12,r5,r6
+ bne L(end_check)
+ cmplw r5,r8
+ bne L(st1)
+ cmplw r6,r9
+ bne L(st1)
+ bdnz L(big_loop)
+ b L(byte_loop)
+
+L(end_check):
+ subfic r12,r12,4
+ blt L(end_check2)
+ rlwinm r12,r12,3,0,31
+ srw r5,r5,r12
+ srw r8,r8,r12
+ cmplw r5,r8
+ bne L(st1)
+ b L(end_strcmp)
+
+L(end_check2):
+ addi r12,r12,4
+ cmplw r5,r8
+ rlwinm r12,r12,3,0,31
+ bne L(st1)
+ srw r6,r6,r12
+ srw r9,r9,r12
+ cmplw r6,r9
+ bne L(st1)
+
+L(end_strcmp):
+ addi r3,r0,0
+ blr
+
+L(st1):
+ mfcr r3
+ blr
+
+L(byte_loop):
+ lbz r5,0(r3)
+ addi r3,r3,1
+ lbz r6,0(r4)
+ addi r4,r4,1
+ cmplw r5,r6
+ bne L(st1)
+ cmpwi r5,0
+ beq L(end_strcmp)
+ b L(byte_loop)
+END (BP_SYM (strcmp))
+libc_hidden_builtin_def (strcmp)
--- sysdeps/powerpc/powerpc32/405/strcpy.S
+++ sysdeps/powerpc/powerpc32/405/strcpy.S
+/* Optimized strcpy implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* strcpy
+
+ Register Use
+ r3:destination and return address
+ r4:source address
+ r10:temp destination address
+
+ Implementation description
+ Loop by checking 2 words at a time, with dlmzb. Check if there is a null
+ in the 2 words. If there is a null jump to end checking to determine
+ where in the last 8 bytes it is. Copy the appropriate bytes of the last
+ 8 according to the null position. */
+
+EALIGN (BP_SYM (strcpy), 5, 0)
+ neg r7,r4
+ subi r4,r4,1
+ clrlwi. r8,r7,29
+ subi r10,r3,1
+ beq L(pre_word8_loop)
+ mtctr r8
+
+L(loop):
+ lbzu r5,0x01(r4)
+ cmpi cr5,r5,0x0
+ stbu r5,0x01(r10)
+ beq cr5,L(end_strcpy)
+ bdnz L(loop)
+
+L(pre_word8_loop):
+ subi r4,r4,3
+ subi r10,r10,3
+
+L(word8_loop):
+ lwzu r5,0x04(r4)
+ lwzu r6,0x04(r4)
+ dlmzb. r11,r5,r6
+ bne L(byte_copy)
+ stwu r5,0x04(r10)
+ stwu r6,0x04(r10)
+ lwzu r5,0x04(r4)
+ lwzu r6,0x04(r4)
+ dlmzb. r11,r5,r6
+ bne L(byte_copy)
+ stwu r5,0x04(r10)
+ stwu r6,0x04(r10)
+ lwzu r5,0x04(r4)
+ lwzu r6,0x04(r4)
+ dlmzb. r11,r5,r6
+ bne L(byte_copy)
+ stwu r5,0x04(r10)
+ stwu r6,0x04(r10)
+ lwzu r5,0x04(r4)
+ lwzu r6,0x04(r4)
+ dlmzb. r11,r5,r6
+ bne L(byte_copy)
+ stwu r5,0x04(r10)
+ stwu r6,0x04(r10)
+ b L(word8_loop)
+
+L(last_bytes_copy):
+ stwu r5,0x04(r10)
+ subi r11,r11,4
+ mtctr r11
+ addi r10,r10,3
+ subi r4,r4,1
+
+L(last_bytes_copy_loop):
+ lbzu r5,0x01(r4)
+ stbu r5,0x01(r10)
+ bdnz L(last_bytes_copy_loop)
+ blr
+
+L(byte_copy):
+ blt L(last_bytes_copy)
+ mtctr r11
+ addi r10,r10,3
+ subi r4,r4,5
+
+L(last_bytes_copy_loop2):
+ lbzu r5,0x01(r4)
+ stbu r5,0x01(r10)
+ bdnz L(last_bytes_copy_loop2)
+
+L(end_strcpy):
+ blr
+END (BP_SYM (strcpy))
+libc_hidden_builtin_def (strcpy)
--- sysdeps/powerpc/powerpc32/405/strlen.S
+++ sysdeps/powerpc/powerpc32/405/strlen.S
+/* Optimized strlen implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* strlen
+
+ Register Use
+ r3:source address and return length of string
+ r4:byte counter
+
+ Implementation description
+ Load 2 words at a time and count bytes, if we find null we subtract one from
+ the count and return the count value. We need to subtract one because
+ we don't count the null character as a byte. */
+
+EALIGN (BP_SYM (strlen),5,0)
+ neg r7,r3
+ clrlwi. r8,r7,29
+ addi r4,0,0
+ beq L(byte_count_loop)
+ mtctr r8
+
+L(loop):
+ lbz r5,0(r3)
+ cmpi cr5,r5,0x0
+ addi r3,r3,0x1
+ addi r4,r4,0x1
+ beq cr5,L(end_strlen)
+ bdnz L(loop)
+
+L(byte_count_loop):
+ lwz r5,0(r3)
+ lwz r6,4(r3)
+ dlmzb. r12,r5,r6
+ add r4,r4,r12
+ bne L(end_strlen)
+ lwz r5,8(r3)
+ lwz r6,12(r3)
+ dlmzb. r12,r5,r6
+ add r4,r4,r12
+ bne L(end_strlen)
+ lwz r5,16(r3)
+ lwz r6,20(r3)
+ dlmzb. r12,r5,r6
+ add r4,r4,r12
+ bne L(end_strlen)
+ lwz r5,24(r3)
+ lwz r6,28(r3)
+ addi r3,r3,0x20
+ dlmzb. r12,r5,r6
+ add r4,r4,r12
+ bne L(end_strlen)
+ b L(byte_count_loop)
+
+L(end_strlen):
+ addi r3,r4,-1
+ blr
+END (BP_SYM (strlen))
+libc_hidden_builtin_def (strlen)
--- sysdeps/powerpc/powerpc32/405/strncmp.S
+++ sysdeps/powerpc/powerpc32/405/strncmp.S
+/* Optimized strncmp implementation for PowerPC476.
+ 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., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+/* strncmp
+
+ Register Use
+ r0:temp return equality
+ r3:source1 address, return equality
+ r4:source2 address
+ r5:byte count
+
+ Implementation description
+ Touch in 3 lines of D-cache.
+ If source1 or source2 is unaligned copy 0-3 bytes to make source1 aligned
+ Check 2 words from src1 and src2. If unequal jump to end and
+ return src1 > src2 or src1 < src2.
+ If null check bytes before null and then jump to end and
+ return src1 > src2, src1 < src2 or src1 = src2.
+ If count = zero check bytes before zero counter and then jump to end and
+ return src1 > src2, src1 < src2 or src1 = src2.
+ If src1 = src2 and no null, repeat. */
+
+EALIGN (BP_SYM(strncmp),5,0)
+ neg r7,r3
+ clrlwi r7,r7,20
+ neg r8,r4
+ clrlwi r8,r8,20
+ srwi. r7,r7,3
+ beq L(prebyte_count_loop)
+ srwi. r8,r8,3
+ beq L(prebyte_count_loop)
+ cmplw r7,r8
+ mtctr r7
+ ble L(preword2_count_loop)
+ mtctr r8
+
+L(preword2_count_loop):
+ srwi. r6,r5,3
+ beq L(prebyte_count_loop)
+ mfctr r7
+ cmplw r6,r7
+ bgt L(set_count_loop)
+ mtctr r6
+ clrlwi r5,r5,29
+
+L(word2_count_loop):
+ lwz r10,0(r3)
+ lwz r6,4(r3)
+ addi r3,r3,0x08
+ lwz r8,0(r4)
+ lwz r9,4(r4)
+ addi r4,r4,0x08
+ dlmzb. r12,r10,r6
+ bne L(end_check)
+ cmplw r10,r8
+ bne L(st1)
+ cmplw r6,r9
+ bne L(st1)
+ bdnz L(word2_count_loop)
+
+L(prebyte_count_loop):
+ addi r5,r5,1
+ mtctr r5
+ bdz L(end_strncmp)
+
+L(byte_count_loop):
+ lbz r6,0(r3)
+ addi r3,r3,1
+ lbz r7,0(r4)
+ addi r4,r4,1
+ cmplw r6,r7
+ bne L(st1)
+ cmpwi r6,0
+ beq L(end_strncmp)
+ bdnz L(byte_count_loop)
+ b L(end_strncmp)
+
+L(set_count_loop):
+ slwi r7,r7,3
+ subf r5,r7,r5
+ b L(word2_count_loop)
+
+L(end_check):
+ subfic r12,r12,4
+ blt L(end_check2)
+ rlwinm r12,r12,3,0,31
+ srw r10,r10,r12
+ srw r8,r8,r12
+ cmplw r10,r8
+ bne L(st1)
+ b L(end_strncmp)
+
+L(end_check2):
+ addi r12,r12,4
+ cmplw r10,r8
+ rlwinm r12,r12,3,0,31
+ bne L(st1)
+ srw r6,r6,r12
+ srw r9,r9,r12
+ cmplw r6,r9
+ bne L(st1)
+
+L(end_strncmp):
+ addi r3,r0,0
+ blr
+
+L(st1):
+ mfcr r3
+ blr
+END (BP_SYM (strncmp))
+libc_hidden_builtin_def (strncmp)
--- sysdeps/powerpc/powerpc32/440
+++ sysdeps/powerpc/powerpc32/440
+(directory)
--- sysdeps/powerpc/powerpc32/440/Implies
+++ sysdeps/powerpc/powerpc32/440/Implies
+powerpc/powerpc32/405/fpu
+powerpc/powerpc32/405
--- sysdeps/powerpc/powerpc32/464
+++ sysdeps/powerpc/powerpc32/464
+(directory)
--- sysdeps/powerpc/powerpc32/464/Implies
+++ sysdeps/powerpc/powerpc32/464/Implies
+powerpc/powerpc32/440/fpu
+powerpc/powerpc32/440
--- sysdeps/powerpc/powerpc32/476
+++ sysdeps/powerpc/powerpc32/476
+(directory)
--- sysdeps/powerpc/powerpc32/476/Implies
+++ sysdeps/powerpc/powerpc32/476/Implies
+powerpc/powerpc32/464/fpu
+powerpc/powerpc32/464
--- sysdeps/powerpc/powerpc32/Makefile
+++ sysdeps/powerpc/powerpc32/Makefile
+# Some Powerpc32 variants assume soft-fp is the default even though there is
+# an fp variant so provide -mhard-float if --with-fp is explicitly passed.
+
+ifeq ($(with-fp),yes)
++cflags += -mhard-float
+ASFLAGS += -mhard-float
+sysdep-LDFLAGS += -mhard-float
+endif
--- sysdeps/unix/alpha/sysdep.h
+++ 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 at zen.org).
@@ -191,8 +191,10 @@
})
#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 @@
# 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 */
--- sysdeps/unix/arm/sysdep.S
+++ 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 @@
#if USE___THREAD
mov ip, lr
+ cfi_register (lr, ip)
mov r1, r0
mov r0, #0xffff0fff
@@ -66,9 +67,13 @@
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
--- sysdeps/unix/mips/mips64/n32/sysdep.h
+++ sysdeps/unix/mips/mips64/n32/sysdep.h
@@ -45,6 +45,7 @@
.set noreorder; \
.align 2; \
99: j __syscall_error; \
+ nop; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
--- sysdeps/unix/mips/mips64/n64/sysdep.h
+++ sysdeps/unix/mips/mips64/n64/sysdep.h
@@ -45,6 +45,7 @@
.set noreorder; \
.align 2; \
99: j __syscall_error; \
+ nop; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
--- sysdeps/unix/sysv/linux/alpha/Versions
+++ sysdeps/unix/sysv/linux/alpha/Versions
@@ -77,6 +77,10 @@
#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;
}
--- sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
+++ sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
+/* 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", at progbits,1
+ .type longjmp_msg, at 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
--- sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2000,2004,2005,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-2000,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
@@ -41,16 +41,18 @@
#define O_NONBLOCK 00004
#define O_APPEND 00010
#define O_NDELAY O_NONBLOCK
-#define O_SYNC 040000
+#define O_SYNC 020040000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000 /* fcntl, for BSD compatibility */
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
# define O_DIRECTORY 0100000 /* Must be a directory. */
# define O_NOFOLLOW 0200000 /* Do not follow links. */
+# define O_CLOEXEC 010000000 /* Set close_on_exec. */
+#endif
+#ifdef __USE_GNU
# define O_DIRECT 02000000 /* Direct disk access. */
# define O_NOATIME 04000000 /* Do not set atime. */
-# define O_CLOEXEC 010000000 /* Set close_on_exec. */
#endif
#ifdef __USE_LARGEFILE64
@@ -62,7 +64,7 @@
We define the symbols here but let them do the same as O_SYNC since
this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_DSYNC 040000 /* Synchronize data. */
# define O_RSYNC O_SYNC /* Synchronize read operations. */
#endif
@@ -79,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
+#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
@@ -87,12 +89,16 @@
#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
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+#endif
+#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
@@ -157,6 +163,23 @@
};
#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. */
@@ -210,7 +233,7 @@
/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
--- sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/Alpha version.
- Copyright (C) 1997, 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2003, 2006, 2009
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -91,14 +92,17 @@
/* Advice to `madvise'. */
#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 6 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 6 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
--- sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
+++ sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux/Alpha sigaction.
- Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2000, 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
@@ -54,6 +54,8 @@
three arguments instead of one. */
#if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
+#endif
+#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
# define SA_NODEFER 0x00000008 /* Don't automatically block the signal
when its handler is being executed. */
--- sysdeps/unix/sysv/linux/alpha/bits/socket.h
+++ sysdeps/unix/sysv/linux/alpha/bits/socket.h
+/* 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_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
+#define MSG_WAITFORONE MSG_WAITFORONE
+
+ 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 */
--- sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2001,2004
+/* Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,10 +17,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_KERNEL 0
#define _STAT_VER_GLIBC2 1
@@ -41,7 +44,7 @@
Use neat tidy anonymous unions and structures when possible. */
-#ifdef __USE_MISC
+#if defined __USE_MISC || defined __USE_XOPEN2K8
# if __GNUC_PREREQ(3,3)
# define __ST_TIME(X) \
__extension__ union { \
@@ -155,3 +158,5 @@
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
--- sysdeps/unix/sysv/linux/alpha/creat.c
+++ sysdeps/unix/sysv/linux/alpha/creat.c
+/* 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)
--- sysdeps/unix/sysv/linux/alpha/dl-auxv.h
+++ 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: \
--- sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
+++ 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>
--- sysdeps/unix/sysv/linux/alpha/fstatfs64.c
+++ sysdeps/unix/sysv/linux/alpha/fstatfs64.c
+#include <sysdeps/unix/sysv/linux/fstatfs64.c>
--- sysdeps/unix/sysv/linux/alpha/fstatvfs.c
+++ sysdeps/unix/sysv/linux/alpha/fstatvfs.c
+#include <sysdeps/unix/sysv/linux/fstatvfs.c>
--- sysdeps/unix/sysv/linux/alpha/fstatvfs64.c
+++ sysdeps/unix/sysv/linux/alpha/fstatvfs64.c
+#include <sysdeps/unix/sysv/linux/fstatvfs64.c>
--- sysdeps/unix/sysv/linux/alpha/fxstat.c
+++ sysdeps/unix/sysv/linux/alpha/fxstat.c
@@ -35,27 +35,39 @@
__fxstat (int vers, int fd, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_fstat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__fxstat)
--- sysdeps/unix/sysv/linux/alpha/fxstatat.c
+++ sysdeps/unix/sysv/linux/alpha/fxstatat.c
@@ -71,6 +71,20 @@
int result, errno_out;
struct kernel_stat kst;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
+ else
+ result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
+
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
+ goto fail;
+ }
+#elif defined __NR_stat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
if (flag & AT_SYMLINK_NOFOLLOW)
@@ -85,6 +99,7 @@
goto fail;
__libc_missing_axp_stat64 = 1;
}
+#endif
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
--- sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c
+++ sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c
+#include <sysdeps/unix/sysv/linux/internal_statvfs64.c>
--- sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ sysdeps/unix/sysv/linux/alpha/kernel-features.h
+/* Set flags signalling availability of kernel features based on given
+ kernel version number.
+ 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. */
+
+/* alpha switched to a 64-bit timeval sometime before 2.2.0. */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_TIMEVAL64 1
+#endif
+
+/* The tgkill syscall was introduced for alpha 2.6.0-test1 which unfortunately
+ cannot be distinguished from 2.6.0. */
+#if __LINUX_KERNEL_VERSION >= 132609
+# define __ASSUME_TGKILL 1
+#endif
+
+/* Starting with version 2.6.4, the stat64 syscalls are available. */
+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
+# define __ASSUME_STAT64_SYSCALL 1
+#endif
+
+#define __ASSUME_UTIMES 1
+
+/* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists. */
+#if __LINUX_KERNEL_VERSION >= 0x020609
+# define __ASSUME_IEEE_RAISE_EXCEPTION 1
+#endif
+
+/* Support for the O_CLOEXEC flag was added for alpha in 2.6.23. */
+#if __LINUX_KERNEL_VERSION >= 0x020617
+# define __ASSUME_O_CLOEXEC 1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added for alpha after
+ 2.6.33-rc1. */
+#if __LINUX_KERNEL_VERSION >= 0x020621
+# define __ASSUME_SOCK_CLOEXEC 1
+# define __ASSUME_IN_NONBLOCK 1
+#endif
+
+/* Support for the pipe2, eventfd2, signalfd4 syscalls was added for alpha
+ after 2.6.33-rc1. */
+#if __LINUX_KERNEL_VERSION >= 0x020621
+# define __ASSUME_PIPE2 1
+# define __ASSUME_EVENTFD2 1
+# define __ASSUME_SIGNALFD4 1
+#endif
+
+/* Support for accept4 was added for alpha after 2.6.33-rc1. */
+#if __LINUX_KERNEL_VERSION >= 0x020621
+# define __ASSUME_ACCEPT4 1
+#endif
+
+#include_next <kernel-features.h>
+
+#undef __ASSUME_ST_INO_64_BIT
+
+/* pselect/ppoll were introduced on alpha just after 2.6.22-rc1. */
+#if __LINUX_KERNEL_VERSION < 0x020617
+# undef __ASSUME_PSELECT
+# undef __ASSUME_PPOLL
+#endif
+
+/* The *at syscalls were introduced on alpha just after 2.6.22-rc1. */
+#if __LINUX_KERNEL_VERSION < 0x020617
+# undef __ASSUME_ATFCTS
+#endif
+
+/* Support for inter-process robust mutexes was added on alpha just
+ after 2.6.22-rc1. */
+#if __LINUX_KERNEL_VERSION < 0x020617
+# undef __ASSUME_SET_ROBUST_LIST
+#endif
+
+/* Support for utimensat was added on alpha after 2.6.22-rc1. */
+#if __LINUX_KERNEL_VERSION < 0x020617
+# undef __ASSUME_UTIMENSAT
+#endif
+
+/* Support for fallocate was added for alpha after 2.6.33-rc1. */
+#if __LINUX_KERNEL_VERSION < 0x020621
+# undef __ASSUME_FALLOCATE
+#endif
--- sysdeps/unix/sysv/linux/alpha/lxstat.c
+++ sysdeps/unix/sysv/linux/alpha/lxstat.c
@@ -35,27 +35,39 @@
__lxstat (int vers, const char *name, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_lstat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__lxstat)
--- sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
+++ sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
@@ -1 +1 @@
-#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c>
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c>
--- sysdeps/unix/sysv/linux/alpha/statfs64.c
+++ sysdeps/unix/sysv/linux/alpha/statfs64.c
+#include <sysdeps/unix/sysv/linux/statfs64.c>
--- sysdeps/unix/sysv/linux/alpha/statvfs.c
+++ sysdeps/unix/sysv/linux/alpha/statvfs.c
+#include <sysdeps/unix/sysv/linux/statvfs.c>
--- sysdeps/unix/sysv/linux/alpha/statvfs64.c
+++ sysdeps/unix/sysv/linux/alpha/statvfs64.c
+#include <sysdeps/unix/sysv/linux/statvfs64.c>
--- sysdeps/unix/sysv/linux/alpha/sys/user.h
+++ 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 @@
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)
--- sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -53,3 +53,8 @@
osf_utimes - osf_utimes 2 __utimes_tv32 utimes at GLIBC_2.0
osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage at GLIBC_2.0
osf_wait4 - osf_wait4 2 __wait4_tv32 wait4 at GLIBC_2.0
+
+# avoid 64-bit aliases on 32-bit statfs syscalls
+fstatfs - fstatfs i:ip __fstatfs fstatfs
+statfs - statfs i:sp __statfs statfs
+
--- sysdeps/unix/sysv/linux/alpha/xstat.c
+++ sysdeps/unix/sysv/linux/alpha/xstat.c
@@ -35,27 +35,39 @@
__xstat (int vers, const char *name, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_stat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__xstat)
--- sysdeps/unix/sysv/linux/alpha/xstatconv.c
+++ sysdeps/unix/sysv/linux/alpha/xstatconv.c
@@ -22,9 +22,14 @@
#include <sys/stat.h>
#include <kernel_stat.h>
#include <xstatconv.h>
+#include <sys/syscall.h>
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
int __libc_missing_axp_stat64;
+# endif
+#endif
int
__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
--- sysdeps/unix/sysv/linux/alpha/xstatconv.h
+++ sysdeps/unix/sysv/linux/alpha/xstatconv.h
@@ -18,7 +18,12 @@
02111-1307 USA. */
#include <kernel-features.h>
+#include <sys/syscall.h>
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
extern int __libc_missing_axp_stat64 attribute_hidden;
+# endif
+#endif
extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
attribute_hidden;
--- sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009
+ Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -41,23 +41,25 @@
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_NDELAY O_NONBLOCK
-#define O_SYNC 010000
+#define O_SYNC 04010000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
# define O_DIRECTORY 040000 /* Must be a directory. */
# define O_NOFOLLOW 0100000 /* Do not follow links. */
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+#endif
+#ifdef __USE_GNU
# define O_DIRECT 0200000 /* Direct disk access. */
# define O_NOATIME 01000000 /* Do not set atime. */
-# define O_CLOEXEC 02000000 /* Set close_on_exec. */
#endif
/* For now Linux has synchronisity options for data and read operations.
We define the symbols here but let them do the same as O_SYNC since
this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_DSYNC 010000 /* Synchronize data. */
# define O_RSYNC O_SYNC /* Synchronize read operations. */
#endif
@@ -84,7 +86,7 @@
#define F_SETLK64 13 /* Set record locking info (non-blocking). */
#define F_SETLKW64 14 /* Set record locking info (blocking). */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
@@ -100,6 +102,10 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+#endif
+#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
@@ -172,9 +178,10 @@
/* Owner types. */
enum __pid_type
{
- F_OWNER_TID = 0, /* Kernel thread. */
- F_OWNER_PID, /* Process. */
- F_OWNER_GID /* Process group. */
+ 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. */
@@ -237,7 +244,7 @@
/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
--- sysdeps/unix/sysv/linux/arm/bits/mman.h
+++ sysdeps/unix/sysv/linux/arm/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/ARM version.
- Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003, 2005, 2006, 2009, 2011
+ 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
@@ -83,14 +84,19 @@
/* Advice to `madvise'. */
#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
+# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
--- sysdeps/unix/sysv/linux/arm/clone.S
+++ 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 at corelcomputer.com>
@@ -52,8 +52,13 @@
@ 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 @@
#else
swi SYS_ify(clone)
#endif
+ cfi_endproc
cmp r0, #0
beq 1f
#ifdef __ARM_EABI__
@@ -74,6 +80,8 @@
blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
RETINSTR(, lr)
+ cfi_startproc
+ cfi_undefined (lr)
1:
#ifdef RESET_PID
tst ip, #CLONE_THREAD
--- sysdeps/unix/sysv/linux/arm/dl-procinfo.c
+++ sysdeps/unix/sysv/linux/arm/dl-procinfo.c
@@ -47,12 +47,12 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_arm_cap_flags
#else
-PROCINFO_CLASS const char _dl_arm_cap_flags[10][10]
+PROCINFO_CLASS const char _dl_arm_cap_flags[15][10]
#endif
#ifndef PROCINFO_DECL
= {
- "swp", "half", "thumb", "26bit", "fast-mult", "fpa", "vfp", "edsp",
- "java", "iwmmxt",
+ "swp", "half", "thumb", "26bit", "fastmult", "fpa", "vfp", "edsp",
+ "java", "iwmmxt", "crunch", "thumbee", "neon", "vfpv3", "vfpv3d16",
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
--- sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+++ sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -24,7 +24,7 @@
#include <ldsodefs.h>
#include <sysdep.h>
-#define _DL_HWCAP_COUNT 10
+#define _DL_HWCAP_COUNT 15
/* The kernel provides platform data but it is not interesting. */
#define _DL_HWCAP_PLATFORM 0
@@ -54,7 +54,7 @@
return GLRO(dl_arm_cap_flags)[idx];
};
-#define HWCAP_IMPORTANT (HWCAP_ARM_HALF | HWCAP_ARM_FAST_MULT)
+#define HWCAP_IMPORTANT (HWCAP_ARM_VFP | HWCAP_ARM_NEON)
static inline int
__attribute__ ((unused))
--- sysdeps/unix/sysv/linux/arm/eabi/Makefile
+++ sysdeps/unix/sysv/linux/arm/eabi/Makefile
@@ -7,3 +7,34 @@
# unwind tables for __libc_start_main.
CFLAGS-libc-start.c += -fexceptions
endif
+
+# Add a syscall function to each library that needs one.
+
+ifeq ($(subdir),rt)
+librt-sysdep_routines += libc-do-syscall
+librt-shared-only-routines += libc-do-syscall
+endif
+
+ifeq ($(subdir),nptl)
+libpthread-sysdep_routines += libc-do-syscall
+libpthread-shared-only-routines += libc-do-syscall
+endif
+
+ifeq ($(subdir),resolv)
+libanl-sysdep_routines += libc-do-syscall
+libanl-shared-only-routines += libc-do-syscall
+endif
+
+ifeq ($(subdir),csu)
+sysdep_routines += libc-do-syscall
+endif
+
+ifeq ($(subdir),nscd)
+nscd-modules += libc-do-syscall
+endif
+
+ifeq ($(subdir),posix)
+LDFLAGS-tst-rfc3484 += $(common-objpfx)csu/libc-do-syscall.o
+LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o
+LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o
+endif
--- sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
+++ sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
@@ -30,6 +30,7 @@
#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 @@
#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 @@
bhi .Lok2; \
.Lfail: \
CALL_FAIL \
+ cfi_restore_state; \
.Lok2: \
mov r0, r5; \
+ cfi_restore_state; \
.Lok:
#include <__longjmp.S>
--- sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S
+++ sysdeps/unix/sysv/linux/arm/eabi/internal_recvmmsg.S
+/* Tag_ABI_align8_preserved: This code preserves 8-byte
+ alignment in any callee. */
+ .eabi_attribute 25, 1
+/* Tag_ABI_align8_needed: This code may require 8-byte alignment from
+ the caller. */
+ .eabi_attribute 24, 1
--- sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
+++ sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
+/* 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 <sysdep.h>
+
+/* Out-of-line syscall stub. We expect the system call number in ip
+ and return the raw result in r0. No registers are clobbered.
+ We could avoid using the stack for this, but the goal is accurate
+ unwind information - and while there is a reserved prefix in the
+ ARM unwind tables for register to register moves, the actual opcodes
+ are not defined. */
+
+ .thumb
+ .syntax unified
+ .hidden __libc_do_syscall
+
+ENTRY (__libc_do_syscall)
+ .fnstart
+ push {r7, lr}
+ .save {r7, lr}
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (r7, 0)
+ cfi_rel_offset (lr, 4)
+ mov r7, ip
+ swi 0x0
+ pop {r7, pc}
+ .fnend
+END (__libc_do_syscall)
--- sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
+++ 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 @@
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)
--- sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h
+++ sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h
-/* Copyright (C) 2008 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_next <aio_misc.h>
-
-#ifdef __thumb2__
-
-#include <errno.h>
-
-/* The Thumb-2 definition of INTERNAL_SYSCALL_RAW has to hide the use
- of r7 from the compiler because it cannot handle asm clobbering the
- hard frame pointer. In aio_suspend, GCC does not eliminate the
- hard frame pointer because the function uses variable-length
- arrays, so it generates unwind information using r7 as virtual
- stack pointer. During system calls, when r7 has been saved on the
- stack, this means the unwind information is invalid. Without extra
- unwind directives, which would need to cause unwind information for
- the asm to be generated separately from that for the parts of the
- function before and after the asm (with three index table entries),
- it is not possible to represent any temporary change to the virtual
- stack pointer. Instead, we move the problematic system calls out
- of line into a function that does not require a frame pointer. */
-
-static __attribute_noinline__ void
-aio_misc_wait (int *resultp,
- volatile int *futexp,
- const struct timespec *timeout,
- int cancel)
-{
- AIO_MISC_WAIT (*resultp, *futexp, timeout, cancel);
-}
-
-#undef AIO_MISC_WAIT
-#define AIO_MISC_WAIT(result, futex, timeout, cancel) \
- aio_misc_wait (&result, &futex, timeout, cancel)
-
-#endif
--- sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
+++ 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 @@
# 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
--- sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ 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 at redhat.com>.
@@ -89,7 +89,15 @@
" .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 @@
" 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"
--- sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+++ 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 at redhat.com>.
@@ -52,7 +52,15 @@
" .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 @@
" 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"
--- sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+++ 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 */
--- sysdeps/unix/sysv/linux/arm/eabi/syscall.S
+++ 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 @@
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)
--- sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
+++ 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.
@@ -44,29 +44,34 @@
argument; otherwise the (optional) compatibility code for APCS binaries
may be invoked. */
-#ifdef __thumb__
-/* Hide the use of r7 from the compiler, this would be a lot
- easier but for the fact that the syscalls can exceed 255.
- For the moment the LOAD_ARGS_7 is sacrificed.
+#if defined(__thumb__)
+/* We can not expose the use of r7 to the compiler. GCC (as
+ of 4.5) uses r7 as the hard frame pointer for Thumb - although
+ for Thumb-2 it isn't obviously a better choice than r11.
+ And GCC does not support asms that conflict with the frame
+ pointer.
+
+ This would be easier if syscall numbers never exceeded 255,
+ but they do. 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). */
+ unwinding (i.e. thread cancellation) for this frame. We can't
+ locally save and restore r7, because we do not know if this
+ function uses r7 or if it is our caller's r7; if it is our caller's,
+ then unwinding will fail higher up the stack. So we move the
+ syscall out of line and provide its own unwind information. */
#undef LOAD_ARGS_7
#undef INTERNAL_SYSCALL_RAW
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
({ \
- int _sys_buf[2]; \
register int _a1 asm ("a1"); \
- register int *_r6 asm ("r6") = _sys_buf; \
- *_r6 = name; \
+ int _nametmp = name; \
LOAD_ARGS_##nr (args) \
- asm volatile ("str r7, [r6, #4]\n\t" \
- "ldr r7, [r6]\n\t" \
- "swi 0 @ syscall " #name "\n\t" \
- "ldr r7, [r6, #4]" \
- : "=r" (_a1) \
- : "r" (_r6) ASM_ARGS_##nr \
- : "memory"); \
- _a1; })
+ register int _name asm ("ip") = _nametmp; \
+ asm volatile ("bl __libc_do_syscall" \
+ : "=r" (_a1) \
+ : "r" (_name) ASM_ARGS_##nr \
+ : "memory", "lr"); \
+ _a1; })
#else /* ARM */
#undef INTERNAL_SYSCALL_RAW
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
@@ -100,11 +105,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 */
--- sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -59,6 +59,8 @@
#include_next <kernel-features.h>
-/* These syscalls are not implemented yet for ARM. */
-#undef __ASSUME_PSELECT
-#undef __ASSUME_PPOLL
+/* Support for pselect6, ppoll and epoll_pwait was added in 2.6.32. */
+#if __LINUX_KERNEL_VERSION < 0x020620
+# undef __ASSUME_PSELECT
+# undef __ASSUME_PPOLL
+#endif
--- sysdeps/unix/sysv/linux/arm/ldsodefs.h
+++ sysdeps/unix/sysv/linux/arm/ldsodefs.h
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ 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. */
+
+#ifndef _ARM_LINUX_LDSODEFS_H
+#define _ARM_LINUX_LDSODEFS_H 1
+
+#include_next <ldsodefs.h>
+
+#undef VALID_ELF_HEADER
+#undef VALID_ELF_OSABI
+
+#ifdef __ARM_EABI__
+#define EXTRA_OSABI ELFOSABI_ARM_AEABI
+#else
+#define EXTRA_OSABI ELFOSABI_ARM
+#endif
+
+#define VALID_ELF_HEADER(hdr,exp,size) \
+ (memcmp (hdr, exp, size) == 0 \
+ || memcmp (hdr, expected2, size) == 0 \
+ || memcmp (hdr, expected3, size) == 0)
+#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
+ || osabi == EXTRA_OSABI \
+ || osabi == ELFOSABI_LINUX)
+#define MORE_ELF_HEADER_DATA \
+ static const unsigned char expected2[EI_PAD] = \
+ { \
+ [EI_MAG0] = ELFMAG0, \
+ [EI_MAG1] = ELFMAG1, \
+ [EI_MAG2] = ELFMAG2, \
+ [EI_MAG3] = ELFMAG3, \
+ [EI_CLASS] = ELFW(CLASS), \
+ [EI_DATA] = byteorder, \
+ [EI_VERSION] = EV_CURRENT, \
+ [EI_OSABI] = ELFOSABI_LINUX \
+ }; \
+ static const unsigned char expected3[EI_PAD] = \
+ { \
+ [EI_MAG0] = ELFMAG0, \
+ [EI_MAG1] = ELFMAG1, \
+ [EI_MAG2] = ELFMAG2, \
+ [EI_MAG3] = ELFMAG3, \
+ [EI_CLASS] = ELFW(CLASS), \
+ [EI_DATA] = byteorder, \
+ [EI_VERSION] = EV_CURRENT, \
+ [EI_OSABI] = EXTRA_OSABI \
+ }
+
+#endif
--- sysdeps/unix/sysv/linux/arm/mmap.S
+++ 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 @@
/* 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 @@
/* 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 @@
/* store args on the stack */
stmdb sp!, {a1-a4}
+ cfi_adjust_cfa_offset (16)
/* do the syscall */
mov a1, sp
@@ -81,6 +92,7 @@
/* pop args off the stack. */
add sp, sp, #16
+ cfi_adjust_cfa_offset (-16)
cmn r0, $4096
RETINSTR(cc, lr)
--- sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
+++ sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
@@ -37,7 +37,12 @@
void __arm_link_error (void);
-#ifdef __thumb2__
+/* Use the atomic builtins provided by GCC in case the backend provides
+ a pattern to do this efficiently. */
+
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define atomic_full_barrier() __sync_synchronize ()
+#elif defined __thumb2__
#define atomic_full_barrier() \
__asm__ __volatile__ \
("movw\tip, #0x0fa0\n\t" \
@@ -64,11 +69,15 @@
#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
({ __arm_link_error (); oldval; })
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap ((mem), (oldval), (newval))
+
/* It doesn't matter what register is used for a_oldval2, but we must
specify one to work around GCC PR rtl-optimization/21223. Otherwise
it may cause a_oldval or a_tmp to be moved to a different register. */
-#ifdef __thumb2__
+#elif defined __thumb2__
/* Thumb-2 has ldrex/strex. However it does not have barrier instructions,
so we still need to use the kernel helper. */
#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
--- sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
+++ 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. */ \
--- sysdeps/unix/sysv/linux/arm/nptl/vfork.S
+++ 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. */ \
--- sysdeps/unix/sysv/linux/arm/syscalls.list
+++ sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -3,3 +3,7 @@
syscall - syscall 7 syscall
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit at GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit at GLIBC_2.0
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
--- sysdeps/unix/sysv/linux/arm/sysdep.h
+++ sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -55,6 +55,11 @@
#define HWCAP_ARM_EDSP 128
#define HWCAP_ARM_JAVA 256
#define HWCAP_ARM_IWMMXT 512
+#define HWCAP_ARM_CRUNCH 1024
+#define HWCAP_ARM_THUMBEE 2048
+#define HWCAP_ARM_NEON 4096
+#define HWCAP_ARM_VFPv3 8192
+#define HWCAP_ARM_VFPv3D16 16384
#ifdef __ASSEMBLER__
@@ -84,7 +89,7 @@
#undef PSEUDO_END
#define PSEUDO_END(name) \
- SYSCALL_ERROR_HANDLER \
+ SYSCALL_ERROR_HANDLER; \
END (name)
#undef PSEUDO_NOERRNO
@@ -129,17 +134,26 @@
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 +193,7 @@
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
- DOARGS_##args \
+ DOARGS_##args; \
swi SYS_ify (syscall_name); \
UNDOARGS_##args
@@ -188,18 +202,47 @@
#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__ */
--- sysdeps/unix/sysv/linux/hppa/Versions
+++ sysdeps/unix/sysv/linux/hppa/Versions
@@ -23,6 +23,10 @@
GLIBC_2.11 {
fallocate64;
}
+ GLIBC_2.12 {
+ #errlist-compat 257
+ _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+ }
}
librt {
GLIBC_2.3 {
--- sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -98,7 +98,7 @@
int ret; \
ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval); \
/* Return 1 if it was already acquired. */ \
- (ret != oldval); \
+ (ret != (int)oldval); \
})
#else
# error __ASSUME_LWS_CAS is required to build glibc.
--- sysdeps/unix/sysv/linux/hppa/bits/errno.h
+++ sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -30,6 +30,18 @@
# define ECANCELED ECANCELLED
# endif
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 254
+# endif
+
+# ifndef ENOTRECOVERABLE
+# define ENOTRECOVERABLE 255
+# endif
+
+# ifndef ERFKILL
+# define ERFKILL 256
+# endif
+
# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable. */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
--- sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -1,6 +1,6 @@
/* O_*, F_*, FD_* bit values for Linux/HPPA.
Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2004
- Free Software Foundation, Inc.
+ 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,7 +18,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _FCNTL_H
+#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
@@ -27,23 +27,24 @@
# include <bits/uio.h>
#endif
+
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
-#define O_RDONLY 00000000
-#define O_WRONLY 00000001
-#define O_RDWR 00000002
-#define O_ACCMODE 00000003
-#define O_APPEND 00000010
-#define O_BLKSEEK 00000100 /* HPUX only */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
#define O_CREAT 00000400 /* not fcntl */
-#define O_TRUNC 00001000 /* not fcntl */
#define O_EXCL 00002000 /* not fcntl */
-#define O_ASYNC 00020000
-#define O_SYNC 00100000
+#define O_NOCTTY 00400000 /* not fcntl */
+#define O_TRUNC 00001000 /* not fcntl */
+#define O_APPEND 00000010
#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */
#define O_NDELAY O_NONBLOCK
-#define O_NOCTTY 00400000 /* not fcntl */
-
+#define O_SYNC 00100000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+#define O_BLKSEEK 00000100 /* HPUX only */
#ifdef __USE_GNU
# define O_DIRECT 000040000 /* Direct disk access. */
@@ -53,15 +54,18 @@
# define O_CLOEXEC 010000000 /* Set close_on_exec. */
#endif
-#ifdef __USE_LARGEFILE64
-# define O_LARGEFILE 00004000
-#endif
-
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
# define O_DSYNC 01000000 /* HPUX only */
# define O_RSYNC 02000000 /* HPUX only */
#endif
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 00004000
+#endif
+
/* Values for the second argument to `fcntl'. */
#define F_DUPFD 0 /* Duplicate file descriptor. */
#define F_GETFD 1 /* Get file descriptor flags. */
@@ -70,11 +74,11 @@
#define F_SETFL 4 /* Set file status flags. */
#ifndef __USE_FILE_OFFSET64
# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
#else
-# define F_GETLK F_GETLK64 /* Get record locking info. */
-# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
#endif
#define F_GETLK64 8 /* Get record locking info. */
@@ -89,19 +93,19 @@
#ifdef __USE_GNU
# define F_SETSIG 13 /* Set number of signal to be sent. */
# define F_GETSIG 14 /* Get number of signal to be sent. */
-# define F_GETOWN_EX 15
-# define F_SETOWN_EX 16
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
-# define F_SETLEASE 1024 /* Set a lease. */
-# define F_GETLEASE 1025 /* Enquire what lease is active. */
-# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
-/* for F_[GET|SET]FL */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -109,12 +113,12 @@
#define F_WRLCK 2 /* Write lock. */
#define F_UNLCK 3 /* Remove lock. */
-/* for old implementation of bsd flock () */
+/* For old implementation of bsd flock(). */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
#ifdef __USE_BSD
-/* operations for bsd flock(), also used by the kernel implementation */
+/* Operations for bsd flock(), also used by the kernel implementation. */
# define LOCK_SH 1 /* shared lock */
# define LOCK_EX 2 /* exclusive lock */
# define LOCK_NB 4 /* or'd with one of the above to prevent
@@ -123,19 +127,26 @@
#endif
#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
/* Types of directory notifications that may be requested with F_NOTIFY. */
-# define DN_ACCESS 0x00000001 /* File accessed. */
-# define DN_MODIFY 0x00000002 /* File modified. */
-# define DN_CREATE 0x00000004 /* File created. */
-# define DN_DELETE 0x00000008 /* File removed. */
-# define DN_RENAME 0x00000010 /* File renamed. */
-# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
-# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
#endif
struct flock
{
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
#ifndef __USE_FILE_OFFSET64
__off_t l_start; /* Offset where the lock begins. */
@@ -150,7 +161,7 @@
#ifdef __USE_LARGEFILE64
struct flock64
{
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
__off64_t l_start; /* Offset where the lock begins. */
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
@@ -158,6 +169,24 @@
};
#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. */
#ifdef __USE_BSD
@@ -172,13 +201,15 @@
#ifdef __USE_XOPEN2K
# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
#ifdef __USE_GNU
+/* Flags for SYNC_FILE_RANGE. */
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
in the range before performing the
write. */
@@ -206,16 +237,18 @@
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
+
/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
+
/* Splice address range into a pipe. */
-extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern ssize_t splice (int __fdin, __off64_t *offin, int __fdout,
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
__off64_t *__offout, size_t __len,
unsigned int __flags);
@@ -241,5 +274,5 @@
# endif
#endif
-
+
__END_DECLS
--- sysdeps/unix/sysv/linux/hppa/bits/mman.h
+++ sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -86,6 +86,8 @@
# define MADV_REMOVE 9 /* Remove these pages and resources. */
# define MADV_DONTFORK 10 /* Do not inherit across fork. */
# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 65 /* KSM may merge identical pages */
+# define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */
#endif
/* The range 12-64 is reserved for page size specification. */
--- sysdeps/unix/sysv/linux/hppa/bits/socket.h
+++ sysdeps/unix/sysv/linux/hppa/bits/socket.h
@@ -1,6 +1,6 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ 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
@@ -62,7 +62,7 @@
/* Flags to be ORed into the type parameter of socket and socketpair and
used for the flags parameter of paccept. */
- SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
+ SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
new descriptor(s). */
#define SOCK_CLOEXEC SOCK_CLOEXEC
#undef SOCK_NONBLOCK
@@ -233,6 +233,8 @@
#define MSG_NOSIGNAL MSG_NOSIGNAL
MSG_MORE = 0x8000, /* Sender will send more. */
#define MSG_MORE MSG_MORE
+ MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
+#define MSG_WAITFORONE MSG_WAITFORONE
MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
descriptor received through
--- sysdeps/unix/sysv/linux/hppa/getcontext.S
+++ sysdeps/unix/sysv/linux/hppa/getcontext.S
@@ -23,17 +23,21 @@
#include "ucontext_i.h"
- /* Trampoline function. */
+ /* Trampoline function. Non-standard calling ABI. */
/* Can not use ENTRY(__getcontext_ret) here. */
.type __getcontext_ret, @function
.hidden __getcontext_ret
__getcontext_ret:
.proc
.callinfo FRAME=0,NO_CALLS
+ /* r26-r23 contain original r3-r6, but because setcontext
+ does not reload r3-r6 (it's using them as temporaries)
+ we must save them elsewhere and swap them back in. */
copy %r23, %r3
copy %r24, %r4
copy %r25, %r5
copy %r26, %r6
+ /* r20 contains original return pointer. */
bv 0(%r20)
copy %r0, %ret0
.procend
@@ -72,13 +76,12 @@
stw %r27, oR27(%r26)
stw %r28, oR28(%r26)
stw %r29, oR29(%r26)
- ldo -64(%sp), %r1 /* Calculate %sp in %r1. */
- stw %r1, oR30(%r26) /* Save new %sp. */
+ stw %sp, oR30(%r26)
stw %r31, oR31(%r26)
stw %r0, oUC_FLAGS(%r26)
/* stw %r0, oUC_LINK(%r26) - Do not overwrite. */
- stw %r1, oSS_SP(%r26)
+ stw %sp, oSS_SP(%r26)
stw %r0, oSS_FLAGS(%r26)
stw %r0, oSS_SIZE(%r26)
@@ -127,9 +130,9 @@
fstds %fr31, 0(%r1)
/* Prologue */
- stwm %r4, 64(%r30)
+ stwm %r4, 64(%sp)
#ifdef PIC
- stw %r19, -32(%r30)
+ stw %r19, -32(%sp)
#endif
/* Set up the trampoline registers.
@@ -152,12 +155,12 @@
ldi SIG_BLOCK, %r26
/* Epilogue */
- ldw -84(%r30), %r2
+ ldw -84(%sp), %r2
#ifdef PIC
- ldw -96(%r30), %r19
+ ldw -96(%sp), %r19
#endif
bv %r0(%r2)
- ldwm -64(%r30), %r4
+ ldwm -64(%sp), %r4
END(__getcontext)
weak_alias (__getcontext, getcontext)
--- sysdeps/unix/sysv/linux/hppa/makecontext.c
+++ sysdeps/unix/sysv/linux/hppa/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Helge Deller <deller at gmx.de>, 2008.
@@ -25,55 +25,77 @@
#include <sysdep.h>
#include <ucontext.h>
-/* XXX: This implementation only handles integer arguments. */
+/* POSIX only supports integer arguments. */
+
+/* Stack must be 64-byte aligned at all times. */
+#define STACK_ALIGN 64
+/* Size of frame marker in unsigned long words. */
+#define FRAME_SIZE_UL 8
+/* Size of frame marker in bytes. */
+#define FRAME_SIZE_BYTES (8 * sizeof(unsigned long))
+/* Size of X arguments in bytes. */
+#define ARGS(x) (x * sizeof(unsigned long))
void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
- unsigned int *sp;
+ unsigned long *sp, *osp;
va_list ap;
int i;
- if (argc > 8)
+ /* Create a 64-byte aligned frame to store args. Use ss_sp if
+ it is available, otherwise be robust and use the currently
+ saved stack pointer. */
+ if (ucp->uc_stack.ss_sp && ucp->uc_stack.ss_size)
+ osp = (unsigned long *)ucp->uc_stack.ss_sp;
+ else
+ osp = (unsigned long *)ucp->uc_mcontext.sc_gr[30];
+
+ sp = (unsigned long *)((((unsigned long) osp)
+ + FRAME_SIZE_BYTES + ARGS(argc) + STACK_ALIGN)
+ & ~(STACK_ALIGN - 1));
+
+ /* Use new frame. */
+ ucp->uc_mcontext.sc_gr[30] = ((unsigned long) sp);
+
+ /* Finish frame setup. */
+ if (ucp->uc_link)
{
- fprintf (stderr, _("\
-makecontext: does not know how to handle more than 8 arguments\n"));
- exit (-1);
+ /* Returning to the next context and next frame. */
+ sp[-4/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[30];
+ sp[-20/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[2];
+ }
+ else
+ {
+ /* This is the main context. No frame marker, and no return address. */
+ sp[-4/sizeof(unsigned long)] = 0x0;
+ sp[-20/sizeof(unsigned long)] = 0x0;
}
-
- /* Get stack pointer. */
- sp = (unsigned int *) ucp->uc_stack.ss_sp;
/* Store address to jump to. */
ucp->uc_mcontext.sc_gr[2] = (unsigned long) func;
+ /* Process arguments. */
va_start (ap, argc);
- /* Handle arguments. */
for (i = 0; i < argc; ++i)
- switch (i)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int);
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- if (sizeof(unsigned long) == 4) {
- /* 32bit: put arg7-arg4 on stack. */
- sp[7-i] = va_arg (ap, int);
- } else {
- /* 64bit: r19-r22 are arg7-arg4. */
- ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);
+ {
+ if (i < 4)
+ {
+ ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int);
+ continue;
}
- break;
- }
- va_end (ap);
-
-}
+ if ((i < 8) && (sizeof(unsigned long) == 8))
+ {
+ /* 64bit: r19-r22 are arg7-arg4. */
+ ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);
+ continue;
+ }
+ /* All other arguments go on the stack. */
+ sp[-1 * (FRAME_SIZE_UL + 1 + i)] = va_arg (ap, int);
+ }
+ va_end (ap);
+}
weak_alias(__makecontext, makecontext)
+
--- sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
+++ sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@
{
struct __pthread_mutex_s
{
- int __lock;
+ int __lock __attribute__ ((aligned(16)));
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
@@ -113,7 +113,7 @@
start of the 4-word lock structure, the next four words
are set all to 1 by the Linuxthreads
PTHREAD_COND_INITIALIZER. */
- int __lock;
+ int __lock __attribute__ ((aligned(16)));
/* Tracks the initialization of this structure:
0 initialized with NPTL PTHREAD_COND_INITIALIZER.
1 initialized with Linuxthreads PTHREAD_COND_INITIALIZER.
@@ -161,7 +161,7 @@
start of the 4-word 16-byte aligned lock structure. The
next four words are all set to 1 by the Linuxthreads
PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL. */
- int __compat_padding[4];
+ int __compat_padding[4] __attribute__ ((aligned(16)));
int __lock;
unsigned int __nr_readers;
unsigned int __readers_wakeup;
--- sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S
+++ sysdeps/unix/sysv/linux/hppa/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
@@ -50,10 +50,9 @@
/* r26, r25, r24, r23 are free since vfork has no arguments */
ENTRY(__vfork)
- /* Prologue */
- stwm %r3, 64(%sp)
- stw %sp, -4(%sp)
- stw %r19, -32(%sp)
+ /* We must not create a frame. When the child unwinds to call
+ exec it will clobber the same frame that the parent
+ needs to unwind. */
/* Save the PIC register. */
#ifdef PIC
@@ -75,12 +74,20 @@
comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */
b,n .Lerror
- /* Return, no need to restore the PIC register. */
- ldw -84(%sp), %rp
- bv %r0(%rp)
- ldwm -64(%sp), %r3
+ /* Return, and DO NOT restore rp. The child may have called
+ functions that updated the frame's rp. This works because
+ the kernel ensures rp is preserved across the vfork
+ syscall. */
+ bv,n %r0(%rp)
.Lerror:
+ /* Now we need a stack to call a function. We are assured
+ that there is no child now, so it's safe to create
+ a frame. */
+ stw %rp, -20(%sp)
+ stwm %r3, 64(%sp)
+ stw %sp, -4(%sp)
+
sub %r0,%ret0,%r3
SYSCALL_ERROR_HANDLER
/* Restore the PIC register (in delay slot) on error */
--- sysdeps/unix/sysv/linux/hppa/nptl/pthread.h
+++ sysdeps/unix/sysv/linux/hppa/nptl/pthread.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,8 +25,6 @@
#include <sched.h>
#include <time.h>
-#define __need_sigset_t
-#include <signal.h>
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
#include <bits/wordsize.h>
@@ -49,7 +47,7 @@
PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_ADAPTIVE_NP
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
,
PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
@@ -427,6 +425,18 @@
__THROW;
+#ifdef __USE_GNU
+/* Get thread name visible in the kernel and its interfaces. */
+extern int pthread_getname_np (pthread_t __target_thread, char *__buf,
+ size_t __buflen)
+ __THROW __nonnull ((2));
+
+/* Set thread name visible in the kernel and its interfaces. */
+extern int pthread_setname_np (pthread_t __target_thread, __const char *__name)
+ __THROW __nonnull ((2));
+#endif
+
+
#ifdef __USE_UNIX98
/* Determine level of concurrency. */
extern int pthread_getconcurrency (void) __THROW;
@@ -739,8 +749,8 @@
#ifdef __USE_XOPEN2K
/* Wait until lock becomes available, or specified time passes. */
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
- __const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
+ __const struct timespec *__restrict
+ __abstime) __THROW __nonnull ((1, 2));
#endif
/* Unlock a mutex. */
@@ -748,7 +758,6 @@
__THROW __nonnull ((1));
-#ifdef __USE_UNIX98
/* Get the priority ceiling of MUTEX. */
extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
__restrict __mutex,
@@ -761,12 +770,11 @@
int __prioceiling,
int *__restrict __old_ceiling)
__THROW __nonnull ((1, 3));
-#endif
#ifdef __USE_XOPEN2K8
/* Declare the state protected by MUTEX as consistent. */
-extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
__THROW __nonnull ((1));
# ifdef __USE_GNU
extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
@@ -797,7 +805,7 @@
int __pshared)
__THROW __nonnull ((1));
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
/* Return in *KIND the mutex kind attribute in *ATTR. */
extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
__attr, int *__restrict __kind)
@@ -808,6 +816,7 @@
PTHREAD_MUTEX_DEFAULT). */
extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
__THROW __nonnull ((1));
+#endif
/* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */
extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
@@ -831,7 +840,6 @@
extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
int __prioceiling)
__THROW __nonnull ((1));
-#endif
#ifdef __USE_XOPEN2K
/* Get the robustness flag of the mutex attribute ATTR. */
@@ -990,13 +998,13 @@
/* Get the process-shared flag of the condition variable attribute ATTR. */
extern int pthread_condattr_getpshared (__const pthread_condattr_t *
- __restrict __attr,
- int *__restrict __pshared)
+ __restrict __attr,
+ int *__restrict __pshared)
__THROW __nonnull ((1, 2));
/* Set the process-shared flag of the condition variable attribute ATTR. */
extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
- int __pshared) __THROW __nonnull ((1));
+ int __pshared) __THROW __nonnull ((1));
#ifdef __USE_XOPEN2K
/* Get the clock selected for the conditon variable attribute ATTR. */
@@ -1071,7 +1079,7 @@
/* Set the process-shared flag of the barrier attribute ATTR. */
extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
- int __pshared)
+ int __pshared)
__THROW __nonnull ((1));
#endif
@@ -1136,11 +1144,11 @@
#endif /* pthread.h */
-#ifndef _PTHREAD_H_HPPA_
+#ifndef _PTHREAD_H_HPPA_
#define _PTHREAD_H_HPPA_ 1
/* The pthread_cond_t initializer is compatible only with NPTL. We do not
- want to be forwards compatible, we eventually want to drop the code
+ want to be forwards compatible, we eventually want to drop the code
that has to clear the old LT initializer. */
#undef PTHREAD_COND_INITIALIZER
#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, (void *) 0, 0, 0, 0, 0, 0 } }
@@ -1173,6 +1181,5 @@
{ { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
0, 0, 0 } }
#endif /* Unix98 or XOpen2K */
-
-#endif
+#endif
--- sysdeps/unix/sysv/linux/hppa/setcontext.S
+++ sysdeps/unix/sysv/linux/hppa/setcontext.S
@@ -25,9 +25,9 @@
ENTRY(__setcontext)
/* Prologue */
- stwm %r3, 64(%r30)
+ stwm %r3, 64(%sp)
#ifdef PIC
- stw %r19, -32(%r30)
+ stw %r19, -32(%sp)
#endif
/* Save ucp. */
@@ -78,7 +78,7 @@
ldw oR27(%r3), %r27
ldw oR28(%r3), %r28
ldw oR29(%r3), %r29
- ldw oR30(%r3), %r30
+ ldw oR30(%r3), %sp
/* ldw oR31(%r3), %r31 - dyncall scratch register */
/* Restore floating-point registers. */
@@ -116,9 +116,13 @@
fldds,mb -8(%r22), %fr1
fldds,mb -8(%r22), %fr0
- /* Calculate new stack pointer. */
- ldw oSS_SP(%r3), %sp
- ldo 64(%sp), %sp
+ /* Do not load oSS_SP into %sp. The value of oSS_SP indicates
+ the start of the user allocated stack, but not the sp that
+ should be used by the new context. In fact makecontext
+ will create a frame, and adjust sp as required. We do not
+ support calling getcontext and modifying ss_sp without
+ a call to makecontext to synchronize ss_sp into the machine
+ context. */
/* Call external function. */
copy %r2, %r22
--- sysdeps/unix/sysv/linux/m68k/Makefile
+++ sysdeps/unix/sysv/linux/m68k/Makefile
@@ -2,12 +2,18 @@
m68k-syntax-flag = -DMOTOROLA_SYNTAX
+ifeq ($(subdir),csu)
+sysdep_routines += m68k-helpers
+endif
+
ifeq ($(subdir),misc)
sysdep_routines += mremap
sysdep_headers += sys/reg.h
endif
ifeq ($(subdir),elf)
+sysdep_routines += dl-vdso libc-m68k-vdso
+sysdep-rtld-routines += m68k-vdso
sysdep-others += lddlibc4
install-bin += lddlibc4
endif
--- sysdeps/unix/sysv/linux/m68k/Versions
+++ sysdeps/unix/sysv/linux/m68k/Versions
@@ -32,4 +32,18 @@
GLIBC_2.11 {
fallocate64;
}
+ GLIBC_2.12 {
+ __m68k_read_tp;
+ }
+ GLIBC_PRIVATE {
+ __vdso_atomic_cmpxchg_32; __vdso_atomic_barrier;
+ }
+}
+
+ld {
+ GLIBC_PRIVATE {
+ __rtld___vdso_read_tp;
+ __rtld___vdso_atomic_cmpxchg_32;
+ __rtld___vdso_atomic_barrier;
+ }
}
--- sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2000, 2004, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2004, 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
@@ -40,23 +40,25 @@
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_NDELAY O_NONBLOCK
-#define O_SYNC 010000
+#define O_SYNC 04010000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
# define O_DIRECTORY 040000 /* Must be a directory. */
# define O_NOFOLLOW 0100000 /* Do not follow links. */
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+#endif
+#ifdef __USE_GNU
# define O_DIRECT 0200000 /* Direct disk access. */
# define O_NOATIME 01000000 /* Do not set atime. */
-# define O_CLOEXEC 02000000 /* Set close_on_exec. */
#endif
/* For now Linux has synchronisity options for data and read operations.
We define the symbols here but let them do the same as O_SYNC since
this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_DSYNC 010000 /* Synchronize data. */
# define O_RSYNC O_SYNC /* Synchronize read operations. */
#endif
@@ -83,7 +85,7 @@
#define F_SETLK64 13 /* Set record locking info (non-blocking). */
#define F_SETLKW64 14 /* Set record locking info (blocking). */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
#endif
@@ -99,6 +101,10 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+#endif
+#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
@@ -171,9 +177,10 @@
/* Owner types. */
enum __pid_type
{
- F_OWNER_TID = 0, /* Kernel thread. */
- F_OWNER_PID, /* Process. */
- F_OWNER_GID /* Process group. */
+ 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. */
@@ -236,7 +243,7 @@
/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
--- sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
+++ sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
+/* Resolve function pointers to VDSO functions.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 _M68K_VDSO_H
+#define _M68K_VDSO_H
+
+#ifdef SHARED
+
+# ifdef IS_IN_rtld
+# define M68K_VDSO_SYMBOL(name) __rtld_##name
+# define STR_M68K_VDSO_SYMBOL(name) "__rtld_" #name
+# else
+# define M68K_VDSO_SYMBOL(name) name
+# define STR_M68K_VDSO_SYMBOL(name) #name
+# endif
+
+# ifndef __ASSEMBLER__
+
+/* We define __rtld_* copies for rtld.
+ We need them visible in libc to initialize. */
+# if defined IS_IN_rtld || !defined NOT_IN_libc
+extern void *__rtld___vdso_read_tp;
+extern void *__rtld___vdso_atomic_cmpxchg_32;
+extern void *__rtld___vdso_atomic_barrier;
+
+/* These stubs are meant to be invoked only from the assembly. */
+extern void __vdso_read_tp_stub (void);
+extern void __vdso_atomic_cmpxchg_32_stub (void);
+extern void __vdso_atomic_barrier_stub (void);
+# endif /* IS_IN_rtld || !NOT_IN_libc */
+
+/* RTLD should only use its own copies. */
+# ifndef IS_IN_rtld
+extern void *__vdso_read_tp;
+extern void *__vdso_atomic_cmpxchg_32;
+extern void *__vdso_atomic_barrier;
+# endif /* !IS_IN_rtld */
+
+# endif /* !__ASSEMBLER__ */
+
+#endif /* SHARED */
+
+#endif /* _M68K_VDSO_H */
--- sysdeps/unix/sysv/linux/m68k/bits/mman.h
+++ sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/m68k version.
- Copyright (C) 1997, 2000, 2003, 2005, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003, 2005, 2008, 2009, 2011
+ 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
@@ -83,14 +84,19 @@
/* Advice to `madvise'. */
#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
+# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
--- sysdeps/unix/sysv/linux/m68k/bits/poll.h
+++ sysdeps/unix/sysv/linux/m68k/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2008, 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
@@ -27,7 +27,7 @@
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
--- sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h
+++ sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h
-/* Copyright (C) 2006 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. */
-
-#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
-# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
-#endif
-
-#ifndef _BITS_SIGCONTEXT_H
-#define _BITS_SIGCONTEXT_H 1
-
-struct sigcontext {
- unsigned long sc_mask;
- unsigned long sc_usp;
- unsigned long sc_d0;
- unsigned long sc_d1;
-#ifdef __mcoldfire__
- unsigned long sc_d2;
- unsigned long sc_d3;
- unsigned long sc_d4;
- unsigned long sc_d5;
- unsigned long sc_d6;
- unsigned long sc_d7;
-#endif
- unsigned long sc_a0;
- unsigned long sc_a1;
-#ifdef __mcoldfire__
- unsigned long sc_a2;
- unsigned long sc_a3;
- unsigned long sc_a4;
- unsigned long sc_a5;
- unsigned long sc_a6;
-#endif
- unsigned short sc_sr;
- unsigned long sc_pc;
- unsigned short sc_formatvec;
-#ifdef __mcoldfire__
- unsigned long sc_fpregs[8][2];
- unsigned long sc_fpcntl[3];
- unsigned char sc_fpstate[16];
-#else
- unsigned long sc_fpregs[2*3];
- unsigned long sc_fpcntl[3];
- unsigned char sc_fpstate[216];
-#endif
-};
-
-#endif
--- sysdeps/unix/sysv/linux/m68k/bits/siginfo.h
+++ sysdeps/unix/sysv/linux/m68k/bits/siginfo.h
-/* siginfo_t, sigevent and constants. m68k linux version.
- Copyright (C) 1997-2002, 2003 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. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct siginfo
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- unsigned short __pad; /* 16-bit version of si_uid. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- unsigned short __pad; /* 16-bit version of si_uid. */
- sigval_t si_sigval; /* Signal value. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- unsigned short __pad; /* 16-bit version of si_uid. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- __uid_t si_uid; /* Real user ID of sending process. */
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend, raise. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
-};
-
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- void *_attribute; /* Really pthread_attr_t. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
--- sysdeps/unix/sysv/linux/m68k/bits/stat.h
+++ sysdeps/unix/sysv/linux/m68k/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,10 +17,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
@@ -61,7 +64,7 @@
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
-#ifdef __USE_MISC
+#if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -107,7 +110,7 @@
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
+# if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -117,14 +120,14 @@
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
-#else
+# else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
-#endif
+# endif
__ino64_t st_ino; /* File serial number. */
};
#endif
@@ -167,3 +170,5 @@
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
--- sysdeps/unix/sysv/linux/m68k/clone.S
+++ sysdeps/unix/sysv/linux/m68k/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,97,98,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,98,2002,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab (schwab at issan.informatik.uni-dortmund.de)
@@ -17,14 +17,21 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-/* clone is even more special than fork as it mucks with stacks
+/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
+#ifdef RESET_PID
+#include <tls.h>
+#endif
+
+#define CLONE_VM 0x00000100
+#define CLONE_THREAD 0x00010000
-/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+ void *parent_tidptr, void *tls, void *child_tidptr) */
.text
ENTRY (__clone)
@@ -42,7 +49,17 @@
movel 16(%sp), -(%a1)
/* Do the system call */
- movel 12(%sp), %d1 /* get flags */
+ movel 12+0(%sp), %d1 /* get flags */
+ movel %d3, -(%a1) /* save %d3 and get parent_tidptr */
+ movel %d3, -(%sp)
+ movel 20+4(%sp), %d3
+ movel %d4, -(%a1) /* save %d4 and get child_tidptr */
+ movel %d4, -(%sp)
+ movel 28+8(%sp), %d4
+ movel %d5, -(%a1) /* save %d5 and get tls */
+ movel %d5, -(%sp)
+ movel 24+12(%sp), %d5
+ /* save %d2 and get stack pointer */
#ifdef __mcoldfire__
movel %d2, -(%a1)
movel %d2, -(%sp)
@@ -57,6 +74,9 @@
#else
exg %d2, %a1 /* restore %d2 */
#endif
+ movel (%sp)+, %d5 /* restore %d5, %d4 and %d3 */
+ movel (%sp)+, %d4
+ movel (%sp)+, %d3
tstl %d0
jmi SYSCALL_ERROR_LABEL
@@ -65,11 +85,35 @@
rts
thread_start:
+ cfi_startproc
+ cfi_undefined (pc) /* Mark end of stack */
subl %fp, %fp /* terminate the stack frame */
+#ifdef RESET_PID
+ /* Check and see if we need to reset the PID. */
+ movel %d1, %a1
+ andl #CLONE_THREAD, %d1
+ jne donepid
+ movel %a1, %d1
+ movel #-1, %d0
+ andl #CLONE_VM, %d1
+ jne gotpid
+ movel #SYS_ify (getpid), %d0
+ trap #0
+gotpid:
+ movel %a0, -(%sp)
+ movel %d0, -(%sp)
+ bsrl __m68k_read_tp at PLTPC
+ movel (%sp)+, %d0
+ movel %d0, PID_OFFSET(%a0)
+ movel %d0, TID_OFFSET(%a0)
+ movel (%sp)+, %a0
+donepid:
+#endif
jsr (%a0)
movel %d0, %d1
movel #SYS_ify (exit), %d0
trap #0
+ cfi_endproc
PSEUDO_END (__clone)
--- sysdeps/unix/sysv/linux/m68k/coldfire
+++ sysdeps/unix/sysv/linux/m68k/coldfire
+(directory)
--- sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S
+++ sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <bits/m68k-vdso.h>
+
+ .text
+
+ .hidden __vdso_read_tp_stub
+ENTRY (__vdso_read_tp_stub)
+ cfi_startproc
+ move.l #__NR_get_thread_area, %d0
+ trap #0
+ move.l %d0, %a0
+ rts
+ cfi_endproc
+END (__vdso_read_tp_stub)
+
+# ifdef SHARED
+/* GCC will emit calls to this routine. Linux has an
+ equivalent helper function (which clobbers fewer registers than
+ a normal function call) in a vdso; tail call to the
+ helper. */
+# ifdef IS_IN_rtld
+/* rtld gets a hidden copy of __m68k_read_tp. */
+ .hidden __m68k_read_tp
+# endif
+ENTRY (__m68k_read_tp)
+ cfi_startproc
+ move.l #_GLOBAL_OFFSET_TABLE_ at GOTPC, %a0
+ lea (-6, %pc, %a0), %a0
+ move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0
+ move.l (%a0), %a0
+ jmp (%a0)
+ cfi_endproc
+END (__m68k_read_tp)
+
+/* The following two stubs are for macros in atomic.h, they can't
+ clobber anything. */
+
+ .hidden __vdso_atomic_cmpxchg_32_stub
+ENTRY (__vdso_atomic_cmpxchg_32_stub)
+ cfi_startproc
+ move.l %d2, -(%sp)
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (%d2, 0)
+ move.l %d0, %d2
+ move.l #SYS_ify (atomic_cmpxchg_32), %d0
+ trap #0
+ move.l (%sp)+, %d2
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (%d2)
+ rts
+ cfi_endproc
+END (__vdso_atomic_cmpxchg_32_stub)
+
+ .hidden __vdso_atomic_barrier_stub
+ENTRY (__vdso_atomic_barrier_stub)
+ cfi_startproc
+ move.l %d0, -(%sp)
+ cfi_adjust_cfa_offset (4)
+ move.l #SYS_ify (atomic_barrier), %d0
+ trap #0
+ move.l (%sp)+, %d0
+ cfi_adjust_cfa_offset (-4)
+ rts
+ cfi_endproc
+END (__vdso_atomic_barrier_stub)
+# else /* !SHARED */
+/* If the vDSO is not available, use a syscall to get TP. */
+ strong_alias (__vdso_read_tp_stub, __m68k_read_tp)
+# endif /* SHARED */
--- sysdeps/unix/sysv/linux/m68k/coldfire/nptl
+++ sysdeps/unix/sysv/linux/m68k/coldfire/nptl
+(directory)
--- sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits
+++ sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits
+(directory)
--- sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h
+++ sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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_ATOMIC_H
+#define _BITS_ATOMIC_H 1
+
+#include <stdint.h>
+#include <sysdep.h>
+#include <bits/m68k-vdso.h>
+
+/* Coldfire has no atomic compare-and-exchange operation, but the
+ kernel provides userspace atomicity operations. Use them. */
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int_fast32_t atomic_fast32_t;
+typedef uint_fast32_t uatomic_fast32_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+/* The only basic operation needed is compare and exchange. */
+/* For ColdFire we'll have to trap into the kernel mode anyway,
+ so trap from the library rather then from the kernel wrapper. */
+#ifdef SHARED
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ ({ \
+ /* Use temporary variables to workaround call-clobberness of */ \
+ /* the registers. */ \
+ __typeof (mem) _mem = mem; \
+ __typeof (oldval) _oldval = oldval; \
+ __typeof (newval) _newval = newval; \
+ register __typeof (mem) _a0 asm ("a0") = _mem; \
+ register __typeof (oldval) _d0 asm ("d0") = _oldval; \
+ register __typeof (newval) _d1 asm ("d1") = _newval; \
+ void *tmp; \
+ \
+ asm ("movel #_GLOBAL_OFFSET_TABLE_ at GOTPC, %2\n\t" \
+ "lea (-6, %%pc, %2), %2\n\t" \
+ "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32) \
+ "@GOT(%2), %2\n\t" \
+ "movel (%2), %2\n\t" \
+ "jsr (%2)\n\t" \
+ : "+d" (_d0), "+m" (*_a0), "=&a" (tmp) \
+ : "a" (_a0), "d" (_d1)); \
+ _d0; \
+ })
+#else
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ ({ \
+ /* Use temporary variables to workaround call-clobberness of */ \
+ /* the registers. */ \
+ __typeof (mem) _mem = mem; \
+ __typeof (oldval) _oldval = oldval; \
+ __typeof (newval) _newval = newval; \
+ register __typeof (oldval) _d0 asm ("d0") \
+ = SYS_ify (atomic_cmpxchg_32); \
+ register __typeof (mem) _a0 asm ("a0") = _mem; \
+ register __typeof (oldval) _d2 asm ("d2") = _oldval; \
+ register __typeof (newval) _d1 asm ("d1") = _newval; \
+ \
+ asm ("trap #0" \
+ : "+d" (_d0), "+m" (*_a0) \
+ : "a" (_a0), "d" (_d2), "d" (_d1)); \
+ _d0; \
+ })
+#endif
+
+#ifdef SHARED
+# define atomic_full_barrier() \
+ ({ \
+ void *tmp; \
+ \
+ asm ("movel #_GLOBAL_OFFSET_TABLE_ at GOTPC, %0\n\t" \
+ "lea (-6, %pc, %0), %0\n\t" \
+ "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_barrier) \
+ "@GOT(%0), %0\n\t" \
+ "movel (%0), %0\n\t" \
+ "jsr (%0)\n\t" \
+ : "=&a" (tmp)); \
+ })
+#else
+# define atomic_full_barrier() \
+ (INTERNAL_SYSCALL (atomic_barrier, , 0), (void) 0)
+#endif
+
+#endif
--- sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
+++ sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
+/* 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. */
+
+#ifndef _LINUX_M68K_COLDFIRE_SYSDEP_H
+#define _LINUX_M68K_COLDFIRE_SYSDEP_H 1
+
+#include <sysdeps/unix/sysdep.h>
+#include <sysdeps/m68k/coldfire/sysdep.h>
+#include <sysdeps/unix/sysv/linux/m68k/sysdep.h>
+
+#define SYSCALL_ERROR_LOAD_GOT(reg) \
+ move.l &_GLOBAL_OFFSET_TABLE_ at GOTPC, reg; \
+ lea (-6, %pc, reg), reg
+
+#endif
--- sysdeps/unix/sysv/linux/m68k/fchownat.c
+++ sysdeps/unix/sysv/linux/m68k/fchownat.c
@@ -1,128 +1 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-#ifdef __NR_chown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_chown32 */
-
-int
-fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
-{
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- int result;
- INTERNAL_SYSCALL_DECL (err);
-
-#if __ASSUME_32BITUIDS > 0
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner,
- group);
- else
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
- group);
-#else
-# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file),
- owner, group);
- else
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
- group);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- goto fail;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_chown32 */
-
- if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown, err, 3, CHECK_STRING (file), owner,
- group);
- else
- result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner,
- group);
-#endif
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- fail:
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- result = -1;
- }
-
- return result;
-}
+#include <sysdeps/unix/sysv/linux/i386/fchownat.c>
--- sysdeps/unix/sysv/linux/m68k/init-first.c
+++ sysdeps/unix/sysv/linux/m68k/init-first.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+/* Note: linking in vDSO to a static binary requires changes to
+ the main GLIBC proper. Not yet implemented. */
+#ifdef SHARED
+
+#include <dl-vdso.h>
+#include <bits/m68k-vdso.h>
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+ void *p;
+
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+
+ /* It may happen that rtld didn't initialize the vDSO, so fallback
+ to the syscall implementations if _dl_vdso_vsym returns NULL.
+ This may happen when a static executable dlopen's a dynamic library.
+ This really is nothing more than a workaround for rtld/csu
+ deficiency. Ideally, init code would setup the vDSO for static
+ binaries too. */
+
+ p = _dl_vdso_vsym ("__kernel_read_tp", &linux26);
+ if (p != NULL)
+ {
+ __vdso_read_tp = p;
+ __rtld___vdso_read_tp = p;
+ }
+ else
+ assert (__vdso_read_tp == (void *) __vdso_read_tp_stub);
+
+ p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26);
+ if (p != NULL)
+ {
+ __vdso_atomic_cmpxchg_32 = p;
+ __rtld___vdso_atomic_cmpxchg_32 = p;
+ }
+ else
+ assert (__vdso_atomic_cmpxchg_32
+ == (void *) __vdso_atomic_cmpxchg_32_stub);
+
+ p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26);
+ if (p != NULL)
+ {
+ __vdso_atomic_barrier = p;
+ __rtld___vdso_atomic_barrier = p;
+ }
+ else
+ assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub);
+}
+
+#define VDSO_SETUP _libc_vdso_platform_setup
+
+#endif /* SHARED */
+
+#include <sysdeps/unix/sysv/linux/init-first.c>
--- sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c
+++ sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c
+#include "m68k-vdso.c"
--- sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S
+++ sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <bits/m68k-vdso.h>
+
+ .text
+
+ .hidden __vdso_read_tp_stub
+ENTRY (__vdso_read_tp_stub)
+ cfi_startproc
+ move.l #__NR_get_thread_area, %d0
+ trap #0
+ move.l %d0, %a0
+ rts
+ cfi_endproc
+END (__vdso_read_tp_stub)
+
+# ifdef SHARED
+/* GCC will emit calls to this routine. Linux has an
+ equivalent helper function (which clobbers fewer registers than
+ a normal function call) in a vdso; tail call to the
+ helper. */
+# ifdef IS_IN_rtld
+/* rtld gets a hidden copy of __m68k_read_tp. */
+ .hidden __m68k_read_tp
+# endif
+ENTRY (__m68k_read_tp)
+ cfi_startproc
+ lea _GLOBAL_OFFSET_TABLE_ at GOTPC(%pc), %a0
+ move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0
+ jmp ([%a0])
+ cfi_endproc
+END (__m68k_read_tp)
+
+/* The following two stubs are for macros in atomic.h, they can't
+ clobber anything. */
+
+ .hidden __vdso_atomic_cmpxchg_32_stub
+ENTRY (__vdso_atomic_cmpxchg_32_stub)
+ cfi_startproc
+ move.l %d2, -(%sp)
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (%d2, 0)
+ move.l %d0, %d2
+ move.l #SYS_ify (atomic_cmpxchg_32), %d0
+ trap #0
+ move.l (%sp)+, %d2
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (%d2)
+ rts
+ cfi_endproc
+END (__vdso_atomic_cmpxchg_32_stub)
+
+ .hidden __vdso_atomic_barrier_stub
+ENTRY (__vdso_atomic_barrier_stub)
+ cfi_startproc
+ move.l %d0, -(%sp)
+ cfi_adjust_cfa_offset (4)
+ move.l #SYS_ify (atomic_barrier), %d0
+ trap #0
+ move.l (%sp)+, %d0
+ cfi_adjust_cfa_offset (-4)
+ rts
+ cfi_endproc
+END (__vdso_atomic_barrier_stub)
+# else /* !SHARED */
+/* If the vDSO is not available, use a syscall to get TP. */
+ strong_alias (__vdso_read_tp_stub, __m68k_read_tp)
+# endif /* SHARED */
--- sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h
+++ sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h
+/* 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. */
+
+#ifndef _LINUX_M68K_M680X0_SYSDEP_H
+#define _LINUX_M68K_M680X0_SYSDEP_H 1
+
+#include <sysdeps/unix/sysdep.h>
+#include <sysdeps/m68k/m680x0/sysdep.h>
+#include <sysdeps/unix/sysv/linux/m68k/sysdep.h>
+
+#define SYSCALL_ERROR_LOAD_GOT(reg) \
+ lea (_GLOBAL_OFFSET_TABLE_ at GOTPC, %pc), reg
+
+#endif
--- sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
+++ sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+#ifdef SHARED
+
+#include <bits/m68k-vdso.h>
+
+/* Because these pointers are used from other libraries than libc,
+ they are exported at GLIBC_PRIVATE version.
+ We initialize them to syscall implementation so that they will be ready
+ to use from the very beginning. */
+void * M68K_VDSO_SYMBOL (__vdso_read_tp)
+= (void *) __vdso_read_tp_stub;
+void * M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32)
+= (void *) __vdso_atomic_cmpxchg_32_stub;
+void * M68K_VDSO_SYMBOL (__vdso_atomic_barrier)
+= (void *) __vdso_atomic_barrier_stub;
+
+#endif /* SHARED */
--- sysdeps/unix/sysv/linux/m68k/nptl
+++ sysdeps/unix/sysv/linux/m68k/nptl
+(directory)
--- sysdeps/unix/sysv/linux/m68k/nptl/bits
+++ sysdeps/unix/sysv/linux/m68k/nptl/bits
+(directory)
--- sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
+++ sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+
+/* Thread identifiers. The structure of the attribute type is
+ deliberately not exposed. */
+typedef unsigned long int pthread_t;
+
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_ATTR_T];
+ long int __align;
+} pthread_attr_t;
+
+
+typedef struct __pthread_internal_slist
+{
+ struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+
+
+/* Data structures for mutex handling. The structure of the attribute
+ type is deliberately not exposed. */
+typedef union
+{
+ struct __pthread_mutex_s
+ {
+ int __lock __attribute__ ((__aligned__ (4)));
+ unsigned int __count;
+ int __owner;
+ /* KIND must stay at this position in the structure to maintain
+ binary compatibility. */
+ int __kind;
+ unsigned int __nusers;
+ __extension__ union
+ {
+ int __spins;
+ __pthread_slist_t __list;
+ };
+ } __data;
+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
+ long int __align;
+} pthread_mutex_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
+ int __align;
+} pthread_mutexattr_t;
+
+
+/* Data structure for conditional variable handling. The structure of
+ the attribute type is deliberately not exposed. */
+typedef union
+{
+ struct
+ {
+ int __lock __attribute__ ((__aligned__ (4)));
+ unsigned int __futex;
+ __extension__ unsigned long long int __total_seq;
+ __extension__ unsigned long long int __wakeup_seq;
+ __extension__ unsigned long long int __woken_seq;
+ void *__mutex;
+ unsigned int __nwaiters;
+ unsigned int __broadcast_seq;
+ } __data;
+ char __size[__SIZEOF_PTHREAD_COND_T];
+ __extension__ long long int __align;
+} pthread_cond_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
+ int __align;
+} pthread_condattr_t;
+
+
+/* Keys for thread-specific data */
+typedef unsigned int pthread_key_t;
+
+
+/* Once-only execution */
+typedef int __attribute__ ((__aligned__ (4))) pthread_once_t;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Data structure for read-write lock variable handling. The
+ structure of the attribute type is deliberately not exposed. */
+typedef union
+{
+ struct
+ {
+ int __lock __attribute__ ((__aligned__ (4)));
+ unsigned int __nr_readers;
+ unsigned int __readers_wakeup;
+ unsigned int __writer_wakeup;
+ unsigned int __nr_readers_queued;
+ unsigned int __nr_writers_queued;
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __writer;
+ } __data;
+ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
+ long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
+ long int __align;
+} pthread_rwlockattr_t;
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type. */
+typedef volatile int pthread_spinlock_t;
+
+
+/* POSIX barriers data type. The structure of the type is
+ deliberately not exposed. */
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIER_T];
+ long int __align __attribute__ ((__aligned__ (4)));
+} pthread_barrier_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
+ int __align;
+} pthread_barrierattr_t;
+#endif
+
+
+#endif /* bits/pthreadtypes.h */
--- sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h
+++ sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h
+/* Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+
+#define __SIZEOF_SEM_T 16
+
+
+/* Value returned if `sem_open' failed. */
+#define SEM_FAILED ((sem_t *) 0)
+
+
+typedef union
+{
+ char __size[__SIZEOF_SEM_T];
+ long int __align __attribute__ ((__aligned__ (4)));
+} sem_t;
--- sysdeps/unix/sysv/linux/m68k/nptl/clone.S
+++ sysdeps/unix/sysv/linux/m68k/nptl/clone.S
+#define RESET_PID
+#include "../clone.S"
--- sysdeps/unix/sysv/linux/m68k/nptl/createthread.c
+++ sysdeps/unix/sysv/linux/m68k/nptl/createthread.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+/* Value passed to 'clone' for initialization of the thread register. */
+#define TLS_VALUE ((void *) (pd) \
+ + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+
+/* Get the real implementation. */
+#include <nptl/sysdeps/pthread/createthread.c>
--- sysdeps/unix/sysv/linux/m68k/nptl/fork.c
+++ sysdeps/unix/sysv/linux/m68k/nptl/fork.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <sched.h>
+#include <signal.h>
+#include <sysdep.h>
+#include <tls.h>
+
+#define ARCH_FORK() \
+ INLINE_SYSCALL (clone, 5, \
+ CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
+ NULL, &THREAD_SELF->tid, NULL)
+
+#include <sysdeps/unix/sysv/linux/fork.c>
--- sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+++ sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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. */
+
+/* Borrowed from ARM's version. */
+
+#ifndef _LOWLEVELLOCK_H
+#define _LOWLEVELLOCK_H 1
+
+#include <time.h>
+#include <sys/param.h>
+#include <bits/pthreadtypes.h>
+#include <atomic.h>
+#include <kernel-features.h>
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+#define FUTEX_REQUEUE 3
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
+#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
+#define FUTEX_LOCK_PI 6
+#define FUTEX_UNLOCK_PI 7
+#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_WAIT_BITSET 9
+#define FUTEX_WAKE_BITSET 10
+#define FUTEX_PRIVATE_FLAG 128
+#define FUTEX_CLOCK_REALTIME 256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
+
+/* Values for 'private' parameter of locking macros. Yes, the
+ definition seems to be backwards. But it is not. The bit will be
+ reversed before passing to the system call. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
+
+
+#define lll_futex_wait(futexp, val, private) \
+ lll_futex_timed_wait(futexp, val, NULL, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAIT, private), \
+ (val), (timespec)); \
+ __ret; \
+ })
+
+#define lll_futex_wake(futexp, nr, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAKE, private), \
+ (nr), 0); \
+ __ret; \
+ })
+
+#define lll_robust_dead(futexv, private) \
+ do \
+ { \
+ int *__futexp = &(futexv); \
+ atomic_or (__futexp, FUTEX_OWNER_DIED); \
+ lll_futex_wake (__futexp, 1, private); \
+ } \
+ while (0)
+
+/* Returns non-zero if error happened, zero if success. */
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
+/* Returns non-zero if error happened, zero if success. */
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_WAKE_OP, private), \
+ (nr_wake), (nr_wake2), (futexp2), \
+ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
+#define lll_trylock(lock) \
+ atomic_compare_and_exchange_val_acq (&(lock), 1, 0)
+
+#define lll_cond_trylock(lock) \
+ atomic_compare_and_exchange_val_acq (&(lock), 2, 0)
+
+#define lll_robust_trylock(lock, id) \
+ atomic_compare_and_exchange_val_acq (&(lock), id, 0)
+
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
+extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
+
+#define __lll_lock(futex, private) \
+ ((void) ({ \
+ int *__futex = (futex); \
+ if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \
+ 1, 0), 0)) \
+ { \
+ if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \
+ __lll_lock_wait_private (__futex); \
+ else \
+ __lll_lock_wait (__futex, private); \
+ } \
+ }))
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
+
+
+#define __lll_robust_lock(futex, id, private) \
+ ({ \
+ int *__futex = (futex); \
+ int __val = 0; \
+ \
+ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
+ 0), 0)) \
+ __val = __lll_robust_lock_wait (__futex, private); \
+ __val; \
+ })
+#define lll_robust_lock(futex, id, private) \
+ __lll_robust_lock (&(futex), id, private)
+
+
+#define __lll_cond_lock(futex, private) \
+ ((void) ({ \
+ int *__futex = (futex); \
+ if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \
+ __lll_lock_wait (__futex, private); \
+ }))
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
+
+
+#define lll_robust_cond_lock(futex, id, private) \
+ __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
+
+
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
+ int private) attribute_hidden;
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
+ int private) attribute_hidden;
+
+#define __lll_timedlock(futex, abstime, private) \
+ ({ \
+ int *__futex = (futex); \
+ int __val = 0; \
+ \
+ if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \
+ __val = __lll_timedlock_wait (__futex, abstime, private); \
+ __val; \
+ })
+#define lll_timedlock(futex, abstime, private) \
+ __lll_timedlock (&(futex), abstime, private)
+
+
+#define __lll_robust_timedlock(futex, abstime, id, private) \
+ ({ \
+ int *__futex = (futex); \
+ int __val = 0; \
+ \
+ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
+ 0), 0)) \
+ __val = __lll_robust_timedlock_wait (__futex, abstime, private); \
+ __val; \
+ })
+#define lll_robust_timedlock(futex, abstime, id, private) \
+ __lll_robust_timedlock (&(futex), abstime, id, private)
+
+
+#define __lll_unlock(futex, private) \
+ (void) \
+ ({ int *__futex = (futex); \
+ int __oldval = atomic_exchange_rel (__futex, 0); \
+ if (__builtin_expect (__oldval > 1, 0)) \
+ lll_futex_wake (__futex, 1, private); \
+ })
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
+
+
+#define __lll_robust_unlock(futex, private) \
+ (void) \
+ ({ int *__futex = (futex); \
+ int __oldval = atomic_exchange_rel (__futex, 0); \
+ if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \
+ lll_futex_wake (__futex, 1, private); \
+ })
+#define lll_robust_unlock(futex, private) \
+ __lll_robust_unlock(&(futex), private)
+
+
+#define lll_islocked(futex) \
+ (futex != 0)
+
+
+/* Our internal lock implementation is identical to the binary-compatible
+ mutex implementation. */
+
+/* Initializers for lock. */
+#define LLL_LOCK_INITIALIZER (0)
+#define LLL_LOCK_INITIALIZER_LOCKED (1)
+
+/* The states of a lock are:
+ 0 - untaken
+ 1 - taken by one user
+ >1 - taken by more users */
+
+/* The kernel notifies a process which uses CLONE_CLEARTID via futex
+ wakeup when the clone terminates. The memory location contains the
+ thread ID while the clone is running and is reset to zero
+ afterwards. */
+#define lll_wait_tid(tid) \
+ do { \
+ __typeof (tid) __tid; \
+ while ((__tid = (tid)) != 0) \
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
+ } while (0)
+
+extern int __lll_timedwait_tid (int *, const struct timespec *)
+ attribute_hidden;
+
+#define lll_timedwait_tid(tid, abstime) \
+ ({ \
+ int __res = 0; \
+ if ((tid) != 0) \
+ __res = __lll_timedwait_tid (&(tid), (abstime)); \
+ __res; \
+ })
+
+#endif /* lowlevellock.h */
--- sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
+++ sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <tcb-offsets.h>
+
+#define SAVE_PID \
+ bsrl __m68k_read_tp at PLTPC ; /* Get the thread pointer. */ \
+ movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \
+ movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \
+ movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \
+ negl %d0 ; /* Negate the PID. */ \
+ movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */
+
+#define RESTORE_PID \
+ tstl %d0 ; \
+ beq 1f ; /* If we are the parent... */ \
+ movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
+1:
+
+#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
--- sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c
+++ sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 "pthreadP.h"
+#include <lowlevellock.h>
+
+unsigned long int __fork_generation attribute_hidden;
+
+static void
+clear_once_control (void *arg)
+{
+ pthread_once_t *once_control = (pthread_once_t *) arg;
+
+ *once_control = 0;
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+}
+
+int
+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
+{
+ for (;;)
+ {
+ int oldval;
+ int newval;
+
+ /* Pseudo code:
+ newval = __fork_generation | 1;
+ oldval = *once_control;
+ if ((oldval & 2) == 0)
+ *once_control = newval;
+ Do this atomically.
+ */
+ do
+ {
+ newval = __fork_generation | 1;
+ oldval = *once_control;
+ if (oldval & 2)
+ break;
+ } while (atomic_compare_and_exchange_val_acq (once_control, newval, oldval) != oldval);
+
+ /* Check if the initializer has already been done. */
+ if ((oldval & 2) != 0)
+ return 0;
+
+ /* Check if another thread already runs the initializer. */
+ if ((oldval & 1) == 0)
+ break;
+
+ /* Check whether the initializer execution was interrupted by a fork. */
+ if (oldval != newval)
+ break;
+
+ /* Same generation, some other thread was faster. Wait. */
+ lll_futex_wait (once_control, oldval, LLL_PRIVATE);
+ }
+
+ /* This thread is the first here. Do the initialization.
+ Register a cleanup handler so that in case the thread gets
+ interrupted the initialization can be restarted. */
+ pthread_cleanup_push (clear_once_control, once_control);
+
+ init_routine ();
+
+ pthread_cleanup_pop (0);
+
+ /* Say that the initialisation is done. */
+ *once_control = __fork_generation | 2;
+
+ /* Wake up all other threads. */
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+
+ return 0;
+}
+weak_alias (__pthread_once, pthread_once)
+strong_alias (__pthread_once, __pthread_once_internal)
--- sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
+++ sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <tls.h>
+#ifndef __ASSEMBLER__
+# include <nptl/pthreadP.h>
+#endif
+
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name) \
+ SINGLE_THREAD_P; \
+ jne .Lpseudo_cancel; \
+ .type __##syscall_name##_nocancel, at function; \
+ .globl __##syscall_name##_nocancel; \
+ __##syscall_name##_nocancel: \
+ DO_CALL (syscall_name, args); \
+ cmp.l &-4095, %d0; \
+ jcc SYSCALL_ERROR_LABEL; \
+ rts; \
+ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
+ .Lpseudo_cancel: \
+ cfi_startproc; \
+ CENABLE; \
+ DOCARGS_##args \
+ move.l %d0, -(%sp); /* Save result of CENABLE. */ \
+ cfi_adjust_cfa_offset (4); \
+ move.l &SYS_ify (syscall_name), %d0; \
+ trap &0; \
+ move.l %d0, %d2; \
+ CDISABLE; \
+ addq.l &4, %sp; /* Remove result of CENABLE from the stack. */ \
+ cfi_adjust_cfa_offset (-4); \
+ move.l %d2, %d0; \
+ UNDOCARGS_##args \
+ cmp.l &-4095, %d0; \
+ jcc SYSCALL_ERROR_LABEL; \
+ cfi_endproc
+
+/* Note: we use D2 to save syscall's return value as D0 will be clobbered in
+ CDISABLE. */
+# define DOCARGS_0 move.l %d2, -(%sp); \
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d2, 0);
+# define UNDOCARGS_0 move.l (%sp)+, %d2; \
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d2);
+
+# define DOCARGS_1 _DOCARGS_1 (4); DOCARGS_0
+# define _DOCARGS_1(n) move.l n(%sp), %d1;
+# define UNDOCARGS_1 UNDOCARGS_0
+
+# define DOCARGS_2 _DOCARGS_2 (8)
+# define _DOCARGS_2(n) DOCARGS_0 move.l n+4(%sp), %d2; _DOCARGS_1 (n)
+# define UNDOCARGS_2 UNDOCARGS_0
+
+/* TODO: We can optimize DOCARGS_{3, 4} by saving registers to a0 and a1
+ instead of pushing them on stack. */
+# define DOCARGS_3 _DOCARGS_3 (12)
+# define _DOCARGS_3(n) move.l %d3, -(%sp); \
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d3, 0); \
+ move.l n+4(%sp), %d3; _DOCARGS_2 (n)
+# define UNDOCARGS_3 UNDOCARGS_2 move.l (%sp)+, %d3; \
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d3);
+
+# define DOCARGS_4 _DOCARGS_4 (16)
+# define _DOCARGS_4(n) move.l %d4, -(%sp); \
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \
+ move.l n+4(%sp), %d4; _DOCARGS_3 (n)
+# define UNDOCARGS_4 UNDOCARGS_3 move.l (%sp)+, %d4; \
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d4);
+
+# define DOCARGS_5 _DOCARGS_5 (20)
+# define _DOCARGS_5(n) move.l %d5, %a1; cfi_register (%d5, a1); \
+ move.l n(%sp), %d5; _DOCARGS_4 (n-4)
+# define UNDOCARGS_5 UNDOCARGS_4 move.l %a1, %d5; cfi_restore (%d5);
+
+# define DOCARGS_6 _DOCARGS_6 (24)
+# define _DOCARGS_6(n) move.l n(%sp), %a0; _DOCARGS_5 (n-4)
+# define UNDOCARGS_6 UNDOCARGS_5
+
+# ifdef PIC
+# define PSEUDO_JMP(sym) jbsr sym ## @PLTPC
+# else
+# define PSEUDO_JMP(sym) jbsr sym
+# endif
+
+# ifdef IS_IN_libpthread
+# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
+# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
+# elif !defined NOT_IN_libc
+# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
+# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
+# elif defined IS_IN_librt
+# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
+# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
+# else
+# error Unsupported library
+# endif
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P \
+ PSEUDO_JMP (__m68k_read_tp); \
+ tst.l MULTIPLE_THREADS_OFFSET(%a0)
+# endif
+
+#elif !defined __ASSEMBLER__
+
+# define SINGLE_THREAD_P (1)
+# define NO_CANCELLATION (1)
+
+#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, \
+ 1)
+#endif
--- sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
+++ sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim at codesourcery.com>, 2010.
+
+ 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 <tcb-offsets.h>
+
+#define SAVE_PID \
+ bsrl __m68k_read_tp at PLTPC ; /* Get the thread pointer. */ \
+ movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \
+ movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \
+ movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \
+ negl %d0 ; /* Negate the PID. */ \
+ bne 1f ; /* If it was zero... */ \
+ movel #0x80000000, %d0 ; /* use 0x80000000 instead. */ \
+1: movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */
+
+#define RESTORE_PID \
+ tstl %d0 ; \
+ beq 1f ; /* If we are the parent... */ \
+ movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
+1:
+
+#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
--- sysdeps/unix/sysv/linux/m68k/register-dump.h
+++ sysdeps/unix/sysv/linux/m68k/register-dump.h
@@ -40,7 +40,6 @@
*/
-#ifndef __mcoldfire__
/* Linux saves only the call-clobbered registers in the sigcontext. We
need to use a trampoline that saves the rest so that the C code can
access them. We use the sc_fpstate field, since the handler is not
@@ -59,14 +58,17 @@
/* Clear the first 4 bytes to make it a null fp state, just\n\
in case the handler does return. */\n\
clr.l (%%a0)+\n\
- movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n\
- fmovem.x %%fp2-%%fp7,11*4(%%a0)\n\
- jra real_catch_segfault"
+ movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n"
+#ifndef __mcoldfire__
+ "fmovem.x %%fp2-%%fp7,11*4(%%a0)\n"
+#elif defined __mcffpu__
+ "fmovem.d %%fp2-%%fp7,11*4(%%a0)\n"
+#endif
+ "jra real_catch_segfault"
: : "n" (offsetof (struct sigcontext, sc_fpstate)));
}
#define catch_segfault(a,b) \
__attribute_used__ real_catch_segfault(a,b)
-#endif
static void
hexvalue (unsigned long int value, char *buf, size_t len)
@@ -104,36 +106,19 @@
/* Generate strings of register contents. */
hexvalue (ctx->sc_d0, regs[0], 8);
hexvalue (ctx->sc_d1, regs[1], 8);
-#ifdef __mcoldfire__
- hexvalue (ctx->sc_d2, regs[2], 8);
- hexvalue (ctx->sc_d3, regs[3], 8);
- hexvalue (ctx->sc_d4, regs[4], 8);
- hexvalue (ctx->sc_d5, regs[5], 8);
- hexvalue (ctx->sc_d6, regs[6], 8);
- hexvalue (ctx->sc_d7, regs[7], 8);
-#else
hexvalue (*p++, regs[2], 8);
hexvalue (*p++, regs[3], 8);
hexvalue (*p++, regs[4], 8);
hexvalue (*p++, regs[5], 8);
hexvalue (*p++, regs[6], 8);
hexvalue (*p++, regs[7], 8);
-#endif
hexvalue (ctx->sc_a0, regs[8], 8);
hexvalue (ctx->sc_a1, regs[9], 8);
-#ifdef __mcoldfire__
- hexvalue (ctx->sc_a2, regs[10], 8);
- hexvalue (ctx->sc_a3, regs[11], 8);
- hexvalue (ctx->sc_a4, regs[12], 8);
- hexvalue (ctx->sc_a5, regs[13], 8);
- hexvalue (ctx->sc_a6, regs[14], 8);
-#else
hexvalue (*p++, regs[10], 8);
hexvalue (*p++, regs[11], 8);
hexvalue (*p++, regs[12], 8);
hexvalue (*p++, regs[13], 8);
hexvalue (*p++, regs[14], 8);
-#endif
hexvalue (ctx->sc_usp, regs[15], 8);
hexvalue (ctx->sc_pc, regs[16], 8);
hexvalue (ctx->sc_sr, regs[17], 4);
@@ -142,9 +127,6 @@
for (i = 0; i < 2; i++)
for (j = 0; j < fpreg_size; j += 8)
hexvalue (*pfp++, fpregs[i] + j, 8);
-#ifdef __mcoldfire__
- p = pfp;
-#endif
for (i = 2; i < 8; i++)
for (j = 0; j < fpreg_size; j += 8)
hexvalue (*p++, fpregs[i] + j, 8);
--- sysdeps/unix/sysv/linux/m68k/socket.S
+++ sysdeps/unix/sysv/linux/m68k/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 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
@@ -41,8 +41,11 @@
.globl __socket
ENTRY (__socket)
-#if defined NEED_CANCELLATION && defined CENABLE
- SINGLE_THREAD_P (%a0)
+#ifdef NEED_CANCELLATION
+# if !defined CENABLE || !defined CDISABLE
+# error CENABLE and/or CDISABLE is not defined
+# endif
+ SINGLE_THREAD_P
jne 1f
#endif
@@ -69,21 +72,26 @@
/* Successful; return the syscall's value. */
rts
-#if defined NEED_CANCELLATION && defined CENABLE
-1: /* Enable asynchronous cancellation. */
+#ifdef NEED_CANCELLATION
+1: cfi_startproc
+ /* Enable asynchronous cancellation. */
CENABLE
- /* Save registers. */
+ /* Save D2. */
move.l %d2, -(%sp)
- move.l %d0, -(%sp)
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (%d2, 0)
- move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */
+ /* Save the result of CENABLE. */
+ move.l %d0, -(%sp)
+ cfi_adjust_cfa_offset (4)
/* Use ## so `socket' is a separate token that might be #define'd. */
move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */
lea 4+8(%sp), %a1 /* Address of args is 2nd arg. */
move.l %a1, %d2
+ move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */
/* Do the system call trap. */
trap #0
@@ -91,14 +99,18 @@
move.l %d0, %d2
CDISABLE
addq.l #4, %sp
+ cfi_adjust_cfa_offset (-4)
move.l %d2, %d0
/* Restore registers. */
move.l (%sp)+, %d2
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (%d2)
/* %d0 is < 0 if there was an error. */
tst.l %d0
jmi SYSCALL_ERROR_LABEL
+ cfi_endproc
/* Successful; return the syscall's value. */
rts
--- sysdeps/unix/sysv/linux/m68k/sys/user.h
+++ sysdeps/unix/sysv/linux/m68k/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -58,4 +58,9 @@
char u_comm[32];
};
+#define NBPG 4096
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR u.start_code
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
#endif
--- sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -1,3 +1,5 @@
# File name Caller Syscall name Args Strong name Weak names
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
--- sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2010
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Andreas Schwab, <schwab at issan.informatik.uni-dortmund.de>,
December 1995.
@@ -18,11 +19,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _LINUX_M68K_SYSDEP_H
-#define _LINUX_M68K_SYSDEP_H 1
-
-#include <sysdeps/unix/sysdep.h>
-#include <sysdeps/m68k/sysdep.h>
+#include <tls.h>
/* Defines RTLD_PRIVATE_ERRNO. */
#include <dl-sysdep.h>
@@ -109,10 +106,27 @@
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
-# else /* !RTLD_PRIVATE_ERRNO */
-/* Store (- %d0) into errno through the GOT. */
-# if defined _LIBC_REENTRANT
-# define SYSCALL_ERROR_HANDLER \
+# elif USE___THREAD
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER \
+SYSCALL_ERROR_LABEL: \
+ neg.l %d0; \
+ move.l %d0, -(%sp); \
+ jbsr __m68k_read_tp at PLTPC; \
+ SYSCALL_ERROR_LOAD_GOT (%a1); \
+ add.l (SYSCALL_ERROR_ERRNO at TLSIE, %a1), %a0; \
+ move.l (%sp)+, (%a0); \
+ move.l &-1, %d0; \
+ /* Copy return value to %a0 for syscalls that are declared to return \
+ a pointer (e.g., mmap). */ \
+ move.l %d0, %a0; \
+ rts;
+# elif defined _LIBC_REENTRANT
+# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
neg.l %d0; \
move.l %d0, -(%sp); \
@@ -123,8 +137,9 @@
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
-# else /* !_LIBC_REENTRANT */
-# define SYSCALL_ERROR_HANDLER \
+# else /* !_LIBC_REENTRANT */
+/* Store (- %d0) into errno through the GOT. */
+# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
move.l (errno at GOTPC, %pc), %a0; \
neg.l %d0; \
@@ -134,8 +149,7 @@
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
-# endif /* _LIBC_REENTRANT */
-# endif /* RTLD_PRIVATE_ERRNO */
+# endif /* _LIBC_REENTRANT */
#else
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
#endif /* PIC */
@@ -148,9 +162,11 @@
arg 3 %d3 call-saved
arg 4 %d4 call-saved
arg 5 %d5 call-saved
+ arg 6 %a0 call-clobbered
The stack layout upon entering the function is:
+ 24(%sp) Arg# 6
20(%sp) Arg# 5
16(%sp) Arg# 4
12(%sp) Arg# 3
@@ -229,7 +245,7 @@
normally. It will never touch errno. This returns just what the kernel
gave back. */
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
({ unsigned int _sys_result; \
{ \
/* Load argument values in temporary variables
@@ -237,7 +253,7 @@
before the call used registers are set. */ \
LOAD_ARGS_##nr (args) \
LOAD_REGS_##nr \
- register int _d0 asm ("%d0") = __NR_##name; \
+ register int _d0 asm ("%d0") = name; \
asm volatile ("trap #0" \
: "=d" (_d0) \
: "0" (_d0) ASM_ARGS_##nr \
@@ -245,6 +261,8 @@
_sys_result = _d0; \
} \
(int) _sys_result; })
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
@@ -300,4 +318,13 @@
#define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0)
#endif /* not __ASSEMBLER__ */
+
+/* Pointer mangling is not yet supported for M68K. */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+/* M68K needs system-supplied DSO to access TLS helpers
+ even when statically linked. */
+# define NEED_STATIC_SYSINFO_DSO 1
#endif
--- sysdeps/unix/sysv/linux/m68k/vfork.S
+++ sysdeps/unix/sysv/linux/m68k/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2002, 2003, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab at gnu.org>.
@@ -22,6 +22,14 @@
#include <bits/errno.h>
#include <kernel-features.h>
+#ifndef SAVE_PID
+#define SAVE_PID
+#endif
+
+#ifndef RESTORE_PID
+#define RESTORE_PID
+#endif
+
/* Clone the calling process, but without copying the whole address space.
The calling process is suspended until the new process exits or is
replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
@@ -31,12 +39,20 @@
#ifdef __NR_vfork
+ /* SAVE_PID clobbers call-clobbered registers and
+ saves data in D1 and A1. */
+
+ SAVE_PID
+
/* Pop the return PC value into A0. */
movel %sp at +, %a0
/* Stuff the syscall number in D0 and trap into the kernel. */
movel #SYS_ify (vfork), %d0
trap #0
+
+ RESTORE_PID
+
tstl %d0
jmi .Lerror /* Branch forward if it failed. */
--- sysdeps/unix/sysv/linux/mips/bits/errno.h
+++ sysdeps/unix/sysv/linux/mips/bits/errno.h
@@ -38,6 +38,10 @@
# define ENOTRECOVERABLE 166
# endif
+# ifndef ERFKILL
+# define ERFKILL 167
+# endif
+
# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable. */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
--- sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -1,6 +1,6 @@
/* O_*, F_*, FD_* bit values for Linux.
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006,
- 2007, 2009 Free Software Foundation, Inc.
+ 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
@@ -36,7 +36,7 @@
#define O_WRONLY 01
#define O_RDWR 02
#define O_APPEND 0x0008
-#define O_SYNC 0x0010
+#define O_SYNC 0x4010
#define O_NONBLOCK 0x0080
#define O_NDELAY O_NONBLOCK
#define O_CREAT 0x0100 /* not fcntl */
@@ -46,19 +46,21 @@
#define O_FSYNC O_SYNC
#define O_ASYNC 0x1000
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
# define O_NOFOLLOW 0x20000 /* Do not follow links. */
-# define O_DIRECT 0x8000 /* Direct disk access hint. */
# define O_DIRECTORY 0x10000 /* Must be a directory. */
-# define O_NOATIME 0x40000 /* Do not set atime. */
# define O_CLOEXEC 02000000 /* Set close_on_exec. */
#endif
+#ifdef __USE_GNU
+# define O_DIRECT 0x8000 /* Direct disk access hint. */
+# define O_NOATIME 0x40000 /* Do not set atime. */
+#endif
/* For now Linux has no synchronisity options for data and read operations.
We define the symbols here but let them do the same as O_SYNC since
this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_DSYNC 0x0010 /* Synchronize data. */
# define O_RSYNC O_SYNC /* Synchronize read operations. */
#endif
@@ -86,7 +88,7 @@
#define F_SETLK64 34 /* Set record locking info (non-blocking). */
#define F_SETLKW64 35 /* Set record locking info (blocking). */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
# define F_SETOWN 24 /* Get owner (process receiving SIGIO). */
# define F_GETOWN 23 /* Set owner (process receiving SIGIO). */
#endif
@@ -102,6 +104,10 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+#endif
+#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
@@ -185,9 +191,10 @@
/* Owner types. */
enum __pid_type
{
- F_OWNER_TID = 0, /* Kernel thread. */
- F_OWNER_PID, /* Process. */
- F_OWNER_GID /* Process group. */
+ 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. */
@@ -250,7 +257,7 @@
/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
--- sysdeps/unix/sysv/linux/mips/bits/mman.h
+++ sysdeps/unix/sysv/linux/mips/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/MIPS version.
- Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006
+ Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006, 2009, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -86,14 +86,19 @@
/* Advice to `madvise'. */
#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
+# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
--- sysdeps/unix/sysv/linux/mips/bits/poll.h
+++ sysdeps/unix/sysv/linux/mips/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
--- sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -1,6 +1,6 @@
/* Bit values & structures for resource limits. Linux/MIPS version.
Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006, 2008,
- 2009 Free Software Foundation, Inc.
+ 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
@@ -240,3 +240,31 @@
PRIO_USER = 2 /* WHO is a user ID. */
#define PRIO_USER PRIO_USER
};
+
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+/* Modify and return resource limits of a process atomically. */
+# ifndef __USE_FILE_OFFSET64
+extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
+ __const struct rlimit *__new_limit,
+ struct rlimit *__old_limit) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
+ enum __rlimit_resource __resource,
+ __const struct rlimit *__new_limit,
+ struct rlimit *__old_limit), prlimit64);
+# else
+# define prlimit prlimit64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
+ __const struct rlimit64 *__new_limit,
+ struct rlimit64 *__old_limit) __THROW;
+# endif
+#endif
+
+__END_DECLS
--- sysdeps/unix/sysv/linux/mips/bits/sigaction.h
+++ sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux/MIPS's sigaction.
- Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003
+ Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -64,6 +64,8 @@
three arguments instead of one. */
#if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+#endif
+#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
--- sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -1,6 +1,6 @@
/* System-specific socket constants and types. Linux/MIPS version.
Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ 2009, 2010, 2011 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
@@ -109,7 +109,9 @@
#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.. */
+#define PF_CAIF 37 /* CAIF sockets. */
+#define PF_ALG 38 /* Algorithm sockets. */
+#define PF_MAX 39 /* For now.. */
/* Address families. */
#define AF_UNSPEC PF_UNSPEC
@@ -150,6 +152,8 @@
#define AF_ISDN PF_ISDN
#define AF_PHONET PF_PHONET
#define AF_IEEE802154 PF_IEEE802154
+#define AF_CAIF PF_CAIF
+#define AF_ALG PF_ALG
#define AF_MAX PF_MAX
/* Socket level values. Others are defined in the appropriate headers.
@@ -232,10 +236,12 @@
#define MSG_NOSIGNAL MSG_NOSIGNAL
MSG_MORE = 0x8000, /* Sender will send more. */
#define MSG_MORE MSG_MORE
+ MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
+#define MSG_WAITFORONE MSG_WAITFORONE
MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
- descriptor received through
- SCM_RIGHTS. */
+ descriptor received through
+ SCM_RIGHTS. */
#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
};
@@ -256,6 +262,15 @@
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
{
@@ -397,4 +412,18 @@
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 */
--- sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -1,5 +1,5 @@
/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
- 2007, 2009 Free Software Foundation, Inc.
+ 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
@@ -17,10 +17,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
#include <sgidefs.h>
/* Versions of the `struct stat' data structure. */
@@ -61,7 +64,7 @@
long int st_pad2[3];
__off64_t st_size; /* Size of file, in bytes. */
#endif
-#ifdef __USE_MISC
+#if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -105,7 +108,7 @@
unsigned long int st_rdev; /* Device number, if device. */
long int st_pad2[3];
__off64_t st_size; /* Size of file, in bytes. */
-#ifdef __USE_MISC
+# if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -115,14 +118,14 @@
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
-#else
+# else
__time_t st_atime; /* Time of last access. */
long int __reserved0;
__time_t st_mtime; /* Time of last modification. */
long int __reserved1;
__time_t st_ctime; /* Time of last status change. */
long int __reserved2;
-#endif
+# endif
__blksize_t st_blksize; /* Optimal block size for I/O. */
long int st_pad3;
__blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
@@ -152,7 +155,7 @@
unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
__off64_t st_size;
#endif
-#ifdef __USE_MISC
+#if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -196,7 +199,7 @@
__dev_t st_rdev;
unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
__off64_t st_size;
-#ifdef __USE_MISC
+# if defined __USE_MISC || defined __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
@@ -206,14 +209,14 @@
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
-#else
+# else
__time_t st_atime;
int __reserved0;
__time_t st_mtime;
int __reserved1;
__time_t st_ctime;
int __reserved2;
-#endif
+# endif
__blksize_t st_blksize;
unsigned int st_pad3;
__blkcnt64_t st_blocks;
@@ -258,3 +261,5 @@
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
--- sysdeps/unix/sysv/linux/mips/bits/statfs.h
+++ sysdeps/unix/sysv/linux/mips/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 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,8 @@
/* Linux specials */
__fsid_t f_fsid;
long int f_namelen;
- long int f_spare[6];
+ long int f_flags;
+ long int f_spare[5];
};
#ifdef __USE_LARGEFILE64
@@ -64,7 +65,8 @@
/* Linux specials */
__fsid_t f_fsid;
long int f_namelen;
- long int f_spare[6];
+ long int f_flags;
+ long int f_spare[5];
};
#endif
--- sysdeps/unix/sysv/linux/mips/bits/termios.h
+++ sysdeps/unix/sysv/linux/mips/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux/MIPS version.
- Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 99, 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
@@ -194,6 +194,9 @@
#endif
#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
#define ITOSTOP TOSTOP
+#ifdef __USE_BSD
+# define EXTPROC 0200000
+#endif
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
--- sysdeps/unix/sysv/linux/mips/configure
+++ sysdeps/unix/sysv/linux/mips/configure
@@ -107,6 +107,6 @@
esac
if test -z "$arch_minimum_kernel"; then
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.1
libc_cv_gcc_unwind_find_fde=yes
fi
--- sysdeps/unix/sysv/linux/mips/configure.in
+++ sysdeps/unix/sysv/linux/mips/configure.in
@@ -107,6 +107,6 @@
esac
if test -z "$arch_minimum_kernel"; then
- arch_minimum_kernel=2.4.0
+ arch_minimum_kernel=2.4.1
libc_cv_gcc_unwind_find_fde=yes
fi
--- sysdeps/unix/sysv/linux/mips/getpagesize.c
+++ sysdeps/unix/sysv/linux/mips/getpagesize.c
-#include <sysdeps/unix/sysv/linux/ia64/getpagesize.c>
--- sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -38,3 +38,9 @@
#endif
#include_next <kernel-features.h>
+
+/* The n32 syscall ABI did not have a getdents64 syscall until
+ 2.6.35. */
+#if _MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623
+# undef __ASSUME_GETDENTS64_SYSCALL
+#endif
--- sysdeps/unix/sysv/linux/mips/ldsodefs.h
+++ sysdeps/unix/sysv/linux/mips/ldsodefs.h
@@ -30,4 +30,12 @@
#undef DL_STATIC_INIT
#define DL_STATIC_INIT(map) _dl_static_init (map)
+/* Allow ABIVERSION == 1, meaning PLTs and copy relocations are
+ required, with ELFOSABI_SYSV. */
+#undef VALID_ELF_ABIVERSION
+#define VALID_ELF_ABIVERSION(osabi,ver) \
+ (ver == 0 \
+ || (osabi == ELFOSABI_SYSV && ver < 2) \
+ || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX))
+
#endif /* ldsodefs.h */
--- sysdeps/unix/sysv/linux/mips/libc-abis
+++ sysdeps/unix/sysv/linux/mips/libc-abis
+# See the copy of this file in libc for detailed explanations. This
+# copy needs to include all libc definitions applicable to MIPS; only
+# one copy will be used.
+#
+# Feature Name Configuration
+# ------------ -------------
+#
+# MIPS PLTs.
+MIPS_PLT mips*-*-linux*
+#
+# Unique symbol definitions for C++.
+# Architecture independent, all ELF targets (== all targets)
+UNIQUE
--- sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S
+++ sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S
+/* MIPS does not have socket.S and the socketcall syscall should
+ generally be avoided, though it exists. */
--- sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c
+++ sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c
+/* 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. */
+
+/* Avoid recvmmsg.c trying to use a definition based on the socketcall
+ syscall and internal_recvmmsg.S. */
+
+#include <errno.h>
+#include <sys/socket.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+#undef __NR_socketcall
+
+#include <sysdeps/unix/sysv/linux/recvmmsg.c>
--- sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
+++ sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
+/* Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ 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 <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+ respect to the file associated with FD. */
+
+int
+posix_fadvise (int fd, off_t offset, off_t len, int advise)
+{
+#ifdef __NR_fadvise64
+ INTERNAL_SYSCALL_DECL (err);
+ int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
+#else
+ return ENOSYS;
+#endif
+}
--- sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+++ sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
@@ -2,6 +2,9 @@
readahead - readahead i:iii __readahead readahead
sync_file_range - sync_file_range i:iiii sync_file_range
-posix_fadvise - fadvise64 i:iiii posix_fadvise
ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64
truncate - truncate i:si truncate truncate64
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark
--- sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
+++ sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
+#include <sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c>
--- sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
+++ sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
+/* posix_fadvise64 is in posix_fadvise.c */
--- sysdeps/unix/sysv/linux/mips/sys/inotify.h
+++ sysdeps/unix/sysv/linux/mips/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 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
@@ -72,6 +72,8 @@
#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
directory. */
#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked
+ objects. */
#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
existing watch. */
#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/405
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/405
+(directory)
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies
+powerpc/powerpc32/405/fpu
+powerpc/powerpc32/405
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/440
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/440
+(directory)
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies
+powerpc/powerpc32/440/fpu
+powerpc/powerpc32/440
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/464
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/464
+(directory)
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies
+powerpc/powerpc32/464/fpu
+powerpc/powerpc32/464
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/476
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/476
+(directory)
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies
+powerpc/powerpc32/476/fpu
+powerpc/powerpc32/476
++++++ deleted files:
--- glibc-2.11-12-g24c0bf7.tar.bz2
More information about the MeeGo-commits
mailing list