summaryrefslogtreecommitdiff
path: root/gas/sframe-opt.c
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2022-12-22 09:57:16 -0800
committerIndu Bhagat <indu.bhagat@oracle.com>2022-12-22 09:57:16 -0800
commit3369de90b81592b44ba34360642a74a68afbdf7a (patch)
tree621de1cc0c59ca7c0ed50464a6cbc2c3c4d44693 /gas/sframe-opt.c
parent41eed6e1878d93753ff82913d4577616c4778fa7 (diff)
downloadbinutils-gdb-3369de90b81592b44ba34360642a74a68afbdf7a.tar.gz
gas: sframe: add support for .cfi_b_key_frame
Gather the information from the DWARF FDE on whether frame's return addresses are signed using the B key or A key. Reflect the information in the SFrame counterpart data structure, the SFrame FDE. ChangeLog: * gas/gen-sframe.c (get_dw_fde_pauth_b_key_p): New definition. (sframe_v1_set_func_info): Add new argument for pauth_key. (sframe_set_func_info): Likewise. (output_sframe_funcdesc): Likewise. * gas/gen-sframe.h (struct sframe_version_ops): Add new argument to the function pointer declaration. * gas/sframe-opt.c (sframe_convert_frag): Handle pauth_key.
Diffstat (limited to 'gas/sframe-opt.c')
-rw-r--r--gas/sframe-opt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/sframe-opt.c b/gas/sframe-opt.c
index f08a424fd88..cf7ca5c1893 100644
--- a/gas/sframe-opt.c
+++ b/gas/sframe-opt.c
@@ -95,6 +95,7 @@ sframe_convert_frag (fragS *frag)
offsetT rest_of_data;
uint8_t fde_type, fre_type;
+ uint8_t pauth_key;
expressionS *exp;
symbolS *dataS;
@@ -116,6 +117,7 @@ sframe_convert_frag (fragS *frag)
dataS = exp->X_add_symbol;
rest_of_data = (symbol_get_value_expression(dataS))->X_add_number;
fde_type = SFRAME_V1_FUNC_FDE_TYPE (rest_of_data);
+ pauth_key = SFRAME_V1_FUNC_PAUTH_KEY (rest_of_data);
gas_assert (fde_type == SFRAME_FDE_TYPE_PCINC);
/* Calculate the applicable fre_type. */
@@ -130,6 +132,7 @@ sframe_convert_frag (fragS *frag)
/* Create the new function info. */
value = SFRAME_V1_FUNC_INFO (fde_type, fre_type);
+ value = SFRAME_V1_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, value);
frag->fr_literal[frag->fr_fix] = value;
}