Re-enabled bytepair compression support in chkdeps.
authorTom Sutcliffe <thomas.sutcliffe@accenture.com>
Wed, 20 Oct 2010 10:11:55 +0100
changeset 72 ce94bcf3f672
parent 69 849a0b46c767
child 74 4429a6c63207
Re-enabled bytepair compression support in chkdeps. Seems it was a bug in the loader code, producing an incorrect error, that led me to disabole it originally. Commented out the apparently-incorrect check, which means theoretically some corrupt binaries won't get picked up during decompression. Which probably doesn't matter much.
commands/chkdeps/chkdeps.cpp
commands/chkdeps/sf_pgcompr.cpp
documentation/change_history.pod
--- a/commands/chkdeps/chkdeps.cpp	Sun Oct 17 18:43:12 2010 +0100
+++ b/commands/chkdeps/chkdeps.cpp	Wed Oct 20 10:11:55 2010 +0100
@@ -202,6 +202,7 @@
 		}
 	}
 
+// Adapted from E32Image::LoadFileBytePairUnpakL()
 void CDllChecker::LoadFileBytePairL(const E32ImageHeaderComp* aHeader, RBuf8& aCode, RBuf8& aRestOfFile)
 	{
 	TInt pos = aHeader->TotalSize();
@@ -245,11 +246,10 @@
 		{
 		LoadFileInflateL(aHeader, aCode, aRestOfFile);
 		}
-	/*TOMSCI TODO doesn't seem to work...
 	else if (aCompression == KUidCompressionBytePair)
 		{
 		LoadFileBytePairL(aHeader, aCode, aRestOfFile);
-		}*/
+		}
 	else
 		{
 		LeaveIfErr(KErrNotSupported, _L("Compression type 0x%x is not supported"), aCompression);
--- a/commands/chkdeps/sf_pgcompr.cpp	Sun Oct 17 18:43:12 2010 +0100
+++ b/commands/chkdeps/sf_pgcompr.cpp	Wed Oct 20 10:11:55 2010 +0100
@@ -108,12 +108,10 @@
 	User::LeaveIfError(size);
 	if (size != aLength)
 		LEAVE_FAILURE(KErrCorrupt);
-	if (iNextPage + iIndexTable[aPageNum] != nextPage)
-		StaticLeaveIfErr(KErrCorrupt, _L("nextPage is %x, expected %x for pagenum %d"), nextPage, iNextPage + iIndexTable[aPageNum], aPageNum);
+//	if (iNextPage + iIndexTable[aPageNum] != nextPage)
+//		StaticLeaveIfErr(KErrCorrupt, _L("nextPage is %x, expected %x for pagenum %d"), nextPage, iNextPage + iIndexTable[aPageNum], aPageNum);
 //		LEAVE_FAILURE(KErrCorrupt);
 
-//TOMSCI	IoUtils::CCommandBase::Static().Printf(_L("nextPage is 0x%08x, iNextPage+%d\r\n"), nextPage, nextPage - iNextPage);
-
 	// If a memmove() was provided, use that to copy the data to its final target
 	if (aMemMoveFn)
 		aMemMoveFn(aTarget, iPageBuf, size);
--- a/documentation/change_history.pod	Sun Oct 17 18:43:12 2010 +0100
+++ b/documentation/change_history.pod	Wed Oct 20 10:11:55 2010 +0100
@@ -38,6 +38,10 @@
 
 Added support for beagleboard to sf\3tshell platform.
 
+=item *
+
+Updated chkdeps command so that it works with byte-pair compressed binaries (experimental).
+
 =back
 
 =head2 Release 001