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

Job Noorman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 08:57:07 PDT 2023


mtvec wrote:

> Thanks for the fix! It seems to be good now. Only the tests seems to left. Just a hint, I would build the single test with 3 different states: only DT_FINI, only DT_FINI_ARRAY, and both for pie and non-pie cases

Added tests for the cases you suggested. Note that I tested on AArch64 because of the issues on x86 as explained in the description of this PR. This meant I had to update `encodeValueAArch64` to accept `R_AARCH64_ABS64` relocs.

> each time checking the static and if needed dynamic relocs were updated.

Instead of doing this, I simply run the instrumented binary in the tests and verify the generated profile makes sense. I feel this should be enough because it implicitly verifies the fini function was hooked correctly. What do you think?

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


More information about the llvm-commits mailing list