summaryrefslogtreecommitdiff
path: root/test/ELF/gnu-ifunc-relative.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/gnu-ifunc-relative.s')
-rw-r--r--test/ELF/gnu-ifunc-relative.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/gnu-ifunc-relative.s b/test/ELF/gnu-ifunc-relative.s
new file mode 100644
index 000000000000..dc35102c5787
--- /dev/null
+++ b/test/ELF/gnu-ifunc-relative.s
@@ -0,0 +1,23 @@
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: ld.lld -static %t.o -o %tout
+// RUN: llvm-readobj -r -t %tout | FileCheck %s
+// REQUIRES: x86
+
+.type foo STT_GNU_IFUNC
+.globl foo
+foo:
+ ret
+
+.globl _start
+_start:
+ call foo
+
+// CHECK: Section ({{.*}}) .rela.plt {
+// CHECK-NEXT: R_X86_64_IRELATIVE - 0x[[ADDR:.*]]
+// CHECK-NEXT: }
+
+// CHECK: Name: foo
+// CHECK-NEXT: Value: 0x[[ADDR]]
+// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Binding: Global
+// CHECK-NEXT: Type: GNU_IFunc