llvm/test/Object/yaml2obj-elf-symbol-visibility.yaml
Simon Atanasyan cc6b0d4dd4 [llvm-readobj] Decode st_other symbol's flags
The patch supports common STV_xxx visibility flags and MIPS specific
STO_MIPS_xxx flags.

Differential Revision: http://reviews.llvm.org/D18447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 16:10:37 +00:00

137 lines
4.3 KiB
YAML

# RUN: yaml2obj -format=elf %s | llvm-readobj -symbols - | \
# RUN: FileCheck --check-prefix OBJ %s
# RUN: yaml2obj -format=elf %s | obj2yaml - | FileCheck --check-prefix YAML %s
# OBJ: Symbol {
# OBJ: Name: default1 (36)
# OBJ-NEXT: Value: 0x0
# OBJ-NEXT: Size: 4
# OBJ-NEXT: Binding: Global (0x1)
# OBJ-NEXT: Type: Object (0x1)
# OBJ-NEXT: Other: 0
# OBJ-NEXT: Section: .data (0x1)
# OBJ-NEXT: }
# OBJ-NEXT: Symbol {
# OBJ-NEXT: Name: default2 (27)
# OBJ-NEXT: Value: 0x4
# OBJ-NEXT: Size: 4
# OBJ-NEXT: Binding: Global (0x1)
# OBJ-NEXT: Type: Object (0x1)
# OBJ-NEXT: Other: 0
# OBJ-NEXT: Section: .data (0x1)
# OBJ-NEXT: }
# OBJ-NEXT: Symbol {
# OBJ-NEXT: Name: internal (8)
# OBJ-NEXT: Value: 0x8
# OBJ-NEXT: Size: 4
# OBJ-NEXT: Binding: Global (0x1)
# OBJ-NEXT: Type: Object (0x1)
# OBJ-NEXT: Other [ (0x1)
# OBJ-NEXT: STV_INTERNAL
# OBJ-NEXT: ]
# OBJ-NEXT: Section: .data (0x1)
# OBJ-NEXT: }
# OBJ-NEXT: Symbol {
# OBJ-NEXT: Name: hidden (1)
# OBJ-NEXT: Value: 0xC
# OBJ-NEXT: Size: 4
# OBJ-NEXT: Binding: Global (0x1)
# OBJ-NEXT: Type: Object (0x1)
# OBJ-NEXT: Other [ (0x2)
# OBJ-NEXT: STV_HIDDEN
# OBJ-NEXT: ]
# OBJ-NEXT: Section: .data (0x1)
# OBJ-NEXT: }
# OBJ-NEXT: Symbol {
# OBJ-NEXT: Name: protected (17)
# OBJ-NEXT: Value: 0x10
# OBJ-NEXT: Size: 4
# OBJ-NEXT: Binding: Global (0x1)
# OBJ-NEXT: Type: Object (0x1)
# OBJ-NEXT: Other [ (0xA3)
# OBJ-NEXT: STO_MIPS_MICROMIPS
# OBJ-NEXT: STO_MIPS_PIC
# OBJ-NEXT: STV_PROTECTED
# OBJ-NEXT: ]
# OBJ-NEXT: Section: .data (0x1)
# OBJ-NEXT: }
# YAML: Symbols:
# YAML-NEXT: Global:
# YAML-NEXT: - Name: default1
# YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: - Name: default2
# YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data
# YAML-NEXT: Value: 0x0000000000000004
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: - Name: internal
# YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data
# YAML-NEXT: Value: 0x0000000000000008
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Visibility: STV_INTERNAL
# YAML-NEXT: - Name: hidden
# YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data
# YAML-NEXT: Value: 0x000000000000000C
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Visibility: STV_HIDDEN
# YAML-NEXT: - Name: protected
# YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data
# YAML-NEXT: Value: 0x0000000000000010
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Visibility: STV_PROTECTED
# YAML-NEXT: Other: [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ]
---
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
Sections:
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_WRITE ]
AddressAlign: 0x04
Size: 0x14
Symbols:
Global:
- Name: default1
Type: STT_OBJECT
Visibility: STV_DEFAULT
Section: .data
Value: 0x00
Size: 0x04
- Name: default2
Type: STT_OBJECT
Section: .data
Value: 0x04
Size: 0x04
- Name: internal
Type: STT_OBJECT
Visibility: STV_INTERNAL
Section: .data
Value: 0x08
Size: 0x04
- Name: hidden
Type: STT_OBJECT
Visibility: STV_HIDDEN
Section: .data
Value: 0x0C
Size: 0x04
- Name: protected
Type: STT_OBJECT
Visibility: STV_PROTECTED
Other: [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ]
Section: .data
Value: 0x10
Size: 0x04