Go to main content

Oracle® Solaris 11.4 Linkers and Libraries Guide

Exit Print View

Updated: March 2019
 
 
Chapter 4

Shared Objects

Shared objects are one form of output created by the link-editor and are generated by specifying the –G option.

A shared object is an indivisible unit that is generated from one or more relocatable objects. Shared objects can be bound with executables to form a runnable process. As their name implies, shared objects can be shared by more than one application. Because of this potentially far-reaching effect, this chapter describes this form of link-editor output in greater depth than has been covered in previous chapters.

For a shared object to be bound to a dynamic object, it must first be available to the link-edit of the required output file. During this link-edit, any input shared objects are interpreted as if they had been added to the logical address space of the output file being produced. All the functionality of the shared object is made available to the output file.

Any input shared objects become dependencies of this output file. A small amount of bookkeeping information is maintained within the output file to describe these dependencies. The runtime linker interprets this information and completes the processing of these shared objects as part of creating a runnable process.

The following sections expand upon the use of shared objects within the compilation and runtime environments. These environments are introduced in Runtime Linking.