Monday, February 3, 2025

Why the name BFD linker?

 The Linux linker got its name "BFD Linker" because of a fascinating piece of history.

What's BFD?

BFD stands for Binary File Descriptor. It's a library and set of tools created in 1996 by Adam Beneschan, originally at Red Hat. The primary goal was to provide a unified interface for working with various file formats, including binary executables, object files, libraries, and archives.

Why the BFD linker?

The first implementation of the Linux linker (link editor) was called `ld` (short for link editor). In 1997, David S. Miller, a key figure in the development of the Linux kernel, started working on a new version of the linker that would utilize the BFD library.

This new version, also named `ld`, used BFD as its backend to manage and manipulate binary files. As a result, the linker became known as the BFD Linker or BFD ld, in honor of its BFD foundation.

Why is it the default linker?

Today, the BFD linker (or simply `ld`) remains the default linker on Linux because:

1. Maturity and stability: The BFD linker has been around for a long time (over 25 years now) and has been extensively tested and refined.

2. Feature set: It supports an impressive range of formats, including ELF (Executable and Linkable Format), a.out, COFF, and more.

3. Portability: The BFD linker is designed to be highly portable across various architectures, making it an ideal choice for Linux's diverse hardware ecosystem.

4. Industry adoption: As the default linker on many Linux distributions, including Red Hat Enterprise Linux (RHEL), CentOS, and Fedora, the BFD linker has become a de facto standard.

Other linkers

While `ld` (BFD Linker) is the default linker on most Linux systems, there are other linkers available for specific use cases or architectures:

* gold: A fast and modular linker developed by Red Hat.

* lld: The LLVM Linker, which offers a different approach to linking using the LLVM infrastructure.

These alternatives often coexist alongside `ld` (BFD Linker) in Linux distributions.

No comments: