Ankit Jain wrote:
see inline
--- Sriharsha Vedurmudi
<sriharsha.v@xxxxxxxxxxxxxxxxxx> wrote:
Ankit Jain wrote:
<>hi
i want to know if this is correct? i am a bit confused
about linker...i am talking this topic when we havea
asm construct in our code.With GNU gcc this is how it happens generally (there
The compiler basically reads the .c program and
converts it into assembly code.Now during this it
neglects this assembler construct and leaves it for
assembler.Assembler is the person which basically
looks for this part of the code and changes it into
machine code.
are a lot of other tiny programs that aid the master at each stage
though)....(GURUs please correct me where ever I go wrong)
1. Your .c file is first Preprocessed and all Header Files and Macros are expanded so that the resultant C file is free from any headers or macros.
2. This expanded c file is then parsed by the compiler (front end) and converted to an RTL (an intermediate Language, NOT assembly).
3. This assembler (backend) is then invoked and it converts this RTL file into the Assembly file 4. This assembled file(s) is(are) passed to the Linker which tries to resolve all external references and generates the final object file.
Ofcourse, there are many more intermediate stages
like optimization etc., but the above is the broad category.
what about exe or final executable
The final object file is your exe or executable file.
_Harsha_
--
*****************************
* Sriharsha Vedurmudi
* Software Engineer
* * Redpine Signals Inc.
* Gate #395, Plot 87,88
* Sagar Society, Road #2, * Banjara Hills,
* Hyderabad - 500 034
* www.redpinesignals.com
*
* +91-40-23559911 (Office)
* +91-9849133133 (Mobile)
*****************************