public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* explicit template instances/vtables in named sections?
@ 1997-10-30  8:45 Mumit Khan
  0 siblings, 0 replies; only message in thread
From: Mumit Khan @ 1997-10-30  8:45 UTC (permalink / raw)
  To: egcs

For targets that support named/arbitrary sections, is there any way I
can tell g++ to create the code due explicit template instantiations in
named sections? Same for vtables.

The reason I may want to do this is the following: on cygwin32 target,
g++ creates implicitly defined template code in named sections (eg.,
.text$xyz, where xyz stands for the mangled name), marks the section
linkonce and makes symbols in these sections global. The PE linker is
smart enough to basically pick one of these and throw away the rest. In
a sense, these sections are "weak", but not the symbols themselves. Now
comes an explicit template instantiation, a template that has already
been defined in a named section in a different translation unit. This
new instance is not created in a named section and linker now barfs due
to multiply-defined global symbols.  If this explicit instance were to
be in a named section, perhaps marked to be linked once, then the PE
linker should be able just pick one and it'll feel like an ELF system.

Does this make any sense?

Currently the template code is broken on cygwin32 target unless you
apply my recently posted patch to revert to *not* using named sections,
and hence lose the benefits of section discarding.

Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-10-30  8:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-30  8:45 explicit template instances/vtables in named sections? Mumit Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).