From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79b248c1cf206957 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-06 03:35:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Why is memory footprint smaller when compiled static? Date: Thu, 6 Jun 2002 10:35:21 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1023359721 15740 129.241.83.82 (6 Jun 2002 10:35:21 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Thu, 6 Jun 2002 10:35:21 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:25392 Date: 2002-06-06T10:35:21+00:00 List-Id: 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