Oracle® Solaris 11.2 Linkers and Libraries Guide

Exit Print View

Updated: July 2014


When linking against a sharable object, the symbols from all versions exported by the object are normally available for use by the link-editor. The DEPEND_VERSIONS directive is used to limit access to specified versions only. Restricting version access can be used to ensure that a given output object does not use newer features that might not be available on an older version of the system.

A DEPEND_VERSIONS directive has the following syntax.

        DEPEND_VERSIONS objname {
                ALLOW = version_name;
                REQUIRE = version_name;

objname is the name of the sharable object, as specified on the command line. In the common case where the object is specified using the –l command line option, this will be the specified name with a lib prefix. For instance, libc is commonly referenced as –lc on the command line, and is therefore specified as in a DEPEND_VERSIONS directive.

ALLOW Attribute

The ALLOW attribute specifies that the specified version, and versions inherited by that version, are available to the link-editor for resolving symbols in the output object. The link-editor will add a requirement for the highest version used in the inheritance chain containing this version to the output object requirements.

REQUIRE Attribute

REQUIRE adds the specified version to the output object requirements, whether or not the version is actually required to satisfy the link operation.