Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What is a relocatable code and how it is related with position independent code?

Status
Not open for further replies.

devendra_devgupta

Member level 3
Joined
Apr 8, 2007
Messages
54
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,632
Friends

Plz tell me what is relocatable code and how it is related with position independent code.


I have searched on net and understood most of the things but not able to make a clear picture of it because of the lack of suitable example.

Please tell me as i m very curious about it.
 

Re: Complex question!!

HI

A relocatable code is a code who can be placed any ware in the sysem memory map

In another word the linker can place the code where ever he wants

All the best

Bobi
 

Complex question!!

Hi bobi
Thanx, the thing which you have said is fine, but my exact question is why there is a need of relocatable code. and how it is drelated with position independent code.

If i want to write relocatable code what things i should consider.

Please understand my mind frame and reply

Thanx again
 

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
 

Complex question!!

Hi frank
Thankyou very much, Frank tell me one more thing i am cofused about, while writing modular software should we have to be concern about writing relocatable code or linker will do it easily.Does relocatability affects performance or any thing else of our code.
 

Complex question!!

HI

A relocatable code is a code who can be placed any
ware in the sysem memory map
In another word the linker can place the code where ever he wants
All the best
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top