Re: C Linker/Compiler question

jhallen@world.std.com (Joseph H Allen)
25 Apr 2000 02:22:29 -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: jhallen@world.std.com (Joseph H Allen)
Newsgroups: comp.compilers
Date: 25 Apr 2000 02:22:29 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 00-04-150
Keywords: linker

Francis Girard <frgirard@globetrotter.net> 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
>holes 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.


>[Interesting question, the answer as far as I know is "no" unless you
>want to massage the ELF files yourself. -John]


This should be possible. Use the -i or -r option of ld to
incrementally link the object modules together into a single large
object module. I think most ld's should have this option since the
load format and object format on most UNIX's is the same. The only
problem is that you probably want to strip many of the symbols after
this process, but not all of them. I don't think 'strip' or 'ld' can
do that, but it should be an easy change. You would have to provide
some kind of list of the symbols which are to publically visible from
the library.
--
/* jhallen@world.std.com (192.74.137.5) */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
[You can certainly make a single .o that way, but it's not really
a library. -John]





Post a followup to this message

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