1# REQUIRES: x86 2 3# If there are two relocations such that the first one requires 4# dynamic COPY relocation, the second one requires GOT entry 5# creation, linker should create both - dynamic relocation 6# and GOT entry. 7 8# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux \ 9# RUN: %S/Inputs/copy-in-shared.s -o %t.so.o 10# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t.o 11# RUN: ld.lld %t.so.o -shared -o %t.so 12# RUN: ld.lld --hash-style=sysv %t.o %t.so -o %t.exe 13# RUN: llvm-readobj -r %t.exe | FileCheck %s 14 15# CHECK: Relocations [ 16# CHECK-NEXT: Section (4) .rel.dyn { 17# CHECK-NEXT: 0x{{[0-9A-F]+}} R_386_GLOB_DAT foo 18# CHECK-NEXT: 0x{{[0-9A-F]+}} R_386_COPY foo 19# CHECK-NEXT: } 20# CHECK-NEXT: ] 21 22 .text 23 .global _start 24_start: 25 movl $foo, (%esp) # R_386_32 - requires R_386_COPY relocation 26 movl foo@GOT, %eax # R_386_GOT32 - requires GOT entry 27