Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ shlib2(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought



SHLIB2(1,C)                 AIX Commands Reference                  SHLIB2(1,C)



-------------------------------------------------------------------------------
shlib2



PURPOSE

Creates a shared library.

SYNTAX


          +------------+
shlib2 ---| +--------+ |--- -sspecfile --- -ttarget ---|
          +-| -hhost |-+
           ^| -n     ||
           || -q     ||
           |+--------+|
           +----------+


DESCRIPTION

The shlib2 command creates a shared library, similar in function to an unshared
library except that multiple programs linking with a shared library will use
the same library code during execution.

The shlib2 command creates both the host and target libraries.  The host shared
library is an archive, used to link-edit user programs with the shared library.
It is used as an unshared library is used.  See "ar" and "cc" for information
on creating an archive library and linking a file.

The target shared library is an executable attached to the user's process.  It
must be fully resolved as it contains the code for all of the library routines.

To use shlib2, it is necessary to specify options on the command line and
describe the contents of the shared library in a library specification file.

The shlib2 command invokes ar, the archiver, as, the assembler and ld, the
loader.

The shared library specification file is created to specify the contents of
both the host and target shared libraries.  To create this file, the following
are needed:

#address section address
              Defines the start address of the given target file section.

#target path name
              Defines the absolute path name of the target shared library.





Processed November 8, 1990        SHLIB2(1,C)                                 1





SHLIB2(1,C)                 AIX Commands Reference                  SHLIB2(1,C)



#branch       Defines the start of the branch table specifications.  The syntax
              is as follows:

                symbol position

              Where symbol is the name of the branch table entry symbol and
              position is the position of the entry.  Position may be specified
              as an integer, or a range of integers.  Only external functions
              can be given branch table entries.

#objects      Defines the names of the object files making up the target shared
              library.  This list consists of the file names followed by
              blanks.  The order for the host shared library is given via
              running the list through the lorder and tsort commands.

#init object  Defines that the object file requires initialization code.  The
              following is the format of initialization coding:

                pointer symbol

              Where pointer points to the "import" symbol, and must be defined
              in object.  The following is the format of the initialization
              code generated:

                pointer = &symbol

#ident string Defines a string to be included in the comment section of the
              target shared library.

##            Defines a comment; all information following this string is
              ignored.

FLAGS

-s  specfile  Contains the information needed to build a shared library.

-t target     Defines the name of the target shared library.

-h host       Defines the name of the host shared library.  The host shared
              library is not created if this flag is not specified.

-n            This prevents the generation of a new target shared library.  The
              -t flag is still required to build the host shared library even
              though the target shared library is not generated.

-q            Suppresses warning messages.

FILES

TEMPDIR/*              Temporary files.  TEMPDIR is usually /usr/tmp.  TEMPDIR
                       can be redefined by setting its environment variable.




Processed November 8, 1990        SHLIB2(1,C)                                 2





SHLIB2(1,C)                 AIX Commands Reference                  SHLIB2(1,C)



RELATED INFORMATION

See the discussion of shared libraries in AIX Operating System Programming
Tools and Interfaces.



















































Processed November 8, 1990        SHLIB2(1,C)                                 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026