]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
linux-unwind.h (aarch64_fallback_frame_state): Check for correct opcodes on BE.
authorMatthew Leach <matthew.leach@arm.com>
Thu, 28 Nov 2013 10:59:38 +0000 (10:59 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Thu, 28 Nov 2013 10:59:38 +0000 (10:59 +0000)
2013-11-26  Matthew Leach  <matthew.leach@arm.com>

* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state): Check
for correct opcodes on BE.

From-SVN: r205479

libgcc/ChangeLog
libgcc/config/aarch64/linux-unwind.h

index 586372a3b6de100a72be42987d5f6bf9bb2632ef..0107350d914ddac6e5685823a702c01c263dc8a9 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-26  Matthew Leach  <matthew.leach@arm.com>
+
+       * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state): Check
+       for correct opcodes on BE.
+
 2013-11-27  Uros Bizjak  <ubizjak@gmail.com>
 
        * soft-fp/op-4.h: Update from glibc.
index fde4d1495e7b87c498e1470a4506633297ceeb3c..8b0d7fe39e10044fb01ffdc29cb6bed7d32ff30e 100644 (file)
 #include <signal.h>
 #include <sys/ucontext.h>
 
+
+/* Since insns are always stored LE, on a BE system the opcodes will
+   be loaded byte-reversed.  Therefore, define two sets of opcodes,
+   one for LE and one for BE.  */
+
+#if __AARCH64EB__
+#define MOVZ_X8_8B     0x681180d2
+#define SVC_0          0x010000d4
+#else
+#define MOVZ_X8_8B     0xd2801168
+#define SVC_0          0xd4000001
+#endif
+
 #define MD_FALLBACK_FRAME_STATE_FOR aarch64_fallback_frame_state
 
 static _Unwind_Reason_Code
@@ -55,7 +68,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
      0xd2801168         movz x8, #0x8b
      0xd4000001         svc  0x0
    */
-  if (pc[0] != 0xd2801168 || pc[1] != 0xd4000001)
+  if (pc[0] != MOVZ_X8_8B || pc[1] != SVC_0)
     {
       return _URC_END_OF_STACK;
     }