A structure typedef may be abstract, while an array typedef cannot. Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- linux-user/elfload.c | 60 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 29 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fce4c05674..ba205c5a19 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -154,7 +154,9 @@ typedef abi_int target_pid_t; #define ELF_ARCH EM_X86_64 #define ELF_NREG 27 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; /* * Note that ELF_NREG should be 29 as there should be place for @@ -163,35 +165,35 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { - (*regs)[0] = tswapreg(env->regs[15]); - (*regs)[1] = tswapreg(env->regs[14]); - (*regs)[2] = tswapreg(env->regs[13]); - (*regs)[3] = tswapreg(env->regs[12]); - (*regs)[4] = tswapreg(env->regs[R_EBP]); - (*regs)[5] = tswapreg(env->regs[R_EBX]); - (*regs)[6] = tswapreg(env->regs[11]); - (*regs)[7] = tswapreg(env->regs[10]); - (*regs)[8] = tswapreg(env->regs[9]); - (*regs)[9] = tswapreg(env->regs[8]); - (*regs)[10] = tswapreg(env->regs[R_EAX]); - (*regs)[11] = tswapreg(env->regs[R_ECX]); - (*regs)[12] = tswapreg(env->regs[R_EDX]); - (*regs)[13] = tswapreg(env->regs[R_ESI]); - (*regs)[14] = tswapreg(env->regs[R_EDI]); - (*regs)[15] = tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - (*regs)[16] = tswapreg(env->eip); - (*regs)[17] = tswapreg(env->segs[R_CS].selector & 0xffff); - (*regs)[18] = tswapreg(env->eflags); - (*regs)[19] = tswapreg(env->regs[R_ESP]); - (*regs)[20] = tswapreg(env->segs[R_SS].selector & 0xffff); - (*regs)[21] = tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[22] = tswapreg(env->segs[R_GS].selector & 0xffff); - (*regs)[23] = tswapreg(env->segs[R_DS].selector & 0xffff); - (*regs)[24] = tswapreg(env->segs[R_ES].selector & 0xffff); - (*regs)[25] = tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[26] = tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[0] = tswapreg(env->regs[15]); + r->regs[1] = tswapreg(env->regs[14]); + r->regs[2] = tswapreg(env->regs[13]); + r->regs[3] = tswapreg(env->regs[12]); + r->regs[4] = tswapreg(env->regs[R_EBP]); + r->regs[5] = tswapreg(env->regs[R_EBX]); + r->regs[6] = tswapreg(env->regs[11]); + r->regs[7] = tswapreg(env->regs[10]); + r->regs[8] = tswapreg(env->regs[9]); + r->regs[9] = tswapreg(env->regs[8]); + r->regs[10] = tswapreg(env->regs[R_EAX]); + r->regs[11] = tswapreg(env->regs[R_ECX]); + r->regs[12] = tswapreg(env->regs[R_EDX]); + r->regs[13] = tswapreg(env->regs[R_ESI]); + r->regs[14] = tswapreg(env->regs[R_EDI]); + r->regs[15] = tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[16] = tswapreg(env->eip); + r->regs[17] = tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[18] = tswapreg(env->eflags); + r->regs[19] = tswapreg(env->regs[R_ESP]); + r->regs[20] = tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[21] = tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[22] = tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[23] = tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[24] = tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[25] = tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[26] = tswapreg(env->segs[R_GS].selector & 0xffff); } #if ULONG_MAX > UINT32_MAX -- 2.43.0