summaryrefslogtreecommitdiffstats
path: root/libunwind/src/UnwindRegistersRestore.S
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-02-27 21:24:02 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-02-27 21:24:02 +0000
commit0594aee52fad70d2a0b44b321579b857b8cf9244 (patch)
tree6f14b96634dacd317fc854d49c16e19c8ce7a905 /libunwind/src/UnwindRegistersRestore.S
parent5337efc69cdd59950faf0579043eb7aa8b9a3f2e (diff)
downloadbcm5719-llvm-0594aee52fad70d2a0b44b321579b857b8cf9244.tar.gz
bcm5719-llvm-0594aee52fad70d2a0b44b321579b857b8cf9244.zip
[libunwind][MIPS]: Add support for unwinding in N32 processes.
Summary: N32 uses the same register context as N64. However, N32 requires one change to properly fetch addresses from registers stored in memory. Since N32 is an ILP32 platform, getP() only fetches the first 32-bits of a stored register. For a big-endian platform this fetches the upper 32-bits which will be zero. To fix this, add a new getRegister() method to AddressSpace which is responsible for extracting the address stored in a register in memory. This matches getP() for all current ABIs except for N32 where it reads the 64-bit register and returns the low 32-bits as an address. The DwarfInstructions::getSavedRegister() method uses AddressSpace::getRegister() instead of AddressSpace::getP(). Reviewers: sdardis, compnerd Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D39074 llvm-svn: 326250
Diffstat (limited to 'libunwind/src/UnwindRegistersRestore.S')
-rw-r--r--libunwind/src/UnwindRegistersRestore.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S
index d7744145a75..a3ba4d14716 100644
--- a/libunwind/src/UnwindRegistersRestore.S
+++ b/libunwind/src/UnwindRegistersRestore.S
@@ -799,7 +799,8 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind14Registers_or1k6jumptoEv)
l.jr r9
l.nop
-#elif defined(__mips__) && defined(_ABIO32) && defined(__mips_soft_float)
+#elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32 && \
+ defined(__mips_soft_float)
//
// void libunwind::Registers_mips_o32::jumpto()
@@ -855,7 +856,7 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind18Registers_mips_o326jumptoEv)
lw $4, (4 * 4)($4)
.set pop
-#elif defined(__mips__) && defined(_ABI64) && defined(__mips_soft_float)
+#elif defined(__mips64) && defined(__mips_soft_float)
//
// void libunwind::Registers_mips_newabi::jumpto()
OpenPOWER on IntegriCloud