FWDSTAMP - Forwarded Entry Point (C, OS/2)

The Forward Entry Point Utility (FWDSTAMP) adds entry points, called forwarders, to a dynamic link library file (.dll). Forwarders point to API functions or other forwarders, to exported code or data. They contain an import reference so that the final target address of the forwarded entry is contained in a different module. A forwarder might be called an imported export.

The imported entry point that a forwarder refers to, may itself be another forwarder. The loader will process a chain of forwarders until a nonforwarder entry point is encountered.

When a file has a fix-up to a forwarded entry point, the loader resolves that fix-up to the address of the entry point that the forwarder imports, by traversing the chain of forwarders until the end of the chain (a nonforwarded export) is reached. All forwarders are implicitly exported.

There is no run-time cost to forwarders; however, there is a slight load-time cost as the loader resolves forwarder chains with their final addresses.

Syntax
Start FWDSTAMP and specify all input from the command line. An example of the syntax follows:

FWDSTAMP [options] infile deffile outfile

where:

[options] Specifies one of the following:
/? Displays FWDSTAMP help panel.
/V Increases the level of information FWDSTAMP should output.
infile Specifies the name of the dynamic link library file that LINK386 created. Use the file-name extension of DLL.
deffile Specifies the name of the module definition file (.def) that contains the forwarders. (See Example below).
outfile Specifies the name of the .dll file that will contain the added forwarders.

Using Forwarders
Use forwarders to combine several DLLs into one without having to relink old applications. For example, if MOUCALLS and VIOCALLS were combined into a single DLL called NEWLIB.DLL, then MOUCALLS and VIOCALLS could be replaced with special DLLs containing forwarders to NEWLIB.DLL.

Notes

Example
Forwarders are specified in the module definition file so that an exported name, which is also imported, is a forwarder. For example :

        IMPORTS
            VIOMODEWAIT=NEWLIB.123
        EXPORTS
            VIOMODEWAIT @ 25

In the example, a forwarder entry point for VIOMODEWAIT is created and contains an import reference to NEWLIB.123.