44 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t && split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/g.s -o %t/g.o4# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/w.s -o %t/w.o5# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/u.s -o %t/u.o6# RUN: ld.lld -e 0 %t/w.o %t/u.o -o %t/w7# RUN: llvm-readelf -s %t/w | FileCheck %s --check-prefix=WEAK8# RUN: ld.lld -e 0 %t/u.o %t/w.o -o %t/u9# RUN: llvm-readelf -s %t/u | FileCheck %s --check-prefix=UNIQUE10 11## We prefer STB_GLOBAL definition, then changing it to undefined since it is in12## in a non-prevailing COMDAT. Ideally this should be defined, but our behavior13## is fine because valid input cannot form this case.14# RUN: ld.lld -e 0 %t/w.o %t/g.o -o %t/und --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=WARN15# RUN: llvm-readelf -s %t/und | FileCheck %s --check-prefix=UND16 17# WEAK: NOTYPE WEAK DEFAULT [[#]] _ZZ1fvE1x18# UNIQUE: OBJECT UNIQUE DEFAULT [[#]] _ZZ1fvE1x19# UND: NOTYPE GLOBAL DEFAULT UND _ZZ1fvE1x20 21# WARN: warning: relocation refers to a symbol in a discarded section: f()::x22# WARN-NEXT: >>> defined in {{.*}}g.o23# WARN-NEXT: >>> section group signature: _ZZ1fvE1x24# WARN-NEXT: >>> prevailing definition is in {{.*}}w.o25# WARN-NEXT: >>> or the symbol in the prevailing group had STB_WEAK binding and the symbol in a non-prevailing group had STB_GLOBAL binding. Mixing groups with STB_WEAK and STB_GLOBAL binding signature is not supported26# WARN-NEXT: >>> referenced by {{.*}}g.o:(.text+0x3)27 28#--- g.s29movq _ZZ1fvE1x@gotpcrel(%rip), %rax30 31.section .bss._ZZ1fvE1x,"awG",@nobits,_ZZ1fvE1x,comdat32.globl _ZZ1fvE1x33_ZZ1fvE1x:34 35#--- w.s36.section .bss._ZZ1fvE1x,"awG",@nobits,_ZZ1fvE1x,comdat37.weak _ZZ1fvE1x38_ZZ1fvE1x:39 40#--- u.s41.section .bss._ZZ1fvE1x,"awG",@nobits,_ZZ1fvE1x,comdat42.type _ZZ1fvE1x, @gnu_unique_object43_ZZ1fvE1x:44