[PATCH 0/6] Fix unwinding through sigreturn trampolines

Dave Martin Dave.Martin at arm.com
Wed Jul 8 12:57:32 EDT 2020


On Mon, Jul 06, 2020 at 09:29:24AM +0000, Daniel Kiss wrote:
> Hi Ard,
> 
> I like your suggestions and tuned a bit and now it works with the LLVM’s unwinders.
> 
> Register 96 is out of the DWARF spec[1] and will collide with SVE registers[2] so 32 is better which is the reserved register for PC.
> 
> my version:
> 
> #define ARM64_SIGFRAME_REGS_OFFSET 312 /* offsetof (struct rt_sigframe, uc.uc_mcontext.regs) */
> 
>     .text
>     .cfi_startproc
>     .cfi_signal_frame
>     
>     .cfi_def_cfa    sp, ARM64_SIGFRAME_REGS_OFFSET
>     .irp x, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
>         13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,  \
>         24, 25, 26, 27, 28, 29, 30, 31
>     .cfi_offset \x, \x * 8
>     .endr
> 
>     .cfi_offset 32, 32 * 8 // regs->pc
>     .cfi_return_column 32

Have you verified that this works with the GNU unwinders?  I seem to
remember experimenting with .cfi_return_column in the past and hitting
problems when trying to use a fake register.

At the time I just assumed I was doing something wrong and didn't go
digging.  Maybe I _was_ doing something wrong...

Cheers
---Dave



More information about the linux-arm-kernel mailing list