diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h index 7e2d4d6e045c..8fa05498a062 100644 --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -1165,7 +1165,7 @@ public: /// Return a dynamic relocation registered at a given \p Address, or nullptr /// if there is no dynamic relocation at such address. - const Relocation *getDynamicRelocationAt(uint64_t Address); + const Relocation *getDynamicRelocationAt(uint64_t Address) const; /// Remove registered relocation at a given \p Address. bool removeRelocationAt(uint64_t Address); diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp index d81b6693fb2e..8af8a2a4ef72 100644 --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -2100,8 +2100,9 @@ const Relocation *BinaryContext::getRelocationAt(uint64_t Address) const { return Section->getRelocationAt(Address - Section->getAddress()); } -const Relocation *BinaryContext::getDynamicRelocationAt(uint64_t Address) { - ErrorOr Section = getSectionForAddress(Address); +const Relocation * +BinaryContext::getDynamicRelocationAt(uint64_t Address) const { + ErrorOr Section = getSectionForAddress(Address); if (!Section) return nullptr;