On Mon, Nov 25, 2002 at 03:31:06PM +0300, egor duda wrote: >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.
So, the above paragraph is a "yes" then. >>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. Ok. >>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. Ok. >>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? I meant the application, as in the application does the fixups. But that was a thinko on my part. >>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. Did you look at the cygwin_dll.h file? Are you saying that you don't think the call should go there? cgf