1## Show that llvm-objcopy/llvm-strip removes all symbols and debug sections. 2 3# RUN: yaml2obj %p/Inputs/strip-all-with-dwarf.yaml -o %t 4 5# RUN: llvm-objcopy --strip-debug %t %t.stripped 6# RUN: llvm-readobj --sections %t.stripped | FileCheck /dev/null \ 7# RUN: --implicit-check-not='Name: __debug' --implicit-check-not='Name: __apple' 8 9## Make sure that all symbols are kept. 10# RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=SYM 11# RUN: llvm-readobj --symbols %t.stripped | FileCheck %s --check-prefix=SYM 12 13# SYM: Symbols [ 14# SYM-COUNT-3: Symbol 15# SYM: ] 16 17## Make sure that all relocations to non-debug sections are kept. 18# RUN: llvm-readobj -r %t | FileCheck %s --check-prefixes=RELOC,DEBUG 19# RUN: llvm-readobj -r %t.stripped | FileCheck %s --check-prefix=RELOC 20 21# RUN: llvm-strip --strip-debug %t -o %t.stripped2 22# RUN: cmp %t.stripped %t.stripped2 23 24# RELOC: Relocations [ 25# RELOC-NEXT: Section __text { 26# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 27# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _main 28# RELOC-NEXT: } 29# DEBUG: Section __debug_info { 30# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 31# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 32# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 33# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 34# DEBUG-NEXT: } 35# RELOC-NEXT: Section __compact_unwind { 36# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 37# RELOC-NEXT: } 38# DEBUG-NEXT: Section __debug_line { 39# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar 40# DEBUG-NEXT: } 41# RELOC-NEXT: ] 42