[PATCH] D117612: [BOLT] Update dynamic relocations from section relocations

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 21:35:01 PST 2022


maksfb added a comment.

It looks good. Thanks for the fixes.

In the summary: " so we the total number" -> "so the total number".



================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:4755
+        cantFail(Section->getSectionRef().getContents());
+    Start = SectionContents.data() - File->getData().data();
+    End = Start + Section->getSize();
----------------
Can you use `Section->getInputFileOffset()`?


================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:4780
+      for (const Relocation &Rel : Section.dynamicRelocations()) {
+        bool IsRelative = Rel.isRelative();
+        if (PatchRelative != IsRelative)
----------------



================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:4799
+          // Usually this case is used for R_*_(I)RELATIVE relocations
+          uint64_t Address = getNewFunctionOrDataAddress(Addend);
+          if (Address)
----------------



================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:4808
+
+        bool IsJmpRel =
+            !!(IsJmpRelocation.find(Rel.Type) != IsJmpRelocation.end());
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117612



More information about the llvm-commits mailing list