- cross-platform development methodology, includes
- host system
- target embedded system
- connectivity solutions between host and target (Joint Test Action Group/Background Debug Module)
- development tools in the host environment are
- cross compiler
- linker
- source level debugger
- cross compiler
- tools in the target embedded system
- dynamic loader
- link loader
- debug agent
- journey from code to executable
- developer writes in C/C++ and assembly
- make-file is created, to automate the process of building/rebuilding on modification
- compiler and assembler produce object file containing both machine binary code and data in the target system
- linker take these object files, and produces either a executable or an object file, used to additional linking with other object fiies
- the linker command file (linker script) instructs linker on how to combine the object files and where to place the binary code and data in the target embedded system
- the main
- symbol table
- created by compiler and contains the symbol name to address mapping
- contains the global symbols defined in the file being compiled and the external symbols referenced in the file that the linker needs to resolve
- symbol resolution, part of linking process
- find where (in other object files) the external symbols are defined
- the statically linked library (in which the external symbols are defined) are copied to the final image
- find where (in other object files) the external symbols are defined
- symbol relocation, mapping a symbol reference to its defination
- done using a fix-up table or relocation table
- for fixing up references to addresses in other segments, as when multiple object files are linked together some addressed must be relocated
- because of the assumption of the assembler that each object file begins at address 0.
- done using a fix-up table or relocation table
- for an executable image, all external symbols must be resolved such that each symbol has an absolute memory address (exception to this rule is DLL)
- a relocatable object file is concatenation of multiple object files and is partially resolved, so that it can be linked with other object files at run-time
http://www.cs.princeton.edu/courses/archive/spr03/cs217/lectures/Linker.pdf