This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: using templates in shared library
- To: Kasper Peeters <K dot Peeters at damtp dot cam dot ac dot uk>
- Subject: Re: using templates in shared library
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 09 Dec 1998 09:11:31 -0200
- Cc: egcs at egcs dot cygnus dot com
- References: <13933.222.720498.990735@hopf.amtp.cam.ac.uk>
On Dec 8, 1998, Kasper Peeters <K.Peeters@damtp.cam.ac.uk> wrote:
> I have a shared library which contains instances of my template
> classes; 'nm --dynamic --defined' shows them as W, weak symbols. When
> I use these template classes in a second library and then link with
> the first one, the second library _still_ contains instances of these
> templates too! (ie. nm shows exactly the same 'W' symbols).
that's because the component object files contain those symbols
already. I don't think the linker should remove those symbols from
a shared library; can you think of the implications of replacing the
other library your library depended upon?
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil