Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Converting binary file to elf

Hi,

Lets say I wanna covert my grep binary that I have on my linux system to elf format so I can execute it on uclinux, whats the process in doing that?

I tried:

nios2-elf-objcopy -I binary -O elf32-littlenios2 /path/to/grep /path/to/output

but the resulting elf does not work on uclinux.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    By your linux system, I assume you mean your computer's system.

    Can't do that mate: the binaries on your computer's system only run on x86 processors, they won't run on NIOS or any other kind of processor.

    You need to cross-compile your software targeting uCLinux on NIOS.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I am looking in the /uClinux-dist/user dir and I cannot locate gawk, awk, or nawk. Is there a tutorial that shows how to cross compile from source?

    Thanks.