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: Relocations:
34 # CHECK-YAML-NEXT: - VirtualAddress: 0
35 # CHECK-YAML-NEXT: SymbolName: foo
36 # CHECK-YAML-NEXT: Type: IMAGE_REL_AMD64_ADDR64
37 # CHECK-YAML-NEXT: - VirtualAddress: 8
38 # CHECK-YAML-NEXT: SymbolName: bar
39 # CHECK-YAML-NEXT: Type: IMAGE_REL_AMD64_ADDR64
40 # CHECK-YAML-NEXT: symbols:
44 Machine: IMAGE_FILE_MACHINE_AMD64
48 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_NRELOC_OVFL, IMAGE_SCN_MEM_READ ]
50 SectionData: '00000000000000000000000000000000'
54 Type: IMAGE_REL_AMD64_ADDR64
57 Type: IMAGE_REL_AMD64_ADDR64
62 SimpleType: IMAGE_SYM_TYPE_NULL
63 ComplexType: IMAGE_SYM_DTYPE_NULL
64 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
68 SimpleType: IMAGE_SYM_TYPE_NULL
69 ComplexType: IMAGE_SYM_DTYPE_NULL
70 StorageClass: IMAGE_SYM_CLASS_EXTERNAL