3
votes

What is the difference between image base address, virtual address and relative virtual address?

What I know is that the in the demand paging the CPU generates a virtual address which contains page number address and offset, from that we check page table and then map to the appropriate frame in main memory. We find the physical address by calculating: (frame no-1)* page size + offset.

But what I have read about physical executable (PE) file format is very different. What I found is that the virtual address = image base + relative virtual address offset

How are these two different? What exactly is image base address? What is the difference between image base address, virtual address and relative virtual address? When do we use image base address ?

1
what is PE file format ??AnshuMan Gupta
PE stands for Portable Executable format, which is default executable machine code file format for windows NT based platform. Read more about it from here en.wikipedia.org/wiki/Portable_Executableamaneureka

1 Answers

3
votes

In PE file format, Image base address is used for binary virtual address itself. The address where Image should be loaded in the environment.
Virtual address is defined for function/label (or symbol to be more specific) address.
Relative address is referenced to relative addressing from current context, which can be current parent symbol address or segment.