This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: File size for arm-elf-gcc


gcc -s file.c
 generates execs which are stripped


-----Original Message-----
From: David Mc Kenna [mailto:mckennad@esatclear.ie]
Sent: Thursday, August 01, 2002 7:45 PM
To: crossgcc@sources.redhat.com
Subject: File size for arm-elf-gcc


Hi all,

Is it possible to reduce the size of files generated by gcc? By default it
seems
to be including functions such as malloc,etc. which highly inflates it size.


An example is this simple program:-

int main()
{
	int i,j;

	for (i = 0 ; i < 100 ; i++)
	{
		j = j + i;
	}
	return 0;
}

When i use the following command it generates an elf file ~ 130K and when
stripped
an intel hex file ~28K:-

arm-elf-gcc -O3 cexample.c -o cexample.elf
arm-elf-strip cexample.elf -o cexample.hex -0 ihex

GCC successfully converts the program to a small Arm assembly program ~300
bytes,
but links in extra functions.

Any help is greatly appreciated,
Thanks,
Dave McKenna
--
http://www.iol.ie

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


**********************************************************************
The information contained in this email and any attachments
is likely to be confidential and legally privileged, and is for the
intended recipient named above only. Any copying, 
dissemination, disclosure of or use of this email or its 
attachments unless authorised by us is prohibited, except 
that you may forward this email and/or attachments to a third 
party on a strict "need to know" basis. 

If you have received this email in error, please notify us 
immediately by replying to the email or by calling 
+91-80-2297030. Please then delete this email and any full
or partial copies of it.

You as the intended recipient must be aware and accept 
that emailis not a totally secure communications medium.

Although we have taken all reasonable steps to make 
sure this email and any attachments are free from viruses, 
we do not (to the extent permitted by law) accept any liability 
whatsoever for any virus infection and/or compromise of 
security caused by this email and any attachment.

No contract may be formed or documents served by you 
on or with us by this email or any attachments unless 
expressly agreed otherwise by us. 

Any views expressed in this email or attachments by 
an individual are not necessarily those of UbiNetics 
India (Private) Limited.

**********************************************************************


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]