Loading...
src/ImageLoader.cpp dyld-46.16 dyld-44.2
--- dyld/dyld-46.16/src/ImageLoader.cpp
+++ dyld/dyld-44.2/src/ImageLoader.cpp
@@ -48,7 +48,7 @@
 uint64_t								ImageLoader::fgTotalNotifyTime;
 uint64_t								ImageLoader::fgTotalInitTime;
 uintptr_t								ImageLoader::fgNextSplitSegAddress = 0x90000000;
-uintptr_t								Segment::fgNextNonSplitSegAddress = 0x8F000000;
+uintptr_t								Segment::fgNextNonSplitSegAddress = 0x8FE00000;
 
 
 
@@ -722,10 +722,8 @@
 		throwf("realpath() failed on %s, errno=%d", this->getPath(), errno);
 	}
 	// recreate temp file name
-	char tempFilePath[PATH_MAX];
-	char suffix[64];
-	sprintf(suffix, "_redoprebinding%d", getpid());
-	ImageLoader::addSuffix(realFilePath, suffix, tempFilePath);
+	char tempFilePath[strlen(realFilePath)+strlen("_redoprebinding")+2];
+	ImageLoader::addSuffix(realFilePath, "_redoprebinding", tempFilePath);
 
 	if ( commit ) {
 		// all files successfully reprebound, so do swap
@@ -765,10 +763,8 @@
 	if ( realpath(this->getPath(), realFilePath) == NULL ) {
 		throwf("realpath() failed on %s, errno=%d", this->getPath(), errno);
 	}
-	char tempFilePath[PATH_MAX];
-	char suffix[64];
-	sprintf(suffix, "_redoprebinding%d", getpid());
-	ImageLoader::addSuffix(realFilePath, suffix, tempFilePath);
+	char tempFilePath[strlen(realFilePath)+strlen("_redoprebinding")+2];
+	ImageLoader::addSuffix(realFilePath, "_redoprebinding", tempFilePath);
 
 	// make copy of file and map it in
 	uint8_t* fileToPrebind;
@@ -847,7 +843,7 @@
 	struct statfs statfs_buf;
 	if ( fstatfs(dst, &statfs_buf) != 0 )
 		throwf("can't fstatfs(), errno=%d for %s", errno, tempFile);
-	uint64_t freespace = (uint64_t)statfs_buf.f_bavail * (uint64_t)statfs_buf.f_bsize;
+	uint64_t freespace = statfs_buf.f_bavail * statfs_buf.f_bsize;
 	
 	// closing notes:  
 	//		ok to close file after mapped in
@@ -867,7 +863,7 @@
 	if ( sUnitsPerSecond == 0 ) {
 		struct mach_timebase_info timeBaseInfo;
 		if ( mach_timebase_info(&timeBaseInfo) == KERN_SUCCESS ) {
-			sUnitsPerSecond = 1000000000ULL * timeBaseInfo.denom / timeBaseInfo.numer;
+			sUnitsPerSecond = timeBaseInfo.denom;
 		}
 	}
 	if ( partTime < sUnitsPerSecond ) {
@@ -879,7 +875,7 @@
 	}
 	else {
 		uint32_t secondsTimeTen = (partTime*10)/sUnitsPerSecond;
-		uint32_t seconds = secondsTimeTen/10;
+		uint32_t seconds = secondsTimeTen/100;
 		uint32_t percentTimesTen = (partTime*1000)/totalTime;
 		uint32_t percent = percentTimesTen/10;
 		fprintf(stderr, "%s: %u.%u seconds (%u.%u%%)\n", msg, seconds, secondsTimeTen-seconds*10, percent, percentTimesTen-percent*10);
@@ -913,7 +909,7 @@
 	fprintf(stderr, "total images loaded:  %d (%d used prebinding)\n", imageCount, fgImagesWithUsedPrebinding);
 	printTime("total images loading time", fgTotalLoadLibrariesTime, totalTime);
 	fprintf(stderr, "total rebase fixups:  %s\n", commatize(fgTotalRebaseFixups, commaNum1));
-	printTime("total rebase fixups time", fgTotalRebaseTime, totalTime);
+	printTime("total rebase fixups time", fgTotalRebaseFixups, totalTime);
 	fprintf(stderr, "total binding fixups: %s\n", commatize(fgTotalBindFixups, commaNum1));
 	printTime("total binding fixups time", fgTotalBindTime, totalTime);
 	fprintf(stderr, "total bindings lazily fixed up: %s of %s\n", commatize(fgTotalLazyBindFixups, commaNum1), commatize(fgTotalPossibleLazyBindFixups, commaNum2));