[PATCH v2 7/7] doc: binman: Add guidance for determining ELF load addresses

Jonas Karlman jonas at kwiboo.se
Wed Sep 24 14:32:43 CEST 2025


Hi,

On 9/14/2025 12:59 PM, Aristo Chen wrote:
> Add documentation to help users understand how to determine where ELF
> files will be loaded when using binman's 'fit,load' property. This
> addresses the common confusion about how load addresses are determined
> from ELF files.
> 
> The documentation explains three methods:
> 1. Using readelf to examine program headers
> 2. Checking the linker script (.lds file)
> 3. Using objdump to see section addresses
> 
> Also includes a specific example from binman tests showing how
> elf_sections.lds sets ATF load address to 0x00000010 and
> elf_sections_tee.lds sets TEE load address to 0x00100010 to avoid
> memory overlap conflicts.
> 
> This helps users debug memory layout conflicts more efficiently when
> working with FIT images containing multiple ELF components.
> 
> Signed-off-by: Aristo Chen <aristo.chen at canonical.com>
> ---
>  tools/binman/entries.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
> index 12a39d070e4..f6a5465ca44 100644
> --- a/tools/binman/entries.rst
> +++ b/tools/binman/entries.rst
> @@ -1050,6 +1050,24 @@ split-elf
>          Generates a `load = <...>` property with the load address of the
>          segment
>  
> +        Note: The load address comes from the ELF file's program header or
> +        linker script. To determine where an ELF file will be loaded, you can:
> +
> +        1. Use readelf to examine the program headers:
> +           ``readelf -l your_elf_file.elf``
> +           Look for the LOAD segments and their VirtAddr (Virtual Address)
> +
> +        2. Check the linker script (.lds file) used to build the ELF:
> +           Look for the `. = <address>;` statements which set the location
> +           counter and determine load addresses for different sections
> +
> +        3. Use objdump to see section addresses:
> +           ``objdump -h your_elf_file.elf``
> +
> +        For example, in binman tests, elf_sections.lds sets ATF load address
> +        to 0x00000010, while elf_sections_tee.lds sets TEE load address to
> +        0x00100010 to avoid memory overlap conflicts.

tools/binman/entries.rst should be generated from a "binman entry-docs"
run as described in the documentation [1].

Please update tools/binman/etype/fit.py or this will be lost next time
someone updates the entries documentation.

[1] https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Regards,
Jonas

> +
>      fit,entry
>          Generates a `entry = <...>` property with the entry address of the
>          ELF. This is only produced for the first entry



More information about the U-Boot mailing list