I want to use gold as my system linker instead of ld as ld doesn't support -fPIC and -shared. I followed this particular url to do so, gold-plugin As per the documentation, I ran gcc -v filename.c to find out what link command gcc would run. Then it tells me to check for line that runs collect2 and replace it with -plugin /path/to/LLVMgold.so. But gcc and collect2 are binary files. I studied a bit..and understood gcc calls collect2 ,in turn collect2 calls system linker ld by searching for ld-linux.so.2. I have rpm packeage of gcc4.4.4 installed on my fedora...how can I change my configuration.
How can I make gcc call ld-new/gold instead of collect2?
I'm a bit late to answer, but I realised Fedora comes out with gold distributed with binutils. The command is ld.gold
. You can select it as the default linker using alternatives
:
# alternatives --config ld
There is 2 program that provides 'ld'.
Selection Command
-----------------------------------------------
*+ 1 /usr/bin/ld.bfd
2 /usr/bin/ld.gold
Enter to keep the current selection[+], or type selection number: 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With