[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4

rtl_enable Command


Relinks shared objects to enable the runtime linker to use them. This command only applies to AIX 4.2 or later.


rtl_enable [  -R |  -o Name ] [  -l ] [  -s ] FileldFlag ... ] [  -F ObjsLibs ...  ]


The rtl_enable command relinks a module, or an archive containing modules, with the -G flag, to enable runtime linking. A module is an XCOFF file containing a loader section. A shared object is a module with the F_SHROBJ flag set in the XCOFF header.

In its simplest form, the rtl_enable command creates a new file with the name File.new. If File is a module, File.new will be the same kind of module. If File is an archive, File.new will be an archive whose members have the same names as the members of File. The rtl_enable command relinks the modules in the new archive to enable run-time linking. The rtl_enable command archives other members unchanged into the output file.

The rtl_enable command uses the loader section in File (or its members) to create import and export files, to determine the libpath information, and to determine the entry point.


-F ObjsLibs ...  Adds ObjsLibs to the beginning of the generated ld command. The ObjsLibs parameter is either an object file or a library (specified with the ld command's -l (lowercase L) flag). If you are enabling an archive, adds the ObjsLibs to the ld command for all shared objects in the archive.
-l (Lowercase L) Leaves the import and export files in the current directory instead of deleting them. Import files have the suffix .imp and export files, the suffix .exp. The rtl_enable command adds the suffixes to the input file name if File is a module. It adds the suffixes to the names of members that are modules if File is an archive.
-o Name Specifies an alternate output file name instead of File.new. Do not use this flag with the -R flag.
-R Replaces the input file instead of creating a new file. It will not overwrite the input file if any errors occur. Do not use this flag with the -o flag.
-s Generates a script of commands in the current directory that you can use to create a new output file or archive, but does not relink anything. It names the script Base.sh, where Base is the basename of the input file with any suffix stripped off. It writes generated import and export files in the current directory as well. You can modify the script and the import and export files to customize the output objects.


File Specifies the input file.
ldFlag ... Copies the specified ld command flags to the end of the generated ld command, overriding default options.

Note: Do not use the -o flag in the ldFlag parameter to name the output file. To specify an alternate output file name, use the rtl_enable command's -o Name flag.

Exit Status

This command returns the following exit values:

0 Successful completion.
>0 An error occurred.

Note: Depending on the error, some output files may have been created.


Access Control: Any User

Auditing Events: N/A


To create a new version of libc.a with runtime linking enabled, enter:

  1. Create a directory for runtime version by entering:

    mkdir /tmp/rtllibs
  2. Make /tmp/rtllibs your current directory by entering:

    cd /tmp/rtllibs
  3. To create the runtime version of libc.a with the same name, enter:

    rtl_enable -o libc.a /lib/libc.a

To use this version of libc.a when linking programs, use -L /tmp/rtllibs with the ld command.


/usr/bin/rtl_enable Contains the rtl_enable command. This is a symbolic link to /usr/ccs/bin/rtl_enable.

Related Information

Commands: ld.

Shared Objects and Runtime Linking in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]