summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-12-14 01:37:56 +0000
committerPetr Hosek <phosek@chromium.org>2018-12-14 01:37:56 +0000
commit493a08248353ea95a310a8a515e69068305e6f6c (patch)
tree9853935e8c99030437714262476f3a54c088ab5e /llvm/test
parentafa75d7843c92a7ac9a194f4b1a2396c03e3efd8 (diff)
downloadbcm5719-llvm-493a08248353ea95a310a8a515e69068305e6f6c.tar.gz
bcm5719-llvm-493a08248353ea95a310a8a515e69068305e6f6c.zip
[llvm-xray] Support for PIE
When the instrumented binary is linked as PIE, we need to apply the relative relocations to sleds. This is handled by the dynamic linker at runtime, but when processing the file we have to do it ourselves. Differential Revision: https://reviews.llvm.org/D55542 llvm-svn: 349120
Diffstat (limited to 'llvm/test')
-rwxr-xr-xllvm/test/tools/llvm-xray/X86/Inputs/elf64-pie.binbin0 -> 465816 bytes
-rw-r--r--llvm/test/tools/llvm-xray/X86/extract-instrmap-pie.ll11
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-xray/X86/Inputs/elf64-pie.bin b/llvm/test/tools/llvm-xray/X86/Inputs/elf64-pie.bin
new file mode 100755
index 00000000000..ab2745eeba8
--- /dev/null
+++ b/llvm/test/tools/llvm-xray/X86/Inputs/elf64-pie.bin
Binary files differ
diff --git a/llvm/test/tools/llvm-xray/X86/extract-instrmap-pie.ll b/llvm/test/tools/llvm-xray/X86/extract-instrmap-pie.ll
new file mode 100644
index 00000000000..987aaf98010
--- /dev/null
+++ b/llvm/test/tools/llvm-xray/X86/extract-instrmap-pie.ll
@@ -0,0 +1,11 @@
+; This test makes sure we can extract the instrumentation map from an
+; XRay-instrumented PIE file.
+;
+; RUN: llvm-xray extract %S/Inputs/elf64-pie.bin -s | FileCheck %s
+
+; CHECK: ---
+; CHECK-NEXT: - { id: 1, address: 0x00000000000299C0, function: 0x00000000000299C0, kind: function-enter, always-instrument: true, function-name: {{.*foo.*}} }
+; CHECK-NEXT: - { id: 1, address: 0x00000000000299D0, function: 0x00000000000299C0, kind: function-exit, always-instrument: true, function-name: {{.*foo.*}} }
+; CHECK-NEXT: - { id: 2, address: 0x00000000000299E0, function: 0x00000000000299E0, kind: function-enter, always-instrument: true, function-name: {{.*bar.*}} }
+; CHECK-NEXT: - { id: 2, address: 0x00000000000299F6, function: 0x00000000000299E0, kind: function-exit, always-instrument: true, function-name: {{.*bar.*}} }
+; CHECK-NEXT: ...
OpenPOWER on IntegriCloud