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