7.3. Locating dynamic content

One of the first tasks a dynamic linker has to perform when loading an ELF file is to find the dynamic content.

In an ELF file produced by the ARM compiler the location of the dynamic content is given by the corresponding section header table entry, and by the tags in the .dynamic section.

If the dynamic linker is loading ELF files directly then it should be using tags in the .dynamic section to find the dynamic content. This is because the presence of the section header table in an ELF executable is optional.

To find the dynamic content using the .dynamic section table the following process is used:

  1. Load the program header table and find the table entry with type PT_DYNAMIC. This gives the location and size of the dynamic section.

  2. Load the contents of the dynamic section using the information given by the PT_DYNAMIC program header table.

  3. The contents of the dynamic section is a table of tag and value pairs. The location of the dynamic content is provided by several table entries. For example the dynamic string table is described by:

    Table 7.1. Dynamic section content

    TagValue
    DT_STRTABBase of dynamic string table
    DT_STRTABSZSize in bytes of the dynamic string table

    Note

    When using the SysV dynamic linking model, which assumes that the dynamic linker loads ELF files directly, all values that are base addresses are virtual addresses.

    When using the BPABI and base platform dynamic linking models, which assume that the ELF file is post processed by a platform specific post-linker, all values that are base addresses are file offsets.

Copyright © 2010 ARM. All rights reserved.ARM DAI 0242A
Non-ConfidentialID011411