EmbeddedRelated.com
Forums
Memfault Beyond the Launch

m68k-elf-objcopy does not convert .ELF to .BIN file

Started by KBG September 20, 2006
Hi,

.ELF to .BIN conversion is working for one set of source code , but it
is not working with

another set of code .

I do the following for converting the .ELF to .BIN :
         "m68k-elf-objcopy -O binary clock.elf clock.bin".

Does source code have any role in affecting the generation of .ELF to
.BIN ?
OR
Does configuration settings of the compiler that generates the .ELF
file has influence ?

I am using Codewarrior for compilation and generation of .ELF file.
I use m68k-elf-objcopy (cygwin tool) for conversion of .ELF to .BIN
file for fusing the
.BIN in flash memory.

I find that the configuration settings of both the set of source codes
are the same, but
the ".ELF to .BIN" is happening for one set of source code's .ELF file
, but it is not

happening for the other set of source code files. Really strange ???

Does the source code play a role in causing problem for converting the
.ELF to .BIN file ?

Is there anything related with LCF (Linker Control File) ?

I even tried with creating a new project, by putting all the necessary
stuffs in the right place. But, i am still unable to get the .BIN file
from the .ELF file. Really strange.

Kindly share your views regarding this .

Tonnes of thx in advans,
Karthik Balaguru

In comp.arch.embedded,
KBG <karthik.balaguru@lntinfotech.com> wrote:
> Hi, > > .ELF to .BIN conversion is working for one set of source code , but it > is not working with > > another set of code . > > I do the following for converting the .ELF to .BIN : > "m68k-elf-objcopy -O binary clock.elf clock.bin". >
Sounds really weird. I use the arm-elf version and use a little different command line: arm-elf-objcopy file.elf -O file.bin So elf file before the -O option, not sure if it matters. What is the error message you get? -- Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)
KBG wrote:

> .ELF to .BIN conversion is working for one set of source code , but it > is not working with another set of code . > > I do the following for converting the .ELF to .BIN : > "m68k-elf-objcopy -O binary clock.elf clock.bin".
1. What actually happens? Do you get an error, or an empty BIN file? 2. objdump the section info for both ELFs and post it here.
Hi friends,

1) I get an Empty BIN file.
But this ELF file for which the generated BIN file is empty , is
getting executed perfectly from RAM via Codewarrior. So, It is really
strange - Why does a good working ELF file generate a empty BIN file
when m68k-elf-objcopy is used ??
Really strange !!

2) The files are pretty big.
      file1.dump is of 10 MB in size
      file2.dump is of 20 MB in size

What could be the reason. It is really strange .

The ELF file for which the BIN file is empty , is getting executed
perfectly from RAM via Codewarrior. So, It is really strange - Why does
a good working ELF file generate a empty BIN file when m68k-elf-objcopy
is used.

Is it a problem with m68k-elf-objcopy  or  Some other issue ???

Really strange . Kindly share your views regarding this.

Tonnes of thx in advans,
Karthik Balaguru


larwe wrote:
> KBG wrote: > > > .ELF to .BIN conversion is working for one set of source code , but it > > is not working with another set of code . > > > > I do the following for converting the .ELF to .BIN : > > "m68k-elf-objcopy -O binary clock.elf clock.bin". > > 1. What actually happens? Do you get an error, or an empty BIN file? > > 2. objdump the section info for both ELFs and post it here.
Hi friends,

What are the other possibile reasons/things because of which it(ELF
file generated using Codewarrior ) is working perfectly from RAM using
Codewarrior , but the BIN file is not getting generated when
m68k-elf-objcopy is used ????

1) I get an Empty BIN file.
But this ELF file for which the generated BIN file is empty , is
getting executed perfectly from RAM via Codewarrior. So, It is really
strange - Why does a good working ELF file generate a empty BIN file
when m68k-elf-objcopy is used ??
Really strange !!

