This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Shared library compilation



> Is there a particular reason why gcc -shared calls ld with all the
> crt*.o files?  What happens is that when I build a shared library this
> way, even on a 900 byte .o file, the shared library is 32 K. 
> If I build the shared library with ld -shared (gnu linker, btw), it doesn't
> bring in these files.

On ELF, this is needed so that the .ctors and .dtors sections get
combined and referenced from a suitable .init section. Pretty much the
same holds for the exception handling support code.

Regards,
Martin