1# REQUIRES: x86 2## 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.o 6# RUN: ld.lld %t.o -o /dev/null 7# RUN: ld.lld %t.o --gc-sections -z nostart-stop-gc -o /dev/null 8# RUN: not ld.lld %t.o --gc-sections -o /dev/null 2>&1 | FileCheck %s 9 10# CHECK: error: undefined symbol: __start_meta 11# 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",@progbits 15.global _start 16_start: 17 .quad __start_meta - . 18 .quad __stop_meta - . 19 20.section meta,"aw",@progbits 21.quad 0 22