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: Instantiating templates in a shared library



On Mar 16, 1999, mrs@wrs.com (Mike Stump) wrote:

>> Date: Tue, 16 Mar 1999 18:19:52 +0100
>> From: Jon Brumfitt <jbrumfit@estsa2.estec.esa.nl>

>> within a shared library - the templates get instantiated in each
>> executable that uses the library

> If you use linkonce, the stuff will come out in .o files, but it
> should not be used (the content should not make it into the a.out).
> (If I understand linkonce and shared libs.)

I'm not sure discarding the definitions from the executable would be a 
good idea, even if they're available in some shared library it links
with, because the shared library might be upgraded in a way that it
doesn't include all symbols it originally did, and then the program
would stop working.

You might argue that this would be an incompatible change in the
library, so its major version number should have been changed, but
since automatic template instantiation takes place automatically,
people are unlikely to care about such template instantiations when
considering whether to increase the major or the minor version number
of the library.

OTOH, not instantiating the symbols in the shared library wouldn't
work if the program didn't happen to instantiate them itself.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil
*** E-mail about software projects will be forwarded to mailing lists