Link to home
Start Free TrialLog in
Avatar of ashfawad
ashfawad

asked on

logical address space

null
ASKER CERTIFIED SOLUTION
Avatar of braveheart
braveheart

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ashfawad
ashfawad

ASKER

I am confused about the way this book is using the terminology,
They say copile time and load time address binding result in logical and physical space being the same  then they turn around and say,
"...if it is anot knwn at compile time where the process will reside in memor, then the compiler must generate relocatable code. In this cae, final binding is delayed until load time..."

Well this implies theat the compile time and load time address binding are differeint. In compile time, the logical and physical sp address space  is the same. Where as at load-time the logical space is relocatable. . Which means at load time the logical addresses are mapped to
I am having hard ime adding comment to my questions. In the comment section the background is black. Must be something wrong with my system. I am just typing into this blindly. So excuse me if I make a lot of typos. I am trying not to.

Anyways,  I want to know which of the following statements are correct,


1)compile time and load time address binding result in an environment whre logical address space and physical address space are the same.
2) compile time address binding results in logical and physical address space eing the same.
3) load time address binding is relocatable. Which means The addrdss will be generated of the form (14 bytes from the base address) and whebn the module is actually loaded into into memory, then the logical address is mapped to the physical address. Which in my opinion resutlts in an environment where logical and physical address apaces are different from each other . This is as oppsed to what the book is saying

I ho



S
so please tell me which one of the above statement is correct. I am confused.

tahnks
I am confused about the way this book is using the terminology,
They say copile time and load time address binding result in logical and physical space being the same  then they turn around and say,
"...if it is anot knwn at compile time where the process will reside in memor, then the compiler must generate relocatable code. In this cae, final binding is delayed until load time..."

Well this implies theat the compile time and load time address binding are differeint. In compile time, the logical and physical sp address space  is the same. Where as at load-time the logical space is relocatable. . Which means at load time the logical addresses are mapped to
Not all compilers, linkers and loaders behave in the same way, or else they have their actions determined by command line options.

In firmware applications it may be important that code is not relocatable and that the physical and logical address space coincide.

For other applications, code should normally be relocatable.

Compilers usually generate relocatable code but don't have to.
Linkers typically combine relocatable code generated by compilers and may either bind the address then and there, but more usually let the code remain relocatable.
Loaders take linked code and bind the address at load time.

So addresses may be bound at compile, link or load time but once the addresses are bound, they can not be unbound (or else it is very difficult to do so).

Relocatable code means that the physical and logical address space are not the same until actually loaded into memory. In a multi-tasking environment, the physical address space may even vary between each timeslice in which it executes, although that is rare. However, there are no hard and fast rules - it is all a question of design.
Is there any thing as "run-time binding"? If there is then, is it different from "load-time" binding?

Thanks
Yes, run-time binding is used with dynamic linking with shared libraries. For instance, most flavours of UNIX make extensive use of shared libraries (.so's). If you are using X11, say, you link a program with libX11.so which is a shared library. The binding is only made at run time, so that if you were to run the same program on a different machine in the network, you might actually be using different versions of the X11 library.