[PATCH][BINUTILS][AARCH64] Add support for pointer authentication B key
Sam Tebbs
Sam.Tebbs@arm.com
Tue Dec 11 17:25:00 GMT 2018
On 12/11/18 5:13 PM, Nick Clifton wrote:
> Hi Sam,
>
>> binutils/ChangeLog:
>> 2018-12-11 Sam Tebbs <sam.tebbs@arm.com>
>>
>> * dwarf.c (read_cie): Add check for 'B'.
>>
>> gas/ChangeLog:
>> 2018-12-11 Sam Tebbs <sam.tebbs@arm.com>
>>
>> * config/tc-aarch64.h (enum pointer_auth_key,
>> tc_fde_entry_extras, tc_cie_entry_extras, tc_fde_entry_init_extra,
>> tc_output_cie_extra, tc_cie_fde_equivalent_extra,
>> tc_cie_entry_init_extra):
>> Define.
>> * dw2gencfi.c (struct cie_entry): Add tc_cie_entry_extras invocation.
>> (alloc_fde_entry, select_cie_for_fde): Add tc_fde_entry_init_extra
>> invocation.
>> (output_cie): Add tc_output_cie_extra invocation.
>> (select_cie_for_fde): Add tc_cie_fde_equivalent_extra invocation.
>> * dw2gencfi.h (enum pointer_auth_key): Move to config/tc-aarch64.h.
>> (struct fde_entry): Add tc_fde_entry_extras invocation
> Approved (again :-).
Thanks! (again :) ).
>
> One thing did catch my eye:
>
> +#define tc_output_cie_extra(cie) if (cie->pauth_key == AARCH64_PAUTH_KEY_B) \
> + out_one ('B');
>
> Normally this would be written as:
>
> #define tc_output_cie_extra(cie) \
> do \
> { \
> if (cie->pauth_key == AARCH64_PAUTH_KEY_B) \
> out_one ('B'); \
> } \
> while (0)
>
> (Note - no semi-colon at the end).
>
> I could not think of a sceanario where your version would cause problems,
> but I thought that you ought to know about the (unofficial) convention,
>
> Cheers
> Nick
That's an interesting convention! I don't really see the use of the loop.
I can commit this with the convention if you'd like, otherwise I can get
it committed right away.
More information about the Binutils
mailing list