world leader in high performance signal processing
Trace: » elf2flt


The elf2flt package is a set of utilities designed to leverage existing Linux ELF toolchains to produce FLAT files. These files are then executed on embedded Linux systems.

Toolchain Integration

The work flow is typically something like:

  • compile source files into object files like normal
  • call gcc to link the final application
  • gcc calls the linker (which is pointing to ld-elf2flt)
  • ld-elf2flt does multiple things
    • craft a special linker script using elf2flt.ld as input
    • call the linker with special linker options and the linker script
      • link the helper ”.gdb” ELF (used for debugging with gdb)
      • link an intermediate ELF
    • call the elf2flt helper with the intermediate ELF
  • elf2flt creates the final FLAT executable

So that people need not run these programs themselves, the real linker is renamed so that gcc transparently calls the ld-elf2flt helper in place of the real linker. This is accomplished by renaming the real linker from ld to ld.real and installing ld-elf2flt as ld. At runtime, ld-elf2flt (now named ld) will be executed by gcc and it will in turn locate ld.real.

Source Code

Releases of elf2flt are pretty much never made. The typical model is for a current snapshot to be taken of the repository, integrated into the toolchain, and then never touched again. The repository is always kept in working order.

The official elf2flt source can be found here:

For people who prefer git, a mirror has been created here:

flthdr (FLAT Header)

The flthdr utility allows you to tweak the header of FLAT files so as to tweak runtime parameters. Most often, people wish to increase the stack size, or tweak the compression settings.

usage: flthdr [options] flat-file
       Allows you to change an existing flat file

       -p      : print current settings
       -P      : print relocations
       -z      : compressed flat file
       -d      : compressed data-only flat file
       -Z      : un-compressed flat file
       -r      : ram load
       -R      : do not RAM load
       -k      : kernel traced load (for debug)
       -K      : normal non-kernel traced load
       -u      : place stack in L1 scratchpad memory
       -U      : place stack in normal SDRAM memory
       -s size : stack size
       -o file : output-file
                 (default is to modify input file)