aboutsummaryrefslogtreecommitdiff
path: root/meta-bigendian
diff options
context:
space:
mode:
authorVictor Kamensky <victor.kamensky@linaro.org>2013-08-08 20:37:01 -0700
committerRiku Voipio <riku.voipio@linaro.org>2013-08-19 15:51:03 +0300
commitb14a568e7e67a76fcad59f557c7564fa8bdc1538 (patch)
tree537e5bc4d8bb4b0fab1573caf1f19fa956b2a67a /meta-bigendian
parentcc0d3e766c2f75a80ee8de8f3d39ef7a7c44fc68 (diff)
strace: fix system call matching code in get_scno for be8 arm
on ARM V7 operating in big endian mode strace does not work: root@genericarmv7ab:~# strace ls pid 1356 unknown syscall trap 0x000000ef it happens because ARM V7 when runs as big endian operates in be8 mode, where instruction are still in little endian form. Strace get_scno reads instructions and matches it to certain pattern, but in armeb case it needs to byteswap it before that. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'meta-bigendian')
-rw-r--r--meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch19
-rw-r--r--meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend3
2 files changed, 22 insertions, 0 deletions
diff --git a/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch
new file mode 100644
index 00000000..c0d4043d
--- /dev/null
+++ b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch
@@ -0,0 +1,19 @@
+Index: strace-4.8/syscall.c
+===================================================================
+--- strace-4.8.orig/syscall.c
++++ strace-4.8/syscall.c
+@@ -1355,6 +1355,14 @@ get_scno(struct tcb *tcp)
+ if (errno)
+ return -1;
+
++#if defined(__ARMEB__) && defined(__ARM_ARCH_7A__)
++ /* We running big endian arm on ARMv7: instructions are
++ * in little endian form so we need to byteswap it. Note
++ * on older ARM like V5 Xscale code is in big endian form
++ * byte swap is not needed in this case. I.e be8 vs be32.
++ */
++ scno = __builtin_bswap32(scno);
++#endif /* __ARMEB__ && __ARM_ARCH_7A__ */
+ /* EABI syscall convention? */
+ if (scno == 0xef000000) {
+ scno = arm_regs.ARM_r7; /* yes */
diff --git a/meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend b/meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend
new file mode 100644
index 00000000..03276d65
--- /dev/null
+++ b/meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+SRC_URI += "file://strace-4.8-arm-be8.patch"