public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Oddities with gcc/g++ linkage
@ 1998-09-19 23:03 Alex Buell
  1998-09-20  8:30 ` H.J. Lu
  1998-09-20 17:05 ` Martin von Loewis
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Buell @ 1998-09-19 23:03 UTC (permalink / raw)
  To: Linux Egcs

Hi guys,

I was messing with generating object files and linking them in separate
phases.

The code I was using is:
  
  #include <stdio.h>

  int main() {
      printf( "bool = %u\nshort = %u\nint = %u\nlong = %u\n",
              sizeof(bool), sizeof(short), sizeof(int), sizeof(long));
      return 0;
      }

First test:
	g++ sizeof.c -o sizeof
	strip sizeof

On my machine that gives a binary executable size of 44k!

Second test:
	g++ -c sizeof.c
	gcc sizeof.o -o sizeof -lc
	strip sizeof

On my machine this gives me a binary executable size of 3k!!

Third test:
	g++ -c sizeof.c
	g++ sizeof.o -o sizeof -lc
	strip sizeof

This gives me a larger executable size of 44k!

All three executables works fine. 

Can anyone explain such variances in binary size?

Cheers,
Alex
--
 /\_/\  Legalise cannabis now! 
( o.o ) Grow some cannabis today!
 > ^ <  Peace, Love, Unity and Respect to all.

http://www.tahallah.demon.co.uk - *new* - rewritten for text browser users!

Linux tahallah 2.1.122 #43 Sat Sep 19 10:54:36 EDT 1998 One AMD 486 DX/4 processor, 49.77 total bogomips, 32M RAM


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1998-09-22 14:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-19 23:03 Oddities with gcc/g++ linkage Alex Buell
1998-09-20  8:30 ` H.J. Lu
1998-09-20 10:48   ` Alex Buell
1998-09-20 17:05 ` Martin von Loewis
1998-09-20 17:05   ` Alex Buell
1998-09-20 21:06     ` Alex Buell
1998-09-21 14:55       ` Martin von Loewis
1998-09-21 14:55         ` Alex Buell
1998-09-22 14:12         ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).