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). 

外部連結[编辑]