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]

How to lookup a symbol for vma using BFD?


Hi,

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

static const char myArray[] = { <some bytes> };

So, I need to find a symbol (myArray) using an address that lays
within its data.

I was trying to find any example or guess by learning bfd.h (and even
elf32-arm.c) but unsuccessfully.

Could you please advice how to implement this? Can I do it using bfd.h
only as the API or should I use other APIs?

P.S. the only method I see now is to iterate over symbols, find the
nearest lower vma (since asymbol does not contain size info). At the
same time DWAR2 or ELF info contains the size info and some attributes
I would like to know. But do not know how to retrieve it.

WBR,
Dmitry


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