This is the mail archive of the cygwin-apps@cygwin.com 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: [ANNOUNCEMENT] Updated: binutils-20021117-1


Hi!

Friday, 22 November, 2002 Christopher Faylor cgf@redhat.com wrote:

CF> On Tue, Nov 19, 2002 at 12:06:59PM +0300, egor duda wrote:
>>Tuesday, 19 November, 2002 Christopher Faylor cygwin@cygwin.com wrote:
>>
>>CF> I've made a new version of binutils available for download.  This is
>>CF> just a refresh from sources.redhat.com.  A notable change is the
>>CF> addition of Egor Duda's --enable-runtime-pseudo-reloc option which
>>CF> allows almost transparent linking of dll's without the need of a def
>>CF> file.  However, this option requires functionality in the cygwin DLL
>>CF> which is not yet present.  Stay tuned.
>>
>>Ok, it's time to revive a discussion about implementation of
>>pseudo-relocations in runtime. So far, there were 3 propositions:

CF> Did you see my questions in cygwin-patches?  I replied YA to your
CF> original patch submission last Friday.

I'm terribly sorry, I've missed them somehow. I'll try to answer here.

Chris Faylor wrote:
>I can see code in dll_crt0_1 being called for handling relocs.  Is it
>your intent that every new DLL will have to specifically call
>_pei386_runtime_relocator?

The dll may have its own pseudo-relocs. When app.exe uses x1.dll
which in turn uses x2.dll. Now, imagine x1.dll references some data in
x2.dll with addend. That means that when linking x1.dll ld will
generate pseudo-reloc, which have to be resolved when x1.dll is
loaded. I suppose that dll_crt0_1 is the place to handle this, but, of
course i may be wrong.

>I can see that over ld-land you are generating an undefined reference for
>this symbol if the --enable-runtime-pseudo-reloc switch is used.

Not exactly. The reference is generated whenever --enable-runtime-pseudo-reloc
switch is used _and_ at least one pseudo-reloc is generated.

>Is this just to ensure that there is an error message when linking with a new
>version of binutils but an older version of a dll that's being built?

The idea is to produce link-time error when we build final binary and
link it with runtime library. If the binary has at least one
pseudo-reloc then runtime ought to have support for them. This means
that either libcygwin.a or crt0.o or whatever object file placed in
gcc's spec file to be linked in when final binary is built, has to
export _pei386_runtime_relocator.

>I was thinking that a call to this code would live in the application
>but obviously that's wrong.  It has to live in the DLL.

You mean cygwin1.dll here, right? Or client dll application is linked
with?

>Wouldn't that mean that it should be added somehow to _cygwin_dll_entry
>winsup/cygwin/include/cygwin/cygwin_dll.h ?

It only have to be called during application (or library, in case of
 app.exe->x1.dll->x2.dll) initialization. I'm getting little confused
now as to where this call should be placed. Actually, i was thinking
there's little difference, it just have to be the code which is called
at startup before main() and constructors.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


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