Index: NEWS
===================================================================
RCS file: /cvs/cygwin-apps/rebase/NEWS,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- NEWS	20 Jun 2011 23:55:32 -0000	1.2
+++ NEWS	5 Aug 2011 15:43:23 -0000	1.3
@@ -1,4 +1,12 @@
-$Id: NEWS,v 1.2 2011/06/20 23:55:32 cwilson Exp $
+$Id: NEWS,v 1.3 2011/08/05 15:43:23 cwilson Exp $
+
+x.y.z
+==============================================================================
+    * rebase and peflags now support operations on 64bit objects
+    * New database functionality (see README)
+    * New developer application rebase-dump for displaying database contents
+    * New platform support: x86_64-w64-mingw32, i686-pc-msys
+    * Many algorithm improvements
 
 3.0.2
 ==============================================================================
Index: README
===================================================================
RCS file: /cvs/cygwin-apps/rebase/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- README	20 Jun 2011 14:22:01 -0000	1.1
+++ README	5 Aug 2011 15:43:23 -0000	1.2
@@ -1,7 +1,7 @@
 $Id: README,v 1.17 2009/04/05 13:25:43 jt Exp $
 
 Abstract:
-===================================================================
+================================================================================
 The Cygwin rebase distribution contains four utilities, rebase, rebaseall,
 peflags, and peflagsall.  The first utility is modeled after Microsoft's SDK
 rebase.  However, instead of linking rebase against Microsoft's imagehlp
@@ -15,10 +15,14 @@ The following are the advantages of usin
        therefore cannot be used in an application that is dependent on
        another C runtime (i.e., Cygwin).
 
-    2. rebase can be used on Windows Me.  For some reason, Microsoft's
+    2. With recent improvements, libimagehelper supports operations on
+       64bit objects, and can itself be compiled as either a 32bit or
+       64bit library.
+
+    3. rebase can be used on Windows Me.  For some reason, Microsoft's
        imagehlp.dll does not function properly on this platform.
 
-    3. Ralf's imagehelper library also provides FixImage() which fixes
+    4. Ralf's imagehelper library also provides FixImage() which fixes
        bad relocations in DLLs that can be caused by stripping.
 
 I would like to thank Ralf Habacker for providing the imagehelper
@@ -32,7 +36,7 @@ facility on Windows Vista and later.
 
 
 Background
-===================================================================
+================================================================================
 The rebaseall utility is a convenient way for users that suffer from the
 Cygwin rebase problem to rebase their entire system (i.e., all of their
 DLLs).  The following is a list of known Cygwin applications that are
@@ -81,33 +85,45 @@ cause Windows to take notice.
 
 
 Requirements:
-===================================================================
-The following packages or later are required to build and/or execute
-Cygwin rebase and/or rebaseall:
-
-    ash 20040127-3
-    binutils 20060709-1
-    cygwin 1.5.20-1
-    fileutils 4.1-3
-    gcc 3.4.4-1
-    grep 2.5.1a-2
-    gzip 1.3.5-2
-    sed 4.1.5-1
-    w32api 3.13-1
-
+================================================================================
+The following packages or later are required to build and/or execute Cygwin
+rebase/peflags, and/or rebaseall/peflagsall:
+
+    binutils             2.20.51-2
+    cygwin               1.7.9-1
+    dash                 0.5.6.1-2
+    gcc4                 4.3.4-4
+    coreutils            8.10-1
+    grep                 2.6.3-1
+    gzip                 1.4-1
+    sed                  4.2.1-1
+    w32api               3.17-2
 
 Install:
-===================================================================
+================================================================================
 Cygwin rebase does not require any special installation procedures.
 
+If the database is used, Cygwin and MSYS rebase will expect to find the
+databases:
+    /etc/rebase.db.i386
+    /etc/rebase.db.x86_64
+For MinGW, the database location is deduced as
+    <location-of-rebase.exe>/../etc/rebase.db.i386
+    <location-of-rebase.exe>/../etc/rebase.db.x86_64
+
+rebaseall, by default, uses the database.
+
 
 Usage:
