X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/7f09b9353af9897bf18933788d6a59c152c29edd..82b4b32b1851b4bba2473356c2208bd34561ee02:/src/ld/ld.hpp diff --git a/src/ld/ld.hpp b/src/ld/ld.hpp index 0db1b7e..8351e3f 100644 --- a/src/ld/ld.hpp +++ b/src/ld/ld.hpp @@ -225,6 +225,7 @@ namespace relocatable { virtual bool hasLongBranchStubs() { return false; } virtual LinkerOptionsList* linkerOptions() const = 0; virtual SourceKind sourceKind() const { return kSourceUnknown; } + virtual const uint8_t* fileContent() const { return nullptr; } }; } // namespace relocatable @@ -786,6 +787,7 @@ public: _definition = a._definition; _combine = a._combine; _dontDeadStrip = a._dontDeadStrip; + _dontDeadStripIfRefLive = a._dontDeadStripIfRefLive; _thumb = a._thumb; _autoHide = a._autoHide; _contentType = a._contentType; @@ -797,6 +799,14 @@ public: _weakImportState = a._weakImportState; } + const char* safeFilePath() const { + const File* f = this->file(); + if ( f != NULL ) + return f->path(); + else + return ""; + } + protected: enum AddressMode { modeSectionOffset, modeFinalAddress }; @@ -831,7 +841,7 @@ public: }; - + // utility classes for using std::unordered_map with c-strings struct CStringHash { size_t operator()(const char* __s) const { @@ -892,7 +902,8 @@ public: hasThreadLocalVariableDefinitions(false), hasWeakExternalSymbols(false), someObjectHasOptimizationHints(false), - dropAllBitcode(false), embedMarkerOnly(false) { } + dropAllBitcode(false), embedMarkerOnly(false), + forceLoadCompilerRT(false) { } std::vector sections; std::vector dylibs; @@ -905,6 +916,7 @@ public: CStringSet linkerOptionFrameworks; std::vector indirectBindingTable; std::vector filesWithBitcode; + std::vector filesFromCompilerRT; std::vector deadAtoms; std::unordered_set allUndefProxies; const ld::dylib::File* bundleLoader; @@ -927,6 +939,7 @@ public: bool someObjectHasOptimizationHints; bool dropAllBitcode; bool embedMarkerOnly; + bool forceLoadCompilerRT; std::vector ltoBitcodePath; };