On 04/28/2009 08:02 AM, P J P wrote:
I came across a library `libexiv2.so'(www.exiv2.org) which has
some
hidden symbols in it. But the `Version symbol' entries for those hidden
symbols are shown as - 1 *global* - by `eu-readelf -sV'. Now if symbol
is hidden
- shouldn't the highest(15'th) bit of the corresponding `Version symbol'
entry be set? And if so, then it could not possibly equate to 1,
right?
Symbol visibility has not really anything to do with versioning.
But hidden symbols shouldn't be in the dynamic symbol table and only
symbols in the dynamic symbol table have version symbol information
associated.
if you really see a symbol with visibility hidden in the dynamic symbol
table then this is a bug.
So could I infer that
- `Version symbol' entries are greater than 1 if and only if the
concerned library(or DSO) uses symbol versioning.
Yes. But there is no version definition section at all if symbol
versioning is not used.
- And if so, there is no way of knowing if a *local* symbol is
defined in
the same object/binary or is resolved from a library while running?
A symbol that is referenced and uses a PLT slot will use the
well-defined symbol lookup path. That's the whole point of ELF symbol
lookup. Read
http://people.redhat.com/drepper/dsohowto.pdf
section 1.5.4.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