Gold (linker) explained

gold
Developer:Ian Lance Taylor
Programming Language:C++
Operating System:GNU
Platform:x86, x86-64, ARM, PowerPC, TileGX
Genre:Linker
License:GNU General Public License version 3

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++.

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 packagedue to concerns it is suffering from bitrotafter Google's interest has moved to LLVM.[6]

See also

External links

Notes and References

  1. Web site: gold README: Rewrite, with some notes on unsupported features.. 2008-03-25. It is a GNU program, and therefore follows the GNU formatting standards[...]. 2020-04-28.
  2. Web site: New ELF linker code added to GNU binutils. Ian Lance Taylor. 2008-03-22. binutils mailing list. 2020-04-28.
  3. Web site: gold: Google Releases New and Improved GCC Linker . Ian Lance Taylor. 2008-04-04. Google Open Source Blog. 2020-04-28.
  4. A New ELF Linker . Ian Lance Taylor . 2008 . . 129–136 . 2020-04-28.
  5. Web site: ElflintGNU. sourceware.org. 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.. 2020-04-28.
  6. Web site: GNU's Gold Linker Is Stagnating, Fedora Looking To Punt It Off Into A Separate Package . 2019-02-24 . Michael Larabel . Michael Larabel . . 2021-02-03.