[PATCH] D146620: [BOLT] Don't use section relocations when computing hash for data from other section

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 11:17:11 PDT 2023


treapster added a comment.

In D146620#4217347 <https://reviews.llvm.org/D146620#4217347>, @rafauler wrote:

> Makes sense, but why is the BD object being assigned the wrong section?
>
> From what I can tell, in BinaryContext.cpp, we call:
>
>   const uint64_t Hash = BD.getSection().hash(BD);
>
> But somehow BD.getSection() is returning the wrong section?

It is not assigned wrong section, but external BD may get passed to a recursive call `hash(*RelBD, Cache)` call on line 58


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146620



More information about the llvm-commits mailing list