This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rebase] Add a rebase database to keep track of DLL addresses


On Wed, Jun 29, 2011 at 05:36:15PM +0200, Corinna Vinschen wrote:
>Hi Jason, Hi Chuck,
>
>
>here's a patch which adds a new functionality to rebase.  If you add the
>-s parameter to the command line, rebase will utilize a file
>"/etc/rebase.image_info" to keep track of DLL addresses.  This allows
>easily to rebase new DLLs so that they don't collide with other DLLs
>which already have been rebased.  But the algorithm doesn't rely only
>on the database info.  It performs a couple of checks to test if the
>database is actually in a state which matches reality.  For instance,
>if you installed a new distro DLL, say, cygz.dll, and the new DLL has
>another address than the one in the database, cygz.dll will be rebased
>back to its spot as noted in the database if possible, even if it
>has not been specified on the command line.
>
>So the database allows to keep an installation in a stable state, plus
>it allows to add DLLs to the database and rebase it so it doesn't collide
>with already existing DLLs.
>
>When you use the -s option the first time, you *must* specify a base
>address, like this:
>
>  rebase -s -b 0x70000000 -T distro-dll-list
>
>In subsequent calls you should omit the base address.  In that case
>rebase will use the base address as stored in the database.  However,
>you can also use another base address.  This will override the base
>address in the database and start the rebasing from scratch, with all
>files in the database plus all files given on the command line.
>Analogous operation for the offset value.
>
>So far the database method implies down_flag == TRUE.  It shouldn't be
>too hard to implement the database algorithm with down_flag == FALSE,
>but for now I was just too lazy.
>
>Additionally I implemented a -h flag which prints the usage in more
>detail.
>
>I also changed rebaseall to use the -s flag now.  I'm not sure if
>that's wanted already, but this new functionality needs more testing
>of course.  It works for me(TM).
>
>I hope the patch is ok.  I tried to take MSYS and Mingw into account,
>but I'm not sure I succeeded completely.  The required changes shouldn't
>be too tricky, though.

Does this patch take into account changes in dll size so that if, e.g.,
cygz.dll doubles in size rebase will not try to force it into the same
hole?

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]