7.4. Dynamic relocations

There are many different types of relocations. The majority of relocations are resolved at static link time by a static linker such as armlink. When an application uses shared libraries, it cannot know at static link time where the shared libraries are going to exist in memory. Therefore, dynamic relocations are added to such an application so that the dynamic linker can resolve the address information for each dynamically referenced symbol at load or run-time.

Each type of dynamic relocation informs the dynamic linker what type of address needs to be filled in, such as an absolute address or an offset, and the calculation to be used to generate the value. A relocation entry includes the target symbol, the type of relocation and an addendum.

The addendum is a value passed from the object producer to the dynamic linker to be used in the calculation. An addendum is normally used to provide an offset into a structure or to correct for PC bias. There are two methods used to store the addend:

Copyright © 2010 ARM. All rights reserved.ARM DAI 0242A