1# REQUIRES: x86 2 3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o 4# RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | FileCheck %s --implicit-check-not=removing 5 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 _start 12_start: 13.quad .foo1 14 15.section .foo1,"a" 16.quad 0 17 18.section .foo2,"a" 19.quad 0 20 21.section bar1,"ao",@progbits,.foo1 22.quad .zed1 23.quad .foo1 24 25.section bar2,"ao",@progbits,.foo2 26.quad .zed2 27.quad .foo2 28 29## An SHT_INIT_ARRAY with the SHF_LINK_ORDER flag can be GCed. 30.section .init_array.bar2,"awo",@init_array,.foo2 31.quad .zed2 32.quad .foo2 33 34.section .zed1,"a" 35.quad 0 36 37.section .zed2,"a" 38.quad 0 39