public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* File size increases significantly after objcopy
@ 2004-11-25 13:22 C Jaiprakash, Noida
  2004-11-25 14:05 ` Andreas Schwab
  2004-11-25 15:53 ` Peter Barada
  0 siblings, 2 replies; 5+ messages in thread
From: C Jaiprakash, Noida @ 2004-11-25 13:22 UTC (permalink / raw)
  To: binutils; +Cc: C Jaiprakash, Noida

Hi,
  I am building colilo for a coldfire (v4e) target. I am facing a strange
problem. If i build colilo with -O0 option and convert the ELF binary to
bnary, srec format following are the resulting file sizes

-rwxr-xr-x    1 cjaiprakash coldfire      93K Nov 25 18:58 colilo.bin
-rwxr-xr-x    1 cjaiprakash coldfire     123K Nov 25 18:58 colilo.elf
-rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.s19
-rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.srec

But when i build the colilo with -O2 option file size increase
significantly, following are the sizes
-rwxr-xr-x    1 cjaiprakash coldfire      17M Nov 25 19:01 colilo.bin
-rwxr-xr-x    1 cjaiprakash coldfire     107K Nov 25 19:01 colilo.elf
-rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.s19
-rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.srec
 
ELF binary size is ok but why the file sizes for bin, srec are so huge? 

Thanks and best regards,
C Jaiprakash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contributing to the World by creating indispensable value !

System Software CoE @ HCLT-Noida
http://www.hcltechnologies.com
Ph. : +91-120-2510701/702 Ext : 3170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

* Re: File size increases significantly after objcopy
  2004-11-25 13:22 File size increases significantly after objcopy C Jaiprakash, Noida
@ 2004-11-25 14:05 ` Andreas Schwab
  2004-11-25 15:53 ` Peter Barada
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2004-11-25 14:05 UTC (permalink / raw)
  To: C Jaiprakash, Noida; +Cc: binutils

"C Jaiprakash, Noida" <cjaiprakash@hcltech.com> writes:

> Hi,
>   I am building colilo for a coldfire (v4e) target. I am facing a strange
> problem. If i build colilo with -O0 option and convert the ELF binary to
> bnary, srec format following are the resulting file sizes
>
> -rwxr-xr-x    1 cjaiprakash coldfire      93K Nov 25 18:58 colilo.bin
> -rwxr-xr-x    1 cjaiprakash coldfire     123K Nov 25 18:58 colilo.elf
> -rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.s19
> -rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.srec
>
> But when i build the colilo with -O2 option file size increase
> significantly, following are the sizes
> -rwxr-xr-x    1 cjaiprakash coldfire      17M Nov 25 19:01 colilo.bin
> -rwxr-xr-x    1 cjaiprakash coldfire     107K Nov 25 19:01 colilo.elf
> -rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.s19
> -rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.srec
>  
> ELF binary size is ok but why the file sizes for bin, srec are so huge? 

Look at the program headers, any holes?  Without any information to
reproduce it's hard to investigate.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: File size increases significantly after objcopy
  2004-11-25 13:22 File size increases significantly after objcopy C Jaiprakash, Noida
  2004-11-25 14:05 ` Andreas Schwab
@ 2004-11-25 15:53 ` Peter Barada
  2004-11-25 15:56   ` Peter Barada
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Barada @ 2004-11-25 15:53 UTC (permalink / raw)
  To: cjaiprakash; +Cc: binutils, cjaiprakash


>  I am building colilo for a coldfire (v4e) target. I am facing a strange
>problem. If i build colilo with -O0 option and convert the ELF binary to
>bnary, srec format following are the resulting file sizes
>
>-rwxr-xr-x    1 cjaiprakash coldfire      93K Nov 25 18:58 colilo.bin
>-rwxr-xr-x    1 cjaiprakash coldfire     123K Nov 25 18:58 colilo.elf
>-rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.s19
>-rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.srec
>
>But when i build the colilo with -O2 option file size increase
>significantly, following are the sizes
>-rwxr-xr-x    1 cjaiprakash coldfire      17M Nov 25 19:01 colilo.bin
>-rwxr-xr-x    1 cjaiprakash coldfire     107K Nov 25 19:01 colilo.elf
>-rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.s19
>-rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.srec
> 
>ELF binary size is ok but why the file sizes for bin, srec are so huge? 

Two things.
1) Build link map so you can see what got sucked into the link.
2) Dump the object header (onjdump -h) and see what sections are in
   colilo.elf.  I'll bet in the -O2 case there are one or more *extra*
   sections that are getting linked to zero since the linker control file
   didn't specify where they are suppoesed to go.

-- 
Peter Barada
peter@the-baradas.com

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

* Re: File size increases significantly after objcopy
  2004-11-25 15:53 ` Peter Barada
