43 lines · plain
1# REQUIRES: x862## Test we don't report duplicate definition errors when mixing Clang STB_WEAK3## and GCC STB_GNU_UNIQUE symbols.4 5# RUN: rm -rf %t && split-file %s %t && cd %t6# RUN: llvm-mc -filetype=obj -triple=x86_64 weak.s -o weak.o7# RUN: llvm-mc -filetype=obj -triple=x86_64 unique.s -o unique.o8# RUN: ld.lld weak.o unique.o -o weak9# RUN: llvm-readelf -s weak | FileCheck %s --check-prefix=WEAK10# RUN: ld.lld unique.o weak.o -o unique11# RUN: llvm-readelf -s unique | FileCheck %s --check-prefix=UNIQUE12 13# WEAK: OBJECT WEAK DEFAULT [[#]] _ZN1BIiE1aE14# UNIQUE: OBJECT UNIQUE DEFAULT [[#]] _ZN1BIiE1aE15 16#--- weak.s17## Clang18 .type _ZN1BIiE1aE,@object19 .section .bss._ZN1BIiE1aE,"aGwR",@nobits,_ZN1BIiE1aE,comdat20 .weak _ZN1BIiE1aE21_ZN1BIiE1aE:22 .zero 423 24 .type _ZGVN1BIiE1aE,@object25 .section .bss._ZGVN1BIiE1aE,"aGw",@nobits,_ZN1BIiE1aE,comdat26 .weak _ZGVN1BIiE1aE27_ZGVN1BIiE1aE:28 .quad 029 30#--- unique.s31## GCC -fgnu-unique. Note the different group signature for the second group.32 .weak _ZN1BIiE1aE33 .section .bss._ZN1BIiE1aE,"awG",@nobits,_ZN1BIiE1aE,comdat34 .type _ZN1BIiE1aE, @gnu_unique_object35_ZN1BIiE1aE:36 .zero 437 38 .weak _ZGVN1BIiE1aE39 .section .bss._ZGVN1BIiE1aE,"awG",@nobits,_ZGVN1BIiE1aE,comdat40 .type _ZGVN1BIiE1aE, @gnu_unique_object41_ZGVN1BIiE1aE:42 .zero 843