[ale] Compiling ssh

Fulton Green ale at FultonGreen.com
Thu Dec 28 16:15:47 EST 2000


Yes and no. :)

This may be rehashing computer science stuff, but this is my understanding
of static linking (someone feel free to correct me):

- The static library file is basically an archive of object files (those .o
  files) with a table of contents (or index, if you prefer) of symbols
  (names and signatures of functions, variables, etc.)
- During linkage, if a symbol needing to be resolved is found within the
  static library, the code for the *entire object* file containing the
  symbol is bound to the executable.

So if you had a library containing fifteen functions spread out through five
object files, but the function you needed was in an object file containing
three of the functions (including the one you needed), your resulting
executable image would contain those three functions.

HTH.

On Thu, Dec 28, 2000 at 03:45:28PM -0500, Chris Fowler wrote:
> I believe it is --staic.  But does that link the whole library, including
> functions that are not used?
> 
> -----Original Message-----
> From: Fulton Green [mailto:ale at FultonGreen.com]
> Sent: Thursday, December 28, 2000 3:40 PM
> To: Chris Fowler
> Cc: ale at ale.org
> Subject: Re: [ale] Compiling ssh
> 
> 
> If you look hard enough through GCC help docs, there's probably a switch
> mechanism that "turns on" static linking for libraries that follow it until
> a "turns off" switch is encountered. The IBM CSet++ compiler had that
> feature (I want to say the flags were something like -static and -dynamic).
> I had to use it to force static binding of core C++ routines due to
> incompatibilites btw versions of AIX.
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list