Re: Complex question!!
Hello,
the basic reason for relocation is modular software design. If you are using precompiled object or library modules, they have to be relocatable, cause the final address isn't known at compilation time.
Relocatable code means, it isn't executable yet, it has placeholders for absolute addresses that has to be replaced by the linker. Another example of relocatable code is PC *.exe file format. It is relocated before execution by a loader.
Position independant is a special case of code, that uses only relative addresses, thus nothing has to be relocated. It depends on the ability of used processor as well as on some information given from operation enviroment. DOS *.com files are basically position independant.
Regards,
Frank