This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Disallow replacing DefinedImport* symbols with other symbols
AbandonedPublic

Authored by mstorsjo on Jul 4 2018, 2:12 PM.

Details

Reviewers
ruiu
pcc
Summary

When DefinedImportThunk and DefinedImportData symbols are created, a pointer to them is stored in the ImportFile class, stored as a pointer to the specific subclass. If these symbols are replaced, these pointers no longer point to this particular base class.

This fixes crashes that were possible before, by touching these symbols that now are populated as e.g. a DefinedRegular, via the old pointers with DefinedImportThunk type.

This is one way of solving the issue, the alternative would be to not store pointers to the subclass but actually check them on use.

Diff Detail

Event Timeline

mstorsjo abandoned this revision.Jul 10 2018, 3:58 AM

Committed the alternative, D48953, instead.