[PATCH] COFF: Handle references from LTO object to lazy symbols correctly.
Rui Ueyama
ruiu at google.com
Mon Jun 8 20:24:08 PDT 2015
LGTM
Thank you for the explanation. My concern was that before this patch, adding a combined compiled bitcode file is really a final operation in the linker, but after this patch, a new call of addMember() can read arbitrary number of new files. That would increase complexity. That being said, this change seems reasonable. It's probably better than maintaining a list of symbols to be linked unconditionally for LTO.
================
Comment at: COFF/SymbolTable.cpp:314
@@ +313,3 @@
+ if (auto *B = dyn_cast<Lazy>(Sym->Body)) {
+ unsigned NumBitcodeFiles = BitcodeFiles.size();
+ auto EC = addMemberFile(B);
----------------
size_t
================
Comment at: COFF/SymbolTable.cpp:317
@@ +316,3 @@
+ if (EC)
+ return EC;
+ if (BitcodeFiles.size() != NumBitcodeFiles) {
----------------
if (auto EC = ...)
return EC
================
Comment at: COFF/SymbolTable.cpp:329
@@ +328,3 @@
+ if (reportRemainingUndefines())
+ return make_error_code(LLDError::BrokenFile);
+
----------------
Can we call reportRemainingUndefines after Symtab.addCombinedLTOObject in the Driver to eliminate this call from here?
http://reviews.llvm.org/D10332
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list