# REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: echo "SECTIONS { .text : { *(.text.1) } }" > %t.script ## Check we do not report orphans by default even with -verbose. # RUN: ld.lld -shared -o %t.out --script %t.script %t.o 2>&1 -verbose \ # RUN: | FileCheck %s --check-prefix=DEFAULT # DEFAULT-NOT: placed ## Check --orphan-handling=place has the same behavior as default. # RUN: ld.lld -shared --orphan-handling=place -o %t.out --script %t.script \ # RUN: %t.o 2>&1 -verbose -error-limit=0 | FileCheck %s --check-prefix=DEFAULT ## Check --orphan-handling=error reports errors about orphans. # RUN: not ld.lld -shared --orphan-handling=error -o %t.out --script %t.script \ # RUN: %t.o 2>&1 -verbose -error-limit=0 | FileCheck %s --check-prefix=REPORT # REPORT: {{.*}}.o:(.text) is being placed in '.text' # REPORT-NEXT: {{.*}}.o:(.text.2) is being placed in '.text' # REPORT-NEXT: :(.comment) is being placed in '.comment' # REPORT-NEXT: :(.bss) is being placed in '.bss' # REPORT-NEXT: :(.bss.rel.ro) is being placed in '.bss.rel.ro' # REPORT-NEXT: :(.dynsym) is being placed in '.dynsym' # REPORT-NEXT: :(.gnu.version) is being placed in '.gnu.version' # REPORT-NEXT: :(.gnu.version_r) is being placed in '.gnu.version_r' # REPORT-NEXT: :(.gnu.hash) is being placed in '.gnu.hash' # REPORT-NEXT: :(.hash) is being placed in '.hash' # REPORT-NEXT: :(.dynamic) is being placed in '.dynamic' # REPORT-NEXT: :(.dynstr) is being placed in '.dynstr' # REPORT-NEXT: :(.rela.dyn) is being placed in '.rela.dyn' # REPORT-NEXT: :(.got) is being placed in '.got' # REPORT-NEXT: :(.got.plt) is being placed in '.got.plt' # REPORT-NEXT: :(.got.plt) is being placed in '.got.plt' # REPORT-NEXT: :(.rela.plt) is being placed in '.rela.plt' # REPORT-NEXT: :(.rela.plt) is being placed in '.rela.plt' # REPORT-NEXT: :(.plt) is being placed in '.plt' # REPORT-NEXT: :(.plt) is being placed in '.plt' # REPORT-NEXT: :(.eh_frame) is being placed in '.eh_frame' # REPORT-NEXT: :(.symtab) is being placed in '.symtab' # REPORT-NEXT: :(.shstrtab) is being placed in '.shstrtab' # REPORT-NEXT: :(.strtab) is being placed in '.strtab' ## Check --orphan-handling=warn reports warnings about orphans. # RUN: ld.lld -shared --orphan-handling=warn -o %t.out --script %t.script \ # RUN: %t.o 2>&1 -verbose | FileCheck %s --check-prefix=REPORT # RUN: not ld.lld --orphan-handling=foo -o %t.out --script %t.script %t.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=UNKNOWN # UNKNOWN: unknown --orphan-handling mode: foo .section .text.1,"a" nop .section .text.2,"a" nop