Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / tools / llvm-readobj / reloc-types-coff-x64.test
blobb78cc037073b192968d5e8967e3c39a91f7f6fd4
1 ## Test that llvm-readobj/llvm-readelf shows proper relocation type
2 ## names and values for coff-x64 target.
4 # RUN: yaml2obj %s -o %t-coff-x86_64.o
5 # RUN: llvm-readobj -r --expand-relocs %t-coff-x86_64.o | FileCheck %s
7 # CHECK: Type: IMAGE_REL_AMD64_ABSOLUTE (0)
8 # CHECK: Type: IMAGE_REL_AMD64_ADDR64 (1)
9 # CHECK: Type: IMAGE_REL_AMD64_ADDR32 (2)
10 # CHECK: Type: IMAGE_REL_AMD64_ADDR32NB (3)
11 # CHECK: Type: IMAGE_REL_AMD64_REL32 (4)
12 # CHECK: Type: IMAGE_REL_AMD64_REL32_1 (5)
13 # CHECK: Type: IMAGE_REL_AMD64_REL32_2 (6)
14 # CHECK: Type: IMAGE_REL_AMD64_REL32_3 (7)
15 # CHECK: Type: IMAGE_REL_AMD64_REL32_4 (8)
16 # CHECK: Type: IMAGE_REL_AMD64_REL32_5 (9)
17 # CHECK: Type: IMAGE_REL_AMD64_SECTION (10)
18 # CHECK: Type: IMAGE_REL_AMD64_SECREL (11)
19 # CHECK: Type: IMAGE_REL_AMD64_SECREL7 (12)
20 # CHECK: Type: IMAGE_REL_AMD64_TOKEN (13)
21 # CHECK: Type: IMAGE_REL_AMD64_SREL32 (14)
22 # CHECK: Type: IMAGE_REL_AMD64_PAIR (15)
23 # CHECK: Type: IMAGE_REL_AMD64_SSPAN32 (16)
25 --- !COFF
26 header:
27   Machine:         IMAGE_FILE_MACHINE_AMD64
28   Characteristics: [  ]
29 sections:
30   - Name:            .text
31     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
32     Alignment:       4
33     SectionData:     00
34     Relocations:
35       - VirtualAddress: 4
36         Type:           IMAGE_REL_AMD64_ABSOLUTE
37       - VirtualAddress: 12
38         Type:           IMAGE_REL_AMD64_ADDR64
39       - VirtualAddress: 20
40         Type:           IMAGE_REL_AMD64_ADDR32
41       - VirtualAddress: 28
42         Type:           IMAGE_REL_AMD64_ADDR32NB
43       - VirtualAddress: 36
44         Type:           IMAGE_REL_AMD64_REL32
45       - VirtualAddress: 44
46         Type:           IMAGE_REL_AMD64_REL32_1
47       - VirtualAddress: 52
48         Type:           IMAGE_REL_AMD64_REL32_2
49       - VirtualAddress: 60
50         Type:           IMAGE_REL_AMD64_REL32_3
51       - VirtualAddress: 68
52         Type:           IMAGE_REL_AMD64_REL32_4
53       - VirtualAddress: 76
54         Type:           IMAGE_REL_AMD64_REL32_5
55       - VirtualAddress: 84
56         Type:           IMAGE_REL_AMD64_SECTION
57       - VirtualAddress: 92
58         Type:           IMAGE_REL_AMD64_SECREL
59       - VirtualAddress: 100
60         Type:           IMAGE_REL_AMD64_SECREL7
61       - VirtualAddress: 108
62         Type:           IMAGE_REL_AMD64_TOKEN
63       - VirtualAddress: 116
64         Type:           IMAGE_REL_AMD64_SREL32
65       - VirtualAddress: 124
66         Type:           IMAGE_REL_AMD64_PAIR
67       - VirtualAddress: 132
68         Type:           IMAGE_REL_AMD64_SSPAN32
69 symbols:
70   - Name:            .text
71     Value:           0
72     SectionNumber:   1
73     SimpleType:      IMAGE_SYM_TYPE_NULL
74     ComplexType:     IMAGE_SYM_DTYPE_NULL
75     StorageClass:    IMAGE_SYM_CLASS_STATIC
76     SectionDefinition: 
77       Length:          136
78       NumberOfRelocations: 17
79       NumberOfLinenumbers: 0
80       CheckSum:        0
81       Number:          1