This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] backends: Hook abi_cfi for arm.

On Thu, 2013-08-29 at 10:51 -0700, Roland McGrath wrote:
> > Note the DWARF abi extension for ARM says that "registers intentionally
> > unused" should also be initialized as if by DW_CFA_same_value.  The
> > example given is "an integer-only function might be included in one
> > executable file for targets with VFP and another for targets without".
> > We don't currently do this yet.
> Seems worthwhile to include the URL to the ABI spec that talks about
> DWARF and/or the function call ABI (we never did for the others, but
> I'm not sure there are canonical URLs for most of them).

Good idea. It is always hard to find them. This one can be found here:
"DWARF for the ARM Architecture ABI r2.09"

> We have the DW_CFA_restore hack (which I could have sworn was used
> somewhere--I thought we had abi_cfi for ppc long ago).  So perhaps the
> right thing is to use that plus explicit DW_CFA_undefined for the
> call-clobbered registers.  
> Either way, this needs to cover the VFP/NEON registers (which are half
> call-clobbered and half call-saved).

Somehow missed them because they are discussed under "5.1.2 Co-processor
Registers". But indeed they also have a calling convention defined.
"Procedure Call Standard for the ARM Architecture ABI r2.09"
I'll also add that link. Hopefully those URLs are stable.

> > +      /* The link register contains the return address setup by caller.  */
> > +      SV (14),
> Should also have:
> 	DW_CFA_register, ULEB128_7 (15), ULEB128_7 (14), /* pc = lr */

Ah, right, of course.

> > +  abi_info->return_address_register = 14; /* Link Register.  */
> I think that's wrong.  14 is LR, which is just a general register that
> happens to be where the ABI says the return address is on entry.  The
> "return_address_register" is for the "caller's PC" (a "virtual
> register" on machines where the PC is not directly addressable), so it
> should use 15 (PC).

Which makes sense with the pc = lr definition above.
Though I am sure I saw r14 used instead. Now I cannot remember
where/why. I'll double check and update the patch.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]