1 ## Test that llvm-readobj/llvm-readelf shows proper relocation type
2 ## names and values for i386 target.
4 # RUN: yaml2obj %s -o %t-i386.o
5 # RUN: llvm-readobj -r --expand-relocs %t-i386.o | FileCheck %s --check-prefix=LLVM
6 # RUN: llvm-readelf -r --expand-relocs %t-i386.o | FileCheck %s --check-prefix=GNU
8 # LLVM: Type: R_386_NONE (0)
9 # LLVM: Type: R_386_32 (1)
10 # LLVM: Type: R_386_PC32 (2)
11 # LLVM: Type: R_386_GOT32 (3)
12 # LLVM: Type: R_386_PLT32 (4)
13 # LLVM: Type: R_386_COPY (5)
14 # LLVM: Type: R_386_GLOB_DAT (6)
15 # LLVM: Type: R_386_JUMP_SLOT (7)
16 # LLVM: Type: R_386_RELATIVE (8)
17 # LLVM: Type: R_386_GOTOFF (9)
18 # LLVM: Type: R_386_GOTPC (10)
19 # LLVM: Type: R_386_32PLT (11)
20 # LLVM: Type: R_386_TLS_TPOFF (14)
21 # LLVM: Type: R_386_TLS_IE (15)
22 # LLVM: Type: R_386_TLS_GOTIE (16)
23 # LLVM: Type: R_386_TLS_LE (17)
24 # LLVM: Type: R_386_TLS_GD (18)
25 # LLVM: Type: R_386_TLS_LDM (19)
26 # LLVM: Type: R_386_16 (20)
27 # LLVM: Type: R_386_PC16 (21)
28 # LLVM: Type: R_386_8 (22)
29 # LLVM: Type: R_386_PC8 (23)
30 # LLVM: Type: R_386_TLS_GD_32 (24)
31 # LLVM: Type: R_386_TLS_GD_PUSH (25)
32 # LLVM: Type: R_386_TLS_GD_CALL (26)
33 # LLVM: Type: R_386_TLS_GD_POP (27)
34 # LLVM: Type: R_386_TLS_LDM_32 (28)
35 # LLVM: Type: R_386_TLS_LDM_PUSH (29)
36 # LLVM: Type: R_386_TLS_LDM_CALL (30)
37 # LLVM: Type: R_386_TLS_LDM_POP (31)
38 # LLVM: Type: R_386_TLS_LDO_32 (32)
39 # LLVM: Type: R_386_TLS_IE_32 (33)
40 # LLVM: Type: R_386_TLS_LE_32 (34)
41 # LLVM: Type: R_386_TLS_DTPMOD32 (35)
42 # LLVM: Type: R_386_TLS_DTPOFF32 (36)
43 # LLVM: Type: R_386_TLS_TPOFF32 (37)
44 # LLVM: Type: R_386_TLS_GOTDESC (39)
45 # LLVM: Type: R_386_TLS_DESC_CALL (40)
46 # LLVM: Type: R_386_TLS_DESC (41)
47 # LLVM: Type: R_386_IRELATIVE (42)
48 # LLVM: Type: R_386_GOT32X (43)
50 # GNU: Relocation section '.rel.text' at offset 0x38 contains 41 entries:
51 # GNU-NEXT: Offset Info Type Sym. Value Symbol's Name
52 # GNU-NEXT: 00000002 00000100 R_386_NONE 00000000 foo
53 # GNU-NEXT: 00000008 00000101 R_386_32 00000000 foo
54 # GNU-NEXT: 0000000e 00000102 R_386_PC32 00000000 foo
55 # GNU-NEXT: 00000014 00000103 R_386_GOT32 00000000 foo
56 # GNU-NEXT: 0000001a 00000104 R_386_PLT32 00000000 foo
57 # GNU-NEXT: 00000020 00000105 R_386_COPY 00000000 foo
58 # GNU-NEXT: 00000026 00000106 R_386_GLOB_DAT 00000000 foo
59 # GNU-NEXT: 0000002c 00000107 R_386_JUMP_SLOT 00000000 foo
60 # GNU-NEXT: 00000032 00000108 R_386_RELATIVE 00000000 foo
61 # GNU-NEXT: 00000038 00000109 R_386_GOTOFF 00000000 foo
62 # GNU-NEXT: 0000003e 0000010a R_386_GOTPC 00000000 foo
63 # GNU-NEXT: 00000044 0000010b R_386_32PLT 00000000 foo
64 # GNU-NEXT: 0000004a 0000010e R_386_TLS_TPOFF 00000000 foo
65 # GNU-NEXT: 00000050 0000010f R_386_TLS_IE 00000000 foo
66 # GNU-NEXT: 00000056 00000110 R_386_TLS_GOTIE 00000000 foo
67 # GNU-NEXT: 0000005c 00000111 R_386_TLS_LE 00000000 foo
68 # GNU-NEXT: 00000062 00000112 R_386_TLS_GD 00000000 foo
69 # GNU-NEXT: 00000068 00000113 R_386_TLS_LDM 00000000 foo
70 # GNU-NEXT: 0000006e 00000114 R_386_16 00000000 foo
71 # GNU-NEXT: 00000074 00000115 R_386_PC16 00000000 foo
72 # GNU-NEXT: 0000007a 00000116 R_386_8 00000000 foo
73 # GNU-NEXT: 00000080 00000117 R_386_PC8 00000000 foo
74 # GNU-NEXT: 00000086 00000118 R_386_TLS_GD_32 00000000 foo
75 # GNU-NEXT: 0000008c 00000119 R_386_TLS_GD_PUSH 00000000 foo
76 # GNU-NEXT: 00000092 0000011a R_386_TLS_GD_CALL 00000000 foo
77 # GNU-NEXT: 00000098 0000011b R_386_TLS_GD_POP 00000000 foo
78 # GNU-NEXT: 0000009e 0000011c R_386_TLS_LDM_32 00000000 foo
79 # GNU-NEXT: 000000a4 0000011d R_386_TLS_LDM_PUSH 00000000 foo
80 # GNU-NEXT: 000000aa 0000011e R_386_TLS_LDM_CALL 00000000 foo
81 # GNU-NEXT: 000000b0 0000011f R_386_TLS_LDM_POP 00000000 foo
82 # GNU-NEXT: 000000b6 00000120 R_386_TLS_LDO_32 00000000 foo
83 # GNU-NEXT: 000000bc 00000121 R_386_TLS_IE_32 00000000 foo
84 # GNU-NEXT: 000000c2 00000122 R_386_TLS_LE_32 00000000 foo
85 # GNU-NEXT: 000000c8 00000123 R_386_TLS_DTPMOD32 00000000 foo
86 # GNU-NEXT: 000000ce 00000124 R_386_TLS_DTPOFF32 00000000 foo
87 # GNU-NEXT: 000000d4 00000125 R_386_TLS_TPOFF32 00000000 foo
88 # GNU-NEXT: 000000da 00000127 R_386_TLS_GOTDESC 00000000 foo
89 # GNU-NEXT: 000000e0 00000128 R_386_TLS_DESC_CALL 00000000 foo
90 # GNU-NEXT: 000000e6 00000129 R_386_TLS_DESC 00000000 foo
91 # GNU-NEXT: 000000ec 0000012a R_386_IRELATIVE 00000000 foo
92 # GNU-NEXT: 000000f2 0000012b R_386_GOT32X 00000000 foo
108 AddressAlign: 0x0000000000000004
109 EntSize: 0x0000000000000008
112 - Offset: 0x0000000000000002
115 - Offset: 0x0000000000000008
118 - Offset: 0x000000000000000E
121 - Offset: 0x0000000000000014
124 - Offset: 0x000000000000001A
127 - Offset: 0x0000000000000020
130 - Offset: 0x0000000000000026
133 - Offset: 0x000000000000002C
134 Type: R_386_JUMP_SLOT
136 - Offset: 0x0000000000000032
139 - Offset: 0x0000000000000038
142 - Offset: 0x000000000000003E
145 - Offset: 0x0000000000000044
148 - Offset: 0x000000000000004A
149 Type: R_386_TLS_TPOFF
151 - Offset: 0x0000000000000050
154 - Offset: 0x0000000000000056
155 Type: R_386_TLS_GOTIE
157 - Offset: 0x000000000000005C
160 - Offset: 0x0000000000000062
163 - Offset: 0x0000000000000068
166 - Offset: 0x000000000000006E
169 - Offset: 0x0000000000000074
172 - Offset: 0x000000000000007A
175 - Offset: 0x0000000000000080
178 - Offset: 0x0000000000000086
179 Type: R_386_TLS_GD_32
181 - Offset: 0x000000000000008C
182 Type: R_386_TLS_GD_PUSH
184 - Offset: 0x0000000000000092
185 Type: R_386_TLS_GD_CALL
187 - Offset: 0x0000000000000098
188 Type: R_386_TLS_GD_POP
190 - Offset: 0x000000000000009E
191 Type: R_386_TLS_LDM_32
193 - Offset: 0x00000000000000A4
194 Type: R_386_TLS_LDM_PUSH
196 - Offset: 0x00000000000000AA
197 Type: R_386_TLS_LDM_CALL
199 - Offset: 0x00000000000000B0
200 Type: R_386_TLS_LDM_POP
202 - Offset: 0x00000000000000B6
203 Type: R_386_TLS_LDO_32
205 - Offset: 0x00000000000000BC
206 Type: R_386_TLS_IE_32
208 - Offset: 0x00000000000000C2
209 Type: R_386_TLS_LE_32
211 - Offset: 0x00000000000000C8
212 Type: R_386_TLS_DTPMOD32
214 - Offset: 0x00000000000000CE
215 Type: R_386_TLS_DTPOFF32
217 - Offset: 0x00000000000000D4
218 Type: R_386_TLS_TPOFF32
220 - Offset: 0x00000000000000DA
221 Type: R_386_TLS_GOTDESC
223 - Offset: 0x00000000000000E0
224 Type: R_386_TLS_DESC_CALL
226 - Offset: 0x00000000000000E6
229 - Offset: 0x00000000000000EC
230 Type: R_386_IRELATIVE
232 - Offset: 0x00000000000000F2