28 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o3# RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s4# RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s5 6## Check we don't create dynamic relocations in a writable section,7## if the number of bits is smaller than the wordsize.8 9.globl hidden10.hidden hidden11local:12hidden:13 14# CHECK: error: relocation R_X86_64_8 cannot be used against local symbol; recompile with -fPIC15# CHECK-NEXT: >>> defined in {{.*}}.o16# CHECK-NEXT: >>> referenced by {{.*}}.o:(.data+0x0)17# CHECK: error: relocation R_X86_64_16 cannot be used against local symbol; recompile with -fPIC18# CHECK: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC19 20# CHECK: error: relocation R_X86_64_32 cannot be used against symbol 'hidden'; recompile with -fPIC21 22.data23.byte local # R_X86_64_824.short local # R_X86_64_1625.long local # R_X86_64_3226 27.long hidden # R_X86_64_3228