Pointers to functions
A function pointer is a data type whose values range over procedure names.
Variables of this type appear in several programming languages, such as C and Fortran. In Fortran, a dummy argument that appears in an EXTERNAL statement is a function pointer. Fortran provides support for the use of function pointers in contexts such as the target of a call statement or an actual argument of such a statement.
A function pointer is a fullword or doubleword quantity that is the address of a function descriptor. The function descriptor is a 3 word or 3 doubleword object. The first word or doubleword contains the address of the entry point of the procedure. The second has the address of the TOC of the object module in which the procedure is bound. The third is the environment pointer for nested (contained) procedures. There is only one function descriptor per entry point. It is bound into the same object module as the function it identifies if the function is external. The descriptor has an external name, which is the same as the function name but with a different storage class that uniquely identifies it. This descriptor name is used in all import or export operations.
In 32-bit mode, function pointers are 4 bytes long and contain a 32-bit address. In 64–bit mode, they are 8 bytes long and contain a 64-bit address. For pointers to local functions, the address contained is the address of the function in the text section. For imported functions, the address is that of the function's stub. Every unique, imported function will have a stub in the object. The function stub is in the non-lazy symbol pointer section.