I'm sponsoring the following case for myself. This case qualifies for
Architectural self-review, but I wish to record the following
information.
------------------------------------------------------------------------
6357282 describes an enhancement to ldd(1), that would allow ldd to
suppress relocation errors against <parent> or <extern> symbols.
Shared objects are often built that refer to call-back interfaces.
These are interfaces that are expected to be supplied by one of the
objects callers. If the caller is unknown, or a dynamic executable,
then the shared object can not be built with a dependency that will
satisfy these call-back references.
Using ldd(1) to process relocations will result in error diagnostics
for any call-back references, as ldd(1) can not locate the necessary
symbols:
% ldd -r /usr/lib/mdb/proc/eft.so
symbol not found: mdb_zalloc (/usr/lib/mdb/proc/eft.so)
symbol not found: mdb_free (/usr/lib/mdb/proc/eft.so)
symbol not found: mdb_vread (/usr/lib/mdb/proc/eft.so)
......
We've been able to use -zdefs with objects that have external call-backs
by defining a mapfile with EXTERN or PARENT symbol definitions. These
keywords translate to tags within the Syminfo section. The PARENT
keyword is even used by ld.so.1 to process a correct direct binding to
a parent.
However, presently ldd(1) does not recognize these Syminfo tags, and
still shows that the object has undefined references. The OSNet nightly
build script check_rtime(1) is cluttered with a number of exceptions to
exclude ldd(1) processing for objects that have external references.
------------------------------------------------------------------------
This ARC case adds a new -p option to ldd(1):
A shared object can make reference to symbols that are
expected to be supplied by the caller of the shared object.
By default, such external references appear unresolved when
using the -d or -r options. These references can be expli-
citly classified when the shared object is created, as
available from a parent, or simply as being external. See
the -M mapfile option of ld(1), and the PARENT and EXTERN
symbol definition keywords. Unresolved parent and external
references can be silenced with the following option.
-p Suppress unresolved symbol errors to explicit parent and
external references.
Thus, an ldd(1) that used to report an error can be silenced.
For example, eft.so can be built with:
% cat mapfile-extern
{
global:
mdb_zalloc = EXTERN;
mdb_free = EXTERN;
mdb_vread = EXTERN;
...
};
A standard ldd(1) will complain about unresolved references,
however these errors can be supressed with -p
% ldd -pr /usr/lib/mdb/proc/eft.so
libc.so.1 => /lib/libc.so.1
libm.so.2 => /lib/libm.so.2
------------------------------------------------------------------------
Release Binding: Patch/Micro
ldd -p option Committed
--
Rod