Mail Archives: cygwin-developers/1998/06/24/13:53:22
Date: Wed, 24 Jun 1998 15:30:11 -0500 (CDT)
From: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
>> Sergey wrote:
>>
>> If objects contains some sections not defined in linker's script, ld generates invalid executable :-(
>
> This can be fixed for particular sections in ld/scripttempl/pe.sc. It
> can be fixed in general in ld/emultempl/pe.em in the function
> gld_${EMULATION_NAME}_place_orphan. That function can arrange for the
> section to be properly aligned, or whatever.
>
But this shouldn't be an issue here since both .init and .fini *are*
mentioned in the linker script. There is a also the issue of readonly
data section I want to turn (.rdata is also in the script).
Hopefully I'm not missing the point here.
Both .init and .fini wind up in .text in the default linker script, so
the loader won't see them.
btw, does the .init and .fini sections in PE work the same way as on SVR4?
Not as far as I know. We could probably make cygwin32 implement this
if we wanted to. However, I don't think Windows will do it for us.
Windows implements a different mechanism: it calls the DLL entry point
when it is loaded and unloaded. That entry point can do whatever you
like.
Ian
- Raw text -