Copyright (C) 2000-2012 |
GNU Info (nasm.info)Section 8.2.58.2.5. Calling Procedures Outside the Library --------------------------------------------- Calling procedures outside your shared library has to be done by means of a _procedure linkage table_, or PLT. The PLT is placed at a known offset from where the library is loaded, so the library code can make calls to the PLT in a position-independent way. Within the PLT there is code to jump to offsets contained in the GOT, so function calls to other shared libraries or to routines in the main program can be transparently passed off to their real destinations. To call an external routine, you must use another special PIC relocation type, `WRT ..plt'. This is much easier than the GOT-based ones: you simply replace calls such as `CALL printf' with the PLT-relative version `CALL printf WRT ..plt'. automatically generated by info2www version 1.2.2.9 |