LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-30-2008, 12:37 AM   #1
syntacticalerror
LQ Newbie
 
Registered: Jun 2008
Posts: 24

Rep: Reputation: 15
Linux binaries


Just wondering if anybody knew what is used to interpret(compile?) the binaries in linux when they are ran?

And also, how does source code become binaries?

thx
 
Old 07-30-2008, 06:38 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
2. src code is converted by the compiler (usually the prog known as 'gcc') to binary executables.
It takes the src code, converts it to 'object' code (a binary format, then 'links' that/those with any reqd pre-built libraries, which results in a single binary executable.
Google 'how a compiler works' or start here: http://en.wikipedia.org/wiki/Compiler
 
Old 07-30-2008, 08:00 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In common usage, "binary" means an executable file in machine language--meaning that it is interpreted by the processor, with no intervening SW. This is why such a program is faster than one using an interpreter--eg Perl, Python, and a zillion other interpreted languages.
A Python program--eg--could be called an "executable", but I never seen it called a "binary".

Quote:
And also, how does source code become binaries?
Compile.
If you want it to work correctly: Compile-debug-Compile-debug-Compile-debug-Compile-debug-Compile-debug-Compile-debug-Compile-debug-Compile-debug.....COMPILE!!....
 
Old 07-30-2008, 08:35 PM   #4
syntacticalerror
LQ Newbie
 
Registered: Jun 2008
Posts: 24

Original Poster
Rep: Reputation: 15
thx for prompt replies

I read somewhere that binaries require an algorithm so that the processor understand what the programs needs to do. If binaries, as you mention, is machine code and the processor interprets them, does that mean the processor contains the algorithms required? And if this is the case, and gcc is used to compile the src to binaries, does this mean gcc must compile the src into binaries specific to the processor being used?

thx again
 
Old 07-30-2008, 09:04 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
gcc must compile the src into binaries specific to the processor being used?
yes

There are algorithms in the src code. The kernel SW loads the binary intoi the processor and the processor runs them ione at a time.
You could save yourself a lot of qns if you read that wiki link I gave you, and also the links it points to. It'll be much quicker than posting qns and waiting for answers.
If you read something and don't understand it, try googling it. If you still don't understand, come back here.
Good luck
 
Old 07-30-2008, 09:47 PM   #6
syntacticalerror
LQ Newbie
 
Registered: Jun 2008
Posts: 24

Original Poster
Rep: Reputation: 15
thx again, i'll look into the subject from a comprehensive source.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux binaries for FreeSpace 2? MathBluster Linux - Games 0 08-07-2007 09:54 PM
Sims 2 for Linux (or at least binaries) darkflounder Linux - Games 17 01-20-2007 07:38 PM
Running FreeBSD binaries on Linux? koyi Linux - General 6 12-25-2004 10:16 PM
Running linux binaries on windows alitrix Linux - Software 2 09-13-2004 08:31 AM
Windows Quake2 CD and Linux Binaries Beav Linux - General 3 10-02-2002 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:03 AM.

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