[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / dynamic-reloc.s
blob6d98db0c2468e6d9bd81670bc2532ce07001e434
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o
4 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/dynamic-reloc.s -o %t3.o
5 // RUN: ld.lld -shared %t2.o -soname=so -o %t2.so
6 // RUN: ld.lld %t.o %t3.o %t2.so -o %t
7 // RUN: llvm-readobj --dynamic-table -r -S %t | FileCheck %s
9 // CHECK: Index: 1
10 // CHECK-NEXT: Name: .dynsym
12 // CHECK: Name: .rela.plt
13 // CHECK-NEXT: Type: SHT_RELA
14 // CHECK-NEXT: Flags [
15 // CHECK-NEXT: SHF_ALLOC
16 // CHECK-NEXT: SHF_INFO_LINK
17 // CHECK-NEXT: ]
18 // CHECK-NEXT: Address: [[RELAADDR:.*]]
19 // CHECK-NEXT: Offset:
20 // CHECK-NEXT: Size: [[RELASIZE:.*]]
21 // CHECK-NEXT: Link: 1
22 // CHECK-NEXT: Info:
23 // CHECK-NEXT: AddressAlignment: 8
24 // CHECK-NEXT: EntrySize: 24
26 // CHECK: Name: .text
27 // CHECK-NEXT: Type: SHT_PROGBITS
28 // CHECK-NEXT: Flags [
29 // CHECK-NEXT: SHF_ALLOC
30 // CHECK-NEXT: SHF_EXECINSTR
31 // CHECK-NEXT: ]
33 // CHECK: DynamicSection [
34 // CHECK-NEXT: Tag Type Name/Value
35 // CHECK-NEXT: 0x0000000000000001 NEEDED Shared library: [so]
36 // CHECK-NEXT: 0x0000000000000015 DEBUG 0x0
37 // CHECK-NEXT: 0x0000000000000017 JMPREL
38 // CHECK-NEXT: 0x0000000000000002 PLTRELSZ 24 (bytes)
39 // CHECK-NEXT: 0x0000000000000003 PLTGOT
40 // CHECK-NEXT: 0x0000000000000014 PLTREL RELA
41 // CHECK-NEXT: 0x0000000000000006 SYMTAB
42 // CHECK-NEXT: 0x000000000000000B SYMENT 24 (bytes)
43 // CHECK-NEXT: 0x0000000000000005 STRTAB
44 // CHECK-NEXT: 0x000000000000000A STRSZ
45 // CHECK-NEXT: 0x000000006FFFFEF5 GNU_HASH
46 // CHECK-NEXT: 0x0000000000000004 HASH
47 // CHECK-NEXT: 0x0000000000000000 NULL 0x0
48 // CHECK-NEXT: ]
50 // CHECK: Relocations [
51 // CHECK-NEXT: Section ({{.*}}) .rela.plt {
52 // CHECK-NEXT: R_X86_64_JUMP_SLOT bar 0x0
53 // CHECK-NEXT: }
54 // CHECK-NEXT: ]
56 .global _start
57 _start:
58 .quad bar + 0x42
59 .weak foo
60 .quad foo
61 call main