public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* rebase-0.4 patch
@ 2002-12-03 13:25 Jason Tishler
       [not found] ` <00d101c29b60$ca190c00$0a1c440a@BRAMSCHE>
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Tishler @ 2002-12-03 13:25 UTC (permalink / raw)
  To: Ralf Habacker; +Cc: Cygwin

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

Ralf,

The attached patch changes your version of rebase as follows:

    1. Round NewImageSize (to the nearest 0x10000) to be consistent
       with MS's rebase.
    2. Fix bug when rebasing up.

Are you willing to accept these changes -- in particular, #2?

If so, then I would like to offer the following too:

    1. gcc 3.2 patches (completed)
    2. conversion to librebase.a patch (to be completed)

My plan is as follows:

    1. Convert your rebase into a library, librebase.a.
    2. Merge librebase.a with my stand-alone, non-persistent rebase.
    3. Release this rebase so there is one version that supports all
       users (including Me) and all DLLs (including ones that need
       fix-up due to stripping).
    4. Merge the above into my stand-alone, persistent rebase.
    5. Submit a setup.exe patch with the above functionality.
    6. When setup.exe patch is accepted, release stand-alone, persistent
       rebase that can be used for DLLs not installed by setup.exe.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

[-- Attachment #2: rebase.cc.diff --]
[-- Type: text/plain, Size: 717 bytes --]

--- ../rebase-ralf-0.4.orig/rebase.cc	2002-08-10 17:41:40.000000000 -0400
+++ rebase.cc	2002-12-03 15:35:24.000000000 -0500
@@ -113,8 +113,16 @@ BOOL ReBaseImage(
 	*OldImageSize = ntheader->OptionalHeader.SizeOfImage; 
 	*NewImageSize = ntheader->OptionalHeader.SizeOfImage; 
 
+	// Round NewImageSize to be consistent with MS's rebase.
+	const ULONG imageSizeGranularity = 0x10000;
+	ULONG remainder = *NewImageSize % imageSizeGranularity;
+	if (remainder)
+		*NewImageSize = (*NewImageSize - remainder) + imageSizeGranularity;
+
 	if (fGoingDown)
 		*NewImageBase -= *NewImageSize; 
+	else
+		*NewImageBase += *NewImageSize; 
 		
 	// already rebased 
 	if (ntheader->OptionalHeader.ImageBase == *NewImageBase) {


[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-12-06 13:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-03 13:25 rebase-0.4 patch Jason Tishler
     [not found] ` <00d101c29b60$ca190c00$0a1c440a@BRAMSCHE>
2002-12-04 12:50   ` Jason Tishler
2002-12-04 13:01     ` Robert Collins
2002-12-04 13:06       ` Christopher Faylor
2002-12-06  5:45         ` Jason Tishler
2002-12-05  0:20     ` Ralf Habacker
2002-12-05  0:43       ` Robert Collins
2002-12-05  0:50         ` Ralf Habacker
2002-12-05  2:31           ` Robert Collins
2002-12-05  0:54         ` Ralf Habacker
2002-12-05  1:46           ` Robert Collins
2002-12-05  3:45             ` Jason Tishler
2002-12-05  8:20               ` Ralf Habacker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).