diff --git a/arch/arm/mcount-support.c b/arch/arm/mcount-support.c index e609c2f9e..8d23460b9 100644 --- a/arch/arm/mcount-support.c +++ b/arch/arm/mcount-support.c @@ -488,8 +488,10 @@ void mcount_arch_get_retval(struct mcount_arg_context *ctx, /* type of return value cannot be FLOAT, so check format instead */ #ifdef HAVE_ARM_HARDFP if (spec->fmt == ARG_FMT_FLOAT && use_hard_float) { - /* d0 register (64 bit) was saved below the r0 */ - memcpy(ctx->val.v, ctx->retval - 2, spec->size); + /* d0, d1 registers (64 bit) were saved below the r0 */ + long *float_retval = ctx->retval - 4; + + mcount_memcpy4(ctx->val.v, float_retval, spec->size); } else #endif /* HAVE_ARM_HARDFP */ diff --git a/libmcount/plthook.c b/libmcount/plthook.c index 2ce62cce3..919b16564 100644 --- a/libmcount/plthook.c +++ b/libmcount/plthook.c @@ -732,9 +732,6 @@ static unsigned long __plthook_entry(unsigned long *ret_addr, struct sym *sym; struct mcount_thread_data *mtdp = NULL; struct mcount_ret_stack *rstack; - struct uftrace_trigger tr = { - .flags = 0, - }; bool skip = false; bool recursion = true; enum filter_result filtered; @@ -742,6 +739,9 @@ static unsigned long __plthook_entry(unsigned long *ret_addr, struct plthook_special_func *func; unsigned long special_flag = 0; unsigned long real_addr = 0; + struct uftrace_trigger tr; + + mcount_memset4(&tr, 0, sizeof(tr)); // if necessary, implement it by architecture. child_idx = mcount_arch_child_idx(child_idx); diff --git a/libmcount/record.c b/libmcount/record.c index 4bf383c5c..ffdad5944 100644 --- a/libmcount/record.c +++ b/libmcount/record.c @@ -503,12 +503,13 @@ void save_argument(struct mcount_thread_data *mtdp, { void *argbuf = get_argbuf(mtdp, rstack); unsigned size; - struct mcount_arg_context ctx = { - .regs = regs, - .stack_base = rstack->parent_loc, - .regions = &mtdp->mem_regions, - .arch = &mtdp->arch, - }; + struct mcount_arg_context ctx; + + mcount_memset4(&ctx, 0, sizeof(ctx)); + ctx.regs = regs; + ctx.stack_base = rstack->parent_loc; + ctx.regions = &mtdp->mem_regions; + ctx.arch = &mtdp->arch; size = save_to_argbuf(argbuf, args_spec, &ctx); if (size == -1U) { @@ -526,11 +527,12 @@ void save_retval(struct mcount_thread_data *mtdp, struct list_head *args_spec = rstack->pargs; void *argbuf = get_argbuf(mtdp, rstack); unsigned size; - struct mcount_arg_context ctx = { - .retval = retval, - .regions = &mtdp->mem_regions, - .arch = &mtdp->arch, - }; + struct mcount_arg_context ctx; + + mcount_memset4(&ctx, 0, sizeof(ctx)); + ctx.retval = retval; + ctx.regions = &mtdp->mem_regions; + ctx.arch = &mtdp->arch; size = save_to_argbuf(argbuf, args_spec, &ctx); if (size == -1U) { diff --git a/tests/t083_arg_float.py b/tests/t083_arg_float.py index e4f2de8b4..024104367 100644 --- a/tests/t083_arg_float.py +++ b/tests/t083_arg_float.py @@ -31,7 +31,5 @@ def runcmd(self): # argument count follows the size of type argopt = argopt.replace('float_mul@fparg1/64,fparg2/32', 'float_mul@fparg1/64,fparg3/32') - argopt = argopt.replace('float_div@fparg1,fparg2', - 'float_div@fparg1,fparg3') return '%s %s %s' % (TestBase.uftrace_cmd, argopt, 't-' + self.name)