This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to get symbol value?
- From: Nick Clifton <nickc at redhat dot com>
- To: Oleg Volf <ykvolf at yahoo dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 22 Jun 2009 10:24:41 +0100
- Subject: Re: How to get symbol value?
- References: <336363.97044.qm@web43514.mail.sp1.yahoo.com>
Hi Oleg,
I am porting linker for new target and want to create new relocation using value of absolute symbol.
What is the simplest way to get this symbol value?
Assuming that you have a pointer to the symbol's bfd_symbol structure
then you can get its value from the 'value' field. ie:
struct bfd_symbol * sym;
sym->value
Have a look in the source code for multiple examples of this.
Cheers
Nick