[llvm] [BOLT] Support instrumentation hook via DT_FINI_ARRAY (PR #67348)
Job Noorman via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 04:58:27 PDT 2023
================
@@ -0,0 +1,94 @@
+## Test the different ways of hooking the fini function for instrumentation (via
+## DT_FINI and via DT_FINI_ARRAY). We test the latter for both PIE and non-PIE
+## binaries because of the different ways of handling relocations (static or
+## dynamic).
+## All tests perform the following steps:
+## - Compile and link for the case to be tested
+## - Some sanity-checks on the dynamic section and relocations in the binary to
+## verify it has the shape we want for testing:
+## - DT_FINI or DT_FINI_ARRAY in dynamic section
+## - No relative relocations for non-PIE
+## - Instrument
+## - Verify generated binary
+# REQUIRES: system-linux,bolt-runtime
+
+# RUN: %clang %s -Wl,-q -o %t.exe
----------------
mtvec wrote:
Thanks for that @yota9! Nice trick :) Tests are updated.
https://github.com/llvm/llvm-project/pull/67348
More information about the llvm-commits
mailing list