This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ELF, Program Header, convert virtual addresses to physical addresses


Torsten Mohr <tmohr@s.netic.de> writes:

> > Evidently Green Hills doesn't use p_paddr at all.  Presumably for them
> > p_paddr is always the same as p_vaddr.
> 
> So isn't that a bug?  How can other tools like objcopy
> then convert such an ELF file?

I've never used the Green Hills toolchain.  They must have some way to
describe loading a program at one address and running it another.  I
don't know how they describe that in the ELF file.

> Isn't there a rule how to convert virtual addresses to
> physical addresses?

For the GNU toolchain, it's the rule you said: find the offset in the
segment from p_vaddr, and add that offset to p_paddr.

This is not something which the ELF standard spells out.  The p_paddr
field was put there for use on embedded systems without virtual
memory.  The ELF standard only explicitly describes usage on Unix
systems, for which p_paddr is meaningless.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]