[PECOFF] Use yaml2obj to avoid checking in binary files.
authorRui Ueyama <ruiu@google.com>
Fri, 5 Jul 2013 10:41:44 +0000 (10:41 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 5 Jul 2013 10:41:44 +0000 (10:41 +0000)
llvm-svn: 185690

19 files changed:
lld/test/pecoff/Inputs/grouped-sections.obj [deleted file]
lld/test/pecoff/Inputs/grouped-sections.obj.yaml [new file with mode: 0644]
lld/test/pecoff/Inputs/hello.obj [deleted file]
lld/test/pecoff/Inputs/hello.obj.yaml [new file with mode: 0644]
lld/test/pecoff/Inputs/main.obj [deleted file]
lld/test/pecoff/Inputs/main.obj.yaml [new file with mode: 0644]
lld/test/pecoff/Inputs/nop.obj [deleted file]
lld/test/pecoff/Inputs/nop.obj.yaml [new file with mode: 0644]
lld/test/pecoff/Inputs/static-data1.obj [deleted file]
lld/test/pecoff/Inputs/static-data1.obj.yaml [new file with mode: 0644]
lld/test/pecoff/Inputs/static-data2.obj [deleted file]
lld/test/pecoff/Inputs/static-data2.obj.yaml [new file with mode: 0644]
lld/test/pecoff/grouped-sections.test
lld/test/pecoff/hello.test
lld/test/pecoff/importlib.test
lld/test/pecoff/lib.test
lld/test/pecoff/multi.test
lld/test/pecoff/reloc.test
lld/test/pecoff/trivial.test

diff --git a/lld/test/pecoff/Inputs/grouped-sections.obj b/lld/test/pecoff/Inputs/grouped-sections.obj
deleted file mode 100644 (file)
index 42b58de..0000000
Binary files a/lld/test/pecoff/Inputs/grouped-sections.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/grouped-sections.obj.yaml b/lld/test/pecoff/Inputs/grouped-sections.obj.yaml
new file mode 100644 (file)
index 0000000..8509e85
--- /dev/null
@@ -0,0 +1,91 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     ""
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     48656C6C
+  - Name:            ".data$2"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       1
+    SectionData:     6F726C6400
+  - Name:            ".data$1"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       1
+    SectionData:     6F2C2077
+  - Name:            ".debug$S"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F1000000670000002C000111000000005A3A5C67726F7570656473656374696F6E735C73656374696F6E2D67726F7570732E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C6572000000
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       2147483648
+    SectionData:     2F454E5452593A6D61696E20
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   000000000000000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   040000000000000000000000000000000000
+  - Name:            ".data$2"
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   050000000000000000000000000000000000
+  - Name:            ".data$1"
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   040000000000000000000000000000000000
+  - Name:            ."debug$S"
+    Value:           0
+    SectionNumber:   5
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   740000000000000000000000000000000000
+  - Name:            _main
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   6
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   0C0000000000000000000000000000000000
+...
diff --git a/lld/test/pecoff/Inputs/hello.obj b/lld/test/pecoff/Inputs/hello.obj
deleted file mode 100644 (file)
index 23dbc0f..0000000
Binary files a/lld/test/pecoff/Inputs/hello.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/hello.obj.yaml b/lld/test/pecoff/Inputs/hello.obj.yaml
new file mode 100644 (file)
index 0000000..1b88611
--- /dev/null
@@ -0,0 +1,104 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     B800000000506800000000680000000050E80000000050E800000000
+    Relocations:
+      - VirtualAddress:  7
+        SymbolName:      caption
+        Type:            IMAGE_REL_I386_DIR32
+      - VirtualAddress:  12
+        SymbolName:      message
+        Type:            IMAGE_REL_I386_DIR32
+      - VirtualAddress:  18
+        SymbolName:      _MessageBoxA@16
+        Type:            IMAGE_REL_I386_REL32
+      - VirtualAddress:  24
+        SymbolName:      _ExitProcess@4
+        Type:            IMAGE_REL_I386_REL32
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     48656C6C6F0048656C6C6F20576F726C6400
+  - Name:            .debug$S
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F1000000650000002A00011100000000433A5C63796777696E5C686F6D655C727569755C72656C6F635C68656C6C6F2E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C65720000000000
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       2147483648
+    SectionData:     2F454E5452593A6D61696E20
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   1C0000000400000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   120000000000000000000000000000000000
+  - Name:            .debug$S
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   740000000000000000000000000000000000
+  - Name:            _MessageBoxA@16
+    Value:           0
+    SectionNumber:   0
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _ExitProcess@4
+    Value:           0
+    SectionNumber:   0
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            message
+    Value:           6
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            _main
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            caption
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   0C0000000000000000000000000000000000
+...
diff --git a/lld/test/pecoff/Inputs/main.obj b/lld/test/pecoff/Inputs/main.obj
deleted file mode 100644 (file)
index 9d0ec24..0000000
Binary files a/lld/test/pecoff/Inputs/main.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/main.obj.yaml b/lld/test/pecoff/Inputs/main.obj.yaml
new file mode 100644 (file)
index 0000000..bb572bb
--- /dev/null
@@ -0,0 +1,86 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     A100000000030500000000C3
+    Relocations:
+      - VirtualAddress:  1
+        SymbolName:      _val1
+        Type:            IMAGE_REL_I386_DIR32
+      - VirtualAddress:  7
+        SymbolName:      _val2
+        Type:            IMAGE_REL_I386_DIR32
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     ""
+  - Name:            ".debug$S"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F10000006E0000003300011100000000433A5C63796777696E5C686F6D655C727569755C7374617469635C7374617469632D696D706F72742E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C657200000000
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       2147483648
+    SectionData:     2F454E5452593A6D61696E20
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   0C0000000200000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   000000000000000000000000000000000000
+  - Name:            ".debug$S"
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   7C0000000000000000000000000000000000
+  - Name:            _val1
+    Value:           0
+    SectionNumber:   0
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _val2
+    Value:           0
+    SectionNumber:   0
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _main
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   0C0000000000000000000000000000000000
+...
diff --git a/lld/test/pecoff/Inputs/nop.obj b/lld/test/pecoff/Inputs/nop.obj
deleted file mode 100644 (file)
index 1761f9e..0000000
Binary files a/lld/test/pecoff/Inputs/nop.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/nop.obj.yaml b/lld/test/pecoff/Inputs/nop.obj.yaml
new file mode 100644 (file)
index 0000000..b2f8939
--- /dev/null
@@ -0,0 +1,67 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     B82A000000C3
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     ""
+  - Name:            ".debug$S"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F10000005D0000002200011100000000433A5C63796777696E5C686F6D655C727569755C6E6F702E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C65720000000000
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       2147483648
+    SectionData:     2F454E5452593A737461727420
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   060000000000000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   000000000000000000000000000000000000
+  - Name:            ".debug$S"
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   6C0000000000000000000000000000000000
+  - Name:            _start
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   0D0000000000000000000000000000000000
+...
diff --git a/lld/test/pecoff/Inputs/static-data1.obj b/lld/test/pecoff/Inputs/static-data1.obj
deleted file mode 100644 (file)
index 9e0f831..0000000
Binary files a/lld/test/pecoff/Inputs/static-data1.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/static-data1.obj.yaml b/lld/test/pecoff/Inputs/static-data1.obj.yaml
new file mode 100644 (file)
index 0000000..ae45474
--- /dev/null
@@ -0,0 +1,55 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     ""
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     03000000
+  - Name:            ".debug$S"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F1000000660000002B00011100000000433A5C63796777696E5C686F6D655C727569755C7374617469635C64617461312E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C657200000000
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   000000000000000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   040000000000000000000000000000000000
+  - Name:            ".debug$S"
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   740000000000000000000000000000000000
+  - Name:            _val1
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+...
diff --git a/lld/test/pecoff/Inputs/static-data2.obj b/lld/test/pecoff/Inputs/static-data2.obj
deleted file mode 100644 (file)
index f3ac6c9..0000000
Binary files a/lld/test/pecoff/Inputs/static-data2.obj and /dev/null differ
diff --git a/lld/test/pecoff/Inputs/static-data2.obj.yaml b/lld/test/pecoff/Inputs/static-data2.obj.yaml
new file mode 100644 (file)
index 0000000..e75415b
--- /dev/null
@@ -0,0 +1,55 @@
+---
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: [  ]
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     ""
+  - Name:            .data
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     04000000
+  - Name:            ".debug$S"
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    SectionData:     04000000F1000000660000002B00011100000000433A5C63796777696E5C686F6D655C727569755C7374617469635C64617461322E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C657200000000
+symbols:
+  - Name:            "@comp.id"
+    Value:           10394907
+    SectionNumber:   65535
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   000000000000000000000000000000000000
+  - Name:            .data
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   040000000000000000000000000000000000
+  - Name:            ".debug$S"
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    NumberOfAuxSymbols: 1
+    AuxiliaryData:   740000000000000000000000000000000000
+  - Name:            _val2
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+...
index 665c0d0..5643d4d 100644 (file)
@@ -1,5 +1,7 @@
-# RUN: lld -flavor link -out %t1 -subsystem console -force \
-# RUN:   -- %p/Inputs/grouped-sections.obj && llvm-objdump -s %t1 | FileCheck %s
+# RUN: yaml2obj %p/Inputs/grouped-sections.obj.yaml > %t.obj
+#
+# RUN: lld -flavor link -out %t1 -subsystem console -force -- %t.obj \
+# RUN:   && llvm-objdump -s %t1 | FileCheck %s
 #
 # The file "grouped-sections.obj" has three data sections in the following
 # order:
index 7b6be39..b57f9c6 100644 (file)
@@ -1,13 +1,13 @@
-# RUN: lld -flavor link -out %t1 -subsystem console -force \
-# RUN:   -- %p/Inputs/hello.obj \
+# RUN: yaml2obj %p/Inputs/hello.obj.yaml > %t.obj
+
+# RUN: lld -flavor link -out %t1 -subsystem console -force -- %t.obj \
 # RUN:   && llvm-readobj -file-headers %t1 | FileCheck -check-prefix=FILE %s
 
 FILE: ImageOptionalHeader {
 FILE:   SizeOfInitializedData: 512
 FILE: }
 
-# RUN: lld -flavor link -out %t1 -subsystem console -force \
-# RUN:   -- %p/Inputs/hello.obj \
+# RUN: lld -flavor link -out %t1 -subsystem console -force -- %t.obj \
 # RUN:   && llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTIONS %s
 
 SECTIONS: Format: COFF-i386
index 847ac95..b15d8aa 100644 (file)
@@ -1,9 +1,10 @@
 # Verify that lld can handle .lib files. "main.obj" refers _val1 and
 # _val2 that are defined in "dynamic.lib".
 #
-# RUN: lld -flavor link -out %t1 -subsystem console \
-# RUN:   -- %p/Inputs/main.obj %p/Inputs/dynamic.lib \
-# RUN:   && llvm-objdump -d %t1 | FileCheck %s
+# RUN: yaml2obj %p/Inputs/main.obj.yaml > %t.obj
+#
+# RUN: lld -flavor link -out %t1 -subsystem console -- %t.obj \
+# RUN:   %p/Inputs/dynamic.lib && llvm-objdump -d %t1 | FileCheck %s
 
 CHECK: Disassembly of section .text:
 CHECK: .text:
index 9c0d9af..ae7c14b 100644 (file)
@@ -1,8 +1,9 @@
 # Verify that lld can handle a library file.
 #
-# RUN: lld -flavor link -out %t1 -subsystem console \
-# RUN:   -- %p/Inputs/main.obj %p/Inputs/static.lib \
-# RUN:   && llvm-objdump -d %t1 | FileCheck %s
+# RUN: yaml2obj %p/Inputs/main.obj.yaml > %t.obj
+#
+# RUN: lld -flavor link -out %t1 -subsystem console -- %t.obj \
+# RUN:   %p/Inputs/static.lib && llvm-objdump -d %t1 | FileCheck %s
 
 CHECK: Disassembly of section .text:
 CHECK: .text:
index 458729d..aa198a8 100644 (file)
@@ -1,8 +1,10 @@
 # Verify that lld can handle multiple input files.
 #
-# RUN: lld -flavor link -out %t1 -subsystem console \
-# RUN:   -- %p/Inputs/main.obj %p/Inputs/static-data1.obj \
-# RUN:   %p/Inputs/static-data2.obj \
+# RUN: yaml2obj %p/Inputs/main.obj.yaml > %t1.obj
+# RUN: yaml2obj %p/Inputs/static-data1.obj.yaml > %t2.obj
+# RUN: yaml2obj %p/Inputs/static-data2.obj.yaml > %t3.obj
+#
+# RUN: lld -flavor link -out %t1 -subsystem console -- %t1.obj %t2.obj %t3.obj \
 # RUN:   && llvm-objdump -d %t1 | FileCheck %s
 
 CHECK: Disassembly of section .text:
index 974cbcd..cde0502 100644 (file)
@@ -1,6 +1,8 @@
-# RUN: llvm-objdump -d %p/Inputs/hello.obj | FileCheck -check-prefix=BEFORE %s
+# RUN: yaml2obj %p/Inputs/hello.obj.yaml > %t.obj
 #
-# RUN: lld -flavor link -out %t1 -subsystem console -force -- %p/Inputs/hello.obj \
+# RUN: llvm-objdump -d %t.obj | FileCheck -check-prefix=BEFORE %s
+#
+# RUN: lld -flavor link -out %t1 -subsystem console -force -- %t.obj \
 # RUN:   && llvm-objdump -d %t1 | FileCheck -check-prefix=AFTER %s
 
 BEFORE: Disassembly of section .text:
index ad314f6..bca164e 100644 (file)
@@ -2,8 +2,13 @@
 # text section. Other data, including data sections, relocations, symbol
 # tables are not present in nop.obj.
 #
-# RUN: lld -flavor link -out %t1 -subsystem console,3.11 -- %p/Inputs/nop.obj \
+# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj
+#
+# RUN: lld -flavor link -out %t1 -subsystem console,3.11 -- %t.obj \
 # RUN:   && llvm-readobj -file-headers %t1 | FileCheck -check-prefix=FILE %s
+#
+# RUN: lld -flavor link -out %t1 -- %t.obj \
+# RUN:   && llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTIONS %s
 
 FILE: Format: COFF-i386
 FILE: Arch: i386
@@ -55,8 +60,6 @@ FILE:   SizeOfHeapCommit: 4096
 FILE:   NumberOfRvaAndSize: 16
 FILE: }
 
-# RUN: lld -flavor link -out %t1 -- %p/Inputs/nop.obj \
-# RUN:   && llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTIONS %s
 SECTIONS: Format: COFF-i386
 SECTIONS: Arch: i386
 SECTIONS: AddressSize: 32bit