topImage = 36, // sizeof(ImageNum)
libDyldEntry = 37, // sizeof(ResolvedSymbolTarget)
libSystemNum = 38, // sizeof(ImageNum)
- bootUUID = 39, // c-string 40
mainEntry = 40, // sizeof(ResolvedSymbolTarget)
startEntry = 41, // sizeof(ResolvedSymbolTarget) // used by programs built with crt1.o
cacheOverrides = 42, // sizeof(PatchEntry) * count // used if process uses interposing or roots (cached dylib overrides)
bool hasObjC() const;
bool hasInitializers() const;
bool hasPrecomputedObjC() const;
+ bool fixupsNotEncoded() const; // minimal closure, dyld must parse and apply fixups
+ bool rebasesNotEncoded() const;
bool hasTerminators() const;
bool hasReadOnlyData() const;
bool hasChainedFixups() const;
bool is64() const;
bool neverUnload() const;
bool cwdMustBeThisDir() const;
- bool isPlatformBinary() const;
bool overridableDylib() const;
bool hasFileModTimeAndInode(uint64_t& inode, uint64_t& mTime) const;
void forEachCDHash(void (^handler)(const uint8_t cdHash[20], bool& stop)) const;
bool hasPathWithHash(const char* path, uint32_t hash) const;
bool isOverrideOfDyldCacheImage(ImageNum& cacheImageNum) const;
uint64_t textSize() const;
+ const char* variantString() const; // "minimal" or "full" closure
union ResolvedSymbolTarget
{
void forEachTextReloc(void (^rebase)(uint32_t imageOffsetToRebase, bool& stop),
void (^bind)(uint32_t imageOffsetToBind, ResolvedSymbolTarget bindTarget, bool& stop)) const;
+ bool forEachBind(void (^bind)(uint64_t imageOffsetToBind, ResolvedSymbolTarget bindTarget, bool& stop)) const;
+
static_assert(sizeof(ResolvedSymbolTarget) == 8, "Overflow in size of SymbolTargetLocation");
static uint32_t hashFunction(const char*);
friend class ClosureBuilder;
friend class ClosureWriter;
friend class LaunchClosureWriter;
-
+ friend class RebasePatternBuilder;
+ friend class BindPatternBuilder;
+
uint32_t pageSize() const;
struct Flags
hasReadOnlyData : 1,
hasChainedFixups : 1,
hasPrecomputedObjC : 1,
- padding : 17;
+ fixupsNotEncoded : 1,
+ rebasesNotEncoded : 1,
+ hasOverrideImageNum : 1,
+ padding : 14;
};
static_assert(sizeof(Flags) == sizeof(uint64_t), "Flags overflow");
{
size_t size() const;
const ImageArray* images() const;
- ImageNum topImage() const;
+ ImageNum topImageNum() const;
+ const Image* topImage() const;
void deallocate() const;
friend class ClosureWriter;
};
bool builtAgainstDyldCache(uuid_t cacheUUID) const;
- const char* bootUUID() const;
void forEachMustBeMissingFile(void (^handler)(const char* path, bool& stop)) const;
void forEachSkipIfExistsFile(void (^handler)(const SkippedFile& file, bool& stop)) const;
void forEachEnvVar(void (^handler)(const char* keyEqualValue, bool& stop)) const;
bool hasInterposings() const;
bool hasProgramVars(uint32_t& runtimeOffset) const;
- static bool buildClosureCachePath(const char* mainExecutablePath, char closurePath[], const char* tempDir,
- bool makeDirsIfMissing);
+ static bool buildClosureCachePath(const char* mainExecutablePath, const char* envp[],
+ bool makeDirsIfMissing, char closurePath[]);
private:
friend class LaunchClosureWriter;