Checksums of address-translated ranges
In most cases ielftool can be used as if the tool operates on virtual (or execution/logical) addresses—the memory addresses that your application uses. However, this is not strictly true, because ielftool operates on ELF files. It is actually using the physical addresses of the ELF file.
In most cases this does not matter, because the physical and the logical address are almost always the same. However, if your application is linked with address translation (see logical directive), the content has two addresses: a logical address (where it resides during execution) and a physical address (where it resides before execution).
Because the symbol table in an ELF file only uses logical addresses, there are no symbols that have physical addresses, so the usual convenience of using symbols in the checksum range does not work for translated checksum ranges. Instead, you must use explicit physical checksum ranges.
An example:
You want to calculate a checksum for the address range 0x5'0000–0x5'FFFF. You have two symbols: __checksum_start=0x5'0000 and __checksum_end=0x5'FFFF.
If your application is linked without address translation, you can use:
‑‑checksum __checksum:4,crc32;__checksum_start-__checksum_end
However, if your application is linked with address translation, assuming the range 0x5'0000–0x5'FFFF was, for example, translated to 0x1000'0000–0x1000'FFFF, you must use:
‑‑checksum __checksum:4,crc32;0x1000'0000-0x1000'FFFF
Note
The checksum symbol __checksum is a normal symbol—it has a virtual address and can be used as is. ielftool processes the physical bytes specified by the checksum range and stores them at the virtual address of the checksum symbol, so that the application can access it.