]> granicus.if.org Git - strace/commitdiff
ARM EABI: fix 64-bit syscall's arguments decoding
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 28 May 2011 20:47:43 +0000 (20:47 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 30 May 2011 21:14:55 +0000 (21:14 +0000)
ARM OABI and ARM EABI have different function parameters passing rules.
With EABI, 64-bit function parameters passed in registers are aligned to
an even-numbered register instead of using the next available pair, see
http://lkml.org/lkml/2006/1/12/175
This rule also applies to syscall's arguments.

* linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64,
readahead, preadv, pwritev): Fix number of arguments.
* util.c (printllval): Align 64bit argument to 64bit boundary on
__ARM_EABI__.

Reported-by: Damir Shayhutdinov <damir@altlinux.org>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
linux/arm/syscallent.h
util.c

index 784b986767f4bae038526b165d6a4c06695bafe9..596990041cd9d7b9a18ba6b39674eea73448409f 100644 (file)
        { 3,    TS,     sys_rt_sigqueueinfo,    "rt_sigqueueinfo"}, /* 178 */
        { 2,    TS,     sys_rt_sigsuspend,      "rt_sigsuspend" }, /* 179 */
 
-       { 5,    TF,     sys_pread,              "pread"         }, /* 180 */
-       { 5,    TF,     sys_pwrite,             "pwrite"        }, /* 181 */
+       { 6,    TF,     sys_pread,              "pread"         }, /* 180 */
+       { 6,    TF,     sys_pwrite,             "pwrite"        }, /* 181 */
        { 3,    TF,     sys_chown,              "chown"         }, /* 182 */
        { 2,    TF,     sys_getcwd,             "getcwd"        }, /* 183 */
        { 2,    0,      sys_capget,             "capget"        }, /* 184 */
        { 0,    TP,     sys_vfork,              "vfork"         }, /* 190 */
        { 2,    0,      sys_getrlimit,          "getrlimit"     }, /* 191 */
        { 6,    TD,     sys_mmap,               "mmap2"         }, /* 192 */
-       { 3,    TF,     sys_truncate64,         "truncate64"    }, /* 193 */
-       { 3,    TF,     sys_ftruncate64,        "ftruncate64"   }, /* 194 */
+       { 4,    TF,     sys_truncate64,         "truncate64"    }, /* 193 */
+       { 4,    TF,     sys_ftruncate64,        "ftruncate64"   }, /* 194 */
        { 2,    TF,     sys_stat64,             "stat64"        }, /* 195 */
        { 2,    TF,     sys_lstat64,            "lstat64"       }, /* 196 */
        { 2,    TF,     sys_fstat64,            "fstat64"       }, /* 197 */
        { 5,    0,      printargs,              "SYS_222"       }, /* 222 */
        { 5,    0,      printargs,              "SYS_223"       }, /* 223 */
        { 0,    0,      printargs,              "gettid"        }, /* 224 */
-       { 4,    0,      sys_readahead,          "readahead"     }, /* 225 */
+       { 5,    0,      sys_readahead,          "readahead"     }, /* 225 */
        { 5,    TF,     sys_setxattr,           "setxattr"      }, /* 226 */
        { 5,    TF,     sys_setxattr,           "lsetxattr"     }, /* 227 */
        { 5,    0,      sys_fsetxattr,          "fsetxattr"     }, /* 228 */
        { 3,    TD,     sys_dup3,               "dup3"          }, /* 358 */
        { 2,    TD,     sys_pipe2,              "pipe2"         }, /* 359 */
        { 1,    TD,     sys_inotify_init1,      "inotify_init1" }, /* 360 */
-       { 5,    TD,     sys_preadv,             "preadv"        }, /* 361 */
-       { 5,    TD,     sys_pwritev,            "pwritev"       }, /* 362 */
+       { 6,    TD,     sys_preadv,             "preadv"        }, /* 361 */
+       { 6,    TD,     sys_pwritev,            "pwritev"       }, /* 362 */
        { 4,    TP|TS,  printargs,              "rt_tgsigqueueinfo"}, /* 363 */
        { 5,    TD,     printargs,              "perf_event_open"}, /* 364 */
        { 5,    TN,     sys_recvmmsg,           "recvmmsg"      }, /* 365 */
diff --git a/util.c b/util.c
index c8eab85e73282d4546ce8ec2ee75ec92c5249e5c..d05f777682c5b6450c50ebaed956ef1caa1e9fb8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -243,7 +243,8 @@ printllval(struct tcb *tcp, const char *format, int llarg)
 {
 # if defined(FREEBSD) \
      || (defined(LINUX) && defined(POWERPC) && !defined(POWERPC64)) \
-     || defined (LINUX_MIPSO32)
+     || defined(LINUX_MIPSO32) \
+     || defined(__ARM_EABI__)
        /* Align 64bit argument to 64bit boundary.  */
        if (llarg % 2) llarg++;
 # endif