This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Undefined reference
- From: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>
- To: pcarlini at unitus dot it (Paolo Carlini)
- Cc: weigand at immd1 dot informatik dot uni-erlangen dot de (Ulrich Weigand), libstdc++ at gcc dot gnu dot org
- Date: Sat, 22 Mar 2003 23:05:47 +0100 (MET)
- Subject: Re: Undefined reference
Paolo Carlini wrote:
> Notice that there are no differences in the basic_string code itself
> present in the various branches (3.2, 3.3 and 3.4) and the problem
> appear at link time and only for dynamic linking, therefore probably
> your guess is correct. Unfortunately I haven't made much progress yet in
> trying to understand what is going wrong.
>
> Do you have any hints?
Well, the symbol is indeed stripped out by the version script.
The mangled name is
_ZNSbIwSt11char_traitsIwESaIwEE12_S_constructEmwRKS1_
but the version script (config/linker-map.gnu) only exports those:
# std::string, std::wstring minus static data members
_ZNKS[sb]*;
_ZNS[sb]D*;
_ZNS[sb]C*;
_ZStplI[cw]St11char_traitsI[cw]ESaI[cw]EESbIT_T0_T1_EPKS3_RKS6_;
_ZStplI[cw]St11char_traitsI[cw]ESaI[cw]EESbIT_T0_T1_ES3_RKS6_;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE[A-Ra-z]*;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][A-Ra-z]*;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][0-9][A-Ra-z]*;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9]_[A-Ra-z]*;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][0-9]_[A-Ra-z]*;
_ZNS[sb]I[cw]St11char_traitsI[cw]ESaI[cw]EE20_S_empty_rep_storageE;
Note that only names starting with _A ... _R (or small letters) are
exported, those starting with _S appear to be deliberately stripped
(with the exception of _S_empty_rep_storage).
Unfortunately I don't understand the reasons behind this, so I
cannot say whether this symbol should be added to the script,
or else the symbol should not have been used in the first place ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
weigand at informatik dot uni-erlangen dot de