Harman Patil (Editor)

Gold (linker)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Ian Lance Taylor

Operating system
  
GNU

Written in
  
C++

Type
  
Linker

Platform
  
x86, x86-64, ARM, PowerPC

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 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 doesn't 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.

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

References

Gold (linker) Wikipedia