[comp.unix.ultrix] fort, vcc, and lk

news@bingvaxu.cc.binghamton.edu (09/26/88)

Reply-to: news@bingvaxu.cc.binghamton.edu


The following fortran program:

	integer a(500000)
	
	stop
	end

when compiled with the Vax/11 fortran compiler produces an executable
file of size 2038627.  (When compiled with f77 it produces an executable
of size 24576.)  The problem is lk rather than fort, since the object
file produced is of size 475.

Similar problems arise when using vcc.

After spending 3 hours reading the manuals, I am at a loss.  Can anyone
tell me how to make this linker do a NON-BRAIN-DAMAGED job of linking
programs with large arrays?????

Fred Sullivan				SUNY at Binghamton
Dept. Math. Sciences			Binghamton, NY 13903
					sullivan@marge.math.binghamton.edu
First you make a roux!

mal@hjuxa.UUCP (11/04/88)

Reply-to: mal@hjuxa.UUCP

> 	integer a(500000)
> 	stop
> 	end
> when compiled with the Vax/11 fortran compiler produces an executable
> file of size 2038627.  (When compiled with f77 it produces an executable
> of size 24576.)


The linker treats that integer array as initialized data and allocates
memory for it.  ld treats it as dynamic memory and no space is allocated.
Rumor has it that the latest version of lk fixes this problem.
I believe the reasoning for this feature in lk was to sell mor disks :-)

> Similar problems arise when using vcc.

my guess is that the linker used by vcc, if it is not the same as lk,
is based on lk.