Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-readobj / XCOFF / loader-section-relocation.test
blob42eb897d073939298e1befa30ba36b075fa3d19d
1 ## Test the --loader-section-relocations option.
3 # RUN: yaml2obj --docnum=1 %s -o %t_xcoff32.o
4 # RUN: yaml2obj --docnum=2  %s -o %t_xcoff64.o
5 # RUN: llvm-readobj --loader-section-relocations --expand-relocs %t_xcoff32.o | FileCheck --check-prefixes=COMMON,EXPAND %s
6 # RUN: llvm-readobj --loader-section-relocations --expand-relocs %t_xcoff64.o | FileCheck --check-prefixes=COMMON,EXPAND %s
7 # RUN: llvm-readobj --loader-section-relocations %t_xcoff32.o | FileCheck --check-prefixes=COMMON,NOEXPAND32 %s
8 # RUN: llvm-readobj --loader-section-relocations %t_xcoff64.o | FileCheck --check-prefixes=COMMON,NOEXPAND64 %s
10 --- !XCOFF
11 FileHeader:
12   MagicNumber:       0x1DF
13 Sections:
14   - Name:            .loader
15     Flags:           [ STYP_LOADER ]
16     SectionData:     "0000000100000001000000020000016D00000001000000A400000000000000506d79696e747661722000028000021105000000000000000020000294000000011f0000022000029c000000031f000002"
17 ##                    ^-------                                                           -Version=1
18 ##                            ^-------                                                   -NumberOfSymbolEntries=1
19 ##                                    ^-------                                           -NumberOfRelocationEntries=2
20 ##                                            ^-------                                   -LengthOfImportFileIDStringTable=365
21 ##                                                    ^-------                           -NumberOfImportFileIDs=1
22 ##                                                            ^-------                   -OffsetToImportFileIDs=0xA4
23 ##                                                                    ^-------           -LengthOfStringTable=0
24 ##                                                                            ^-------   -OffsetToStringTable=0
25 ##                                                                                    ^---------------         SymbolName=myintvar
26 ##                                                                                                    ^------- Value=0x20000280
27 ##                                                                                                            ^---  sectionNumber = 2
28 ##                                                                                                                ^- SymbolType=0x11
29 ##                                                                                                                  ^- StorageClass=0x05
30 ##                                                                                                                    ^-------   ImportFileID=0
31 ##                                                                                                                            ^-------ParameterCheckType=0
32 ##                                                                                                                                    ^-------    Virtual Address = 0x20000294
33 ##                                                                                                                                            ^------- SymbolIndex = 1
34 ##                                                                                                                                                    ^--- Type =0x1f00
35 ##                                                                                                                                                        ^--- Section Num =2
36 ##                                                                                                                                                            ^-------    Virtual Address = 0x20000294
37 ##                                                                                                                                                                    ^------- SymbolIndex = 3
38 ##                                                                                                                                                                            ^--- Type =0x1f00
39 ##                                                                                                                                                                                ^--- Section Num =2
41 --- !XCOFF
42 FileHeader:
43   MagicNumber:       0x1F7
44 Sections:
45   - Name:            .loader
46     Flags:           [ STYP_LOADER ]
47     SectionData:     "0000000200000001000000020000016D000000010000001200000000000000D000000000000000700000000000000038000000000000005000000001100003000000000200021105000000000000000000000000200002941f00000200000001000000002000029C1f0000020000000300096d79696e747661720000"
48 ##                    ^-------                                                           -Version=2
49 ##                            ^-------                                                   -NumberOfSymbolEntries=1
50 ##                                    ^-------                                           -NumberOfRelocationEntries=2
51 ##                                            ^-------                                   -LengthOfImportFileIDStringTable=365
52 ##                                                    ^-------                           -NumberOfImportFileIDs=1
53 ##                                                            ^-------                   --LengthOfStringTable=0x12
54 ##                                                                    ^---------------   -OffsetToImportFileIDs=0xD0
55 ##                                                                                    ^---------------   -OffsetToStringTable=0x70
56 ##                                                                                                    ^---------------  -OffsetToSymbolTable=0x38
57 ##                                                                                                                    ^---------------   -OffsetToRelocationEntries=0x50
58 ##                                                                                                                                    ^---------------         Value=0x0000000110000300
59 ##                                                                                                                                                    ^------- OffsetToStringTbl=2
60 ##                                                                                                                                                            ^---  sectionNumber = 2
61 ##                                                                                                                                                                ^- SymbolType=0x11
62 ##                                                                                                                                                                  ^- StorageClass=0x05
63 ##                                                                                                                                                                    ^-------   ImportFileID=0
64 ##                                                                                                                                                                            ^-------ParameterCheckType=0
65 ##                                                                                                                                                                                    ^--------------- VirtualAddress= 0x20000294
66 ##                                                                                                                                                                                                    ^--- Type= 1f00
67 ##                                                                                                                                                                                                        ^---SectionNumber = 2
68 ##                                                                                                                                                                                                            ^------- SymbolIndex =1
69 ##                                                                                                                                                                                                                    ^--------------- VirtualAddress= 0x2000029C
70 ##                                                                                                                                                                                                                                    ^--- Type= 1f00
71 ##                                                                                                                                                                                                                                        ^---SectionNumber = 2
72 ##                                                                                                                                                                                                                                            ^------- SymbolIndex =3
73 ##                                                                                                                                                                                                                                                    ^-------------------StringTable
75 # COMMON:      Loader Section {
76 # COMMON-NEXT:     Loader Section Relocations {
77 # NOEXPAND64-NEXT:           Vaddr            Type        SecNum  SymbolName (Index)
78 # NOEXPAND64-NEXT:     0x0000000020000294 0x1f00 (R_POS)       2    .data (1)
79 # NOEXPAND64-NEXT:     0x000000002000029c 0x1f00 (R_POS)       2    myintvar (3)
80 # NOEXPAND32-NEXT:        Vaddr        Type        SecNum  SymbolName (Index)
81 # NOEXPAND32-NEXT:      0x20000294 0x1f00 (R_POS)       2    .data (1)
82 # NOEXPAND32-NEXT:      0x2000029c 0x1f00 (R_POS)       2    myintvar (3)
83 # EXPAND-NEXT:       Relocation {
84 # EXPAND-NEXT:         Virtual Address: 0x20000294
85 # EXPAND-NEXT:         Symbol: .data (1)
86 # EXPAND-NEXT:         IsSigned: No
87 # EXPAND-NEXT:         FixupBitValue: 0
88 # EXPAND-NEXT:         Length: 32
89 # EXPAND-NEXT:         Type: R_POS (0x0)
90 # EXPAND-NEXT:         SectionNumber: 2
91 # EXPAND-NEXT:       }
92 # EXPAND-NEXT:       Relocation {
93 # EXPAND-NEXT:         Virtual Address: 0x2000029C
94 # EXPAND-NEXT:         Symbol: myintvar (3)
95 # EXPAND-NEXT:         IsSigned: No
96 # EXPAND-NEXT:         FixupBitValue: 0
97 # EXPAND-NEXT:         Length: 32
98 # EXPAND-NEXT:         Type: R_POS (0x0)
99 # EXPAND-NEXT:         SectionNumber: 2
100 # EXPAND-NEXT:       }
101 # EXPAND-NEXT:     }
102 # EXPAND-NEXT: }