This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Oddities with gcc/g++ linkage
- To: Linux Egcs <egcs at cygnus dot com>
- Subject: Oddities with gcc/g++ linkage
- From: Alex Buell <alex dot buell at tahallah dot demon dot co dot uk>
- Date: Sun, 20 Sep 1998 01:59:40 -0400 (EDT)
- Reply-To: alex dot buell at tahallah dot demon dot co dot uk
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