CFA: pseudo-reloc v2

Dave Korn dave.korn.cygwin@googlemail.com
Sun Oct 4 16:09:00 GMT 2009


Christopher Faylor wrote:
> On Sun, Oct 04, 2009 at 01:25:04PM +0200, Corinna Vinschen wrote:

>> So, actually fprintf(stderr) is more correct.  However, it's not safe to
>> assume that stdio has already been initialized when the runtime
>> relocator runs.  AFAICS, the relocator is called before dll_crt0_1 is
>> called and only in that latter function, the stdio descriptors are
>> initialized.
>>
>> Failing relocation is as bad as any other error starting an application.
>> Wouldn't it be the right thing to raise an exception, along the lines of
>> the Windows exception which is raised when a loadtime linked DLL can't
>> be loaded?
> 
> I'd feel more comfortable with a real error message, even if you have to
> use WriteConsole to display it.  Or, a real error message + an
> exception.

  We could set a flag that means "reloc (or other) failure during
statically-linked crt0 startup" and pass it to the DLL, which could then issue
any kind of nice error message it liked once it had initialised enough of the
system to do so nicely.

    cheers,
      DaveK



More information about the Cygwin-developers mailing list