This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcov with dynamic c++ libraries
- From: Jim Wilson <wilson at specifixinc dot com>
- To: evan at whereisevan dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 19 Dec 2003 12:43:41 -0800
- Subject: Re: gcov with dynamic c++ libraries
- References: <20031218042329.84845.qmail@web108.biz.mail.yahoo.com>
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