2 # RUN: rm -rf %t && split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/1.s -o %t/1.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/2.s -o %t/2.o
5 # RUN: ld.lld -shared -soname=t2 %t/2.o -o %t/2.so
6 # RUN: ld.lld %t/1.o %t/2.so -o %t/1
7 # RUN: llvm-readelf -S -r --dyn-syms %t/1 | FileCheck %s
8 # RUN: ld.lld --gc-sections -pie %t/1.o %t/2.so -o %t/1
9 # RUN: llvm-readelf -S -r --dyn-syms %t/1 | FileCheck %s
11 # CHECK: [[#BSS:]]] .bss
13 # CHECK: R_X86_64_COPY [[#%x,]] a1 + 0
14 # CHECK-NEXT: R_X86_64_GLOB_DAT [[#%x,]] b1 + 0
15 # CHECK-NEXT: R_X86_64_COPY [[#%x,]] b1 + 0
16 # CHECK-NEXT: R_X86_64_GLOB_DAT [[#%x,]] a2 + 0
18 # CHECK: Value Size Type Bind Vis Ndx Name
19 # CHECK: [[#%x,ADDR:]] 1 OBJECT GLOBAL DEFAULT [[#BSS]] a1
20 # CHECK-NEXT: {{0*}}[[#ADDR+1]] 1 OBJECT WEAK DEFAULT [[#BSS]] b1
21 # CHECK-NEXT: {{0*}}[[#ADDR+1]] 1 OBJECT GLOBAL DEFAULT [[#BSS]] b2
22 # CHECK-NEXT: {{0*}}[[#ADDR]] 1 OBJECT WEAK DEFAULT [[#BSS]] a2
23 # CHECK-NEXT: {{0*}}[[#ADDR+1]] 1 OBJECT GLOBAL DEFAULT [[#BSS]] b3
32 ## Test that a copy relocated alias may have GOT entry.
34 movq a2@gotpcrel
(%rip
), %rax
35 movq b1@gotpcrel
(%rip
), %rcx