gold (连结器)

维基百科,自由的百科全书

gold
开发者Ian Lance Taylor
编程语言C++
操作系统GNU
平台x86, x86-64, ARM, PowerPC, TileGX
类型链接器
许可协议GNU通用公共许可证第三版
网站sourceware.org/binutils/

在软体工程中,goldELF档案的链接器。其在2008年3月成为官方GNU软体包并被加入至GNU Binutils[1][2],第一次释出是在binutils 2.19中。gold是由Ian Lance Taylor与Google的一个小团队开发的[3]。编写gold的动机是要制作一个比GNU连结器更快的连结器[3],特别是对于使用C++编写的大型应用程序

与GNU连结器不同,gold并不会使用BFD函式库来处理目的档。虽然这限制了其只能处理ELF的目的档格式,但其也声称可以在没有额外抽象层的情况下有更清晰且更快的实作。作者提到了完全移除BFD作为从头开发新连结器而非逐步改进GNU连结器的原因[4]。这个重写也修复了旧的ld的一些Bug,这些Bug以各种小问题破坏ELF档案[5]

要在Makefile中指定gold,可以将LD或LD环境变量设定为ld.gold。要透过编译器选项指定gold,可以使用GCC选项-fuse-ld=gold

Fedora已将gold从binutils移转到自己的软体包中,因为担心在Google的兴趣转移到LLVM后会有软件腐败的问题[6]

参见[编辑]

参考资料[编辑]

  1. ^ gold README: Rewrite, with some notes on unsupported features.. 2008-03-25 [2020-04-28]. (原始内容存档于2022-04-08). It is a GNU program, and therefore follows the GNU formatting standards[...] 
  2. ^ Ian Lance Taylor. New ELF linker code added to GNU binutils. binutils mailing list. 2008-03-22 [2020-04-28]. (原始内容存档于2022-04-08). 
  3. ^ 3.0 3.1 Ian Lance Taylor. gold: Google Releases New and Improved GCC Linker. Google Open Source Blog. 2008-04-04 [2020-04-28]. (原始内容存档于2022-03-21). 
  4. ^ Ian Lance Taylor. A New ELF Linker. GCC Developers' Summit: 129–136. 2008 [2020-04-28]. (原始内容存档于2022-04-08). 
  5. ^ ElflintGNU. sourceware.org. [2020-04-28]. (原始内容存档于2022-03-24). 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. 
  6. ^ Michael Larabel. GNU's Gold Linker Is Stagnating, Fedora Looking To Punt It Off Into A Separate Package. Phoronix. 2019-02-24 [2021-02-03]. (原始内容存档于2022-04-08). 

外部链接[编辑]