diff options
author | Sam Tebbs <sam.tebbs@arm.com> | 2018-12-13 16:27:01 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomas.preudhomme@linaro.org> | 2018-12-13 16:37:40 +0000 |
commit | 09038062534606ef9100b5474d136f7d2e543de4 (patch) | |
tree | 71b88ac39f8eee0495e68f742a8dfc4deefcfcc4 /gas/config | |
parent | fe554d200d1befdc3bddc9e14f8593ea3446c351 (diff) | |
download | gdb-09038062534606ef9100b5474d136f7d2e543de4.zip gdb-09038062534606ef9100b5474d136f7d2e543de4.tar.gz gdb-09038062534606ef9100b5474d136f7d2e543de4.tar.bz2 |
Move aarch64 CIE code to aarch64 backend
This commit moves all aarch64-specific code to deal with CIE structure
introduced in 3a67e1a6b4430374f3073e51bb19347d4c421cfe from
target-independent files to the aarch64 backend.
2018-12-13 Sam Tebbs <sam.tebbs@arm.com>
binutils/
* dwarf.c (read_cie): Add check for 'B'.
gas/
* config/tc-aarch64.h (enum pointer_auth_key,
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.c (struct cie_entry): Add tc_cie_entry_extras invocation.
(alloc_fde_entry, select_cie_for_fde): 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 invocation.
* dw2gencfi.h (enum pointer_auth_key): Move to config/tc-aarch64.h.
(struct fde_entry): Add tc_fde_entry_extras invocation
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-aarch64.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index 88df2aa..93e8f80 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -80,6 +80,43 @@ struct aarch64_fix #define tc_frob_section(S) aarch64_frob_section (S) +/* The key used to sign a function's return address. */ +enum pointer_auth_key { + AARCH64_PAUTH_KEY_A, + AARCH64_PAUTH_KEY_B +}; + +/* The extra fields required by AArch64 in fde_entry and cie_entry. Currently + only used to store the key used to sign the frame's return address. */ +#define tc_fde_entry_extras enum pointer_auth_key pauth_key; +#define tc_cie_entry_extras enum pointer_auth_key pauth_key; + +/* The extra initialisation steps needed by AArch64 in alloc_fde_entry. + Currently only used to initialise the key used to sign the return + address. */ +#define tc_fde_entry_init_extra(fde) fde->pauth_key = AARCH64_PAUTH_KEY_A; + +/* Extra checks required by AArch64 when outputting the current cie_entry. + Currently only used to output a 'B' if the return address is signed with the + B key. */ +#define tc_output_cie_extra(cie) \ + do \ + { \ + if (cie->pauth_key == AARCH64_PAUTH_KEY_B) \ + out_one ('B'); \ + } \ + while (0) + +/* Extra equivalence checks required by AArch64 when selecting the correct cie + for some fde. Currently only used to check for quivalence between keys used + to sign ther return address. */ +#define tc_cie_fde_equivalent_extra(cie, fde) (cie->pauth_key == fde->pauth_key) + +/* The extra initialisation steps needed by AArch64 in select_cie_for_fde. + Currently only used to initialise the key used to sign the return + address. */ +#define tc_cie_entry_init_extra(cie, fde) cie->pauth_key = fde->pauth_key; + #define TC_FIX_TYPE struct aarch64_fix #define TC_INIT_FIX_DATA(FIX) { (FIX)->tc_fix_data.inst = NULL; \ (FIX)->tc_fix_data.opnd = AARCH64_OPND_NIL; } |