39 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o4# RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | FileCheck %s --implicit-check-not=removing5 6# CHECK: removing unused section {{.*}}.o:(.foo2)7# CHECK: removing unused section {{.*}}.o:(bar2)8# CHECK: removing unused section {{.*}}.o:(.init_array.bar2)9# CHECK: removing unused section {{.*}}.o:(.zed2)10 11.global _start12_start:13.quad .foo114 15.section .foo1,"a"16.quad 017 18.section .foo2,"a"19.quad 020 21.section bar1,"ao",@progbits,.foo122.quad .zed123.quad .foo124 25.section bar2,"ao",@progbits,.foo226.quad .zed227.quad .foo228 29## An SHT_INIT_ARRAY with the SHF_LINK_ORDER flag can be GCed.30.section .init_array.bar2,"awo",@init_array,.foo231.quad .zed232.quad .foo233 34.section .zed1,"a"35.quad 036 37.section .zed2,"a"38.quad 039