1 # RUN: yaml2obj -format=elf %s | llvm-readobj -symbols - | \ 2 # RUN: FileCheck --check-prefix OBJ %s 3 # RUN: yaml2obj -format=elf %s | obj2yaml - | FileCheck --check-prefix YAML %s 4 5 # OBJ: Symbol { 6 # OBJ: Name: default1 (36) 7 # OBJ-NEXT: Value: 0x0 8 # OBJ-NEXT: Size: 4 9 # OBJ-NEXT: Binding: Global (0x1) 10 # OBJ-NEXT: Type: Object (0x1) 11 # OBJ-NEXT: Other: 0 12 # OBJ-NEXT: Section: .data (0x1) 13 # OBJ-NEXT: } 14 # OBJ-NEXT: Symbol { 15 # OBJ-NEXT: Name: default2 (27) 16 # OBJ-NEXT: Value: 0x4 17 # OBJ-NEXT: Size: 4 18 # OBJ-NEXT: Binding: Global (0x1) 19 # OBJ-NEXT: Type: Object (0x1) 20 # OBJ-NEXT: Other: 0 21 # OBJ-NEXT: Section: .data (0x1) 22 # OBJ-NEXT: } 23 # OBJ-NEXT: Symbol { 24 # OBJ-NEXT: Name: internal (8) 25 # OBJ-NEXT: Value: 0x8 26 # OBJ-NEXT: Size: 4 27 # OBJ-NEXT: Binding: Global (0x1) 28 # OBJ-NEXT: Type: Object (0x1) 29 # OBJ-NEXT: Other: 1 30 # OBJ-NEXT: Section: .data (0x1) 31 # OBJ-NEXT: } 32 # OBJ-NEXT: Symbol { 33 # OBJ-NEXT: Name: hidden (1) 34 # OBJ-NEXT: Value: 0xC 35 # OBJ-NEXT: Size: 4 36 # OBJ-NEXT: Binding: Global (0x1) 37 # OBJ-NEXT: Type: Object (0x1) 38 # OBJ-NEXT: Other: 2 39 # OBJ-NEXT: Section: .data (0x1) 40 # OBJ-NEXT: } 41 # OBJ-NEXT: Symbol { 42 # OBJ-NEXT: Name: protected (17) 43 # OBJ-NEXT: Value: 0x10 44 # OBJ-NEXT: Size: 4 45 # OBJ-NEXT: Binding: Global (0x1) 46 # OBJ-NEXT: Type: Object (0x1) 47 # OBJ-NEXT: Other: 3 48 # OBJ-NEXT: Section: .data (0x1) 49 # OBJ-NEXT: } 50 51 # YAML: Symbols: 52 # YAML-NEXT: Global: 53 # YAML-NEXT: - Name: default1 54 # YAML-NEXT: Type: STT_OBJECT 55 # YAML-NEXT: Section: .data 56 # YAML-NEXT: Size: 0x0000000000000004 57 # YAML-NEXT: - Name: default2 58 # YAML-NEXT: Type: STT_OBJECT 59 # YAML-NEXT: Section: .data 60 # YAML-NEXT: Value: 0x0000000000000004 61 # YAML-NEXT: Size: 0x0000000000000004 62 # YAML-NEXT: - Name: internal 63 # YAML-NEXT: Type: STT_OBJECT 64 # YAML-NEXT: Section: .data 65 # YAML-NEXT: Value: 0x0000000000000008 66 # YAML-NEXT: Size: 0x0000000000000004 67 # YAML-NEXT: Visibility: STV_INTERNAL 68 # YAML-NEXT: - Name: hidden 69 # YAML-NEXT: Type: STT_OBJECT 70 # YAML-NEXT: Section: .data 71 # YAML-NEXT: Value: 0x000000000000000C 72 # YAML-NEXT: Size: 0x0000000000000004 73 # YAML-NEXT: Visibility: STV_HIDDEN 74 # YAML-NEXT: - Name: protected 75 # YAML-NEXT: Type: STT_OBJECT 76 # YAML-NEXT: Section: .data 77 # YAML-NEXT: Value: 0x0000000000000010 78 # YAML-NEXT: Size: 0x0000000000000004 79 # YAML-NEXT: Visibility: STV_PROTECTED 80 81 --- 82 FileHeader: 83 Class: ELFCLASS32 84 Data: ELFDATA2LSB 85 Type: ET_REL 86 Machine: EM_MIPS 87 Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ] 88 89 Sections: 90 - Name: .data 91 Type: SHT_PROGBITS 92 Flags: [ SHF_ALLOC, SHF_WRITE ] 93 AddressAlign: 0x04 94 Size: 0x14 95 96 Symbols: 97 Global: 98 - Name: default1 99 Type: STT_OBJECT 100 Visibility: STV_DEFAULT 101 Section: .data 102 Value: 0x00 103 Size: 0x04 104 - Name: default2 105 Type: STT_OBJECT 106 Section: .data 107 Value: 0x04 108 Size: 0x04 109 - Name: internal 110 Type: STT_OBJECT 111 Visibility: STV_INTERNAL 112 Section: .data 113 Value: 0x08 114 Size: 0x04 115 - Name: hidden 116 Type: STT_OBJECT 117 Visibility: STV_HIDDEN 118 Section: .data 119 Value: 0x0C 120 Size: 0x04 121 - Name: protected 122 Type: STT_OBJECT 123 Visibility: STV_PROTECTED 124 Section: .data 125 Value: 0x10 126 Size: 0x04 127