diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-08-21 21:00:16 +0000 |
---|---|---|
committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-08-21 21:00:16 +0000 |
commit | 359840a6e4ae062f984c2ce91ab37c084755c158 (patch) | |
tree | 9e951545fa9aa5abfee440b2c4317e6ec1c08351 /llvm/lib/Object | |
parent | 08ff5df49c61a4d6bd297ac34c5b7815bcc83624 (diff) | |
download | bcm5719-llvm-359840a6e4ae062f984c2ce91ab37c084755c158.tar.gz bcm5719-llvm-359840a6e4ae062f984c2ce91ab37c084755c158.zip |
[BinaryFormat] Teach identify_magic about Tapi files.
Summary:
Tapi files are YAML files that start with the !tapi tag. The only execption are
TBD v1 files, which don't have a tag. In that case we have to scan a little
further and check if the first key "archs" exists.
This is the first patch in a series of patches to add libObject support for
text-based dynamic library (.tbd) files.
This patch is practically exactly the same as D37820, that was never pushed to master,
and is needed for future commits related to reading tbd files for llvm-nm
Reviewers: ributzka, steven_wu, bollu, espindola, jfb, shafik, jdoerfert
Reviewed By: steven_wu
Subscribers: dexonsmith, llvm-commits
Tags: #llvm, #clang, #sanitizers, #lldb, #libc, #openmp
Differential Revision: https://reviews.llvm.org/D66149
llvm-svn: 369579
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Object/ObjectFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Object/SymbolicFile.cpp | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index a953c1d8cb8..1ceda54a4b4 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -86,6 +86,9 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, return errorCodeToError(object_error::invalid_file_type); case file_magic::minidump: return MinidumpFile::create(Buffer); + case file_magic::tapi_file: + // Placeholder until TAPI is supported for lib/Object + return errorCodeToError(object_error::invalid_file_type); } llvm_unreachable("Unexpected Binary File Type"); } diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index 101f5dcc082..79812e3a10b 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -127,6 +127,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type) { case file_magic::pdb: case file_magic::minidump: return errorCodeToError(object_error::invalid_file_type); + case file_magic::tapi_file: + return errorCodeToError(object_error::invalid_file_type); case file_magic::elf: case file_magic::elf_relocatable: case file_magic::elf_executable: diff --git a/llvm/lib/Object/SymbolicFile.cpp b/llvm/lib/Object/SymbolicFile.cpp index 2b152b7d8da..3db4ad9ed14 100644 --- a/llvm/lib/Object/SymbolicFile.cpp +++ b/llvm/lib/Object/SymbolicFile.cpp @@ -53,6 +53,7 @@ SymbolicFile::createSymbolicFile(MemoryBufferRef Object, file_magic Type, case file_magic::windows_resource: case file_magic::pdb: case file_magic::minidump: + case file_magic::tapi_file: return errorCodeToError(object_error::invalid_file_type); case file_magic::elf: case file_magic::elf_executable: |