Skip navigation

ELFLib—The ELF Library from the Embedded Experts

  • Fast
  • No viral licensing (no 3rd party code)
  • Support for ELF output from different compilers
  • Cross platform (Windows, Linux, macOS)
  • Simple API

The SEGGER ELFLib is a library for extracting various information from ELF files, be it generic ELF related information (e.g. section information), or compiler specific debugging information (e.g. variables/functions, their types, address, ...)

The SEGGER ELFLib is the preferred solution when creating visualization utilities, target control utilities and similar, that need to connect target application information to user interaction and/or data representation. The SEGGER ELFLib allows to extract debugging information like addresses of variables etc. from target applications. While DWARF specifies how to interpret debugging information in general, there are many differences between various compilers which is the main reason why usually one IDE cannot handle ELF files that have been generated by another one. The SEGGER ELFLib overcomes such problems.

What is ELF?

The Executable and Linkable Format (ELF) describes a standard for executable files, object code and similar. While ELF defines the structure of the file (where to find what information) it is often combined with the DWARF debugging format to specify a way to represent debugging information like where which variable is present in memory, of which type it is and similar.

Usage scenarios

Many IDEs have various ways of displaying and interpreting data that is collected by the target application. However, in many cases, these ways of displaying data do not fit the specific needs in specific cases and bound the development to a specific IDE which may not be available for specific architectures. With the SEGGER ELFLib it is possible to create own applications that can visualize such data and there is no more dependency on the IDE that is used during development.

A real world use case of the SEGGER ELFLib is monitoring and modifying variable values of the target application running on an embedded system, without the need to implement an extra protocol etc. in the application itself, to get the data of the variable. For example, the SEGGER J-Scope software also uses the SEGGER ELFLib to extract information about what variables are present in a target application, so the user can select which ones to visualize.

Another use case of the ELFLib is for example to create a graphical user interface to control the behavior of an embedded target, without implementing a specific protocol etc. for this, by using modifying values of various variables inside the target application This way, the target application itself would not need to be modified (avoiding unnecessary code and saving space in memory) and would be directly usable on any target application.

Deliverables

The SEGGER ELFLib is delivered as a static library (with the option on source code) and available for Windows, Linux and MacOS. The shipment comes with a sample application that demonstrates the usage of the API of the ELFLib. 

Licensing

The ELFLib is licensed on a company wide license, meaning that after the library has purchased once, as many utilities as liked can be created and used inside the company that purchased the ELFLib.