comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier.DeMontmollin@maths.unine.ch (Gautier)
Subject: Re: Looking for a smart linker for GNAT/DOS
Date: 1997/04/17
Date: 1997-04-17T00:00:00+00:00	[thread overview]
Message-ID: <1997Apr17.104410.5889@news> (raw)
In-Reply-To: dewar.861173085@merv


> <<...
> 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.




  parent reply	other threads:[~1997-04-17  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1997Apr15.202909.5879@news>
1997-04-16  0:00 ` Looking for a smart linker for GNAT/DOS Samuel Tardieu
1997-04-16  0:00   ` Gautier
1997-04-18  0:00     ` Robert Dewar
1997-04-19  0:00       ` Geert Bosch
1997-04-22  0:00         ` Robert Dewar
1997-04-28  0:00         ` Larry Kilgallen
1997-04-19  0:00       ` Fergus Henderson
1997-04-21  0:00         ` Robert Dewar
1997-04-21  0:00           ` Gautier
1997-04-23  0:00             ` Robert Dewar
1997-04-24  0:00               ` Gautier
1997-04-26  0:00                 ` Robert Dewar
1997-04-27  0:00                 ` Geert Bosch
1997-04-29  0:00                   ` Gautier
1997-04-21  0:00       ` Gautier
1997-04-21  0:00       ` Mats Weber
1997-04-23  0:00         ` Robert Dewar
     [not found] ` <dewar.861173085@merv>
1997-04-17  0:00   ` Gautier [this message]
1997-04-17  0:00     ` Robert Dewar
1997-04-18  0:00       ` Gautier
1997-04-19  0:00         ` Robert Dewar
replies disabled

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