2015-07-05 07:37:32 +08:00
|
|
|
# RUN: yaml2obj < %s > %t.obj
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
2015-07-28 11:24:23 +08:00
|
|
|
# RUN: /merge:.foo=.abc /merge:.bar=.def %t.obj /debug
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --sections %t.exe | FileCheck %s
|
2015-07-05 07:37:32 +08:00
|
|
|
|
2018-04-21 05:10:33 +08:00
|
|
|
# RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.foo=.bar /merge:.bar=.abc %t.obj /debug
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --sections %t.exe | FileCheck --check-prefix=CHECK2 %s
|
2018-04-21 05:10:33 +08:00
|
|
|
|
2018-04-07 08:46:55 +08:00
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.rsrc=.foo %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-RSRC %s
|
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.foo=.rsrc %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-RSRC %s
|
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.reloc=.foo %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-RELOC %s
|
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.foo=.reloc %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-RELOC %s
|
2018-04-21 05:10:33 +08:00
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.foo=.foo1 /merge:.foo1=.foo %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-CYCLE %s
|
|
|
|
# RUN: not lld-link /out:%t.exe /entry:main /subsystem:console /force \
|
|
|
|
# RUN: /merge:.foo=.foo1 /merge:.foo1=.foo2 /merge:.foo2=.foo1 %t.obj /debug 2>&1 | FileCheck --check-prefix=NO-CYCLE %s
|
2018-04-07 08:46:55 +08:00
|
|
|
|
2015-07-05 07:37:32 +08:00
|
|
|
# CHECK: Name: .def
|
|
|
|
# CHECK: Name: .abc
|
|
|
|
|
2018-04-21 05:10:33 +08:00
|
|
|
# CHECK2-NOT: Name: .bar
|
|
|
|
# CHECK2: Name: .abc
|
|
|
|
# CHECK2-NOT: Name: .bar
|
|
|
|
|
2018-04-07 08:46:55 +08:00
|
|
|
# NO-RSRC: /merge: cannot merge '.rsrc' with any section
|
|
|
|
# NO-RELOC: /merge: cannot merge '.reloc' with any section
|
|
|
|
|
2018-04-21 05:10:33 +08:00
|
|
|
# NO-CYCLE: /merge: cycle found for section '.foo'
|
|
|
|
|
2016-06-28 04:17:08 +08:00
|
|
|
--- !COFF
|
2015-07-05 07:37:32 +08:00
|
|
|
header:
|
|
|
|
Machine: IMAGE_FILE_MACHINE_AMD64
|
|
|
|
Characteristics: []
|
|
|
|
sections:
|
|
|
|
- Name: .foo
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: 000000000000
|
|
|
|
- Name: .bar
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: 000000000000
|
|
|
|
symbols:
|
|
|
|
- Name: .foo
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 6
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 0
|
|
|
|
- Name: .bar
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 2
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 6
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 0
|
|
|
|
- Name: main
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
...
|