1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: ld.lld -pie %t.o -o %tout
4# RUN: llvm-objdump -section-headers %tout | FileCheck %s
5# RUN: llvm-readobj -dynamic-table -r %tout | FileCheck %s --check-prefix=TAGS
6
7## Check we produce DT_PLTREL/DT_JMPREL/DT_PLTGOT and DT_PLTRELSZ tags
8## when there are no other relocations except R_*_IRELATIVE.
9
10# CHECK:  Name          Size      Address
11# CHECK:  .rela.plt   00000030 0000000000000210
12# CHECK:  .got.plt    00000010 0000000000002000
13
14# TAGS:      Relocations [
15# TAGS-NEXT:   Section {{.*}} .rela.plt {
16# TAGS-NEXT:     R_X86_64_IRELATIVE
17# TAGS-NEXT:     R_X86_64_IRELATIVE
18# TAGS-NEXT:   }
19# TAGS-NEXT: ]
20
21# TAGS:   Tag                Type                 Name/Value
22# TAGS:   0x0000000000000017 JMPREL               0x210
23# TAGS:   0x0000000000000002 PLTRELSZ             48
24# TAGS:   0x0000000000000003 PLTGOT               0x2000
25# TAGS:   0x0000000000000014 PLTREL               RELA
26
27.text
28.type foo STT_GNU_IFUNC
29.globl foo
30foo:
31 ret
32
33.type bar STT_GNU_IFUNC
34.globl bar
35bar:
36 ret
37
38.globl _start
39_start:
40 call foo
41 call bar
42