This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][BINUTILS][AARCH64] Add support for pointer authentication B key
- From: Sam Tebbs <Sam dot Tebbs at arm dot com>
- To: "nickc at redhat dot com" <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, nd <nd at arm dot com>
- Date: Tue, 11 Dec 2018 17:25:00 +0000
- Subject: Re: [PATCH][BINUTILS][AARCH64] Add support for pointer authentication B key
- References: <2dc8e3a9-e7c9-8be2-e316-93df1045f121@arm.com> <d76532cf-c0f1-2f5f-a4b1-20df14b85ad7@redhat.com> <35629789-a182-8888-6553-14ccf5516dcd@arm.com> <4280f72f-0cae-b392-9b5e-800d4ee0a6d0@redhat.com> <42aa82df-61ed-2113-8ef3-be373f1d8259@arm.com> <7c187098-86b6-4d1e-c728-25166b39a977@redhat.com> <225eb491-00a3-97db-e82c-e29bbab00a1c@arm.com> <2a2dc23c-712c-e8fd-a2cb-ddf689fc7a60@redhat.com>
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.