This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What the linker file does?

Hello everyone.

I am new in programming and I am wondering what the linker file is used for and what It does? The programing environment I use is IAR embedded workbench. The only thing I know is that the linker file is used as a reference between the binary file and the libraries I have included in my source code. But how it works? Is the linker file created automatically by the compiler when I compile my source?  Thank you and excuse my poor English!

Parents
  • Hi Rikotech,

    I'm moving this to our ARM and Keil Tools group where development tools are discussed.

    You have 3 parts to make your piece of code work:

    - Pre-processor

    - Compiler

    - Linker

    The pre-processor handles stuff like macros (#define for instance)

    The compilo converts your different pieces of code (C, C++) into machine readable code (assembly, object files).

    The linker makes the different pieces of code talk together (shared functions, variables...) and decide on memory location (device memory mapping file is necessary for that) to put constants and code in ROM, allocate stack, variable spaces in RAM...

    The following article is long, but interesting for you:

Reply
  • Hi Rikotech,

    I'm moving this to our ARM and Keil Tools group where development tools are discussed.

    You have 3 parts to make your piece of code work:

    - Pre-processor

    - Compiler

    - Linker

    The pre-processor handles stuff like macros (#define for instance)

    The compilo converts your different pieces of code (C, C++) into machine readable code (assembly, object files).

    The linker makes the different pieces of code talk together (shared functions, variables...) and decide on memory location (device memory mapping file is necessary for that) to put constants and code in ROM, allocate stack, variable spaces in RAM...

    The following article is long, but interesting for you:

Children
No data