Subject: Re: when to rebase?
From: Jason Tishler <[email-masked]>
To: "Peter A. Castro" <[email-masked]>
Cc: [email-masked]
Date: Tue, 24 Feb 2004 16:11:12 -0500

Peter,

On Fri, Feb 20, 2004 at 10:19:09PM -0800, Peter A. Castro wrote:
> On Fri, 20 Feb 2004, Jason Tishler wrote:
> > FWIW, I just tried the above with Microsoft's rebase and observed
> > the same behavior.  Note this is not a "ruling" just another data
> > point.
> 
> Well, considering what the root problem is, I wouldn't expect MS's
> rebase to work any better than the cygwin version.

Understood.  However, one of my design goals for rebase was to behave as
similar to Microsoft's as possible.  This became especially true when I
replaced Microsoft's ReBaseImage() with the one from Ralf Habacker's
libimagehelper.

> However, I would like to see some cooperation on how to resolve it.

See below for one possible solution...

> This problem is not specific to zsh.

Understood.

> It has more to do with how exported symbols are treated/managed.

Or built...

> I'd almost propose that rebase change such symbols' value, being
> rebase is the one changing the image base of the dll in the first
> place.

Do others agree?  If so, does anyone know how hard it would be to enhance
libimagehelper to handle this case?

> However, I would really like to understand why this symbol exists and
> if there is some way to eliminate it and use the dll's real image base
> instead.

It appears that dllwrap *may* be the culprit.  If I replace dllwrap with
gcc -shared in your testscript, then the problem is avoided.  See
attached patch for the details.

Can you use gcc -shared instead of dllwrap when you build zsh?

Thanks,
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
--- testscript.sh.orig	2004-02-24 15:52:50.398697600 -0500
+++ testscript.sh	2004-02-24 15:53:52.097416000 -0500
@@ -34,7 +34,7 @@
 echodo "gcc -g -c testdll.c"

 echo "## Creating testdll.dll"

-echodo "dllwrap -g --export-all-symbols -o testdll.dll testdll.o -lc"

+echodo "gcc -shared -g -o testdll.dll testdll.o -lc"

 echo "## Compiling testmain.c -> testmain.o"

 echodo "gcc -g -c testmain.c"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/