diff options
| author | Steven Wu <stevenwu@apple.com> | 2019-03-21 21:01:31 +0000 |
|---|---|---|
| committer | Steven Wu <stevenwu@apple.com> | 2019-03-21 21:01:31 +0000 |
| commit | 5a593547602be6601c6125b689c0ffe325984ecf (patch) | |
| tree | 8fd96e6d2c701e6520a76e53125733e4529015c2 /llvm/test/Object/Inputs | |
| parent | e811333b2dbb14a1aacf25a46872ca1d513f8f57 (diff) | |
| download | bcm5719-llvm-5a593547602be6601c6125b689c0ffe325984ecf.tar.gz bcm5719-llvm-5a593547602be6601c6125b689c0ffe325984ecf.zip | |
[Object] Fix reading objects created with -fembed-bitcode-marker
Currently, this fails with many tools, e.g.
$ clang -fembed-bitcode-marker -c -o test.o test.c
$ nm test.o
nm: test.o The file was not recognized as a valid object file
-fembed-bitcode-marker creates a LLVM,bitcode section consisting of a single
byte. When reading the object file, IRObjectFile::findBitcodeInObject succeeds,
causing SymbolicFile::createSymbolicFile to try to read the "bitcode" rather
than using the outer Mach-O data - when then fails.
Fix this by making findBitcodeInObject return an error if the section size <= 1.
Patched by: Nicholas Allegra
Differential Revision: https://reviews.llvm.org/D44373
llvm-svn: 356718
Diffstat (limited to 'llvm/test/Object/Inputs')
| -rw-r--r-- | llvm/test/Object/Inputs/macho-bitcode-marker-x86_64.o | bin | 0 -> 840 bytes |
| -rw-r--r-- | llvm/test/Object/Inputs/macho-bitcode-x86_64.o | bin | 0 -> 3600 bytes |
2 files changed, 0 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-bitcode-marker-x86_64.o b/llvm/test/Object/Inputs/macho-bitcode-marker-x86_64.o Binary files differnew file mode 100644 index 00000000000..5b24816b7c5 --- /dev/null +++ b/llvm/test/Object/Inputs/macho-bitcode-marker-x86_64.o diff --git a/llvm/test/Object/Inputs/macho-bitcode-x86_64.o b/llvm/test/Object/Inputs/macho-bitcode-x86_64.o Binary files differnew file mode 100644 index 00000000000..eeaec046f19 --- /dev/null +++ b/llvm/test/Object/Inputs/macho-bitcode-x86_64.o |

