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 and .rela.text 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 10## GC collects .bar section and we exclude .rela.bar from output. We keep 11## .rela.text because we keep .text. 12# RUN: ld.lld --gc-sections --emit-relocs --print-gc-sections %t.o -o %t \ 13# RUN: | FileCheck --check-prefix=MSG %s 14# MSG: removing unused section {{.*}}.o:(.bar) 15# MSG: removing unused section {{.*}}.o:(.rela.bar) 16# RUN: llvm-objdump %t --section-headers | FileCheck %s --check-prefix=GC 17# GC-NOT: rela.bar 18# GC: rela.text 19# GC-NOT: rela.bar 20 21.section .bar,"a" 22.quad .bar 23 24.text 25relocs: 26.quad _start 27 28.global _start 29_start: 30 nop 31