comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Re: Why is memory footprint smaller when compiled static?
Date: Thu, 6 Jun 2002 10:35:21 +0000 (UTC)
Date: 2002-06-06T10:35:21+00:00	[thread overview]
Message-ID: <slrnafuen9.1h9.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: mailman.1023321903.7863.comp.lang.ada@ada.eu.org

On Wed, 5 Jun 2002 19:02:30 -0500, Steven Deller wrote:
> Preben,
> When you link with a shared library, everything in that shared library
> is loaded when it is loaded.  Everything, not just what you need.

Ah I see. Thanks!

> When you link statically, just what you need/use is included.  One
> caveat -- libraries, whether C or Ada, come in chunks (called object
> files) that often include many routines, so you get all of them even
> when you just want one.  Normally linkers can't do "dead code
> elimination", though some are getting almost smart enough to do that.

Ok.

> In your case, there are lots of parts of I/O and Ada that you are not
> using, so when you link statically, much of the library's contents are
> not included in the executable.

Yes. Ok now I understand and I learned something new :-)

Again thanks.

Preben Randhol



  reply	other threads:[~2002-06-06 10:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-05 11:37 Why is memory footprint smaller when compiled static? Grein, Christoph
2002-06-05 12:36 ` Preben Randhol
2002-06-05 13:42   ` Mark Johnson
2002-06-06  0:02   ` Steven Deller
2002-06-06 10:35     ` Preben Randhol [this message]
2002-06-06 14:26     ` Gautier
2002-06-06 15:08       ` Jean-Marc Bourguet
2002-06-06 15:24         ` Jean-Pierre Rosen
2002-06-06 19:35           ` Jeffrey Carter
2002-06-10 23:51     ` Randy Brukardt
2002-06-11  0:53       ` Robert A Duff
2002-06-11 16:45         ` Wes Groleau
2002-06-11 17:08           ` Preben Randhol
2002-06-11 19:12             ` Wes Groleau
2002-06-11 21:38               ` Randy Brukardt
2002-06-11 21:32         ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2002-06-04 15:14 Preben Randhol
2002-06-04 16:13 ` Mark Johnson
2002-06-04 21:01 ` Florian Weimer
2002-06-04 21:02 ` Florian Weimer
2002-06-04 21:03 ` Florian Weimer
2002-06-05 11:10   ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox