3 ## Don't create a canonical PLT if the symbol is defined as protected in a DSO,
4 ## because thay may break pointer equality.
6 # RUN: echo '.globl foo; .protected foo; .type foo,@function; foo:' | \
7 # RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o
8 # RUN: ld.lld %t2.o -o %t2.so -shared -soname=so
9 # RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t.o
11 # RUN: not ld.lld %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
12 # ERR: error: cannot preempt symbol: foo
14 # RUN: ld.lld --ignore-function-address-equality %t.o %t2.so -o %t
15 # RUN: llvm-readobj --dyn-symbols --relocations %t | FileCheck %s
17 # Check that we have a relocation and an undefined symbol with a non zero address
19 # CHECK: R_X86_64_JUMP_SLOT foo 0x0
22 # CHECK-NEXT: Value: 0x20{{.*}}
24 # CHECK-NEXT: Binding: Global
25 # CHECK-NEXT: Type: Function
27 # CHECK-NEXT: Section: Undefined