diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2014-11-11 14:12:00 +0200 |
---|---|---|
committer | Koen Kooi <koen.kooi@linaro.org> | 2014-11-12 13:38:57 +0000 |
commit | 28ab590af355aa1d464577f85a32536ac702271a (patch) | |
tree | 0b9c9161a3d188c78779bf6c775be410866f00b0 | |
parent | 2aec64a6d04c8a6b6115159349eb76873bad04ba (diff) |
strace: fix strace-arm-be8 patch for 4.9 release
Change-Id: Ief1aa78fe443cf6fdef9716656df4badb21000a5
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rw-r--r-- | meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch | 52 | ||||
-rw-r--r-- | meta-bigendian/recipes-devtools/strace/strace_%.bbappend (renamed from meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend) | 0 |
2 files changed, 35 insertions, 17 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 index d9cce72b..bda48074 100644 --- 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 @@ -1,19 +1,37 @@ -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; - +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> +--- + syscall.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/syscall.c ++++ b/syscall.c +@@ -1374,6 +1374,16 @@ get_scno(struct tcb *tcp) + scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL); + 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); ++ /* 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 */ ++ + /* EABI syscall convention? */ + if (scno != 0xef000000) { + /* No, it's OABI */ diff --git a/meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend index 3f3d73e0..3f3d73e0 100644 --- a/meta-bigendian/recipes-devtools/strace/strace_4.8.bbappend +++ b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend |