aboutsummaryrefslogtreecommitdiff
path: root/libiberty/vprintf-support.c
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2024-04-10 13:46:37 -0700
committerIndu Bhagat <indu.bhagat@oracle.com>2024-04-10 13:46:37 -0700
commitf1c5d46cae3fa4a3c41c05c796c69d52eef97067 (patch)
treeed39ef5f849d97ec7a38758e3f232ba7cdcbe819 /libiberty/vprintf-support.c
parenta1c6a60cc55a17b5f3c8e26f1bc68b4ee2470e54 (diff)
downloadbinutils-f1c5d46cae3fa4a3c41c05c796c69d52eef97067.zip
binutils-f1c5d46cae3fa4a3c41c05c796c69d52eef97067.tar.gz
binutils-f1c5d46cae3fa4a3c41c05c796c69d52eef97067.tar.bz2
gas: scfi: bugfixes for SCFI state propagation
There are two state propagation functions in SCFI machinery - forward and backward flow. The patch addresses two issues: - In forward_flow_scfi_state (), the state being compared in forward flow must be that at the exit of a prev bb and that at the entry of the next bb. The variable holding the state to be compared was previously (erroneously) stale. - In cmp_scfi_state (), the assumption that two different control flows, leading to the same basic block, cannot have a mismatched notion of CFA base register, is not true. Remove the assertion and instead return err if mismatch. Fixing these issues helps correctly synthesize CFI, when previously SCFI was erroring out for an otherwise valid input asm. gas/ * scfi.c (cmp_scfi_state): Remove assertion and return mismatch in return value as applicable. (forward_flow_scfi_state): Update state object to be the same as the exit state of the prev bb before comparing. gas/testsuite/ * gas/scfi/x86_64/scfi-x86-64.exp: Add new test. * gas/scfi/x86_64/scfi-cfg-5.d: New test. * gas/scfi/x86_64/scfi-cfg-5.l: New test. * gas/scfi/x86_64/scfi-cfg-5.s: New test.
Diffstat (limited to 'libiberty/vprintf-support.c')
0 files changed, 0 insertions, 0 deletions