reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
## Check how obj2yaml dumps the SHT_LLVM_ADDRSIG section.

## Check that when possible obj2yaml tries to produce the "Name" tag when
## dumping entries of the SHT_LLVM_ADDRSIG section. It falls back to producing
## the "Index" tag when it can't match a symbol index with a symbol table entry.

# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=NAME

# NAME:      - Name: .llvm_addrsig
# NAME-NEXT:   Type: SHT_LLVM_ADDRSIG
# NAME-NEXT:   Link: .symtab
# NAME-NEXT:   Symbols:
# NAME-NEXT:     - Name:  foo
# NAME-NEXT:     - Name:  bar
# NAME-NEXT:     - Index: 0x00000003
# NAME-NEXT:     - Index: 0xFFFFFFFF
# NAME:      - Name: .llvm_addrsig_unlinked
# NAME-NEXT:   Type: SHT_LLVM_ADDRSIG
# NAME-NEXT:   Symbols:
# NAME-NEXT:     - Index: 0x00000001
# NAME-NEXT:     - Index: 0x00000002
# NAME-NEXT:     - Index: 0x00000003
# NAME-NEXT:     - Index: 0xFFFFFFFF

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Symbols:
      - Index: 1
      - Index: 2
      - Index: 3
      - Index: 0xFFFFFFFF
  - Name: .llvm_addrsig_unlinked
    Type: SHT_LLVM_ADDRSIG
    Link: 0
    Symbols:
      - Index: 1
      - Index: 2
      - Index: 3
      - Index: 0xFFFFFFFF
Symbols:
  - Name:    foo
    Type:    STT_FUNC
    Binding: STB_GLOBAL
  - Name:    bar
    Type:    STT_FUNC
    Binding: STB_GLOBAL

## Check that obj2yaml dumps the SHT_LLVM_ADDRSIG section
## data using the "Content" tag when at least one of the entries is broken,
## e.g. because the entry contains a malformed uleb128 value.

# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID-ENTRY

# INVALID-ENTRY:      - Name:    .llvm_addrsig
# INVALID-ENTRY-NEXT:   Type:    SHT_LLVM_ADDRSIG
# INVALID-ENTRY-NEXT:   Content: FFFFFFFFFF

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Content: "FFFFFFFFFF"

## obj2yaml produces a "Symbols" tag when describing an empty SHT_LLVM_ADDRSIG section.

# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY

# EMPTY:      - Name:    .llvm_addrsig
# EMPTY-NEXT:   Type:    SHT_LLVM_ADDRSIG
# EMPTY-NEXT:   Symbols: []

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Content: ""