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

Technical Reference: Base Operating System and Extensions, Volume 1

loadbind Subroutine

Purpose

Provides specific run-time resolution of a module's deferred symbols.

Syntax


int loadbind( Flag, ExportPointer, ImportPointer)
int Flag;
void *ExportPointer, *ImportPointer;

Description

The loadbind subroutine controls the run-time resolution of a previously loaded object module's unresolved imported symbols.

The loadbind subroutine is used when two modules are loaded. Module A, an object module loaded at run time with the load subroutine, has designated that some of its imported symbols be resolved at a later time. Module B contains exported symbols to resolve module A's unresolved imports.

To keep module A's imported symbols from being resolved until the loadbind service is called, you can specify the load subroutine flag, L_NOAUTODEFER, when loading module A.

(This paragraph only applies to AIX 4.3.1 and previous releases.) When a 32-bit process is executing under ptrace control, portions of the process's address space are recopied after the loadbind processing completes. The main program text (loaded in segment 1) and shared library modules (loaded in segment 13) are recopied. Any breakpoints or other modifications to these segments must be reinserted after the loadbind call.

(This paragraph only applies to AIX 4.3.2 and later releases.) When a 32-bit process executing under ptrace control calls loadbind, the debugger is notified by setting the W_SLWTED flag in the status returned by wait.

When a 64-bit process under ptrace control calls loadbind, the debugger is not notified and execution of the process being debugged continues normally.

Parameters

Flag Currently not used.
ExportPointer Specifies the function pointer returned by the load subroutine when module B was loaded.
ImportPointer Specifies the function pointer returned by the load subroutine when module A was loaded.
Note
The ImportPointer or ExportPointer parameter may also be set to any exported static data area symbol or function pointer contained in the associated module. This would typically be the function pointer returned from the load of the specified module.

Return Values

A 0 is returned if the loadbind subroutine is successful.

Error Codes

A -1 is returned if an error is detected, with the errno global variable set to an associated error code:

EINVAL Indicates that either the ImportPointer or ExportPointer parameter is not valid (the pointer to the ExportPointer or ImportPointer parameter does not correspond to a loaded program module or library).
ENOMEM Indicates that the program requires more memory than allowed by the system-imposed maximum.

After an error is returned by the loadbind subroutine, you may also use the loadquery subroutine to obtain additional information about the loadbind error.

Related Information

The load (load Subroutine)subroutine, loadquery (loadquery Subroutine)subroutine, unload subroutine.

The ld command.

Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

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