-===================================================================
+================================================================================
 Use the following procedure to rebase your entire system:
 
     1. shutdown all Cygwin processes and services
-    2. start ash (do not use bash or rxvt)
-    3. execute /bin/rebaseall (in the ash window)
+    2. start ash or dash (do not use bash or a terminal emulator like rxvt
+       or mintty). The easiest way to do this is to use Windows Explorer
+       and navigate to the top level of your cygwin installation, and
+       double-click ash.exe or dash.exe in the bin/ directory.
+    3. execute /bin/rebaseall (in the ash/dash window)
 
 If you get any errors due to DLLs being in-use or read-only, then take the
 appropriate action and rerun rebaseall.  Otherwise, you run the risk of fork()
@@ -117,7 +133,10 @@ Use a similar procedure to set the pefla
 dlls on your entire system:
 
     1. shutdown all Cygwin processes and services
-    2. start ash (do not use bash or rxvt)
+    2. start ash or dash (do not use bash or a terminal emulator like rxvt
+       or mintty). The easiest way to do this is to use Windows Explorer
+       and navigate to the top level of your cygwin installation, and
+       double-click ash.exe or dash.exe in the bin/ directory.
     3. execute /bin/peflagsall (in the ash window)
 
 Both procedures may be combined into a single, 4-step procedure if desired.
@@ -142,24 +161,34 @@ to the existing default set of suffixes.
 the next section.
 
 Command line syntax
-===================================================================
+================================================================================
 
 rebaseall
--------------------------------------------------------------------
+--------------------------------------------------------------------------------
 The following is the rebaseall command line syntax:
 
-    rebaseall [-b BaseAddress] [-o Offset] [-T FileList | -] [-v]
+    rebaseall [-b BaseAddress] [-o Offset] [-s DllSuffix] [-T FileList | -] [-4|-8] [-v]
 
 where:
 
     -b => base address used by rebase (default: 0x70000000)
-    -o => offset between each DLL rebased (default: 0x10000)
+    -o => offset between each DLL rebased (default: 0x10000 MinGW/MSYS, 0x0 Cygwin)
     -s => specify DLL suffix, use multiple if necessary (default: dll, so)
     -T => specify filelist (or stdin) to list additional files
+    -4 => operate only on 32bit objects (ignore 64bit objects) (*)
+    -8 => operate only on 64bit objects (ignore 32bit objects) (*)
     -v => verbose (default: off)
 
+(*) -4 and -8 are mutually exclusive. -4 is the default if rebaseall is
+    executed in a 32bit environment; -8 is the default if rebaseall is executed
+    64bit environment.
+
+rebaseall now uses the database functionality provided by rebase. See the
+description below.
+
+
 peflagsall
--------------------------------------------------------------------
+--------------------------------------------------------------------------------
 The following is the peflagsall command line syntax:
 
     peflagsall [-p extra_args] [-d bool] [-t bool] [-s suffix] [-T FileList | -] [-vnh]
@@ -185,46 +214,94 @@ The following is the peflagsall command 
           it set the tsaware flag on dlls. If you must do this, use peflags itself
 
 rebase
--------------------------------------------------------------------
+--------------------------------------------------------------------------------
 The following is the rebase command line syntax:
 
