[PATCH] D113038: [ORC] Add a utility for adding missing "self" relocations to a Symbol

Ben Langmuir via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 11:38:00 PDT 2021


benlangmuir added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp:447
+    LLVM_DEBUG(dbgs() << "Adding delta32 self-relocation at " << InstrStart);
+    B.addEdge(jitlink::x86_64::Delta32, RelocOffInBlock, Sym, /*Addend=*/-4);
+  }
----------------
I wasn't sure if it was worth zeroing out the existing addend in the instruction stream - it would seem to be "nice" to zero it out to ensure we're depending on the relocation instead of the original addend, but it seems to get overwritten completely when we perform the fixup anyway and the contents of the block need to be copied and made mutable to make any changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113038



More information about the llvm-commits mailing list