1 # RUN: llvm-readobj --file-header %p/Inputs/xcoff-basic.o | \
2 # RUN: FileCheck --check-prefix=FILEHEADER %s
4 # RUN: llvm-readobj --file-header %p/Inputs/xcoff-basic-64.o | \
5 # RUN: FileCheck --check-prefix=FILEHEADER64 %s
7 # RUN: llvm-readobj --file-header %p/Inputs/xcoff-basic-neg-time.o | \
8 # RUN: FileCheck --check-prefix=NEGTIME %s
10 # RUN: llvm-readobj --file-header %p/Inputs/xcoff-basic-neg-sym-count.o | \
11 # RUN: FileCheck --check-prefix=NEGSYMCOUNT %s
13 # RUN: llvm-readobj --relocs --expand-relocs %p/Inputs/xcoff-basic.o | \
14 # RUN: FileCheck --check-prefix=RELOCSEXP %s
16 # FILEHEADER: File: {{.*}}xcoff-basic.o
17 # FILEHEADER-NEXT: Format: aixcoff-rs6000
18 # FILEHEADER-NEXT: Arch: powerpc
19 # FILEHEADER-NEXT: AddressSize: 32bit
20 # FILEHEADER-NEXT: FileHeader {
21 # FILEHEADER-NEXT: Magic: 0x1DF
22 # FILEHEADER-NEXT: NumberOfSections: 6
23 # FILEHEADER-NEXT: TimeStamp: 2019-03-12T14:04:43Z (0x5C87BC7B)
24 # FILEHEADER-NEXT: SymbolTableOffset: 0x52E
25 # FILEHEADER-NEXT: SymbolTableEntries: 120
26 # FILEHEADER-NEXT: OptionalHeaderSize: 0x1C
27 # FILEHEADER-NEXT: Flags: 0x0
30 # FILEHEADER64: File: {{.*}}xcoff-basic-64.o
31 # FILEHEADER64-NEXT: Format: aix5coff64-rs6000
32 # FILEHEADER64-NEXT: Arch: powerpc64
33 # FILEHEADER64-NEXT: AddressSize: 64bit
34 # FILEHEADER64-NEXT: FileHeader {
35 # FILEHEADER64-NEXT: Magic: 0x1F7
36 # FILEHEADER64-NEXT: NumberOfSections: 5
37 # FILEHEADER64-NEXT: TimeStamp: 2019-03-18T20:03:47Z (0x5C8FF9A3)
38 # FILEHEADER64-NEXT: SymbolTableOffset: 0x54C
39 # FILEHEADER64-NEXT: SymbolTableEntries: 58
40 # FILEHEADER64-NEXT: OptionalHeaderSize: 0x0
41 # FILEHEADER64-NEXT: Flags: 0x0
42 # FILEHEADER64-NEXT: }
44 # NEGTIME: File: {{.*}}xcoff-basic-neg-time.o
45 # NEGTIME-NEXT: Format: aixcoff-rs6000
46 # NEGTIME-NEXT: Arch: powerpc
47 # NEGTIME-NEXT: AddressSize: 32bit
48 # NEGTIME-NEXT: FileHeader {
49 # NEGTIME-NEXT: Magic: 0x1DF
50 # NEGTIME-NEXT: NumberOfSections: 6
51 # NEGTIME-NEXT: TimeStamp: Reserved Value (0xDC87BC7B)
52 # NEGTIME-NEXT: SymbolTableOffset: 0x52E
53 # NEGTIME-NEXT: SymbolTableEntries: 120
54 # NEGTIME-NEXT: OptionalHeaderSize: 0x1C
55 # NEGTIME-NEXT: Flags: 0x0
58 # NEGSYMCOUNT: File: {{.*}}xcoff-basic-neg-sym-count.o
59 # NEGSYMCOUNT-NEXT: Format: aixcoff-rs6000
60 # NEGSYMCOUNT-NEXT: Arch: powerpc
61 # NEGSYMCOUNT-NEXT: AddressSize: 32bit
62 # NEGSYMCOUNT-NEXT: FileHeader {
63 # NEGSYMCOUNT-NEXT: Magic: 0x1DF
64 # NEGSYMCOUNT-NEXT: NumberOfSections: 5
65 # NEGSYMCOUNT-NEXT: TimeStamp: 2019-03-12T14:04:43Z (0x5C87BC7B)
66 # NEGSYMCOUNT-NEXT: SymbolTableOffset: 0x0
67 # NEGSYMCOUNT-NEXT: SymbolTableEntries: Reserved Value (0x80000000)
68 # NEGSYMCOUNT-NEXT: OptionalHeaderSize: 0x1C
69 # NEGSYMCOUNT-NEXT: Flags: 0xD
72 # xcoff-basic.o was compiled with `xlc -qtls -O3 -g -c xcoff-basic.c`
73 # from the following source:
76 # __thread int j = 55;
78 # int A() { return a; }
79 # int B() { return b; }
80 # int J() { return j; }
81 # double D() { return d; }
83 # xcoff-basic-neg-time.o was manually edited to include a negative time stamp.
84 # xcoff-basic-neg-sym-count.o was stripped using the 'strip' utility, and
85 # manually edited to have a negative symbol table entry count.
87 # RELOCSEXP: File: {{.*}}xcoff-basic.o
88 # RELOCSEXP-NEXT: Format: aixcoff-rs6000
89 # RELOCSEXP-NEXT: Arch: powerpc
90 # RELOCSEXP-NEXT: AddressSize: 32bit
91 # RELOCSEXP-NEXT: Relocations [
92 # RELOCSEXP-NEXT: Section (index: 1) .text {
93 # RELOCSEXP-NEXT: Relocation {
94 # RELOCSEXP-NEXT: Virtual Address: 0x2
95 # RELOCSEXP-NEXT: Symbol: a (85)
96 # RELOCSEXP-NEXT: IsSigned: Yes
97 # RELOCSEXP-NEXT: FixupBitValue: 0
98 # RELOCSEXP-NEXT: Length: 16
99 # RELOCSEXP-NEXT: Type: R_TOC (0x3)
102 # RELOCSEXP: Virtual Address: 0x90
103 # RELOCSEXP-NEXT: Symbol: .__tls_get_addr (118)
104 # RELOCSEXP-NEXT: IsSigned: Yes
105 # RELOCSEXP-NEXT: FixupBitValue: 0
106 # RELOCSEXP-NEXT: Length: 26
107 # RELOCSEXP-NEXT: Type: R_RBA (0x18)
110 # RELOCSEXP-NEXT: Section (index: 2) .data {
111 # RELOCSEXP-NEXT: Relocation {
112 # RELOCSEXP-NEXT: Virtual Address: 0x100
113 # RELOCSEXP-NEXT: Symbol: A (78)
114 # RELOCSEXP-NEXT: IsSigned: No
115 # RELOCSEXP-NEXT: FixupBitValue: 0
116 # RELOCSEXP-NEXT: Length: 32
117 # RELOCSEXP-NEXT: Type: R_POS (0x0)
120 # RELOCSEXP: Virtual Address: 0x110
121 # RELOCSEXP-NEXT: Symbol: J (96)
122 # RELOCSEXP-NEXT: IsSigned: No
123 # RELOCSEXP-NEXT: FixupBitValue: 0
124 # RELOCSEXP-NEXT: Length: 32
125 # RELOCSEXP-NEXT: Type: R_POS (0x0)
128 # RELOCSEXP: Virtual Address: 0x114
129 # RELOCSEXP-NEXT: Symbol: j (100)
130 # RELOCSEXP-NEXT: IsSigned: No
131 # RELOCSEXP-NEXT: FixupBitValue: 0
132 # RELOCSEXP-NEXT: Length: 32
133 # RELOCSEXP-NEXT: Type: R_TLS (0x20)
136 # RELOCSEXP: Virtual Address: 0x124
137 # RELOCSEXP-NEXT: Symbol: d (111)
138 # RELOCSEXP-NEXT: IsSigned: No
139 # RELOCSEXP-NEXT: FixupBitValue: 0
140 # RELOCSEXP-NEXT: Length: 32
141 # RELOCSEXP-NEXT: Type: R_TLSM (0x24)
144 # RELOCSEXP: Virtual Address: 0x128
145 # RELOCSEXP-NEXT: Symbol: (76)
146 # RELOCSEXP-NEXT: IsSigned: No
147 # RELOCSEXP-NEXT: FixupBitValue: 0
148 # RELOCSEXP-NEXT: Length: 32
149 # RELOCSEXP-NEXT: Type: R_POS (0x0)
152 # RELOCSEXP: Virtual Address: 0x154
153 # RELOCSEXP-NEXT: Symbol: TOC (72)
154 # RELOCSEXP-NEXT: IsSigned: No
155 # RELOCSEXP-NEXT: FixupBitValue: 0
156 # RELOCSEXP-NEXT: Length: 32
157 # RELOCSEXP-NEXT: Type: R_POS (0x0)