This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35067] [4.2 Regression] multiple definition of virtual thunk
- From: "vincent dot riviere at freesbee dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Feb 2008 22:57:05 -0000
- Subject: [Bug c++/35067] [4.2 Regression] multiple definition of virtual thunk
- References: <bug-35067-14645@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from vincent dot riviere at freesbee dot fr 2008-02-03 22:57 -------
This problem seems to happen on targets where ASM_WEAKEN_LABEL() is defined,
but MAKE_DECL_ONE_ONLY() is not defined. In that case, the `virtual
thunk to C::~C()' symbol is defined using .globl instead of using .weak (like
it was in 4.1.2).
I made some investigation. The problem may be related to these source files:
gcc/cp/methods.c in function use_thunk()
if (DECL_ONE_ONLY (function))
make_decl_one_only (thunk_fndecl);
This code was different in 4.1.2
gcc/varasm.c in function make_decl_one_only()
if (SUPPORTS_ONE_ONLY)
{
#ifdef MAKE_DECL_ONE_ONLY
MAKE_DECL_ONE_ONLY (decl);
#endif
DECL_ONE_ONLY (decl) = 1;
}
When MAKE_DECL_ONE_ONLY is not defined, SUPPORTS_ONE_ONLY is set to 0. So
DECL_ONE_ONLY (decl) = 1 is never called.
Thus if the destructor is flagged DECL_ONE_ONLY, the virtual thunk is not
flagged DECL_ONE_ONLY as it should, then it is defined with .globl instead of
.weak
--
vincent dot riviere at freesbee dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.2.3
Known to work| |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35067