gold-linker

Is binary linked with gold linker running faster?

对着背影说爱祢 提交于 2019-12-02 03:02:31
Running simulation code using GEANT4 (large Monte Carlo C++ simulation framework, lots of shared libraries). Compiled and linked GEANT and my app with gold linker and with standard BFD based linker. Looks like gold one is running a bit faster (1'47" vs 1'51"). Could someone shed a light what would be the reason for the difference? Ubuntu 15.04, 64bit, GCC 4.9.2. Run each test about 10 times, lowest time taken, no other activity, one terminal. Naturally, different linkers will produce different results, just like different compilers do. The result mostly depends on the optimization options that

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

不打扰是莪最后的温柔 提交于 2019-12-02 01:12:43
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 nothing except call dlopen() dlclose() in main. The test code like: int main() { for(int i=0;i<1000;i++) { void * h=dlopen(filepath); if(h) dlclose(h); } return 0; } Than I checked the memory cat /proc/pid/maps before and after I found only heap changes bigger and bigger every time. About 90M after 1000 time call dlopen & dlclose to me 90M is still too

Requirements to use flto

笑着哭i 提交于 2019-11-29 09:31:26
If I want to compile my project with -flto is it enough to have built gcc with --enable-gold or do I also need to build gold and replace ld with it? And do I need any other flags? Ie I'm doing this gcc -flto one.c two.c According to https://gcc.gnu.org/wiki/LinkTimeOptimization#Requirements , Despite the " link time " name, LTO does not need to use any special linker features. The basic mechanism needed is the detection of GIMPLE sections inside object files. This is currently implemented in collect2 . Therefore, LTO will work on any linker already supported by GCC. Furthermore, the GCC

Requirements to use flto

蹲街弑〆低调 提交于 2019-11-27 06:49:52
问题 If I want to compile my project with -flto is it enough to have built gcc with --enable-gold or do I also need to build gold and replace ld with it? And do I need any other flags? Ie I'm doing this gcc -flto one.c two.c 回答1: According to https://gcc.gnu.org/wiki/LinkTimeOptimization#Requirements, Despite the " link time " name, LTO does not need to use any special linker features. The basic mechanism needed is the detection of GIMPLE sections inside object files. This is currently implemented

Replacing ld with gold - any experience?

心已入冬 提交于 2019-11-27 00:16:30
Has anyone tried to use gold instead of ld ? gold promises to be much faster than ld , so it may help speeding up test cycles for large C++ applications, but can it be used as drop-in replacement for ld? Can gcc / g++ directly call gold .? Are there any know bugs or problems? Although gold is part of the GNU binutils since a while, I have found almost no "success stories" or even "Howtos" in the Web. ( Update: added links to gold and blog entry explaining it ) nob At the moment it is compiling bigger projects on Ubuntu 10.04. Here you can install and integrate it easily with the binutils-gold