[PATCH] D123755: [BOLT][perf2bolt] Fix base address calculation for shared objects

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 19:39:22 PDT 2022


maksfb created this revision.
maksfb added reviewers: yota9, Amir, ayermolo, rafauler.
Herald added a subscriber: mgorny.
Herald added a project: All.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When processing profile data for shared object or PIE, perf2bolt needs
to calculate base address of the binary based on the map info reported
by the perf tool. When the mapping data provided is for the second
(or any other than the first) segment and the segment's file offset
does not match its memory offset, perf2bolt uses wrong assumption
about the binary base address.

Add a function to calculate binary base address using the reported
memory mapping and use the returned base for further address
adjustments.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123755

Files:
  bolt/include/bolt/Core/BinaryContext.h
  bolt/include/bolt/Profile/DataAggregator.h
  bolt/lib/Core/BinaryContext.cpp
  bolt/lib/Profile/DataAggregator.cpp
  bolt/unittests/Core/BinaryContext.cpp
  bolt/unittests/Core/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123755.422721.patch
Type: text/x-patch
Size: 11021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220414/a6ee6da7/attachment.bin>


More information about the llvm-commits mailing list