diff options
Diffstat (limited to 'meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch')
-rw-r--r-- | meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch b/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch new file mode 100644 index 0000000000..a6579df598 --- /dev/null +++ b/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | powerpc64: fix 64-bit process detection on embedded | ||
2 | |||
3 | * syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection | ||
4 | on embedded powerpc. | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | Signed-off-by: James Yang <james.yang@freescale.com> | ||
9 | Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> | ||
10 | |||
11 | diff --git a/syscall.c.orig b/syscall.c | ||
12 | index 7efee0e..72d9453 100644 | ||
13 | --- a/syscall.c.orig | ||
14 | +++ b/syscall.c | ||
15 | @@ -1207,11 +1207,14 @@ get_scno(struct tcb *tcp) | ||
16 | /* Check for 64/32 bit mode. */ | ||
17 | if (upeek(tcp, sizeof(unsigned long)*PT_MSR, &val) < 0) | ||
18 | return -1; | ||
19 | - /* SF is bit 0 of MSR */ | ||
20 | - if (val < 0) | ||
21 | - currpers = 0; | ||
22 | - else | ||
23 | - currpers = 1; | ||
24 | + | ||
25 | + /* | ||
26 | + * Check for 64/32 bit mode. | ||
27 | + * Embedded implementations covered by Book E extension of PPC use | ||
28 | + * bit 0 (CM) of 32-bit Machine state register (MSR). | ||
29 | + * Other implementations use bit 0 (SF) of 64-bit MSR. | ||
30 | + */ | ||
31 | + currpers = (val & 0x8000000080000000) ? 0 : 1; | ||
32 | update_personality(tcp, currpers); | ||
33 | # endif | ||
34 | #elif defined(AVR32) | ||