Loading and overlays

Prev: Relocation Next: Shared libraries

Problems

8.1

Compile some small C routines with PIC and non-PIC code. How much slower is the PIC code than non-PIC? Is it enough slower to be worth having non-PIC versions of libraries for programmers in a hurry?


8.2

In the overlay example, assume that dick and dot each call both edgar and fran, but dick and dot don’t call each other. Restructure the overlay so that dick and dot share the same space, and adjust the structure so that the call tree still works. How much space does the overlaid program take now?


8.3

In the overlay segment table, there’s no explicit marking of conflicting segments. When the overlay manager loads a segment and the segment’s path, how does the manager determine what segments to mark as not present?


8.4

In an overlaid program with no exclusive calls, is it possible that a series of calls could end up jumping to unloaded code anyway? In the example above, what happens if rob calls bill, which calls aaron, which calls chris, then the routines all return? How hard would it be for the linker or overlay manager to detect or prevent that problem?