public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* RE: File size for arm-elf-gcc
@ 2002-08-02  1:41 David Mc Kenna
  2002-08-02 10:40 ` Aaron J. Grier
  0 siblings, 1 reply; 6+ messages in thread
From: David Mc Kenna @ 2002-08-02  1:41 UTC (permalink / raw)
  To: Daniel Ezekiel, 'mckennad@esatclear.ie', crossgcc

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

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

* Re: File size for arm-elf-gcc
  2002-08-02  1:41 File size for arm-elf-gcc David Mc Kenna
@ 2002-08-02 10:40 ` Aaron J. Grier
  0 siblings, 0 replies; 6+ messages in thread
From: Aaron J. Grier @ 2002-08-02 10:40 UTC (permalink / raw)
  To: crossgcc

On Fri, Aug 02, 2002 at 09:41:40AM +0100, David Mc Kenna wrote:
> 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?

are you looking at filesize, or using the size program?  (arm-elf-size)
filesize alone can be misleading.

> 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

"it hasn't done that before."  :)  are there other linker options
normally passed that perhaps -Wl,-t is overriding?  you may need to
include those as well...

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com

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

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

* RE: File size for arm-elf-gcc
@ 2002-08-02  1:55 Daniel Ezekiel
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Ezekiel @ 2002-08-02  1:55 UTC (permalink / raw)
  To: 'mckennad@esatclear.ie', Daniel Ezekiel, crossgcc

What you might want to look at is to reduce the file size, not with GCC but
since you are using ELF Format
 you might be able to do some ELF tweakin and reduce the object file size,
pls refer to
http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

Hope this helps
Danny


-----Original Message-----
From: David Mc Kenna [mailto:mckennad@esatclear.ie]
Sent: Friday, August 02, 2002 2:12 PM
To: Daniel Ezekiel; 'mckennad@esatclear.ie'; crossgcc@sources.redhat.com
Subject: RE: File size for arm-elf-gcc


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


**********************************************************************
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

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

* RE: File size for arm-elf-gcc
@ 2002-08-01 23:53 Daniel Ezekiel
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Ezekiel @ 2002-08-01 23:53 UTC (permalink / raw)
  To: 'mckennad@esatclear.ie', crossgcc

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

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

* Re: File size for arm-elf-gcc
  2002-08-01  7:14 David Mc Kenna
@ 2002-08-01 10:00 ` Aaron J. Grier
  0 siblings, 0 replies; 6+ messages in thread
From: Aaron J. Grier @ 2002-08-01 10:00 UTC (permalink / raw)
  To: crossgcc

On Thu, Aug 01, 2002 at 03:14:44PM +0100, David Mc Kenna wrote:

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

turn on link tracing (-Wl,-t to gcc, or -t to ld) and study what exactly
your program is being linked against before producing an executable.

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com

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

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

* File size for arm-elf-gcc
@ 2002-08-01  7:14 David Mc Kenna
  2002-08-01 10:00 ` Aaron J. Grier
  0 siblings, 1 reply; 6+ messages in thread
From: David Mc Kenna @ 2002-08-01  7:14 UTC (permalink / raw)
  To: crossgcc

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

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

end of thread, other threads:[~2002-08-02 17:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-02  1:41 File size for arm-elf-gcc David Mc Kenna
2002-08-02 10:40 ` Aaron J. Grier
  -- strict thread matches above, loose matches on Subject: below --
2002-08-02  1:55 Daniel Ezekiel
2002-08-01 23:53 Daniel Ezekiel
2002-08-01  7:14 David Mc Kenna
2002-08-01 10:00 ` Aaron J. Grier

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).