Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / x86-64-dyn-rel-error5.s
blobbfd60ef2f8ac7e172e544185a08191b36908b4e8
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s
4 # RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s
6 ## Check we don't create dynamic relocations in a writable section,
7 ## if the number of bits is smaller than the wordsize.
9 .globl hidden
10 .hidden hidden
11 local:
12 hidden:
14 # CHECK: error: relocation R_X86_64_8 cannot be used against local symbol; recompile with -fPIC
15 # CHECK-NEXT: >>> defined in {{.*}}.o
16 # CHECK-NEXT: >>> referenced by {{.*}}.o:(.data+0x0)
17 # CHECK: error: relocation R_X86_64_16 cannot be used against local symbol; recompile with -fPIC
18 # CHECK: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
20 # CHECK: error: relocation R_X86_64_32 cannot be used against symbol 'hidden'; recompile with -fPIC
22 .data
23 .byte local # R_X86_64_8
24 .short local # R_X86_64_16
25 .long local # R_X86_64_32
27 .long hidden # R_X86_64_32