🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53394

Re: Long executable with math library

#53394
From: David Grabiner
Date: Tue, 14 Jan 1992 20:32
22 lines
1827 bytes
In article <GRABINER.92Jan14151006@zariski.harvard.edu>, I wrote:

> Using gcc 1.36 on a Sun 4, I have a program which is 12K in length and
> uses one function (anint) from the math library.  The .o file is 48K,
> but when the entire program is compiled with -lm, the executable is
> 160K, which is still 152K when stripped.  As a comparison, cc gives a
> 32K .o file and a 40K executable.

The problem had nothing to do with the math library; I inlined the
function and removed the inclusion of math.h, but I still got a 160K
executable with gcc, and the .o file is still only 48K.  Where is all of
this extra memory coming from?

The program does some calculations copied from a spreadsheet, so it
contains a 23*17 two-dimensional array of doubles, and a lot of simple
mathematical calculations on array elements.

--
David Grabiner, grabiner@zariski.harvard.edu
"We are sorry, but the number you have dialed is imaginary."
"Please rotate your phone 90 degrees and try again."
Disclaimer: I speak for no one and no one speaks for me.
Technical Details
Message-ID: <GRABINER.92Jan14153156@zariski.harvard.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das.harvard.edu!husc-news.harvard.edu!zariski!grabiner
References: <GRABINER.92Jan14151006@zariski.harvard.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,1b6a7eb3a34a2790
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-01-14 12:46:09 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das.harvard.edu!husc-news.harvard.edu!zariski!grabiner
From: grabiner@math.harvard.edu (David Grabiner)
Newsgroups: gnu.gcc.help
Subject: Re: Long executable with math library
Message-ID: <GRABINER.92Jan14153156@zariski.harvard.edu>
Date: 14 Jan 92 20:32:05 GMT
Article-I.D.: zariski.GRABINER.92Jan14153156
References: <GRABINER.92Jan14151006@zariski.harvard.edu>
Distribution: gnu
Organization: Harvard University Dept. of Mathematics
Lines: 22
Nntp-Posting-Host: zariski.harvard.edu
In-reply-to: grabiner@math.harvard.edu's message of 14 Jan 92 15:10:16 EST