Gold (linker)

Last updated
gold
Developer(s) Ian Lance Taylor
Written in C++
Operating system GNU
Platform x86, x86-64, ARM, PowerPC, TileGX
Type Linker
License GNU General Public License version 3
Website sourceware.org/binutils/

In software engineering, gold is a linker for ELF files. It became an official GNU package and was added to binutils in March 2008 [1] [2] and first released in binutils version 2.19. gold was developed by Ian Lance Taylor and a small team at Google. [3] The motivation for writing gold was to make a linker that is faster than the GNU linker, [3] especially for large applications coded in C++.

Contents

Unlike the GNU linker, gold does not use the BFD library to process object files. While this limits the object file formats it can process to ELF only, it is also claimed to result in a cleaner and faster implementation without an additional abstraction layer. The author cited complete removal of BFD as a reason to create a new linker from scratch rather than incrementally improve the GNU linker. [4] This rewrite also fixes some bugs in old ld that break ELF files in various minor ways. [5]

To specify gold in a makefile, one sets the LD or LD environment variable to ld.gold. To specify gold through a compiler option, one can use the gcc option -fuse-ld=gold.

Fedora has moved gold from binutils into its own package due to concerns it is suffering from bitrot after Google's interest has moved to LLVM. [6]

See also

Related Research Articles

<span class="mw-page-title-main">Executable and Linkable Format</span> Standard file format for executables, object code, shared libraries, and core dumps.

In computing, the Executable and Linkable Format, is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems. In 1999, it was chosen as the standard binary file format for Unix and Unix-like systems on x86 processors by the 86open project.

<span class="mw-page-title-main">Linker (computing)</span> Computer program which combines multiple object files into a single file

In computing, a linker or link editor is a computer system program that takes one or more object files and combines them into a single executable file, library file, or another "object" file.

<span class="mw-page-title-main">Red Hat Linux</span> Linux distribution

Red Hat Linux was a widely used commercial open-source Linux distribution created by Red Hat until its discontinuation in 2004.

<span class="mw-page-title-main">GNU Project</span> Free software project

The GNU Project is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and computing devices by collaboratively developing and publishing software that gives everyone the rights to freely run the software, copy and distribute it, study it, and modify it. GNU software grants these rights in its license.

An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the same machine code can be packaged in different object file formats. An object file may also work like a shared library.

The Binary File Descriptor library (BFD) is the GNU Project's main mechanism for the portable manipulation of object files in a variety of formats. As of 2003, it supports approximately 50 file formats for some 25 instruction set architectures.

MinGW, formerly mingw32, is a free and open source software development environment to create Microsoft Windows applications.

The archiver, also known simply as ar, is a Unix utility that maintains groups of files as a single archive file. Today, ar is generally used only to create and update static library files that the link editor or linker uses and for generating .deb packages for the Debian family; it can be used to create archives for any purpose, but has been largely replaced by tar for purposes other than static libraries. An implementation of ar is included as one of the GNU Binutils.

Buffer overflow protection is any of various techniques used during software development to enhance the security of executable programs by detecting buffer overflows on stack-allocated variables, and preventing them from causing program misbehavior or from becoming serious security vulnerabilities. A stack buffer overflow occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed-length buffer. Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for that buffer. This almost always results in corruption of adjacent data on the stack, which could lead to program crashes, incorrect operation, or security issues.

<span class="mw-page-title-main">LLVM</span> Compiler backend for multiple programming languages

LLVM is a set of compiler and toolchain technologies that can be used to develop a frontend for any programming language and a backend for any instruction set architecture. LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety of transformations over multiple passes. The name LLVM originally stood for Low Level Virtual Machine, though the project has expanded and the name is no longer officially an initialism.

readelf is a program for displaying various information about object files on Unix-like systems such as objdump. It is part of the GNU binutils.

The GNU Assembler, commonly known as gas or as, is the assembler developed by the GNU Project. It is the default back-end of GCC. It is used to assemble the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.

Technical variations of Linux distributions include support for different hardware devices and systems or software package configurations. Organizational differences may be motivated by historical reasons. Other criteria include security, including how quickly security upgrades are available; ease of package management; and number of packages available.

<span class="mw-page-title-main">David S. Miller</span> American software programmer

David Stephen Miller is an American software developer working on the Linux kernel, where he is the primary maintainer of the networking subsystem and individual networking drivers, the SPARC implementation, and the IDE subsystem. With other people, he co-maintains the crypto API, KProbes, IPsec, and is also involved in other development work.

<span class="mw-page-title-main">Mathomatic</span> Computer algebra system

Mathomatic is a free, portable, general-purpose computer algebra system (CAS) that can symbolically solve, simplify, combine, and compare algebraic equations, and can perform complex number, modular, and polynomial arithmetic, along with standard arithmetic. It does some symbolic calculus (derivative, extrema, Taylor series, and polynomial integration and Laplace transforms), numerical integration, and handles all elementary algebra except logarithms. Trigonometric functions can be entered and manipulated using complex exponentials, with the GNU m4 preprocessor. Not currently implemented are general functions like f(x), arbitrary-precision and interval arithmetic, and matrices.

objdump is a command-line program for displaying various information about object files on Unix-like operating systems. For instance, it can be used as a disassembler to view an executable in assembly form. It is part of the GNU Binutils for fine-grained control over executables and other binary data. objdump uses the BFD library to read the contents of object files. Similar utilities are Borland TDUMP, Microsoft DUMPBIN and readelf.

<span class="mw-page-title-main">GNU Binutils</span> Software development tools

The GNU Binary Utilities, or binutils, are a set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.

<span class="mw-page-title-main">Fiwix</span> Operating system

Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobbyist operating system, but it also serves for educational purposes. It runs on the i386 hardware platform and is compatible with a good base of existing GNU applications. It follows the System V Application Binary Interface and is also Linux 2.0 System Call ABI mostly compatible

Mingw-w64 is a free and open source software development environment to create (cross-compile) Microsoft Windows PE applications. It was forked in 2005–2010 from MinGW.

Advanced Matrix Extensions (AMX), also known as Intel Advanced Matrix Extensions, are extensions to the x86 instruction set architecture (ISA) for microprocessors from Intel and Advanced Micro Devices (AMD) designed to work on matrices to accelerate artificial intelligence (AI) / machine learning (ML) -related workloads.

References

  1. "gold README: Rewrite, with some notes on unsupported features". 2008-03-25. Retrieved 2020-04-28. It is a GNU program, and therefore follows the GNU formatting standards[...]
  2. Ian Lance Taylor (2008-03-22). "New ELF linker code added to GNU binutils". binutils mailing list. Retrieved 2020-04-28.
  3. 1 2 Ian Lance Taylor (2008-04-04). "gold: Google Releases New and Improved GCC Linker". Google Open Source Blog. Retrieved 2020-04-28.
  4. Ian Lance Taylor (2008). A New ELF Linker. GCC Developers' Summit. pp. 129–136. Retrieved 2020-04-28.
  5. "ElflintGNU". sourceware.org. Retrieved 2020-04-28. eu-elflint has a flag '--gnu-ld' described as "Binary has been created with GNU ld and is therefore known to be broken in certain ways". Note that by GNU ld the original GNU binutils ld is meant, not the newer GNU binutils gold linker.
  6. Michael Larabel (2019-02-24). "GNU's Gold Linker Is Stagnating, Fedora Looking To Punt It Off Into A Separate Package". Phoronix . Retrieved 2021-02-03.