47 lines · plain
1# REQUIRES: x862# LINK_ORDER cnamed sections are not kept alive by the __start_* reference.3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o5# RUN: ld.lld --gc-sections -z start-stop-gc -z nostart-stop-gc %t.o -o %t6# RUN: llvm-objdump --section-headers -t %t | FileCheck %s7 8## With -z start-stop-gc (default), non-SHF_LINK_ORDER C identifier name9## sections are not retained by __start_/__stop_ references.10# RUN: ld.lld --gc-sections %t.o -o %t11# RUN: llvm-readelf -S -s %t | FileCheck %s --check-prefix=GC12# RUN: ld.lld --gc-sections -z start-stop-gc %t.o -o %t113# RUN: llvm-readelf -S -s %t1 | FileCheck %s --check-prefix=GC14 15# CHECK: Sections:16# CHECK-NOT: yy17# CHECK: xx {{.*}} DATA18# CHECK-NOT: yy19 20# CHECK: SYMBOL TABLE:21# CHECK: xx 0000000000000000 .protected __start_xx22# CHECK: w *UND* 0000000000000000 __start_yy23 24# GC: Section Headers:25# GC-NOT: xx26# GC-NOT: yy27 28# GC: WEAK DEFAULT UND __start_xx29# GC: WEAK DEFAULT UND __start_yy30 31.weak __start_xx32.weak __start_yy33 34.global _start35_start:36.quad __start_xx37.quad __start_yy38 39.section xx,"a"40.quad 041 42.section .foo,"a"43.quad 044 45.section yy,"ao",@progbits,.foo46.quad 047