49 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/undef-with-plt-addr.s -o %t2.o4// RUN: ld.lld %t2.o -o %t2.so -shared -soname=so5// RUN: ld.lld %t.o %t2.so -o %t36// RUN: llvm-readobj --symbols -S -r %t3 | FileCheck %s7 8// Test that -z nocopyreloc doesn't prevent the plt hack.9// RUN: ld.lld %t.o %t2.so -o %t3 -z nocopyreloc10 11.globl _start12_start:13movabsq $set_data, %rax14 15.data16.quad foo17// Test that set_data has an address in the .plt, but foo is not18 19// CHECK: Name: .plt20// CHECK-NEXT: Type: SHT_PROGBITS21// CHECK-NEXT: Flags [22// CHECK-NEXT: SHF_ALLOC23// CHECK-NEXT: SHF_EXECINSTR24// CHECK-NEXT: ]25// CHECK-NEXT: Address: 0x2012E026 27// CHECK: Section ({{.*}}) .rela.dyn {28// CHECK-NEXT: 0x203400 R_X86_64_64 foo 0x029// CHECK-NEXT: }30// CHECK-NEXT: Section ({{.*}}) .rela.plt {31// CHECK-NEXT: 0x203420 R_X86_64_JUMP_SLOT set_data 0x032// CHECK-NEXT: }33 34// CHECK: Name: set_data35// CHECK-NEXT: Value: 0x2012F036// CHECK-NEXT: Size: 037// CHECK-NEXT: Binding: Global38// CHECK-NEXT: Type: Function39// CHECK-NEXT: Other: 040// CHECK-NEXT: Section: Undefined41 42// CHECK: Name: foo43// CHECK-NEXT: Value: 0x044// CHECK-NEXT: Size: 045// CHECK-NEXT: Binding: Global46// CHECK-NEXT: Type: Function47// CHECK-NEXT: Other: 048// CHECK-NEXT: Section: Undefined49