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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,364dfbdf0a113a56 X-Google-Attributes: gid103376,public From: Gautier.DeMontmollin@maths.unine.ch (Gautier) Subject: Re: Looking for a smart linker for GNAT/DOS Date: 1997/04/17 Message-ID: <1997Apr17.104410.5889@news>#1/1 X-Deja-AN: 235419925 References: <1997Apr15.202909.5879@news> Organization: University of Neuchatel, Switzerland Reply-To: Gautier.deMontmollin@Maths.UniNe.CH Newsgroups: comp.lang.ada Date: 1997-04-17T00:00:00+00:00 List-Id: > <<... > It could avoid the explosion of executables' sizes > (47k for a ``null'' programme, 97k for a ``hello world'',...)>> dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Are you sure you are stripping the executables? I find only 24K for > a null program on OS/2, and that is without a shared library (it would > of course be MUCH smaller if I used a shared library). > > In any case, I don't think there is much in the way of unused code in > these programs -- what makes you think there is? GNAT only loads library > units that are used. Oh? Not every package found on the HD is linked ? ;-) > There is a certain fundamental overhead of stuff > that is needed to e.g. setup handling of standard exceptions. > > But I think your 47K sounds like it still has some debugging stuff left in The 47k programme is compiled without debug option (-g) and the exe is stripped. The fact that the DOS version has 47k and the OS/2, 24K, seems normal since with the DOS version all I/O and file handling must be made through the DPMI interface. This 47k basis is not annoying but the fact that 100% of each new added package is linked although a part of it (maybe a few tenth for a graphics package, a few thousends for a numerics package like LAPACK) is really used. Here is a test package to illustrate it: ------------------------------------------------------------------------------- -- Package to test the linker's smartness (unused procedures detection) -- See P_TstLnk test procedure package TestLink is procedure A; procedure B; procedure C; procedure D; end; with Text_IO; use Text_IO; package body TestLink is procedure A is begin Put("Adalbert"); end; procedure B is begin Put("Berthold"); end; procedure C is begin Put("Clothilde"); end; procedure D is procedure E is begin Put("Ernest"); end; procedure F is begin Put("Fabien"); end; begin Put("Dagobert"); E; end; end; -- Only "Berthold", "Dagobert", "Ernest" strings should appear in P_TSTLNK.EXE -- "Adalbert", "Clothilde", "Fabien" should not appear. with TestLink; use TestLink; procedure P_TstLnk is begin B; D; end; ------------------------------------------------------------------------------- A Turbo Pascal equivalent of it will have only the used procedures in the .exe G.