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
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()?
Nit: how about "DematerializeFunctionPreservesLinkageType" to capture the intent a little better?