Hi,
i am studying Bootstrap Loader in msp430. Can anyone tell me what is the function of a linker ??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
i am studying Bootstrap Loader in msp430. Can anyone tell me what is the function of a linker ??
Hi Ankit,
WIKI knows the answer: http://en.wikipedia.org/wiki/Linker_(computing)
Rgds
aBUGSworstnightmare
The linker links what the compiler compiles. :)Ankit Agarwal said:linker
The compiler generates relocatable code snippets from the different source files. Each source file is compiled independently and doesn't know of each other.
To allow cross-usage of resources, the compiler-generated code contains additional infomation like 'this function call goes to a function called 'x' that is not part of this object file'.
The linekr then collects all relocatable code (and data) snippets. It then starts at a known point (usually your main function, but it is a bit more complex) and lokks whether it has a code snippet of this name. Then it puts this code snipped into the available memory. next it looks whether this code snippets has any unresolved references (liek the external function 'x' mentioned above). If so, the functions and variables referenced in main() are placed into memory too and searched for unknown references. This continues until there are no more unknown references or a reference cannot be found in any of the object files or the available space is full. The latter two leading to an error.
Last step when everything is found and placed is that the linker will replace the 'unknown' function calls and data accesses in all the code snippets by the absolute addresses it has actually placed the code and data to.
Only then you got a running program.
Hi Jens ,
Thanks very much !! i was really looking for an easy answer,as i was confused ... thanks again !! :)
**Attention** This is a public forum