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-Thread: a07f3367d7,cb9e1ed8412da744 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!2g2000prl.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Typical handling of packages through compilers Date: Wed, 22 Jul 2009 14:55:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4c52e11d-891d-4019-a849-8824f4f5c5c5@b25g2000prb.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1248299749 3477 127.0.0.1 (22 Jul 2009 21:55:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 22 Jul 2009 21:55:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 2g2000prl.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7283 Date: 2009-07-22T14:55:49-07:00 List-Id: On Jul 22, 2:25=A0pm, Hibou57 (Yannick Duch=EAne) wrote: > On 22 juil, 16:29, Adam Beneschan wrote: > > > By the way, "inner packages" don't have any effect at all on this, and > > I'd guess that that is true for other compilers as well. =A0Inner > > packages are not at all reflected in the structure of the object > > file. =A0Our linker considers each code or data item individually to se= e > > if it can be eliminated; it doesn't care at all about whether they've > > been grouped into another package. > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0-- Adam > > So if I have > > package P is > ... > =A0 =A0package Q is > =A0 =A0 =A0 .... > =A0 =A0end Q; > end P; > > then with most compiler, Q will not be linked unless it is referenced No, that isn't what I said, I think. What I said is: some linkers will link in all of package P (including P.Q) if any of it is referenced; other linkers are able to include only those items in P (including P.Q) that are needed. For this purpose, though, the linker won't know what items are in Q and what items aren't. But I guess this does mean that, for the second type of linker, if none of the items in Q are referenced, then none of them will be linked in, but this has nothing to do with whether they're inside Q or not. The linker will probably have no knowledge of "Q" as an entity or group of entities. > Adam, are you a member of a compiler vendor team ? Yes. www.irvine.com -- Adam