This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: change a "const int" in an ELF file
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Torsten Mohr <tmohr at s dot netic dot de>
- Cc: binutils <binutils at sources dot redhat dot com>
- Date: Tue, 18 Feb 2003 13:54:59 +1030
- Subject: Re: change a "const int" in an ELF file
- References: <200302162057.47957.tmohr@s.netic.de>
On Sun, Feb 16, 2003 at 08:57:47PM +0100, Torsten Mohr wrote:
> With "v850-unknown-elf-readelf -s ELF-File | grep a_value" i can
> get the address of the value, but how can i access that address
> in the ELF-File?
If you look at either the ELF program headers or section headers,
you'll see file offsets, vmas and sizes. Your vma of interest
should be contained in one of the regions specified by vma and size.
>From that header, you can then calculate
file_offset = sec_or_seg_file_offset + vma - sec_or_seg_vma.
--
Alan Modra
IBM OzLabs - Linux Technology Centre