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: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: nick clifton <nickc at redhat dot com>
- Cc: Sam dot Tebbs at arm dot com, binutils <binutils at sourceware dot org>, 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: Thu, 13 Dec 2018 21:30:32 +0100
- 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> <f4575424-c264-5570-118f-5169b82ef87b@redhat.com>
On Wed, 12 Dec 2018 at 11:50, Nick Clifton <nickc@redhat.com> wrote:
>
> 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
>
>
Hi Sam,
You patch broke the build:
../../gas/dw2gencfi.c: In function 'output_cie':
../../gas/dw2gencfi.c:1868:5: error: expected ';' before '}' token
}
^
../../gas/dw2gencfi.c:1931:1: error: invalid storage class for
function 'output_fde'
output_fde (struct fde_entry *fde, struct cie_entry *cie,
^
../../gas/dw2gencfi.c: In function 'output_fde':
../../gas/dw2gencfi.c:1931:54: error: declaration of 'cie' shadows a
parameter [-Werror=shadow]
[...]
Christophe