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