-    rebase -b BaseAddress [-Vdv] [-o Offset] [-T FileList | -] Files...
-
-where:
+    rebase [OPTIONS] [FILE]...
+    Rebase PE files, usually DLLs, to a specified address or address range.
+    
+      -4, --32                Only rebase 32 bit DLLs. (*)
+      -8, --64                Only rebase 64 bit DLLs. (*)
+      -b, --base=BASEADDRESS  Specifies the base address at which to start rebasing.
+      -s, --database          Utilize the rebase database to find unused memory
+                              slots to rebase the files on the command line to.
+                              (Implies -d).
+                              If -b is given, too, the database gets recreated.
+      -i, --info              Rather then rebasing, just print the current base
+                              address and size of the files.  With -s, use the
+                              database.  The files are ordered by base address.
+                              A '*' at the end of the line is printed if a
+                              collisions with an adjacent file is detected.
+    
+      One of the options -b, -s or -i is mandatory.  If no rebase database exists
+      yet, -b is required together with -s.
+    
+      -d, --down              Treat the BaseAddress as upper ceiling and rebase
+                              files top-down from there.  Without this option the
+                              files are rebased from BaseAddress bottom-up.
+                              With the -s option, this option is implicitly set.
+      -o, --offset=OFFSET     Specify an additional offset between adjacent DLLs
+                              when rebasing.  Default is no offset.
+      -T, --filelist=FILE     Also rebase the files specified in FILE.  The format
+                              of FILE is one DLL per line.
+      -q, --quiet             Be quiet about non-critical issues.
+      -v, --verbose           Print some debug output.
+      -V, --version           Print version info and exit.
+      -h, --help, --usage     This help.
+
+(*) -4 and -8 are mutually exclusive. -4 is the default if rebase.exe itself
+    was compiled as a 32bit application; -8 is the default if rebase.exe is
+    a 64bit application.
+
+There are actually two separate database files, for 32bit and 64bit objects.
+On Cygwin and MSYS, these are:
+    /etc/rebase.db.i386
+    /etc/rebase.db.x86_64
+For MinGW, the database location is deduced as
+    <location-of-rebase.exe>/../etc/rebase.db.i386
+    <location-of-rebase.exe>/../etc/rebase.db.x86_64
+
+The (optional) database allows to easily rebase new DLLs so that they don't
+collide with other DLLs which already have been rebased.  Because rebaseall uses
+the database, rebaseall will now only rebase new DLLs, or those DLLs which
+have been updated -- e.g. their current ImageBase does not match the value in
+the database, or their size has changed (grown) such that they no longer 'fit'
+in the previously-assigned location. (If an updated DLL still fits in its
+previously-assigned location, it will be rebased back to that location).
+
+Thus, the (optional) database allows to keep an installation in a stable
+state, and only modifies the ImageBase of DLLs when absolutely necessary.
+A complete rebase can be forced by (a) specifying -b to either rebase.exe
+itself, or to rebaseall, or (b) deleting the existing database files and
+re-running rebase/rebaseall.
 
-    -b => base address used by rebase
-    -d => rebase down memory (default: up)
-    -o => offset between each DLL rebased
-    -T => specify filelist (or stdin) to list additional files
-    -V => display version and exit
-    -v => verbose (default: off)
 
 peflags
--------------------------------------------------------------------
+--------------------------------------------------------------------------------
 The following is the peflags command line syntax:
 
-    peflags [OPTIONS] file(s)...
+    Usage: peflags [OPTIONS] file(s)...
     Sets, clears, or displays various flags in PE files (that is,
     exes and dlls).  For each flag, if an argument is given, then
     the specified flag will be set or cleared; if no argument is
     given, then the current value of that flag will be displayed.
-
+    
       -d, --dynamicbase  [BOOL]   Image base address may be relocated using
                                   address space layout randomization (ASLR)
-          --forceinteg   [BOOL]   Code integrity checks are enforced
+      -f, --forceinteg   [BOOL]   Code integrity checks are enforced
       -n, --nxcompat     [BOOL]   Image is compatible with data execution
                                   prevention
-          --no-isolation [BOOL]   Image understands isolation but do not
+      -i, --no-isolation [BOOL]   Image understands isolation but do not
                                   isolate the image
-          --no-seh       [BOOL]   Image does not use SEH. No SE handler may
+      -s, --no-seh       [BOOL]   Image does not use SEH. No SE handler may
                                   be called in this image
