[PATCH] D120379: [BOLT] Support PC-relative relocations with addends

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 10:56:40 PST 2022


ayermolo added inline comments.


================
Comment at: bolt/lib/Core/BinaryFunction.cpp:1359
+        const Relocation &Relocation = Itr->second;
+        uint64_t SymbolValue = Relocation.Value - Relocation.Addend;
+        if (Relocation.isPCRelative())
----------------
maksfb wrote:
> ayermolo wrote:
> > I think I miss understand something. Why are we subtracting Addend from the Value of relocation? Isn't it S + A - P?
> > Presumably Relocation.Vaue is the address of the Symbol?
> Value is what the expression S + A - P evaluates to.
Ah, had it backwards in my mind.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120379



More information about the llvm-commits mailing list