1# RUN: yaml2obj %s | llvm-readobj -symbols - | \ 2# RUN: FileCheck --check-prefix OBJ %s 3# RUN: yaml2obj %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 [ (0x1) 30# OBJ-NEXT: STV_INTERNAL 31# OBJ-NEXT: ] 32# OBJ-NEXT: Section: .data (0x1) 33# OBJ-NEXT: } 34# OBJ-NEXT: Symbol { 35# OBJ-NEXT: Name: hidden (1) 36# OBJ-NEXT: Value: 0xC 37# OBJ-NEXT: Size: 4 38# OBJ-NEXT: Binding: Global (0x1) 39# OBJ-NEXT: Type: Object (0x1) 40# OBJ-NEXT: Other [ (0x2) 41# OBJ-NEXT: STV_HIDDEN 42# OBJ-NEXT: ] 43# OBJ-NEXT: Section: .data (0x1) 44# OBJ-NEXT: } 45# OBJ-NEXT: Symbol { 46# OBJ-NEXT: Name: protected (17) 47# OBJ-NEXT: Value: 0x10 48# OBJ-NEXT: Size: 4 49# OBJ-NEXT: Binding: Global (0x1) 50# OBJ-NEXT: Type: Object (0x1) 51# OBJ-NEXT: Other [ (0xA3) 52# OBJ-NEXT: STO_MIPS_MICROMIPS 53# OBJ-NEXT: STO_MIPS_PIC 54# OBJ-NEXT: STV_PROTECTED 55# OBJ-NEXT: ] 56# OBJ-NEXT: Section: .data (0x1) 57# OBJ-NEXT: } 58 59# YAML: Symbols: 60# YAML-NEXT: Global: 61# YAML-NEXT: - Name: default1 62# YAML-NEXT: Type: STT_OBJECT 63# YAML-NEXT: Section: .data 64# YAML-NEXT: Size: 0x0000000000000004 65# YAML-NEXT: - Name: default2 66# YAML-NEXT: Type: STT_OBJECT 67# YAML-NEXT: Section: .data 68# YAML-NEXT: Value: 0x0000000000000004 69# YAML-NEXT: Size: 0x0000000000000004 70# YAML-NEXT: - Name: internal 71# YAML-NEXT: Type: STT_OBJECT 72# YAML-NEXT: Section: .data 73# YAML-NEXT: Value: 0x0000000000000008 74# YAML-NEXT: Size: 0x0000000000000004 75# YAML-NEXT: Visibility: STV_INTERNAL 76# YAML-NEXT: - Name: hidden 77# YAML-NEXT: Type: STT_OBJECT 78# YAML-NEXT: Section: .data 79# YAML-NEXT: Value: 0x000000000000000C 80# YAML-NEXT: Size: 0x0000000000000004 81# YAML-NEXT: Visibility: STV_HIDDEN 82# YAML-NEXT: - Name: protected 83# YAML-NEXT: Type: STT_OBJECT 84# YAML-NEXT: Section: .data 85# YAML-NEXT: Value: 0x0000000000000010 86# YAML-NEXT: Size: 0x0000000000000004 87# YAML-NEXT: Visibility: STV_PROTECTED 88# YAML-NEXT: Other: [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ] 89 90--- !ELF 91FileHeader: 92 Class: ELFCLASS32 93 Data: ELFDATA2LSB 94 Type: ET_REL 95 Machine: EM_MIPS 96 Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ] 97 98Sections: 99 - Name: .data 100 Type: SHT_PROGBITS 101 Flags: [ SHF_ALLOC, SHF_WRITE ] 102 AddressAlign: 0x04 103 Size: 0x14 104 105Symbols: 106 Global: 107 - Name: default1 108 Type: STT_OBJECT 109 Visibility: STV_DEFAULT 110 Section: .data 111 Value: 0x00 112 Size: 0x04 113 - Name: default2 114 Type: STT_OBJECT 115 Section: .data 116 Value: 0x04 117 Size: 0x04 118 - Name: internal 119 Type: STT_OBJECT 120 Visibility: STV_INTERNAL 121 Section: .data 122 Value: 0x08 123 Size: 0x04 124 - Name: hidden 125 Type: STT_OBJECT 126 Visibility: STV_HIDDEN 127 Section: .data 128 Value: 0x0C 129 Size: 0x04 130 - Name: protected 131 Type: STT_OBJECT 132 Visibility: STV_PROTECTED 133 Other: [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ] 134 Section: .data 135 Value: 0x10 136 Size: 0x04 137