Go to main content

Oracle® Solaris 11.3 Linkers and Libraries Guide

Exit Print View

Updated: March 2018
 
 
Chapter 8

Capability Processing

Systems can offer various capabilities that are required for code to execute correctly. Systems can also offer services that are required to establish a process, or might be important for debugging or monitoring that process. Objects convey these requirements by defining their capability needs within a capabilities section.

Code that can only be executed when certain capabilities are available should identify these requirements by means of a capabilities section. Recording capability requirements within an object allows the system to validate the object before attempting to execute the associated code. These requirements can also provide a framework where the system can select the most appropriate object from a family of objects, or symbol from a family of symbols. A family consists of instances of the same object or symbol, where each instance requires different capabilities.

    The following capabilities provide for the validation of an object. These capabilities also provide for the selection of capabilities instances from a family of objects or symbols.

  • A platform capability - identifies a specific platform by name.

  • A machine capability - identifies a specific machine hardware by name.

  • Hardware capabilities - identify instruction set extensions and other hardware details with capabilities flags.

    When more than one capability instance can be exercised on the same system, a set of precedence rules are used to select one instance. These rules are the same for selecting from a family of objects, or for selecting from a family of symbols within an object.

  • A capability group that defines a platform name takes precedence over a group that does not define a platform name.

  • A capability group that defines a machine hardware name takes precedence over a group that does not define a machine hardware name.

  • A larger hardware capabilities value takes precedence over a smaller hardware capabilities value.

    Objects can also use capabilities to affect process creation or relay other software environment requirements. These capabilities are not inspected as part of object validation, or as part of object or symbol selection, but provide additional information that can affect the process. The following capability provides software information.

  • Software capabilities - reflect attributes of the software environment with capabilities flags.

Each of these capabilities can be defined individually, or combined to produce a capabilities group.

Dynamic objects, as well as individual functions or initialized data items within an object, can be associated with capability requirements. Some capability requirements are recorded in the relocatable objects that are produced by the compiler, and reflect the options or optimization that was specified at compile time. The link-editor combines the capabilities of any input relocatable objects to create a final capabilities section for the output file. See Capabilities Section.

In addition, capabilities can be defined when the link-editor creates an output file. These capabilities are identified using a mapfile and the link-editor's –M option. Capabilities that are defined by using a mapfile can augment, or override, the capabilities that are specified within any input relocatable objects. Mapfiles are usually used to augment compilers that do not generate the necessary capability information, or to override compiler generated capabilities information in special circumstances.

For a cheat sheet that describes creating and exercising symbol capability variants, see Symbol Capabilities Example.

This chapter describes the creation and use of capabilities together with techniques for exercising capabilities instances.