[PATCH] D85408: Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols.

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 13:02:18 PDT 2020


tmsriram added a comment.

In D85408#2253055 <https://reviews.llvm.org/D85408#2253055>, @MaskRay wrote:

> I am still reading the patch, but I have noticed one thing worth discussing. `.bb_addr_map` is a non-SHF_ALLOC section (meaning that it is not part of the memory image). An absolute relocation type (`.quad	.Lfunc_begin0`) works but the value is a link-time address, not taking account of the load base (PIE/shared object)). (If .bb_addr_map has the SHF_ALLOC flag, linkers will report a text relocation) How do you intend to use `.bb_addr_map` at runtime?

bb_addr_map is intentionally not loaded as it is never meant to be used at run-time. bb_addr_map will be later be used in conjunction with a hardware profile of the binary to associate executed basic block addresses to machine basic blocks.  The hardware profile of the binary has enough info to determine the load base address with PIE, this is pretty straight forward and multiple strategies exist.  What exactly is the concern here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85408



More information about the llvm-commits mailing list