This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
How to lookup a symbol for vma using BFD?
- From: "Dmitry Smirnov" <divis1969 at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 6 Aug 2008 19:12:39 +0400
- Subject: 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