]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: Add wrapper header for <semaphore.h> with hidden __sem_post
authorFlorian Weimer <fweimer@redhat.com>
Wed, 24 Jun 2020 11:38:08 +0000 (13:38 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 24 Jun 2020 11:38:08 +0000 (13:38 +0200)
This is required to avoid a check-localplt failure due to a
sem_post call through the PLT.

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
sysdeps/htl/include/semaphore.h [new file with mode: 0644]
sysdeps/htl/sem-post.c
sysdeps/htl/sem-timedwait.c

diff --git a/sysdeps/htl/include/semaphore.h b/sysdeps/htl/include/semaphore.h
new file mode 100644 (file)
index 0000000..58fa2bf
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef        _SEMAPHORE_H
+#include_next <semaphore.h>
+
+#ifndef _ISOMAC
+extern __typeof (sem_post) __sem_post;
+libpthread_hidden_proto (__sem_post)
+#endif
+
+#endif
index fd0c6338c68ccc319258ac0c9b58afe833d2859e..720b73a05937c5843af26ad3b5956f3bbda51da7 100644 (file)
@@ -64,5 +64,5 @@ __sem_post (sem_t *sem)
 
   return 0;
 }
-
+libpthread_hidden_def (__sem_post)
 strong_alias (__sem_post, sem_post);
index fffdf36467f746c29b1be166d902607ff0ef2ce7..5095d49b284cbead9151ec9b0ae6c23a9b0eeee5 100644 (file)
@@ -167,7 +167,7 @@ out_locked:
     {
       if (ret == 0 && ctx.cancel_wake == 0)
        /* We were cancelled while waking up with a token, put it back.  */
-       sem_post (sem);
+       __sem_post (sem);
 
       __pthread_exit (PTHREAD_CANCELED);
     }