This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Minimal GCC/Linux shared lib + EH bug example
----- Original Message -----
From: "Martin v. Loewis" <martin@v.loewis.de>
> Jason Merrill <jason@redhat.com> writes:
>
> > I find this testcase somewhat persuasive, as the offending dlopen call
is
> > not in the C++ code. What do others think?
>
> What I find troubling is that gcc emits the typeinfo for worker_error
> into all three object files, even though the class has a non-inline
> non-abstract virtual function. It correctly manages to emit the vtable
> only once; it should manage to emit the typeinfo (and typeinfo name)
> only once, also.
>
> I believe if the single copy of the typeinfo was emitted together with
> the vtable, this example would "work".
Hmm, that's very interesting. I agree with Martin that this change should
probably be made, I also think it doesn't go nearly far enough. If I
understand correctly, even with the change, if worker_error were changed to
be a POD struct it would fail again. It seems unreasonable that users
should have to restrict themselves to throwing polymorphic class instances
with out-of-line virtual functions.
[all the same, this one change would make a big difference for my
application]
-Dave