GNU Info

Info Node: (nasm.info)Section 8.2.5

(nasm.info)Section 8.2.5


Next: Section 8.2.6 Prev: Section 8.2.4 Up: Section 8.2
Enter node , (file) or (file)node

8.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