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.
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.
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.