File size for arm-elf-gcc

David Mc Kenna mckennad@esatclear.ie
Fri Aug 2 01:41:00 GMT 2002


Using gcc -s file.c successfully reduces the elf file to ~44k. But when I convert
this into Intel Hex, for ease of use, it still is ~28k. Is there any way to
reduce this size?

Also when I added the option -Wl,-t it caused gcc to crash out,

/c/win/arm/bin/../lib/gcc-lib/arm-elf/3.1.1/../../../../arm-elf/bin/ld: warning:
connot find thumb start symbol /c/win/arm/bin/../lib/gcc-lib/arm-elf/3.1.1/crti.o

/c/adi/win/arm/bin/../lib/gcc-lib/arm-elf/3.1.1/../../../../arm-elf/lib/crt0.o:
In function `start':
/c/win/arm/bin/../lib/gcc-lib/arm-elf/3.1.1/../../../../arm-elf/lib/crt0.o(.text+0xd8):
undefined reference to `_init'
/c/win/arm/bin/../lib/gcc-lib/arm-elf/3.1.1/../../../../arm-elf/lib/crt0.o(.text+0xf8):
undefined reference to `_fini'
collect2: ld returned 1 exit status

Thanks again,
Dave McKenna
>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.
>
>**********************************************************************
>
>
--
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



More information about the crossgcc mailing list