1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj
3 # RUN: llvm-readobj --sections %t.dll | FileCheck %s
4 # RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /section:.foo,rwe
5 # RUN: llvm-readobj --sections %t.dll | FileCheck --check-prefix=SECTION %s
6 # RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /merge:.foo=.bar
7 # RUN: llvm-readobj --sections --section-data %t.dll | FileCheck --check-prefix=MERGE %s
8 # RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /merge:.foo=.bar /section:.foo,rwe
9 # RUN: llvm-readobj --sections %t.dll | FileCheck --check-prefix=MERGE-SECTION %s
12 # CHECK: Characteristics [
13 # CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
14 # CHECK-NEXT: IMAGE_SCN_MEM_READ
18 # CHECK: Characteristics [
19 # CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
20 # CHECK-NEXT: IMAGE_SCN_MEM_READ
21 # CHECK-NEXT: IMAGE_SCN_MEM_WRITE
25 # SECTION: Characteristics [
26 # SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
27 # SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
28 # SECTION-NEXT: IMAGE_SCN_MEM_READ
29 # SECTION-NEXT: IMAGE_SCN_MEM_WRITE
33 # SECTION: Characteristics [
34 # SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
35 # SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
36 # SECTION-NEXT: IMAGE_SCN_MEM_READ
37 # SECTION-NEXT: IMAGE_SCN_MEM_WRITE
41 # MERGE: Characteristics [
42 # MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
43 # MERGE-NEXT: IMAGE_SCN_MEM_READ
45 # MERGE-NEXT: SectionData (
46 # MERGE-NEXT: 0000: 0301
49 # MERGE: Characteristics [
50 # MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
51 # MERGE-NEXT: IMAGE_SCN_MEM_READ
52 # MERGE-NEXT: IMAGE_SCN_MEM_WRITE
54 # MERGE-NEXT: SectionData (
55 # MERGE-NEXT: 0000: 04
58 # MERGE: Characteristics [
59 # MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
60 # MERGE-NEXT: IMAGE_SCN_MEM_READ
61 # MERGE-NEXT: IMAGE_SCN_MEM_WRITE
63 # MERGE-NEXT: SectionData (
64 # MERGE-NEXT: 0000: 02
66 # MERGE-SECTION: Name: .bar
67 # MERGE-SECTION: Characteristics [
68 # MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
69 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
70 # MERGE-SECTION-NEXT: ]
72 # MERGE-SECTION: Name: .bar
73 # MERGE-SECTION: Characteristics [
74 # MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
75 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
76 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_WRITE
77 # MERGE-SECTION-NEXT: ]
79 # MERGE-SECTION: Name: .foo
80 # MERGE-SECTION: Characteristics [
81 # MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
82 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
83 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
84 # MERGE-SECTION-NEXT: IMAGE_SCN_MEM_WRITE
85 # MERGE-SECTION-NEXT: ]
89 Machine: IMAGE_FILE_MACHINE_AMD64
93 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
97 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
101 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
105 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]