summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-02-11 21:22:57 +0000
committerRenato Golin <renato.golin@linaro.org>2016-02-11 21:22:57 +0000
commita6a92a4421831bfc41b5bb85cfbd3ae4fdba056c (patch)
treec806694aa3a34358be238bb9084545c25ca3251d
parent7bd6a225e816ec4776e6d242992dda178dd09a4b (diff)
downloadbcm5719-llvm-a6a92a4421831bfc41b5bb85cfbd3ae4fdba056c.tar.gz
bcm5719-llvm-a6a92a4421831bfc41b5bb85cfbd3ae4fdba056c.zip
[AArch64] Fix libunwind build when using GNU assembler
Use x29 and x30 for fp and lr respectively. This does not change the code generation with integrated asm but using x30 and x29 helps compile the code with gnu as. Currently gas fails to assemble this code with errors as below. Error: operand X should be an integer register. Newer versions of binutils should be fixed, but enough exists in the wild to make this change harmless and worthy. Patch by Khem Raj. llvm-svn: 260595
-rw-r--r--libunwind/src/UnwindRegistersRestore.S6
-rw-r--r--libunwind/src/UnwindRegistersSave.S6
2 files changed, 6 insertions, 6 deletions
diff --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S
index 3a4ea62f6e2..d5ecc6ed2ac 100644
--- a/libunwind/src/UnwindRegistersRestore.S
+++ b/libunwind/src/UnwindRegistersRestore.S
@@ -282,8 +282,8 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Registers_arm646jumptoEv)
ldp x22,x23, [x0, #0x0B0]
ldp x24,x25, [x0, #0x0C0]
ldp x26,x27, [x0, #0x0D0]
- ldp x28,fp, [x0, #0x0E0]
- ldr lr, [x0, #0x100] // restore pc into lr
+ ldp x28,x29, [x0, #0x0E0]
+ ldr x30, [x0, #0x100] // restore pc into lr
ldr x1, [x0, #0x0F8]
mov sp,x1 // restore sp
@@ -306,7 +306,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Registers_arm646jumptoEv)
ldr d31, [x0, #0x208]
ldp x0, x1, [x0, #0x000] // restore x0,x1
- ret lr // jump to pc
+ ret x30 // jump to pc
#elif defined(__arm__) && !defined(__APPLE__)
diff --git a/libunwind/src/UnwindRegistersSave.S b/libunwind/src/UnwindRegistersSave.S
index f84b7114f77..82becffa0e4 100644
--- a/libunwind/src/UnwindRegistersSave.S
+++ b/libunwind/src/UnwindRegistersSave.S
@@ -263,11 +263,11 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext)
stp x22,x23, [x0, #0x0B0]
stp x24,x25, [x0, #0x0C0]
stp x26,x27, [x0, #0x0D0]
- stp x28,fp, [x0, #0x0E0]
- str lr, [x0, #0x0F0]
+ stp x28,x29, [x0, #0x0E0]
+ str x30, [x0, #0x0F0]
mov x1,sp
str x1, [x0, #0x0F8]
- str lr, [x0, #0x100] // store return address as pc
+ str x30, [x0, #0x100] // store return address as pc
// skip cpsr
stp d0, d1, [x0, #0x110]
stp d2, d3, [x0, #0x120]
OpenPOWER on IntegriCloud