[PATCH] D122106: [BOLT] Fix dynamic relocation offset for constant islands

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 15:25:49 PDT 2022


rafauler added a comment.

Thanks!



================
Comment at: bolt/include/bolt/Core/BinarySection.h:290
-  /// Iterate over all non-pending relocations for this section.
-  iterator_range<RelocationSetType::iterator> relocations() {
-    return make_range(Relocations.begin(), Relocations.end());
----------------
Here you remove the accessors to the non-const version of relocs, but I suspect we will need them to avoid using the mutable hack.


================
Comment at: bolt/include/bolt/Core/Relocation.h:53
+  /// The label symbol associated with this relocation.
+  mutable MCSymbol *Label{nullptr};
+
----------------
Why mutable? Except when storing mutexes, usually mutable indicates a problem with the class that should be solved with a redesign (removing const where appropriate). Is there a way to use non-const Relocation objects?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122106



More information about the llvm-commits mailing list