gold (linker)
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 |
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 package due to concerns it is suffering from bitrot after Google's interest has moved to LLVM.[6] In particular, gold does not read LDFLAGS variable, so cannot see libraries in folders like /usr/local/lib.
On 2025年02月02日 the 2.44 version of GNU Binutils removed gold from the default source distribution and into a separate package, stating that "the gold linker is now deprecated and will eventually be removed unless volunteers step forward and offer to continue development and maintenance".[7]
See also
[edit ]- Comparison of executable file formats, also for PE/COFF (Windows), and Mach-O (Mac OS X) formats.
References
[edit ]- ^ "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[...]
- ^ Ian Lance Taylor (2008年03月22日). "New ELF linker code added to GNU binutils". binutils mailing list. Retrieved 2020年04月28日.
- ^ a b Ian Lance Taylor (2008年04月04日). "gold: Google Releases New and Improved GCC Linker". Google Open Source Blog. Retrieved 2020年04月28日.
- ^ Ian Lance Taylor (2008). A New ELF Linker. GCC Developers' Summit. pp. 129–136. Retrieved 2020年04月28日.
- ^ "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.
- ^ 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日.
- ^ Nick Clifton (2024年02月02日). "GNU Binutils 2.44 Released". LWN.net . Retrieved 2025年02月07日.
External links
[edit ]- 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日.
This programming-tool-related article is a stub. You can help Wikipedia by expanding it.