2) The files are pretty big.
      file1.dump is of 10 MB in size
      file2.dump is of 20 MB in size

The ELF file for which the BIN file is empty , is getting executed
perfectly from RAM via Codewarrior.

So, It is really strange -> Why does a good working ELF file generate a
empty BIN file when m68k-elf-objcopy
is used.

Where could be the problem ??? What could be reason ????
Really strange . Kindly share your views regarding this.

Tonnes of thx in advans,
Karthik Balaguru




Stef wrote:
> In comp.arch.embedded, > KBG <karthik.balaguru@lntinfotech.com> wrote: > > Hi, > > > > .ELF to .BIN conversion is working for one set of source code , but it > > is not working with > > > > another set of code . > > > > I do the following for converting the .ELF to .BIN : > > "m68k-elf-objcopy -O binary clock.elf clock.bin". > > > Sounds really weird. I use the arm-elf version and use a little different > command line: arm-elf-objcopy file.elf -O file.bin > So elf file before the -O option, not sure if it matters. > > What is the error message you get? > > -- > Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)
Op 20 Sep 2006 07:09:27 -0700 schreef KBG:

> Hi friends, > > 1) I get an Empty BIN file.
This is the third time you asked. What have you done with the answers 'Stef' and 'larwe' wrote to your questions?
> larwe wrote: >> KBG wrote: >> >>> .ELF to .BIN conversion is working for one set of source code , but it >>> is not working with another set of code . >>> >>> I do the following for converting the .ELF to .BIN : >>> "m68k-elf-objcopy -O binary clock.elf clock.bin". >> >> 1. What actually happens? Do you get an error, or an empty BIN file? >> >> 2. objdump the section info for both ELFs and post it here.
Stef wrote:
> In comp.arch.embedded, > KBG <karthik.balaguru@lntinfotech.com> wrote: > > Hi, > > > > .ELF to .BIN conversion is working for one set of source code , but it > > is not working with > > > > another set of code . > > > > I do the following for converting the .ELF to .BIN : > > "m68k-elf-objcopy -O binary clock.elf clock.bin". > > > Sounds really weird. I use the arm-elf version and use a little different > command line: arm-elf-objcopy file.elf -O file.bin > So elf file before the -O option, not sure if it matters. > > What is the error message you get?
So, in short: what are the error messages you get. This news group does not consist of clearvoyants! -- Coos
KBG wrote:

> 1) I get an Empty BIN file. > But this ELF file for which the generated BIN file is empty , is > getting executed perfectly from RAM via Codewarrior. So, It is really
Yeah, and the one that generates a good BIN file is probably being compiled for ROM/flash target, right?
> 2) The files are pretty big.
This wasn't an answer to my question 2, which I have requoted below for your convenience:
> > 2. objdump the section info for both ELFs and post it here.
Hi,

I Would like to share the solution for the problem that i was facing
last week.

This ELF problem is due to the lcf file.

The (RWX)  fixed the problem of the 0 byte size binary file.
Initially,  i did not have the RWX attributes defined for the FLASH /
RAM memory.

MEMORY
{
            flash        (RWX) :           ORIGIN = 0xFF800000, LENGTH
= 0x00005000
            ram         (RWX) :           ORIGIN = 0x00003000 , LENGTH
= 0x00200000
}

Now, things work fine !!! Thankyou.

Regards,
Karthik Balaguru



larwe wrote:
> KBG wrote: > > > 1) I get an Empty BIN file. > > But this ELF file for which the generated BIN file is empty , is > > getting executed perfectly from RAM via Codewarrior. So, It is really > > Yeah, and the one that generates a good BIN file is probably being > compiled for ROM/flash target, right? > > > 2) The files are pretty big. > > This wasn't an answer to my question 2, which I have requoted below for > your convenience: > > > > 2. objdump the section info for both ELFs and post it here.

Memfault Beyond the Launch