Revision history   OpenPOWER Library

 5.1.7. External function calls

When building dynamically linked applications or shared libraries, the linker must resolve any function call targeting a function that may be defined in another module to point to a PLT stub in accordance with the requirements in section 4.2.5.3 "Procedure Linkage Table" of the ELFv2 ABI specification. Specifically, this stub must ensure the TOC pointer is saved to the TOC save slot on the stack, unless the calling routine indicates that it has already performed this operation by using the R_PPC64_TOCSAVE relocation on the nop instruction following the call. In addition, the linker must modify the nop instruction following the call to an instruction that restores the TOC pointer from the TOC save slot on the stack, unless the call is marked using the R_PPC64_REL24_NOTOC relocation.