delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/01/24/12:45:09

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Date: Thu, 24 Jan 2002 12:49:52 -0500
From: Jason Tishler <jason AT tishler DOT net>
To: Cygwin-Apps <cygwin-apps AT sources DOT redhat DOT com>
Subject: Rebase Status
Message-ID: <20020124174951.GA2600@dothill.com>
Mail-Followup-To: Cygwin-Apps <cygwin-apps AT sources DOT redhat DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.24i

--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Since I'm around half way done, I decided to post a status report to let
people know that I'm still working on this...

I have implemented the following:

    main ()
    {
      for dll in dlls
        rebase (dll)
    }
  
    rebase (dll)
    {
      sz = image_size (dll)
      find slot of size sz in free_list and remove slot from free_list
      add slot to used_list
      rebase_image (dll)
    }

The free and used lists are persisted in a file called rebase.conf which will
be ultimately stored in /etc/setup.  Attached is a sample.

I will be implementing the un-rebase and re-rebase functionality next:

    unrebase (dll)
    {
      find dll in used_list and remove from used_list
      add slot to free_list
    }

    rerebase (dll)
    {
      find dll in used_list
      if (old image size == new image size)
        rebase_image (dll)
      else
        unrebase (dll)
        rebase (dll)
    }

Note that I have skipped executables (even though suggested by Rob),
because AFAICT that are *not* rebase-able.  I have also skipped DLL
dependency checking too.  You have to crawl, before you can walk, before
you can run...

I have decided to develop using a stand-alone Mingw (i.e., -mno-cygwin) app
instead of integrating directly into setup.exe for the following reasons:

    o speed development
    o prevent whacking my Cygwin installation
    ? possibly this stand-alone rebase could be used as a one-shot to
      rebase existing Cygwin installations
    ? possibly this stand-alone rebase should be the "real" rebase tool that
      is part of the standard Cygwin distribution (as opposed to my previous
      versions)
    ? possibly setup.exe should call rebase.exe to minimize impact on size
      (although the current stripped size is ~31K)

Any comments on the items above marked by "?" would be appreciated.

BTW, the attached (untried) "patch" demonstrates how one could integrate
this new rebase functionality into setup.exe.

I can post the source if anyone is interested in checking it out.
Otherwise, I will post it when full functionality is achieved.

Thanks,
Jason

--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rebase.conf"

[Free List]
0x78000000	0x7fee0000
0x5f000000	0x70000000
0x00400000	0x50000000

[Used List]
C:\home\jtishler\src\setup-rebase\cygcrypto.dll	0x7ff50000	0x000b0000
C:\home\jtishler\src\setup-rebase\cygssl.dll	0x7ff10000	0x00040000
C:\home\jtishler\src\setup-rebase\cygz.dll	0x7fee0000	0x00030000


--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rebase.diff"

Index: install.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
retrieving revision 2.37
diff -u -p -r2.37 install.cc
--- install.cc	2002/01/22 11:35:10	2.37
+++ install.cc	2002/01/24 17:32:12
@@ -291,6 +291,7 @@ install_one_source (packagemeta & pkgm, 
 		    }
 		}
 	    }
+	  rebaser::get_instance ()->rebase (concat (prefixPath, fn));
 
 	  progress (tmp->tell ());
 	  num_installs++;
Index: package_meta.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/package_meta.cc,v
retrieving revision 2.15
diff -u -p -r2.15 package_meta.cc
--- package_meta.cc	2002/01/22 09:03:55	2.15
+++ package_meta.cc	2002/01/24 17:32:12
@@ -168,6 +168,7 @@ packagemeta::uninstall ()
 	      SetFileAttributes (d, dw & ~FILE_ATTRIBUTE_READONLY);
 	      DeleteFile (d);
 	    }
+	  rebaser::get_instance ()->unrebase (d);
 	  /* Check for Windows shortcut of same name. */
 	  d = concat (d, ".lnk", NULL);
 	  dw = GetFileAttributes (d);

--lEGEL1/lMxI0MVQ2--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019