LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux binaries (https://www.linuxquestions.org/questions/linux-newbie-8/linux-binaries-659173/)

syntacticalerror 07-30-2008 12:37 AM

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

chrism01 07-30-2008 06:38 AM

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

pixellany 07-30-2008 08:00 AM

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!!....;)

syntacticalerror 07-30-2008 08:35 PM

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

chrism01 07-30-2008 09:04 PM

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

syntacticalerror 07-30-2008 09:47 PM

thx again, i'll look into the subject from a comprehensive source.


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