Dynamic Linking and Loading
Prev: Shared libraries Next: Advanced Techniques
Problems
10.1
In ELF shared libraries, libraries are often linked so that calls from one routine to another within a single shared library go through the PLT and have their addresses bound at runtime. Is this useful? Why or why not?
10.2
Imagine that a program calls a library routine plugh() that is found in a shared library, and the programmer builds a dynamically linked program that uses that library. Later, the system manager notices that plugh is a silly name for a routine and installs a new version of the library that calls the routine xsazq instead. What happens when the next time the programmer runs the program?
10.3
If the runtime environment variable LD_BIND_NOW is set, the ELF dynamic loader binds all of the program’s PLT entries at load time. What would happen in the situation in the previous problem if LD_BIND_NOW were set?
10.4
Microsoft implemented lazy procedure binding without operating system assistance by adding some extra cleverness in the linker and using the existing facilities in the operating system. How hard would it be to provide transparent access to shared data, avoiding the extra level of pointers that the current scheme uses?