]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/InputFiles.h
ld64-253.3.tar.gz
[apple/ld64.git] / src / ld / InputFiles.h
index afc2077349923d5fa402caf174099e0f8c239a75..608ce39f41f20349a0ec035a1a2eea7a26851219 100644 (file)
@@ -63,7 +63,7 @@ public:
        virtual ld::dylib::File*        findDylib(const char* installPath, const char* fromPath);
        
        // iterates all atoms in initial files
        virtual ld::dylib::File*        findDylib(const char* installPath, const char* fromPath);
        
        // iterates all atoms in initial files
-       void                                            forEachInitialAtom(ld::File::AtomHandler&);
+       void                                            forEachInitialAtom(ld::File::AtomHandler&, ld::Internal& state);
        // searches libraries for name
        bool                                            searchLibraries(const char* name, bool searchDylibs, bool searchArchives,  
                                                                                                                                  bool dataSymbolOnly, ld::File::AtomHandler&) const;
        // searches libraries for name
        bool                                            searchLibraries(const char* name, bool searchDylibs, bool searchArchives,  
                                                                                                                                  bool dataSymbolOnly, ld::File::AtomHandler&) const;
@@ -74,6 +74,9 @@ public:
        
        bool                                            inferredArch() const { return _inferredArch; }
        
        
        bool                                            inferredArch() const { return _inferredArch; }
        
+       void                                            addLinkerOptionLibraries(ld::Internal& state, ld::File::AtomHandler& handler);
+       void                                            createIndirectDylibs();
+
        // for -print_statistics
        volatile int64_t                        _totalObjectSize;
        volatile int64_t                        _totalArchiveSize;
        // for -print_statistics
        volatile int64_t                        _totalObjectSize;
        volatile int64_t                        _totalArchiveSize;
@@ -90,12 +93,13 @@ private:
        void                                            logTraceInfo (const char* format, ...) const;
        void                                            logDylib(ld::File*, bool indirect);
        void                                            logArchive(ld::File*) const;
        void                                            logTraceInfo (const char* format, ...) const;
        void                                            logDylib(ld::File*, bool indirect);
        void                                            logArchive(ld::File*) const;
-       void                                            createIndirectDylibs();
+       void                                            markExplicitlyLinkedDylibs();
        void                                            checkDylibClientRestrictions(ld::dylib::File*);
        void                                            createOpaqueFileSections();
        void                                            checkDylibClientRestrictions(ld::dylib::File*);
        void                                            createOpaqueFileSections();
+       bool                                            libraryAlreadyLoaded(const char* path);
        
        // for pipelined linking
        
        // for pipelined linking
-    void                      waitForInputFiles();
+    void                                               waitForInputFiles();
        static void                                     waitForInputFiles(InputFiles *inputFiles);
 
        // for threaded input file processing
        static void                                     waitForInputFiles(InputFiles *inputFiles);
 
        // for threaded input file processing
@@ -103,11 +107,7 @@ private:
        static void                                     parseWorkerThread(InputFiles *inputFiles);
        void                                            startThread(void (*threadFunc)(InputFiles *)) const;
 
        static void                                     parseWorkerThread(InputFiles *inputFiles);
        void                                            startThread(void (*threadFunc)(InputFiles *)) const;
 
-       class CStringEquals {
-       public:
-               bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
-       };
-       typedef __gnu_cxx::hash_map<const char*, ld::dylib::File*, __gnu_cxx::hash<const char*>, CStringEquals> InstallNameToDylib;
+       typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals>   InstallNameToDylib;
 
        const Options&                          _options;
        std::vector<ld::File*>          _inputFiles;
 
        const Options&                          _options;
        std::vector<ld::File*>          _inputFiles;
@@ -115,9 +115,7 @@ private:
        InstallNameToDylib                      _installPathToDylibs;
        std::set<ld::dylib::File*>      _allDylibs;
        ld::dylib::File*                        _bundleLoader;
        InstallNameToDylib                      _installPathToDylibs;
        std::set<ld::dylib::File*>      _allDylibs;
        ld::dylib::File*                        _bundleLoader;
-       bool                                            _allDirectDylibsLoaded;
        bool                                            _inferredArch;
        bool                                            _inferredArch;
-    int                       _fileMonitor;
     struct strcompclass {
         bool operator() (const char *a, const char *b) const { return ::strcmp(a, b) < 0; }
     };
     struct strcompclass {
         bool operator() (const char *a, const char *b) const { return ::strcmp(a, b) < 0; }
     };
@@ -137,6 +135,7 @@ private:
        int                                                     _remainingInputFiles;   // number of input files still to parse
        
        ld::File::Ordinal                       _indirectDylibOrdinal;
        int                                                     _remainingInputFiles;   // number of input files still to parse
        
        ld::File::Ordinal                       _indirectDylibOrdinal;
+       ld::File::Ordinal                       _linkerOptionOrdinal;
     
     class LibraryInfo {
         ld::File* _lib;
     
     class LibraryInfo {
         ld::File* _lib;