1 ## This test checks that yaml2obj correctly handles COFF sections with
2 ## extended relocation tables (IMAGE_SCN_LNK_NRELOC_OVFL).
3 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-readobj --sections --relocations %t | FileCheck %s --check-prefix=CHECK-OBJ
5 # RUN: obj2yaml %t | FileCheck %s --check-prefix=CHECK-YAML
7 # CHECK-OBJ: Sections [
8 # CHECK-OBJ-NEXT: Section {
9 # CHECK-OBJ-NEXT: Number: 1
10 # CHECK-OBJ-NEXT: Name: .data
11 # CHECK-OBJ: RawDataSize: 16
12 # CHECK-OBJ: RelocationCount: 65535
13 # CHECK-OBJ: Characteristics [
14 # CHECK-OBJ-NEXT: IMAGE_SCN_ALIGN_16BYTES
15 # CHECK-OBJ-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
16 # CHECK-OBJ-NEXT: IMAGE_SCN_LNK_NRELOC_OVFL
17 # CHECK-OBJ-NEXT: IMAGE_SCN_MEM_READ
21 # CHECK-OBJ-NEXT: Relocations [
22 # CHECK-OBJ-NEXT: Section (1) .data {
23 # CHECK-OBJ-NEXT: 0x0 IMAGE_REL_AMD64_ADDR64 foo (0)
24 # CHECK-OBJ-NEXT: 0x8 IMAGE_REL_AMD64_ADDR64 bar (1)
28 # CHECK-YAML: sections:
29 # CHECK-YAML-NEXT: - Name: .data
30 # CHECK-YAML-NEXT: Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_NRELOC_OVFL, IMAGE_SCN_MEM_READ ]
31 # CHECK-YAML-NEXT: Alignment: 16
32 # CHECK-YAML-NEXT: SectionData: '00000000000000000000000000000000'
33 # CHECK-YAML-NEXT: SizeOfRawData: 16
34 # CHECK-YAML-NEXT: Relocations:
35 # CHECK-YAML-NEXT: - VirtualAddress: 0
36 # CHECK-YAML-NEXT: SymbolName: foo
37 # CHECK-YAML-NEXT: Type: IMAGE_REL_AMD64_ADDR64
38 # CHECK-YAML-NEXT: - VirtualAddress: 8
39 # CHECK-YAML-NEXT: SymbolName: bar
40 # CHECK-YAML-NEXT: Type: IMAGE_REL_AMD64_ADDR64
41 # CHECK-YAML-NEXT: symbols:
45 Machine: IMAGE_FILE_MACHINE_AMD64
49 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_NRELOC_OVFL, IMAGE_SCN_MEM_READ ]
51 SectionData: '00000000000000000000000000000000'
55 Type: IMAGE_REL_AMD64_ADDR64
58 Type: IMAGE_REL_AMD64_ADDR64
63 SimpleType: IMAGE_SYM_TYPE_NULL
64 ComplexType: IMAGE_SYM_DTYPE_NULL
65 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
69 SimpleType: IMAGE_SYM_TYPE_NULL
70 ComplexType: IMAGE_SYM_DTYPE_NULL
71 StorageClass: IMAGE_SYM_CLASS_EXTERNAL