diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2024-07-18 20:24:00 -0700 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2024-07-18 20:54:13 -0700 |
commit | af4eb9e20a6b4d9a5e61d9caaf89daf4c3742150 (patch) | |
tree | 7c093802f64157bca1282585031ca320a347244d /cpu/mep.cpu | |
parent | 8dcdc911822f53cc2a8050ce7b8fe2c1b641d524 (diff) | |
download | gdb-af4eb9e20a6b4d9a5e61d9caaf89daf4c3742150.zip gdb-af4eb9e20a6b4d9a5e61d9caaf89daf4c3742150.tar.gz gdb-af4eb9e20a6b4d9a5e61d9caaf89daf4c3742150.tar.bz2 |
gas: scfi: make scfi_state_restore_reg function more precise
When the SCFI machinery detects that a register has been restored from
stack, it makes some state changes in the SCFI state object.
Prior to the patch, scfi_state_restore_reg () was setting a value of
(reg, CFI_IN_REG) for (base, state) respectively. This was causing
issues in the cmp_scfi_state () function:
- The default state of all (callee-saved) regs at the beginning of
function is set to (0, CFI_UNDEFINED).
- If a register is saved and restored on some control path, the state
of reg is (reg, CFI_IN_REG) on that path.
- On another control path where the register was perhaps not
used (or saved/restored on stack) remains (0, CFI_UNDEFINED).
- The two states should be treated equal, however, at the point in
program after the register has been restored.
Fix this by resetting the state to (0, CFI_UNDEFINED) in
scfi_state_restore_reg ().
A testcase (scfi-cfg-4.s) for this is added in a subsequent commit.
gas/
* scfi.c (scfi_state_restore_reg): Reset to 0, CFI_UNDEFINED
for base, state.
Diffstat (limited to 'cpu/mep.cpu')
0 files changed, 0 insertions, 0 deletions