]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
i386: Use ENTRY/END in assembly codes
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)
Use ENTRY and END in assembly codes so that ENDBR32 will be added at
function entries when CET is enabled.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/i386/nptl/pthread_spin_lock.S
sysdeps/i386/nptl/pthread_spin_unlock.S
sysdeps/i386/pthread_spin_trylock.S

index 5736c82078e44884a72e355ff23aa790862d3d32..10a2a73f02d7456930d7e6d86aad2395134ceb72 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <sysdep.h>
 #include <lowlevellock.h>
 
-       .globl  pthread_spin_lock
-       .type   pthread_spin_lock,@function
-       .align  16
-pthread_spin_lock:
+ENTRY (pthread_spin_lock)
        mov     4(%esp), %eax
 1:     LOCK
        decl    0(%eax)
@@ -34,4 +32,4 @@ pthread_spin_lock:
        cmpl    $0, 0(%eax)
        jg      1b
        jmp     2b
-       .size   pthread_spin_lock,.-pthread_spin_lock
+END (pthread_spin_lock)
index e7757d0a03d49610a2b555fde5ca83f59ef1c484..fe46f5ccb1ac0d7fbdc0af512c7ec8c9a09d559f 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-       .globl  pthread_spin_unlock
-       .type   pthread_spin_unlock,@function
-       .align  16
-pthread_spin_unlock:
+#include <sysdep.h>
+
+ENTRY (pthread_spin_unlock)
        movl    4(%esp), %eax
        movl    $1, (%eax)
        xorl    %eax, %eax
        ret
-       .size   pthread_spin_unlock,.-pthread_spin_unlock
+END (pthread_spin_unlock)
 
        /* The implementation of pthread_spin_init is identical.  */
        .globl  pthread_spin_init
index dd08d38f8d5b3cf619414d88c8d2e8f870d8aee9..949879c6031904e2db50fdb8eebf1a90184f9a53 100644 (file)
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <sysdep.h>
 #include <pthread-errnos.h>
 
 
 # define LOCK lock
 #endif
 
-       .globl  pthread_spin_trylock
-       .type   pthread_spin_trylock,@function
-       .align  16
-pthread_spin_trylock:
+ENTRY (pthread_spin_trylock)
        movl    4(%esp), %edx
        movl    $1, %eax
        xorl    %ecx, %ecx
@@ -43,4 +41,4 @@ pthread_spin_trylock:
 0:
 #endif
        ret
-       .size   pthread_spin_trylock,.-pthread_spin_trylock
+END (pthread_spin_trylock)