This is the mail archive of the binutils@sources.redhat.com 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: change a "const int" in an ELF file


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


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