[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / undef-with-plt-addr.s
blob7f8e0afc770ba38157001d1f1764db5032e2f9e9
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/undef-with-plt-addr.s -o %t2.o
4 // RUN: ld.lld %t2.o -o %t2.so -shared -soname=so
5 // RUN: ld.lld %t.o %t2.so -o %t3
6 // RUN: llvm-readobj --symbols -S -r %t3 | FileCheck %s
8 // Test that -z nocopyreloc doesn't prevent the plt hack.
9 // RUN: ld.lld %t.o %t2.so -o %t3 -z nocopyreloc
11 .globl _start
12 _start:
13 movabsq $set_data, %rax
15 .data
16 .quad foo
17 // Test that set_data has an address in the .plt, but foo is not
19 // CHECK: Name: .plt
20 // CHECK-NEXT: Type: SHT_PROGBITS
21 // CHECK-NEXT: Flags [
22 // CHECK-NEXT: SHF_ALLOC
23 // CHECK-NEXT: SHF_EXECINSTR
24 // CHECK-NEXT: ]
25 // CHECK-NEXT: Address: 0x2012E0
27 // CHECK: Section ({{.*}}) .rela.dyn {
28 // CHECK-NEXT: 0x203400 R_X86_64_64 foo 0x0
29 // CHECK-NEXT: }
30 // CHECK-NEXT: Section ({{.*}}) .rela.plt {
31 // CHECK-NEXT: 0x203420 R_X86_64_JUMP_SLOT set_data 0x0
32 // CHECK-NEXT: }
34 // CHECK: Name: set_data
35 // CHECK-NEXT: Value: 0x2012F0
36 // CHECK-NEXT: Size: 0
37 // CHECK-NEXT: Binding: Global
38 // CHECK-NEXT: Type: Function
39 // CHECK-NEXT: Other: 0
40 // CHECK-NEXT: Section: Undefined
42 // CHECK: Name: foo
43 // CHECK-NEXT: Value: 0x0
44 // CHECK-NEXT: Size: 0
45 // CHECK-NEXT: Binding: Global
46 // CHECK-NEXT: Type: Function
47 // CHECK-NEXT: Other: 0
48 // CHECK-NEXT: Section: Undefined