1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o 3 4## Show that we emit .rela.bar, .rela.text and .rela.debug_info when GC is disabled. 5# RUN: ld.lld --emit-relocs %t.o -o %t 6# RUN: llvm-objdump %t --section-headers | FileCheck %s --check-prefix=NOGC 7# NOGC: .rela.text 8# NOGC: .rela.bar 9# NOGC: .rela.debug_info 10 11## GC collects .bar section and we exclude .rela.bar from output. We keep 12## .rela.text because we keep .text. We keep .rela.debug_info because we keep 13## non-SHF_ALLOC .debug_info. 14# RUN: ld.lld --gc-sections --emit-relocs --print-gc-sections %t.o -o %t \ 15# RUN: | FileCheck --check-prefix=MSG %s 16# MSG: removing unused section {{.*}}.o:(.bar) 17# MSG: removing unused section {{.*}}.o:(.rela.bar) 18# RUN: llvm-objdump %t --section-headers | FileCheck %s --check-prefix=GC --implicit-check-not=.rela. 19# GC: .rela.text 20# GC-NEXT: .debug_info 21# GC-NEXT: .rela.debug_info 22 23.section .bar,"a" 24.quad .bar 25 26.text 27relocs: 28.quad _start 29 30.global _start 31_start: 32 nop 33 34.section .debug_info,"",@progbits 35.quad .text 36