This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: using templates in shared library


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]