-          --no-bind      [BOOL]   Do not bind this image
-          --wdmdriver    [BOOL]   Driver uses the WDM model
+      -b, --no-bind      [BOOL]   Do not bind this image
+      -W, --wdmdriver    [BOOL]   Driver uses the WDM model
       -t, --tsaware      [BOOL]   Image is Terminal Server aware
-          --wstrim       [BOOL]   Aggressively trim the working set.
-          --bigaddr      [BOOL]   The application can handle addresses
+      -w, --wstrim       [BOOL]   Aggressively trim the working set.
+      -l, --bigaddr      [BOOL]   The application can handle addresses
                                   larger than 2 GB
-          --sepdbg       [BOOL]   Debugging information was removed and
+      -S, --sepdbg       [BOOL]   Debugging information was removed and
                                   stored separately in another file.
       -T, --filelist FILE         Indicate that FILE contains a list
                                   of PE files to process
@@ -237,70 +314,71 @@ The following is the peflags command lin
               if not present, then display symbolicly the value of the flag
     Valid forms for short options: -d, -d0, -d1, -dfalse, etc
     Valid forms for long options :  --tsaware, --tsaware=true, etc
-    To set a value, and display the results symbolicly, repeat the option:
+    To set a value, and display the results symbolic, repeat the option:
       --tsaware=true --tsaware -d0 -d
 
-    
 Source:
-===================================================================
-Cygwin rebase builds OOTB under Cygwin.  With minor Makefile tweaking,
-it builds cleanly under Mingw too.
+================================================================================
+Cygwin rebase builds OOTB under Cygwin, MinGW, and MSYS. It also can be compiled
+using the 64bit mingw64 compiler: x86_64-w64-mingw32-gcc. Cross compilation is
+(somewhat) supported, but YMMV.
 
 
 Build:
-===================================================================
+================================================================================
 See build.sh in the source archive for my exact build recipe for configuring,
 making, and packaging this distribution.
 
 
 Test:
-===================================================================
+================================================================================
 rebase does not contain any regression tests.
 
-peflagsall may be invoked with the -n, -k, and -v options to 
-allow inspection of what it WOULD do, without actually doing it.
+peflagsall may be invoked with the -n, -k, and -v options to allow inspection
+of what it WOULD do, without actually doing it.
 
-peflags will make no changes to any files unless it is given an
-flagname argument *with* a boolean value for that flag (0 or 1).
-If no boolean argument is provided, then peflags will merely
-display the current value of the flag in the specified files.
+peflags will make no changes to any files unless it is given an flagname
+argument *with* a boolean value for that flag (0 or 1). If no boolean argument
+is provided, then peflags will merely display the current value of the flag in
+the specified files.
 
 
 Issues:
-===================================================================
+================================================================================
 The following are the known Cygwin rebase issues:
 
 1. rebase should be integrated with Cygwin's setup.exe.
 
 2. rebase does not handle in-use DLLs.
 
-3. rebase does not currently store the DLL base addresses in a database
-which would speed up and/or obviate subsequent rebases.
-
-4. rebase skips read-only DLLs.
+3. rebase skips read-only DLLs.
 
-Issues #1, #2, and #4 also apply to the peflags utility.
+Issues #1, #2, and #3 also apply to the peflags utility.
 
 
 Homepage:
-===================================================================
+================================================================================
 The primary rebase web site is:
 
     http://www.tishler.net/jason/software/rebase/
 
 
 Download:
-===================================================================
+================================================================================
 The primary rebase download site is:
 
     http://www.tishler.net/jason/software/rebase/
 
+Access to the CVS development sources is available:
+
+    cvs -d:pserver:anoncvs@cygwin.com:/cvs/cygwin-apps co rebase
+
 
 Mailing Lists:
-===================================================================
+================================================================================
 Please report problems, suggestions, etc. to <cygwin@cygwin.com>.
 
 
 Maintainer:
-===================================================================
+================================================================================
     Jason Tishler <jason@tishler.net>
