Re: C Linker/Compiler question

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

          From comp.compilers

Related articles
C Linker/Compiler question frgirard@globetrotter.net (Francis Girard) (2000-04-20)
Re: C Linker/Compiler question jhallen@world.std.com (2000-04-25)
Re: C Linker/Compiler question agold@bga.com (Arthur H. Gold) (2000-04-25)
Re: C Linker/Compiler question frgirard@globetrotter.net (Francis Girard) (2000-04-26)
Re: C Linker/Compiler question agold@bga.com (Arthur H. Gold) (2000-04-30)
Re: C Linker/Compiler question jaxon@soltec.net (Greg Jaxon) (2000-04-30)
Re: C Linker/Compiler question eeide@cs.utah.edu (Eric Eide) (2000-05-04)
Re: C Linker/Compiler question cosmic@cosmic-software.se (Bengt Farre) (2000-05-12)
| List of all articles for this month |
From: "Arthur H. Gold" <agold@bga.com>
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.


HTH,
--ag


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 cs.utexas.edu account for more info)
mailto:agold@bga.com or mailto:agold@cs.utexas.edu


Post a followup to this message

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