https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71951

--- Comment #7 from Timo Teräs <timo.teras at iki dot fi> ---
(In reply to Andrew Pinski from comment #6)
> (In reply to Timo Teräs from comment #5)
> > Not easily. It's musl, and using iterate phdr. Same build script works on
> > x86, x86_64 and armhf. It's only aarch64 misbehaving like this with omit
> > frame pointer. Any other suggestions what to try/how to debug further?
> 
> So check the unwind information to see if it is correct.
> 
> 
>    0x000003ffb7db974c <+20>:  sxtw    x1, w1
>    0x000003ffb7db9750 <+24>:  ldr     x2, [x0,x1,lsl #3]
> 
> So x0 + ((long long)(int)w1) << 3
> Or rather contex + index
> 
> And it is looking into x29 because of x1 is 29.
> 
> So it does look like the unwind information is messed up for the frame being
> looked at.

I'm not too familiar with dwarf, but I assume the section relevant from objdump
--dwarf output is:

00000120 000000000000001c 00000124 FDE cie=00000000
pc=0000000000009738..0000000000009788
  DW_CFA_advance_loc: 12 to 0000000000009744
  DW_CFA_def_cfa_offset: 16
  DW_CFA_offset: r30 (x30) at cfa-16
  DW_CFA_advance_loc: 4 to 0000000000009748
  DW_CFA_def_cfa_offset: 0
  DW_CFA_restore: r30 (x30)
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop

I can also attach the broken libgcc_s here if it helps.

Reply via email to