@ 2004-11-25 15:56   ` Peter Barada
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Barada @ 2004-11-25 15:56 UTC (permalink / raw)
  To: peter; +Cc: cjaiprakash, binutils, cjaiprakash


>1) Build link map so you can see what got sucked into the link.
>2) Dump the object header (onjdump -h) and see what sections are in

I really should drink more caffeine in the morning before I type. :)
The above should read:

1) Build a link map so you can see what got sucked into the link.
2) Dump the object header (objdump -h) and see what sections are in

-- 
Peter Barada
peter@the-baradas.com

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

* RE: File size increases significantly after objcopy
@ 2004-11-25 13:23 C Jaiprakash, Noida
  0 siblings, 0 replies; 5+ messages in thread
From: C Jaiprakash, Noida @ 2004-11-25 13:23 UTC (permalink / raw)
  To: 'binutils@sources.redhat.com'

I am using binutils version 2.15.91

Thanks and best regards,
C Jaiprakash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contributing to the World by creating indispensable value !

System Software CoE @ HCLT-Noida
http://www.hcltechnologies.com
Ph. : +91-120-2510701/702 Ext : 3170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


>  -----Original Message-----
> From: 	C Jaiprakash, Noida  
> Sent:	Thursday, November 25, 2004 6:50 PM
> To:	binutils@sources.redhat.com
> Cc:	C Jaiprakash, Noida
> Subject:	File size increases significantly after objcopy
> 
> Hi,
>   I am building colilo for a coldfire (v4e) target. I am 
> facing a strange problem. If i build colilo with -O0 option 
> and convert the ELF binary to bnary, srec format following 
> are the resulting file sizes
> 
> -rwxr-xr-x    1 cjaiprakash coldfire      93K Nov 25 18:58 colilo.bin
> -rwxr-xr-x    1 cjaiprakash coldfire     123K Nov 25 18:58 colilo.elf
> -rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.s19
> -rw-r--r--    1 cjaiprakash coldfire     279K Nov 25 18:58 colilo.srec
> 
> But when i build the colilo with -O2 option file size 
> increase significantly, following are the sizes
> -rwxr-xr-x    1 cjaiprakash coldfire      17M Nov 25 19:01 colilo.bin
> -rwxr-xr-x    1 cjaiprakash coldfire     107K Nov 25 19:01 colilo.elf
> -rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.s19
> -rw-r--r--    1 cjaiprakash coldfire      49M Nov 25 19:01 colilo.srec
>  
> ELF binary size is ok but why the file sizes for bin, srec 
> are so huge? 
> 
> Thanks and best regards,
> C Jaiprakash
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Contributing to the World by creating indispensable value !
> 
> System Software CoE @ HCLT-Noida
> http://www.hcltechnologies.com
> Ph. : +91-120-2510701/702 Ext : 3170
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 

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

end of thread, other threads:[~2004-11-25 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-25 13:22 File size increases significantly after objcopy C Jaiprakash, Noida
2004-11-25 14:05 ` Andreas Schwab
2004-11-25 15:53 ` Peter Barada
2004-11-25 15:56   ` Peter Barada
2004-11-25 13:23 C Jaiprakash, Noida

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