Search code examples
armu-bootlinker-scripts

U-Boot - multiple same output formats in linker scripts for ARM


I'm currently investigating the U-Boot source tree, because I want add support for a specific ARM architecture for the purpose of education.

Also investigated the linker scripts for ARM, but there is something what I currently don't understand:

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")

Source:
GitHub: U-Boot: arch/arm/cpu/u-boot-spl.lds
GitHub: U-Boot: arch/arm/cpu/u-boot.lds

What is the meaning, when multiple output formats with the same format are defined in a linker script? Can somebody explain this, please?


Solution

  • Binutil manpages are available at https://sourceware.org/binutils/docs/ld/Format-Commands.html

    The first argument is the default output format the second one is for a user explicitly asking for big-endian with -EB passed to ld, the third for a user explicitly asking for low-endian with -EL.

    If all are the same, using a single parameter for OUTPUT_FORMAT should have the same effect.