[PATCH] D114194: [SystemZ] Add range checks for PC-relative fixups

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 23 13:05:24 PST 2021


jonpa updated this revision to Diff 389289.
jonpa added a comment.

.space directive works better - compile time issue eliminated :-)

handlePCRelFixupValue(32) still in the patch, but the test for it removed in fixups-out-of-range-02.s. I think it will catch some positive out-of-range values, but not any negative ones (out of range). In the future if 64-bit offsets become supported, this should then work as expected, hopefully.

I have now made sure the SMLoc is passed to all created MCFixups in SystemZMCCodeEmitter.cpp. This improves the diagnostic message (line number and instruction printed).

I copied the diagnostic message from GAS in fixups-out-of-range-02.s, but have not done so for the displacements (fixups-out-of-range-01.s). I am not quite sure what is best: should the displacements also get the fuller diagnostic, or is it better with a simplistic message?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114194/new/

https://reviews.llvm.org/D114194

Files:
  llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp
  llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp
  llvm/test/MC/SystemZ/fixups-out-of-range-01.s
  llvm/test/MC/SystemZ/fixups-out-of-range-02.s
  llvm/test/MC/SystemZ/fixups-out-of-range.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114194.389289.patch
Type: text/x-patch
Size: 5739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211123/7689ef69/attachment.bin>


More information about the llvm-commits mailing list