[llvm] [BOLT] Support map other function entry address (PR #101466)
Vladislav Khmelevsky via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 08:14:18 PDT 2024
================
@@ -0,0 +1,32 @@
+// This test examines whether BOLT can correctly process when
+// dynamic relocation points to other entry points of the
+// function.
+
+# RUN: %clang %cflags -fPIC -pie %s -o %t.exe -nostdlib -Wl,-q
+# RUN: llvm-bolt %t.exe -o %t.bolt > %t.out.txt
+# RUN: readelf -r %t.bolt >> %t.out.txt
+# RUN: llvm-objdump --disassemble-symbols=chain %t.bolt >> %t.out.txt
+# RUN: FileCheck %s --input-file=%t.out.txt
+
+## Check if the new address in `chain` is correctly updated by BOLT
+# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entry:
+# CHECK: {{.*}} R_X86_64_RELATIVE [[ADDR:.+]]
+# CHECK: [[#ADDR]]: c3 retq
----------------
yota9 wrote:
I think you need either remove # here or (probably even better) make var setting above like [[#%x,ADDR:]]
https://github.com/llvm/llvm-project/pull/101466
More information about the llvm-commits
mailing list