33 lines · plain
1# REQUIRES: x862 3## Don't create a canonical PLT if the symbol is defined as protected in a DSO,4## because thay may break pointer equality.5 6# RUN: echo '.globl foo; .protected foo; .type foo,@function; foo:' | \7# RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o8# RUN: ld.lld %t2.o -o %t2.so -shared -soname=so9# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t.o10 11# RUN: not ld.lld %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s12# ERR: error: cannot preempt symbol: foo13 14# RUN: ld.lld --ignore-function-address-equality %t.o %t2.so -o %t15# RUN: llvm-readobj --dyn-symbols --relocations %t | FileCheck %s16 17# Check that we have a relocation and an undefined symbol with a non zero address18 19# CHECK: R_X86_64_JUMP_SLOT foo 0x020 21# CHECK: Name: foo22# CHECK-NEXT: Value: 0x20{{.*}}23# CHECK-NEXT: Size:24# CHECK-NEXT: Binding: Global25# CHECK-NEXT: Type: Function26# CHECK-NEXT: Other:27# CHECK-NEXT: Section: Undefined28 29.global _start30_start:31 .quad foo32 33