[PATCH] Fix aarch64 decoding of arm struct stat64.

Dmitry V. Levin ldv at altlinux.org
Wed Apr 9 14:14:04 UTC 2014


On Sun, Apr 06, 2014 at 12:15:57PM -0700, enh wrote:
> On Sun, Apr 6, 2014 at 8:20 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> >> diff --git a/file.c b/file.c
> >> index 7e0773d..b2790e0 100644
> >> --- a/file.c
> >> +++ b/file.c
> >> @@ -181,10 +181,6 @@ struct __old_kernel_stat {
> >>  #undef st_mtime
> >>  #undef st_ctime
> >>
> >> -#ifdef AARCH64
> >> -#define stat64 stat
> >> -#endif /* AARCH64 */
> >> -
> >>  #include <fcntl.h>
> >>  #ifdef HAVE_SYS_VFS_H
> >>  # include <sys/vfs.h>
> >
> > This hunk doesn't apply - it conflicts with commit
> > a07cfcc133f4adf5116a32b199c4230e022475da.
> 
> ah, sorry --- i'd already reverted that locally. (my patches are
> relative to Android's strace tree where i can build and test.) what
> would you like me to do?
> 
> >> @@ -1053,10 +1053,16 @@ struct stat64 {
> >>   unsigned int st_ctime;
> >>   unsigned int st_ctime_nsec;
> >>   unsigned long long st_ino;
> >> -} __attribute__((packed));
> >> +}
> >> +#if defined X86_64
> >> +__attribute__((packed))
> >> +#endif
> >> +;
> >>  # define HAVE_STAT64 1
> >> +#if defined X86_64
> >>  # define STAT64_SIZE 96
> >>  #endif
> >> +#endif
> >
> > Why do you disable STAT64_SIZE check for AARCH64?
> 
> because arm's struct stat64 is a different size than the x86 one, and
> i thought that you were just checking that the packing attribute
> worked. it's 104 bytes if you want to add that for arm, which i guess
> would protect against someone accidentally turning on packing for
> aarch64/arm.
> 
> > BTW, this hunk introduces wrong indentation.
> 
> sorry. i hadn't noticed that you indent preprocessor stuff.
> 
> do you want me to redo this patch or is it easier for you to fit it locally?

I've applied it myself, but next time please check your patches before
submitting them.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140409/ff34a15e/attachment.bin>


More information about the Strace-devel mailing list