This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcov with dynamic c++ libraries


Evan Bigall wrote:
./a.out: relocation error: foo.so: undefined symbol: __bb_init_func

This function is only in the static libgcc.a library, it is not in the shared libgcc_s.so library. It isn't documented why, but I suspect it is because it uses other library routines, such as open and read, and we normally would not want to require definitions of those when linking with libgcc.


The shared library is used by default for C++ as this is needed for throwing exceptions across libraries. See the discussion of the --shared-libgcc/--static-libgcc options in the manual. So yes, there does seem to be a problem.

You might be able to solve it by explicitly linking the executable with the static libgcc.a library, in order to get this function resolved. Or maybe using --static-libgcc on the executable link will work.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]