This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Reading an elf file with binutils
Awesome, thanks! The missing part turned out to be bfd_check_format.
Once I had that in, everything seems to work.
I have a follow-up question.. I'm using bfd_section::filepos to see
where in the file the section is, but the documentation says that it's
not valid for all backends and is not always updated. Is it fairly
reliable on average? Mostly I'll be using this code on ELF and Windows
PE executables...
Thanks for your help!
- Yan
On Thu, Aug 6, 2009 at 12:58 AM, Alan Modra <amodra@bigpond.net.au> wrote:
>
> On Thu, Aug 06, 2009 at 12:19:30AM -0700, Yan wrote:
> > Anyone want to help me figure this out? Is there something obvious I'm
> > missing?
>
> You need to do a lot more than just open the file. ?binutils comes
> with many examples of how to use BFD. ?strings.c, nm.c, objcopy.c, ...
>
> --
> Alan Modra
> Australia Development Lab, IBM