Questions tagged [gold-linker]

`gold` is the name of a ELF linker included in binutils

gold is an linker included in binutils as a faster, ELF-only, alternative to the traditional linker known as ld or ld.bfd.

Is considered in beta. (as of February, 2013, binutils release 2.23-1)

It was started on Google and then release as open source and added to binutils.

50 questions
4
votes
2 answers

Enabling the gold linker on Freebsd

I have been trying to enable the gold linker on FreeBSD to use the link time optimizations. I made gold from the binutils under /usr/ports. After building binutils using make -k install clean i got ld under /usr/bin and in the directory…
4
votes
1 answer

Trying to build binutils with --enable-gold

Following instructions from this site: http://llvm.org/docs/GoldPlugin.html From the command: ../binutils/configure --enable-gold --enable-plugins --disable-werror I get a warning saying: configure: WARNING: unrecognized options:…
drum
  • 5,416
  • 7
  • 57
  • 91
3
votes
0 answers

gcc 9.2: spurious -Wuninitialized

I am trying to build our code base with gcc 9.2.0, but when using -flto, I get a dozen warnings with missing information. These issues did not arise with gcc6.3. : In member function ‘__ct_base ’: : error: is used…
Julien Vivenot
  • 2,230
  • 13
  • 17
3
votes
2 answers

How to force GCC to use ld.gold if real-ld executable exists in compiler search path?

I've found out that when GCC (tried on GCC 4.8 and GCC 6.4) finds real-ld executable in its search path, it is silently ignoring -fuse-ld=... option, and use real-ld instead of appropriate linker. $ echo "int main(){}" > script.c $ ln -s /usr/bin/ld…
Kuchara
  • 622
  • 7
  • 16
3
votes
1 answer

Dlclose can't work if make an empty dso with link -static-libstdc++

I want to Compiling / linking the whole stdlibc+ into a so to independence with C++ support. So I make an empty so file with only contains declare extern "C" void * __dso_handle = 0 and export all symbols link it…
TQ.Liu
  • 81
  • 6
3
votes
1 answer

Referring to a specific symbol in a static library with the GNU gold linker

When laying out symbols in the address space using a linker script, ld allows to refer to a specific symbol coming from a static library with the following syntax: archive.a:object_file.o(.section.symbol_name) Using gold rather than ld, it seems…
3
votes
1 answer

Linker Error when Compiling Autotooled projects to LLVM Bitcode

I followed the instructions on http://gbalats.github.io/2015/12/10/compiling-autotooled-projects-to-LLVM-bitcode.html#compiling-llvm-from-source-with-gold-plugin to try to compile various projects including the coreutils to LLVM IR. I tried to test…
box
  • 3,156
  • 3
  • 26
  • 36
3
votes
1 answer

gentoo ld.gold failed on sys-libs/db

I've recently switched from default binutils linker ld.bfd to ld.gold (to get link time optimization working and why not?). It was made by manual (like here: http://wiki.gentoo.org/wiki/Gold). As the result I got chain of symlinks from /usr/bin/ld…
Alexander Sergeyev
  • 922
  • 10
  • 19
3
votes
1 answer

Gold plugin for LLVM 3.3

I built LLVM and was using it, now I want to add Gold plug-in to use as linker, I just followed "build gold with plugin support" in LLVM website,and now have ld-new but I dont want to rebuild LLVM agian, is there any way to add this plugin without…
khalil Saedi
  • 93
  • 1
  • 7
2
votes
1 answer

Link static library directly into an executable using ld.gold

I have an libfoo.a which contains _start and all required symbols for an executable. ld.bfd -o foo libfoo.a works smoothly in my case. However, ld.gold -o foo libfoo.a fails silently generating an executable with no symbols from libfoo.a. Creating…
lz96
  • 2,816
  • 2
  • 28
  • 46
2
votes
0 answers

static link stdc++ without STB_GNU_UNIQUE cause memory leak when dlclose

I have to make a dso that static link stdc++ and need can unload from memory dynamic. So I tried with compile gcc with --disable-gnu-unique-object and use gold link with -Wl,--no-gnu-unique options. But both contains memory leak issue even I do…
TQ.Liu
  • 81
  • 6
2
votes
1 answer

c++17, lto, -static-libstdc++ issue: Warning: relocation refers to discarded section with ld.gold, then segfault in __run_exit_handlers

I am after some suggestions as to how to go about debugging a significant problem that I cannot reduce to a minimal example. The problem: I compile my application which links to a number of different libraries. The flags include: -static-libstdc++…
Andrew
  • 277
  • 3
  • 11
2
votes
1 answer

Does binutils-gold has support for arm/Android?

I am trying to replace my default arm-eabi-ld with installed from binutils-gold ld, however during linking I have got (..../*.o) requires unsupported dynamic reloc; recompile with -fPIC LOCAL_CFLAGS := -fPIC in Android.mk doesn't help very much. Is…
noisy
  • 6,495
  • 10
  • 50
  • 92
2
votes
1 answer

Why does the gold linker cause dl_iterate_phdr() not to return my custom note section?

On Linux, I would like to store some structures in a custom .note.foobar section and discover them at runtime. I compile and link the program below once with gold and once without: $ gcc -o test-ld test.c $ gcc -o test-gold -fuse-ld=gold test.c You…
Nick Rolfe
  • 68
  • 5
1
vote
0 answers

error: cannot use ‘typeid’ with -fno-rtti

I haven't passed any flag like -fno-rtti. http://blog.binpang.me/2018/09/27/llvm-gold/ I'm following this link. mkdir build cd build ../binutils/configure --enable-gold=default --enable-plugins --disable-werror make all-gold cmake ../llvm…
NobinPegasus
  • 545
  • 2
  • 16