diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
commit | 4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch) | |
tree | cd67e40a74928c0f58d4f5b79d2e260e4099fee7 /ports | |
parent | 91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff) |
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'ports')
111 files changed, 1113 insertions, 1600 deletions
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha index 55f876898..b7d6bb1af 100644 --- a/ports/ChangeLog.alpha +++ b/ports/ChangeLog.alpha @@ -1,3 +1,8 @@ +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/alpha/dl-machine.h (elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + 2011-03-28 Aurelien Jarno <aurelien@aurel32.net> * sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S(____longjmp_chk): @@ -48,7 +53,7 @@ Define without 64-bit aliases. 2010-05-03 Aurelien Jarno <aurelien@aurel32.net> - + * sysdeps/alpha/memchr.S: Use prefetch load. * sysdeps/alpha/alphaev6/memchr.S: Likewise. diff --git a/ports/ChangeLog.am33 b/ports/ChangeLog.am33 index e9b19bd3c..ccffef38f 100644 --- a/ports/ChangeLog.am33 +++ b/ports/ChangeLog.am33 @@ -1,3 +1,8 @@ +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/am33/dl-machine.h (elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + 2007-10-22 Daniel Jacobowitz <dan@codesourcery.com> * sysdeps/unix/sysv/linux/am33/bits/fcntl.h (F_DUPFD_CLOEXEC): Define. diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm index 569b98f8a..ba319b832 100644 --- a/ports/ChangeLog.arm +++ b/ports/ChangeLog.arm @@ -1,3 +1,26 @@ +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/arm/dl-machine.h (elf_machine_rel, elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc, don't call ifunc + function if non-zero. + +2011-09-13 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/arm/elf/configure.in: Always test for TLS support and + error out in case it is missing. + * sysdeps/arm/elf/configure: Regenerate. + * sysdeps/arm/nptl/tls.h, + sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S: Remove tests for + HAVE_TLS_SUPPORT. + +2011-09-11 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/arm/dl-machine.h, sysdeps/arm/dl-tlsdesc.S, + sysdeps/arm/libc-tls.c, sysdeps/arm/nptl/tls.h, + sysdeps/arm/tlsdesc.c, sysdeps/arm/tlsdesc.sym, + sysdeps/unix/arm/sysdep.S: Remove !USE_THREAD and !USE_TLS cases. + Don't define USE_TLS. + 2011-08-18 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> * sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall @@ -353,7 +376,7 @@ file. 2009-10-22 Andrew Stubbs <ams@codesourcery.com> - Julian Brown <julian@codesourcery.com> + Julian Brown <julian@codesourcery.com> * sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated instruction fstmiax with vstmia. @@ -398,9 +421,9 @@ (setup_aeabi_stdio): New function. Add it to .preinit_array. 2009-06-24 Maxim Kuvyrkov <maxim@codesourcery.com> - Mark Mitchell <mark@codesourcery.com> - Joseph Myers <joseph@codesourcery.com> - Kazu Hirata <kazu@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + Joseph Myers <joseph@codesourcery.com> + Kazu Hirata <kazu@codesourcery.com> * sysdeps/arm/eabi/backtrace.c: New. * sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add @@ -461,17 +484,17 @@ 2009-02-13 Khem Raj <raj.khem@gmail.com> - * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c + * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c (libgcc_s_handle): New variable. (pthread_cancel_init): Depend in libgcc_s_handle for decision to load DSO. Assign last. (__unwind_freeres): New function. - * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: + * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Likewise. 2009-02-05 Paul Brook <paul@codesourcery.com> - Joseph Myers <joseph@codesourcery.com> + Joseph Myers <joseph@codesourcery.com> * sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto. (elf_machine_load_address): Clear T bit of PLT entry contents. @@ -877,7 +900,7 @@ 2006-06-08 Mark Shinwell <shinwell@codesourcery.com> - * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12. + * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12. 2006-06-08 Daniel Jacobowitz <dan@codesourcery.com> diff --git a/ports/ChangeLog.cris b/ports/ChangeLog.cris index 810b53b32..da1ad973f 100644 --- a/ports/ChangeLog.cris +++ b/ports/ChangeLog.cris @@ -1,3 +1,8 @@ +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/cris/dl-machine.h (elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + 2007-10-22 Daniel Jacobowitz <dan@codesourcery.com> * sysdeps/unix/sysv/linux/cris/bits/fcntl.h (F_DUPFD_CLOEXEC): Define. diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa index 2ccc91143..be3a951a8 100644 --- a/ports/ChangeLog.hppa +++ b/ports/ChangeLog.hppa @@ -1,7 +1,94 @@ +2011-10-21 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Update copyright year. + Do not include signal.h and sys/ucontext.h. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Update copyright + year. + (PSEUDO): Define __*_nocancel version. Add CFI directives to __*_nocancel + and normal version. + (PUSHARGS_1): Add CFI directive. + (PUSHARGS_2): Likewise. + (PUSHARGS_3): Likewise. + (PUSHARGS_4): Likewise. + (PUSHARGS_5): Likewise. + (PUSHARGS_6): Likewise. + (POPARGS_1): Likewise. + (POPARGS_2): Likewise. + (POPARGS_3): Likewise. + (POPARGS_4): Likewise. + (POPARGS_5): Likewise. + (POPARGS_6): Likewise. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c: Remove. + * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h: Remove. + * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h: Remove. + * sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h: Remove. + * sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c: Remove. + * sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h: Remove. + * sysdeps/hppa/linuxthreads/pspinlock.c: Remove. + * sysdeps/hppa/linuxthreads/pt-machine.h: Remove. + * sysdeps/hppa/linuxthreads/tls.h: Remove. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/hppa/stackinfo.h: Update copyright year. + Include elf.h and define DEFAULT_STACK_PERMS. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Synchronize + with canonical fcntl.h. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/hppa/fpu/fegetenv.c: Add hidden alias. + * sysdeps/hppa/fpu/feupdateenv.c: Likewise. + * sysdeps/hppa/fpu/ftestexcept.c: Likewise. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/hppa/dl-tls.h: Update copyright year. + Define TLS_DTV_UNALLOCATED. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/hppa/elf/configure.in: Always test for TLS support + and error out if missing. + * sysdeps/hppa/elf/configure: Regenerate. + * sysdeps/hppa/configure: Regenerate. + +2011-10-20 Carlos O'Donell <carlos@systemhalted.org> + + * sysdeps/hppa/nptl/tls.h: Update copyright year. + Remove HAVE_TLS_SUPPORT check. + +2011-10-17 Guy Martin <gmsoft@tuxicoman.be> + + * sysdeps/unix/sysv/linux/hppa/sys/epoll.h + Fix EPOLL_CLOEXEC and EPOLL_NONBLOCK to match kernel definition. + * sysdeps/unix/sysv/linux/hppa/sys/eventfd.h + Fix EFD_CLOEXEC and EFD_NONBLOCK to match kernel definition. + * sysdeps/unix/sysv/linux/hppa/sys/inotify.h + Fix IN_CLOEXEC and IN_NONBLOCK to match kernel definition. + * sysdeps/unix/sysv/linux/hppa/sys/signalfd.h + Fix SFD_CLOEXEC and SFD_NONBLOCK to match kernel definition. + * sysdeps/unix/sysv/linux/hppa/sys/timerfd.h + Fix TFD_CLOEXEC and TFD_NONBLOCK to match kernel definition. + +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/hppa/dl-machine.h (elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + 2010-06-24 Carlos O'Donell <carlos@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 + * 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@codesourcery.com> @@ -10,12 +97,12 @@ Document that this function is a non-standard calling ABI. Document register usage. (__getcontext): Use normal %sp without adjustment. Use named - resgister %sp. + 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. + (__makecontext): Create and setup a stack frame. * sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext): - Use named register %sp. Do not use oSS_SP. + Use named register %sp. Do not use oSS_SP. 2010-06-07 Andreas Schwab <schwab@redhat.com> diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k index 8c85d5c81..d7e03efd2 100644 --- a/ports/ChangeLog.m68k +++ b/ports/ChangeLog.m68k @@ -1,3 +1,82 @@ +2011-10-23 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/coldfire/fpu/e_sqrt.c: Add __sqrt_finite alias. + * sysdeps/m68k/coldfire/fpu/e_sqrtf.c: Add __sqrtf_finite alias. + + * sysdeps/m68k/m680x0/fpu/e_exp.c (FUNC_FINITE): Define. + * sysdeps/m68k/m680x0/fpu/e_expf.c (FUNC_FINITE): Define. + * sysdeps/m68k/m680x0/fpu/e_expl.c (FUNC_FINITE): Define. + +2011-10-22 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/s_ccos.c: Remove. + * sysdeps/m68k/m680x0/fpu/s_ccosf.c: Remove. + * sysdeps/m68k/m680x0/fpu/s_ccosl.c: Remove. + +2011-10-13 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/fpu/e_acos.c: Add __*_finite alias. + * sysdeps/m68k/m680x0/fpu/e_acosf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_acosl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_asin.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_asinl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_asinf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_atan2.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_atanh.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_atanhf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_atanhl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_cosh.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_coshf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_coshl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp10.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp10f.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp10l.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp2.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp2l.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_exp2f.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_fmod.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_fmodf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_fmodl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_logl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_logf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log10.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log10f.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log10l.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log2.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log2f.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_log2l.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_pow.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_remainder.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_remainderl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_remainderf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_scalb.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sinh.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sinhf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sinhl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sqrt.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sqrtf.c: Likewise. + * sysdeps/m68k/m680x0/fpu/e_sqrtl.c: Likewise. + +2011-10-09 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/m680x0/s_isinfl.c: Remove. + * sysdeps/m68k/m680x0/s_isnanl.c: Remove. + +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/m68k/dl-machine.h (elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + +2011-09-11 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/nptl/tls.h: Don't define USE_TLS. + * sysdeps/m68k/dl-machine.h: Remove use of USE_TLS. + * sysdeps/m68k/libc-tls.c: Likewise. + + * sysdeps/unix/sysv/linux/m68k/sysdep.h: Remove use of + USE___THREAD. + 2011-06-23 Andreas Schwab <schwab@linux-m68k.org> * sysdeps/m68k/dl-trampoline.S (_dl_runtime_profile) diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips index 75f87fe41..78932d7a0 100644 --- a/ports/ChangeLog.mips +++ b/ports/ChangeLog.mips @@ -1,3 +1,31 @@ +2011-10-12 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/mips/fpu/e_sqrt.c: Add __sqrt_finite alias. + * sysdeps/mips/fpu/e_sqrtf.c: Add __sqrtf_finite alias. + * sysdeps/mips/mips64/soft-fp/e_sqrtl.c: Add __sqrtl_finite alias. + +2011-10-05 Andreas Schwab <schwab@redhat.com> + + * sysdeps/mips/dl-machine.h (elf_machine_rel, elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc. + +2011-09-13 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/mips/bits/socket.h (__cmsg_nxthdr): Cast + return value to (struct cmsghdr *). + +2011-09-13 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/mips/elf/configure.in: Always test for TLS support and + error out in case it is missing. + * sysdeps/mips/elf/configure: Regenerate. + * sysdeps/mips/nptl/tls.h: Remove test for HAVE_TLS_SUPPORT. + +2011-09-11 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/mips/dl-machine.h, sysdeps/mips/libc-tls.c, + sysdeps/mips/nptl/tls.h: Don't define or use USE_TLS. + 2011-09-06 Joseph Myers <joseph@codesourcery.com> [BZ #13109] @@ -372,7 +400,7 @@ Update comment. * sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h: New file. * sysdeps/unix/sysv/linux/mips/ucontext_i.sym: New file. - * sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers): + * sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers): Add ucontext_i.sym. 2009-04-18 Joseph Myers <joseph@codesourcery.com> @@ -577,7 +605,7 @@ 2008-04-02 Aurelien Jarno <aurelien@aurel32.net> - * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add + * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add truncate and ftruncate systems calls. * sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: Make an empty file. @@ -963,7 +991,7 @@ (lll_robust_mutex_dead, lll_robust_mutex_trylock, lll_robust_mutex_lock, lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock, lll_robust_mutex_unlock): New macros. - (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes. + (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes. * sysdeps/unix/sysv/linux/mips/nptl/pt-vfork.S: Use correct path to vfork.S. * sysdeps/unix/sysv/linux/mips/nptl/vfork.S: Likewise. diff --git a/ports/sysdeps/alpha/dl-machine.h b/ports/sysdeps/alpha/dl-machine.h index e4a502208..2790ae570 100644 --- a/ports/sysdeps/alpha/dl-machine.h +++ b/ports/sysdeps/alpha/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Alpha version. - Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1996-2005, 2006, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson <rth@tamu.edu>. @@ -371,7 +371,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, + int skip_ifunc) { Elf64_Addr *const reloc_addr = reloc_addr_arg; unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info); @@ -514,7 +515,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, auto inline void __attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf64_Addr l_addr, const Elf64_Rela *reloc) + Elf64_Addr l_addr, const Elf64_Rela *reloc, + int skip_ifunc) { Elf64_Addr * const reloc_addr = (void *)(l_addr + reloc->r_offset); unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info); diff --git a/ports/sysdeps/am33/dl-machine.h b/ports/sysdeps/am33/dl-machine.h index 808fd9cc8..ffd866ac1 100644 --- a/ports/sysdeps/am33/dl-machine.h +++ b/ports/sysdeps/am33/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. AM33 version. - Copyright (C) 1995,96,97,98,99,2000,2001, 2004 + Copyright (C) 1995,96,97,98,99,2000,2001, 2004, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -296,7 +296,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, static inline void elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); Elf32_Addr value, *reloc_addr; @@ -457,7 +457,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, static inline void elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { unsigned long int const r_type = ELF32_R_TYPE (reloc->r_info); diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h index b5d477be6..5a5896560 100644 --- a/ports/sysdeps/arm/dl-machine.h +++ b/ports/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, - 2006, 2009, 2010 Free Software Foundation, Inc. + 2006, 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 @@ -242,18 +242,12 @@ _dl_start_user:\n\ 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. */ -#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) -# define elf_machine_type_class(type) \ +#define elf_machine_type_class(type) \ ((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \ || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \ || (type) == R_ARM_TLS_DESC) \ * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) -#else -#define elf_machine_type_class(type) \ - ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) -#endif /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_ARM_JUMP_SLOT @@ -341,7 +335,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -375,9 +369,9 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value; if (sym != NULL - && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, - 0) - && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) + && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf32_Addr (*) (void)) value) (); switch (r_type) @@ -436,7 +430,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } case R_ARM_TLS_DESC: { - struct tlsdesc volatile *td = + struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; # ifndef RTLD_BOOTSTRAP @@ -460,10 +454,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, else # endif # endif - { + { td->argument.value = value + sym_map->l_tls_offset; td->entry = _dl_tlsdesc_return; - } + } } } break; @@ -494,7 +488,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } break; #if !defined RTLD_BOOTSTRAP -#if defined USE_TLS case R_ARM_TLS_DTPMOD32: /* Get the information from the link map returned by the resolv function. */ @@ -514,7 +507,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, *reloc_addr += sym->st_value + sym_map->l_tls_offset; } break; -#endif case R_ARM_IRELATIVE: value = map->l_addr + *reloc_addr; value = ((Elf32_Addr (*) (void)) value) (); @@ -533,7 +525,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -551,9 +543,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value; if (sym != NULL - && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, - 0) - && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) + && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf32_Addr (*) (void)) value) (); switch (r_type) @@ -608,7 +600,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } break; #if !defined RTLD_BOOTSTRAP -#if defined USE_TLS case R_ARM_TLS_DTPMOD32: /* Get the information from the link map returned by the resolv function. */ @@ -628,7 +619,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, + reloc->r_addend); } break; -#endif case R_ARM_IRELATIVE: value = map->l_addr + *reloc_addr; value = ((Elf32_Addr (*) (void)) value) (); @@ -666,7 +656,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, auto inline void __attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rel *reloc) + Elf32_Addr l_addr, const Elf32_Rel *reloc, + int skip_ifunc) { Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -678,20 +669,18 @@ elf_machine_lazy_rel (struct link_map *map, else *reloc_addr = map->l_mach.plt; } -#ifdef USE_TLS else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1)) { struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; /* The linker must have given us the parameter we need in the - first GOT entry, and left the second one empty. We fill the - last with the resolver address */ + first GOT entry, and left the second one empty. We fill the + last with the resolver address */ assert (td->entry == 0); td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + map->l_addr); } -#endif else _dl_reloc_bad_type (map, r_type, 1); } diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S index 19e4ed3d0..c192fc978 100644 --- a/ports/sysdeps/arm/dl-tlsdesc.S +++ b/ports/sysdeps/arm/dl-tlsdesc.S @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. ARM version. - Copyright (C) 2006, 2010 Free Software Foundation, Inc. + Copyright (C) 2006, 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 @@ -31,7 +31,6 @@ @ emit debug information with cfi @ use arm-specific pseudos for unwinding itself .cfi_sections .debug_frame -#ifdef USE_TLS .hidden _dl_tlsdesc_return .global _dl_tlsdesc_return .type _dl_tlsdesc_return,#function @@ -218,5 +217,3 @@ _dl_tlsdesc_resolve_hold: .fnend cfi_endproc .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold - -#endif /* USE_TLS */ diff --git a/ports/sysdeps/arm/elf/configure b/ports/sysdeps/arm/elf/configure index 150de0c61..32018cb1a 100644 --- a/ports/sysdeps/arm/elf/configure +++ b/ports/sysdeps/arm/elf/configure @@ -1,7 +1,6 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/arm/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. { $as_echo "$as_me:$LINENO: checking for ARM TLS support" >&5 @@ -34,12 +33,10 @@ rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $libc_cv_arm_tls" >&5 $as_echo "$libc_cv_arm_tls" >&6; } -if test $libc_cv_arm_tls = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_TLS_SUPPORT 1 -_ACEOF - -fi +if test $libc_cv_arm_tls = no; then + { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5 +$as_echo "$as_me: error: the assembler must support TLS" >&2;} + { (exit 1); exit 1; }; } fi #AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/ports/sysdeps/arm/elf/configure.in b/ports/sysdeps/arm/elf/configure.in index 104529677..123a32186 100644 --- a/ports/sysdeps/arm/elf/configure.in +++ b/ports/sysdeps/arm/elf/configure.in @@ -1,7 +1,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/arm/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. AC_CACHE_CHECK(for ARM TLS support, libc_cv_arm_tls, [dnl @@ -23,9 +22,8 @@ else libc_cv_arm_tls=no fi rm -f conftest*]) -if test $libc_cv_arm_tls = yes; then - AC_DEFINE(HAVE_TLS_SUPPORT) -fi +if test $libc_cv_arm_tls = no; then + AC_MSG_ERROR([the assembler must support TLS]) fi dnl It is always possible to access static and hidden symbols in an diff --git a/ports/sysdeps/arm/libc-tls.c b/ports/sysdeps/arm/libc-tls.c index affb1899e..a6271bb3b 100644 --- a/ports/sysdeps/arm/libc-tls.c +++ b/ports/sysdeps/arm/libc-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. ARM version. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 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 @@ -20,8 +20,6 @@ #include <csu/libc-tls.c> #include <dl-tls.h> -#if USE_TLS - /* On ARM, 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 @@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti) dtv_t *dtv = THREAD_DTV (); return (char *) dtv[1].pointer.val + ti->ti_offset; } - -#endif diff --git a/ports/sysdeps/arm/nptl/tls.h b/ports/sysdeps/arm/nptl/tls.h index f257b93fe..16c970643 100644 --- a/ports/sysdeps/arm/nptl/tls.h +++ b/ports/sysdeps/arm/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/ARM version. - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 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 @@ -43,14 +43,6 @@ typedef union dtv #endif /* __ASSEMBLER__ */ -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - -/* Signal that TLS support is available. */ -# define USE_TLS 1 - #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/ports/sysdeps/arm/tlsdesc.c b/ports/sysdeps/arm/tlsdesc.c index e0b970f00..811d66b83 100644 --- a/ports/sysdeps/arm/tlsdesc.c +++ b/ports/sysdeps/arm/tlsdesc.c @@ -1,5 +1,5 @@ /* Manage TLS descriptors. ARM version. - Copyright (C) 2005, 2010 Free Software Foundation, Inc. + Copyright (C) 2005, 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 @@ -24,8 +24,6 @@ #include <dl-tlsdesc.h> #include <tlsdeschtab.h> -#ifdef USE_TLS - /* This function is used to lazily resolve TLS_DESC REL relocations Besides the TLS descriptor itself, we get the module's got address as the second parameter. */ @@ -161,4 +159,3 @@ _dl_unmap (struct link_map *map) htab_delete (map->l_mach.tlsdesc_table); #endif } -#endif diff --git a/ports/sysdeps/arm/tlsdesc.sym b/ports/sysdeps/arm/tlsdesc.sym index a1deb2117..3f3a13e2c 100644 --- a/ports/sysdeps/arm/tlsdesc.sym +++ b/ports/sysdeps/arm/tlsdesc.sym @@ -7,13 +7,9 @@ -- -- Abuse tls.h macros to derive offsets relative to the thread register. -#if defined USE_TLS - TLSDESC_ARG offsetof(struct tlsdesc, argument.pointer) TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count) TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module) TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset) - -#endif diff --git a/ports/sysdeps/cris/dl-machine.h b/ports/sysdeps/cris/dl-machine.h index 368733e73..cc3701e59 100644 --- a/ports/sysdeps/cris/dl-machine.h +++ b/ports/sysdeps/cris/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. CRIS version. - Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002, 2003, 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 @@ -285,7 +285,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, static inline void elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -378,7 +378,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, static inline void elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); diff --git a/ports/sysdeps/hppa/dl-machine.h b/ports/sysdeps/hppa/dl-machine.h index e462fd335..72dba8f20 100644 --- a/ports/sysdeps/hppa/dl-machine.h +++ b/ports/sysdeps/hppa/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version. - Copyright (C) 1995-1997,1999-2003 + Copyright (C) 1995-1997,1999-2003,2011 Free Software Foundation, Inc. Contributed by David Huggins-Daines <dhd@debian.org> This file is part of the GNU C Library. @@ -33,19 +33,19 @@ #include <abort-instr.h> #include <tls.h> -/* These two definitions must match the definition of the stub in +/* These two definitions must match the definition of the stub in bfd/elf32-hppa.c (see plt_stub[]). - + a. Define the size of the *entire* stub we place at the end of the PLT table (right up against the GOT). - + b. Define the number of bytes back from the GOT to the entry point of the PLT stub. You see the PLT stub must be entered in the middle - so it can depwi to find it's own address (long jump stub) - + so it can depwi to find it's own address (long jump stub) + c. Define the size of a single PLT entry so we can jump over the last entry to get the stub address */ - + #define SIZEOF_PLT_STUB (7*4) #define GOT_FROM_PLT_STUB (4*4) #define PLT_ENTRY_SIZE (2*4) @@ -110,8 +110,8 @@ elf_machine_load_address (void) return dynamic - elf_machine_dynamic (); } -/* Fixup a PLT entry to bounce directly to the function at VALUE. */ -static inline struct fdesc __attribute__ ((always_inline)) +/* Fixup a PLT entry to bounce directly to the function at VALUE. */ +static inline struct fdesc __attribute__ ((always_inline)) elf_machine_fixup_plt (struct link_map *map, lookup_t t, const Elf32_Rela *reloc, Elf32_Addr *reloc_addr, struct fdesc value) @@ -127,7 +127,7 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t t, } /* Return the final value of a plt relocation. */ -static inline struct fdesc +static inline struct fdesc elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, struct fdesc value) { @@ -149,106 +149,106 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) unsigned char c[8]; Elf32_Addr i[2]; } sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}}; - + /* If we don't have a PLT we can just skip all this... */ if (__builtin_expect (l->l_info[DT_JMPREL] == NULL,0)) return lazy; - - /* All paths use these values */ + + /* All paths use these values */ l_addr = l->l_addr; jmprel = D_PTR(l, l_info[DT_JMPREL]); end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val; - + extern void _dl_runtime_resolve (void); extern void _dl_runtime_profile (void); - + /* Linking lazily */ if (lazy) { /* FIXME: Search for the got, but backwards through the relocs, technically we should - find it on the first try. However, assuming the relocs got out of order the - routine is made a bit more robust by searching them all in case of failure. */ + find it on the first try. However, assuming the relocs got out of order the + routine is made a bit more robust by searching them all in case of failure. */ for (iplt = (end_jmprel - sizeof(Elf32_Rela)); iplt >= jmprel; iplt -= sizeof (Elf32_Rela)) - { - + { + reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); + r_type = ELF32_R_TYPE (reloc->r_info); + r_sym = ELF32_R_SYM (reloc->r_info); - got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB); + got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB); - /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */ - if (__builtin_expect (r_type != R_PARISC_IPLT, 0)) + /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */ + if (__builtin_expect (r_type != R_PARISC_IPLT, 0)) { if (__builtin_expect (r_type != R_PARISC_NONE, 0)) - _dl_reloc_bad_type (l, r_type, 1); + _dl_reloc_bad_type (l, r_type, 1); continue; } - - /* Check for the plt_stub that binutils placed here for us - to use with _dl_runtime_resolve */ - if (got[-2] != sig.i[0] || got[-1] != sig.i[1]) - { - got = NULL; /* Not the stub... keep looking */ - } - else + + /* Check for the plt_stub that binutils placed here for us + to use with _dl_runtime_resolve */ + if (got[-2] != sig.i[0] || got[-1] != sig.i[1]) + { + got = NULL; /* Not the stub... keep looking */ + } + else { - /* Found the GOT! */ - register Elf32_Addr ltp __asm__ ("%r19"); - - /* Identify this shared object. Second entry in the got. */ - got[1] = (Elf32_Addr) l; - - /* This function will be called to perform the relocation. */ - if (__builtin_expect (!profile, 1)) - { - /* If a static application called us, then _dl_runtime_resolve is not + /* Found the GOT! */ + register Elf32_Addr ltp __asm__ ("%r19"); + + /* Identify this shared object. Second entry in the got. */ + got[1] = (Elf32_Addr) l; + + /* This function will be called to perform the relocation. */ + if (__builtin_expect (!profile, 1)) + { + /* If a static application called us, then _dl_runtime_resolve is not a function descriptor, but the *real* address of the function... */ if((unsigned long) &_dl_runtime_resolve & 3) { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_resolve & ~3))->ip; + got[-2] = (Elf32_Addr) ((struct fdesc *) + ((unsigned long) &_dl_runtime_resolve & ~3))->ip; } else { /* Static executable! */ - got[-2] = (Elf32_Addr) &_dl_runtime_resolve; + got[-2] = (Elf32_Addr) &_dl_runtime_resolve; } - } - else - { - if (GLRO(dl_profile) != NULL + } + else + { + if (GLRO(dl_profile) != NULL && _dl_name_match_p (GLRO(dl_profile), l)) - { + { /* This is the object we are looking for. Say that - we really want profiling and the timers are - started. */ - GL(dl_profile_map) = l; - } + we really want profiling and the timers are + started. */ + GL(dl_profile_map) = l; + } if((unsigned long) &_dl_runtime_profile & 3) { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_profile & ~3))->ip; + got[-2] = (Elf32_Addr) ((struct fdesc *) + ((unsigned long) &_dl_runtime_profile & ~3))->ip; } else { /* Static executable */ - got[-2] = (Elf32_Addr) &_dl_runtime_profile; + got[-2] = (Elf32_Addr) &_dl_runtime_profile; } - } - /* Plunk in the gp of this function descriptor so we - can make the call to _dl_runtime_xxxxxx */ - got[-1] = ltp; - break; - /* Done looking for the GOT, and stub is setup */ - } /* else we found the GOT */ - } /* for, walk the relocs backwards */ - - if(!got) - return 0; /* No lazy linking for you! */ - - /* Process all the relocs, now that we know the GOT... */ + } + /* Plunk in the gp of this function descriptor so we + can make the call to _dl_runtime_xxxxxx */ + got[-1] = ltp; + break; + /* Done looking for the GOT, and stub is setup */ + } /* else we found the GOT */ + } /* for, walk the relocs backwards */ + + if(!got) + return 0; /* No lazy linking for you! */ + + /* Process all the relocs, now that we know the GOT... */ for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) { reloc = (const Elf32_Rela *) iplt; @@ -276,25 +276,25 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); } } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ + } /* for all the relocations */ } /* if lazy */ else { for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) - { - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1)) - { - fptr = (struct fdesc *) (reloc->r_offset + l_addr); - /* Relocate this *ABS* entry, set only the gp, the rest is set later - when elf_machine_rela_relative is called (WITHOUT the linkmap) */ - fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); - } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ - } + { + reloc = (const Elf32_Rela *) iplt; + r_type = ELF32_R_TYPE (reloc->r_info); + r_sym = ELF32_R_SYM (reloc->r_info); + + if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1)) + { + fptr = (struct fdesc *) (reloc->r_offset + l_addr); + /* Relocate this *ABS* entry, set only the gp, the rest is set later + when elf_machine_rela_relative is called (WITHOUT the linkmap) */ + fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); + } /* r_type == R_PARISC_IPLT */ + } /* for all the relocations */ + } return lazy; } @@ -441,7 +441,7 @@ asm ( \ " ldw -44(%sp),%r24\n" \ \ /* _dl_fini is a local function in the loader, so we construct \ - a false OPD here and pass this to the application. */ \ + a false OPD here and pass this to the application. */ \ /* FIXME: Should be able to use P%, and LR RR to have the \ the linker construct a proper OPD. */ \ " .section .data\n" \ @@ -462,7 +462,7 @@ asm ( \ " depi 2,31,2,%r23\n" /* delay slot */ \ ); -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or a TLS variable, so 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. */ @@ -505,7 +505,7 @@ dl_platform_init (void) /* Avoid an empty string which would disturb us. */ GLRO(dl_platform) = NULL; } - + #endif /* !dl_machine_h */ /* These are only actually used where RESOLVE_MAP is defined, anyway. */ @@ -523,11 +523,12 @@ dl_platform_init (void) | (((as14) & 0x2000) >> 13)) auto void __attribute__((always_inline)) -elf_machine_rela (struct link_map *map, +elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, - const Elf32_Sym *sym, + const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, + int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const Elf32_Sym *const refsym = sym; @@ -557,7 +558,7 @@ elf_machine_rela (struct link_map *map, # else sym_map = RESOLVE_MAP (&sym, version, r_type); # endif - + if (sym_map) { value = sym ? sym_map->l_addr + sym->st_value : 0; @@ -584,7 +585,7 @@ elf_machine_rela (struct link_map *map, case R_PARISC_DIR21L: { unsigned int insn = *(unsigned int *)reloc_addr; - value = sym_map->l_addr + sym->st_value + value = sym_map->l_addr + sym->st_value + ((reloc->r_addend + 0x1000) & -0x2000); value = value >> 11; insn = (insn &~ 0x1fffff) | reassemble_21 (value); @@ -595,7 +596,7 @@ elf_machine_rela (struct link_map *map, case R_PARISC_DIR14R: { unsigned int insn = *(unsigned int *)reloc_addr; - value = ((sym_map->l_addr + sym->st_value) & 0x7ff) + value = ((sym_map->l_addr + sym->st_value) & 0x7ff) + (((reloc->r_addend & 0x1fff) ^ 0x1000) - 0x1000); insn = (insn &~ 0x3fff) | reassemble_14 (value); *(unsigned int *)reloc_addr = insn; @@ -604,17 +605,17 @@ elf_machine_rela (struct link_map *map, case R_PARISC_PLABEL32: /* Easy rule: If there is a symbol and it is global, then we - need to make a dynamic function descriptor. Otherwise we - have the address of a PLT slot for a local symbol which we - know to be unique. */ + need to make a dynamic function descriptor. Otherwise we + have the address of a PLT slot for a local symbol which we + know to be unique. */ if (sym == NULL || sym_map == NULL || ELF32_ST_BIND (sym->st_info) == STB_LOCAL) - { + { break; - } + } /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. - We have to do this outside of the generic function descriptor + We have to do this outside of the generic function descriptor code, since it doesn't know about our requirement for setting protection bits */ value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2); @@ -625,17 +626,17 @@ elf_machine_rela (struct link_map *map, { unsigned int insn = *(unsigned int *)reloc_addr; - if (__builtin_expect (sym == NULL, 0)) - break; + if (__builtin_expect (sym == NULL, 0)) + break; - value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2); + value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2); - if (r_type == R_PARISC_PLABEL21L) + if (r_type == R_PARISC_PLABEL21L) { value >>= 11; insn = (insn &~ 0x1fffff) | reassemble_21 (value); } - else + else { value &= 0x7ff; insn = (insn &~ 0x3fff) | reassemble_14 (value); @@ -647,16 +648,16 @@ elf_machine_rela (struct link_map *map, case R_PARISC_IPLT: if (__builtin_expect (sym_map != NULL, 1)) - { - elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, + { + elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, DL_FIXUP_MAKE_VALUE(sym_map, value)); - } - else - { + } + else + { /* If we get here, it's a (weak) undefined sym. */ - elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, + elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, DL_FIXUP_MAKE_VALUE(map, value)); - } + } return; case R_PARISC_COPY: @@ -687,21 +688,21 @@ elf_machine_rela (struct link_map *map, case R_PARISC_TLS_DTPOFF32: /* During relocation all TLS symbols are defined and used. - Therefore the offset is already correct. */ + Therefore the offset is already correct. */ if (sym != NULL) - *reloc_addr = sym->st_value; + *reloc_addr = sym->st_value; return; case R_PARISC_TLS_TPREL32: /* The offset is negative, forward from the thread pointer */ if (sym != NULL) - { - CHECK_STATIC_TLS (map, sym_map); + { + CHECK_STATIC_TLS (map, sym_map); value = sym_map->l_tls_offset + sym->st_value + reloc->r_addend; } break; #endif /* use TLS */ - + case R_PARISC_NONE: /* Alright, Wilbur. */ return; @@ -721,13 +722,13 @@ elf_machine_rela_relative (Elf32_Addr l_addr, { unsigned long const r_type = ELF32_R_TYPE (reloc->r_info); Elf32_Addr *const reloc_addr = reloc_addr_arg; - static char msgbuf[] = { "Unknown" }; + static char msgbuf[] = { "Unknown" }; struct link_map map; Elf32_Addr value; value = l_addr + reloc->r_addend; - if (ELF32_R_SYM (reloc->r_info) != 0){ + if (ELF32_R_SYM (reloc->r_info) != 0){ _dl_error_printf ("%s: In elf_machine_rela_relative " "ELF32_R_SYM (reloc->r_info) != 0. Aborting.", rtld_progname ?: "<program name unknown>"); @@ -769,7 +770,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, auto void __attribute__((always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { /* We don't have anything to do here. elf_machine_runtime_setup has done all the relocs already. */ diff --git a/ports/sysdeps/hppa/dl-tls.h b/ports/sysdeps/hppa/dl-tls.h index 1bc9aae66..91c3d4473 100644 --- a/ports/sysdeps/hppa/dl-tls.h +++ b/ports/sysdeps/hppa/dl-tls.h @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. hppa version. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 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 @@ -27,3 +27,6 @@ typedef struct extern void *__tls_get_addr (tls_index *ti); + +/* Value used for dtv entries for which the allocation is delayed. */ +#define TLS_DTV_UNALLOCATED ((void *) -1l) diff --git a/ports/sysdeps/hppa/elf/configure b/ports/sysdeps/hppa/elf/configure index 0e89b7d39..e0aa9701a 100644 --- a/ports/sysdeps/hppa/elf/configure +++ b/ports/sysdeps/hppa/elf/configure @@ -1,7 +1,6 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/hppa/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. { $as_echo "$as_me:$LINENO: checking for hppa TLS support" >&5 @@ -54,10 +53,8 @@ rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $libc_cv_hppa_tls" >&5 $as_echo "$libc_cv_hppa_tls" >&6; } -if test $libc_cv_hppa_tls = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_TLS_SUPPORT 1 -_ACEOF - -fi +if test $libc_cv_hppa_tls = no; then + { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5 +$as_echo "$as_me: error: the assembler must support TLS" >&2;} + { (exit 1); exit 1; }; } fi diff --git a/ports/sysdeps/hppa/elf/configure.in b/ports/sysdeps/hppa/elf/configure.in index 1b70a5b74..e31c880c1 100644 --- a/ports/sysdeps/hppa/elf/configure.in +++ b/ports/sysdeps/hppa/elf/configure.in @@ -1,7 +1,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/hppa/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. AC_CACHE_CHECK(for hppa TLS support, libc_cv_hppa_tls, [dnl @@ -43,7 +42,6 @@ else libc_cv_hppa_tls=no fi rm -f conftest*]) -if test $libc_cv_hppa_tls = yes; then - AC_DEFINE(HAVE_TLS_SUPPORT) -fi +if test $libc_cv_hppa_tls = no; then + AC_MSG_ERROR([the assembler must support TLS]) fi diff --git a/ports/sysdeps/hppa/fpu/fegetenv.c b/ports/sysdeps/hppa/fpu/fegetenv.c index fcf5d2dcf..aab3431b2 100644 --- a/ports/sysdeps/hppa/fpu/fegetenv.c +++ b/ports/sysdeps/hppa/fpu/fegetenv.c @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Huggins-Daines <dhd@debian.org>, 2000 @@ -33,3 +33,4 @@ fegetenv (fenv_t *envp) memcpy(envp, buf, sizeof (*envp)); return 0; } +libm_hidden_def (fegetenv) diff --git a/ports/sysdeps/hppa/fpu/feupdateenv.c b/ports/sysdeps/hppa/fpu/feupdateenv.c index 17140060a..6e1d5d4b6 100644 --- a/ports/sysdeps/hppa/fpu/feupdateenv.c +++ b/ports/sysdeps/hppa/fpu/feupdateenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment and raise exceptions. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Huggins-Daines <dhd@debian.org>, 2000 @@ -38,3 +38,4 @@ feupdateenv (const fenv_t *envp) /* Success. */ return 0; } +libm_hidden_def (feupdateenv) diff --git a/ports/sysdeps/hppa/fpu/ftestexcept.c b/ports/sysdeps/hppa/fpu/ftestexcept.c index ac6d4b2e3..c031ffe6e 100644 --- a/ports/sysdeps/hppa/fpu/ftestexcept.c +++ b/ports/sysdeps/hppa/fpu/ftestexcept.c @@ -1,5 +1,5 @@ /* Test exception in current environment. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Huggins-Daines <dhd@debian.org>, 2000 @@ -32,3 +32,4 @@ fetestexcept (int excepts) return (s.sw[0] >> 27) & excepts & FE_ALL_EXCEPT; } +libm_hidden_def (fetestexcept) diff --git a/ports/sysdeps/hppa/linuxthreads/pspinlock.c b/ports/sysdeps/hppa/linuxthreads/pspinlock.c deleted file mode 100644 index e5a554522..000000000 --- a/ports/sysdeps/hppa/linuxthreads/pspinlock.c +++ /dev/null @@ -1,82 +0,0 @@ -/* POSIX spinlock implementation. hppa version. - Copyright (C) 2000 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <errno.h> -#include <pthread.h> -#include "internals.h" - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - volatile unsigned int *addr = __ldcw_align (lock); - - while (__ldcw (addr) == 0) - while (*addr == 0) ; - - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - volatile unsigned int *a = __ldcw_align (lock); - - return __ldcw (a) ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - volatile unsigned int *a = __ldcw_align (lock); - int tmp = 1; - /* This should be a memory barrier to newer compilers */ - __asm__ __volatile__ ("stw,ma %1,0(%0)" - : : "r" (a), "r" (tmp) : "memory"); - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - volatile unsigned int *a = __ldcw_align (lock); - int tmp = 1; - /* This should be a memory barrier to newer compilers */ - __asm__ __volatile__ ("stw,ma %1,0(%0)" - : : "r" (a), "r" (tmp) : "memory"); - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/ports/sysdeps/hppa/linuxthreads/pt-machine.h b/ports/sysdeps/hppa/linuxthreads/pt-machine.h deleted file mode 100644 index f35523f0f..000000000 --- a/ports/sysdeps/hppa/linuxthreads/pt-machine.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - hppa version. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson <rth@tamu.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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#include <sys/types.h> -#include <bits/initspin.h> - -#ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) -#endif - -extern inline long int testandset (__atomic_lock_t *spinlock); -extern inline int __compare_and_swap (long int *p, long int oldval, long int newval); -extern inline int lock_held (__atomic_lock_t *spinlock); -extern inline int __load_and_clear (__atomic_lock_t *spinlock); - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME stack_pointer -register char * stack_pointer __asm__ ("%r30"); - -/* Get/Set thread-specific pointer. We have to call into the kernel to - * modify it, but we can read it in user mode. */ -#ifndef THREAD_SELF -#define THREAD_SELF __get_cr27() -#endif - -#ifndef SET_THREAD_SELF -#define SET_THREAD_SELF(descr) __set_cr27(descr) -#endif -/* Use this to determine type */ -struct _pthread_descr_struct *__thread_self; - -static inline struct _pthread_descr_struct * __get_cr27(void) -{ - long cr27; - asm ("mfctl %%cr27, %0" : "=r" (cr27) : ); - return (struct _pthread_descr_struct *) cr27; -} - -#ifndef INIT_THREAD_SELF -#define INIT_THREAD_SELF(descr, nr) __set_cr27(descr) -#endif - -static inline void __set_cr27(struct _pthread_descr_struct * cr27) -{ - asm ( "ble 0xe0(%%sr2, %%r0)\n\t" - "copy %0, %%r26" - : : "r" (cr27) : "r26" ); -} - -/* We want the OS to assign stack addresses. */ -#define FLOATING_STACKS 1 -#define ARCH_STACK_MAX_SIZE 8*1024*1024 - -/* The hppa only has one atomic read and modify memory operation, - load and clear, so hppa spinlocks must use zero to signify that - someone is holding the lock. The address used for the ldcw - semaphore must be 16-byte aligned. */ -#define __ldcw(a) \ -({ \ - unsigned int __ret; \ - __asm__ __volatile__("ldcw 0(%1),%0" \ - : "=r" (__ret) : "r" (a) : "memory"); \ - __ret; \ -}) - -/* Strongly ordered lock reset */ -#define __lock_reset(lock_addr, tmp) \ -({ \ - __asm__ __volatile__ ("stw,ma %1,0(%0)" \ - : : "r" (lock_addr), "r" (tmp) : "memory"); \ -}) - -/* Because malloc only guarantees 8-byte alignment for malloc'd data, - and GCC only guarantees 8-byte alignment for stack locals, we can't - be assured of 16-byte alignment for atomic lock data even if we - specify "__attribute ((aligned(16)))" in the type declaration. So, - we use a struct containing an array of four ints for the atomic lock - type and dynamically select the 16-byte aligned int from the array - for the semaphore. */ -#define __PA_LDCW_ALIGNMENT 16 -#define __ldcw_align(a) ({ \ - volatile unsigned int __ret = (unsigned int) a; \ - if ((__ret & ~(__PA_LDCW_ALIGNMENT - 1)) < (unsigned int) a) \ - __ret = (__ret & ~(__PA_LDCW_ALIGNMENT - 1)) + __PA_LDCW_ALIGNMENT; \ - (unsigned int *) __ret; \ -}) - -/* Spinlock implementation; required. */ -PT_EI int -__load_and_clear (__atomic_lock_t *spinlock) -{ - volatile unsigned int *a = __ldcw_align (spinlock); - - return __ldcw (a); -} - -/* Emulate testandset */ -PT_EI long int -testandset (__atomic_lock_t *spinlock) -{ - return (__load_and_clear(spinlock) == 0); -} - -PT_EI int -lock_held (__atomic_lock_t *spinlock) -{ - volatile unsigned int *a = __ldcw_align (spinlock); - - return *a == 0; -} - -#endif /* pt-machine.h */ diff --git a/ports/sysdeps/hppa/linuxthreads/tls.h b/ports/sysdeps/hppa/linuxthreads/tls.h deleted file mode 100644 index 3d33a1892..000000000 --- a/ports/sysdeps/hppa/linuxthreads/tls.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Definition for thread-local data handling. linuxthreads/hppa version. - Copyright (C) 2005 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 _TLS_H -#define _TLS_H - -#ifndef __ASSEMBLER__ -# include <pt-machine.h> -# include <stdbool.h> -# include <stddef.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__ */ - - -#if defined HAVE_TLS_SUPPORT - -/* Signal that TLS support is available. */ -# define USE_TLS 1 - -# ifndef __ASSEMBLER__ - -typedef struct -{ - dtv_t *dtv; - void *private; -} tcbhead_t; - -/* Include some syscall information for other headers */ -# include <sysdep.h> - -/* This is the size of the initial TCB. */ -# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (tcbhead_t) - -/* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) - -/* The TLS blocks start right after the TCB. */ -# define TLS_DTV_AT_TP 1 - -/* Return the thread descriptor for the current thread. */ -# undef THREAD_SELF -# define THREAD_SELF \ - ({ struct _pthread_descr_struct *__self; \ - __self = __get_cr27(); \ - __self - 1; \ - }) - -# undef INIT_THREAD_SELF -# define INIT_THREAD_SELF(descr, nr) \ - ({ struct _pthread_descr_struct *__self = (void *)descr; \ - __set_cr27(__self + 1); \ - 0; \ - }) - -/* Access to data in the thread descriptor is easy. */ -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* 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))->dtv = dtvp + 1 - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(dtv) \ - ({ tcbhead_t *__tcbp = (tcbhead_t *)__get_cr27(); \ - __tcbp->dtv = dtv; \ - }) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(tcbp) \ - (((tcbhead_t *) (tcbp))->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) \ - ({ __set_cr27(tcbp); 0; }) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - ({ tcbhead_t *__tcbp = (tcbhead_t *)__get_cr27(); \ - __tcbp->dtv; \ - }) - -# define TLS_MULTIPLE_THREADS_IN_TCB 1 - -/* Get the thread descriptor definition. This must be after the - the definition of THREAD_SELF for TLS. */ -# include <linuxthreads/descr.h> - -# endif /* __ASSEMBLER__ */ - -#else - -# ifndef __ASSEMBLER__ - -typedef struct -{ - void *tcb; - dtv_t *dtv; - void *self; - int multiple_threads; -} tcbhead_t; - -/* Get the thread descriptor definition. */ -# include <linuxthreads/descr.h> - -# define NONTLS_INIT_TP \ - do { \ - static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 }; \ - INIT_THREAD_SELF(&nontls_init_tp, 0); \ - } while (0) - -# endif /* __ASSEMBLER__ */ - -#endif /* HAVE_TLS_SUPPORT */ - -#endif /* tls.h */ diff --git a/ports/sysdeps/hppa/nptl/tls.h b/ports/sysdeps/hppa/nptl/tls.h index 389cbb949..8af75044c 100644 --- a/ports/sysdeps/hppa/nptl/tls.h +++ b/ports/sysdeps/hppa/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/hppa version. - Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 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 @@ -42,12 +42,6 @@ typedef union dtv # include <tcb-offsets.h> #endif /* __ASSEMBLER__ */ - -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - /* Signal that TLS support is available. */ #define USE_TLS 1 diff --git a/ports/sysdeps/hppa/stackinfo.h b/ports/sysdeps/hppa/stackinfo.h index 318de7143..44929c46a 100644 --- a/ports/sysdeps/hppa/stackinfo.h +++ b/ports/sysdeps/hppa/stackinfo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 1999, 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 @@ -22,6 +22,12 @@ #ifndef _STACKINFO_H #define _STACKINFO_H 1 +#include <elf.h> + +/* 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) + /* On PA the stack grows up. */ #define _STACK_GROWS_UP 1 diff --git a/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c b/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c index a160308bf..b6c67e89a 100644 --- a/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c +++ b/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 Free Software Foundation, Inc. +/* Copyright (C) 2006, 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 @@ -22,3 +22,4 @@ __ieee754_sqrt (double x) asm ("fdsqrt.d %1,%0" : "=f" (x) : "fm" (x)); return x; } +strong_alias (__ieee754_sqrt, __sqrt_finite) diff --git a/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c b/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c index 7cfc0dd65..e0481b805 100644 --- a/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c +++ b/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 Free Software Foundation, Inc. +/* Copyright (C) 2006, 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 @@ -23,3 +23,4 @@ __ieee754_sqrtf (float x) asm ("fssqrt.s %1,%0" : "=f" (result) : "dm" (x)); return result; } +strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/ports/sysdeps/m68k/dl-machine.h b/ports/sysdeps/m68k/dl-machine.h index 9bc35e769..51272125d 100644 --- a/ports/sysdeps/m68k/dl-machine.h +++ b/ports/sysdeps/m68k/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. m68k version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010 + Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -211,7 +211,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, auto inline void __attribute__ ((unused, always_inline)) elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -269,7 +269,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, case R_68K_PC32: *reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr; break; -#if defined USE_TLS && !defined RTLD_BOOTSTRAP +#ifndef RTLD_BOOTSTRAP case R_68K_TLS_DTPMOD32: /* Get the information from the link map returned by the resolv function. */ @@ -287,7 +287,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, *reloc_addr = TLS_TPREL_VALUE (sym_map, sym, reloc); } break; -#endif /* defined USE_TLS && !defined RTLD_BOOTSTRAP */ +#endif /* !RTLD_BOOTSTRAP */ case R_68K_NONE: /* Alright, Wilbur. */ break; default: @@ -307,7 +307,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, auto inline void __attribute__ ((unused, always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); if (ELF32_R_TYPE (reloc->r_info) == R_68K_JMP_SLOT) diff --git a/ports/sysdeps/m68k/libc-tls.c b/ports/sysdeps/m68k/libc-tls.c index e865fac16..b16eac21e 100644 --- a/ports/sysdeps/m68k/libc-tls.c +++ b/ports/sysdeps/m68k/libc-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. m68k version. - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. @@ -21,8 +21,6 @@ #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 @@ -34,5 +32,3 @@ __tls_get_addr (tls_index *ti) dtv_t *dtv = THREAD_DTV (); return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET; } - -#endif diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acos.c b/ports/sysdeps/m68k/m680x0/fpu/e_acos.c index c9f6c6a16..5afa8bd9c 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_acos.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_acos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 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 @@ -21,10 +21,11 @@ #include "mathimpl.h" #ifndef FUNC -#define FUNC __ieee754_acos +# define FUNC __ieee754_acos +# define FUNC_FINITE __acos_finite #endif #ifndef float_type -#define float_type double +# define float_type double #endif float_type @@ -33,3 +34,6 @@ FUNC (x) { return __m81_u(FUNC)(x); } +#ifdef FUNC_FINITE +strong_alias (FUNC, FUNC_FINITE) +#endif diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c b/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c index 90665082d..300fff601 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c @@ -1,5 +1,6 @@ #ifndef FUNC -#define FUNC __ieee754_acosf +# define FUNC __ieee754_acosf +# define FUNC_FINITE __acosf_finite #endif #define float_type float #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c b/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c index e3dcd170f..35767f4e2 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c @@ -1,5 +1,6 @@ #ifndef FUNC -#define FUNC __ieee754_acosl +# define FUNC __ieee754_acosl +# define FUNC_FINITE __acosl_finite #endif #define float_type long double #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asin.c b/ports/sysdeps/m68k/m680x0/fpu/e_asin.c index b6176c708..271a1f23d 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_asin.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_asin.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_asin +#define FUNC_FINITE __asin_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c b/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c index 05fb82670..ece691c6f 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_asinf +#define FUNC __ieee754_asinf +#define FUNC_FINITE __asinf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c b/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c index 0dd89fb9d..0c136f30e 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_asinl +#define FUNC_FINITE __asinl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c b/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c index 551b14db8..ac5982eab 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 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 @@ -102,3 +102,4 @@ s(__ieee754_atan2) (float_type y, float_type x) } return z; } +strong_alias (s(__ieee754_atan2), CONCATX (s (__atan2), _finite)) diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c index 11bf43068..f5f7e7b52 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_atanh +#define FUNC __ieee754_atanh +#define FUNC_FINITE __atanh_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c index 7a8f92ecf..cb464cbb7 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_atanhf +#define FUNC __ieee754_atanhf +#define FUNC_FINITE __atanhf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c index d8975d678..8f276f5fa 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_atanhl +#define FUNC_FINITE __atanhl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c b/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c index 93d753c51..aaba11be3 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_cosh +#define FUNC __ieee754_cosh +#define FUNC_FINITE __cosh_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c b/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c index 433faf17b..0884741c5 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_coshf +#define FUNC __ieee754_coshf +#define FUNC_FINITE __coshf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c b/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c index 39144fd20..7fc9b7b91 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_coshl +#define FUNC_FINITE __coshl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp.c index 1e95ac474..9f228034a 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_exp +#define FUNC __ieee754_exp +#define FUNC_FINITE __exp_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c index a1dd22447..e66a80599 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp10 +#define FUNC_FINITE __exp10_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c index 1b78bc372..7a3bdd418 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp10f +#define FUNC_FINITE __exp10f_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c index 5e901999f..e2a6255a7 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp10l +#define FUNC_FINITE __exp10l_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c index 24fac4fce..35e29ae65 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp2 +#define FUNC_FINITE __exp2_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c index 593842e4e..e57ddb536 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp2f +#define FUNC_FINITE __exp2f_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c index 0ab2a428c..c5854ae42 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_exp2l +#define FUNC_FINITE __exp2l_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_expf.c b/ports/sysdeps/m68k/m680x0/fpu/e_expf.c index 2aeaacfab..af1e01950 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_expf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_expf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_expf +#define FUNC __ieee754_expf +#define FUNC_FINITE __expf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_expl.c b/ports/sysdeps/m68k/m680x0/fpu/e_expl.c index 8805a1b83..543eb0edf 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_expl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_expl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_expl +#define FUNC_FINITE __expl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c index bd229ae4b..293d7214d 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 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 @@ -21,10 +21,11 @@ #include "mathimpl.h" #ifndef FUNC -#define FUNC __ieee754_fmod +# define FUNC __ieee754_fmod +# define FUNC_FINITE __fmod_finite #endif #ifndef float_type -#define float_type double +# define float_type double #endif float_type @@ -34,3 +35,6 @@ FUNC (x, y) { return __m81_u(FUNC)(x, y); } +#ifdef FUNC_FINITE +strong_alias (FUNC, FUNC_FINITE) +#endif diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c index 88c350ce9..38995c376 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c @@ -1,5 +1,6 @@ #ifndef FUNC -#define FUNC __ieee754_fmodf +# define FUNC __ieee754_fmodf +# define FUNC_FINITE __fmodf_finite #endif #define float_type float #include <e_fmod.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c index a46f19ea9..8d793b2de 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c @@ -1,5 +1,6 @@ #ifndef FUNC -#define FUNC __ieee754_fmodl +# define FUNC __ieee754_fmodl +# define FUNC_FINITE __fmodl_finite #endif #define float_type long double #include <e_fmod.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log.c b/ports/sysdeps/m68k/m680x0/fpu/e_log.c index 146dc0c78..628c62b31 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log +#define FUNC __ieee754_log +#define FUNC_FINITE __log_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10.c index 06a9b87cb..78e0693e9 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log10.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log10 +#define FUNC __ieee754_log10 +#define FUNC_FINITE __log10_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c index 3896864ec..452a75ec1 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log10f +#define FUNC __ieee754_log10f +#define FUNC_FINITE __log10f_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c index 6dcfc5a10..7c5dcb8e1 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_log10l +#define FUNC_FINITE __log10l_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2.c index 5528922b9..a00ddbdc9 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log2.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log2 +#define FUNC __ieee754_log2 +#define FUNC_FINITE __log2_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c index 6b4907686..670b69c8a 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log2f +#define FUNC __ieee754_log2f +#define FUNC_FINITE __log2f_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c index 4c92a11ac..4a97a0023 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_log2l +#define FUNC __ieee754_log2l +#define FUNC_FINITE __log2l_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_logf.c b/ports/sysdeps/m68k/m680x0/fpu/e_logf.c index bc23217c3..1989a9543 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_logf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_logf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_logf +#define FUNC __ieee754_logf +#define FUNC_FINITE __logf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_logl.c b/ports/sysdeps/m68k/m680x0/fpu/e_logl.c index 03b183075..9ab842c3f 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_logl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_logl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_logl +#define FUNC_FINITE __logl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_pow.c b/ports/sysdeps/m68k/m680x0/fpu/e_pow.c index 0b6cee6f1..1bded0b7b 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_pow.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_pow.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 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 @@ -124,3 +124,4 @@ s(__ieee754_pow) (float_type x, float_type y) z = m81(__ieee754_exp) (y * m81(__ieee754_log) (x)); return z; } +strong_alias (s(__ieee754_pow), CONCATX (s(__pow), _finite)) diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c index aa31bc011..f7732af8c 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_remainder +#define FUNC_FINITE __remainder_finite #include <e_fmod.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c index b04f0c87c..94b53e7a8 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_remainderf +#define FUNC_FINITE __remainderf_finite #include <e_fmodf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c index b9dc540cc..d5b59607a 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_remainderl +#define FUNC_FINITE __remainderl_finite #include <e_fmodl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c b/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c index 88edba1ca..c03fd671a 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. @@ -58,3 +58,4 @@ s(__ieee754_scalb) (float_type x, float_type fn) __asm ("fscale%.x %1, %0" : "=f" (retval) : "f" (fn), "0" (x)); return retval; } +strong_alias (s(__ieee754_scalb), CONCATX (s(__scalb), _finite)) diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c index c6fed7ff4..1e1b1c118 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_sinh +#define FUNC __ieee754_sinh +#define FUNC_FINITE __sinh_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c index b5034b7b0..13c79f9d9 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_sinhf +#define FUNC __ieee754_sinhf +#define FUNC_FINITE __sinhf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c index 2f42d96a3..47f0f2440 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_sinhl +#define FUNC_FINITE __sinhl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c index 70f19710c..9a250cbc2 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_sqrt +#define FUNC __ieee754_sqrt +#define FUNC_FINITE __sqrt_finite #include <e_acos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c index 5dc1904cb..372c3eb2f 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c @@ -1,2 +1,3 @@ -#define FUNC __ieee754_sqrtf +#define FUNC __ieee754_sqrtf +#define FUNC_FINITE __sqrtf_finite #include <e_acosf.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c index fede1024a..df5f44e6a 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c @@ -1,2 +1,3 @@ #define FUNC __ieee754_sqrtl +#define FUNC_FINITE __sqrtl_finite #include <e_acosl.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c deleted file mode 100644 index 823915964..000000000 --- a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Complex cosine function. m68k fpu version - Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - - 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 <complex.h> -#include <math.h> -#include "mathimpl.h" - -#ifndef SUFF -#define SUFF -#endif -#ifndef float_type -#define float_type double -#endif - -#define CONCATX(a,b) __CONCAT(a,b) -#define s(name) CONCATX(name,SUFF) -#define m81(func) __m81_u(s(func)) - -__complex__ float_type -s(__ccos) (__complex__ float_type x) -{ - __complex__ float_type retval; - unsigned long rx_cond = __m81_test (__real__ x); - - if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) - { - /* Real part is finite. */ - float_type sin_rx, cos_rx; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx) - : "f" (__real__ x)); - __real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x); - if (rx_cond & __M81_COND_ZERO) - __imag__ retval = (signbit (__imag__ x) - ? __real__ x : -__real__ x); - else - __imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x); - } - else - { - unsigned long ix_cond = __m81_test (__imag__ x); - - if (ix_cond & __M81_COND_INF) - __real__ retval = s(fabs) (__imag__ x); - else - __real__ retval = __real__ x - __real__ x; - if (ix_cond & __M81_COND_ZERO) - __imag__ retval = __imag__ x; - else - __imag__ retval = __real__ x - __real__ x; - } - - return retval; -} -#define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (s(__ccos), s(ccos)) diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c deleted file mode 100644 index f5e8a41fa..000000000 --- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF f -#define float_type float -#include <s_ccos.c> diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c deleted file mode 100644 index aaff36520..000000000 --- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SUFF l -#define float_type long double -#include <s_ccos.c> diff --git a/ports/sysdeps/m68k/m680x0/s_isinfl.c b/ports/sysdeps/m68k/m680x0/s_isinfl.c deleted file mode 100644 index 250203908..000000000 --- a/ports/sysdeps/m68k/m680x0/s_isinfl.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995, 1997, 2002 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 <math.h> -#include "ieee754.h" - -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -int -__isinfl (long double value) -{ - union ieee854_long_double u; - - u.d = value; - - /* An IEEE 854 infinity has an exponent with the - maximum possible value and a zero mantissa. - In Motorola's interpretation the integer bit is ignored. */ - if ((u.ieee.exponent & 0x7fff) == 0x7fff && - (u.ieee.mantissa0 & 0x7fffffff) == 0 && u.ieee.mantissa1 == 0) - return u.ieee.negative ? -1 : 1; - - return 0; -} - -hidden_def (__isinfl) -weak_alias (__isinfl, isinfl); diff --git a/ports/sysdeps/m68k/m680x0/s_isnanl.c b/ports/sysdeps/m68k/m680x0/s_isnanl.c deleted file mode 100644 index 999746f29..000000000 --- a/ports/sysdeps/m68k/m680x0/s_isnanl.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995, 1997, 2002 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 <math.h> -#include "ieee754.h" - -/* Return nonzero if VALUE is not a number. */ -int -__isnanl (long double value) -{ - union ieee854_long_double u; - - u.d = value; - - /* IEEE 854 NaN's have the maximum possible - exponent and a nonzero mantissa. In Motorola's - interpretation the integer bit is ignored. */ - return ((u.ieee.exponent & 0x7fff) == 0x7fff && - ((u.ieee.mantissa0 & 0x7fffffff) != 0 || u.ieee.mantissa1 != 0)); -} - -hidden_def (__isnanl) -weak_alias (__isnanl, isnanl); diff --git a/ports/sysdeps/m68k/nptl/tls.h b/ports/sysdeps/m68k/nptl/tls.h index c29824cfb..3c5b165d8 100644 --- a/ports/sysdeps/m68k/nptl/tls.h +++ b/ports/sysdeps/m68k/nptl/tls.h @@ -43,9 +43,6 @@ typedef union dtv # include <tcb-offsets.h> #endif /* __ASSEMBLER__ */ -/* Signal that TLS support is available. */ -#define USE_TLS 1 - #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/ports/sysdeps/mips/dl-machine.h b/ports/sysdeps/mips/dl-machine.h index e2c782afd..836c47f81 100644 --- a/ports/sysdeps/mips/dl-machine.h +++ b/ports/sysdeps/mips/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. MIPS version. - Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. @@ -343,7 +343,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, switch (r_type) { -#if defined (USE_TLS) && !defined (RTLD_BOOTSTRAP) +#if !defined (RTLD_BOOTSTRAP) # if _MIPS_SIM == _ABI64 case R_MIPS_TLS_DTPMOD64: case R_MIPS_TLS_DTPREL64: @@ -528,7 +528,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, strtab + refsym->st_name); } memcpy (reloc_addr, (void *) value, - MIN (sym->st_size, refsym->st_size)); + MIN (sym->st_size, refsym->st_size)); break; } @@ -559,7 +559,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) + void *const reloc_addr, int skip_ifunc) { elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info, sym, version, reloc_addr, 0, 1); @@ -576,7 +576,8 @@ elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, auto inline void __attribute__((always_inline)) elf_machine_lazy_rel (struct link_map *map, - ElfW(Addr) l_addr, const ElfW(Rel) *reloc) + ElfW(Addr) l_addr, const ElfW(Rel) *reloc, + int skip_ifunc) { ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info); @@ -599,7 +600,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, const ElfW(Sym) *sym, const struct r_found_version *version, - void *const reloc_addr) + void *const reloc_addr, int skip_ifunc) { elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info, sym, version, reloc_addr, reloc->r_addend, 0); @@ -627,7 +628,7 @@ elf_machine_got_rel (struct link_map *map, int lazy) ({ \ const ElfW(Sym) *ref = sym; \ const struct r_found_version *version \ - = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \ + = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \ struct link_map *sym_map; \ sym_map = RESOLVE_MAP (&ref, version, reloc); \ ref ? sym_map->l_addr + ref->st_value : 0; \ @@ -649,7 +650,7 @@ elf_machine_got_rel (struct link_map *map, int lazy) i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1; /* Add the run-time displacement to all local got entries if - needed. */ + needed. */ if (__builtin_expect (map->l_addr != 0, 0)) { while (i < n) diff --git a/ports/sysdeps/mips/elf/configure b/ports/sysdeps/mips/elf/configure index b1b3d0baf..bee99287d 100644 --- a/ports/sysdeps/mips/elf/configure +++ b/ports/sysdeps/mips/elf/configure @@ -1,7 +1,6 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/mips/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. { $as_echo "$as_me:$LINENO: checking for MIPS TLS support" >&5 @@ -36,11 +35,9 @@ rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $libc_cv_mips_tls" >&5 $as_echo "$libc_cv_mips_tls" >&6; } -if test $libc_cv_mips_tls = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_TLS_SUPPORT 1 -_ACEOF - -fi +if test $libc_cv_mips_tls = no; then + { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5 +$as_echo "$as_me: error: the assembler must support TLS" >&2;} + { (exit 1); exit 1; }; } fi diff --git a/ports/sysdeps/mips/elf/configure.in b/ports/sysdeps/mips/elf/configure.in index ecb9108c1..5cb5a742e 100644 --- a/ports/sysdeps/mips/elf/configure.in +++ b/ports/sysdeps/mips/elf/configure.in @@ -1,7 +1,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/mips/elf. -if test "$usetls" != no; then # Check for support of thread-local storage handling in assembler and # linker. AC_CACHE_CHECK(for MIPS TLS support, libc_cv_mips_tls, [dnl @@ -25,9 +24,8 @@ else libc_cv_mips_tls=no fi rm -f conftest*]) -if test $libc_cv_mips_tls = yes; then - AC_DEFINE(HAVE_TLS_SUPPORT) -fi +if test $libc_cv_mips_tls = no; then + AC_MSG_ERROR([the assembler must support TLS]) fi dnl No MIPS GCC supports accessing static and hidden symbols in an diff --git a/ports/sysdeps/mips/fpu/e_sqrt.c b/ports/sysdeps/mips/fpu/e_sqrt.c index 5449710af..d1a8afc3c 100644 --- a/ports/sysdeps/mips/fpu/e_sqrt.c +++ b/ports/sysdeps/mips/fpu/e_sqrt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. @@ -30,6 +30,7 @@ __ieee754_sqrt (double x) __asm__ ("sqrt.d %0,%1" : "=f" (z) : "f" (x)); return z; } +strong_alias (__ieee754_sqrt, __sqrt_finite) #else diff --git a/ports/sysdeps/mips/fpu/e_sqrtf.c b/ports/sysdeps/mips/fpu/e_sqrtf.c index 3590ad46d..da58b46f8 100644 --- a/ports/sysdeps/mips/fpu/e_sqrtf.c +++ b/ports/sysdeps/mips/fpu/e_sqrtf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. @@ -30,6 +30,7 @@ __ieee754_sqrtf (float x) __asm__ ("sqrt.s %0,%1" : "=f" (z) : "f" (x)); return z; } +strong_alias (__ieee754_sqrtf, __sqrtf_finite) #else diff --git a/ports/sysdeps/mips/libc-tls.c b/ports/sysdeps/mips/libc-tls.c index a3d6301d1..2c7805625 100644 --- a/ports/sysdeps/mips/libc-tls.c +++ b/ports/sysdeps/mips/libc-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 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 @@ -20,8 +20,6 @@ #include <csu/libc-tls.c> #include <dl-tls.h> -#if USE_TLS - /* On MIPS, 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 @@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti) dtv_t *dtv = THREAD_DTV (); return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET; } - -#endif diff --git a/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c b/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c index 81fd58ae1..c2e1faf24 100644 --- a/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c +++ b/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c @@ -1,5 +1,5 @@ /* long double square root in software floating-point emulation. - Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2006, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -37,3 +37,4 @@ __ieee754_sqrtl (const long double a) FP_HANDLE_EXCEPTIONS; return c; } +strong_alias (__ieee754_sqrtl, __sqrtl_finite) diff --git a/ports/sysdeps/mips/nptl/tls.h b/ports/sysdeps/mips/nptl/tls.h index 20f9f9683..0f215d447 100644 --- a/ports/sysdeps/mips/nptl/tls.h +++ b/ports/sysdeps/mips/nptl/tls.h @@ -56,14 +56,6 @@ typedef union dtv #endif /* __ASSEMBLER__ */ -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - -/* Signal that TLS support is available. */ -#define USE_TLS 1 - #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S index d3ad81b7b..dcd3ce252 100644 --- a/ports/sysdeps/unix/arm/sysdep.S +++ b/ports/sysdeps/unix/arm/sysdep.S @@ -1,5 +1,5 @@ /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003, - 2004, 2005, 2009 + 2004, 2005, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -42,7 +42,6 @@ syscall_error: moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */ #endif -#if USE___THREAD mov ip, lr cfi_register (lr, ip) mov r1, r0 @@ -58,46 +57,6 @@ syscall_error: RETINSTR (, ip) 1: .word errno(gottpoff) + (. - 2b - 8) -#elif RTLD_PRIVATE_ERRNO - ldr r1, 1f -0: str r0, [pc, r1] - mvn r0, $0 - DO_RET(r14) - -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 -#else -#ifndef PIC - ldr r1, 1f - str r0, [r1] - mvn r0, $0 - DO_RET (r14) - -1: .long C_SYMBOL_NAME(errno) -#else - @ we have to establish our PIC register - ldr r2, 1f - ldr r1, 2f -0: add r2, pc, r2 - str r0, [r1, r2] - mvn r0, $0 - DO_RET (r14) - -1: .word _GLOBAL_OFFSET_TABLE_ - 0b - 8 -2: .word C_SYMBOL_NAME(errno)(GOTOFF) -#endif -#endif #undef __syscall_error END (__syscall_error) diff --git a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S index 7691a94b1..8eeff6b26 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S +++ b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S @@ -35,8 +35,6 @@ #include <sysdep.h> -#ifdef HAVE_TLS_SUPPORT - /* GCC will emit calls to this routine under -mtp=soft. Linux has an equivalent helper function (which clobbers fewer registers than a normal function call) in a high page of memory; tail call to the @@ -47,5 +45,3 @@ ENTRY (__aeabi_read_tp) mov r0, #0xffff0fff sub pc, r0, #31 END (__aeabi_read_tp) - -#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h index a2c64827a..8f42111cf 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h @@ -1,5 +1,5 @@ -/* O_*, F_*, FD_* bit values for Linux/HPPA. - Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2004 +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995-1999, 2000, 2002, 2004, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -46,13 +46,15 @@ #define O_ASYNC 020000 #define O_BLKSEEK 00000100 /* HPUX only */ -#ifdef __USE_GNU -# define O_DIRECT 000040000 /* Direct disk access. */ +#ifdef __USE_XOPEN2K8 # define O_DIRECTORY 000010000 /* Must be a directory. */ # define O_NOFOLLOW 000000200 /* Do not follow links. */ -# define O_NOATIME 004000000 /* Do not set atime. */ # define O_CLOEXEC 010000000 /* Set close_on_exec. */ #endif +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_NOATIME 004000000 /* Do not set atime. */ +#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 @@ -85,7 +87,7 @@ #define F_SETLK64 9 /* Set record locking info (non-blocking). */ #define F_SETLKW64 10 /* Set record locking info (blocking). */ -#if defined __USE_BSD || defined __USE_UNIX98 +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 # define F_GETOWN 11 /* Get owner of socket (receiver of SIGIO). */ # define F_SETOWN 12 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -101,6 +103,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 @@ -227,6 +233,19 @@ struct f_owner_ex we splice from/to). */ # define SPLICE_F_MORE 4 /* Expect more data. */ # define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 #endif __BEGIN_DECLS @@ -243,20 +262,32 @@ extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); -/* Splice address range into a pipe. */ +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); -/* Splice two files together. */ +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, __off64_t *__offout, size_t __len, unsigned int __flags); -/* In-kernel implementation of tee for pipe buffers. */ +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); -/* Reserve storage for the data of the file associated with FD. */ +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); # else @@ -273,6 +304,19 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset, __off64_t __len); # endif + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + #endif __END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c deleted file mode 100644 index 0d6da8291..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <shlib-compat.h> - -#define aio_cancel64 XXX -#include <aio.h> -#undef aio_cancel64 -#include <errno.h> - -extern __typeof (aio_cancel) __new_aio_cancel; -extern __typeof (aio_cancel) __old_aio_cancel; - -#define aio_cancel __new_aio_cancel - -#include <sysdeps/pthread/aio_cancel.c> - -#undef aio_cancel -strong_alias (__new_aio_cancel, __new_aio_cancel64); -versioned_symbol (librt, __new_aio_cancel, aio_cancel, GLIBC_2_3); -versioned_symbol (librt, __new_aio_cancel64, aio_cancel64, GLIBC_2_3); - -#if SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_3) - -#undef ECANCELED -#define aio_cancel __old_aio_cancel -#define ECANCELED 125 - -#include <sysdeps/pthread/aio_cancel.c> - -#undef aio_cancel -strong_alias (__old_aio_cancel, __old_aio_cancel64); -compat_symbol (librt, __old_aio_cancel, aio_cancel, GLIBC_2_1); -compat_symbol (librt, __old_aio_cancel64, aio_cancel64, GLIBC_2_1); - -#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h deleted file mode 100644 index ff0ec200f..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h +++ /dev/null @@ -1,41 +0,0 @@ -/* PA-RISC specific definitions for spinlock initializers. - Copyright (C) 2000, 2001 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Initial value of a spinlock. PA-RISC only implements atomic load - and clear so this must be non-zero. */ -#define __LT_SPINLOCK_INIT ((__atomic_lock_t) { { 1, 1, 1, 1 } }) - -/* Initialize global spinlocks without cast, generally macro wrapped */ -#define __LT_SPINLOCK_ALT_INIT { { 1, 1, 1, 1 } } - -/* Macros for lock initializers, not using the above definition. - The above definition is not used in the case that static initializers - use this value. */ -#define __LOCK_ALT_INITIALIZER { __LT_SPINLOCK_ALT_INIT, 0 } - -/* Used to initialize _pthread_fastlock's in non-static case */ -#define __LOCK_INITIALIZER ((struct _pthread_fastlock){ __LT_SPINLOCK_INIT, 0 }) - -/* Used in pthread_atomic initialization */ -#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_ALT_INIT } - -/* Tell the rest of the code that the initializer is non-zero without - explaining it's internal structure */ -#define __LT_INITIALIZER_NOT_ZERO - diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h deleted file mode 100644 index 717371831..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Linuxthreads - a simple clone()-based implementation of Posix */ -/* threads for Linux. */ -/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ -/* */ -/* This program is free software; you can redistribute it and/or */ -/* modify it under the terms of the GNU Library General Public License */ -/* as published by the Free Software Foundation; either version 2 */ -/* of the License, or (at your option) any later version. */ -/* */ -/* This program 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 Library General Public License for more details. */ - -#if !defined _BITS_TYPES_H && !defined _PTHREAD_H -# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead." -#endif - -#ifndef _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#define __need_schedparam -#include <bits/sched.h> - -/* We need 128-bit alignment for the ldcw semaphore. At most, we are - assured of 64-bit alignment for stack locals and malloc'd data. Thus, - we use a struct with four ints for the atomic lock type. The locking - code will figure out which of the four to use for the ldcw semaphore. */ -typedef volatile struct { - int lock[4]; -} __attribute__ ((aligned(16))) __atomic_lock_t; - -/* Fast locks (not abstract because mutexes and conditions aren't abstract). */ -struct _pthread_fastlock -{ - __atomic_lock_t __spinlock; /* Used by compare_and_swap emulation. Also, - adaptive SMP lock stores spin count here. */ - long int __status; /* "Free" or "taken" or head of waiting list */ -}; - -#ifndef _PTHREAD_DESCR_DEFINED -/* Thread descriptors */ -typedef struct _pthread_descr_struct *_pthread_descr; -# define _PTHREAD_DESCR_DEFINED -#endif - - -/* Attributes for threads. */ -typedef struct __pthread_attr_s -{ - int __detachstate; - int __schedpolicy; - struct __sched_param __schedparam; - int __inheritsched; - int __scope; - size_t __guardsize; - int __stackaddr_set; - void *__stackaddr; - size_t __stacksize; -} pthread_attr_t; - - -/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */ - -#ifdef __GLIBC_HAVE_LONG_LONG -__extension__ typedef long long __pthread_cond_align_t; -#else -typedef long __pthread_cond_align_t; -#endif - -typedef struct -{ - struct _pthread_fastlock __c_lock; /* Protect against concurrent access */ - _pthread_descr __c_waiting; /* Threads waiting on this condition */ - char __padding[48 - sizeof (struct _pthread_fastlock) - - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; - __pthread_cond_align_t __align; -} pthread_cond_t; - - -/* Attribute for conditionally variables. */ -typedef struct -{ - int __dummy; -} pthread_condattr_t; - -/* Keys for thread-specific data */ -typedef unsigned int pthread_key_t; - - -/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */ -/* (The layout is unnatural to maintain binary compatibility - with earlier releases of LinuxThreads.) */ -typedef struct -{ - int __m_reserved; /* Reserved for future use */ - int __m_count; /* Depth of recursive locking */ - _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */ - int __m_kind; /* Mutex kind: fast, recursive or errcheck */ - struct _pthread_fastlock __m_lock; /* Underlying fast lock */ -} pthread_mutex_t; - - -/* Attribute for mutex. */ -typedef struct -{ - int __mutexkind; -} pthread_mutexattr_t; - - -/* Once-only execution */ -typedef int pthread_once_t; - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -/* Read-write locks. */ -typedef struct _pthread_rwlock_t -{ - struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */ - int __rw_readers; /* Number of readers */ - _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */ - _pthread_descr __rw_read_waiting; /* Threads waiting for reading */ - _pthread_descr __rw_write_waiting; /* Threads waiting for writing */ - int __rw_kind; /* Reader/Writer preference selection */ - int __rw_pshared; /* Shared between processes or not */ -} pthread_rwlock_t; - - -/* Attribute for read-write locks. */ -typedef struct -{ - int __lockkind; - int __pshared; -} pthread_rwlockattr_t; -#endif - -#ifdef __USE_XOPEN2K -/* POSIX spinlock data type. */ -typedef __atomic_lock_t pthread_spinlock_t; - -/* POSIX barrier. */ -typedef struct { - struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */ - int __ba_required; /* Threads needed for completion */ - int __ba_present; /* Threads waiting */ - _pthread_descr __ba_waiting; /* Queue of waiting threads */ -} pthread_barrier_t; - -/* barrier attribute */ -typedef struct { - int __pshared; -} pthread_barrierattr_t; - -#endif - - -/* Thread identifiers */ -typedef unsigned long int pthread_t; - -#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h deleted file mode 100644 index 5dc6e6fa7..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h +++ /dev/null @@ -1,73 +0,0 @@ -/* HP-PARISC macro definitions for mutexes, thread-specific data - and parameters for malloc. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2003. - - 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 _MALLOC_MACHINE_H -#define _MALLOC_MACHINE_H - -#undef thread_atfork_static - -#include <atomic.h> -#include <bits/libc-lock.h> - -__libc_lock_define (typedef, mutex_t) - -/* Since our lock structure does not tolerate being initialized to zero, we must - modify the standard function calls made by malloc */ -# define mutex_init(m) \ - __libc_maybe_call (__pthread_mutex_init, (m, NULL), \ - (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT),(*(int *)(m))) ) -# define mutex_lock(m) \ - __libc_maybe_call (__pthread_mutex_lock, (m), \ - (__load_and_clear(&((m)->__m_lock.__spinlock)), 0)) -# define mutex_trylock(m) \ - __libc_maybe_call (__pthread_mutex_trylock, (m), \ - (*(int *)(m) ? 1 : (__load_and_clear(&((m)->__m_lock.__spinlock)), 0))) -# define mutex_unlock(m) \ - __libc_maybe_call (__pthread_mutex_unlock, (m), \ - (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT), (*(int *)(m))) ) - -/* This is defined by newer gcc version unique for each module. */ -extern void *__dso_handle __attribute__ ((__weak__)); - -#include <fork.h> - -#ifdef SHARED -# define thread_atfork(prepare, parent, child) \ - __register_atfork (prepare, parent, child, __dso_handle) -#else -# define thread_atfork(prepare, parent, child) \ - __register_atfork (prepare, parent, child, \ - &__dso_handle == NULL ? NULL : __dso_handle) -#endif - -/* thread specific data for glibc */ - -#include <bits/libc-tsd.h> - -typedef int tsd_key_t[1]; /* no key data structure, libc magic does it */ -__libc_tsd_define (static, void *, MALLOC) /* declaration/common definition */ -#define tsd_key_create(key, destr) ((void) (key)) -#define tsd_setspecific(key, data) __libc_tsd_set (void *, MALLOC, (data)) -#define tsd_getspecific(key, vptr) ((vptr) = __libc_tsd_get (void *, MALLOC)) - -#include <sysdeps/generic/malloc-machine.h> - -#endif /* !defined(_MALLOC_MACHINE_H) */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c deleted file mode 100644 index 27f850cf8..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Special .init and .fini section support for HPPA. Linuxthreads version. - Copyright (C) 2001, 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. - - 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 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.) - - 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the - .init and .fini sections and defines global symbols for - those addresses, so they can be called as functions. - - * crtn.s puts the corresponding function epilogues - in the .init and .fini sections. */ - -/* If we use the standard C version, the linkage table pointer won't - be properly preserved due to the splitting up of function prologues - and epilogues. Therefore we write these in assembly to make sure - they do the right thing. */ - -__asm__ ( -"#include \"defs.h\"\n" -"\n" -"/*@HEADER_ENDS*/\n" -"\n" -"/*@_init_PROLOG_BEGINS*/\n" -" .section .init\n" -" .align 4\n" -" .globl _init\n" -" .type _init,@function\n" -"_init:\n" -" stw %rp,-20(%sp)\n" -" stwm %r4,64(%sp)\n" -" stw %r19,-32(%sp)\n" -" bl __pthread_initialize_minimal,%rp\n" -" copy %r19,%r4 /* delay slot */\n" -" copy %r4,%r19\n" -"/*@_init_PROLOG_ENDS*/\n" -"\n" -"/*@_init_EPILOG_BEGINS*/\n" -"/* Here is the tail end of _init. */\n" -" .section .init\n" -" ldw -84(%sp),%rp\n" -" copy %r4,%r19\n" -" bv %r0(%rp)\n" -"_end_init:\n" -" ldwm -64(%sp),%r4\n" -"\n" -"/* Our very own unwind info, because the assembler can't handle\n" -" functions split into two or more pieces. */\n" -" .section .PARISC.unwind,\"a\",@progbits\n" -" .extern _init\n" -" .word _init, _end_init\n" -" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n" -"\n" -"/*@_init_EPILOG_ENDS*/\n" -"\n" -"/*@_fini_PROLOG_BEGINS*/\n" -" .section .fini\n" -" .align 4\n" -" .globl _fini\n" -" .type _fini,@function\n" -"_fini:\n" -" stw %rp,-20(%sp)\n" -" stwm %r4,64(%sp)\n" -" stw %r19,-32(%sp)\n" -" copy %r19,%r4\n" -"/*@_fini_PROLOG_ENDS*/\n" -"\n" -"/*@_fini_EPILOG_BEGINS*/\n" -" .section .fini\n" -" ldw -84(%sp),%rp\n" -" copy %r4,%r19\n" -" bv %r0(%rp)\n" -"_end_fini:\n" -" ldwm -64(%sp),%r4\n" -"\n" -" .section .PARISC.unwind,\"a\",@progbits\n" -" .extern _fini\n" -" .word _fini, _end_fini\n" -" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n" -"\n" -"/*@_fini_EPILOG_ENDS*/\n" -"\n" -"/*@TRAILER_BEGINS*/\n" -); diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h deleted file mode 100644 index 51d6cf394..000000000 --- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h +++ /dev/null @@ -1,242 +0,0 @@ -/* cancellable system calls for Linux/HPPA. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2003. - - 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 <linuxthreads/internals.h> -#endif - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt - -# ifndef NO_ERROR -# define NO_ERROR -0x1000 -# endif - -/* The syscall cancellation mechanism requires userspace - assistance, the following code does roughly this: - - do arguments (read arg5 and arg6 to registers) - setup frame - - check if there are threads, yes jump to pseudo_cancel - - unthreaded: - syscall - check syscall return (jump to pre_end) - set errno - set return to -1 - (jump to pre_end) - - pseudo_cancel: - cenable - syscall - cdisable - check syscall return (jump to pre_end) - set errno - set return to -1 - - pre_end - restore stack - - It is expected that 'ret' and 'END' macros will - append an 'undo arguments' and 'return' to the - this PSEUDO macro. */ - -# undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - ENTRY (name) \ - DOARGS_##args ASM_LINE_SEP \ - copy TREG, %r1 ASM_LINE_SEP \ - copy %sp, TREG ASM_LINE_SEP \ - stwm %r1, 64(%sp) ASM_LINE_SEP \ - stw %rp, -20(%sp) ASM_LINE_SEP \ - stw TREG, -4(%sp) ASM_LINE_SEP \ - /* Done setting up frame, continue... */ ASM_LINE_SEP \ - SINGLE_THREAD_P ASM_LINE_SEP \ - cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \ -L(unthreaded): ASM_LINE_SEP \ - /* Save r19 */ ASM_LINE_SEP \ - SAVE_PIC(TREG) ASM_LINE_SEP \ - /* Do syscall, delay loads # */ ASM_LINE_SEP \ - ble 0x100(%sr2,%r0) ASM_LINE_SEP \ - ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ - ldi NO_ERROR,%r1 ASM_LINE_SEP \ - cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \ - /* Restore r19 from TREG */ ASM_LINE_SEP \ - LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \ - SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ - /* Use TREG for temp storage */ ASM_LINE_SEP \ - copy %ret0, TREG /* delay */ ASM_LINE_SEP \ - /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ - /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ - sub %r0, TREG, TREG ASM_LINE_SEP \ - /* Store into errno location */ ASM_LINE_SEP \ - stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ - b L(pre_end) ASM_LINE_SEP \ - /* return -1 as error */ ASM_LINE_SEP \ - ldo -1(%r0), %ret0 /* delay */ ASM_LINE_SEP \ -L(pseudo_cancel): ASM_LINE_SEP \ - PUSHARGS_##args /* Save args */ ASM_LINE_SEP \ - /* Save r19 into TREG */ ASM_LINE_SEP \ - CENABLE /* FUNC CALL */ ASM_LINE_SEP \ - SAVE_PIC(TREG) /* delay */ ASM_LINE_SEP \ - /* restore syscall args */ ASM_LINE_SEP \ - POPARGS_##args ASM_LINE_SEP \ - /* save mask from cenable (use stub rp slot) */ ASM_LINE_SEP \ - stw %ret0, -24(%sp) ASM_LINE_SEP \ - /* ... SYSCALL ... */ ASM_LINE_SEP \ - ble 0x100(%sr2,%r0) ASM_LINE_SEP \ - ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ - /* ............... */ ASM_LINE_SEP \ - LOAD_PIC(TREG) ASM_LINE_SEP \ - /* pass mask as arg0 to cdisable */ ASM_LINE_SEP \ - ldw -24(%sp), %r26 ASM_LINE_SEP \ - CDISABLE ASM_LINE_SEP \ - stw %ret0, -24(%sp) /* delay */ ASM_LINE_SEP \ - /* Restore syscall return */ ASM_LINE_SEP \ - ldw -24(%sp), %ret0 ASM_LINE_SEP \ - /* compare error */ ASM_LINE_SEP \ - ldi NO_ERROR,%r1 ASM_LINE_SEP \ - /* branch if no error */ ASM_LINE_SEP \ - cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \ - LOAD_PIC(TREG) /* cond. nullify */ ASM_LINE_SEP \ - copy %ret0, TREG /* save syscall return */ ASM_LINE_SEP \ - SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ - /* make syscall res value positive */ ASM_LINE_SEP \ - sub %r0, TREG, TREG /* delay */ ASM_LINE_SEP \ - /* No need to LOAD_PIC */ ASM_LINE_SEP \ - /* store into errno location */ ASM_LINE_SEP \ - stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ - /* return -1 */ ASM_LINE_SEP \ - ldo -1(%r0), %ret0 ASM_LINE_SEP \ -L(pre_end): ASM_LINE_SEP \ - /* Restore rp before exit */ ASM_LINE_SEP \ - ldw -84(%sr0,%sp), %rp ASM_LINE_SEP \ - /* Undo frame */ ASM_LINE_SEP \ - ldwm -64(%sp),TREG ASM_LINE_SEP \ - /* No need to LOAD_PIC */ ASM_LINE_SEP - -/* Save arguments into our frame */ -# define PUSHARGS_0 /* nothing to do */ -# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP - -/* Bring them back from the stack */ -# define POPARGS_0 /* nothing to do */ -# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP -# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP -# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP -# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP -# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP -# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP - -# ifdef IS_IN_libpthread -# ifdef PIC -# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP -# else -# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ - bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP -# endif -# elif !defined NOT_IN_libc -# ifdef PIC -# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ - bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ - bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP -# else -# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ - bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ - bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP -# endif -# else -# ifdef PIC -# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ - bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \ - bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP -# else -# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ - bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP -# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \ - bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP -# endif -# endif - -/* p_header.multiple_threads is +12 from the pthread_descr struct start, - We could have called __get_cr27() but we really want less overhead */ -# define MULTIPLE_THREADS_OFFSET 0xC - -/* cr27 has been initialized to 0x0 by kernel */ -# define NO_THREAD_CR27 0x0 - -# ifdef IS_IN_libpthread -# define __local_multiple_threads __pthread_multiple_threads -# elif !defined NOT_IN_libc -# define __local_multiple_threads __libc_multiple_threads -# else -# define __local_multiple_threads __librt_multiple_threads -# endif - -# ifndef __ASSEMBLER__ -# if !defined NOT_IN_libc || defined IS_IN_libpthread -extern int __local_multiple_threads attribute_hidden; -# else -extern int __local_multiple_threads; -# endif -# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) -# else -/* This ALT version requires newer kernel support */ -# define SINGLE_THREAD_P_MFCTL \ - mfctl %cr27, %ret0 ASM_LINE_SEP \ - cmpib,= NO_THREAD_CR27,%ret0,L(stp) ASM_LINE_SEP \ - nop ASM_LINE_SEP \ - ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0 ASM_LINE_SEP \ -L(stp): ASM_LINE_SEP -# ifdef PIC -/* Slower version uses GOT to get value of __local_multiple_threads */ -# define SINGLE_THREAD_P \ - addil LT%__local_multiple_threads, %r19 ASM_LINE_SEP \ - ldw RT%__local_multiple_threads(%sr0,%r1), %ret0 ASM_LINE_SEP \ - ldw 0(%sr0,%ret0), %ret0 ASM_LINE_SEP -# else -/* Slow non-pic version using DP */ -# define SINGLE_THREAD_P \ - addil LR%__local_multiple_threads-$global$,%r27 ASM_LINE_SEP \ - ldw RR%__local_multiple_threads-$global$(%sr0,%r1),%ret0 ASM_LINE_SEP -# endif -# endif -#elif !defined __ASSEMBLER__ - -/* This code should never be used but we define it anyhow. */ -# define SINGLE_THREAD_P (1) - -#endif -/* !defined NOT_IN_libc || defined IS_IN_libpthread */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h index 6cffa7631..d704345fe 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 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 @@ -61,11 +61,53 @@ # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ + ENTRY (__##syscall_name##_nocancel) \ + DOARGS_##args ASM_LINE_SEP \ + stwm TREG, 64(%sp) ASM_LINE_SEP \ + .cfi_offset TREG, 0 ASM_LINE_SEP \ + .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \ + stw %sp, -4(%sp) ASM_LINE_SEP \ + .cfi_offset 30, -4 ASM_LINE_SEP \ + stw %r19, -32(%sp) ASM_LINE_SEP \ + .cfi_offset 19, -32 ASM_LINE_SEP \ + /* Save r19 */ ASM_LINE_SEP \ + SAVE_PIC(TREG) ASM_LINE_SEP \ + /* Do syscall, delay loads # */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,L(pre_nc_end) ASM_LINE_SEP \ + /* Restore r19 from TREG */ ASM_LINE_SEP \ + LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \ + SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ + /* Use TREG for temp storage */ ASM_LINE_SEP \ + copy %ret0, TREG /* delay */ ASM_LINE_SEP \ + /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ + /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ + sub %r0, TREG, TREG ASM_LINE_SEP \ + /* Store into errno location */ ASM_LINE_SEP \ + stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ + /* return -1 as error */ ASM_LINE_SEP \ + ldi -1, %ret0 ASM_LINE_SEP \ +L(pre_nc_end): ASM_LINE_SEP \ + /* No need to LOAD_PIC */ ASM_LINE_SEP \ + /* Undo frame */ ASM_LINE_SEP \ + ldwm -64(%sp),TREG ASM_LINE_SEP \ + .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \ + /* Restore rp before exit */ ASM_LINE_SEP \ + ldw -20(%sp), %rp ASM_LINE_SEP \ + .cfi_restore 2 ASM_LINE_SEP \ + ret ASM_LINE_SEP \ + END(__##syscall_name##_nocancel) ASM_LINE_SEP \ + /**********************************************/ASM_LINE_SEP \ ENTRY (name) \ DOARGS_##args ASM_LINE_SEP \ stwm TREG, 64(%sp) ASM_LINE_SEP \ + .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \ stw %sp, -4(%sp) ASM_LINE_SEP \ + .cfi_offset 30, -4 ASM_LINE_SEP \ stw %r19, -32(%sp) ASM_LINE_SEP \ + .cfi_offset 19, -32 ASM_LINE_SEP \ /* Done setting up frame, continue... */ ASM_LINE_SEP \ SINGLE_THREAD_P ASM_LINE_SEP \ cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \ @@ -128,26 +170,40 @@ L(pre_end): ASM_LINE_SEP \ /* No need to LOAD_PIC */ ASM_LINE_SEP \ /* Undo frame */ ASM_LINE_SEP \ ldwm -64(%sp),TREG ASM_LINE_SEP \ + .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \ /* Restore rp before exit */ ASM_LINE_SEP \ - ldw -20(%sp), %rp ASM_LINE_SEP + ldw -20(%sp), %rp ASM_LINE_SEP \ + .cfi_restore 2 ASM_LINE_SEP /* Save arguments into our frame */ # define PUSHARGS_0 /* nothing to do */ -# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP -# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP +# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 26, -36 ASM_LINE_SEP +# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 25, -40 ASM_LINE_SEP +# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 24, -44 ASM_LINE_SEP +# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 23, -48 ASM_LINE_SEP +# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 22, -52 ASM_LINE_SEP +# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 21, -56 ASM_LINE_SEP /* Bring them back from the stack */ # define POPARGS_0 /* nothing to do */ -# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP -# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP -# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP -# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP -# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP -# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP +# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP \ + .cfi_restore 26 ASM_LINE_SEP +# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP \ + .cfi_restore 25 ASM_LINE_SEP +# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP \ + .cfi_restore 24 ASM_LINE_SEP +# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP \ + .cfi_restore 23 ASM_LINE_SEP +# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP \ + .cfi_restore 22 ASM_LINE_SEP +# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP \ + .cfi_restore 21 ASM_LINE_SEP # ifdef IS_IN_libpthread # ifdef PIC diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h new file mode 100644 index 000000000..1931cc687 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h @@ -0,0 +1,144 @@ +/* Copyright (C) 2002-2006, 2007, 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 + 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 _SYS_EPOLL_H +#define _SYS_EPOLL_H 1 + +#include <stdint.h> +#include <sys/types.h> + +/* Get __sigset_t. */ +#include <bits/sigset.h> + +#ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +#endif + + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 010000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; + + +enum EPOLL_EVENTS + { + EPOLLIN = 0x001, +#define EPOLLIN EPOLLIN + EPOLLPRI = 0x002, +#define EPOLLPRI EPOLLPRI + EPOLLOUT = 0x004, +#define EPOLLOUT EPOLLOUT + EPOLLRDNORM = 0x040, +#define EPOLLRDNORM EPOLLRDNORM + EPOLLRDBAND = 0x080, +#define EPOLLRDBAND EPOLLRDBAND + EPOLLWRNORM = 0x100, +#define EPOLLWRNORM EPOLLWRNORM + EPOLLWRBAND = 0x200, +#define EPOLLWRBAND EPOLLWRBAND + EPOLLMSG = 0x400, +#define EPOLLMSG EPOLLMSG + EPOLLERR = 0x008, +#define EPOLLERR EPOLLERR + EPOLLHUP = 0x010, +#define EPOLLHUP EPOLLHUP + EPOLLRDHUP = 0x2000, +#define EPOLLRDHUP EPOLLRDHUP + EPOLLONESHOT = (1 << 30), +#define EPOLLONESHOT EPOLLONESHOT + EPOLLET = (1 << 31) +#define EPOLLET EPOLLET + }; + + +/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ +#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ +#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ +#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ + + +typedef union epoll_data +{ + void *ptr; + int fd; + uint32_t u32; + uint64_t u64; +} epoll_data_t; + +struct epoll_event +{ + uint32_t events; /* Epoll events */ + epoll_data_t data; /* User data variable */ +}; + + +__BEGIN_DECLS + +/* Creates an epoll instance. Returns an fd for the new instance. + The "size" parameter is a hint specifying the number of file + descriptors to be associated with the new instance. The fd + returned by epoll_create() should be closed with close(). */ +extern int epoll_create (int __size) __THROW; + +/* Same as epoll_create but with an FLAGS parameter. The unused SIZE + parameter has been dropped. */ +extern int epoll_create1 (int __flags) __THROW; + + +/* Manipulate an epoll instance "epfd". Returns 0 in case of success, + -1 in case of error ( the "errno" variable will contain the + specific error code ) The "op" parameter is one of the EPOLL_CTL_* + constants defined above. The "fd" parameter is the target of the + operation. The "event" parameter describes which events the caller + is interested in and any associated user data. */ +extern int epoll_ctl (int __epfd, int __op, int __fd, + struct epoll_event *__event) __THROW; + + +/* Wait for events on an epoll instance "epfd". Returns the number of + triggered events returned in "events" buffer. Or -1 in case of + error with the "errno" variable set to the specific error code. The + "events" parameter is a buffer that will contain triggered + events. The "maxevents" is the maximum number of events to be + returned ( usually size of "events" ). The "timeout" parameter + specifies the maximum wait time in milliseconds (-1 == infinite). + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_wait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout); + + +/* Same as epoll_wait, but the thread's signal mask is temporarily + and atomically replaced with the one provided as parameter. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_pwait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout, + __const __sigset_t *__ss); + +__END_DECLS + +#endif /* sys/epoll.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h new file mode 100644 index 000000000..751f27675 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h @@ -0,0 +1,54 @@ +/* Copyright (C) 2007, 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 + 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 _SYS_EVENTFD_H +#define _SYS_EVENTFD_H 1 + +#include <stdint.h> + + +/* Type for event counter. */ +typedef uint64_t eventfd_t; + +/* Flags for signalfd. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 010000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define EFD_NONBLOCK EFD_NONBLOCK + }; + + +__BEGIN_DECLS + +/* Return file descriptor for generic event channel. Set initial + value to COUNT. */ +extern int eventfd (int __count, int __flags) __THROW; + +/* Read event counter and possibly wait for events. */ +extern int eventfd_read (int __fd, eventfd_t *__value); + +/* Increment event counter. */ +extern int eventfd_write (int __fd, eventfd_t __value); + +__END_DECLS + +#endif /* sys/eventfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h new file mode 100644 index 000000000..080497d7b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h @@ -0,0 +1,107 @@ +/* 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 + 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 _SYS_INOTIFY_H +#define _SYS_INOTIFY_H 1 + +#include <stdint.h> + + +/* Flags for the parameter of inotify_init1. */ +enum + { + IN_CLOEXEC = 010000000, +#define IN_CLOEXEC IN_CLOEXEC + IN_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define IN_NONBLOCK IN_NONBLOCK + }; + + +/* Structure describing an inotify event. */ +struct inotify_event +{ + int wd; /* Watch descriptor. */ + uint32_t mask; /* Watch mask. */ + uint32_t cookie; /* Cookie to synchronize two events. */ + uint32_t len; /* Length (including NULs) of name. */ + char name __flexarr; /* Name. */ +}; + + +/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */ +#define IN_ACCESS 0x00000001 /* File was accessed. */ +#define IN_MODIFY 0x00000002 /* File was modified. */ +#define IN_ATTRIB 0x00000004 /* Metadata changed. */ +#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */ +#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ +#define IN_OPEN 0x00000020 /* File was opened. */ +#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */ +#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ +#define IN_CREATE 0x00000100 /* Subfile was created. */ +#define IN_DELETE 0x00000200 /* Subfile was deleted. */ +#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */ +#define IN_MOVE_SELF 0x00000800 /* Self was moved. */ + +/* Events sent by the kernel. */ +#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */ +#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */ +#define IN_IGNORED 0x00008000 /* File was ignored. */ + +/* Helper events. */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ + +/* Special flags. */ +#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. */ +#define IN_ONESHOT 0x80000000 /* Only send event once. */ + +/* All events which a program can wait on. */ +#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \ + | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \ + | IN_MOVED_TO | IN_CREATE | IN_DELETE \ + | IN_DELETE_SELF | IN_MOVE_SELF) + + +__BEGIN_DECLS + +/* Create and initialize inotify instance. */ +extern int inotify_init (void) __THROW; + +/* Create and initialize inotify instance. */ +extern int inotify_init1 (int __flags) __THROW; + +/* Add watch of object NAME to inotify instance FD. Notify about + events specified by MASK. */ +extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask) + __THROW; + +/* Remove the watch specified by WD from the inotify instance FD. */ +extern int inotify_rm_watch (int __fd, int __wd) __THROW; + +__END_DECLS + +#endif /* sys/inotify.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h index ca35489f5..0c076337e 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1999, 2000, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 2000, 2006, 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 @@ -29,10 +30,8 @@ GDB unless you know what you are doing. */ #include <features.h> -#include <signal.h> #include <sys/time.h> #include <sys/types.h> -#include <sys/ucontext.h> #include <sys/user.h> __BEGIN_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h new file mode 100644 index 000000000..da8264e7c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h @@ -0,0 +1,66 @@ +/* Copyright (C) 2007, 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 _SYS_SIGNALFD_H +#define _SYS_SIGNALFD_H 1 + +#define __need_sigset_t +#include <signal.h> +#include <stdint.h> + + +struct signalfd_siginfo +{ + uint32_t ssi_signo; + int32_t ssi_errno; + int32_t ssi_code; + uint32_t ssi_pid; + uint32_t ssi_uid; + int32_t ssi_fd; + uint32_t ssi_tid; + uint32_t ssi_band; + uint32_t ssi_overrun; + uint32_t ssi_trapno; + int32_t ssi_status; + int32_t ssi_int; + uint64_t ssi_ptr; + uint64_t ssi_utime; + uint64_t ssi_stime; + uint64_t ssi_addr; + uint8_t __pad[48]; +}; + +/* Flags for signalfd. */ +enum + { + SFD_CLOEXEC = 010000000, +#define SFD_CLOEXEC SFD_CLOEXEC + SFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define SFD_NONBLOCK SFD_NONBLOCK + }; + +__BEGIN_DECLS + +/* Request notification for delivery of signals in MASK to be + performed using descriptor FD.*/ +extern int signalfd (int __fd, const sigset_t *__mask, int __flags) + __THROW __nonnull ((2)); + +__END_DECLS + +#endif /* sys/signalfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h new file mode 100644 index 000000000..78cdfc478 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h @@ -0,0 +1,60 @@ +/* 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. */ + +#ifndef _SYS_TIMERFD_H +#define _SYS_TIMERFD_H 1 + +#include <time.h> + + +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 010000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define TFD_NONBLOCK TFD_NONBLOCK + }; + + +/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */ +enum + { + TFD_TIMER_ABSTIME = 1 << 0 +#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME + }; + + +__BEGIN_DECLS + +/* Return file descriptor for new interval timer source. */ +extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW; + +/* Set next expiration time of interval timer source UFD to UTMR. If + FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is + absolute. Optionally return the old expiration time in OTMR. */ +extern int timerfd_settime (int __ufd, int __flags, + __const struct itimerspec *__utmr, + struct itimerspec *__otmr) __THROW; + +/* Return the next expiration time of UFD. */ +extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; + +__END_DECLS + +#endif /* sys/timerfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h index d381189fe..28113ac5c 100644 --- a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -106,7 +106,7 @@ SYSCALL_ERROR_LABEL: \ a pointer (e.g., mmap). */ \ move.l %d0, %a0; \ rts; -# elif USE___THREAD +# elif defined _LIBC_REENTRANT # ifndef NOT_IN_libc # define SYSCALL_ERROR_ERRNO __libc_errno # else @@ -125,18 +125,6 @@ SYSCALL_ERROR_LABEL: \ 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); \ - jbsr __errno_location@PLTPC; \ - 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; # else /* !_LIBC_REENTRANT */ /* Store (- %d0) into errno through the GOT. */ # define SYSCALL_ERROR_HANDLER \ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h index 239949092..4aacfae99 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h @@ -312,7 +312,7 @@ __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; + return (struct cmsghdr *) 0; __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)); @@ -321,7 +321,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ - return 0; + return (struct cmsghdr *) 0; return __cmsg; } #endif /* Use `extern inline'. */ |