The function deleteBody() converts the linkage to external and thus destroys
original linkage type value. Lack of correct linkage type causes wrong
relocations to be emitted later.
Calling dropAllReferences() instead of deleteBody() will fix the issue.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Related thread at llvm-commit list: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140915/thread.html#235838
Comment Actions
LGTM. Is there a way to test this, though? Should there be a unit test to cover BitcodeReader::Dematerialize()?
Comment Actions
LGTM
unittests/Bitcode/BitReaderTest.cpp | ||
---|---|---|
61 ↗ | (On Diff #13935) | Nit: how about "DematerializeFunctionPreservesLinkageType" to capture the intent a little better? |
77 ↗ | (On Diff #13935) | Nit: change to "Check that..." (otherwise the comment doesn't make it clear whether the test wants the linkage preserved or not) |