opensource.google.com

Menu

gold: Google Releases New and Improved GCC Linker

Friday, April 4, 2008



I submitted my first patch to the GNU linker in 1992. In 1993 I knew enough about its shortcomings, and started to argue that we should rewrite it from scratch. In 2006, just 13 years later, and now working at Google, I finally got a chance to do it.

That work came to fruition last month, with the release
of gold to the open source community
. gold is a new linker, written from scratch. It really only has one new feature compared to the current GNU linker: it's much faster. I've measured it as five times faster linking large C++ applications. Since for most programmers the linker is nothing more than a roadblock between writing code and running the program, I figure that speed and correctness are the only really important features of any linker.

We've been using gold widely within Google as a beta test, and will soon be deploying it as the default linker internally. Now that it is part of the GNU binutils, my hope is that it will eventually become the default linker for all the free operating systems.

Getting gold to this point was the work of a small team at Google. It's a reasonably sized program — some 50,000 lines of commented C++ code. We're contributing it back to the open source community not because we have to, or because we expect some benefit, but simply because we can. Google gets a lot from the open source community, and we try to give a lot back.
.