diff options
author | Rui Ueyama <ruiu@google.com> | 2013-11-14 22:09:08 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-11-14 22:09:08 +0000 |
commit | b850a05f2c914fef74dbafbf61470512a976c632 (patch) | |
tree | 182add9a77e395b70dc4faedcccbac6f4f581a9b /test | |
parent | 6a1a5e94e2b094aead41f171ee060d91ad25777c (diff) | |
download | external_llvm-b850a05f2c914fef74dbafbf61470512a976c632.zip external_llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.gz external_llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.bz2 |
Recognize 0x0000 as a COFF file magic.
Summary:
Some machine-type-neutral object files containing only undefined symbols
actually do exist in the Windows standard library. Need to recognize them
as COFF files.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/tools/llvm-readobj/Inputs/magic.coff-unknown | bin | 0 -> 450 bytes | |||
-rw-r--r-- | test/tools/llvm-readobj/file-headers.test | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/tools/llvm-readobj/Inputs/magic.coff-unknown b/test/tools/llvm-readobj/Inputs/magic.coff-unknown Binary files differnew file mode 100644 index 0000000..7b3b461 --- /dev/null +++ b/test/tools/llvm-readobj/Inputs/magic.coff-unknown diff --git a/test/tools/llvm-readobj/file-headers.test b/test/tools/llvm-readobj/file-headers.test index b900e36..d88029a 100644 --- a/test/tools/llvm-readobj/file-headers.test +++ b/test/tools/llvm-readobj/file-headers.test @@ -8,6 +8,8 @@ RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 \ RUN: | FileCheck %s -check-prefix ELF32 RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 \ RUN: | FileCheck %s -check-prefix ELF64 +RUN: llvm-readobj -h %p/Inputs/magic.coff-unknown \ +RUN: | FileCheck %s -check-prefix COFF-UNKNOWN COFF32: File: {{(.*[/\\])?}}trivial.obj.coff-i386 COFF32-NEXT: Format: COFF-i386 @@ -183,3 +185,17 @@ PE32-NEXT: ReservedRVA: 0x0 PE32-NEXT: ReservedSize: 0x0 PE32-NEXT: } PE32-NEXT: } + +COFF-UNKNOWN: Format: COFF-<unknown arch> +COFF-UNKNOWN-NEXT: Arch: unknown +COFF-UNKNOWN-NEXT: AddressSize: 32bit +COFF-UNKNOWN-NEXT: ImageFileHeader { +COFF-UNKNOWN-NEXT: Machine: IMAGE_FILE_MACHINE_UNKNOWN (0x0) +COFF-UNKNOWN-NEXT: SectionCount: 3 +COFF-UNKNOWN-NEXT: TimeDateStamp: 2013-11-14 21:19:28 (0x52853E60) +COFF-UNKNOWN-NEXT: PointerToSymbolTable: 0xF8 +COFF-UNKNOWN-NEXT: SymbolCount: 11 +COFF-UNKNOWN-NEXT: OptionalHeaderSize: 0 +COFF-UNKNOWN-NEXT: Characteristics [ (0x0) +COFF-UNKNOWN-NEXT: ] +COFF-UNKNOWN-NEXT: } |