- Source: Gold (linker)
In software engineering, gold is a linker for ELF files. It became an official GNU package and was added to binutils in March 2008 and first released in binutils version 2.19. gold was developed by Ian Lance Taylor and a small team at Google. The motivation for writing gold was to make a linker that is faster than the GNU linker, 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. This rewrite also fixes some bugs in old ld that break ELF files in various minor ways.
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.
See also
Comparison of executable file formats, also for PE/COFF (Windows), and Mach-O (Mac OS X) formats.
References
External links
Ian Lance Taylor (2007-08-22). "Linkers part 1". Retrieved 2020-04-28.
Edge, Jake (2008-03-26). "Striking gold in binutils". LWN.net. Retrieved 2020-04-28.
"The LLVM gold plugin". LLVM.
Coutant, Cary (2012-04-05). "Incremental Linking with Gold" (PDF). Linux Foundation Collaboration Summit.
"Incremental Linking with Gold". 2012 Linux Foundation Collaboration Summit. 2012-04-11. Archived from the original on 2017-02-02. Retrieved 2017-01-22.