[PATCH][BINUTILS][AARCH64] Add support for pointer authentication B key

Nick Clifton nickc@redhat.com
Wed Dec 12 10:50:00 GMT 2018

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)

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.


More information about the Binutils mailing list