diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -1165,7 +1165,7 @@ /// 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 --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -2100,8 +2100,9 @@ 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;