1 ## Show that llvm-objcopy/llvm-strip removes all symbols and debug sections.
3 # RUN: yaml2obj %p/Inputs/strip-all.yaml -o %t.exec
4 # RUN: yaml2obj %p/Inputs/strip-all-with-dwarf.yaml -o %t.dwarf
6 ## Check that the symbol list satisfies the order: local / defined external /
7 ## undefined external, otherwise llvm-objcopy will fail.
8 # RUN: llvm-objcopy %t.exec /dev/null
10 # RUN: llvm-objcopy --strip-all %t.exec %t.exec.stripped
11 # RUN: llvm-readobj --sections --relocations --symbols %t.exec.stripped \
12 # RUN: | FileCheck --check-prefix=COMMON %s
14 # RUN: llvm-objcopy --strip-all %t.dwarf %t.dwarf.stripped
15 # RUN: llvm-readobj --sections --relocations --symbols %t.dwarf.stripped \
16 # RUN: | FileCheck --check-prefixes=COMMON,DWARF %s
18 ## The output of "llvm-strip" should be identical with that of
19 ## "llvm-strip --strip-all" and "llvm-objcopy --strip-all".
20 # RUN: llvm-strip %t.exec -o %t2
21 # RUN: llvm-strip --strip-all %t.exec -o %t3
22 # cmp %t2 %t.exec.stripped
23 # cmp %t3 %t.exec.stripped
25 # RUN: llvm-strip %t.dwarf -o %t4
26 # RUN: llvm-strip --strip-all %t.dwarf -o %t5
27 # cmp %t4 %t.dwarf.stripped
28 # cmp %t5 %t.dwarf.stripped
30 # RUN: llvm-lipo %t.dwarf -create -output %t.dwarf.universal
31 # RUN: llvm-strip %t.dwarf.universal -o %t.dwarf.universal.stripped
32 # RUN: llvm-lipo %t.dwarf.universal.stripped -thin x86_64 -output %t6
33 # RUN: cmp %t6 %t.dwarf.stripped
35 ## Make sure that debug sections are removed.
37 # DWARF-NOT: Name: __debug_str
38 # DWARF-NOT: Name: __debug_abbrev
39 # DWARF-NOT: Name: __debug_info
40 # DWARF-NOT: Name: __debug_macinfo
41 # DWARF-NOT: Name: __apple_names
42 # DWARF-NOT: Name: __apple_objc
43 # DWARF-NOT: Name: __apple_namespac
44 # DWARF-NOT: Name: __apple_types
45 # DWARF-NOT: Name: __debug_line
48 ## Make sure that all relocations and symbols
49 ## (except those which have the flag ReferencedDynamically set) are removed.
50 # COMMON: Relocations [
52 # COMMON-NEXT: Symbols [
53 # COMMON-NEXT: Symbol {
54 # COMMON-NEXT: Name: __mh_execute_header
56 # COMMON-NEXT: Type: Section
57 # COMMON-NEXT: Section: __text
58 # COMMON-NEXT: RefType: UndefinedNonLazy
59 # COMMON-NEXT: Flags [ (0x10)
60 # COMMON-NEXT: ReferencedDynamically (0x10)