Re: C Linker/Compiler question (Joseph H Allen)
25 Apr 2000 02:22:29 -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: (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 <> 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.
/* ( */ /* 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)
]?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.