This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question on symbol versioning
Hi,
On Thu, 19 Aug 2010, Ian Lance Taylor wrote:
> "Amker.Cheng" <amker.cheng@gmail.com> writes:
>
> >> What does readelf -V print for your executable?
> >>
> > No, There is no versioning information in test.so. the output is like
> >
> > mipsel-linux-gnu-ld -shared test.o -o test.so
> > mipsel-linux-gnu-readelf.exe -V test.so
> > -----------------------
> > No version information found in this file.
> >
> > I guess it's reasonable, since I didn't statically link to libc.so before.
>
> I have no explanation why the dynamic linker would not select the
> default version in this case.
Because the base version is the right thing to select. If the
application doesn't have any version specific info it's sensible to assume
that it was build at a time where the linkers either weren't able to do
symbols versioning at all, or that at least the library to which it links
didn't have any symbol version info either. In both cases we can assume
that the application was seeing the oldest possible symbol when link
editing, therefore also that one should be chosen at runtime.
(that's different from dlsym where also no specific version is requested,
but it's more probable that the application would like to have the
newest, i.e. default, version of the symbol it asks for).
Ciao,
Michael.