www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/04/04:01:59

Date: Tue, 4 Nov 1997 09:59:36 +0100 (MET)
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
To: DJGPP mailing list <djgpp AT delorie DOT com>
Subject: Re: ELF-binary format object file?
In-Reply-To: <63jqeh$nu2@freenet-news.carleton.ca>
Message-ID: <Pine.LNX.3.95.971104095509.4886B-100000@trompete.hrz.tu-chemnitz.de>
MIME-Version: 1.0

On 3 Nov 1997, Paul Derbyshire wrote:

> 
> Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) writes:
> > On Thu, 30 Oct 1997, Salvador Eduardo Tropea (SET) wrote:
> > 
> >> Yes, gcc (ld to be more exact) can generated dynamically linked
> >> libraries, they are much more powerful than the (dead brain) M$ DLL
> >> idea.
> >> This helps in too aspects: saves disk space and saves memory.
> > 
> > This was also discussed a lot.  To put the advantages in perspective,
> > I'd like to point out that shared libraries have two DISadvantages:
> > 
> >        - The shared library includes ALL of libc, so if the loader
> >          loads it in its entirety, you actually *waste* memory (since
> >          it's a rare program that uses all of the libc).
> 
> Not if each .o of libc is dynamically-linked independently the way they
> are now statically linked independently.

I don't know from where you got this information or how you tested
it, but I did it (with a 'hello world' program) and here the results
(of course from linux, since DJGPP has no DLL support):

/* file test.c */
#include <stdio.h>

int main()
{
  printf("Hello world\n");
  getchar();
  return 0;
}

/* End of test.c */

/* Now compiling two executables:
gcc -o test.dyn -O -s test.c
gcc -o test.sta -O -s -static test.c
ls -l test.dyn test.sta
-rwxr-xr-x   1 rho      users        2680 Nov  3 18:18 test.dyn*
-rwxr-xr-x   1 rho      users       84084 Nov  3 18:18 test.sta*

Now starting each program on a different console and
obtaining the information via ps from a third console:

  VSZ   RSS  COMMAND
=====================
   96    52  test.sta
  788   216  test.dyn


As you can see, the dynamic linked program uses much more
memory (216K) than the static linked one (52K). And as the
prices for a meg of RAM are much higher than for a meg of
HD, I would prefer to use the static methode :-)

*/


> That is a potential problem. The solution is to let older programs
> continue to use the static library version built in, and to ensure that
> any and all shared libraries:
> a) are distributed as bug free as possible

Hey!! Does this mean that the current libraries are not distributed
with the same goal?

Do you have really seen any library which is bug free?

Robert
******************************************************
* Robert Hoehne <robert DOT hoehne AT gmx DOT net>              *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019