67 lines · plain
1# COMDAT sections with non-external linkage should not be merged by ICF.2 3# RUN: yaml2obj %s -o %t1.obj4# RUN: sed s/foo/main/ %s | yaml2obj > %t2.obj5# RUN: lld-link /out:%t.exe /entry:main /subsystem:console /verbose \6# RUN: %t1.obj %t2.obj > %t.log 2>&17# RUN: FileCheck %s < %t.log8 9# CHECK-NOT: Removed bar10 11--- !COFF12header:13 Machine: IMAGE_FILE_MACHINE_AMD6414 Characteristics: []15sections:16 - Name: .text17 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]18 Alignment: 1619 SectionData: 488D0500000000C320 Relocations:21 - VirtualAddress: 322 SymbolName: bar23 Type: IMAGE_REL_AMD64_REL3224 - Name: .rdata25 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ ]26 Alignment: 827 SectionData: 2A000000000000002B0000000000000028symbols:29 - Name: .text30 Value: 031 SectionNumber: 132 SimpleType: IMAGE_SYM_TYPE_NULL33 ComplexType: IMAGE_SYM_DTYPE_NULL34 StorageClass: IMAGE_SYM_CLASS_STATIC35 SectionDefinition:36 Length: 837 NumberOfRelocations: 138 NumberOfLinenumbers: 039 CheckSum: 109217813140 Number: 141 - Name: .rdata42 Value: 043 SectionNumber: 244 SimpleType: IMAGE_SYM_TYPE_NULL45 ComplexType: IMAGE_SYM_DTYPE_NULL46 StorageClass: IMAGE_SYM_CLASS_STATIC47 SectionDefinition:48 Length: 1649 NumberOfRelocations: 050 NumberOfLinenumbers: 051 CheckSum: 120066849752 Number: 553 Selection: IMAGE_COMDAT_SELECT_ANY54 - Name: foo55 Value: 056 SectionNumber: 157 SimpleType: IMAGE_SYM_TYPE_NULL58 ComplexType: IMAGE_SYM_DTYPE_FUNCTION59 StorageClass: IMAGE_SYM_CLASS_EXTERNAL60 - Name: bar61 Value: 062 SectionNumber: 263 SimpleType: IMAGE_SYM_TYPE_NULL64 ComplexType: IMAGE_SYM_DTYPE_NULL65 StorageClass: IMAGE_SYM_CLASS_STATIC66...67