summaryrefslogtreecommitdiff
path: root/libpthread/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl')
-rw-r--r--libpthread/nptl/allocatestack.c24
-rw-r--r--libpthread/nptl/init.c1
-rw-r--r--libpthread/nptl/pt-cleanup.c4
-rw-r--r--libpthread/nptl/pthreadP.h16
-rw-r--r--libpthread/nptl/sysdeps/generic/dl-tls.c2
-rw-r--r--libpthread/nptl/sysdeps/generic/libc-tls.c2
-rw-r--r--libpthread/nptl/sysdeps/pthread/bits/sigthread.h44
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h122
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S10
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S2
-rw-r--r--libpthread/nptl/unwind.c5
19 files changed, 47 insertions, 200 deletions
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c
index 1c549cee1..e30fe41a2 100644
--- a/libpthread/nptl/allocatestack.c
+++ b/libpthread/nptl/allocatestack.c
@@ -122,7 +122,7 @@ static uintptr_t in_flight_stack;
list_t __stack_user __attribute__ ((nocommon));
hidden_data_def (__stack_user)
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
/* Number of threads created. */
static unsigned int nptl_ncreated;
#endif
@@ -316,10 +316,10 @@ change_stack_perm (struct pthread *pd
+ (((((pd->stackblock_size - pd->guardsize) / 2)
& pagemask) + pd->guardsize) & pagemask));
size_t len = pd->stackblock + pd->stackblock_size - stack;
-#elif _STACK_GROWS_DOWN
+#elif defined _STACK_GROWS_DOWN
void *stack = pd->stackblock + pd->guardsize;
size_t len = pd->stackblock_size - pd->guardsize;
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
void *stack = pd->stackblock;
size_t len = (uintptr_t) pd - pd->guardsize - (uintptr_t) pd->stackblock;
#else
@@ -443,7 +443,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
void *mem = 0;
const int prot = (PROT_READ | PROT_WRITE);
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
/* Add one more page for stack coloring. Don't do it for stacks
with 16 times pagesize or larger. This might just cause
unnecessary misalignment. */
@@ -474,7 +474,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
adjust the allocated stack size if necessary. This way
allocations directly following each other will not have
aliasing problems. */
-#if MULTI_PAGE_ALIASING != 0
+#if defined MULTI_PAGE_ALIASING && MULTI_PAGE_ALIASING != 0
if ((size % MULTI_PAGE_ALIASING) == 0)
size += pagesize_m1 + 1;
#endif
@@ -494,7 +494,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
So we can never get a null pointer back from mmap. */
assert (mem != NULL);
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
/* Atomically increment NCREATED. */
unsigned int ncreated = atomic_increment_val (&nptl_ncreated);
@@ -591,9 +591,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
{
#ifdef NEED_SEPARATE_REGISTER_STACK
char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
-#elif _STACK_GROWS_DOWN
+#elif defined _STACK_GROWS_DOWN
char *guard = mem;
-# elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
#endif
if (mprotect (guard, guardsize, PROT_NONE) != 0)
@@ -641,11 +641,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
oldguard + pd->guardsize - guard - guardsize,
prot) != 0)
goto mprot_error;
-#elif _STACK_GROWS_DOWN
+#elif defined _STACK_GROWS_DOWN
if (mprotect ((char *) mem + guardsize, pd->guardsize - guardsize,
prot) != 0)
goto mprot_error;
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
if (mprotect ((char *) pd - pd->guardsize,
pd->guardsize - guardsize, prot) != 0)
goto mprot_error;
@@ -688,9 +688,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
#ifdef NEED_SEPARATE_REGISTER_STACK
*stack = pd->stackblock;
*stacksize = stacktop - *stack;
-#elif _STACK_GROWS_DOWN
+#elif defined _STACK_GROWS_DOWN
*stack = stacktop;
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
*stack = pd->stackblock;
assert (*stack > 0);
#endif
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index 911293a65..c8ca09637 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -257,6 +257,7 @@ extern void **__libc_dl_error_tsd (void) __attribute__ ((const));
/* This can be set by the debugger before initialization is complete. */
static bool __nptl_initial_report_events __attribute_used__;
+void __pthread_initialize_minimal_internal (void) attribute_hidden;
void
__pthread_initialize_minimal_internal (void)
{
diff --git a/libpthread/nptl/pt-cleanup.c b/libpthread/nptl/pt-cleanup.c
index 97673b6c5..d7394ae44 100644
--- a/libpthread/nptl/pt-cleanup.c
+++ b/libpthread/nptl/pt-cleanup.c
@@ -39,13 +39,13 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
cbuf != NULL && _JMPBUF_UNWINDS_ADJ (target, cbuf, adj);
cbuf = cbuf->__prev)
{
-#if _STACK_GROWS_DOWN
+#ifdef _STACK_GROWS_DOWN
if ((uintptr_t) cbuf - adj <= targetframe_adj)
{
cbuf = NULL;
break;
}
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
if ((uintptr_t) cbuf - adj >= targetframe_adj)
{
cbuf = NULL;
diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h
index fbac7d08f..fb354eaa3 100644
--- a/libpthread/nptl/pthreadP.h
+++ b/libpthread/nptl/pthreadP.h
@@ -179,7 +179,13 @@ extern struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX];
hidden_proto (__pthread_keys)
/* Number of threads running. */
-extern unsigned int __nptl_nthreads attribute_hidden;
+extern unsigned int __nptl_nthreads
+#ifdef SHARED
+ attribute_hidden
+#else
+ __attribute ((weak))
+#endif
+ ;
#ifndef __ASSUME_SET_ROBUST_LIST
/* Negative if we do not have the system call and we can use it. */
@@ -563,7 +569,13 @@ extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer,
int execute);
-extern void __nptl_deallocate_tsd (void) attribute_hidden;
+extern void __nptl_deallocate_tsd (void)
+#ifdef SHARED
+ attribute_hidden
+#else
+ __attribute ((weak))
+#endif
+ ;
extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
diff --git a/libpthread/nptl/sysdeps/generic/dl-tls.c b/libpthread/nptl/sysdeps/generic/dl-tls.c
index 4acfa4ba7..904da8b8d 100644
--- a/libpthread/nptl/sysdeps/generic/dl-tls.c
+++ b/libpthread/nptl/sysdeps/generic/dl-tls.c
@@ -66,6 +66,7 @@ oom (void)
# endif
+void *_dl_memalign(size_t alignment, size_t bytes);
void *_dl_memalign(size_t alignment, size_t bytes)
{
return _dl_malloc(bytes);
@@ -836,6 +837,7 @@ __tls_get_addr (GET_ADDR_ARGS)
+void _dl_add_to_slotinfo (struct link_map *l);
void
_dl_add_to_slotinfo (struct link_map *l)
{
diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
index b78d96483..e14fc26c6 100644
--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
+++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
@@ -110,6 +110,7 @@ init_static_tls (size_t memsz, size_t align)
GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx);
}
+void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
void
__libc_setup_tls (size_t tcbsize, size_t tcbalign)
{
@@ -241,6 +242,7 @@ _dl_tls_setup (void)
return 0;
}
+extern void __pthread_initialize_minimal(void) __attribute__((weak));
/* This is the minimal initialization function used when libpthread is
not used. */
diff --git a/libpthread/nptl/sysdeps/pthread/bits/sigthread.h b/libpthread/nptl/sysdeps/pthread/bits/sigthread.h
index 9a524e57d..e69de29bb 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/sigthread.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/sigthread.h
@@ -1,44 +0,0 @@
-/* Signal handling function for threaded programs.
- Copyright (C) 1998, 1999, 2000, 2002, 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- 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 _BITS_SIGTHREAD_H
-#define _BITS_SIGTHREAD_H 1
-
-#if !defined _SIGNAL_H && !defined _PTHREAD_H
-# error "Never include this file directly. Use <pthread.h> instead"
-#endif
-
-/* Functions for handling signals. */
-
-/* Modify the signal mask for the calling thread. The arguments have
- the same meaning as for sigprocmask(2). */
-extern int pthread_sigmask (int __how,
- __const __sigset_t *__restrict __newmask,
- __sigset_t *__restrict __oldmask)__THROW;
-
-/* Send signal SIGNO to the given thread. */
-extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
-
-#ifdef __USE_GNU
-/* Queue signal and data to a thread. */
-extern int pthread_sigqueue (pthread_t __threadid, int __signo,
- const union sigval __value) __THROW;
-#endif
-
-#endif /* bits/sigthread.h */
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h
deleted file mode 100644
index 8f63e2510..000000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 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. */
-
-#include <stdint.h>
-#include <sysdep.h>
-
-
-typedef int8_t atomic8_t;
-typedef uint8_t uatomic8_t;
-typedef int_fast8_t atomic_fast8_t;
-typedef uint_fast8_t uatomic_fast8_t;
-
-typedef int32_t atomic32_t;
-typedef uint32_t uatomic32_t;
-typedef int_fast32_t atomic_fast32_t;
-typedef uint_fast32_t uatomic_fast32_t;
-
-typedef intptr_t atomicptr_t;
-typedef uintptr_t uatomicptr_t;
-typedef intmax_t atomic_max_t;
-typedef uintmax_t uatomic_max_t;
-
-void __arm_link_error (void);
-
-#ifdef __thumb2__
-#define atomic_full_barrier() \
- __asm__ __volatile__ \
- ("movw\tip, #0x0fa0\n\t" \
- "movt\tip, #0xffff\n\t" \
- "blx\tip" \
- : : : "ip", "lr", "cc", "memory");
-#else
-#define atomic_full_barrier() \
- __asm__ __volatile__ \
- ("mov\tip, #0xffff0fff\n\t" \
- "mov\tlr, pc\n\t" \
- "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)" \
- : : : "ip", "lr", "cc", "memory");
-#endif
-
-/* Atomic compare and exchange. This sequence relies on the kernel to
- provide a compare and exchange operation which is atomic on the
- current architecture, either via cleverness on pre-ARMv6 or via
- ldrex / strex on ARMv6. */
-
-#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
- ({ __arm_link_error (); oldval; })
-
-#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
- ({ __arm_link_error (); oldval; })
-
-/* It doesn't matter what register is used for a_oldval2, but we must
- specify one to work around GCC PR rtl-optimization/21223. Otherwise
- it may cause a_oldval or a_tmp to be moved to a different register. */
-
-#ifdef __thumb2__
-/* Thumb-2 has ldrex/strex. However it does not have barrier instructions,
- so we still need to use the kernel helper. */
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \
- register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \
- register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \
- register __typeof (oldval) a_tmp __asm__ ("r3"); \
- register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \
- __asm__ __volatile__ \
- ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
- "cmp\t%[tmp], %[old2]\n\t" \
- "bne\t1f\n\t" \
- "mov\t%[old], %[old2]\n\t" \
- "movw\t%[tmp], #0x0fc0\n\t" \
- "movt\t%[tmp], #0xffff\n\t" \
- "blx\t%[tmp]\n\t" \
- "bcc\t0b\n\t" \
- "mov\t%[tmp], %[old2]\n\t" \
- "1:" \
- : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
- : [new] "r" (a_newval), [ptr] "r" (a_ptr), \
- [old2] "r" (a_oldval2) \
- : "ip", "lr", "cc", "memory"); \
- a_tmp; })
-#else
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \
- register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \
- register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \
- register __typeof (oldval) a_tmp __asm__ ("r3"); \
- register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \
- __asm__ __volatile__ \
- ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
- "cmp\t%[tmp], %[old2]\n\t" \
- "bne\t1f\n\t" \
- "mov\t%[old], %[old2]\n\t" \
- "mov\t%[tmp], #0xffff0fff\n\t" \
- "mov\tlr, pc\n\t" \
- "add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t" \
- "bcc\t0b\n\t" \
- "mov\t%[tmp], %[old2]\n\t" \
- "1:" \
- : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
- : [new] "r" (a_newval), [ptr] "r" (a_ptr), \
- [old2] "r" (a_oldval2) \
- : "ip", "lr", "cc", "memory"); \
- a_tmp; })
-#endif
-
-#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- ({ __arm_link_error (); oldval; })
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c
index 08710f1c8..79faf54bf 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c
@@ -2,4 +2,4 @@
#include <sys/time.h>
int gettimeofday (struct timeval *, struct timezone *) attribute_hidden;
-_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz);
+_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
index 7ac9ca1e9..f0e5f6b37 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
@@ -36,7 +36,7 @@
.type __##syscall_name##_nocancel,%function; \
.globl __##syscall_name##_nocancel; \
__##syscall_name##_nocancel: \
- .cfi_sections .debug_frame; \
+ cfi_sections(.debug_frame); \
cfi_startproc; \
DO_CALL (syscall_name, args); \
PSEUDO_RET; \
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
index e35374d34..15250157c 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
@@ -65,7 +65,7 @@ __asm__ (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
"_Unwind_Resume:\n"
-" .cfi_sections .debug_frame\n"
+" " CFI_SECTIONS (.debug_frame) "\n"
" " CFI_STARTPROC "\n"
" stmfd sp!, {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (16)" \n"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c
index f2795510a..642198bad 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c
@@ -25,6 +25,7 @@ extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
#pragma weak __pthread_cleanup_upto
+void _longjmp_unwind (jmp_buf env, int val);
void
_longjmp_unwind (jmp_buf env, int val)
{
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index f87532359..e59bdda44 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -163,7 +163,7 @@ __lll_timedlock_wait:
cfi_startproc
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 2eb8e29fa..5cc4256a5 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
@@ -118,7 +118,7 @@ __lll_robust_timedlock_wait:
cfi_startproc
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 3a965ad0b..645436f99 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -98,7 +98,7 @@ __pthread_cond_timedwait:
22:
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
@@ -437,14 +437,6 @@ __pthread_cond_timedwait:
/* Only clocks 0 and 1 are allowed so far. Both are handled in the
kernel. */
leaq 32(%rsp), %rsi
-# ifdef SHARED
- movq __vdso_clock_gettime@GOTPCREL(%rip), %rax
- movq (%rax), %rax
- PTR_DEMANGLE (%rax)
- jz 26f
- call *%rax
- jmp 27f
-# endif
26: movl $__NR_clock_gettime, %eax
syscall
27:
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index 3629ffbe5..15edd6149 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -96,7 +96,7 @@ pthread_rwlock_timedrdlock:
11:
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 23e1ee155..3c4a27912 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -93,7 +93,7 @@ pthread_rwlock_timedwrlock:
11:
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index 704a2223a..3ff34120c 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -61,7 +61,7 @@ sem_timedwait:
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
# ifdef __PIC__
- cmpl $0, __have_futex_clock_realtime(%rip)
+ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip)
# else
cmpl $0, __have_futex_clock_realtime
# endif
diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c
index c7e01e764..671d70208 100644
--- a/libpthread/nptl/unwind.c
+++ b/libpthread/nptl/unwind.c
@@ -30,7 +30,7 @@
#ifdef _STACK_GROWS_DOWN
# define FRAME_LEFT(frame, other, adj) \
((uintptr_t) frame - adj >= (uintptr_t) other - adj)
-#elif _STACK_GROWS_UP
+#elif defined _STACK_GROWS_UP
# define FRAME_LEFT(frame, other, adj) \
((uintptr_t) frame - adj <= (uintptr_t) other - adj)
#else
@@ -117,6 +117,9 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc)
void
attribute_protected
__cleanup_fct_attribute __attribute ((noreturn))
+#if !defined SHARED && !defined IS_IN_libpthread
+weak_function
+#endif
__pthread_unwind (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;