• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s > %t
2# RUN: llvm-readobj -r %t | FileCheck -check-prefix=OBJ %s
3# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
4
5# OBJ:      Relocations [
6# OBJ-NEXT:   Section (2) .rela.text {
7# OBJ-NEXT:     0x14 R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 main 0x4
8# OBJ-NEXT:     0x1C R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 main 0x8
9# OBJ-NEXT:     0x20 R_MIPS_GOT_PAGE/R_MIPS_NONE/R_MIPS_NONE .rodata 0x0
10# OBJ-NEXT:     0x24 R_MIPS_GOT_OFST/R_MIPS_NONE/R_MIPS_NONE .rodata 0x0
11# OBJ-NEXT:     0x28 R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE printf 0x0
12# OBJ-NEXT:     0x30 R_MIPS_GPREL16/R_MIPS_LO16/R_MIPS_NONE printf 0x0
13# OBJ-NEXT:   }
14# OBJ-NEXT: ]
15
16# YAML:      Relocations:
17# YAML-NEXT:   - Offset:      0x0000000000000014
18# YAML-NEXT:     Symbol:      main
19# YAML-NEXT:     Type:        R_MIPS_GPREL16
20# YAML-NEXT:     Type2:       R_MIPS_SUB
21# YAML-NEXT:     Type3:       R_MIPS_HI16
22# YAML-NEXT:     Addend:      4
23# YAML-NEXT:   - Offset:      0x000000000000001C
24# YAML-NEXT:     Symbol:      main
25# YAML-NEXT:     Type:        R_MIPS_GPREL16
26# YAML-NEXT:     Type2:       R_MIPS_SUB
27# YAML-NEXT:     Type3:       R_MIPS_LO16
28# YAML-NEXT:     Addend:      8
29# YAML-NEXT:   - Offset:      0x0000000000000020
30# YAML-NEXT:     Symbol:      .rodata
31# YAML-NEXT:     Type:        R_MIPS_GOT_PAGE
32# YAML-NEXT:   - Offset:      0x0000000000000024
33# YAML-NEXT:     Symbol:      .rodata
34# YAML-NEXT:     Type:        R_MIPS_GOT_OFST
35# YAML-NEXT:   - Offset:      0x0000000000000028
36# YAML-NEXT:     Symbol:      printf
37# YAML-NEXT:     Type:        R_MIPS_CALL16
38# YAML-NEXT:   - Offset:      0x0000000000000030
39# YAML-NEXT:     Symbol:      printf
40# YAML-NEXT:     Type:        R_MIPS_GPREL16
41# YAML-NEXT:     Type2:       R_MIPS_LO16
42# YAML-NEXT:     SpecSym:     RSS_GP0
43
44--- !ELF
45FileHeader:
46  Class:           ELFCLASS64
47  Data:            ELFDATA2LSB
48  Type:            ET_REL
49  Machine:         EM_MIPS
50  Flags:           [ EF_MIPS_PIC, EF_MIPS_CPIC,
51                     EF_MIPS_NOREORDER, EF_MIPS_ARCH_64R2 ]
52Sections:
53  - Name:            .text
54    Type:            SHT_PROGBITS
55    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
56    AddressAlign:    0x10
57    Size:            0x60
58  - Name:            .rela.text
59    Type:            SHT_RELA
60    Flags:           [ SHF_INFO_LINK ]
61    AddressAlign:    0x8
62    Info:            .text
63    Relocations:
64      - Offset:      0x14
65        Symbol:      main
66        Type:        R_MIPS_GPREL16
67        Type2:       R_MIPS_SUB
68        Type3:       R_MIPS_HI16
69        Addend:      4
70      - Offset:      0x1C
71        Symbol:      main
72        Type:        R_MIPS_GPREL16
73        Type2:       R_MIPS_SUB
74        Type3:       R_MIPS_LO16
75        Addend:      8
76      - Offset:      0x20
77        Symbol:      .rodata
78        Type:        R_MIPS_GOT_PAGE
79        Addend:      0
80      - Offset:      0x24
81        Symbol:      .rodata
82        Type:        R_MIPS_GOT_OFST
83        Addend:      0
84      - Offset:      0x28
85        Symbol:      printf
86        Type:        R_MIPS_CALL16
87        Addend:      0
88      - Offset:      0x30
89        Symbol:      printf
90        Type:        R_MIPS_GPREL16
91        Type2:       R_MIPS_LO16
92        SpecSym:     RSS_GP0
93        Addend:      0
94  - Name:            .rodata
95    Type:            SHT_PROGBITS
96    Flags:           [ SHF_ALLOC ]
97    AddressAlign:    0x10
98    Size:            0x0F
99
100Symbols:
101  Local:
102    - Name:            .text
103      Type:            STT_SECTION
104      Section:         .text
105    - Name:            .rodata
106      Type:            STT_SECTION
107      Section:         .rodata
108  Global:
109    - Name:            main
110      Type:            STT_FUNC
111      Section:         .text
112      Size:            0x58
113    - Name:            printf
114...
115