This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Virtual address value in ELF file format...
- To: axp-list@redhat.com, "'glibc-linux@ricardo.ecn.wfu.edu'" <glibc-linux@ricardo.ecn.wfu.edu>
- Subject: Re: Virtual address value in ELF file format...
- From: Richard Henderson <rth@twiddle.net>
- Date: Fri, 28 May 1999 15:17:32 -0700
- References: <73F63B52E3A7D111B20900A0C96C0FD776EFFC@kh_exchange1>
- Reply-To: glibc-linux@ricardo.ecn.wfu.edu
On Thu, May 27, 1999 at 07:12:25PM +0900, Hyung Min SEO wrote:
> How can I set the p_vaddr value in some ELF file?
With a linker script laying out the sections.
> And how can I get the virtual address for any physical address?
You can't in general. What are you really asking?
> If I want the ELF file to load at physical address 0x416000, how can I get
> virtual address?
I presume you are tring to do MILO-ish sort of loading things?
In which case you know the mapping from virtual to physical in
that environment and arrange things appropriately.
There is a provision for setting separate virtual and physical
load points, but this is only useful for writing ROMs.
See http://www.cygnus.com/pubs/gnupro/5_ut/b_Usingld/ldLinker_scripts.html
for a good explanation of how to use linker scripts.
r~