forked from OSchip/llvm-project
parent
bdb34beae0
commit
43a589cc82
|
@ -38,7 +38,7 @@ public:
|
|||
|
||||
Resolver(LinkingContext &context)
|
||||
: _context(context), _symbolTable(context), _result(new MergedFile()),
|
||||
_haveLLVMObjs(false), _addToFinalSection(false) {}
|
||||
_addToFinalSection(false) {}
|
||||
|
||||
// InputFiles::Handler methods
|
||||
void doDefinedAtom(const DefinedAtom&);
|
||||
|
@ -71,7 +71,7 @@ private:
|
|||
bool resolveUndefines();
|
||||
void updateReferences();
|
||||
void deadStripOptimize();
|
||||
bool checkUndefines(bool isFinal);
|
||||
bool checkUndefines();
|
||||
void removeCoalescedAwayAtoms();
|
||||
void checkDylibSymbolCollisions();
|
||||
void linkTimeOptimize();
|
||||
|
@ -117,7 +117,6 @@ private:
|
|||
std::vector<const Atom *> _atomsWithUnresolvedReferences;
|
||||
llvm::DenseSet<const Atom *> _liveAtoms;
|
||||
std::unique_ptr<MergedFile> _result;
|
||||
bool _haveLLVMObjs;
|
||||
bool _addToFinalSection;
|
||||
};
|
||||
|
||||
|
|
|
@ -397,11 +397,7 @@ void Resolver::deadStripOptimize() {
|
|||
}
|
||||
|
||||
// error out if some undefines remain
|
||||
bool Resolver::checkUndefines(bool isFinal) {
|
||||
// when using LTO, undefines are checked after bitcode is optimized
|
||||
if (_haveLLVMObjs && !isFinal)
|
||||
return false;
|
||||
|
||||
bool Resolver::checkUndefines() {
|
||||
// build vector of remaining undefined symbols
|
||||
std::vector<const UndefinedAtom *> undefinedAtoms;
|
||||
_symbolTable.undefines(undefinedAtoms);
|
||||
|
@ -466,7 +462,7 @@ bool Resolver::resolve() {
|
|||
return false;
|
||||
this->updateReferences();
|
||||
this->deadStripOptimize();
|
||||
if (this->checkUndefines(false))
|
||||
if (this->checkUndefines())
|
||||
if (!_context.allowRemainingUndefines())
|
||||
return false;
|
||||
this->removeCoalescedAwayAtoms();
|
||||
|
|
Loading…
Reference in New Issue