A LIBVEC is provided for the Language Environment library routines. A pointer to it is kept in the CAA and in the EDB. Additional LIBVECs are provided for members to use for their own libraries. Members define their own LIBVEC pointer fields.
As Figure 1 shows, a LIBVEC has three contiguous parts. The first part is made up of fields that contain parameters relating to the table itself. The subroutine loader uses this information. The second part is pointed to by the LIBVEC pointer and contains a 4 byte entry (SLOTn) at a fixed offset for each subroutine. If the subroutine has been loaded and AMODE switching is not being performed, each SLOTn contains the entry point address of its subroutine. Otherwise SLOTn points to its corresponding GLUE AREAn within the third part of the table. The third part is the GLUEAREAn. The size of each GLUE AREAn is 20 bytes. If the subroutine has been loaded and AMODE switching is being performed, the corresponding GLUE AREAn contains AMODE switching code.
Access to library routines through LIBVEC can be direct (though a known fixed LIBVEC offset) or indirectly (through an externally-defined address constant and a library owner supplied stub). Library owners can choose to provide a macro for direct access to their library routines and a stub for indirect access.
L R15,libvec_pointer Get address of LIBVEC
L R15,xxx(,15) Get address of Subroutine or GLUE AREAn
from LIBVEC slot
BALR R14,R15
When the access is indirect, through a stub,
AL 15,=V(LIBSUBx)
BALR 14,15
L 15,libvec_pointer Get address of LIBVEC
L 15,xxx(,15) Get address of Subroutine or GLUE AREAn
from LIBVEC slot
BR 15