From 0524c91d1eee6dc2f1629160ed309a5441fb3bdd Mon Sep 17 00:00:00 2001 From: Matt Austern Date: Thu, 3 Jun 2004 23:15:01 +0000 Subject: re PR c++/15428 (vtables shouldn't always be weak on Darwin) PR c++/15428 * default.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): New name for TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, with reversed sense. * config/darwin.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Likewise. * doc/tm.texi (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Rewrite documentation to reflect the new macro name and to clarify its meaning. * cp/decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC is nonzero, and if we see a noninline definition of a key method, make the vtables nonweak. From-SVN: r82610 --- gcc/doc/tm.texi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index aee7ba8..082de59 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -6753,13 +6753,23 @@ commands that will make the symbol(s) associated with @var{decl} have hidden, protected or internal visibility as specified by @var{visibility}. @end deftypefn -@defmac TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY +@defmac TARGET_WEAK_NOT_IN_ARCHIVE_TOC A C expression that evaluates to true if the target's linker expects -explicit template specializations, as well as implicit, to be given -linkonce semantics. The default is @code{1}. The C++ ABI requires -this macro to be nonzero. Define this macro for targets where full -C++ ABI compliance is impossible and where explicit and implicit -template specialization must be treated differently. +that weak symbols do not appear in a static archive's table of contents. +The default is @code{0}. + +Leaving weak symbols out of an archive's table of contents means that, +if a symbol will only have a definition in one translation unit and +will have undefined references from other translation units, that +symbol should not be weak. Defining this macro to be nonzero will +thus have the effect that certain symbols that would normally be weak +(explicit template instantiations, and vtables for polymorphic classes +with noninline key methods) will instead be nonweak. + +The C++ ABI requires this macro to be zero. Define this macro for +targets where full C++ ABI compliance is impossible and where linker +restrictions require weak symbols to be left out of a static archive's +table of contents. @end defmac @defmac TARGET_SUPPORTS_HIDDEN -- cgit v1.1