X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/ebf6f43431fe84b7b17822014a6d1f0169516e93..82b4b32b1851b4bba2473356c2208bd34561ee02:/src/ld/SymbolTable.h diff --git a/src/ld/SymbolTable.h b/src/ld/SymbolTable.h index 451d064..2708f1f 100644 --- a/src/ld/SymbolTable.h +++ b/src/ld/SymbolTable.h @@ -42,7 +42,7 @@ #include #include -#include +#include #include "Options.h" #include "ld.hpp" @@ -57,42 +57,38 @@ public: typedef uint32_t IndirectBindingSlot; private: - class CStringEquals { - public: - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - typedef __gnu_cxx::hash_map, CStringEquals> NameToSlot; + typedef std::unordered_map NameToSlot; class ContentFuncs { public: size_t operator()(const ld::Atom*) const; bool operator()(const ld::Atom* left, const ld::Atom* right) const; }; - typedef __gnu_cxx::hash_map ContentToSlot; + typedef std::unordered_map ContentToSlot; class ReferencesHashFuncs { public: size_t operator()(const ld::Atom*) const; bool operator()(const ld::Atom* left, const ld::Atom* right) const; }; - typedef __gnu_cxx::hash_map ReferencesToSlot; + typedef std::unordered_map ReferencesToSlot; class CStringHashFuncs { public: size_t operator()(const ld::Atom*) const; bool operator()(const ld::Atom* left, const ld::Atom* right) const; }; - typedef __gnu_cxx::hash_map CStringToSlot; + typedef std::unordered_map CStringToSlot; class UTF16StringHashFuncs { public: size_t operator()(const ld::Atom*) const; bool operator()(const ld::Atom* left, const ld::Atom* right) const; }; - typedef __gnu_cxx::hash_map UTF16StringToSlot; + typedef std::unordered_map UTF16StringToSlot; typedef std::map SlotToName; - typedef __gnu_cxx::hash_map, CStringEquals> NameToMap; + typedef std::unordered_map NameToMap; typedef std::vector DuplicatedSymbolAtomList; typedef std::map DuplicateSymbols; @@ -124,6 +120,8 @@ public: unsigned int updateCount() { return _indirectBindingTable.size(); } void undefines(std::vector& undefines); void tentativeDefs(std::vector& undefines); + void mustPreserveForBitcode(std::unordered_set& syms); + void removeDeadAtoms(); bool hasName(const char* name); bool hasExternalTentativeDefinitions() { return _hasExternalTentativeDefinitions; } byNameIterator begin() { return byNameIterator(_byNameTable.begin(),_indirectBindingTable); } @@ -158,6 +156,7 @@ private: CStringToSlot _cstringTable; NameToMap _nonStdCStringSectionToMap; ReferencesToSlot _nonLazyPointerTable; + ReferencesToSlot _threadPointerTable; ReferencesToSlot _cfStringTable; ReferencesToSlot _objc2ClassRefTable; ReferencesToSlot _pointerToCStringTable;