diff options
author | Jens Remus <jremus@linux.ibm.com> | 2024-03-07 17:01:46 +0100 |
---|---|---|
committer | Jens Remus <jremus@linux.ibm.com> | 2024-05-16 13:32:22 +0200 |
commit | 216dab48bf3fccaddd00fc512b95f59b4fdcf4aa (patch) | |
tree | caefc094183e11fadb0440001f8bac4e1a9139e5 | |
parent | 15850370ce8fda34d7de5e94015febaa4aa793ae (diff) | |
download | fsf-binutils-gdb-216dab48bf3fccaddd00fc512b95f59b4fdcf4aa.zip fsf-binutils-gdb-216dab48bf3fccaddd00fc512b95f59b4fdcf4aa.tar.gz fsf-binutils-gdb-216dab48bf3fccaddd00fc512b95f59b4fdcf4aa.tar.bz2 |
gas: Validate SFrame RA tracking and fixed RA offset
If an architecture uses SFrame return-address (RA) tracking it must
specify the fixed RA offset as invalid. Otherwise, if an architecture
does not use RA tracking, it must specify a valid fixed RA offset.
gas/
* gen-sframe.c: Validate SFrame RA tracking and fixed
RA offset.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
-rw-r--r-- | gas/gen-sframe.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 9e5532b..bd03be4 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1536,6 +1536,18 @@ output_sframe (segT sframe_seg) /* Setup the version specific access functions. */ sframe_set_version (SFRAME_VERSION_2); +#ifdef SFRAME_FRE_RA_TRACKING + if (sframe_ra_tracking_p ()) + /* With RA tracking the fixed RA offset must be invalid. */ + gas_assert (sframe_cfa_ra_offset () == SFRAME_CFA_FIXED_RA_INVALID); + else + /* Without RA tracking the fixed RA offset may not be invalid. */ + gas_assert (sframe_cfa_ra_offset () != SFRAME_CFA_FIXED_RA_INVALID); +#else + /* Without RA tracking the fixed RA offset may not be invalid. */ + gas_assert (sframe_cfa_ra_offset () != SFRAME_CFA_FIXED_RA_INVALID); +#endif + /* Process all fdes and create SFrame stack trace information. */ create_sframe_all (); |