[llvm] [BOLT] Support instrumentation hook via DT_FINI_ARRAY (PR #67348)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 03:45:10 PDT 2023


yota9 wrote:

> Is it so that we can run them once we have a way to cross-compile the runtime library?
True. Also in this case you would check your changes directly, which is nice too :)

> I tried adding non-runtime tests but the problem is that __bolt_instr_fini (which ends up in DT_FINI or DT_FINI_ARRAY) is not exposed in the binary's symbol table. This means that the tests would need to hard-code an address that can change at any time. This feels extremely fragile.

I see. Yes hardcode is not a good option. Let me think a bit about it too. A guess it would be enough to check that the address is somewhere in inserted section, but it might be tricky to implement this too.

https://github.com/llvm/llvm-project/pull/67348


More information about the llvm-commits mailing list