This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
#pragma interface (was Re: ia64 c++ abi exception handling)
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: #pragma interface (was Re: ia64 c++ abi exception handling)
- From: Jason Merrill <jason at redhat dot com>
- Date: 15 Mar 2001 14:10:00 +0000
- Cc: Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr, bkoz at redhat dot com, gcc-patches at gcc dot gnu dot org
- References: <flu24v94uh.fsf@sel.cmla.ens-cachan.fr><20010314210320O.mitchell@codesourcery.com>
>>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:
> | >>>>> "Benjamin" == Benjamin Kosnik <bkoz@redhat.com> writes:
> |
> | > Also, kill the pragma implementation: we shouldn't be using this
> | > pragma anymore.
> |
> | Frankly, I disagree. Unfortunately, there's still no better way to deal
> | with duplicated vtables on targets that don't support COMDAT. The first
> | virtual function heuristic doesn't work for all classes. bad_exception,
> | for instance.
> Sure there is: use a pre-linker to figure out what you need where. :-)
> That, in fact, is the only way I know of to get both correct behavior
> and decent performance on such targets. Good support of AIX pretty
> much requires this technique, AFAIK.
The xlC prelinker does the right thing for AIX, but it's not really
applicable to any other target, so I don't see there being a GNU version
any time soon.
For the studio audience, as I recall xlC gives template instantiations (and
vtables?) odd, semi-random names, and puts them in oddly named sections.
The prelinker goes through, chooses one of these, and renames it to the
real symbol name. The others are then discarded by the section GC done by
the AIX linker.
There is no way to do this sort of thing for, say, a.out.
> I agree with Benjamin: these #pragmas are confusing, and have lead to
> way too many weird bugs in the compiler itself.
Really? I've always found them ugly, but fairly clear. I agree with
Benjamin that a better solution is to just move virtuals out of line so
that the heuristic will work, though--I repent my statement quoted above.
> But, in fairness to your key point, the question is whether anyone
> will ever implement the pre-linker, and whether or not the #pragmas
> need to stay until that point.
Unfortunately, we have a major customer who relies on the #pragmas because
one of their targets is i960-b.out.
My pending linkage rewrite will reduce the maintenance impact of these
#pragmas by doing away with interface_*, though I'm setting it aside until
3.0 is out.
Jason