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

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 10:29:37 PST 2022


maksfb 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())
----------------
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.


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