[comp.sys.apollo] Difference between Unix ld and Aegis bind commands.

aerostr@bullet.ecf.toronto.edu (W. Graham Elliott) (05/01/91)

We have recently noticed a big difference in the size of files
created with the ld or bind commands.  For a simple Fortran program,
which we used for testing, the Aegis bind command produced an
executable file about 1.5 kB in size.  The corresponding ld command
produced a 22kB file.  For a much larger program the difference was
850 kB vs. 7,500 kB!

What is in the reason for the difference in the file sizes?  
Does it have something to do with the shared libraries?
Are we missing something with ld?

Some specifics:  Domain OS SR 10.2,  Aegis & BSD 4.3
                 
Sequence:    Aegis                    BSD
          ftn foo.ftn -b foo.bin    f77 foo.ftn -c -b foo.o
          bind foo.bin -b foo       f77 foo.bin -o foo

Incidentally, it is irrelevent whether the source is compiled
with ftn or f77.  Also, both executables created by bind and 
ld function correctly.

Thank-you, in advance.
Graham.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Graham Elliott                      aerostr@bullet.ecf.utoronto.ca
Institute for Aerospace Studies     graham.elliott@canrem.UUCP
University of Toronto, Canada

wa115@sdcc12.ucsd.edu (Russell ) (05/02/91)

In article <1991May1.035524.7904@bullet.ecf.toronto.edu> aerostr@bullet.ecf.toronto.edu (W. Graham Elliott) writes:
>We have recently noticed a big difference in the size of files
>created with the ld or bind commands.  For a simple Fortran program,
>which we used for testing, the Aegis bind command produced an
>executable file about 1.5 kB in size.  The corresponding ld command
>produced a 22kB file.  For a much larger program the difference was
>850 kB vs. 7,500 kB!
>
>What is in the reason for the difference in the file sizes?  
>Does it have something to do with the shared libraries?

  I'd guess that the apollo bind program is taking advantage of
 Aegis' dynamic binding scheme and not binding the standard
 libraries in with the executable.  The UNIX ld, on the other
 hand, is including the library object in the final coff file.
 That would account for the large size difference in the two
 files.


--------------------------------------------------------------------
Russell Shanks
wa115@sdcc12.ucsd.edu 
 

hanche@imf.unit.no (Harald Hanche-Olsen) (05/02/91)

In article <18894@sdcc6.ucsd.edu> wa115@sdcc12.ucsd.edu (Russell ) writes:

   In article <1991May1.035524.7904@bullet.ecf.toronto.edu> aerostr@bullet.ecf.toronto.edu (W. Graham Elliott) writes:
   [... explaining how ld creates much larger files than bind ...]

     I'd guess that the apollo bind program is taking advantage of
    Aegis' dynamic binding scheme and not binding the standard
    libraries in with the executable.  The UNIX ld, on the other
    hand, is including the library object in the final coff file.

No it doesn't, does it?  Are you serious about this??  (Run nm on the
linked file and watch all the "U" (for undefined) entries...)

    That would account for the large size difference in the two
    files.

Hmm, I wonder how the size differences were measured?  The files
generated by ld might have holes in them that could confuse the output
of ls -l.  With ls -s you get the disk space used.  This has has me
fooled more than once.

- Harald Hanche-Olsen <hanche@imf.unit.no>
  Division of Mathematical Sciences
  The Norwegian Institute of Technology
  N-7034 Trondheim, NORWAY