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

Stephen Peckham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 07:35:52 PST 2022


stephenpeckham added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:646-647
+                              Fixup.getOffset();
+    // The FixedValue should be the difference between SymA csect address and BR
+    // instr address plus any constant value.
+    FixedValue =
----------------
// The FixedValue is the difference between the SymA address and BRInstrAddress plus any constant value. 

The documentation for R_RBR is easy to misunderstand. The documentation doesn't describe what should be computed for the FixedValue.  It describes how the FixedValue should be adjusted at link time. This adjustment is based both on the change to the address of SymA (pre-link vs. post-link) and the change to the address of the branch instruction (or its csect--they're equivalent)


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