[PATCH] D144012: [SPARC][MC] Fix encoding of backwards BPr branches

Koakuma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 4 01:49:44 PST 2023


koakuma added inline comments.


================
Comment at: llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp:67
+    case Sparc::fixup_sparc_br16_2:
+      return ELF::R_SPARC_WDISP16;
     case Sparc::fixup_sparc_pc22:    return ELF::R_SPARC_PC22;
----------------
jrtc27 wrote:
> Isn't this going to create two relocations rather than one? Really there should be a single fixup for the whole thing.
Yeah, I tried to merge the _14 and the _2 parts, but the MCFixupKindInfo table does not support split bits.
One thing that I can think of is to just emit the real ELF relocation with the _14 internal type and emit a R_SPARC_NONE instead with the _2 internal type but I'm not really sure if this is okay?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144012



More information about the llvm-commits mailing list