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
On 12/13/18 8:30 PM, Christophe Lyon wrote:
> 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
Hi Christophe,
Thanks for noticing that, it should now be fixed by Jeff Law's change
(commit c680338). Thanks to Jeff for sorting it out.