Back to All
Developer Blog

ELD: Introducing a new open-source embedded linker tool for embedded systems

Sign up for Developer monthly newsletter-image

Sign up for Developer monthly newsletter

Join thousands of developers around the globe who receive latest news and updates from our monthly curated newsletter.

Sign up
Come for support, stay for the community-image

Come for support, stay for the community

Get support from experts, connect with like-minded developers, and access exclusive virtual events.

Join Developer Discord

At Qualcomm Technologies, Inc., embedded linkers play a crucial role in our software stack. While many linkers work well on traditional platforms, they often fall short when it comes to embedded systems.

Embedded projects have unique requirements, such as:

  • Heavy reliance on linker scripts, which are not typically a concern in host linking.

  • Complex use cases that often require custom extensions to linker functionality or linker scripts, tailored to meet specific customer needs.

To address these challenges, we developed a linker called eld, which is derived from mclinker. This linker is designed to work with ELF files and is specifically tailored to meet the needs of the embedded community.

The eld linker is included in the Qualcomm compiler toolchains and leverages LLVM components and libraries wherever possible. Our customers rely on eld to build images that run on Qualcomm Technologies hardware.

We are excited to open source the eld linker! Our goal is to collaborate with the linker and system software communities to develop new features and enhance its capabilities. Download eld from GitHub

Features

The linker is fully compliant with GNU standards, encompassing the reading of input files, symbol resolution, and the generation of GNU-compliant output.

The linker supports the following targets:

  • AArch32 and AArch64
  • Qualcomm Hexagon NPU
  • RISC-V (including the Xqci extension)

The linker incorporates various features commonly available in GNU-compliant linkers, including:

  • Partial linking
  • Dynamic linking
  • Static linking
  • Link Time Optimization (LTO)
  • Linker optimizations such as string merging

Additionally, the linker offers mature support for linker scripts with custom extensions.

Extended Features

The linker also includes numerous features aimed at enhancing user experience, such as:

  • Easy-to-read linker map files: Our customer support team extensively utilizes this information to diagnose and resolve issues. These map files are also machine-readable, enabling customers to generate custom reports from the images they build.

  • Easy reproduction of link-time issues: A unique method for customers to share artifacts used at link time when encountering link-time issues.

  • Comprehensive diagnostic options: Provides extensive debugging capabilities for complex issues such as symbol garbage collection, command-line issues, warnings, and errors.

Linker Plugins

In response to increasing customer demand for inspecting and altering image layouts, extending linker functionality for unanticipated use cases, and generating custom reports, we have developed linker plugins.

These plugins allow customers to create custom passes that run during link time, offering complete user control and management by the linker, with a focus on diagnostics.

The plugin infrastructure also allows toolchain developers to treat the linker as a transparent component, facilitating the careful management of assumptions in the image, emitting errors or warnings if assumptions are violated, and encoding information in source code for linker consumption.

This infrastructure also assists compiler developers with layout decisions, enabling them to:

  • Pass auxiliary information from the compiler to the linker

  • Optimize image layout for specific use cases

Qualcomm Technologies Products Utilizing the Linker

The linker is employed in various Qualcomm Technologies’ products, including:

  • Qualcomm AI software infrastructure
  • Qualcomm 5G modems
  • Wireless LAN products and drivers
  • Qualcomm firmware and device drivers
  • Qualcomm Audio drivers
  • TrustZone
  • Numerous AArch32/AArch64/RISC-V images utilizing Zephyr RTOS
  • Various microcontroller images based on RISC-V

 

Linker Source Organization

The linker source code is categorized into three major sections:

  • Core Linker (divided into functionally specific directories)
  • Target-specific overrides
  • Unit tests

The core linker encompasses the most critical features, while the target-specific overrides facilitate the customization of functionality provided by the core linker.

This encapsulation allows developers to modify and enhance target-specific functionality without impacting other targets.

The unit tests are divided into two categories:

  • Unit testing using Google Unit Tests
  • Lit tests using the LLVM lit test framework

Testing

The linker includes a comprehensive set of unit test cases that are designed to be easily readable and modifiable. These tests cover both the linker itself and various linker plugin examples, helping customers understand the robust linker plugin infrastructure.

Our team also performs testing for internal applications on both simulated and on-device platforms.

Eld documentation

The linker is accompanied by comprehensive user-facing documentation that elucidates linker behavior, as well as a thorough FAQ addressing common problems and solutions. 

Connect with us

The team is dedicated to continually assessing and introducing features that focus on the embedded community.

We invite you to join our efforts in improving the linker and making the solution better. Please feel free to open any issues you would like to work on on GitHub or share use cases that we do not currently support.

Closing Remarks

We hope that the embedded linker solution addresses the use cases you are aiming to solve.

We would also like to acknowledge the eld team and our entire LLVM team for their continuous contributions to enhancing the linker.

If you have any thoughts to share or would like to speak with us, please do not hesitate to reach out to our team on GitHub.

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries ("Qualcomm"). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.

Qualcomm-branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries.

About the Author
Shankar  Kalpathi Easwaran
Shankar Kalpathi EaswaranPrincipal Engineer
Qualcomm relentlessly innovates to deliver intelligent computing everywhere, helping the world tackle some of its most important challenges. Our leading-edge AI, high performance, low-power computing, and unrivaled connectivity deliver proven solutions that transform major industries. At Qualcomm, we are engineering human progress.

Stay connected

Get the latest Qualcomm and industry information delivered to your inbox.

Subscribe
Manage your subscription

© Qualcomm Technologies, Inc. and/or its affiliated companies.

Snapdragon and Qualcomm branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries. Qualcomm patented technologies are licensed by Qualcomm Incorporated.

Note: Certain services and materials may require you to accept additional terms and conditions before accessing or using those items.

References to "Qualcomm" may mean Qualcomm Incorporated, or subsidiaries or business units within the Qualcomm corporate structure, as applicable.

Qualcomm Incorporated includes our licensing business, QTL, and the vast majority of our patent portfolio. Qualcomm Technologies, Inc., a subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of our engineering, research and development functions, and substantially all of our products and services businesses, including our QCT semiconductor business.

Materials that are as of a specific date, including but not limited to press releases, presentations, blog posts and webcasts, may have been superseded by subsequent events or disclosures.

Nothing in these materials is an offer to sell or license any of the services or materials referenced herein.