It is easy to get confused about which component

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: files, this is not a major issue. But on register-starved IA32 systems, losing even one register can trigger spilling of the registers onto the stack. PIC Function Calls It would certainly be possible for PIC code to use the same approach for resolving external procedure calls: call L1: popl addl call L1 %ebx; $PROCOFF, %ebx *(%ebx) # ebx contains the current PC # ebx points to GOT entry for proc # call indirect through the GOT However, this approach would require three additional instructions for each run-time procedure call. Instead, ELF compilation systems use an interesting technique, called lazy binding, that defers the binding of procedure addresses until the first time the procedure is called. There is a nontrivial run-time overhead the first time the procedure is called, but each call thereafter only costs a single instruction and a memory reference for the indirection. Lazy binding is implemented with a compact yet somewhat complex interaction between two data structures: the GOT and the procedure linkage table (PLT). If an object module calls any functions that are defined in shared libraries,...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online