This is the mail archive of the binutils@sourceware.org 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: How to lookup a symbol for vma using BFD?


Hi Dmitry,

I need to implement the following functionality:
Using an ELF file, I need to find the symbol (perhaps, not a
function!) for some vma.
Let's suppose I have an array defined as

Have a look at the file binutils/addr2line.c which implements something similar to what you want. Alternatively look at binutils/objdump.c and in particular the find_symbol_for_address() function which does pretty much exactly what you need.


Cheers
  Nick



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