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

Sam Tebbs Sam.Tebbs@arm.com
Tue Nov 20 16:41:00 GMT 2018


On 11/9/18 4:31 PM, Nick Clifton wrote:
> Hi Sam,
>
>>>> The DWARF extensions for ARM therefore
>>> Are these extensions documented somewhere ?
>> There is no public documentation for this approach as it was agreed upon
>> internally with those implementing support in LLVM. I have documented
>> this in gas/doc/c-aarch64.texi, would you like me to refer to that
>> section from the relevant source code?
> No.  I was just hoping that there would be a pdf accessible on the web
> somewhere that contained a description of the exntensions to the CFI
> encoding used by AArch64.  In the past ARM have been very good about
> creating such documents... :-)
>
> [Ah - just read Ramana's email, so it looks like this point is now covered.
> Please could the Dwarf supplement be referenced in a comment in the revised
> patch set ?]
>
I will have to follow up with the revision once it is published which 
there is no concrete ETA for yet.

>>> Did you also test on an non AArch64 configuration, just to be sure,  eg x86_64-pc-linux-gnu ?
>> I haven't actually, but will do so and report back. Would just this
>> other configuration suffice?
> Yes.  I am not actually expecting any problems.  But testing the
> most popular non-ARM target configuration would be a good idea.

I have now successfully tested and built the patch on 
x86_64-pc-linux-gnu with no problems.

>> Adding a definition of the encoding character to a header could perhaps
>> coincide with your suggestions below, in that I could add a macro called
>> "tc_is_valid_aug_char" which the target defines. That would mean we
>> could avoid having such an encoding definition in a target-agnostic
>> file. Let me know what you think.
> The tc_xxx terminology is only used inside gas, whereas we want these characters
> to be processed in lots of different places, (gas, libbfd, readelf, etc).  So I
> think that you might need to put the encoding characters into a more generic
> header file like include/elf/common.h or maybe include/elf/cfi.h.
>
As you suggested in an earlier email, I think I will follow up with a 
change to this in a later patch rather than include it in this one.

Attached is a revised patch with the target hooks implemented and 
target-specific definitions (pointer_auth_key etc.).

bfd/

2018-11-20  Sam Tebbs  <sam.tebbs@arm.com>

     * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Add check for 'B'.

binutils/

2018-11-20  Sam Tebbs  <sam.tebbs@arm.com>

     * dwarf.c (read_cie): Add check for 'B'.

gas/

2018-11-20  Sam Tebbs  <sam.tebbs@arm.com>

     * dw2gencfi.c (struct cie_entry): Add tc_cie_entry_extras invocation.
     (alloc_fde_entry): 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 and 
tc_cie_entry_init_extra
     invocation.
     (frch_cfi_data, cfa_save_data): Move to dwgencfi.h.
     * config/tc-aarch64.c (s_aarch64_cfi_b_key_frame): Declare.
     (md_pseudo_table): Add "cfi_b_key_frame".
     * config/tc-aarch64.h (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.h (struct fde_entry): Add tc_fde_entry_extras invocation.
     (pointer_auth_key): Define.
     (frch_cfi_data, cfa_save_data): Move from dwgencfi.c.

gas/doc/

2018-11-20  Sam Tebbs  <sam.tebbs@arm.com>

     * c-aarch64.texi (.cfi_b_key_frame): Add documentation.

gas/testsuite

2018-11-20  Sam Tebbs  <sam.tebbs@arm.com>

     * gas/aarch64/(pac_ab_key.d, pac_ab_key.s): New file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: latest.patch
Type: text/x-patch
Size: 8646 bytes
Desc: latest.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20181120/3ed473a0/attachment.bin>


More information about the Binutils mailing list