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: Nick Clifton <nickc at redhat dot com>
- To: Sam Tebbs <Sam dot Tebbs at arm 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: Wed, 12 Dec 2018 10:50:25 +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> <ad32f591-2f10-1b38-98a3-f22451335922@arm.com>
Hi Sam,
>> 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).
> That's an interesting convention! I don't really see the use of the loop.
It is there so that programmers can do:
if (foo)
tc_output_cie_extra (bar);
if (baz)
blah;
With your version you might get a warning from the compiler about the "if (baz)"
conditional not being clearly associated with a previous if() statement.
> I can commit this with the convention if you'd like, otherwise I can get
> it committed right away.
I think that I prefer my way. :-) Sorry, but your patch is still approved with this change made.
Cheers
Nick