Re: Number of Objects in Static Link Library
- From: Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 02 Jul 2007 21:38:36 -0400
David T. Ashley wrote:
"Logan Shaw" <lshaw-usenet@xxxxxxxxxxxxx> wrote in message news:46893a21$0$30657$4c368faf@xxxxxxxxxxxxxxxxxDavid T. Ashley wrote:I've experimented with making Linux libraries (to shorten compile time) and statically linking against them. Works fine.I'm not an expert on linkers, but as far as I know, the linker on a Unix
Up until this time, I've generated the libraries from object files that each represent a related group of functions and their data (for example, common string operations not performed by the standard library). The end result (I assume) is that if a symbol in the object file is referenced, the entire object file (all functions) is dragged in, even if just one function (out of maybe dozens) is referenced.
system will typically pull in only those symbols which are actually needed.
Are you sure it's working the way you've described?
I haven't tested it, but I'm 75% sure. With most linkers, the minimum amount that can normally be pulled in is one "module" or "translation unit". This normally corresponds to a single .o file that comes from either compiling a .c file or assembling an assembly-language file.
My question is about breaking up .c file further so that each function is compiled individually, then letting the linker sort it out.
GMP is compiled this way.
Just not sure what maximums exist. Is 10,000 symbols too many? I'm not sure.
I'm not aware of any explicit limit -- but then, there are
a lot of things I'm not aware of ...
This seems like a question you could answer with a simple
experiment: Write yourself a script that generates and compiles
ten thousand files with ten thousand function names, and see
whether you can put 'em all in a library and link against it.
Ten minutes to whip the script together, about three hours for
the compilations ... as I write, some eight and a half hours
have elapsed since you first posed the question: you could have
had your answer twice by now!
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Number of Objects in Static Link Library
- From: David T. Ashley
- Re: Number of Objects in Static Link Library
- References:
- Number of Objects in Static Link Library
- From: David T. Ashley
- Re: Number of Objects in Static Link Library
- From: Logan Shaw
- Re: Number of Objects in Static Link Library
- From: David T. Ashley
- Number of Objects in Static Link Library
- Prev by Date: Re: Check if a pop server is alive
- Next by Date: Re: Number of Objects in Static Link Library
- Previous by thread: Re: Number of Objects in Static Link Library
- Next by thread: Re: Number of Objects in Static Link Library
- Index(es):
Relevant Pages
|