1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

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

Discussion in 'Embedded' started by KBG, Sep 20, 2006.

  1. KBG

    KBG Guest

    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
     
    KBG, Sep 20, 2006
    #1
    1. Advertisements

  2. KBG

    Stef Guest

    In comp.arch.embedded,
    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, Sep 20, 2006
    #2
    1. Advertisements

  3. KBG

    larwe Guest

    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.
     
    larwe, Sep 20, 2006
    #3
  4. KBG

    KBG Guest

    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
     
    KBG, Sep 20, 2006
    #4
  5. KBG

    KBG Guest

    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
     
    KBG, Sep 20, 2006
    #5
  6. KBG

    Coos Haak Guest

    Op 20 Sep 2006 07:09:27 -0700 schreef KBG:
    This is the third time you asked.
    What have you done with the answers 'Stef' and 'larwe' wrote to your
    questions?
    So, in short: what are the error messages you get. This news group does not
    consist of clearvoyants!
     
    Coos Haak, Sep 20, 2006
    #6
  7. KBG

    larwe Guest

    Yeah, and the one that generates a good BIN file is probably being
    compiled for ROM/flash target, right?
    This wasn't an answer to my question 2, which I have requoted below for
    your convenience:
     
    larwe, Sep 20, 2006
    #7
  8. KBG

    KBG Guest

    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
     
    KBG, Sep 25, 2006
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.