Re: C Linker/Compiler question

"Arthur H. Gold" <>
25 Apr 2000 02:27:48 -0400

          From comp.compilers

Related articles
C Linker/Compiler question (Francis Girard) (2000-04-20)
Re: C Linker/Compiler question (2000-04-25)
Re: C Linker/Compiler question (Arthur H. Gold) (2000-04-25)
Re: C Linker/Compiler question (Francis Girard) (2000-04-26)
Re: C Linker/Compiler question (Arthur H. Gold) (2000-04-30)
Re: C Linker/Compiler question (Greg Jaxon) (2000-04-30)
Re: C Linker/Compiler question (Eric Eide) (2000-05-04)
Re: C Linker/Compiler question (Bengt Farre) (2000-05-12)
| List of all articles for this month |

From: "Arthur H. Gold" <>
Newsgroups: comp.compilers
Date: 25 Apr 2000 02:27:48 -0400
Organization: UTCS OOPS Group
References: 00-04-150
Keywords: linker

Francis Girard wrote:
> Is there a way to generate a library (with gcc, kcc or anything) that
> includes another library AND DOES some linking tasks by filling the
> wholes in the intermediate files (.o) we're including in the library
> we're trying to build with the code found in the library we're also
> including in that library we're trying to build.
> The goal is to not use another version of the same symbols when
> linking to an executable.

Unfortunately, I'm not sure I completely understand your question.
If, however, the situation is as follows:
------- --------
| app |-------------->| lib1 |
------- --------
      | |
      |--> symbol "a" |---> a different symbol "a" (from lib2)

Where lib1 is a shared object, you can do it by:
1) linking lib2 into lib1 statically _and_ symbolically
2) using a version script to decide what gets exported from lib1

I suggest you look at the info pages for ld for further information.

A different approach would be to develop wrapper code around the
functions you're interested in and use partial linking to create a
"library-like" .o file.

If you restate your problem a little more clearly, I (or someone else)
might be able to give you further help.


BTW -- I have needed to use a slew of similar mechanisms for a project
I've been working on (for far too long)...
Artie Gold, Austin, TX (finger the account for more info) or

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.