Object code control
None.
Generates object code for DLLs or DLL applications.
For C and IPA Link:
.-NODLL-. .-(NOCBA)-. >>-+-DLL---+--+---------+-------------------------------------->< '-(CBA)---'
For C++:
.-DLL---. .-(NOCBA)-. >>-+-NODLL-+--+---------+-------------------------------------->< '-(CBA)---'
For a C compile and the IPA link step, the default option is NODLL(NOCBA). For a C++ compile, the default option is DLL(NOCBA).
The CALLBACKANY suboption is not supported when the XPLINK option is used. When function pointers having their origins (that is, where the address of a function is taken and assigned to a function pointer) in XPLINK code in the same or another DLL, or NOXPLINK NODLL code in another DLL, or non-XPLINK DLL code in another DLL, are passed to exported XPLINK functions, the compiler inserts code to check whether or not the function pointers received as actual arguments are valid (useable directly) XPLINK function pointers, and converts them if required. This provides results that are similar in many respects to the function pointer conversion provided when DLL(CALLBACKANY) is specified for non-XPLINK code. Other function pointers that have their origins in non-XPLINK code, including function pointer parameters passed to non-exported functions or otherwise acquired, are not converted automatically by XPLINK compiled code. Use of such function pointers will cause the application to fail.
When the DLL option is in effect, the compiler is instructed to produce DLL code. The DLL code can export or import functions and external variables.
For information on how to create or use DLLs, and on when to use the appropriate DLL options and suboptions, see z/OS XL C/C++ Programming Guide.
void (*foo)();
void main() {
/* ... */
if (foo != (void (*)()) (50L) ) {
/* do something other than calling foo */
}
}
This conditional expression will cause an abend at execution
time because the function pointer (with value 50L)
needs to be dereferenced to perform the comparison. The compiler
will check for this type of casting problem if you use the CHECKOUT(CAST)
option along with the DLL option. See CHECKOUT | NOCHECKOUT (C only) for
more information on obtaining diagnostic information for C applications.The IPA compile step generates information for the IPA link step. The CALLBACKANY option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.
The IPA link step accepts the DLL compiler option, but ignores it.
Each partition is initially empty and is set as DLL or non-DLL, when the first subprogram (function or method) is placed in the partition. The setting is based on the DLL or non-DLL classification of the IPA object module which contained the subprogram. Procedures from IPA object modules with incompatible DLL values will not be inlined. This results in reduced performance. For best performance, compile your application as all DLL code or all non-DLL code.
The IPA link step allows you to input a mixture of IPA objects that are compiled with DLL(CBA) and DLL(NOCBA). The IPA link step does not convert function pointers from the IPA Objects that are compiled with the option DLL(NOCBA).
You should only export subprograms (functions and C++ methods) or variables that you need for the interface to the final DLL. If you export subprograms or variables unnecessarily (for example, by using the EXPORTALL option), you severely limit IPA optimization. Global variables are not coalesced, and inlined code is not 100% pruned.