e354a5
commit 0455f251f494d30db4b52f11b5b0b7f285f775ef
e354a5
Author: H.J. Lu <hjl.tools@gmail.com>
e354a5
Date:   Sat Feb 1 05:44:55 2020 -0800
e354a5
e354a5
    i386: Use ENTRY/END in assembly codes
e354a5
    
e354a5
    Use ENTRY and END in assembly codes so that ENDBR32 will be added at
e354a5
    function entries when CET is enabled.
e354a5
    
e354a5
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
e354a5
---
e354a5
e354a5
diff --git a/sysdeps/i386/nptl/pthread_spin_lock.S b/sysdeps/i386/nptl/pthread_spin_lock.S
e354a5
index 1980fec..8aa081b 100644
e354a5
--- a/sysdeps/i386/nptl/pthread_spin_lock.S
e354a5
+++ b/sysdeps/i386/nptl/pthread_spin_lock.S
e354a5
@@ -15,12 +15,10 @@
e354a5
    License along with the GNU C Library; if not, see
e354a5
    <http://www.gnu.org/licenses/>.  */
e354a5
 
e354a5
+#include <sysdep.h>
e354a5
 #include <lowlevellock.h>
e354a5
 
e354a5
-	.globl	pthread_spin_lock
e354a5
-	.type	pthread_spin_lock,@function
e354a5
-	.align	16
e354a5
-pthread_spin_lock:
e354a5
+ENTRY (pthread_spin_lock)
e354a5
 	mov	4(%esp), %eax
e354a5
 1:	LOCK
e354a5
 	decl	0(%eax)
e354a5
@@ -34,4 +32,4 @@ pthread_spin_lock:
e354a5
 	cmpl	$0, 0(%eax)
e354a5
 	jg	1b
e354a5
 	jmp	2b
e354a5
-	.size	pthread_spin_lock,.-pthread_spin_lock
e354a5
+END (pthread_spin_lock)
e354a5
diff --git a/sysdeps/i386/nptl/pthread_spin_unlock.S b/sysdeps/i386/nptl/pthread_spin_unlock.S
e354a5
index 2e71086..2995001 100644
e354a5
--- a/sysdeps/i386/nptl/pthread_spin_unlock.S
e354a5
+++ b/sysdeps/i386/nptl/pthread_spin_unlock.S
e354a5
@@ -16,15 +16,14 @@
e354a5
    License along with the GNU C Library; if not, see
e354a5
    <http://www.gnu.org/licenses/>.  */
e354a5
 
e354a5
-	.globl	pthread_spin_unlock
e354a5
-	.type	pthread_spin_unlock,@function
e354a5
-	.align	16
e354a5
-pthread_spin_unlock:
e354a5
+#include <sysdep.h>
e354a5
+
e354a5
+ENTRY (pthread_spin_unlock)
e354a5
 	movl	4(%esp), %eax
e354a5
 	movl	$1, (%eax)
e354a5
 	xorl	%eax, %eax
e354a5
 	ret
e354a5
-	.size	pthread_spin_unlock,.-pthread_spin_unlock
e354a5
+END (pthread_spin_unlock)
e354a5
 
e354a5
 	/* The implementation of pthread_spin_init is identical.  */
e354a5
 	.globl	pthread_spin_init
e354a5
diff --git a/sysdeps/i386/pthread_spin_trylock.S b/sysdeps/i386/pthread_spin_trylock.S
e354a5
index 686dd8c..42cbdb7 100644
e354a5
--- a/sysdeps/i386/pthread_spin_trylock.S
e354a5
+++ b/sysdeps/i386/pthread_spin_trylock.S
e354a5
@@ -16,6 +16,7 @@
e354a5
    License along with the GNU C Library; if not, see
e354a5
    <http://www.gnu.org/licenses/>.  */
e354a5
 
e354a5
+#include <sysdep.h>
e354a5
 #include <pthread-errnos.h>
e354a5
 
e354a5
 
e354a5
@@ -25,10 +26,7 @@
e354a5
 # define LOCK lock
e354a5
 #endif
e354a5
 
e354a5
-	.globl	pthread_spin_trylock
e354a5
-	.type	pthread_spin_trylock,@function
e354a5
-	.align	16
e354a5
-pthread_spin_trylock:
e354a5
+ENTRY (pthread_spin_trylock)
e354a5
 	movl	4(%esp), %edx
e354a5
 	movl	$1, %eax
e354a5
 	xorl	%ecx, %ecx
e354a5
@@ -43,4 +41,4 @@ pthread_spin_trylock:
e354a5
 0:
e354a5
 #endif
e354a5
 	ret
e354a5
-	.size	pthread_spin_trylock,.-pthread_spin_trylock
e354a5
+END (pthread_spin_trylock)
e354a5