, Johann Schmitz

The gold linker is a new ELF included in the binutils package since version 2.19. It was implemented by Ian Lance Taylor so I leave the technical introduction to him. And of course Diego wrote some nice things about it.

So what we can gain from its usage compared to the bfd linker:

  1. faster and more efficient linking (5 times have been estimated)

  2. Detection of underlinking. I won't go into details, but read this post post for more details

So if you like to try it, use following little hack. But BE WARNED, things are likely to get broken, so don't use this on system packages and the kernel.

_gold() {  
    pushd /usr/bin  
    ln -sf x86_64-pc-linux-gnu-ld.${1} ld  
    ln -sf /usr/x86_64-pc-linux-gnu/bin/ld.${1} x86_64-pc-linux-gnu-ld

    cd /usr/x86_64-pc-linux-gnu/bin/  
    ln -sf /usr/x86_64-pc-linux-gnu/binutils-bin/2*/ld.${1} ld


setgold() {  
   _gold gold  

unsetgold() {  
   _gold bfd