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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,cb9e1ed8412da744 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h11g2000yqb.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Typical handling of packages through compilers Date: Wed, 22 Jul 2009 05:57:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3ca6c026-9269-4228-be95-1b7d6adf6131@h11g2000yqb.googlegroups.com> References: NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1248267455 31877 127.0.0.1 (22 Jul 2009 12:57:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 22 Jul 2009 12:57:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h11g2000yqb.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.37 Safari/530.5,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7271 Date: 2009-07-22T05:57:34-07:00 List-Id: Yannick: > I've noticed that the inclusion of a package, turns into the inclusion > of all of its content, despite just a few part of it is really used > (taking into account, internal dependencies). It's the lack of a proper smart linking in the GNU linker. This technique is in use since more than 20 years in other systems - e.g.: Turbo Pascal and, later, Delphi. It seems also that Janus has it (or at least an old version had it). > Using seperate data and > function sections and then the linker gc-section option, does not > change anything (the executable is even a bit bigger using these > options). Try with -ffunction-sections only. With separate data sections I get a gain on most units, but unexpectedly one package turns into an enormous .o . The GNU docs warns about these options: "Only use these options when there are significant benefits from doing so. When you specify these options, the assembler and linker will create larger object and executable files and will also be slower. You will not be able to use gprof on all systems if you specify this option and you may have problems with debugging if you specify both this option and -g." You also have the gnatelim tool (a very dumb workaround, but it works). HTH _________________________________________________________ Gautier's Ada programming -- http://sf.net/users/gdemont/ NB: For a direct answer, e-mail address on the Web site!