size of executable - g95 vs gfortran42 - shared libs?

Tobias Hoellrich thoellri at adobe.com
Thu Jun 5 13:29:48 UTC 2008


> -----Original Message-----
> From: owner-freebsd-questions at freebsd.org 
> [mailto:owner-freebsd-questions at freebsd.org] On Behalf Of 
> Anton Shterenlikht
> Sent: Thursday, June 05, 2008 7:21 AM
> To: freebsd-questions at freebsd.org
> Subject: size of executable - g95 vs gfortran42 - shared libs?
> 
> I use two different fortran90 compiler on a simple input file
> and get executables which differ in size by almost 3 orders of
> magnitude, see below. Is this something to do with the use
> of shared libraries?
> 
> % gfortran42 tmp.f90
> % ls -al a.out
> -rwxr-xr-x  1 <xxx>  <zzz>    9179  5 Jun 14:15 a.out
> % g95 tmp.f90
> % ls -al a.out
> -rwxr-xr-x  1 <xxx>  <zzz>  546413  5 Jun 14:15 a.out
> %
> 
> The program results seem to be identical.
> 
> many thanks
> anton

Run "file" and "ldd" on the executables to see the difference:

[root at santafe ~]# file `which ls`
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
for FreeBSD 8.0 (800038), dynamically linked (uses shared libs),
FreeBSD-style, stripped

[root at santafe ~]# ldd `which ls`
/bin/ls:
        libutil.so.7 => /lib/libutil.so.7 (0x28082000)
        libncurses.so.7 => /lib/libncurses.so.7 (0x28090000)
        libc.so.7 => /lib/libc.so.7 (0x280cf000)
[root at santafe ~]#

Hope this helps
  Tobias


More information about the freebsd-questions mailing list