aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2024-02-01 14:48:18 -0800
committerIndu Bhagat <indu.bhagat@oracle.com>2024-02-01 15:00:05 -0800
commit09812f0835e077bbe643d6909745eea3c6ef4228 (patch)
treecf81dad681ed51a620000359ce975f042d9a1934 /bfd
parentb3c670a6ba31dcd98ba92e5739b12467aba6645a (diff)
downloadgdb-09812f0835e077bbe643d6909745eea3c6ef4228.zip
gdb-09812f0835e077bbe643d6909745eea3c6ef4228.tar.gz
gdb-09812f0835e077bbe643d6909745eea3c6ef4228.tar.bz2
gas: x86: ginsn: adjust ginsns for certain lea ops
A review comment on the SCFI V4 series was to handle ginsn creation for certain lea opcodes more precisely. Specifically, we should preferably handle the following two cases of lea opcodes similarly: - #1 lea with "index register and scale factor of 1, but no base register", - #2 lea with "no index register, but base register present". Currently, a ginsn of type GINSN_TYPE_OTHER is generated for the case of #1 above. For #2, however, the lea insn is translated to either a GINSN_TYPE_ADD or GINSN_TYPE_MOV depending on whether the immediate for displacement is non-zero or not respectively. Change the handling in x86_ginsn_lea so that both of the above lea manifestations are handled similarly. While at it, remove the code paths creating GINSN_TYPE_OTHER altogether from the function. It makes sense to piggy back on the x86_ginsn_unhandled code path to create GINSN_TYPE_OTHER if the destination register is interesting. This was also suggested in one of the previous review rounds; the other functions already follow that model, so this keeps functions symmetrical looking. gas/ * gas/config/tc-i386.c (x86_ginsn_lea): Handle select lea ops with no base register similar to the case of no index register. Remove creation of GINSN_TYPE_OTHER from the function. gas/testsuite/ * gas/scfi/x86_64/ginsn-lea-1.l: New test. * gas/scfi/x86_64/ginsn-lea-1.s: Likewise. * gas/scfi/x86_64/scfi-x86-64.exp: Add new test.
Diffstat (limited to 'bfd')
0 files changed, 0 insertions, 0 deletions