arm/linux: Fix build after a5214472
The build broke because x30 was used instead of r14 in place of LR
which gcc doesn't recognize when building for 64-bit ARM. gcc does
recognize LR for 32-bit ARM, however, so revert to that since it's
more readable.
Also, de-duplicate saving of FP/IP which are synonyms of r11/r12,
saved above.
Change-Id: I8ae28f430cc3c47f4e4cf3679383ed5b94fadd2e
Reviewed-on: https://chromium-review.googlesource.com/1217483
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
diff --git a/util/misc/capture_context_linux.S b/util/misc/capture_context_linux.S
index f2b066b..f4216fd 100644
--- a/util/misc/capture_context_linux.S
+++ b/util/misc/capture_context_linux.S
@@ -257,16 +257,14 @@
// Restore r0.
sub r0, r0, #0x24
- // Save named general purpose registers.
- str FP, [r0, #0x4c] // context->uc_mcontext.fp
- str IP, [r0, #0x50] // context->uc_mcontext.ip
+ // Save SP/r13.
str SP, [r0, #0x54] // context->uc_mcontext.sp
// The original LR can't be recovered.
- str x30, [r0, #0x58] // context->uc_mcontext.lr
+ str LR, [r0, #0x58] // context->uc_mcontext.lr
// The link register holds the return address for this function.
- str x30, [r0, #0x5c] // context->uc_mcontext.pc
+ str LR, [r0, #0x5c] // context->uc_mcontext.pc
// Use r1 as a scratch register.