LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2013, 05:01 PM   #1
Henry1989
LQ Newbie
 
Registered: Nov 2012
Posts: 5

Rep: Reputation: Disabled
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?
 
Old 01-21-2013, 02:58 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.

Last edited by theNbomr; 01-21-2013 at 03:00 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bin file on x86 can be run on ARM? lesca Linux - Hardware 3 09-24-2010 08:00 PM
arm-elf-gcc _sbrk errors fairuz.ismail Programming 0 07-05-2010 05:17 AM
.bin, .elf, .out - Linux file extension raedbenz Linux - Software 7 09-15-2009 12:34 AM
Arm elf gcc jotagallo LinuxQuestions.org Member Intro 0 04-22-2009 02:32 PM
When do i get "/arm-elf/bin/ld:cannot find -lc" while compiling my project rameshsatyavaram Linux - Newbie 0 09-10-2008 03:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration