[PATCH] D138982: [XCOFF] adjust the Fixedvalue for R_RBR relocations.
    Esme Yi via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Dec 14 19:33:06 PST 2022
    
    
  
Esme added inline comments.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:653
+        SectionMap[SymASec]->Address - BRInstrAddress + Target.getConstant();
   }
 
----------------
Esme wrote:
> shchenz wrote:
> > For the other `else`(relocation types), maybe we should add an assertion here to avoid any other unhandled relocation type that may introduce in `PPCXCOFFObjectWriter::getRelocTypeAndSignSize()` in future. The assertion will help us address the root cause early like the one for `XCOFF::RelocationType::R_RBR`.
> Good point!
Oh, it's incorrect to add the assertion/unreachable here, because what we are doing in the function is just to adjust the fixedvalue for some particular cases, and the fixedvalue for general cases are already calculated before this function.
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