[PATCH] D138982: [XCOFF] adjust the Fixedvalue for R_RBR relocations.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 00:08:46 PST 2022


shchenz added a comment.

I also thinks the doc is wrong about the relocation type `R_RBR`, it should be the diff between the relocatable symbol and the branch instruction, not between the symbol and the csect which contains the branch instruction.



================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:639
+  } else if (Type == XCOFF::RelocationType::R_RBR &&
+             SymASec->getMappingClass() == XCOFF::XMC_PR) {
+    MCSectionXCOFF *ParentSec = cast<MCSectionXCOFF>(Fragment->getParent());
----------------
Is it possible that the `XCOFF::RelocationType::R_RBR` is generated for a non XMC_PR type symbol? Maybe we should make it as an assertion here for both `SymASec` and `ParentSec`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138982



More information about the llvm-commits mailing list