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]

ELF addresses


I am trying to figure out how to determine the starting address for an elf file,
in accordance to the e_entry param in the header.
The e_entry will have the VMA, right?
I get something along the lines of 0x0804832c.


What is the base address of the ELF file? Is it 0x08040000 ?
How do I track this down and make it portable?

What I am trying to do is open the file in binary mode, go into the .text section and
fix up some instructions, then save the file, and execve() it with the new version.


When I read the file into a buffer, the buffer is obviously indexed starting at 0, so
I need to figure out how may bytes into the file the .text section starts, given the
value 0x0804832c.


Is there a neat interface to BFD that can take care of all of this for me?

--
Brian Blietz
bblietz@iastate.edu

"There are 10 types of people in the world...
Those who understand binary, and those who don't."


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