1# RUN: yaml2obj < %s > %t.obj
2# RUN: not lld-link /out:%t.exe /entry:func1 /subsystem:console %t.obj 2>&1 | FileCheck %s
3
4# This file is like pdata-arm64.yaml, except that .pdata has been extended with
5# 4 bytes. This can happen due to for example bad assembler input. Check that
6# lld errors gracefully instead of crashing.
7
8# CHECK: unexpected .pdata size: 20 is not a multiple of 8
9
10--- !COFF
11header:
12  Machine:         IMAGE_FILE_MACHINE_ARM64
13  Characteristics: [  ]
14sections:
15  - Name:            .text
16    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
17    Alignment:       4
18    SectionData:     ff4300d1f37b00a9f303012a00000094e003132a00000094f37b40a9ff430091c0035fd6f353bea9fe0b00f9f303012af403022a00000094e003132a00000094e003142a00000094fe0b40f9f353c2a8c0035fd6c0035fd6
19    Relocations:
20      - VirtualAddress:  12
21        SymbolName:      func3
22        Type:            IMAGE_REL_ARM64_BRANCH26
23      - VirtualAddress:  20
24        SymbolName:      func3
25        Type:            IMAGE_REL_ARM64_BRANCH26
26      - VirtualAddress:  52
27        SymbolName:      func3
28        Type:            IMAGE_REL_ARM64_BRANCH26
29      - VirtualAddress:  60
30        SymbolName:      func3
31        Type:            IMAGE_REL_ARM64_BRANCH26
32      - VirtualAddress:  68
33        SymbolName:      func3
34        Type:            IMAGE_REL_ARM64_BRANCH26
35  - Name:            .pdata
36    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
37    Alignment:       4
38    SectionData:     0000000031002201000000002500a10000000000
39    Relocations:
40      - VirtualAddress:  0
41        SymbolName:      func2
42        Type:            IMAGE_REL_ARM64_ADDR32NB
43      - VirtualAddress:  8
44        SymbolName:      func1
45        Type:            IMAGE_REL_ARM64_ADDR32NB
46symbols:
47  - Name:            .text
48    Value:           0
49    SectionNumber:   1
50    SimpleType:      IMAGE_SYM_TYPE_NULL
51    ComplexType:     IMAGE_SYM_DTYPE_NULL
52    StorageClass:    IMAGE_SYM_CLASS_STATIC
53    SectionDefinition:
54      Length:          57
55      NumberOfRelocations: 0
56      NumberOfLinenumbers: 0
57      CheckSum:        0
58      Number:          1
59  - Name:            .pdata
60    Value:           0
61    SectionNumber:   2
62    SimpleType:      IMAGE_SYM_TYPE_NULL
63    ComplexType:     IMAGE_SYM_DTYPE_NULL
64    StorageClass:    IMAGE_SYM_CLASS_STATIC
65    SectionDefinition:
66      Length:          20
67      NumberOfRelocations: 2
68      NumberOfLinenumbers: 0
69      CheckSum:        0
70      Number:          2
71  - Name:            func1
72    Value:           0
73    SectionNumber:   1
74    SimpleType:      IMAGE_SYM_TYPE_NULL
75    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
76    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
77  - Name:            func2
78    Value:           36
79    SectionNumber:   1
80    SimpleType:      IMAGE_SYM_TYPE_NULL
81    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
82    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
83  - Name:            func3
84    Value:           84
85    SectionNumber:   1
86    SimpleType:      IMAGE_SYM_TYPE_NULL
87    ComplexType:     IMAGE_SYM_DTYPE_NULL
88    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
89...
90