xref: /llvm-project/lld/test/ELF/gnu-ifunc-dyntags.s (revision 691b97c884a15a7eac641ddf67c9f2f30fb4e747)
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   VMA
11# CHECK:  .rela.dyn   00000030 0000000000000248
12# CHECK:  .got.plt    00000010 0000000000003370
13
14# TAGS:   Tag                Type                 Name/Value
15# TAGS:   0x0000000000000007 RELA                 0x248
16# TAGS:   0x0000000000000008 RELASZ               48 (bytes)
17# TAGS-NOT: JMPREL
18# TAGS-NOT: PLTREL
19
20# TAGS:      Relocations [
21# TAGS-NEXT:   Section {{.*}} .rela.dyn {
22# TAGS-NEXT:     R_X86_64_IRELATIVE
23# TAGS-NEXT:     R_X86_64_IRELATIVE
24# TAGS-NEXT:   }
25# TAGS-NEXT: ]
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