about summary refs log tree commit diff
path: root/sysdeps/i386/nptl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-02-01 05:44:55 -0800
committerH.J. Lu <hjl.tools@gmail.com>2020-02-01 05:44:55 -0800
commit0455f251f494d30db4b52f11b5b0b7f285f775ef (patch)
treed5dff22537a00b82c0e73286ec1cc959c8584367 /sysdeps/i386/nptl
parent825b58f3fb04781e559858510fe83a8c4bf28425 (diff)
downloadglibc-0455f251f494d30db4b52f11b5b0b7f285f775ef.tar.gz
glibc-0455f251f494d30db4b52f11b5b0b7f285f775ef.tar.xz
glibc-0455f251f494d30db4b52f11b5b0b7f285f775ef.zip
i386: Use ENTRY/END in assembly codes
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>
Diffstat (limited to 'sysdeps/i386/nptl')
-rw-r--r--sysdeps/i386/nptl/pthread_spin_lock.S8
-rw-r--r--sysdeps/i386/nptl/pthread_spin_unlock.S9
2 files changed, 7 insertions, 10 deletions
diff --git a/sysdeps/i386/nptl/pthread_spin_lock.S b/sysdeps/i386/nptl/pthread_spin_lock.S
index 5736c82078..10a2a73f02 100644
--- a/sysdeps/i386/nptl/pthread_spin_lock.S
+++ b/sysdeps/i386/nptl/pthread_spin_lock.S
@@ -15,12 +15,10 @@
    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)
diff --git a/sysdeps/i386/nptl/pthread_spin_unlock.S b/sysdeps/i386/nptl/pthread_spin_unlock.S
index e7757d0a03..fe46f5ccb1 100644
--- a/sysdeps/i386/nptl/pthread_spin_unlock.S
+++ b/sysdeps/i386/nptl/pthread_spin_unlock.S
@@ -16,15 +16,14 @@
    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