mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
81b4af3e73
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
13 lines
393 B
Plaintext
13 lines
393 B
Plaintext
# Inputs generated with:
|
|
# echo 'int hello() { return 5; }' > test.c
|
|
# clang -O -fembed-bitcode -c -o macho-bitcode-x86_64.o test.c
|
|
# clang -O -fembed-bitcode-marker -c -o macho-bitcode-marker-x86_64.o test.c
|
|
|
|
RUN: llvm-nm -a %p/Inputs/macho-bitcode-x86_64.o \
|
|
RUN: | FileCheck %s
|
|
|
|
RUN: llvm-nm -a %p/Inputs/macho-bitcode-marker-x86_64.o \
|
|
RUN: | FileCheck %s
|
|
|
|
CHECK: T _hello
|