3 /// For non-preemptable ifunc
, place ifunc PLT entries after regular PLT entries.
5 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-unknown-linux
%s
-o
%t.o
6 // RUN
: ld.lld
--shared
-o
%t.so
%t.o
7 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
%t.so | FileCheck
%s
--check-prefix
=DISASM
8 // RUN
: llvm-readobj
-r
%t.so | FileCheck
%s
10 // Check that an IRELATIVE relocation is used for
a non-preemptible ifunc
11 // handler
and a JUMP_SLOT is used for
a preemptible ifunc
12 // DISASM
: Disassembly of section
.text:
14 // DISASM-NEXT
: <fct
>:
15 // DISASM-NEXT
: 1308: retq
17 // DISASM-NEXT
: 1309: retq
19 // DISASM-NEXT
: 130a: callq
0x1350
20 // DISASM-NEXT
: 130f
: callq
0x1330
21 // DISASM-NEXT
: 1314: callq
0x1340
22 // DISASM-NEXT
: 1319: retq
24 // DISASM-NEXT
: 131a: retq
26 // DISASM-NEXT
: Disassembly of section
.plt:
28 // DISASM-NEXT
: <.plt>:
29 // DISASM-NEXT
: 1320: pushq
8482(%rip
)
30 // DISASM-NEXT
: 1326: jmpq
*8484(%rip
)
31 // DISASM-NEXT
: 132c
: nopl
(%rax
)
33 // DISASM-NEXT
: <fct2@plt
>:
34 // DISASM-NEXT
: 1330: jmpq
*8482(%rip
)
35 // DISASM-NEXT
: 1336: pushq $
0
36 // DISASM-NEXT
: 133b: jmp
0x1320 <.plt>
38 // DISASM-NEXT
: <f2@plt
>:
39 // DISASM-NEXT
: 1340: jmpq
*8474(%rip
)
40 // DISASM-NEXT
: 1346: pushq $
1
41 // DISASM-NEXT
: 134b: jmp
0x1320 <.plt>
42 // DISASM
: Disassembly of section
.iplt:
45 // DISASM-NEXT
: 1350: jmpq
*8466(%rip
)
46 // DISASM-NEXT
: 1356: pushq $
0
47 // DISASM-NEXT
: 135b: jmp
0x1320 <.plt>
49 // CHECK
: Relocations
[
50 // CHECK-NEXT
: Section
(5) .rela.dyn {
51 // CHECK-NEXT
: 0x3468 R_X86_64_IRELATIVE
- 0x1308
53 // CHECK-NEXT
: Section
(6) .rela.plt {
54 // CHECK-NEXT
: 0x3458 R_X86_64_JUMP_SLOT fct2
0x0
55 // CHECK-NEXT
: 0x3460 R_X86_64_JUMP_SLOT
f2 0x0
58 // Hidden expect IRELATIVE
61 .type fct, STT_GNU_IFUNC
65 // Not hidden expect JUMP_SLOT
67 .type fct2, STT_GNU_IFUNC