• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Check yaml2obj is able to dump relocations
2## that have no or a zero symbol associated.
3
4# RUN: yaml2obj %s -o %t.o
5# RUN: obj2yaml %t.o | FileCheck %s
6
7# CHECK:      --- !ELF
8# CHECK-NEXT: FileHeader:
9# CHECK-NEXT:   Class:   ELFCLASS64
10# CHECK-NEXT:   Data:    ELFDATA2LSB
11# CHECK-NEXT:   Type:    ET_REL
12# CHECK-NEXT:   Machine: EM_X86_64
13# CHECK-NEXT: Sections:
14# CHECK-NEXT:   - Name:    .text
15# CHECK-NEXT:     Type:    SHT_PROGBITS
16# CHECK-NEXT:     Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
17# CHECK-NEXT:   - Name:    .rela.text
18# CHECK-NEXT:     Type:    SHT_RELA
19# CHECK-NEXT:     Info:    .text
20# CHECK-NEXT:     Relocations:
21# CHECK-NEXT:       - Type:   R_X86_64_NONE
22# CHECK-NEXT:       - Offset: 0x4
23# CHECK-NEXT:         Type:   R_X86_64_NONE
24# CHECK-NEXT: ...
25
26--- !ELF
27FileHeader:
28  Class:   ELFCLASS64
29  Data:    ELFDATA2LSB
30  Type:    ET_REL
31  Machine: EM_X86_64
32Sections:
33  - Name:  .text
34    Type:  SHT_PROGBITS
35    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
36  - Name:  .rela.text
37    Type:  SHT_RELA
38    Info:  .text
39    Relocations:
40      - Type:   R_X86_64_NONE
41      - Offset: 0x4
42        Type:   R_X86_64_NONE
43        Symbol: 0
44