Linker (computing) - Relaxation

Relaxation

As the compiler has no information on the layout of objects in the final output, it cannot take advantage of shorter or more efficient instructions that place a requirement on the address of another object. For example, a jump instruction can reference an absolute address or an offset from the current location, and the offset could be expressed with different lengths depending on the distance to the target. By generating the most conservative instruction (usually the largest relative or absolute variant, depending on platform) and adding relaxation hints, it is possible to substitute shorter or more efficient instructions during the final link. This step can be performed only after all input objects have been read and assigned temporary addresses; the relaxation pass subsequently re-assigns addresses, which may in turn allow more relaxations to occur. In general, the substituted sequences are shorter, which allows this process to always converge on the best solution given a fixed order of objects; if this is not the case, relaxations can conflict, and the linker needs to weigh the advantages of either option.

Read more about this topic:  Linker (computing)

Famous quotes containing the word relaxation:

    Worst of all, there is no sign of any relaxation of antisemitism. Logically it has nothing to do with Fascism. But the human race is imitative rather than logical; and as Fascism spreads antisemitism spreads.
    George Bernard Shaw (1856–1950)