Re: asm construct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ankit,

>i want to know if this is correct? i am a bit confused about linker...i am talking this topic when we have a asm construct in our code.

The linker takes all the bits-and-pieces of object code and concatenates them together in a format that is compatible with the machine architecture's loader.

>The compiler basically reads the .c program and converts it into assembly code.

From a very high level viewpoint, okay.

>Now during this it neglects this assembler construct and leaves it for assembler.

Not entirely accurate, but close enough.

>Assembler is the person which basically looks for this part of the code and changes it into machine code.

(humor)
Don't anthropomorphize computer programs.  They hate it when you do that.
(/humor)

Seriously, the assembler does not look for MERELY embedded assembler in your code to convert it into machine code. The assembler assembles ALL the assembly code (embedded or generated from the compiler) into object code.

Object code is more than just machine code. It's also data, bss, as well as the code, and it's in some particular object file format that's pertinent to the platform. It also has external references and external linkage for resolving later. It also has relocation information for fix-up by the loader (or pre-fixed-up by the linker). Often, it also has debug information.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux