1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
# RUN: yaml2obj %s -o %t.obj
# RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj
# RUN: llvm-readobj --sections %t.dll | FileCheck %s
# RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /section:.foo,rwe
# RUN: llvm-readobj --sections %t.dll | FileCheck --check-prefix=SECTION %s
# RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /merge:.foo=.bar
# RUN: llvm-readobj --sections --section-data %t.dll | FileCheck --check-prefix=MERGE %s
# RUN: lld-link /out:%t.dll /entry:__ImageBase /dll %t.obj /merge:.foo=.bar /section:.foo,rwe
# RUN: llvm-readobj --sections %t.dll | FileCheck --check-prefix=MERGE-SECTION %s
# CHECK: Name: .foo
# CHECK: Characteristics [
# CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# CHECK-NEXT: IMAGE_SCN_MEM_READ
# CHECK-NEXT: ]
# CHECK: Name: .foo
# CHECK: Characteristics [
# CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# CHECK-NEXT: IMAGE_SCN_MEM_READ
# CHECK-NEXT: IMAGE_SCN_MEM_WRITE
# CHECK-NEXT: ]
# SECTION: Name: .foo
# SECTION: Characteristics [
# SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
# SECTION-NEXT: IMAGE_SCN_MEM_READ
# SECTION-NEXT: IMAGE_SCN_MEM_WRITE
# SECTION-NEXT: ]
# SECTION: Name: .foo
# SECTION: Characteristics [
# SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
# SECTION-NEXT: IMAGE_SCN_MEM_READ
# SECTION-NEXT: IMAGE_SCN_MEM_WRITE
# SECTION-NEXT: ]
# MERGE: Name: .bar
# MERGE: Characteristics [
# MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-NEXT: IMAGE_SCN_MEM_READ
# MERGE-NEXT: ]
# MERGE-NEXT: SectionData (
# MERGE-NEXT: 0000: 0301
# MERGE: Name: .bar
# MERGE: Characteristics [
# MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-NEXT: IMAGE_SCN_MEM_READ
# MERGE-NEXT: IMAGE_SCN_MEM_WRITE
# MERGE-NEXT: ]
# MERGE-NEXT: SectionData (
# MERGE-NEXT: 0000: 04
# MERGE: Name: .foo
# MERGE: Characteristics [
# MERGE-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-NEXT: IMAGE_SCN_MEM_READ
# MERGE-NEXT: IMAGE_SCN_MEM_WRITE
# MERGE-NEXT: ]
# MERGE-NEXT: SectionData (
# MERGE-NEXT: 0000: 02
# MERGE-SECTION: Name: .bar
# MERGE-SECTION: Characteristics [
# MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
# MERGE-SECTION-NEXT: ]
# MERGE-SECTION: Name: .bar
# MERGE-SECTION: Characteristics [
# MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_WRITE
# MERGE-SECTION-NEXT: ]
# MERGE-SECTION: Name: .foo
# MERGE-SECTION: Characteristics [
# MERGE-SECTION-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_EXECUTE
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_READ
# MERGE-SECTION-NEXT: IMAGE_SCN_MEM_WRITE
# MERGE-SECTION-NEXT: ]
--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Characteristics: [ ]
sections:
- Name: .foo
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
Alignment: 1
SectionData: 01
- Name: .foo
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 1
SectionData: 02
- Name: .bar
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
Alignment: 1
SectionData: 03
- Name: .bar
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 1
SectionData: 04
symbols:
...
|