|
Description
|
The versioning sections generated by the GNU ld are based
on the Solaris versions, but contain some significant extentions:
(1) The Versym also contains indexes to Verneed records, recording
which object/version contributed the external symbol at
link time. These indexes start with the next value following
the final Verdef index. The index is written to the previously
reserved vna_other field of the ELF Vernaux structure.
(2) The top bit of the Versym value is no longer part of the index,
but is used as a "hidden bit" to prevent binding to the symbol.
(3) Multiple implementations of a given symbol, contained in varying
versions are allowed, using special assembler pseudo ops,
and encoded in the symbol name using '@' characters.
Previous work has been done to allow the Solaris linkers to interoperate
with such objects:
6516665 The link-editors should be more resilient against gcc's symbol versioning
6565476 rtld symbol version check prevents GNU ld binary from running
6577462 Additional improvements needed to handling of gcc's symbol versioning
However, to date, the Solaris linker does not generate any of this extra
information. This case adds support for item (1) above. The Solaris linker
should generate VERSYM indexes to VERNEED records in addition to those
already generated for VERDEF. The benefit from this change is that using
elfdump or pvs, you can determine the object and version that ld expects
an undefined symbol to be satisfied by at runtime. As with the GNU ld,
and compatabily with it, these indexes will be recorded in the previously
unused vna_other field of the Elf_Vernaux structure.
For example, here is the pvs symbol output for a hello world program
without this change:
% pvs -s a.out
libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
Here is the pvs output from the same program augmented with
the changes discussed here:
% pvs -s a.out
libc.so.1 (SUNWprivate_1.1):
_get_exit_frame_monitor;
libc.so.1 (SYSVABI_1.3):
printf;
_exit;
atexit;
__fpstart;
exit;
This change is for item (1) above only. No changes will be
made that affect support for the other 2 items.
|