Closed tstellar closed 9 years ago
Fixed at r249947.
Patch with fix and testcase out for review at http://reviews.llvm.org/D13596
I found that this due to unnamed functions created during the link for use in library functions also generated during the link. These unnamed functions don't have entries in the Value Symbol Table and thus we can't look up their bitcode offset. I am thinking about some ways to handle this.
Reproduced, taking a look.
Extended Description
r247927 has caused a regression where llvm-dis hits an assertion failure when trying to disassemble bitcode that has been output by the linker:
lib/Bitcode/Reader/BitcodeReader.cpp:4965: std::error_code {anonymous}::BitcodeReader::findFunctionInStream(llvm::Function, llvm::DenseMapBase<llvm::DenseMap<llvm::Function, long unsigned int>, llvm::Function, long unsigned int, llvm::DenseMapInfo<llvm::Function>, llvm::detail::DenseMapPair<llvm::Function*, long unsigned int> >::iterator): Assertion `VSTOffset == 0' failed.
To reproduce place the attached files program.bc and library.bc in the same directory has link.sh and then execute the link.sh script.
Note that program.bc was generated by LLVM 3.5, and I think library.bc was from LLVM 3.6.