Weak symbols without symbol version

Jonathan Wakely jwakely.gcc@gmail.com
Sun Sep 9 09:58:00 GMT 2018


On Sun, 9 Sep 2018 at 07:42, Philipp Wähnert wrote:
>
> Hi,
>
> there're weak symbols like
>
>     operator +(const char *, const std::string &)
>
> inside my binaries stemming from function templates of the libstdc++. Even
> though their counterparts inside the stdlibc++-library got a specific
> version attached to it, those published symbols inside my binaries aren't.
> It is quite possible that such symbols inside my binaries are choosen at
> runtime by the dynamic linker to be the used ones in my process.
>
> Question: Am I supposed to expect, that symbols like that never change
> semantically?

Yes. The semantics are specified by the standard.

>Is it truely irrelevant with which version of the libstdc++
> my binaries currently are running and from which version of the libstdc++
> those symbols inside my binaries come?

Yes, as long as the version of libstdc++ the binary uses at runtime is
not older than the one used to compile against (but that's always
required, independently of your question).



More information about the Libstdc++ mailing list