5 May 2010 18:54
Re: CFA: pseudo-reloc v2
Dave Korn <dave.korn.cygwin <at> googlemail.com>
2010-05-05 16:54:29 GMT
2010-05-05 16:54:29 GMT
[ redirected from cygwin-developers. ]
On 04/10/2009 05:11, Charles Wilson wrote:
[ thread seriously necro'd! ]
> Dave Korn wrote:
>> Charles Wilson wrote:
>>> 120 void
>>> 121 _pei386_runtime_relocator ()
>>> 122 {
>>> 123 static int was_init = 0;
>>> 124 if (was_init)
>>> 125 return;
>>> 126 ++was_init;
>>> 127 do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__,&__RUNTIME_PSEUDO_RELOC_LIST_END__,&_image_base__);
>>> 128 }
>> Maybe that static should be NO_COPY? If everything gets remapped in the
>> forkee, do the relocs need rerunning? (I'm not sure about the behaviour of
>> NtCreateProcess w.r.t modified .text section pages.)
>
> Good guess! With the following patch, all of these fork tests perform
> as expected.
Aha, not so good as all that after all! We need to re-apply relocs in the
forkee - but only if they *don't* point to regions covered by the .data/.bss
section copying at startup. Argh!
> One oddity; it turns out that __INSIDE_CYGWIN__ is not
> defined inside pseudo-reloc.c, so I used __CYGWIN__ as a guard.
Dunno if we ever went into that, but it's right; pseudo-reloc.o is part of
the CRT in winsup/cygwin/lib/, and is linked statically into every exe and
(Continue reading)
RSS Feed