This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH 13/26] arm: Store lr in r2 around GET_TLS
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-ports at sourceware dot org
- Cc: Joseph Myers <joseph at codesourcery dot com>
- Date: Tue, 26 Feb 2013 19:16:13 -0800
- Subject: [PATCH 13/26] arm: Store lr in r2 around GET_TLS
- References: <1361934986-17018-1-git-send-email-rth@twiddle.net>
Rather than on the stack.
---
* sysdeps/unix/sysv/linux/arm/nptl/vfork.S (SAVE_PID): Save lr to r2
around the GET_TLS call.
* sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S (SAVE_PID): Likewise.
---
ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S | 8 +++-----
ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
index bc0a771..cd51122 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
@@ -19,12 +19,10 @@
/* Save the PID value. */
#define SAVE_PID \
- str lr, [sp, #-4]!; /* Save LR. */ \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
+ mov r2, lr; /* Save LR. */ \
+ cfi_register (lr, r2); \
GET_TLS; \
- ldr lr, [sp], #4; /* Restore LR. */ \
- cfi_adjust_cfa_offset (-4); \
+ mov lr, r2; /* Restore LR. */ \
cfi_restore (lr); \
NEGOFF_ADJ_BASE2(r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
ldr r3, NEGOFF_OFF1(r2, PID_OFFSET); /* Load the saved PID. */ \
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
index 3c0ef78..4007081 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
@@ -19,12 +19,10 @@
/* Save the PID value. */
#define SAVE_PID \
- str lr, [sp, #-4]!; /* Save LR. */ \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
+ mov r2, lr; /* Save LR. */ \
+ cfi_register (lr, r2); \
GET_TLS; \
- ldr lr, [sp], #4; /* Restore LR. */ \
- cfi_adjust_cfa_offset (-4); \
+ mov lr, r2; /* Restore LR. */ \
cfi_restore (lr); \
NEGOFF_ADJ_BASE2(r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
ldr r3, NEGOFF_OFF1(r2, PID_OFFSET); /* Load the saved PID. */ \
--
1.8.1.2