This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ and link once sections.
- To: knk at dde dot dk
- Subject: Re: g++ and link once sections.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 1 Apr 2000 11:54:56 +0200
- CC: gcc at gcc dot gnu dot org
- References: <38E2BE7D.5F2AE662@dde.dk>
> But when I i compiled a couple of object files having template code the
> resulting .o files do not have these sections . Am I missing out any
> other macros that are related to this ??
A number, including SUPPORTS_ONE_ONLY, SUPPORTS_WEAK, as well as the
setting of flag_weak. I'd really recommend to analyse this in a
debugger; set a breakpoint on supports_one_only, comdat_linkage, and
make_decl_one_only.
> Secondly I would like to know, is this a _must_ for templates ??
No. You can make the templates static if you want. This increases code
size, of course. The only thing that might not work is block-static
variables in templates: for a specific instantiation, they should be
shared across translations units.
Regards,
Martin