home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!mcsun!dxcern!dscomsa.desy.de!dscomsa!ohl
- From: ohl@ips105.desy.de (Thorsten Ohl)
- Subject: Re: why are fortran binaries so large?
- In-Reply-To: dedmunds@selkirk.sfu.ca's message of Thu, 23 Jul 1992 18:47:58 GMT
- Message-ID: <OHL.92Jul23231746@ips105.desy.de>
- Sender: news@dscomsf.desy.de (USENET News System)
- Nntp-Posting-Host: ips105.desy.de
- Organization: Deutsches Elektronen-Synchrotron, Hamburg, Germany.
- References: <dedmunds.711917278@sfu.ca>
- Date: Thu, 23 Jul 1992 23:17:46 GMT
- Lines: 22
-
- >>>>> On Thu, 23 Jul 1992 18:47:58 GMT, dedmunds@selkirk.sfu.ca (Darran Edward Edmundson) said:
-
- Darran> Is space for variables being reserved in the data segment
- Darran> (like initialized variables in assembly language)? (i.e. my
- Darran> binary is very large even if my code is quite short and simple
- Darran> but I have a large array.)
-
- Depends on the compiler. Some put uninitialized arrays into the DATA
- segment, some are smarter and but them into the BSS segment. Use
- size(1) to find out what's going on.
-
- Darran> If this is the answer, is there a way to prevent it (I don't
- Darran> have a f77 manual handy)?
-
- At least on Apollos and HP-UX boxes you can trick the compiler to
- allocate the offending array in the BSS segment by putting it into a
- COMMON block. Yes, it's a hack, but it can reduce the size of your
- binaries tremendously.
- --
- ////// Thorsten Ohl, DESY (-T-), Notkestr. 85, W-2000 Hamburg 52, F.R.G.
- ///////// net: ohl@crunch.ikp.physik.th-darmstadt.de, ohl@gnu.ai.mit.edu
- //////////////////////// voice: +49-40-8998-3699, fax: +49-40-8998-3282
-