Article View: gnu.g++
Article #237g++-compiled objects big :-(
From: Georg Feil
Date: Sat, 09 Dec 1989 00:37
Date: Sat, 09 Dec 1989 00:37
30 lines
1611 bytes
1611 bytes
I have a small ANSI C program I'm running on a simple custom 68020 target
system. The same program compiles just as easily with g++ as with gcc,
but the resulting binary is several times larger: (!)
-rwxr-xr-x 1 georg 17374 Dec 8 18:29 test-gcc*
-rwxr-xr-x 1 georg 51986 Dec 8 19:02 test-g++*
Size is rather of the essence, as the program gets sent to the target
system in S-records at 9600 baud. By examining the object file using nm,
I discovered large amounts of trash from libg++ being included for no
apparent reason. In particular, builtin.cc is a major culprit. It gets
included merely to resolve a reference to '__1xyzzy__' from __main().
My question:
What exactly is needed from libg++ to link a dead-simple C++ program?
In particular, is all the other junk in builtin.cc really necessary, or
will it do to put the definition for '__1xyzzy__' in a separate .cc file?
Awaiting wisdom from the wizards,
Georg.
--
Georg Feil Internet: ghfeil@white.toronto.edu
-or- : georg@sgl.ists.ca
...if all else fails, try:
{uunet,pyramid,watmath,utzoo}!utcsri!white!ghfeil
ghfeil%white.toronto.edu@relay.cs.net (ARPA)
Technical Details
Message-ID:
<89Dec8.193637est.27231@snow.white.toronto.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!uunet!cs.utexas.edu!jarvis.csri.toronto.edu!daemonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!uunet!cs.utexas.edu!jarvis.csri.toronto.edu!daemon From: ghfeil@white.toronto.edu (Georg Feil) Newsgroups: gnu.g++ Subject: g++-compiled objects big :-( Message-ID: <89Dec8.193637est.27231@snow.white.toronto.edu> Date: 9 Dec 89 00:37:37 GMT Sender: <daemon> Organization: University of Toronto, CSRI Lines: 30