using profile guided optimization in shared library causes segfault

Philipp Münzel
Tue Jun 1 20:19:00 GMT 2010


I'm wondering why I can't find any information on the usage of PGO with 
shared libraries.
I found two unanswered questions via google that are pointing in the 

My basic setup is simple: gcc 4.5.0 release version (not cvs) and 
binutils 2.20 release version (not cvs) with --enable-gold option. 
Operating System is Linux Suse 11.2.

As long as I don't flag -fprofile-generate everything is well and my .so 
is dlopen()'ed by the main program and works flawlessly. Out of 
curiosity I tried PGO with it.
When compiled and linked with -fprofile-generate the library gets 
loaded, everything works, but when I end the main program I get a 
sigsegv with coredump.

I fed the corefile to gdb and got this:
#0 0x00000000 in ?? ()
No symbol table info available.
#1 0x1f32bc2f in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

And of course no .cdda files are saved.

Any ideas?


More information about the Gcc-help mailing list