duplicate symbols on HP-PA
Marco Franzen
marcof@thyron.com
Wed Nov 22 04:30:00 GMT 2000
On Fri, 17 Nov 2000, John David Anglin wrote:
> It is relatively simple to build gcc on the pa without weak support.
> Just turn off HAVE_GAS_WEAK in auto-host.h or edit out the last few lines
> in config/pa/som.h. This doesn't fix the weak issue but it might give
> you a compiler that works for your purpose.
Unfortunately, it doesn't. The only difference seems to be
that it doesn't use weak. ;-)
I still (of course, now) gets multiple copies of the function,
several are actually called, and the copies still use different data,
initialised once per copy.
The assemler code looks worse than 2.95.2. Back then, it emitted the
data with a mangled symbol as common and just failed to export them -
and failed to mangle, export and .comm the initialisation guard
(first-time flag). 20001023 does not mangle, export or commonize
either the data or the guard, regardless of underlying weak support.
Looking at the front-end, I noticed some new (relative to 2.95.2)
code that cares to mangle and to DECL_COMMON (guard)
(cp/decl2.c: get_guard, called from cp/decl.c:expand_static_init),
but only if the flag_new_abi is set.
20001120 (with new abi default) does not even bootstrap.
(I tried only with weak turned off.) It generates garbled assembler
labels from quadlib.c. _U_Qfgt and _U_Qfge both become _U_Qfg,
leading to a redefinition error. They are only distinguishable by the
debug information, for example
.stabs "",36,0,0,L$scope0002-_U_Qfg
.align 4
.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.stabs "_U_Qfge:F1",36,0,53,_U_Qfg
.stabs "a:p14",160,0,52,40
.stabs "b:p14",160,0,52,56
.EXPORT _U_Qfg,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR
_U_Qfg
20001023 did bootstrap with --enable-new-gxx-abi and
HAVE_GAS_WEAK turned off. But it ICEs and generates invalid
assembler code.
The invalid assembler code is due to mangling. It generates labels
with `*INTERNAL*' in it, which is rejected by gas.
The ICE is 20004106, on every single static method with static data
(even if not of a template class).
It seems it disagrees with itself what abi it is using: [cp/method.c]
---------------------------------------
/* Produce the mangling for a variable named NAME in CONTEXT, which can
be either a class TYPE or a FUNCTION_DECL. */
tree
build_static_name (context, name)
tree context, name;
{
/* This function is obsoleted by the new ABI. */
my_friendly_assert (!flag_new_abi, 200004106);
---------------------------------------
Cheers,
Marco
-----------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed.
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Thyron Limited.
If you are not the intended recipient then please be advised
that you have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email
is strictly prohibited.
If you have received this email in error, please notify the
Thyron IT Administrator on +44 (0)1923 236 050 or
send an email to mail-admin@thyron.com.
Thank You
More information about the Gcc
mailing list