22 lines · plain
1# REQUIRES: x862## Some projects may not work with GNU ld<2015-10 (ld.lld 13.0.0) --gc-sections behavior.3## Give a hint.4 5# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o6# RUN: ld.lld %t.o -o /dev/null7# RUN: ld.lld %t.o --gc-sections -z nostart-stop-gc -o /dev/null8# RUN: not ld.lld %t.o --gc-sections -o /dev/null 2>&1 | FileCheck %s9 10# CHECK: error: undefined symbol: __start_meta11# CHECK-NEXT: >>> referenced by {{.*}}12# CHECK-NEXT: >>> the encapsulation symbol needs to be retained under --gc-sections properly; consider -z nostart-stop-gc (see https://lld.llvm.org/ELF/start-stop-gc)13 14.section .text,"ax",@progbits15.global _start16_start:17 .quad __start_meta - .18 .quad __stop_meta - .19 20.section meta,"aw",@progbits21.quad 022