This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Tricky wrapping problem
- From: "Mike McTernan" <mmcternan at airvana dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 6 Feb 2009 15:58:39 -0000
- Subject: Tricky wrapping problem
Hi,
I'm trying to wrap the functions in a library and having some problems
when static linking with GNU ld version 2.17.
The setup is that the library (actually linuxthreads) exports a bunch of
functions, but also makes use of some of its own functions internally
(mainly pthread_cond funcs). The problem is that I only want to wrap
the functions as used by the external API, and not the internal usage so
as not to harm internal operations.
What I'd therefore like to do is get ld to resolve all references that
can be satisfied within the .a file itself as a first step, and to then
perform a link with the --wrap's and my application code.
I've been trying to use "ld -r libpthread.a -o n.a" and various other
options to try and resolve the internal references for a first pass, but
the output always comes out as a tiny file having been stripped of
symbols.
Are there any pointers or ideas as to how I can get this working?
Regards,
Mike