[M16C-ELF] : S-REC file generated by ObjCopy is greater than input file (*.x or *.out)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[M16C-ELF] : S-REC file generated by ObjCopy is greater than input file (*.x or *.out)

Prafulla Thakare
Hi,

We have downloaded the latest FSF sources for GCC and binutils for M16C
port.
We could successfully build the cross toolchain i.e. m32c-elf-*.

However, we are facing a strange problem while using binary utility
"m32c-elf-objcopy". The file size for S-REC file generated using objcopy
is
greater than the input file size.

Following are the commands used,

#m32c-elf-gcc foo.c -o my.x -mcpu=m16c -msim -g
Output File -> my.x {Size = 114KB}

#m32c-elf-objcopy -O srec my.x  big.mot
Output File -> big.mot {Size = 227KB}

We are using binutils snapshot dated 21st December 2005,
"GNU objcopy 051221 20051221".

What could be the reason for above behavior?
Is it a bug with objcopy?

We have these observations with default linker script as well as custom
linker script.

Thanks in advance.

Regards,
Prafulla Thakare
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on October 12, 2005.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reply | Threaded
Open this post in threaded view
|

Re: [M16C-ELF] : S-REC file generated by ObjCopy is greater than input file (*.x or *.out)

Bernd Jendrissek
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Dec 22, 2005 at 02:59:34PM +0530, Prafulla Thakare wrote:
> #m32c-elf-gcc foo.c -o my.x -mcpu=m16c -msim -g
> Output File -> my.x {Size = 114KB}
>
> #m32c-elf-objcopy -O srec my.x  big.mot
> Output File -> big.mot {Size = 227KB}
>
> What could be the reason for above behavior?
> Is it a bug with objcopy?

No problem at all; the bulk of your SREC-format file is an ASCII hexdump
of the contents of the ELF sections, which inherently and inevitably
doubles-up every byte.

Your ELF-format file contains some headers too, which are *not*
hexdumped, which explains why 227 < 114*2.

- --
Your Mom is so dumb that she tried to minimize a 12
variable function to a minimal sum of products expression using a
karnaugh map instead of the Quine-McCluskey Algorithm.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Please fetch my new key 804177F8 from hkp://wwwkeys.eu.pgp.net/

iD8DBQFDqnRXwyMv24BBd/gRAlNTAJ0VrJBbJBkmOPCM32K2vZP1LEPitwCeMrdz
QR2YZ06HbGL0txSe5Mk8umY=
=pu+H
-----END PGP SIGNATURE-----