42 lines · plain
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 %t4 5# RUN: llvm-objcopy --strip-debug %t %t.stripped6# 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=SYM11# RUN: llvm-readobj --symbols %t.stripped | FileCheck %s --check-prefix=SYM12 13# SYM: Symbols [14# SYM-COUNT-3: Symbol15# 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,DEBUG19# RUN: llvm-readobj -r %t.stripped | FileCheck %s --check-prefix=RELOC20 21# RUN: llvm-strip --strip-debug %t -o %t.stripped222# RUN: cmp %t.stripped %t.stripped223 24# RELOC: Relocations [25# RELOC-NEXT: Section __text {26# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar27# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _main28# RELOC-NEXT: }29# DEBUG: Section __debug_info {30# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar31# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar32# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar33# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar34# DEBUG-NEXT: }35# RELOC-NEXT: Section __compact_unwind {36# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar37# RELOC-NEXT: }38# DEBUG-NEXT: Section __debug_line {39# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar40# DEBUG-NEXT: }41# RELOC-NEXT: ]42