X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/b1f7435d66a93f03b77932b3a9ad8a83ce5e1ebc..bee7e226299dacc6d80d9cf6f1585c3d5d0645e0:/src/ld/Resolver.h diff --git a/src/ld/Resolver.h b/src/ld/Resolver.h index a267489..06b7a8b 100644 --- a/src/ld/Resolver.h +++ b/src/ld/Resolver.h @@ -42,6 +42,7 @@ #include #include +#include #include "Options.h" #include "ld.hpp" @@ -61,7 +62,9 @@ public: : _options(opts), _inputFiles(inputs), _internal(state), _symbolTable(opts, state.indirectBindingTable), _haveLLVMObjs(false), - _completedInitialObjectFiles(false) {} + _completedInitialObjectFiles(false), + _ltoCodeGenFinished(false), + _haveAliases(false) {} virtual void doAtom(const ld::Atom&); @@ -69,7 +72,7 @@ public: void resolve(); - + private: struct WhyLiveBackChain { @@ -88,7 +91,8 @@ private: void fillInInternalState(); void fillInHelpersInInternalState(); void removeCoalescedAwayAtoms(); - void fillInEntryPoint(); + void syncAliases(); + void fillInEntryPoint(); void linkTimeOptimize(); void convertReferencesToIndirect(const ld::Atom& atom); const ld::Atom* entryPoint(bool searchArchives); @@ -98,12 +102,11 @@ private: void remainingUndefines(std::vector&); bool printReferencedBy(const char* name, SymbolTable::IndirectBindingSlot slot); void tweakWeakness(); + void buildArchivesList(); + void doLinkerOption(const std::vector& linkerOption, const char* fileName); + void dumpAtoms(); - class CStringEquals { - public: - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - typedef __gnu_cxx::hash_set, CStringEquals> StringSet; + typedef std::unordered_set StringSet; class NotLive { public: @@ -124,10 +127,14 @@ private: ld::Internal& _internal; std::vector _atoms; std::set _deadStripRoots; + std::vector _dontDeadStripIfReferencesLive; std::vector _atomsWithUnresolvedReferences; + std::vector _aliasesFromCmdLine; SymbolTable _symbolTable; bool _haveLLVMObjs; bool _completedInitialObjectFiles; + bool _ltoCodeGenFinished; + bool _haveAliases; };