1 # RUN: yaml2obj %s > %t 2 # RUN: cp %t %t1 3 # RUN: llvm-objcopy --discard-all %t %t2 4 # Verify that llvm-objcopy has not modified the input. 5 # RUN: cmp %t %t1 6 # RUN: llvm-readobj -symbols %t2 | FileCheck %s 7 8 # RUN: llvm-objcopy -x %t %t3 9 # Verify that llvm-objcopy has not modified the input. 10 # RUN: cmp %t %t1 11 # RUN: cmp %t2 %t3 12 13 # Verify that llvm-strip modifies the symbol table the same way. 14 15 # RUN: cp %t %t4 16 # RUN: llvm-strip --discard-all %t4 17 # RUN: cmp %t2 %t4 18 19 # RUN: llvm-strip -x %t 20 # RUN: cmp %t2 %t 21 22 !ELF 23 FileHeader: 24 Class: ELFCLASS64 25 Data: ELFDATA2LSB 26 Type: ET_REL 27 Machine: EM_X86_64 28 Sections: 29 - Name: .text 30 Type: SHT_PROGBITS 31 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 32 Address: 0x1000 33 AddressAlign: 0x0000000000000010 34 Size: 64 35 Symbols: 36 Local: 37 - Name: Local 38 Type: STT_FUNC 39 Section: .text 40 Value: 0x1000 41 Size: 8 42 - Name: LocalSection 43 Type: STT_SECTION 44 Section: .text 45 - Name: LocalFile 46 Type: STT_FILE 47 Weak: 48 - Name: Weak 49 Type: STT_FUNC 50 Size: 8 51 Section: .text 52 Value: 0x1008 53 Global: 54 - Name: Global 55 Type: STT_FUNC 56 Size: 8 57 Section: .text 58 Value: 0x1010 59 60 #CHECK: Symbols [ 61 #CHECK-NEXT: Symbol { 62 #CHECK-NEXT: Name: 63 #CHECK-NEXT: Value: 0x0 64 #CHECK-NEXT: Size: 0 65 #CHECK-NEXT: Binding: Local 66 #CHECK-NEXT: Type: None 67 #CHECK-NEXT: Other: 0 68 #CHECK-NEXT: Section: Undefined 69 #CHECK-NEXT: } 70 #CHECK-NEXT: Symbol { 71 #CHECK-NEXT: Name: LocalSection 72 #CHECK-NEXT: Value: 0x0 73 #CHECK-NEXT: Size: 0 74 #CHECK-NEXT: Binding: Local 75 #CHECK-NEXT: Type: Section 76 #CHECK-NEXT: Other: 0 77 #CHECK-NEXT: Section: .text 78 #CHECK-NEXT: } 79 #CHECK-NEXT: Symbol { 80 #CHECK-NEXT: Name: LocalFile 81 #CHECK-NEXT: Value: 0x0 82 #CHECK-NEXT: Size: 0 83 #CHECK-NEXT: Binding: Local 84 #CHECK-NEXT: Type: File 85 #CHECK-NEXT: Other: 0 86 #CHECK-NEXT: Section: Undefined 87 #CHECK-NEXT: } 88 #CHECK-NEXT: Symbol { 89 #CHECK-NEXT: Name: Global 90 #CHECK-NEXT: Value: 0x1010 91 #CHECK-NEXT: Size: 8 92 #CHECK-NEXT: Binding: Global 93 #CHECK-NEXT: Type: Function 94 #CHECK-NEXT: Other: 0 95 #CHECK-NEXT: Section: .text 96 #CHECK-NEXT: } 97 #CHECK-NEXT: Symbol { 98 #CHECK-NEXT: Name: Weak 99 #CHECK-NEXT: Value: 0x1008 100 #CHECK-NEXT: Size: 8 101 #CHECK-NEXT: Binding: Weak 102 #CHECK-NEXT: Type: Function 103 #CHECK-NEXT: Other: 0 104 #CHECK-NEXT: Section: .text 105 #CHECK-NEXT: } 106 #CHECK-NEXT:] 107