brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · a738fce Raw
75 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t1.obj4# RUN: llvm-mc -triple=x86_64-windows-gnu %S/Inputs/associative-comdat-mingw-2.s -filetype=obj -o %t2.obj5 6# RUN: lld-link -lldmingw -entry:main %t1.obj %t2.obj -out:%t.gc.exe -verbose7# RUN: llvm-readobj --sections %t.gc.exe | FileCheck %s8 9# CHECK: Sections [10# CHECK:   Section {11# CHECK:     Number: 212# CHECK-LABEL:     Name: .rdata (2E 72 64 61 74 61 00 00)13#             This is the critical check to show that only *one* definition of14#             .xdata$foo was retained. This *must* be 0x24 (0x4 for the .xdata15#             section and 0x20 for the .ctors/.dtors headers/ends).16#             Make sure that no other .xdata sections get included, which would17#             increase the size here.18# CHECK-NEXT:     VirtualSize: 0x2419 20        .text21        .def            main;22        .scl            2;23        .type           32;24        .endef25        .globl          main26        .p2align        4, 0x9027main:28        call            foo29        retq30 31# Defines .text$foo (which has a leader symbol and is referenced like32# normally), and .xdata$foo (which lacks a leader symbol, which normally33# would be declared associative to the symbol foo).34# .xdata$foo should be implicitly treated as associative to foo and brought35# in, while .xdata$bar, implicitly associative to bar, not included, and36# .xdata$baz not included since there's no symbol baz.37 38# GNU binutils ld doesn't do this at all, but always includes all .xdata/.pdata39# comdat sections, even if --gc-sections is used.40 41        .section        .xdata$foo,"dr"42        .linkonce       discard43        .p2align        344        .long           4245 46        .section        .xdata$bar,"dr"47        .linkonce       discard48        .p2align        349        .long           4350 51        .section        .xdata$baz,"dr"52        .linkonce       discard53        .p2align        354        .long           4455 56        .def            foo;57        .scl            2;58        .type           32;59        .endef60        .section        .text$foo,"xr",discard,foo61        .globl          foo62        .p2align        463foo:64        ret65 66        .def            bar;67        .scl            2;68        .type           32;69        .endef70        .section        .text$bar,"xr",discard,bar71        .globl          bar72        .p2align        473bar:74        ret75