From: Dmitry V. Levin Date: Tue, 23 Aug 2016 14:49:20 +0000 (+0000) Subject: x86_64: provide a replacement of for x32 personality X-Git-Tag: v4.14~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d81b3b35f2d03f53b6fe44fc2f38fde165179b7;p=strace x86_64: provide a replacement of for x32 personality For the reason described in commit v4.10-517-gcfde1e3, a correct definition of struct stat for x32 personality is necessary to enable "asm_stat.h" with -mx32 on x86_64. * linux/x32/asm_stat.h: Rename to ... * linux/x86_64/asm_stat.h: ... new file. * Makefile.am (strace_SOURCES): Add it. * linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h". --- diff --git a/Makefile.am b/Makefile.am index 32d2092c..cae411d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -147,6 +147,7 @@ strace_SOURCES = \ link.c \ linux/asm_stat.h \ linux/x32/asm_stat.h \ + linux/x86_64/asm_stat.h \ lookup_dcookie.c \ loop.c \ lseek.c \ diff --git a/linux/x32/asm_stat.h b/linux/x32/asm_stat.h index 467c8f0e..865aa4a0 100644 --- a/linux/x32/asm_stat.h +++ b/linux/x32/asm_stat.h @@ -1,39 +1 @@ -#ifndef STRACE_X32_ASM_STAT_H -#define STRACE_X32_ASM_STAT_H - -# if defined __x86_64__ && defined __ILP32__ -# define stat redirect_kernel_stat -# endif - -# include "linux/asm_stat.h" - -# if defined __x86_64__ && defined __ILP32__ -# undef stat -/* - * This is a replacement for x32 which - * appears to be wrong in older kernel headers. - */ -struct stat { - kernel_ulong_t st_dev; - kernel_ulong_t st_ino; - kernel_ulong_t st_nlink; - unsigned int st_mode; - unsigned int st_uid; - unsigned int st_gid; - unsigned int pad0__; - kernel_ulong_t st_rdev; - kernel_long_t st_size; - kernel_long_t st_blksize; - kernel_long_t st_blocks; - kernel_ulong_t st_atime; - kernel_ulong_t st_atime_nsec; - kernel_ulong_t st_mtime; - kernel_ulong_t st_mtime_nsec; - kernel_ulong_t st_ctime; - kernel_ulong_t st_ctime_nsec; - kernel_long_t pad1__[3]; -}; - -# endif /* __x86_64__ && __ILP32__ */ - -#endif /* !STRACE_X32_ASM_STAT_H */ +#include "x86_64/asm_stat.h" diff --git a/linux/x86_64/asm_stat.h b/linux/x86_64/asm_stat.h new file mode 100644 index 00000000..a563f087 --- /dev/null +++ b/linux/x86_64/asm_stat.h @@ -0,0 +1,39 @@ +#ifndef STRACE_X86_64_ASM_STAT_H +#define STRACE_X86_64_ASM_STAT_H + +# if defined __x86_64__ && defined __ILP32__ +# define stat redirect_kernel_stat +# endif + +# include "linux/asm_stat.h" + +# if defined __x86_64__ && defined __ILP32__ +# undef stat +/* + * This is a replacement for x32 which + * appears to be wrong in older kernel headers. + */ +struct stat { + kernel_ulong_t st_dev; + kernel_ulong_t st_ino; + kernel_ulong_t st_nlink; + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int pad0__; + kernel_ulong_t st_rdev; + kernel_long_t st_size; + kernel_long_t st_blksize; + kernel_long_t st_blocks; + kernel_ulong_t st_atime; + kernel_ulong_t st_atime_nsec; + kernel_ulong_t st_mtime; + kernel_ulong_t st_mtime_nsec; + kernel_ulong_t st_ctime; + kernel_ulong_t st_ctime_nsec; + kernel_long_t pad1__[3]; +}; + +# endif /* __x86_64__ && __ILP32__ */ + +#endif /* !STRACE_X86_64_ASM_STAT_H */