LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Using arm-elf-gcc to creat a .bin file (http://www.linuxquestions.org/questions/programming-9/using-arm-elf-gcc-to-creat-a-bin-file-4175446501/)

Henry1989 01-20-2013 05:01 PM

Using arm-elf-gcc to creat a .bin file
 
I have a c source file, now I want to use arm-elf-gcc to creat a .bin file which can be executed on ARM processor. How can I do this.BTW, what's the relationship between the .bin file and .elf file?

theNbomr 01-21-2013 02:58 PM

What do you want the .bin file to do? Neither of those two filename extensions are commonly used in Linux, although one can imagine that a .elf file is an object module in the elf file format. .bin has no particular meaning that I know of, although it tends to be used somewhat generically to suggest that a file's content is something other than human-readable text.

Typically, executable files are named without any filename extension.

If your C source module includes main() and doesn't reference any libraries not known to the compiler, you should be able to simply add the /path/to/your/cross/compiler to $PATH, and then compile:
Code:

arm-elf-gcc -o yourProgramName yourProgramName.c
That should produce yourProgramName in the current working directory.

The above assumes a functional and conventionally built cross toolchain.

--- rod.


All times are GMT -5. The time now is 09:11 AM.