Skip to content

Commit e139054

Browse files
committed
[Unwind][AArch64] Match sigreturn instructions in big endian
1 parent 287ca7b commit e139054

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libunwind/src/UnwindCursor.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
#include "RWMutex.hpp"
5959
#include "Unwind-EHABI.h"
6060

61+
#if defined(__AARCH64EB__)
62+
#define MOVZ_X8_8B 0x681180d2
63+
#define SVC_0 0x010000d4
64+
#else
65+
#define MOVZ_X8_8B 0xd2801168
66+
#define SVC_0 0xd4000001
67+
#endif
68+
6169
#if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)
6270
// Provide a definition for the DISPATCHER_CONTEXT struct for old (Win7 and
6371
// earlier) SDKs.
@@ -2827,7 +2835,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
28272835
return false;
28282836
auto *instructions = reinterpret_cast<const uint32_t *>(pc);
28292837
// Look for instructions: mov x8, #0x8b; svc #0x0
2830-
if (instructions[0] != 0xd2801168 || instructions[1] != 0xd4000001)
2838+
if (instructions[0] != MOVZ_X8_8B || instructions[1] != SVC_0)
28312839
return false;
28322840

28332841
_info = {};

0 commit comments

Comments
 (0)